* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow-y: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: 'Segoe UI', 'Comic Sans MS', 'Chalkboard SE', Arial, sans-serif;
  background: linear-gradient(180deg, #87CEEB 0%, #4FC3F7 40%, #29B6F6 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app {
  width: 100%;
  max-width: 500px;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  padding-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

#app::-webkit-scrollbar {
  width: 6px;
}
#app::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.4);
  border-radius: 3px;
}

a { text-decoration: none; }

h1, h2, h3 {
  color: #333;
  text-align: center;
  text-shadow: 2px 2px 0 rgba(255,255,255,0.5);
}

h1 { font-size: 36px; margin: 12px 0; }
h2 { font-size: 28px; margin: 10px 0; }
h3 { font-size: 22px; margin: 8px 0; }

p {
  font-size: 20px;
  color: #333;
  line-height: 1.4;
  text-align: center;
}

/* ===== BUTTONS ===== */
.btn-gross {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 40px;
  font-size: 26px;
  font-weight: bold;
  color: #FFF;
  background: #FF7043;
  border: 4px solid #333;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 6px 0 #BF360C, 0 8px 16px rgba(0,0,0,0.2);
  transition: all 0.05s linear;
  min-height: 64px;
  min-width: 200px;
  font-family: inherit;
  touch-action: manipulation;
}
.btn-gross:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 #BF360C, 0 4px 8px rgba(0,0,0,0.2);
}
.btn-gross:hover {
  background: #FF8A65;
}

.btn-sekundaer {
  background: #66BB6A;
  box-shadow: 0 6px 0 #2E7D32, 0 8px 16px rgba(0,0,0,0.2);
}
.btn-sekundaer:hover { background: #81C784; }

.btn-spiel {
  background: #42A5F5;
  box-shadow: 0 6px 0 #1565C0, 0 8px 16px rgba(0,0,0,0.2);
}
.btn-spiel:hover { background: #64B5F6; }

.btn-klein {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 18px;
  font-weight: bold;
  color: #FFF;
  background: #78909C;
  border: 3px solid #333;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 #37474F;
  transition: all 0.05s linear;
  min-height: 48px;
  font-family: inherit;
  touch-action: manipulation;
}
.btn-klein:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #37474F;
}

.btn-zurueck {
  background: #FFA726;
  box-shadow: 0 4px 0 #E65100;
  margin-top: 16px;
}
.btn-zurueck:active { box-shadow: none; }

/* ===== LOGIN ===== */
.seite-login {
  justify-content: center;
  overflow-y: auto;
  padding-top: 16px;
}
.seite-karte {
  max-width: 100% !important;
  max-height: 100dvh !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
.seite-karte .karte {
  padding-top: 2px;
}
.login-box {
  background: rgba(255,255,255,0.9);
  border: 5px solid #333;
  border-radius: 30px;
  padding: 30px 24px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.login-ship svg {
  width: 200px;
  height: auto;
}
.login-box h1 {
  font-size: 34px;
  color: #333;
  margin: 0;
}
.login-box .fehler {
  background: #FFCDD2;
  color: #C62828;
  padding: 10px 16px;
  border-radius: 12px;
  border: 3px solid #E53935;
  font-size: 18px;
  font-weight: bold;
  width: 100%;
  text-align: center;
}
.login-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.login-box input {
  padding: 14px 18px;
  font-size: 22px;
  border: 4px solid #333;
  border-radius: 16px;
  outline: none;
  font-family: inherit;
  background: #FFF;
  width: 100%;
}
.login-box input:focus {
  border-color: #42A5F5;
  box-shadow: 0 0 0 3px rgba(66,165,245,0.3);
}
.login-box .btn-gross {
  width: 100%;
}

/* ===== KARTE / MEER ===== */
.karte {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 12px;
  position: relative;
}
.karte-header {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 4px 8px;
  z-index: 5;
}
.karte-header > :first-child { flex: 0 0 auto; }
.karte-header > :last-child { flex: 0 0 auto; }
.header-titel {
  flex: 1;
  text-align: center;
  font-size: 24px;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  margin: 0;
}
.header-titel a {
  color: inherit;
  text-decoration: none;
}
.header-titel a:active {
  opacity: 0.5;
}
.kofi-link {
  font-size: 22px;
  line-height: 1;
  margin-right: 4px;
  text-decoration: none;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.2));
  transition: 0.1s;
}
.kofi-link:active {
  transform: scale(0.88);
}
.flagge-kopf-link {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.12);
  padding: 4px 14px 4px 8px;
  border-radius: 30px;
  text-decoration: none;
  transition: 0.1s;
  white-space: nowrap;
}
.flagge-kopf-link:active {
  transform: scale(0.92);
}
.flagge-kopf-link svg {
  width: 24px;
  height: 32px;
}
.flagge-kopf-link span {
  font-size: 20px;
  font-weight: bold;
  color: #FFD600;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.sound-btn {
  font-size: 28px;
  background: rgba(0,0,0,0.12);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.1s;
  touch-action: manipulation;
  font-family: inherit;
  line-height: 1;
}
.sound-btn:active {
  transform: scale(0.88);
  background: rgba(0,0,0,0.2);
}

