/* =========================================================
   Türkçe Macera – Kinder-App
   Ägäis-Karte: tiefes Meer, Sandinseln, Tulpenrot, Gold
   ========================================================= */
:root {
  --sea-deep: #0B4F7C;
  --sea: #1A7FB8;
  --sea-light: #5EC3E8;
  --foam: #EAF7FB;
  --sand: #F7D79B;
  --sand-dark: #E1B465;
  --lale: #E23E6B;
  --lale-dark: #A9234A;
  --gold: #FFC233;
  --gold-dark: #CF8F00;
  --olive: #3A9A5A;
  --olive-dark: #24713F;
  --coral: #F2603A;
  --coral-dark: #B83C1B;
  --ink: #16324A;
  --muted: #5D7489;
  --card: #FFFFFF;
  --line: #D6E7EF;
  --soft: #F3FAFD;
  --night-text: #fff;

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-pill: 999px;
  --tabs-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --display: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, sans-serif;
}

/* Farbwelten (im Laden freischaltbar) */
.theme-lale      { --sea-deep: #8C1D52; --sea: #C8457F; --sea-light: #F39BC3; --foam: #FDF0F6; }
.theme-gunbatimi { --sea-deep: #5B2A86; --sea: #D9622B; --sea-light: #F7A55C; --foam: #FFF4EA; }
.theme-orman     { --sea-deep: #134E3A; --sea: #2F8F62; --sea-light: #8FD3A8; --foam: #EEF8F1; }
.theme-gece      { --sea-deep: #0D1240; --sea: #28307A; --sea-light: #6E7BE0; --foam: #E9ECFB; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  overflow-x: hidden;
  font-family: var(--body);
  color: var(--ink);
  background: var(--foam);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: .2px;
  padding: 12px 22px; border-radius: 16px; min-height: 52px;
  background: var(--sea); color: #fff; box-shadow: 0 5px 0 var(--sea-deep);
  transition: transform .08s, box-shadow .08s, filter .15s; text-decoration: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--sea-deep); }
.btn-primary { background: var(--lale); box-shadow: 0 5px 0 var(--lale-dark); }
.btn-primary:active { box-shadow: 0 1px 0 var(--lale-dark); }
.btn-gold { background: var(--gold); color: #5A3B00; box-shadow: 0 5px 0 var(--gold-dark); }
.btn-gold:active { box-shadow: 0 1px 0 var(--gold-dark); }
.btn-ok { background: var(--olive); box-shadow: 0 5px 0 var(--olive-dark); }
.btn-ok:active { box-shadow: 0 1px 0 var(--olive-dark); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); }
.btn-ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn-big { width: 100%; font-size: 21px; min-height: 58px; }
.btn[disabled] { filter: grayscale(.9) opacity(.55); pointer-events: none; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; min-height: 100dvh; background: linear-gradient(180deg, var(--sea-deep), var(--sea) 60%, var(--sea-light)); display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-sea { position: absolute; inset: 0; pointer-events: none; }
.login-island { position: absolute; font-size: 120px; right: -10px; top: 6%; opacity: .9; filter: drop-shadow(0 10px 0 rgba(0,0,0,.12)); }
.login-boat { position: absolute; font-size: 64px; left: 8%; bottom: 120px; animation: bob 3s ease-in-out infinite; }
.login-waves { position: absolute; bottom: 0; left: 0; width: 100%; height: 110px; fill: var(--foam); opacity: .95; }
.login-box { position: relative; width: 100%; max-width: 400px; background: #fff; border-radius: var(--r-xl); padding: 28px 24px 26px; box-shadow: 0 10px 0 rgba(0,0,0,.12); }
.login-title { font-size: 42px; color: var(--sea-deep); text-align: center; }
.login-sub { text-align: center; color: var(--muted); margin: 4px 0 18px; font-weight: 700; }
.login-form label { display: block; font-weight: 800; font-size: 15px; margin: 12px 0 6px; }
.login-form input[type=text], .login-form input:not([type]), .login-form input[type=password] {
  width: 100%; font: inherit; font-size: 19px; padding: 14px 16px; border-radius: var(--r-md);
  border: 3px solid var(--line); background: var(--soft); color: var(--ink);
}
.login-form input:focus { outline: none; border-color: var(--sea); background: #fff; }
.login-remember { display: flex !important; align-items: center; gap: 10px; font-weight: 700 !important; margin: 16px 0 18px !important; }
.login-remember input { width: 22px; height: 22px; accent-color: var(--lale); }
.login-error { background: #FFE8EE; color: #8A1538; border-radius: var(--r-md); padding: 10px 14px; font-weight: 700; margin: 0 0 8px; }

/* ---------- App-Rahmen ---------- */
.shell {
  min-height: 100vh; min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "top" "main";
  padding-bottom: calc(var(--tabs-h) + var(--safe-b));
}
.topbar {
  grid-area: top; position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: var(--sea-deep); color: #fff;
}
.me-chip { display: flex; align-items: center; gap: 10px; color: #fff; text-align: left; min-width: 0; flex: 1 1 auto; padding: 2px; border-radius: 16px; }
.me-avatar { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: var(--sand); box-shadow: inset 0 -4px 0 var(--sand-dark); }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-name { font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-level { font-size: 13px; opacity: .9; white-space: nowrap; }
.me-level b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--gold); color: #5A3B00; font-size: 12px; }
.xpbar { display: block; width: 100%; max-width: 110px; min-width: 56px; height: 8px; border-radius: 6px; background: rgba(255,255,255,.2); margin-top: 4px; overflow: hidden; }
.xpbar span { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 6px; transition: width .6s ease; }
.stats { display: flex; gap: 6px; flex-shrink: 0; }
.stat { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: var(--r-pill); background: rgba(255,255,255,.13); font-family: var(--display); font-weight: 800; font-size: 17px; }
.stat-ico { font-size: 17px; }
.stat.bump { animation: bump .5s ease; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--tabs-h) + var(--safe-b)); padding: 6px 6px calc(6px + var(--safe-b));
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 2px solid var(--line);
}
.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 14px; position: relative; color: var(--muted); }
.tabs button span { font-size: 26px; line-height: 1; transition: transform .15s; }
.tabs button em { font-style: normal; font-size: 11.5px; font-weight: 800; }
.tabs button.active { background: var(--foam); color: var(--sea-deep); }
.tabs button.active span { transform: translateY(-2px) scale(1.12); }
.tabs .tab-me { display: none; }
.tabs .dot { position: absolute; top: 6px; right: calc(50% - 22px); width: 12px; height: 12px; border-radius: 50%; background: var(--lale); border: 2px solid #fff; }

.view { grid-area: main; padding: 16px 16px 24px; outline: none; min-width: 0; }
.side { display: none; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50vh; font-weight: 800; color: var(--muted); }
.spin { display: inline-block; font-size: 28px; animation: bob 1.4s ease-in-out infinite; }

.card { background: var(--card); border-radius: var(--r-lg); padding: 18px; box-shadow: 0 4px 0 var(--line); }
.card + .card { margin-top: 14px; }
.section-title { font-size: 26px; margin: 4px 0 4px; }
.section-sub { color: var(--muted); margin: 0 0 16px; font-weight: 600; }
.muted { color: var(--muted); }

/* ---------- Tagesziel ---------- */
.goal { display: flex; align-items: center; gap: 14px; }
.ring { --p: 0; width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--olive) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.ring::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #fff; }
.ring b { position: relative; z-index: 1; font-size: 24px; }
.goal h3 { font-size: 19px; }
.goal p { margin: 2px 0 0; font-size: 14px; color: var(--muted); font-weight: 700; }
.goal.done .ring { background: var(--olive); }

.family { margin-top: 14px; }
.family h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.bar { height: 14px; border-radius: 10px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.bar > span { display: block; height: 100%; width: 0; border-radius: 10px; background: linear-gradient(90deg, var(--gold), #FF9F1C); transition: width .8s ease; }
.family small { color: var(--muted); font-weight: 700; }

/* ---------- Die Karte ---------- */
.map-head { display: grid; gap: 14px; margin-bottom: 14px; }
.map {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255,255,255,.18), transparent 55%),
    linear-gradient(180deg, var(--sea-light) 0%, var(--sea) 35%, var(--sea-deep) 100%);
  min-height: 400px; padding: 10px 0 40px;
}
.map::before { /* Wellenmuster */
  content: ''; position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background-image: radial-gradient(circle at 10px 10px, transparent 9px, #fff 10px, transparent 11px);
  background-size: 44px 26px;
}
.theme-gece .map::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .7;
  background-image: radial-gradient(1.5px 1.5px at 20% 12%, #fff, transparent), radial-gradient(1px 1px at 70% 30%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 45% 60%, #fff, transparent), radial-gradient(1px 1px at 85% 80%, #fff, transparent), radial-gradient(1px 1px at 12% 85%, #fff, transparent);
}
.map svg.route { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map svg.route path { fill: none; stroke: rgba(255,255,255,.75); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 14; }
.map svg.route path.done { stroke: var(--gold); stroke-dasharray: none; stroke-width: 6; opacity: .9; }
.isle {
  position: absolute; width: 132px; margin-left: -66px; display: flex; flex-direction: column; align-items: center;
  text-align: center; color: #fff; z-index: 2;
}
.isle-btn {
  width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; font-size: 50px; position: relative;
  background: var(--isle, var(--sand)); box-shadow: 0 8px 0 rgba(0,0,0,.18), inset 0 -10px 0 rgba(0,0,0,.08), 0 0 0 7px rgba(255,255,255,.22);
  transition: transform .15s;
}
.isle-btn:active { transform: scale(.95); }
.isle.locked .isle-btn { filter: grayscale(1) brightness(.9); font-size: 40px; }
.isle.locked .isle-btn::after { content: '🔒'; position: absolute; font-size: 30px; right: -4px; bottom: -4px; filter: none; }
.isle.complete .isle-btn::after { content: '🚩'; position: absolute; font-size: 30px; right: -2px; top: -8px; }
.isle.current .isle-btn { box-shadow: 0 8px 0 rgba(0,0,0,.18), inset 0 -10px 0 rgba(0,0,0,.08), 0 0 0 7px var(--gold); animation: pulse 2.2s ease-in-out infinite; }
.isle-name { margin-top: 12px; font-family: var(--display); font-weight: 800; font-size: 16px; line-height: 1.05; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.isle-tr { font-size: 12.5px; font-weight: 700; opacity: .85; }
.isle-stars { margin-top: 4px; font-size: 12px; background: rgba(0,0,0,.25); border-radius: var(--r-pill); padding: 2px 8px; font-weight: 800; }
.boat { position: absolute; font-size: 44px; z-index: 3; margin: -24px 0 0 -22px; animation: bob 2.6s ease-in-out infinite; transition: left 1.2s ease, top 1.2s ease; pointer-events: none; filter: drop-shadow(0 4px 0 rgba(0,0,0,.2)); }
.map-end { position: absolute; left: 50%; transform: translateX(-50%); color: #fff; font-weight: 800; text-align: center; opacity: .85; width: 80%; }

/* ---------- Insel-Blatt (Lektionen) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(8,30,48,.55); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet { background: var(--foam); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 0 0 calc(20px + var(--safe-b)); animation: up .28s cubic-bezier(.2,.9,.3,1.2); }
.sheet-head { position: relative; padding: 22px 20px 18px; color: #fff; background: linear-gradient(160deg, var(--sea), var(--sea-deep)); border-radius: var(--r-xl) var(--r-xl) 0 0; display: flex; gap: 14px; align-items: center; }
.sheet-emoji { width: 76px; height: 76px; flex: 0 0 76px; border-radius: 50%; display: grid; place-items: center; font-size: 42px; background: var(--isle, var(--sand)); box-shadow: inset 0 -6px 0 rgba(0,0,0,.1); }
.sheet-head h2 { font-size: 27px; }
.sheet-head p { margin: 2px 0 0; opacity: .9; font-weight: 700; }
.sheet-close { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 20px; }
.sheet-body { padding: 18px 18px 0; }
.sheet-progress { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; color: var(--muted); }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r-lg); background: #fff; box-shadow: 0 4px 0 var(--line); width: 100%; text-align: left; }
.step-ico { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--soft); border: 3px solid var(--line); }
.step-main { flex: 1; min-width: 0; }
.step-main b { display: block; font-family: var(--display); font-size: 19px; line-height: 1.1; }
.step-main small { color: var(--muted); font-weight: 700; font-size: 13.5px; }
.step-stars { font-size: 18px; letter-spacing: -2px; white-space: nowrap; }
.step.next { box-shadow: 0 4px 0 var(--lale-dark); background: var(--lale); color: #fff; }
.step.next small { color: rgba(255,255,255,.9); }
.step.next .step-ico { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }
.step.locked { opacity: .55; pointer-events: none; box-shadow: none; background: transparent; border: 2px dashed var(--line); }
.step.blitz .step-ico { background: #FFF5D6; border-color: var(--gold); }
.step.exam .step-ico { background: #FFE3EB; border-color: var(--lale); }
.step.passed .step-ico { background: #E5F6EA; border-color: var(--olive); }

/* ---------- Lern-Spieler (Vollbild) ---------- */
.player { position: fixed; inset: 0; z-index: 50; background: var(--foam); display: flex; flex-direction: column; padding: calc(12px + var(--safe-t)) 16px calc(12px + var(--safe-b)); }
.pl-top { display: flex; align-items: center; gap: 12px; max-width: 720px; width: 100%; margin: 0 auto; }
.pl-close { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: #fff; box-shadow: 0 3px 0 var(--line); font-size: 20px; color: var(--muted); }
.pl-bar { flex: 1; height: 18px; border-radius: 12px; background: var(--line); overflow: hidden; }
.pl-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--olive), #63C483); border-radius: 12px; transition: width .4s ease; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); }
.pl-kind { font-family: var(--display); font-weight: 800; color: var(--muted); font-size: 15px; white-space: nowrap; }
.pl-timer { height: 6px; border-radius: 4px; background: var(--line); max-width: 720px; width: 100%; margin: 10px auto 0; overflow: hidden; }
.pl-timer span { display: block; height: 100%; width: 100%; background: var(--gold); transform-origin: left; }
.pl-stage { flex: 1; display: flex; flex-direction: column; max-width: 720px; width: 100%; margin: 0 auto; padding: 18px 0 0; min-height: 0; overflow-y: auto; }
.q-label { font-family: var(--display); font-weight: 800; font-size: 21px; margin: 0 0 14px; }
.q-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 18px 12px; background: #fff; border-radius: var(--r-xl); box-shadow: 0 5px 0 var(--line); margin-bottom: 18px; position: relative; }
.q-emoji { font-size: 76px; line-height: 1; }
.q-word { font-family: var(--display); font-weight: 800; font-size: 40px; line-height: 1.05; color: var(--sea-deep); word-break: break-word; }
.q-de { font-weight: 800; font-size: 22px; color: var(--ink); }
.q-hint { font-size: 14px; color: var(--muted); font-weight: 700; background: var(--soft); border-radius: 10px; padding: 4px 10px; }
.speak { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; background: var(--sea); color: #fff; font-size: 26px; box-shadow: 0 4px 0 var(--sea-deep); }
.speak:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--sea-deep); }
.speak.big { width: 120px; height: 120px; font-size: 54px; box-shadow: 0 7px 0 var(--sea-deep); }
.speak.playing { animation: ping .8s ease; }
.speak.slow { width: 46px; height: 46px; font-size: 20px; background: #fff; color: var(--sea); box-shadow: 0 3px 0 var(--line); border: 2px solid var(--line); }
.speak-row { display: flex; gap: 12px; align-items: center; }

/* Lernkarte */
.flash { padding: 26px 16px; }
.flash .q-word { font-size: 46px; }
.flash-arrow { color: var(--muted); font-size: 22px; }
.new-tag { position: absolute; top: 12px; left: 12px; background: var(--gold); color: #5A3B00; font-weight: 800; font-size: 13px; padding: 3px 10px; border-radius: var(--r-pill); }

/* Antworten */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opts.one { grid-template-columns: 1fr; }
.opt {
  min-height: 72px; padding: 12px; border-radius: var(--r-lg); background: #fff; border: 3px solid var(--line);
  box-shadow: 0 5px 0 var(--line); font-weight: 800; font-size: 19px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; line-height: 1.2;
  transition: transform .08s;
}
.opt .oe { font-size: 34px; line-height: 1; }
.opt.tr { font-family: var(--display); font-size: 22px; color: var(--sea-deep); }
.opt:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line); }
.opt.sel { border-color: var(--sea); background: #E6F4FB; box-shadow: 0 5px 0 var(--sea); }
.opt.right { border-color: var(--olive); background: #E5F6EA; box-shadow: 0 5px 0 var(--olive); animation: pop .35s ease; }
.opt.wrong { border-color: var(--coral); background: #FFEDE6; box-shadow: 0 5px 0 var(--coral); animation: shake .4s ease; }
.opt.dim { opacity: .45; }
.opts.locked .opt { pointer-events: none; }

/* Paare finden */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.match .opt { min-height: 64px; font-size: 18px; }
.match .opt.done { visibility: hidden; }

/* Puzzle & Tippen */
.answer-line { min-height: 66px; border-radius: var(--r-lg); background: #fff; border: 3px dashed var(--line); padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-bottom: 16px; }
.tiles { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; }
.tile { min-width: 48px; height: 52px; padding: 0 12px; border-radius: 12px; background: #fff; border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); font-family: var(--display); font-weight: 800; font-size: 24px; color: var(--sea-deep); }
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.tile.used { visibility: hidden; }
.tile.in { background: #E6F4FB; border-color: var(--sea); box-shadow: 0 4px 0 var(--sea); }
.type-input { width: 100%; font-family: var(--display); font-weight: 800; font-size: 28px; text-align: center; padding: 14px; border-radius: var(--r-lg); border: 3px solid var(--line); background: #fff; color: var(--sea-deep); }
.type-input:focus { outline: none; border-color: var(--sea); }
.chars { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0 4px; }
.chars button { width: 48px; height: 48px; border-radius: 12px; background: #fff; border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--sea-deep); }

.pl-foot { max-width: 720px; width: 100%; margin: 14px auto 0; }

/* Rückmeldung */
.feedback { position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; padding: 18px 18px calc(18px + var(--safe-b)); border-radius: var(--r-xl) var(--r-xl) 0 0; animation: up .25s cubic-bezier(.2,.9,.3,1.2); }
.feedback .in { max-width: 720px; margin: 0 auto; display: grid; gap: 12px; }
.feedback h3 { font-size: 28px; }
.feedback h3 small { display: block; font-family: var(--body); font-size: 16px; font-weight: 800; opacity: .85; margin-top: 2px; }
.feedback p { margin: 0; font-weight: 700; font-size: 17px; }
.feedback .sol { font-family: var(--display); font-size: 26px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feedback.good { background: #DDF4E4; color: var(--olive-dark); }
.feedback.bad { background: #FFE4DB; color: var(--coral-dark); }
.feedback.bad .btn { background: var(--coral); box-shadow: 0 5px 0 var(--coral-dark); }
.feedback.good .btn { background: var(--olive); box-shadow: 0 5px 0 var(--olive-dark); }

/* Start- und Ergebnisbildschirm */
.splash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 10px 0 20px; }
.splash .big-emoji { font-size: 104px; line-height: 1; animation: bob 3s ease-in-out infinite; }
.splash h2 { font-size: 34px; color: var(--sea-deep); }
.splash p { margin: 0; color: var(--muted); font-weight: 700; font-size: 18px; max-width: 420px; }
.result-stars { font-size: 64px; display: flex; gap: 6px; }
.result-stars span { display: inline-block; animation: starIn .5s ease backwards; }
.result-stars span:nth-child(2) { animation-delay: .25s; }
.result-stars span:nth-child(3) { animation-delay: .5s; }
.result-stars .off { filter: grayscale(1) opacity(.3); }
.gains { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.gain { background: #fff; border-radius: var(--r-lg); padding: 10px 16px; box-shadow: 0 4px 0 var(--line); text-align: center; min-width: 96px; }
.gain b { display: block; font-family: var(--display); font-size: 28px; line-height: 1; }
.gain small { color: var(--muted); font-weight: 800; }
.gain.xp b { color: var(--sea); }
.gain.coins b { color: var(--gold-dark); }
.gain.words b { color: var(--olive); }
.score-big { font-family: var(--display); font-weight: 800; font-size: 64px; line-height: 1; }
.score-big.pass { color: var(--olive); }
.score-big.fail { color: var(--coral); }

/* ---------- Popups (Level, Abzeichen, Geld) ---------- */
.pop-wrap { position: fixed; inset: 0; z-index: 80; background: rgba(8,30,48,.6); display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.pop { background: #fff; border-radius: var(--r-xl); padding: 28px 22px 22px; width: 100%; max-width: 380px; text-align: center; animation: zoom .4s cubic-bezier(.2,1.4,.4,1); }
.pop .pe { font-size: 96px; line-height: 1; margin-bottom: 8px; }
.pop h2 { font-size: 30px; color: var(--sea-deep); }
.pop p { color: var(--muted); font-weight: 700; margin: 6px 0 18px; font-size: 17px; }
.pop .amount { font-family: var(--display); font-weight: 800; font-size: 48px; color: var(--olive); }
.pop.gold { background: linear-gradient(180deg, #FFF6D8, #fff 60%); }

/* ---------- Listen, Laden, Belohnungen ---------- */
.seg { display: flex; gap: 6px; background: #fff; padding: 5px; border-radius: var(--r-pill); box-shadow: 0 3px 0 var(--line); margin-bottom: 16px; overflow-x: auto; }
.seg button { flex: 1; padding: 9px 12px; border-radius: var(--r-pill); font-weight: 800; white-space: nowrap; color: var(--muted); }
.seg button.on { background: var(--sea); color: #fff; }
.grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.item { background: #fff; border-radius: var(--r-lg); padding: 14px 10px 12px; box-shadow: 0 4px 0 var(--line); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 3px solid transparent; }
.item .ie { font-size: 54px; line-height: 1.1; }
.item .in { font-weight: 800; font-size: 14px; line-height: 1.2; min-height: 34px; }
.item .btn { min-height: 40px; font-size: 16px; padding: 6px 12px; width: 100%; box-shadow: 0 4px 0 var(--sea-deep); }
.item.equipped { border-color: var(--olive); }
.item .tag { font-size: 13px; font-weight: 800; color: var(--olive); }
.price { font-family: var(--display); font-weight: 800; }

.reward { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: var(--r-lg); padding: 14px; box-shadow: 0 4px 0 var(--line); }
.reward + .reward { margin-top: 12px; }
.reward .re { font-size: 44px; width: 64px; height: 64px; flex: 0 0 64px; border-radius: 18px; background: var(--soft); display: grid; place-items: center; }
.reward .rm { flex: 1; min-width: 0; }
.reward .rm b { display: block; font-size: 17px; line-height: 1.2; }
.reward .bar { height: 10px; margin: 8px 0 2px; }
.reward .btn { min-height: 46px; font-size: 16px; padding: 8px 14px; }
.reqs { list-style: none; margin: 0; padding: 0; }
.reqs li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.reqs li:last-child { border: 0; }
.reqs .st { margin-left: auto; font-size: 13px; padding: 3px 10px; border-radius: var(--r-pill); white-space: nowrap; }
.st.pending { background: #FFF5D6; color: #8A5A00; }
.st.approved { background: #E5F6EA; color: var(--olive-dark); }
.st.rejected { background: #FFE4DB; color: var(--coral-dark); }

.treasury { background: linear-gradient(160deg, #FFF3C9, #FFE08A); border-radius: var(--r-xl); padding: 20px; box-shadow: 0 5px 0 var(--gold-dark); margin-bottom: 18px; }
.treasury .amt { font-family: var(--display); font-weight: 800; font-size: 46px; color: #5A3B00; line-height: 1; }
.treasury h3 { font-size: 20px; color: #5A3B00; }
.treasury ul { margin: 12px 0 14px; padding: 0; list-style: none; display: grid; gap: 6px; }
.treasury li { display: flex; gap: 10px; align-items: center; font-weight: 700; color: #5A3B00; }
.treasury li b { margin-left: auto; font-family: var(--display); }

/* Rangliste */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 10px 0 20px; }
.pod { display: flex; flex-direction: column; align-items: center; width: 33%; max-width: 150px; }
.pod .pa { font-size: 50px; line-height: 1; margin-bottom: 6px; }
.pod .pn { font-weight: 800; font-size: 15px; text-align: center; }
.pod .pb { width: 100%; border-radius: 16px 16px 0 0; display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 800; font-size: 30px; margin-top: 6px; }
.pod.p1 .pb { height: 120px; background: var(--gold); color: #5A3B00; }
.pod.p2 .pb { height: 86px; background: #B8C7D3; color: var(--ink); }
.pod.p3 .pb { height: 64px; background: #E0A27A; }
.pod .ps { font-weight: 800; color: var(--sea); font-size: 14px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border-radius: var(--r-lg); box-shadow: 0 4px 0 var(--line); }
.rank-row + .rank-row { margin-top: 10px; }
.rank-row.me { box-shadow: 0 4px 0 var(--sea); border: 3px solid var(--sea); }
.rank-row .rn { font-family: var(--display); font-weight: 800; font-size: 22px; width: 28px; color: var(--muted); }
.rank-row .ra { font-size: 36px; }
.rank-row .rm { flex: 1; }
.rank-row .rm b { display: block; }
.rank-row .rm small { color: var(--muted); font-weight: 700; }
.rank-row .rs { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--sea); }

/* Profil */
.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-head .big-av { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 60px; background: var(--sand); box-shadow: inset 0 -7px 0 var(--sand-dark), 0 0 0 6px #fff; flex: 0 0 96px; }
.profile-head h2 { font-size: 30px; }
.profile-head p { margin: 2px 0 0; font-weight: 700; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi { background: #fff; border-radius: var(--r-lg); padding: 12px 14px; box-shadow: 0 4px 0 var(--line); }
.kpi b { display: block; font-family: var(--display); font-size: 30px; line-height: 1; color: var(--sea-deep); }
.kpi small { color: var(--muted); font-weight: 800; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.badge { text-align: center; background: #fff; border-radius: var(--r-lg); padding: 12px 6px 10px; box-shadow: 0 4px 0 var(--line); }
.badge .be { font-size: 40px; line-height: 1.1; }
.badge b { display: block; font-size: 13.5px; line-height: 1.1; margin-top: 4px; }
.badge small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 700; line-height: 1.2; margin-top: 2px; }
.badge.off .be { filter: grayscale(1) opacity(.35); }
.badge.off b { color: var(--muted); }
.days { display: flex; align-items: flex-end; gap: 5px; height: 110px; padding-top: 8px; }
.days div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.days i { display: block; width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: var(--sea-light); min-height: 4px; }
.days i.hit { background: var(--olive); }
.days small { font-size: 10.5px; font-weight: 800; color: var(--muted); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-weight: 800; }
.switch { width: 58px; height: 34px; border-radius: 20px; background: var(--line); position: relative; transition: background .2s; flex: 0 0 58px; }
.switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.switch.on { background: var(--olive); }
.switch.on::after { transform: translateX(24px); }

.empty { text-align: center; padding: 30px 10px; }
.empty .ee { font-size: 72px; }
.empty h3 { font-size: 24px; margin-top: 6px; }
.empty p { color: var(--muted); font-weight: 700; }

.closed { text-align: center; padding: 40px 16px; }
.closed .ee { font-size: 90px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 18px + var(--safe-b)); transform: translateX(-50%); z-index: 90; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-pill); font-weight: 800; max-width: 90vw; text-align: center; animation: up .25s ease; }
body.playing .toast { top: calc(76px + var(--safe-t)); bottom: auto; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }

/* ---------- Animationen ---------- */
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes zoom { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes ping { 0% { box-shadow: 0 4px 0 var(--sea-deep), 0 0 0 0 rgba(26,127,184,.5); } 100% { box-shadow: 0 4px 0 var(--sea-deep), 0 0 0 22px rgba(26,127,184,0); } }
@keyframes starIn { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Kleine Handys ---------- */
@media (max-width: 480px) {
  .topbar { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .stats { gap: 4px; }
  .stat { padding: 5px 8px; font-size: 15px; gap: 3px; }
  .stat-ico { font-size: 15px; }
  .me-avatar { width: 42px; height: 42px; flex-basis: 42px; font-size: 26px; }
  .me-name { font-size: 17px; }
}
@media (max-width: 380px) {
  .me-level span { display: none; }
  .q-word { font-size: 34px; }
  .opt { font-size: 17px; min-height: 66px; }
  .isle { width: 116px; margin-left: -58px; }
  .isle-btn { width: 90px; height: 90px; font-size: 44px; }
}

/* ---------- Tablet / Desktop ---------- */
@media (min-width: 900px) {
  :root { --tabs-h: 0px; }
  .shell {
    grid-template-columns: 230px minmax(0, 1fr) 320px;
    grid-template-rows: auto 1fr;
    grid-template-areas: "top top top" "nav main side";
    padding-bottom: 0;
    max-width: 1440px; margin: 0 auto;
  }
  .topbar { padding: 14px 28px; border-radius: 0 0 var(--r-xl) var(--r-xl); }
  .xpbar { max-width: 180px; width: 180px; }
  .tabs {
    grid-area: nav; position: sticky; top: 92px; align-self: start; height: auto;
    display: flex; flex-direction: column; gap: 6px; padding: 20px 14px; background: transparent; border: 0;
  }
  .tabs button { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 12px 14px; font-size: 17px; }
  .tabs button em { font-size: 17px; }
  .tabs button span { font-size: 26px; }
  .tabs button.active { background: #fff; box-shadow: 0 4px 0 var(--line); }
  .tabs button.active span { transform: scale(1.1); }
  .tabs .tab-me { display: flex; }
  .tabs .dot { top: 12px; right: 12px; }
  .view { padding: 24px 12px 40px; }
  .side { display: block; grid-area: side; padding: 24px 24px 40px 12px; position: sticky; top: 92px; align-self: start; }
  .side .card + .card { margin-top: 14px; }
  .map-head { display: none; }
  .map { min-height: 560px; }
  .isle { width: 160px; margin-left: -80px; }
  .isle-btn { width: 122px; height: 122px; font-size: 60px; }
  .isle-name { font-size: 18px; }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: var(--r-xl); max-height: 84vh; }
  .player { padding: 24px 24px 28px; }
  .q-word { font-size: 52px; }
  .q-emoji { font-size: 96px; }
  .opt { min-height: 84px; font-size: 21px; }
  .feedback { left: 50%; right: auto; width: 720px; transform: translateX(-50%); bottom: 24px; border-radius: var(--r-xl); animation: fade .2s ease; }
  .toast { bottom: 28px; }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .mini-rank .rank-row { padding: 8px 10px; }
  .mini-rank .ra { font-size: 28px; }
}
@media (min-width: 900px) and (max-width: 1180px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr) 280px; }
}
