:root {
  --bg: #1b1444; --panel: #2a2166; --panel2: #382d85; --ink: #fff; --dim: #c5bdf5;
  --gold: #ffd43b; --pri: #ff7a45; --pri2: #ff4d6d; --ok: #40c057; --bad: #fa5252;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif; color: var(--ink); background: var(--bg); overflow-x: hidden; }
h1, h2, h3, p { margin: 0 0 .5em; }
h3 { margin-top: 1.2em; }
h3 small { font-weight: 400; color: var(--dim); font-size: .8em; margin-left: .5em; }
small, .small { color: var(--dim); font-size: .85rem; }
a { color: var(--gold); }
kbd { background: #fff; color: #222; border-radius: 6px; padding: 0 .45em; font-weight: 700; font-size: .9rem; font-family: inherit; box-shadow: 0 2px 0 #999; }
.grow { flex: 1; }

.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-blobs i { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(90px); opacity: .45; animation: drift 22s ease-in-out infinite alternate; }
.bg-blobs i:nth-child(1) { background: #7048e8; top: -20vmax; left: -15vmax; }
.bg-blobs i:nth-child(2) { background: #e64980; bottom: -25vmax; right: -15vmax; animation-delay: -8s; }
.bg-blobs i:nth-child(3) { background: #1098ad; top: 30%; left: 40%; width: 35vmax; height: 35vmax; animation-delay: -14s; }
@keyframes drift { to { transform: translate(8vmax, 5vmax) scale(1.15); } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

/* Buttons */
.btn { font-weight: 600; font-size: 1rem; font-family: inherit; color: var(--ink); background: var(--panel2); border: 0; border-radius: 14px; padding: .6em 1.1em; cursor: pointer; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); transition: transform .08s, filter .15s; display: inline-flex; align-items: center; gap: .5em; justify-content: center; }
.btn:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--pri), var(--pri2)); }
.btn.danger { background: #c92a2a; }
.btn.xl { font-size: 1.35rem; padding: .7em 1.6em; border-radius: 18px; }
.btn.sm { font-size: .85rem; padding: .4em .8em; border-radius: 10px; }
.btn.chip { flex-direction: column; gap: 0; align-items: flex-start; text-align: left; max-width: 260px; }
.btn.chip small { color: inherit; opacity: .8; font-weight: 400; }
.row { display: flex; flex-wrap: wrap; gap: .6em; justify-content: center; margin-top: 1em; }
.row.left { justify-content: flex-start; margin-top: 0; }
.col { display: flex; flex-direction: column; gap: .7em; }
.inp { font-weight: 600; font-size: 1.3rem; font-family: inherit; padding: .5em .8em; border-radius: 12px; border: 3px solid var(--panel2); background: #fff; color: #222; width: 100%; max-width: 280px; text-align: center; }

/* Avatar */
.avatar { --s: 56px; width: var(--s); height: var(--s); border-radius: 50%; position: relative; display: inline-grid; place-items: center; border: calc(var(--s) * .07) solid #fff; box-shadow: 0 calc(var(--s) * .08) calc(var(--s) * .2) rgba(0, 0, 0, .45); flex: none; }
.avatar .face { font-size: calc(var(--s) * .56); line-height: 1; }
.avatar .hat { position: absolute; top: calc(var(--s) * -.4); left: 50%; transform: translateX(-50%) rotate(-10deg); font-size: calc(var(--s) * .5); line-height: 1; }
.cur { display: flex; gap: .8em; font-weight: 700; }
.cur.big { font-size: 1.4rem; margin: .3em 0; }

/* Menü & Listen */
.screen { max-width: 980px; margin: 0 auto; padding: 24px 16px 60px; }
.screen.center { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2em; }
.top { display: flex; align-items: center; gap: 1em; margin-bottom: 1em; }
.top h2 { margin: 0; }
.title { text-align: center; }
.title h1 { font-size: clamp(3.5rem, 13vw, 7rem); line-height: .9; font-weight: 700; background: linear-gradient(180deg, #fff3bf, var(--gold) 45%, #f76707); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 0 #5f3dc4) drop-shadow(0 12px 18px rgba(0, 0, 0, .5)); transform: rotate(-4deg); }
.title p { color: var(--dim); font-size: 1.1rem; margin-top: 1.4em; }
.tdie { font-size: 4rem; display: inline-block; animation: wob 2.4s ease-in-out infinite; }
@keyframes wob { 0%, 100% { transform: rotate(-14deg) translateY(0); } 50% { transform: rotate(16deg) translateY(-12px); } }
.menu { width: min(320px, 90vw); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 1em; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.pbig { font: inherit; color: inherit; background: var(--panel); border: 3px solid transparent; border-radius: 20px; padding: 26px 12px 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .35em; position: relative; transition: transform .12s, border-color .12s; }
.pbig:hover { transform: translateY(-3px); border-color: var(--panel2); }
.pbig.sel { border-color: var(--gold); background: var(--panel2); }
.pbig.add { border: 3px dashed var(--panel2); background: transparent; justify-content: center; }
.pbig.add span { font-size: 2.6rem; line-height: 1; }
.pbig .num { position: absolute; top: 8px; right: 10px; background: var(--gold); color: #222; font-weight: 700; font-size: .9rem; font-family: inherit; width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; }
.xp { position: relative; width: 100%; max-width: 280px; height: 20px; border-radius: 10px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.xp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #38d9a9, #4dabf7); }
.xp span { position: relative; display: block; text-align: center; font-size: .72rem; line-height: 20px; font-weight: 600; }

.hero { display: flex; gap: 28px; align-items: center; background: var(--panel); border-radius: 24px; padding: 40px 28px 24px; flex-wrap: wrap; }
.hero h2 { margin: 0; font-size: 2rem; }
.hero > div:last-child { flex: 1; min-width: 220px; }
.skills { display: grid; gap: 8px; }
.skills > div { background: var(--panel); border-radius: 14px; padding: 10px 14px; display: grid; grid-template-columns: 150px 90px 1fr auto; gap: 10px; align-items: center; }
.dots { color: var(--gold); letter-spacing: 2px; }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tile { font: inherit; color: inherit; background: var(--panel); border: 3px solid transparent; border-radius: 16px; padding: 10px 8px 4px; width: 84px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tile.sel { border-color: var(--gold); background: var(--panel2); }
.tile.buy small { color: var(--gold); font-weight: 600; }
.tile:disabled { opacity: .45; cursor: not-allowed; }
.tile .em { font-size: 2rem; line-height: 46px; }
@media (max-width: 560px) { .skills > div { grid-template-columns: 1fr auto; } }

/* Dialoge */
.ov { position: fixed; inset: 0; background: rgba(10, 6, 40, .72); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 60; padding: 16px; animation: fade .15s; }
.modal { background: var(--panel); border-radius: 24px; padding: 24px 26px; width: min(480px, 100%); max-height: 92vh; overflow: auto; text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .6), inset 0 0 0 3px rgba(255, 255, 255, .08); animation: pop .22s cubic-bezier(.3, 1.6, .5, 1); }
.modal.wide { width: min(680px, 100%); text-align: left; }
.modal.col .row { flex-direction: column; }
.modal.shop .btn { justify-content: flex-start; text-align: left; }
.modal.shop .big { font-size: 1.8rem; }
.modal.cardm { background: linear-gradient(160deg, #9c36b5, #5f3dc4); transform-origin: center; animation: flip .45s ease-out; }
.lead { font-size: 1.2rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
@keyframes flip { from { transform: rotateY(90deg) scale(.6); } }
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: #111; color: #fff; padding: .6em 1.2em; border-radius: 999px; z-index: 95; font-weight: 600; animation: pop .2s, fade .4s 2.2s reverse forwards; white-space: nowrap; }
.legend, .awards, .res, .podium { list-style: none; padding: 0; margin: .5em 0; display: grid; gap: 8px; text-align: left; }
.legend li { display: grid; grid-template-columns: 34px auto 1fr; gap: 10px; align-items: center; font-size: .92rem; color: var(--dim); }
.legend b { color: var(--ink); }
.legend i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-style: normal; border: 2px solid #fff; }
.wheel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wheel div { background: var(--panel2); border-radius: 12px; padding: 16px 4px; font-weight: 700; transition: .05s; }
.wheel div.on { background: var(--gold); color: #222; transform: scale(1.1); box-shadow: 0 0 24px var(--gold); }
.podium li { display: flex; gap: 14px; align-items: center; background: var(--panel2); border-radius: 16px; padding: 16px 14px 10px; }
.podium li.first { background: linear-gradient(135deg, #f59f00, #e8590c); }
.podium .rk { font-size: 1.8rem; width: 1.4em; text-align: center; }
.podium small { color: inherit; opacity: .9; }
.lvup { color: #fff; background: var(--ok); border-radius: 6px; padding: 0 .4em; }

/* Spiel */
#game { height: 100vh; display: grid; grid-template: auto 1fr auto / 230px 1fr; gap: 10px; padding: 10px; }
#game header { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 16px; padding: 8px 14px; }
#game header b { color: var(--gold); font-size: 1.2rem; }
#round { background: var(--panel2); border-radius: 999px; padding: .2em .9em; font-weight: 600; }
#side { display: flex; flex-direction: column; gap: 8px; overflow: hidden auto; padding: 14px 8px 0 0; }
.pcard { background: var(--panel); border-radius: 16px; padding: 14px 10px 8px; display: flex; gap: 10px; align-items: center; border: 3px solid transparent; transition: .2s; }
.pcard.on { border-color: var(--gold); background: var(--panel2); transform: translateX(4px); }
.bag { min-height: 1.3em; display: flex; gap: 3px; }
#game main { display: grid; place-items: center; min-height: 0; min-width: 0; }
#board { position: relative; width: min(100%, calc((100vh - 200px) * 1000 / 640)); aspect-ratio: 1000 / 640; container-type: inline-size; background: radial-gradient(ellipse at 50% 40%, #3b5bdb55, transparent 70%), linear-gradient(160deg, #2b8a3e55, #1864ab55); border-radius: 28px; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .1), 0 14px 40px rgba(0, 0, 0, .4); }
#board svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.edges line { stroke: rgba(0, 0, 0, .35); stroke-width: 22; stroke-linecap: round; }
.edges.dash line { stroke: rgba(255, 255, 255, .55); stroke-width: 4; stroke-dasharray: 2 12; }
.field circle { stroke: #fff; stroke-width: 4; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .35)); transform-box: fill-box; transform-origin: center; }
.field text { font-size: 26px; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.field.pulse circle { animation: pulse .45s 2; }
@keyframes pulse { 50% { transform: scale(1.35); } }
.logo { font: 700 30px 'Fredoka', sans-serif; fill: rgba(255, 255, 255, .13); text-anchor: middle; letter-spacing: 3px; }
.token { position: absolute; transform: translate(-50%, -50%); transition: left .4s ease, top .4s ease; z-index: 3; pointer-events: none; }
.token .avatar { --s: 4.6cqw; }
.token.on { z-index: 4; }
.token.on .avatar { box-shadow: 0 0 0 .5cqw var(--gold), 0 0 3cqw var(--gold); }
@keyframes bob { 50% { transform: translateY(-.8cqw); } }
#gold { position: absolute; transform: translate(-50%, -50%); font-size: 3.6cqw; z-index: 2; filter: drop-shadow(0 0 1.2cqw var(--gold)); transition: left .6s, top .6s; pointer-events: none; }
.float { position: absolute; transform: translate(-50%, -50%); font-weight: 700; font-size: 2.6cqw; font-family: inherit; color: var(--gold); text-shadow: 0 2px 0 #000; z-index: 6; animation: rise 1.3s forwards; pointer-events: none; white-space: nowrap; }
.float.bad { color: #ff8787; }
@keyframes rise { to { transform: translate(-50%, -350%); opacity: 0; } }
#dice { position: absolute; inset: 0; display: none; place-items: center; grid-auto-flow: column; justify-content: center; gap: 2cqw; z-index: 8; }
#dice.show { display: grid; }
.die { width: 13cqw; height: 13cqw; background: #fff; color: #222; border-radius: 2.4cqw; display: grid; place-items: center; font-weight: 700; font-size: 8cqw; font-family: inherit; box-shadow: 0 1cqw 0 #bbb, 0 2cqw 4cqw rgba(0, 0, 0, .5); animation: shake .1s infinite; }
#dice.final .die { animation: pop .3s; background: var(--gold); }
@keyframes shake { 0% { transform: rotate(-12deg); } 50% { transform: rotate(12deg) translateY(-1cqw); } }
#game footer { grid-column: 1 / -1; background: var(--panel); border-radius: 16px; padding: 10px 14px; display: flex; align-items: center; gap: 14px; min-height: 76px; flex-wrap: wrap; }
#say { flex: 1; font-size: 1.1rem; min-width: 200px; }
#act { margin: 0; }
@media (max-width: 760px) {
  #game { grid-template: auto auto 1fr auto / minmax(0, 1fr); height: auto; min-height: 100vh; }
  #side { flex-direction: row; overflow: auto hidden; padding: 14px 4px 6px; scrollbar-width: none; }
  #game header b { display: none; }
  .pcard { min-width: 150px; }
  #board { width: 100%; }
}

/* Minispiel-Bühne */
.stage { position: fixed; inset: 0; z-index: 50; background: radial-gradient(circle at 50% 0, #5f3dc4, #1b1444 70%); display: grid; place-items: center; padding: 16px; overflow: auto; animation: fade .3s; }
.stage-in { width: min(760px, 100%); text-align: center; }
.stage-head { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 14px; }
.stage-head span { font-size: 3rem; }
.stage-head h2 { font-size: 2.2rem; margin: 0; color: var(--gold); }
.stage-body { background: var(--panel); border-radius: 24px; padding: 28px 22px; min-height: 240px; }
.who { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 1.3rem; margin: 18px 0 10px; }
.q { font-size: 1.5rem; }
.word { font-size: clamp(1.8rem, 6vw, 3rem); font-weight: 700; color: var(--gold); margin: .4em 0; }
.taboo { color: #ffa8a8; font-size: 1.15rem; font-weight: 600; }
.signal { font-size: 3.2rem; font-weight: 700; padding: 36px 10px; border-radius: 20px; background: #c92a2a; margin-bottom: 18px; }
.signal.go { background: var(--ok); animation: pop .15s; }
.clock { font-weight: 700; font-size: 5rem; font-family: inherit; font-variant-numeric: tabular-nums; }
.disc { font-size: 5rem; display: inline-block; }
.disc.spin { animation: spin 2.5s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pads { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pad { font: inherit; color: inherit; background: var(--panel2); border: 3px solid transparent; border-radius: 18px; padding: 22px 10px 10px; width: 112px; display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; touch-action: manipulation; user-select: none; }
.pad:active, .pad.hit { transform: scale(.93); background: #5f3dc4; }
.pad.win { border-color: var(--gold); background: #e67700; }
.pad.ok { border-color: #fff; }
.pad.out { opacity: .4; }
.pv { font-weight: 700; font-size: 1.3rem; min-height: 1.3em; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.opt.right { background: var(--ok); opacity: 1; }
.opt.wrong { background: var(--bad); opacity: 1; }
.res li { display: grid; grid-template-columns: auto 1fr auto 70px; gap: 12px; align-items: center; background: var(--panel2); border-radius: 12px; padding: 12px 12px 6px; }
.res em { font-style: normal; font-weight: 700; color: var(--gold); text-align: right; }
.bar { height: 12px; border-radius: 6px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--pri2), var(--gold)); transition: width .1s linear; }
.secs { font-weight: 700; margin: 4px 0 10px; }
.cw { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.cwc { font-weight: 600; font-size: 1rem; font-family: inherit; padding: 16px 4px; border-radius: 12px; border: 3px solid transparent; background: #f1e9d2; color: #333; cursor: pointer; }
.cw.peek .cwc.g, .cwc.open.g { background: var(--ok); color: #fff; }
.cw.peek .cwc.x, .cwc.open.x { background: #111; color: #fff; }
.cwc.open.n { background: #8d8670; color: #ddd; }
.cwc.open { border-color: #fff; cursor: default; }