/* ----- Meer (der Karten-Hintergrund) ----- */
.meer {
  flex: 1;
  width: 100%;
  border-radius: 24px;
  background: linear-gradient(180deg, #1A8BCF 0%, #29B6F6 40%, #4FC3F7 100%);
  border: 4px solid #333;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  box-shadow: inset 0 -8px 0 #0D5A8A;
}

/* Hintergrund-Schiff (fährt von links nach rechts) */
.bg-schiff {
  position: absolute;
  bottom: 24px;
  left: -120px;
  z-index: 1;
  opacity: 0.45;
  pointer-events: none;
  width: 90px;
  animation: bg-schiff-fahrt 16s linear infinite;
}
.bg-schiff svg {
  width: 100%;
  height: auto;
  display: block;
}
@keyframes bg-schiff-fahrt {
  0% { left: -120px; }
  100% { left: calc(100% + 40px); }
}
@media (max-width: 500px) {
  .bg-schiff { width: 65px; opacity: 0.4; animation-duration: 12s; }
  .meer { min-height: 0; }
}

/* Wellen-Animation */
.welle-bahn {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 30'%3E%3Cpath d='M0,15 Q25,0 50,15 Q75,30 100,15 Q125,0 150,15 Q175,30 200,15 L200,30 L0,30 Z' fill='rgba(255,255,255,0.25)'/%3E%3C/svg%3E") repeat-x;
  background-size: 200px 30px;
  animation: welle 3s linear infinite;
  z-index: 1;
  pointer-events: none;
}
.welle-bahn.w2 {
  bottom: 10px;
  opacity: 0.5;
  animation-duration: 4s;
  animation-direction: reverse;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20'%3E%3Cpath d='M0,10 Q25,0 50,10 Q75,20 100,10 Q125,0 150,10 Q175,20 200,10 L200,20 L0,20 Z' fill='rgba(255,255,255,0.2)'/%3E%3C/svg%3E");
  background-size: 200px 20px;
}
.welle-bahn.w3 {
  bottom: 20px;
  opacity: 0.3;
  animation-duration: 5s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 15'%3E%3Cpath d='M0,8 Q25,0 50,8 Q75,15 100,8 Q125,0 150,8 Q175,15 200,8 L200,15 L0,15 Z' fill='rgba(255,255,255,0.3)'/%3E%3C/svg%3E");
  background-size: 200px 15px;
}
@keyframes welle {
  0% { background-position-x: 0; }
  100% { background-position-x: -200px; }
}

/* ----- Inseln-Gitter (Diamant-Layout) ----- */
.meer-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 4px;
  align-items: center;
  justify-items: center;
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 4px;
}
.pos-krabben { grid-column: 1; grid-row: 1; }
.pos-papagei { grid-column: 2; grid-row: 1; }
.pos-wal { grid-column: 3; grid-row: 1; }
.schiff-mitte { grid-column: 2; grid-row: 2; }
.pos-anker { grid-column: 1; grid-row: 2; }
.pos-schaetze { grid-column: 3; grid-row: 2; }
.pos-crew { grid-column: 1; grid-row: 3; }
.pos-fische { grid-column: 2; grid-row: 3; }
.pos-schatz { grid-column: 3; grid-row: 3; }
.pos-boot { grid-column: 2; grid-row: 4; }
.pos-fluss { grid-column: 3; grid-row: 4; }

