/* Das Geheimnis von Blubbi — Nachtgarten-Stil */
@font-face { font-family: 'Kurale'; src: url(fonts/kurale-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: 'Kurale'; src: url(fonts/kurale-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; font-display: swap; }
@font-face { font-family: 'Kurale'; src: url(fonts/kurale-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 400; src: url(fonts/nunito-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 400; src: url(fonts/nunito-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF; font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 400; src: url(fonts/nunito-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 700; src: url(fonts/nunito-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 700; src: url(fonts/nunito-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF; font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 700; src: url(fonts/nunito-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 800; src: url(fonts/nunito-cyrillic-800-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: 'Nunito'; font-weight: 800; src: url(fonts/nunito-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; font-display: swap; }
@font-face { font-family: 'Caveat'; font-weight: 700; src: url(fonts/caveat-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap; }
@font-face { font-family: 'Caveat'; font-weight: 700; src: url(fonts/caveat-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+2113, U+2C60-2C7F, U+A720-A7FF; font-display: swap; }
@font-face { font-family: 'Caveat'; font-weight: 700; src: url(fonts/caveat-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; font-display: swap; }

:root {
  --night: #161d2e;
  --night-2: #1f2940;
  --night-3: #2b3754;
  --paper: #f7eedb;
  --paper-2: #efe1c3;
  --ink: #3b2f24;
  --ink-soft: #6b5a48;
  --gold: #e3aa3e;
  --gold-2: #f6cf74;
  --rust: #b8582d;
  --moss: #6f8a4c;
  --plum: #7d5b8c;
  --shadow: #3d3f55;
  --ok: #5c9a4e;
  --bad: #c0493a;
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--night);
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(227,170,62,.18), transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(125,91,140,.25), transparent 45%),
    linear-gradient(180deg, #1a2236 0%, #121827 100%);
  background-attachment: fixed;
  color: var(--paper);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
}
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ── Kopfleiste ── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px calc(10px) 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(18, 24, 39, .88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(227,170,62,.25);
}
.top .brand { font-family: 'Kurale', serif; font-size: 19px; color: var(--gold-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--night-3); color: var(--paper);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 5px 10px; font-size: 15px; font-weight: 700;
  min-height: 36px;
}
.chip svg { width: 18px; height: 18px; }
.chip.scales { color: var(--gold-2); }
button.chip:active { transform: scale(.96); }

main { max-width: 560px; margin: 0 auto; padding: 16px 16px 140px; }

/* ── Szenen & Figuren ── */
.feed > * { animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.scene { margin: 6px 0 18px; border-radius: var(--radius); overflow: hidden; box-shadow: 0 12px 30px rgba(0,0,0,.45); border: 3px solid var(--paper-2); background: var(--paper-2); }
.scene img { width: 100%; height: auto; }
.scene.portrait { width: 62%; margin: 6px auto 18px; border-radius: 50%; border-color: var(--gold); }

.say { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; }
.ava { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid var(--gold); box-shadow: 0 4px 12px rgba(0,0,0,.4); background: var(--paper-2); }
.bubble {
  position: relative; background: var(--paper); color: var(--ink);
  border-radius: 4px var(--radius) var(--radius) var(--radius);
  padding: 10px 14px 12px; flex: 1; box-shadow: 0 6px 16px rgba(0,0,0,.35);
}
.bubble .name { display: block; font-family: 'Kurale', serif; color: var(--rust); font-size: 15px; margin-bottom: 2px; }
.bubble p { margin: 0; }
.say.dark .ava { border-color: #8d8fb0; filter: saturate(.8); }
.say.dark .bubble { background: #2a2c40; color: #e6e4f5; border: 1px solid #55577a; }
.say.dark .bubble .name { color: #b9b7de; }
.say.dark { animation: rise .45s ease both, shiver 2.8s ease-in-out infinite; }
@keyframes shiver { 0%,100% { transform: translateX(0); } 48% { transform: translateX(0); } 50% { transform: translateX(-1.5px); } 52% { transform: translateX(1.5px); } 54% { transform: translateX(0); } }

.uk { display: block; font-size: .86em; opacity: .78; font-style: italic; margin-top: 4px; }
.bubble .uk { color: #5c4f43; }
.say.dark .bubble .uk { color: #b6b4cf; }

.narr { font-style: italic; color: #d9d2c0; margin: 4px 4px 18px; padding-left: 14px; border-left: 3px solid rgba(227,170,62,.55); }
.narr .uk { color: #b8b1a0; }

.note {
  font-family: 'Caveat', cursive; font-weight: 700; font-size: 25px; line-height: 1.25;
  background: #fbf3df;
  background-image: repeating-linear-gradient(180deg, transparent 0 31px, rgba(90,120,170,.18) 31px 32px);
  color: #2e2a4a; padding: 16px 18px; margin: 0 0 18px; border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,.4); transform: rotate(-.6deg); white-space: pre-line;
}
.note .uk { font-family: 'Nunito', sans-serif; font-weight: 400; font-size: 15px; color: #6a5d74; white-space: pre-line; margin-top: 10px; }
.note.uk-only { font-family: 'Nunito', sans-serif; font-weight: 400; font-size: 16px; line-height: 1.45; transform: none; background: #e9eef8; background-image: none; color: #2b3450; }
.note.uk-only::before { content: '🇺🇦 '; }

.task {
  background: linear-gradient(135deg, #3a4a2f, #2e3d2a); color: #f2f6e7;
  border: 2px dashed rgba(200,230,150,.55); border-radius: var(--radius);
  padding: 12px 14px; margin: 0 0 18px; font-weight: 700;
}
.task .lbl { display: block; font-family: 'Kurale', serif; font-weight: 400; color: #cfe6a6; font-size: 15px; margin-bottom: 2px; }
.task .uk { font-weight: 400; color: #dbe6c6; }

/* Beweis-Karten */
.evi { display: flex; gap: 12px; background: var(--paper); color: var(--ink); border-radius: 12px; padding: 12px; margin: 0 0 14px; box-shadow: 0 6px 16px rgba(0,0,0,.35); border-left: 6px solid var(--gold); }
.evi .ic { width: 48px; height: 48px; flex: none; border-radius: 10px; background: var(--paper-2); display: grid; place-items: center; }
.evi .ic svg { width: 34px; height: 34px; }
.evi h4 { margin: 0 0 2px; font-family: 'Kurale', serif; font-weight: 400; font-size: 18px; color: var(--rust); }
.evi p { margin: 0; font-size: 15px; }
.evi .uk { font-size: 14px; }
.evi.new { border-left-color: var(--rust); }
.evi .badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; background: var(--rust); color: white; border-radius: 6px; padding: 1px 6px; margin-bottom: 4px; }

.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.suspect { background: var(--paper); color: var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.suspect img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.suspect div { padding: 8px 10px 10px; font-size: 13.5px; line-height: 1.35; }
.suspect b { display: block; font-family: 'Kurale', serif; font-weight: 400; color: var(--rust); font-size: 15px; margin-bottom: 2px; }
.suspect .uk { font-size: 12.5px; }

.code { display: flex; justify-content: center; gap: 12px; margin: 4px 0 20px; }
.code span { width: 64px; height: 80px; border-radius: 12px; display: grid; place-items: center; font-family: 'Kurale', serif; font-size: 44px; background: var(--night-3); border: 2px solid rgba(255,255,255,.15); color: rgba(255,255,255,.25); }
.code span.on { background: linear-gradient(160deg, var(--gold-2), var(--gold)); color: #3b2508; border-color: #fff3cf; box-shadow: 0 0 22px rgba(246,207,116,.55); }

.emblem { display: grid; place-items: center; margin: 4px 0 18px; }
.emblem .disc { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, var(--gold-2), var(--gold) 60%, #b27a1f); box-shadow: 0 0 40px rgba(227,170,62,.45), inset 0 -6px 12px rgba(0,0,0,.25); border: 4px solid #fff0c4; }
.emblem .disc svg { width: 86px; height: 86px; }
.emblem h2 { font-family: 'Kurale', serif; font-weight: 400; color: var(--gold-2); margin: 12px 0 0; font-size: 28px; text-align: center; }

/* ── Karten & Eingabe ── */
.card { background: var(--paper); color: var(--ink); border-radius: var(--radius); padding: 16px; box-shadow: 0 10px 26px rgba(0,0,0,.45); margin: 8px 0 18px; }
.card h3 { margin: 0 0 10px; font-family: 'Kurale', serif; font-weight: 400; font-size: 21px; color: var(--ink); line-height: 1.3; }
.card h3 .uk { font-family: 'Nunito', sans-serif; font-size: 15px; color: var(--ink-soft); }
.row { display: flex; gap: 8px; }
input.answer {
  flex: 1; min-width: 0; font: inherit; font-size: 22px; font-weight: 800; letter-spacing: .04em;
  padding: 12px 14px; border-radius: 12px; border: 2px solid #c9b48c; background: #fffaf0; color: var(--ink);
  text-transform: uppercase;
}
input.answer:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(227,170,62,.25); }
.btn {
  border: none; border-radius: 14px; padding: 14px 18px; font-weight: 800; font-size: 18px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #3b2508;
  box-shadow: 0 4px 0 #a36f1d, 0 8px 18px rgba(0,0,0,.3);
  min-height: 52px;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #a36f1d; }
.btn:disabled { opacity: .5; }
.btn.alt { background: var(--night-3); color: var(--paper); box-shadow: 0 4px 0 #111827; border: 1px solid rgba(255,255,255,.15); }
.btn.green { background: linear-gradient(180deg, #8fc56e, #5f9a45); color: #10230a; box-shadow: 0 4px 0 #3e6a2c; }
.btn.block { width: 100%; }
.choices { display: grid; gap: 8px; }
.choices button { text-align: left; background: #fffaf0; border: 2px solid #d9c49b; border-radius: 12px; padding: 12px 14px; font-weight: 700; color: var(--ink); min-height: 52px; }
.choices button .uk { font-weight: 400; }
.choices button:active { background: #fbe9bf; }
.choices button.wrong { border-color: var(--bad); background: #f7dcd6; }
.feedback { min-height: 26px; margin: 10px 2px 0; font-weight: 700; }
.feedback.bad { color: var(--bad); }
.shake { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }

.hints { margin-top: 14px; border-top: 1px dashed #cdb993; padding-top: 12px; }
.hint { background: #fff4d6; border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; font-size: 16px; }
.hint b { color: var(--rust); }
.hintbtn { background: none; border: 2px solid #d9b25a; color: #8a5a10; border-radius: 12px; padding: 8px 12px; font-weight: 800; font-size: 15px; width: 100%; min-height: 44px; }
.hintbtn:disabled { border-color: #d8ccb2; color: #a7967a; }

.tools { display: flex; gap: 8px; margin: 12px 0 0; flex-wrap: wrap; }

/* Uhren */
.clocks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 14px; }
.clock { background: #fffaf0; border-radius: 12px; padding: 8px 6px 6px; text-align: center; border: 2px solid #d9c49b; }
.clock svg { width: 100%; height: auto; }
.clock b { display: inline-block; margin-top: 4px; font-family: 'Kurale', serif; font-weight: 400; font-size: 26px; color: var(--rust); line-height: 1; }
.frag { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 10px; margin: 0 0 12px; }
.frag h4 { margin: 0 0 8px 4px; font-family: 'Kurale', serif; font-weight: 400; color: var(--rust); }
.frag .clocks { grid-template-columns: 1fr 1fr; margin: 0; }

/* Scan */
.scanbox { background: var(--night-2); border: 2px dashed rgba(227,170,62,.5); border-radius: var(--radius); padding: 16px; margin: 6px 0 18px; text-align: center; }
.scanbox p { margin: 0 0 12px; color: #e4dcc8; }
.scanbox .row { margin-top: 12px; }
.scanbox input.answer { font-size: 20px; text-align: center; }
.progress { font-weight: 800; color: var(--gold-2); margin: 0 0 12px; }

/* Untere Weiter-Leiste */
.next {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(18,24,39,0), rgba(18,24,39,.95) 35%);
}
.next .btn { display: block; width: 100%; max-width: 528px; margin: 0 auto; }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8,10,18,.94); display: flex; flex-direction: column; }
.overlay .bar { display: flex; gap: 8px; padding: 12px; padding-top: max(12px, env(safe-area-inset-top)); align-items: center; }
.overlay .bar b { flex: 1; font-family: 'Kurale', serif; font-weight: 400; color: var(--gold-2); font-size: 20px; }
.overlay .body { flex: 1; overflow: auto; padding: 0 16px 24px; }
.cam { position: relative; flex: 1; overflow: hidden; background: #000; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam.mirror video { transform: scaleX(-1); }
.cam .frame { position: absolute; inset: 18% 12%; border: 4px solid rgba(246,207,116,.9); border-radius: 22px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); pointer-events: none; }
.cam.mirror .frame { display: none; }
.cam .msg { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: white; font-weight: 700; text-shadow: 0 2px 6px black; padding: 0 20px; }

.toast { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 60; background: var(--paper); color: var(--ink); padding: 12px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); font-weight: 700; max-width: calc(100% - 32px); width: max-content; animation: rise .3s ease both; border-left: 6px solid var(--gold); }
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--ok); }

/* Start */
.hero h1 { font-family: 'Kurale', serif; font-weight: 400; color: var(--gold-2); font-size: 34px; line-height: 1.1; margin: 8px 0 4px; text-align: center; text-shadow: 0 3px 12px rgba(0,0,0,.5); }
.hero .sub { text-align: center; color: #d9d2c0; margin: 0 0 20px; }
.langs { display: grid; gap: 10px; }

.center { text-align: center; }
.muted { color: #b8b1a0; font-size: 15px; }
.big { font-family: 'Kurale', serif; font-size: 30px; color: var(--gold-2); text-align: center; margin: 10px 0; }
.big .uk { font-family: 'Nunito', sans-serif; font-size: 18px; color: #d9d2c0; }

.bar-p { height: 12px; background: var(--night-3); border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.bar-p i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 999px; transition: width .6s; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.stat { background: var(--night-2); border-radius: 14px; padding: 12px; text-align: center; border: 1px solid rgba(255,255,255,.1); }
.stat b { display: block; font-size: 30px; color: var(--gold-2); font-family: 'Kurale', serif; font-weight: 400; }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

h2.sec { font-family: 'Kurale', serif; font-weight: 400; color: var(--gold-2); font-size: 22px; margin: 18px 0 10px; }
