/* ============ AGames – Konsolen-Look (hell, glänzend, verspielt) ============ */
:root {
  --bg: #e7eaed;
  --stripe: #edf0f2;
  --ink: #4b5057;
  --ink2: #8a9097;
  --ink3: #b3b8bd;
  --white: #ffffff;
  --tile: #f7f8f9;
  --line: #cfd4d9;
  --line2: #dfe3e7;
  --accent: #29a8e0;
  --accent2: #6fd0f6;
  --accent-d: #1386bd;
  --red: #ff4f5e; --orange: #ff9f1c; --yellow: #ffc61a; --green: #2fc56a; --teal: #1fc2b6; --blue: #2d8cff; --indigo: #5e5ce6; --purple: #a259f7; --pink: #ff5aa5;
  --r-xl: 30px; --r-lg: 22px; --r-md: 16px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow: 0 2px 0 rgba(255, 255, 255, .9) inset, 0 10px 24px -12px rgba(40, 50, 60, .35), 0 2px 4px rgba(40, 50, 60, .12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font); font-weight: 700; color: var(--ink); -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background: repeating-linear-gradient(0deg, var(--bg) 0 2px, var(--stripe) 2px 4px);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.hidden { display: none !important; }
.spacer { flex: 1; }
.ic { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Typo ---------- */
.eyebrow { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--ink2); }
.h1 { font-size: clamp(32px, 4vw, 60px); font-weight: 900; line-height: 1.05; margin: 0; color: var(--ink); }
.h2 { font-size: clamp(24px, 2.4vw, 38px); font-weight: 900; line-height: 1.1; margin: 0; }
.h3 { font-size: 20px; font-weight: 800; margin: 0; }
.sub { color: var(--ink2); font-size: 18px; line-height: 1.45; margin: 0; }
.accent-text { color: var(--accent); }
.title-pair { font-weight: 900; }
.title-pair b { color: var(--ink3); font-weight: 900; }
.title-pair i { color: var(--accent); font-style: normal; }

/* ---------- Flächen ---------- */
.panel {
  background: linear-gradient(180deg, #fff, #f3f5f7); border: 2px solid var(--line2); border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}
.card { padding: 24px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(180deg, #fff, #eef1f3); border: 2px solid var(--line); color: var(--ink); font-size: 15px; font-weight: 800;
}
.pill.accent { border-color: var(--accent); color: var(--accent-d); }
.team-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--tc, #ccc); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--tc, #ccc); flex: none; }

/* ---------- Knöpfe (glänzende Pillen) ---------- */
.btn {
  position: relative; height: 54px; padding: 0 30px; border-radius: 999px; font-size: 19px; font-weight: 800; color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f2f4f6 50%, #e4e8ec 100%); border: 3px solid #c9ced3;
  box-shadow: 0 1px 0 #fff inset, 0 6px 14px -8px rgba(40, 50, 60, .5);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap; user-select: none;
  transition: transform .35s var(--spring), border-color .2s, box-shadow .25s;
}
.btn:hover, .btn:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(41, 168, 224, .22), 0 1px 0 #fff inset, 0 8px 18px -8px rgba(41, 168, 224, .55); outline: none; transform: scale(1.03); }
.btn:active { transform: scale(.96); transition-duration: .1s; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.primary { color: #fff; background: linear-gradient(180deg, #6fd0f6, #29a8e0 55%, #1b93cc); border-color: #1786bb; text-shadow: 0 1px 1px rgba(0, 0, 0, .2); }
.btn.go { color: #fff; background: linear-gradient(180deg, #72e39a, #2fc56a 55%, #22a957); border-color: #1d9a4d; text-shadow: 0 1px 1px rgba(0, 0, 0, .2); }
.btn.warn { color: #fff; background: linear-gradient(180deg, #ff8a95, #ff4f5e 55%, #e53a49); border-color: #c92f3d; }
.btn.sm { height: 40px; padding: 0 18px; font-size: 15px; border-width: 2px; }
.btn.lg { height: 66px; padding: 0 44px; font-size: 23px; }
.btn.xl { height: 78px; padding: 0 56px; font-size: 27px; }
.btn.block { width: 100%; }
.btn.icon { width: 46px; padding: 0; }
.btn.icon.sm { width: 40px; }
.round-btn {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; color: var(--ink2);
  background: radial-gradient(circle at 50% 35%, #fff, #e9edf0 70%); border: 4px solid #d3d8dd;
  box-shadow: 0 0 0 6px #f4f6f8, 0 10px 24px -10px rgba(40, 50, 60, .5); transition: transform .35s var(--spring), border-color .2s;
}
.round-btn:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.06); }

/* ---------- Eingaben ---------- */
.field {
  width: 100%; height: 58px; padding: 0 20px; border-radius: 16px; border: 3px solid var(--line); background: #fff;
  color: var(--ink); font-size: 21px; font-weight: 800; outline: none; box-shadow: inset 0 3px 6px rgba(40, 50, 60, .08); transition: border-color .2s, box-shadow .25s;
}
.field::placeholder { color: var(--ink3); }
.field:focus { border-color: var(--accent); box-shadow: inset 0 3px 6px rgba(40, 50, 60, .08), 0 0 0 4px rgba(41, 168, 224, .2); }
.field.code { text-transform: uppercase; text-align: center; font-size: 40px; height: 78px; font-weight: 900; padding-left: calc(20px + .3em); }

/* ---------- Spiel-Icon ---------- */
.app-icon {
  width: var(--s); height: var(--s); border-radius: 26%; display: grid; place-items: center; color: #fff; flex: none; position: relative; overflow: hidden;
  background: linear-gradient(145deg, var(--g1), var(--g2)); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 6px 14px -6px rgba(0, 0, 0, .35);
}
.app-icon::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 255, 255, .35), transparent 52%); pointer-events: none; }
.app-icon .ic { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); stroke-width: 2.3; }

/* ---------- Figur ---------- */
.av { position: relative; display: inline-block; width: var(--s); height: calc(var(--s) * 1.2); flex: none; vertical-align: bottom; }
.av svg { display: block; overflow: visible; }
.av.av-img img { position: absolute; left: 6%; bottom: 0; width: 88%; height: 88%; object-fit: cover; border-radius: 30%; background: #fff; box-shadow: 0 0 0 2px #fff, 0 4px 10px -4px rgba(40, 50, 60, .45); }
.av.av-img.mii img { left: 0; bottom: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; border-radius: 0; background: transparent; box-shadow: none; }
.av.bob.av-img img { animation: bob 2.4s ease-in-out infinite; }
.av.bob svg { animation: bob 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-1.5deg); } }

/* ---------- Timer ---------- */
.timer { --p: 1; position: relative; width: 84px; height: 84px; flex: none; }
.timer.sm { width: 52px; height: 52px; } .timer.lg { width: 110px; height: 110px; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer .tb { fill: #fff; stroke: var(--line2); stroke-width: 4; }
.timer .tf { fill: none; stroke: var(--accent); stroke-width: 4; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--p)); stroke-linecap: round; transition: stroke .3s; }
.timer .tnum { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }
.timer.md .tnum { font-size: 30px; } .timer.sm .tnum { font-size: 19px; } .timer.lg .tnum { font-size: 42px; }
.timer.urgent .tf { stroke: var(--red); }
.timer.urgent .tnum { color: var(--red); animation: pulse .5s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* ---------- Bewegung ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(22px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes popRot { 0% { opacity: 0; transform: scale(.4) rotate(-10deg); } 65% { opacity: 1; transform: scale(1.08) rotate(2deg); } 100% { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
@keyframes float { 50% { transform: translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes stamp { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.6) rotate(-14deg); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(.92) rotate(-8deg); } 100% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); } }
.rise { animation: rise .6s var(--ease) both; }
.pop { animation: pop .5s var(--spring) both; }
.pop-rot { animation: popRot .65s var(--spring) both; }
.float { animation: float 3s ease-in-out infinite; }
.stagger > * { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.pop-new { animation: pop .6s var(--spring) both !important; }
.buzz { animation: shake .4s !important; }
.no-anim .rise, .no-anim .pop, .no-anim .pop-rot, .no-anim .stagger > *, .no-anim .media.letters span, .no-anim .opt.right { animation: none !important; }

#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 999; }
#emote-layer { position: fixed; inset: 0; pointer-events: none; z-index: 900; overflow: hidden; }
.emote-fly { position: absolute; bottom: -100px; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: emoteUp 3.2s var(--ease) forwards; }
.emote-sticker { display: block; filter: drop-shadow(0 8px 12px rgba(40, 50, 60, .35)); animation: wob .6s ease-in-out infinite; }
@keyframes wob { 50% { transform: rotate(var(--rot, 10deg)) scale(1.06); } }
.emote-who { display: flex; align-items: center; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: 99px; padding: 2px 10px 2px 4px; font-size: 13px; }
@keyframes emoteUp { 0% { transform: translate(0, 0) scale(.3); opacity: 0; } 12% { opacity: 1; transform: translate(calc(var(--dx) * .2), -130px) scale(1.15); } 80% { opacity: 1; } 100% { transform: translate(var(--dx), -78vh) scale(.85); opacity: 0; } }

#toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #fff; color: var(--ink); padding: 12px 22px; border-radius: 999px; border: 3px solid var(--accent); animation: rise .4s var(--ease) both; font-size: 16px; font-weight: 800; box-shadow: 0 12px 24px -10px rgba(40, 50, 60, .45); }

/* ---------- Antwort-Optionen ---------- */
.o0 { --c1: #ff6b78; --c2: #ff3d55; } .o1 { --c1: #4da9ff; --c2: #2d6fff; } .o2 { --c1: #ffd34d; --c2: #ffab1a; } .o3 { --c1: #4fdd8a; --c2: #20b35f; }
.opt {
  position: relative; overflow: hidden; border: 3px solid rgba(0, 0, 0, .12); border-radius: 26px; min-height: 92px; padding: 16px 22px; display: flex; align-items: center; gap: 16px; text-align: left;
  color: #fff; font-weight: 900; background: linear-gradient(180deg, var(--c1), var(--c2)); text-shadow: 0 2px 2px rgba(0, 0, 0, .18);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), 0 10px 20px -10px var(--c2); transition: transform .4s var(--spring), filter .3s, opacity .3s;
}
.opt::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .05)); border-radius: 22px 22px 40% 40% / 22px 22px 18px 18px; pointer-events: none; }
.opt .shape { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, .28); flex: none; }
.o2 { color: #5b3d00; text-shadow: none; }
.opt .cnt { margin-left: auto; flex: none; min-width: 1.9em; height: 1.6em; padding: 0 .5em; display: flex; align-items: center; justify-content: center; font-size: .8em; line-height: 1; font-variant-numeric: tabular-nums; border-radius: 99px; background: rgba(255, 255, 255, .85); color: var(--ink); text-shadow: none; }
.opt.dim { filter: grayscale(.85) brightness(1.05); opacity: .45; transform: scale(.97); }
.opt.right { animation: pop .6s var(--spring) both; box-shadow: 0 0 0 5px #fff, 0 0 0 9px var(--c2), 0 20px 40px -14px var(--c2); }

/* ---------- Medien ---------- */
.media { display: grid; place-items: center; }
.frame { background: #fff; border: 2px solid var(--line2); border-radius: 30px; box-shadow: var(--shadow); padding: 12px; }
.media.logo { background: #fff; border-radius: 34px; padding: 34px; border: 2px solid var(--line2); box-shadow: var(--shadow); }
.media.logo img { width: min(30vh, 280px); height: min(30vh, 280px); object-fit: contain; }
.media.logo.blurry img { filter: blur(calc(var(--blur, 1) * 28px)) saturate(calc(1 - var(--blur, 1) * .8)); transform: scale(calc(1 + var(--blur, 1) * .3)); }
.media.flag img { height: min(32vh, 290px); border-radius: 16px; border: 6px solid #fff; box-shadow: 0 16px 30px -14px rgba(40, 50, 60, .55); }
.media.photo { border-radius: 26px; overflow: hidden; border: 8px solid #fff; box-shadow: 0 18px 40px -16px rgba(40, 50, 60, .6); background: #fff; }
.media.photo img { display: block; max-height: min(44vh, 500px); max-width: min(68vw, 880px); object-fit: contain; }
.media.photo.zoom img { transform: scale(calc(1 + var(--zoom, 0) * 2.2)); transform-origin: 50% 45%; }
.media.audio .eq { display: flex; align-items: center; gap: 8px; height: 180px; padding: 0 40px; background: #fff; border-radius: 40px; border: 2px solid var(--line2); box-shadow: var(--shadow); }
.media.audio .eq i { width: 12px; border-radius: 99px; background: linear-gradient(180deg, var(--accent2), var(--accent), var(--purple)); height: 30%; animation: eq 1s ease-in-out infinite; animation-delay: calc(var(--i) * -73ms); }
@keyframes eq { 0%, 100% { height: 18%; } 30% { height: 80%; } 60% { height: 42%; } }
.media.cover { display: flex; align-items: center; gap: 28px; }
.media.cover img { width: min(30vh, 280px); border-radius: 22px; border: 6px solid #fff; box-shadow: 0 18px 40px -16px rgba(40, 50, 60, .6); animation: popRot .8s var(--spring) both; }
.cover-meta { display: flex; flex-direction: column; gap: 6px; } .cover-meta b { font-size: 40px; font-weight: 900; } .cover-meta span { font-size: 24px; color: var(--ink2); }
.media.text { display: block; position: relative; font-size: clamp(22px, 2.2vw, 32px); font-weight: 800; line-height: 1.35; padding: 30px 38px; max-width: 980px; text-align: center; border-radius: var(--r-xl); background: #fff; border: 2px solid var(--line2); box-shadow: var(--shadow); }
.media.text.quote { padding: 44px 64px 36px; }
.media.text.quote::before { content: '“'; position: absolute; left: 28px; top: -30px; box-sizing: border-box; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 60px; line-height: 1; padding-top: 16px; overflow: hidden; color: #fff; background: var(--accent); border: 4px solid #fff; box-shadow: 0 6px 14px -6px rgba(41, 168, 224, .7); }
.media.letters { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.media.letters span { width: 76px; height: 88px; display: grid; place-items: center; border-radius: 20px; font-size: 48px; font-weight: 900; color: var(--ink);
  background: linear-gradient(180deg, #fff, #eef1f4); border: 3px solid var(--line); box-shadow: var(--shadow);
  animation: tileIn .6s var(--spring) both, tileJiggle 3s ease-in-out infinite; animation-delay: calc(var(--i) * 60ms), calc(var(--i) * 140ms); }
.media.letters.solved span { background: linear-gradient(180deg, #72e39a, #2fc56a); border-color: #22a957; color: #fff; }
@keyframes tileIn { from { transform: translateY(-50px) rotate(-16deg); opacity: 0; } }
@keyframes tileJiggle { 0%, 82%, 100% { transform: rotate(0); } 88% { transform: rotate(-5deg); } 94% { transform: rotate(4deg); } }
.media.hl { grid-template-columns: 1fr auto 1fr; gap: 26px; align-items: stretch; width: min(1060px, 100%); }
.hl-card { border-radius: var(--r-xl); overflow: hidden; display: flex; flex-direction: column; background: #fff; border: 2px solid var(--line2); box-shadow: var(--shadow); }
.hl-img { height: min(25vh, 250px); display: grid; place-items: center; background: #f2f4f6; color: var(--ink3); overflow: hidden; }
.hl-img img { width: 100%; height: 100%; object-fit: cover; }
.hl-img.is-flag img { object-fit: contain; padding: 22px; }
.hl-body { padding: 16px 22px 20px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.hl-name { font-size: 28px; font-weight: 900; }
.hl-val { font-size: 40px; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }
.hl-card.b .hl-val { color: var(--orange); }
.media.hl.revealed .hl-card.b .hl-val { animation: pop .7s var(--spring) both; }
.hl-metric { font-size: 13px; color: var(--ink2); text-transform: uppercase; font-weight: 800; }
.hl-vs { align-self: center; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 24px; color: #fff; background: linear-gradient(180deg, #6fd0f6, #29a8e0); border: 4px solid #fff; box-shadow: 0 0 0 3px var(--accent), 0 10px 20px -8px rgba(41, 168, 224, .7); }
.chalk-board { background: #1f4a37; background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(135deg, #2a5c45, #183829); background-size: 6px 6px, auto;
  border: 14px solid #8b5a2b; border-radius: 18px; box-shadow: inset 0 0 50px rgba(0, 0, 0, .45), 0 20px 40px -18px rgba(40, 50, 60, .6); padding: 30px 44px; color: #f4f1e6;  }
.chalk-board .klasse { font-size: 38px; opacity: .85; }
.chalk-board .chalk-q { font-size: clamp(40px, 5vw, 68px); line-height: 1.1; }

.heart-on { color: var(--red); } .heart-off { color: #d3d7dc; }
.lives-row { display: inline-flex; gap: 2px; }

/* Logo aus copyright.svg, blau eingefärbt */
.brand-logo { display: block; width: 1em; height: 1em; font-size: 64px; background: var(--accent); -webkit-mask: url(/copyright.svg) center / contain no-repeat; mask: url(/copyright.svg) center / contain no-repeat; }