/* ----- Insel-Button (groß) ----- */
.insel-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  cursor: pointer;
  animation: insel-bob 3s ease-in-out infinite;
  transition: 0.05s linear;
  padding: 4px;
}
.insel-btn:active {
  transform: scale(0.92);
}
.insel-btn.pos-wal { animation-delay: 0.3s; }
.insel-btn.pos-crew { animation-delay: 0.6s; }
.insel-btn.pos-schatz { animation-delay: 0.9s; }
.insel-btn.pos-papagei { animation-delay: 0.15s; }
.insel-btn.pos-anker { animation-delay: 0.45s; }
.insel-btn.pos-schaetze { animation-delay: 0.75s; }
.insel-btn.pos-fische { animation-delay: 1.05s; }
.insel-btn.pos-boot { animation-delay: 1.2s; }
.insel-btn.pos-fluss { animation-delay: 1.35s; }
@keyframes insel-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.insel-btn-bild {
  width: 110px;
  height: 80px;
  border-radius: 16px;
  border: 4px solid #333;
  overflow: hidden;
  background: #FFF;
  box-shadow: 0 4px 0 #333, 0 6px 16px rgba(0,0,0,0.2);
  transition: 0.1s;
}
.insel-btn-bild svg {
  width: 100%;
  height: 100%;
  display: block;
}
.insel-btn-name {
  font-size: 14px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.5);
  text-align: center;
  white-space: nowrap;
}

/* ----- Schiff-Mitte ----- */
.btn-schiff {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.9);
  border: 4px solid #333;
  border-radius: 20px;
  padding: 8px 18px;
  box-shadow: 0 5px 0 #333, 0 8px 20px rgba(0,0,0,0.15);
  transition: 0.05s linear;
  cursor: pointer;
  animation: schiff-bob 2.5s ease-in-out infinite;
  text-decoration: none;
}
.btn-schiff:active {
  transform: translateY(5px);
  box-shadow: 0 0 0 #333, 0 4px 10px rgba(0,0,0,0.15);
}
@keyframes schiff-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.btn-schiff svg {
  width: var(--schiff-gr, 130px);
  height: auto;
  display: block;
  transition: width 0.5s ease;
  pointer-events: none;
}
.btn-schiff span {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-top: 4px;
  pointer-events: none;
}

/* ----- Hinkebein-Pirat ----- */
.hinkebein {
  position: absolute;
  bottom: 12px;
  left: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  cursor: pointer;
}
.hinkebein-figur {
  width: 50px;
  height: auto;
  animation: hinkebein-wackeln 2s ease-in-out infinite;
  transition: 0.1s;
}
.hinkebein-figur:active {
  transform: scale(0.9);
}
.hinkebein-figur svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
}
@keyframes hinkebein-wackeln {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  25% { transform: rotate(3deg) translateY(-2px); }
  75% { transform: rotate(-3deg) translateY(-1px); }
}
.hinkebein-spruch {
  background: #FFF;
  border: 3px solid #333;
  border-radius: 16px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  white-space: nowrap;
  position: relative;
  margin-bottom: 6px;
  box-shadow: 0 3px 0 #333, 0 4px 12px rgba(0,0,0,0.15);
  max-width: 220px;
  white-space: normal;
  text-align: center;
  display: none;
  animation: spruch-einblenden 0.3s ease;
}
.hinkebein-spruch::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #FFF;
  filter: drop-shadow(0 2px 0 #333);
}
.hinkebein-spruch.offen {
  display: block;
}
@keyframes spruch-einblenden {
  from { opacity: 0; transform: translateY(6px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 500px) {
  .hinkebein { bottom: 6px; left: 4px; }
  .hinkebein-figur { width: 38px; }
  .hinkebein-spruch { font-size: 12px; padding: 6px 10px; max-width: 160px; }
}

/* ----- Krokodil (läuft nach links zu Hinkebein) ----- */
.krokodil {
  position: absolute;
  bottom: 20px;
  width: 85px;
  height: auto;
  z-index: 9;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
  left: 0;
  transition: opacity 0.25s ease, transform 0.3s ease;
}
.krokodil svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
}
.krokodil.sichtbar {
  opacity: 1;
  pointer-events: auto;
}
.krokodil.laeuft {
  animation-name: krokodil-laufen-normal;
  animation-duration: var(--lauf-dauer, 8s);
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
.krokodil.laeuft svg {
  animation: krokodil-krabbeln 0.35s ease-in-out infinite;
}
.krokodil.verschwinden {
  opacity: 0;
  transform: scale(0.3);
  pointer-events: none;
  animation: none;
  transition: opacity 0.25s ease, transform 0.3s ease;
}
@keyframes krokodil-laufen-normal {
  0% { left: calc(100% - 100px); }
  100% { left: 95px; }
}
@keyframes krokodil-laufen-klein {
  0% { left: calc(100% - 65px); }
  100% { left: 78px; }
}
@keyframes krokodil-krabbeln {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(-2deg); }
}
.krokodil.fallt {
  animation: krokodil-fallen 0.5s ease-in forwards;
  pointer-events: none;
}
@keyframes krokodil-fallen {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(25px) scale(0.2); opacity: 0; }
}

/* Loch unter Krokodil */
.krokodil-loch {
  position: absolute;
  bottom: 18px;
  width: 80px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #0D1B2A 0%, #1a2a3a 60%, transparent 100%);
  z-index: 8;
  left: 85px;
  opacity: 0;
  transform: scaleY(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
  pointer-events: none;
}
.krokodil-loch.offen {
  opacity: 1;
  transform: scaleY(1);
}

@media (max-width: 500px) {
  .krokodil { width: 60px; bottom: 12px; }
  .krokodil.laeuft { animation-name: krokodil-laufen-klein; }
  .krokodil-loch { width: 55px; height: 8px; left: 68px; bottom: 10px; }
}

/* ----- Papageien (oben pupsend) ----- */
.papagei {
  position: absolute;
  top: -20px;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  transform: translateY(-10px);
  pointer-events: none;
}
.papagei.sichtbar {
  opacity: 1;
  transform: translateY(0);
}
.papagei-1 { left: 8%; }
.papagei-2 { left: 40%; }
.papagei-3 { right: 8%; }
.papagei-voegel {
  width: 32px;
  height: auto;
  animation: papagei-wippen 1s ease-in-out infinite;
}
.papagei-voegel svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(1px 1px 3px rgba(0,0,0,0.25));
}
@keyframes papagei-wippen {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(4deg); }
}
.papagei-pups {
  font-size: 22px;
  opacity: 0;
  transform: scale(0.3);
  transition: none;
  margin-top: -6px;
  position: relative;
  z-index: 1;
}
.papagei-pups.pups-aktiv {
  animation: pups-explosion 0.9s ease forwards;
}
@keyframes pups-explosion {
  0% { opacity: 0; transform: scale(0.3) translateY(0); }
  15% { opacity: 1; transform: scale(1.8) translateY(2px); }
  40% { opacity: 0.9; transform: scale(1.3) translateY(14px); }
  100% { opacity: 0; transform: scale(0.3) translateY(34px); }
}
.papagei-voegel.schub {
  animation: papagei-schub 0.9s ease;
}
@keyframes papagei-schub {
  0% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-10px) rotate(-6deg) scale(1.1); }
  50% { transform: translateY(-5px) rotate(4deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

@media (max-width: 500px) {
  .papagei-voegel { width: 24px; }
  .papagei-pups { font-size: 16px; }
}

/* ===== INSEL (Intro) ===== */
.insel-seite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 0;
}
.insel-bild svg {
  width: 100%;
  max-width: 340px;
  height: auto;
}
.insel-text {
  font-size: 22px;
  background: rgba(255,255,255,0.85);
  padding: 16px 20px;
  border-radius: 18px;
  border: 4px solid #333;
  max-width: 400px;
}

/* ===== SPIEL (generisch) ===== */
.spiel-seite {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
}
#spiel-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
#spiel-header h2 {
  font-size: 26px;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
#spiel-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
#spiel-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.hilfe-hinweis {
  background: #FFF9C4;
  border: 3px solid #F9A825;
  border-radius: 14px;
  padding: 8px 16px;
  font-size: 18px;
  font-weight: bold;
  color: #F57F17;
  animation: einblenden 0.3s ease;
}
@keyframes einblenden {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== KRABBEN-SPIEL ===== */
.krabben-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 12px;
}
.krabbe-hole {
  width: 110px;
  height: 110px;
  background: #A1887F;
  border: 5px solid #333;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 -6px 0 #6D4C41;
  transition: 0.1s;
}
.krabbe-hole:active {
  transform: scale(0.92);
}
.krabbe-tier {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: auftauchen 0.2s ease;
  cursor: pointer;
}
.krabbe-tier svg {
  width: 80px;
  height: 80px;
}
@keyframes auftauchen {
  from { transform: translateY(40px) scale(0.5); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.krabbe-verscheucht {
  animation: verscheuchen 0.2s ease forwards;
}
@keyframes verscheuchen {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}
.krabben-zaehler {
  font-size: 24px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.2);
  padding: 8px 20px;
  border-radius: 30px;
}

/* ===== WAL-SPIEL (Putzen) ===== */
.wal-spiel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.wal-bild {
  width: 100%;
  max-width: 420px;
  border: 4px solid #333;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 5px 0 #333, 0 8px 20px rgba(0,0,0,0.15);
}
.wal-bild svg {
  width: 100%;
  height: auto;
  display: block;
  background: #87CEEB;
  touch-action: none;
}
.wal-zaehler {
  font-size: 22px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.2);
  padding: 6px 20px;
  border-radius: 30px;
}
.wal-clean-bar {
  width: 100%;
  max-width: 320px;
  height: 24px;
  background: rgba(255,255,255,0.5);
  border: 4px solid #333;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
}
.wal-clean-fill {
  height: 100%;
  background: linear-gradient(90deg, #66BB6A, #FFD600);
  border-radius: 12px;
  transition: width 0.3s ease;
}

/* ===== FLUSS-SPIEL ===== */
.fluss-spiel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 460px;
}
.fluss-view {
  width: 100%;
  border: 4px solid #333;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 0 #333, 0 10px 24px rgba(0,0,0,0.16);
  background: #1E88E5;
}
.fluss-view svg {
  width: 100%;
  height: auto;
  display: block;
  background: linear-gradient(180deg, #1E88E5 0%, #29B6F6 100%);
  touch-action: none;
}
.fluss-zaehler {
  font-size: 22px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.25);
  padding: 8px 20px;
  border-radius: 30px;
}

/* ===== CREW-SPIEL ===== */
.crew-spiel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.crew-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}
.crew-ort {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: rgba(255,255,255,0.85);
  border: 4px solid #333;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 0 #333;
  transition: 0.05s linear;
  min-height: 80px;
}
.crew-ort .ort-icon { font-size: 36px; }
.crew-ort .ort-name { font-size: 14px; font-weight: bold; color: #333; }
.crew-ort:active {
  transform: translateY(4px);
  box-shadow: none;
}
.crew-ort.zaubern {
  animation: zaubern 0.6s ease infinite alternate;
}
@keyframes zaubern {
  from { transform: scale(1); box-shadow: 0 4px 0 #333; }
  to { transform: scale(1.06); box-shadow: 0 0 0 #FFD600, 0 0 20px #FFD600; border-color: #FFD600; }
}
.crew-hinweis {
  font-size: 22px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.2);
  padding: 8px 20px;
  border-radius: 30px;
}
.crew-zaehler {
  font-size: 20px;
  font-weight: bold;
  color: #FFF;
}

/* ===== SCHATZ-SPIEL (Memory) ===== */
.schatz-spiel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.schatz-status {
  font-size: 22px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.2);
  padding: 6px 20px;
  border-radius: 30px;
}
.schatz-schatz {
  font-size: 64px;
  animation: schatz-puls 0.8s ease infinite alternate;
}
@keyframes schatz-puls {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}
.memory-gitter {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  padding: 8px;
}
.memory-karte {
  aspect-ratio: 1;
  cursor: pointer;
  perspective: 600px;
  touch-action: manipulation;
}
.memory-innen {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}
.memory-karte.offen .memory-innen {
  transform: rotateY(180deg);
}
.memory-vorne, .memory-hinten {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  border: 4px solid #333;
  border-radius: 14px;
  backface-visibility: hidden;
}
.memory-vorne {
  background: linear-gradient(135deg, #FFD600, #FF9800);
  box-shadow: 0 4px 0 #E65100, 0 6px 12px rgba(0,0,0,0.15);
}
.memory-hinten {
  background: #FFF;
  transform: rotateY(180deg);
  box-shadow: 0 4px 0 #333, 0 6px 12px rgba(0,0,0,0.1);
}
.memory-karte.offen .memory-vorne {
  box-shadow: 0 2px 0 #E65100;
}
.memory-karte:active .memory-innen {
  transform: scale(0.92);
}
.memory-karte.offen:active .memory-innen {
  transform: rotateY(180deg) scale(0.92);
}

/* ===== PAPAGEI-SPIEL ===== */
.papagei-spiel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.papagei-gruppe {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.papagei-tier svg {
  width: 120px;
  height: auto;
}
.papagei-farben {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  justify-items: center;
}
.papagei-btn {
  width: 140px;
  height: 140px;
  border: 5px solid #333;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 5px 0 #333, 0 6px 12px rgba(0,0,0,0.15);
  transition: 0.05s linear;
  touch-action: manipulation;
}
.papagei-btn:active {
  transform: translateY(5px);
  box-shadow: none;
}
.papagei-btn.leuchtet {
  animation: p-leuchten 0.4s ease;
}
@keyframes p-leuchten {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.2); filter: brightness(1.6); box-shadow: 0 0 30px rgba(255,255,255,0.9); }
  100% { transform: scale(1); filter: brightness(1); }
}
.papagei-hinweis {
  font-size: 22px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.2);
  padding: 8px 20px;
  border-radius: 30px;
  text-align: center;
}

/* ===== SCHÄTZE-BUDDELN ===== */
.schaetze-spiel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.schaetze-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 340px;
}
.schaetze-huegel {
  width: 72px;
  height: 72px;
  background: #A1887F;
  border: 5px solid #333;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  cursor: pointer;
  box-shadow: 0 5px 0 #6D4C41, inset 0 -8px 0 #8D6E63;
  transition: 0.05s linear;
  touch-action: manipulation;
}
.schaetze-huegel:active {
  transform: translateY(5px);
  box-shadow: 0 0 0 #6D4C41, inset 0 -3px 0 #8D6E63;
}
.schaetze-huegel.aufgedeckt {
  box-shadow: 0 3px 0 #6D4C41;
  border-color: #FFD600;
  background: #FFE082;
}
.schaetze-zaehler {
  font-size: 22px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.2);
  padding: 6px 20px;
  border-radius: 30px;
}

/* ===== ANKER-SPIEL ===== */
.anker-spiel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}
#anker-svg {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: block;
  border: 4px solid #333;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 5px 0 #333, 0 8px 20px rgba(0,0,0,0.15);
}
.anker-tipp-btn {
  width: 280px;
  height: 90px;
  font-size: 36px;
  font-weight: bold;
  color: #FFF;
  background: #8D6E63;
  border: 5px solid #333;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0 6px 0 #4E342E, 0 8px 20px rgba(0,0,0,0.2);
  transition: 0.03s linear;
  font-family: inherit;
  touch-action: manipulation;
}
.anker-tipp-btn:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 #4E342E, 0 4px 10px rgba(0,0,0,0.15);
}
.anker-zaehler {
  font-size: 18px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.anker-progress {
  width: 100%;
  max-width: 300px;
  height: 14px;
  background: rgba(255,255,255,0.4);
  border: 4px solid #333;
  border-radius: 14px;
  overflow: hidden;
}
.anker-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FFA726, #FF7043);
  border-radius: 10px;
  transition: width 0.15s ease;
}


/* ===== FISCHE-FÜTTERN ===== */
.fische-spiel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.fische-container {
  width: 100%;
  max-width: 360px;
  position: relative;
  background: linear-gradient(180deg, #87CEEB, #4FC3F7);
  border: 4px solid #333;
  border-radius: 18px;
  overflow: hidden;
  height: 260px;
}
.fische-gross-fisch {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 120px;
  height: 80px;
  pointer-events: none;
  z-index: 2;
  transform-origin: center center;
  transition: transform 0.3s ease;
}
.fische-gross-fisch svg {
  width: 100%;
  height: 100%;
}
.fische-klein {
  position: absolute;
  width: 50px;
  height: 30px;
  cursor: pointer;
  transition: none;
  z-index: 1;
  animation: fisch-schwimmen 0.5s ease;
}
.fische-klein svg {
  width: 100%;
  height: 100%;
}
.fische-klein.gefuettert {
  animation: fisch-weg 0.4s ease forwards;
}
@keyframes fisch-weg {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.3) translate(60px, 0); opacity: 0; }
}
@keyframes fisch-schwimmen {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.fische-zaehler {
  font-size: 22px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.2);
  padding: 6px 20px;
  border-radius: 30px;
}

/* ===== BOOTSRENNEN ===== */
.boot-spiel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.boot-progress {
  width: 100%;
  max-width: 320px;
  height: 16px;
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 2px solid #333;
}
.boot-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #66BB6A, #FFD600);
  border-radius: 8px;
  transition: width 0.2s;
}
.boot-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: #333;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
.boot-view {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  background: #42A5F5;
  border: 4px solid #333;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}
.boot-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.boot-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}
.boot-btn {
  flex: 1;
  font-size: 32px;
  padding: 12px;
  background: rgba(255,255,255,0.25);
  border: 3px solid #333;
  border-radius: 16px;
  cursor: pointer;
  transition: 0.05s linear;
  touch-action: manipulation;
}
.boot-btn:active {
  transform: scale(0.9);
  background: rgba(255,255,255,0.5);
}
.boot-status {
  flex: 2;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  padding: 8px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== FLUSS-ÜBERQUERUNG (Frogger) ===== */
.fluss-spiel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.fluss-view {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 12 / 11;
  background: #1a8bcf;
  border: 4px solid #333;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
}
.fluss-view svg {
  width: 100%;
  height: 100%;
  display: block;
  background: #29B6F6;
}
.fluss-zaehler {
  font-size: 22px;
  font-weight: bold;
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.2);
  padding: 6px 20px;
  border-radius: 30px;
}

/* ===== GEWONNEN ===== */
.gewonnen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  animation: einblenden 0.5s ease;
}
.gewonnen h2 {
  font-size: 36px;
  color: #FFD600;
  text-shadow: 3px 3px 0 #333, 0 0 20px rgba(255,214,0,0.5);
}
.sterne-regen {
  font-size: 40px;
  animation: sterne-fall 1s ease infinite;
}
@keyframes sterne-fall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: translateY(10px) rotate(180deg); opacity: 0; }
}

/* ===== FLAGGE ===== */
.flagge-seite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 8px));
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.flagge-seite h2 {
  color: #FFF;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.flagge-sterne-reihe {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}
.sterne-anzahl {
  font-size: 28px;
  font-weight: bold;
  color: #FFD600;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
  background: rgba(0,0,0,0.15);
  padding: 6px 24px;
  border-radius: 30px;
}
.btn-fertig {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 28px;
  font-weight: bold;
  color: #FFF;
  background: #66BB6A;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
  padding: 6px 20px;
  border: 4px solid #333;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 0 #2E7D32, 0 4px 8px rgba(0,0,0,0.15);
  transition: 0.05s linear;
  font-family: inherit;
  text-decoration: none;
  touch-action: manipulation;
  white-space: nowrap;
}
.btn-fertig:active {
  transform: translateY(4px);
  box-shadow: none;
}
.flagge-vorschau {
  width: 100%;
  max-width: 420px;
}
.flagge-vorschau svg {
  width: 100%;
  height: auto;
  background: rgba(255,255,255,0.5);
  border: 4px solid #333;
  border-radius: 18px;
  padding: 8px;
}
.farben-muster-reihe {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}
.farben-wahl, .muster-wahl {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.85);
  border: 4px solid #333;
  border-radius: 18px;
  padding: 12px;
}
.flagge-aktionen {
  display: flex;
  flex-direction: row;
  gap: 10px;
  width: 100%;
  max-width: 420px;
}
.btn-klein {
  flex: 1;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  background: rgba(255,255,255,0.85);
  border: 3px solid #333;
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
  transition: 0.1s;
}
.btn-klein:active {
  transform: scale(0.95);
  background: #FFF;
}
.farben-wahl p, .muster-wahl p {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
}
.farben-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.farb-btn {
  width: 36px;
  height: 36px;
  border: 3px solid #333;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.1s;
  touch-action: manipulation;
}
.farb-btn.aktiv {
  border-color: #FFD600;
  box-shadow: 0 0 0 2px #FFD600, 0 0 12px rgba(255,214,0,0.5);
  transform: scale(1.1);
}
.farb-btn:active { transform: scale(0.9); }

.muster-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.muster-btn {
  padding: 6px 10px;
  font-size: 14px;
  font-weight: bold;
  font-family: inherit;
  color: #333;
  background: #FFF;
  border: 4px solid #333;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.1s;
  touch-action: manipulation;
}
.muster-btn.aktiv {
  background: #FFD600;
  border-color: #333;
}
.muster-btn:active { transform: scale(0.92); }

/* ===== RESPONSIVE ===== */

/* Smartphone: Inseln vertikal statt Diamant-Raster */
@media (max-width: 500px) {
  .meer-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 8px;
    width: 100%;
  }

  .pos-krabben, .pos-wal, .pos-papagei, .pos-anker,
  .pos-schaetze, .pos-crew, .pos-fische, .pos-schatz, .pos-boot, .pos-fluss,
  .schiff-mitte {
    grid-column: auto;
    grid-row: auto;
  }

  .schiff-mitte {
    align-self: center;
    margin-top: 6px;
    order: 99;
  }
  .btn-schiff {
    flex-direction: row;
    gap: 8px;
    padding: 4px 14px;
    animation: none;
    border-width: 3px;
    border-radius: 14px;
  }
  .btn-schiff svg { width: 36px; }
  .btn-schiff span { font-size: 13px; margin-top: 0; }

  .insel-punkt { width: 100%; }
  .insel-btn {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    background: rgba(255,255,255,0.9);
    border: 3px solid #333;
    border-radius: 12px;
    animation: none;
  }
  .insel-btn:active { transform: scale(0.97); }
  .insel-btn-bild {
    width: 44px;
    height: 32px;
    flex-shrink: 0;
    border-width: 2px;
    border-radius: 8px;
    box-shadow: 0 2px 0 #333, 0 3px 8px rgba(0,0,0,0.15);
  }
  .insel-btn-name {
    font-size: 13px;
    text-align: left;
    white-space: normal;
    color: #333;
    text-shadow: none;
    line-height: 1.2;
  }
}

@media (max-width: 400px) {
  #app { padding: 8px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .btn-gross { font-size: 22px; padding: 14px 28px; min-width: 160px; }
  .krabbe-hole { width: 85px; height: 85px; }
  .krabbe-tier svg { width: 60px; height: 60px; }
  .krabben-grid { gap: 8px; padding: 6px; }
  .memory-gitter { gap: 6px; padding: 4px; max-width: 280px; }
  .memory-vorne, .memory-hinten { font-size: 28px; border-width: 3px; }

  .login-box { padding: 16px; gap: 12px; }
  .login-box h1 { font-size: 28px; }
  .login-ship svg { width: 140px; }
  .login-box input { font-size: 18px; padding: 12px 14px; }
  .login-box .btn-gross { font-size: 20px; padding: 12px 20px; min-height: 52px; }

  .karte-header h2 { font-size: 18px; }
  .kofi-link { font-size: 18px; }
  .flagge-kopf-link { padding: 2px 10px 2px 6px; }
  .flagge-kopf-link svg { width: 18px; height: 24px; }
  .flagge-kopf-link span { font-size: 16px; }
  .insel-btn-bild { width: 38px; height: 28px; }
  .insel-btn-name { font-size: 12px; }
  .btn-schiff svg { width: 30px; }
  .btn-schiff { padding: 3px 10px; }
  .btn-schiff span { font-size: 11px; }
  .meer-grid { gap: 4px; padding: 6px; }
  .meer { min-height: 280px; }
  .schaetze-huegel { width: 60px; height: 60px; font-size: 24px; }
  .papagei-btn { width: 100px; height: 100px; }
  .anker-tipp-btn { width: 200px; height: 70px; font-size: 28px; }
  .fische-container { height: 200px; }

  .flagge-seite { padding: 10px 12px 12px; }
  .btn-fertig { font-size: 22px; padding: 4px 14px; }
}

@media (max-width: 350px) {
  .login-box { padding: 12px; }
  .login-ship svg { width: 110px; }
  .login-box input { font-size: 16px; padding: 10px 12px; }
  .login-box .btn-gross { font-size: 18px; padding: 10px 16px; min-height: 46px; min-width: 130px; }
}
