@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap; src: url("assets/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
:root {
  --felt1: #1d7a4c; --felt2: #0d4a2c; --gold: #ffc83d; --fg: #fff; --muted: #cfe3d6; --card: rgba(8, 36, 22, .9);
  --c0: #1c1c28; --c1: #cf1f3c; --c2: #cf1f3c; --c3: #1c1c28; --back1: #1f4fb8; --back2: #173a86;
}
body.vier { --c2: #1b66d0; --c3: #127a37; }
body.tisch-blau { --felt1: #2263a8; --felt2: #12345e; }
body.tisch-rot { --felt1: #8c2638; --felt2: #4a1420; }
body.tisch-grau { --felt1: #4a5260; --felt2: #252a33; }
body.ruecken-rot { --back1: #c3263f; --back2: #8a1629; }
body.ruecken-gruen { --back1: #1f8a52; --back2: #135c36; }
body.ruecken-gold { --back1: #d49a1e; --back2: #9a6a0c; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
body { font-family: "Space Grotesk", "Segoe UI", Roboto, Arial, sans-serif; color: var(--fg); background: radial-gradient(ellipse at 50% 30%, var(--felt1), var(--felt2) 75%); background-attachment: fixed; touch-action: none; }
#app { position: fixed; inset: 0; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.hidden { display: none !important; }

/* ---------- Kopf- und Fußleiste ---------- */
#hud { flex: 0 0 auto; height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 10px; background: rgba(0,0,0,.18); }
#btnMenu { width: 42px; height: 38px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,.3); background: rgba(0,0,0,.2); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ht { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.1; }
.ht b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ht small { color: var(--muted); font-size: 12px; }
.hs { display: flex; gap: 12px; font-size: 17px; font-variant-numeric: tabular-nums; }
.hs span { background: rgba(0,0,0,.22); padding: 4px 10px; border-radius: 10px; }
#bar { flex: 0 0 auto; display: flex; justify-content: center; gap: 8px; padding: 6px 8px 8px; background: rgba(0,0,0,.18); }
#bar button { flex: 1; max-width: 140px; min-height: 52px; border: 0; border-radius: 14px; background: rgba(255,255,255,.14); color: #fff; font: 700 14px "Space Grotesk", sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; touch-action: manipulation; }
#bar button i { font-style: normal; font-size: 20px; line-height: 1; }
#bar button:active { background: rgba(255,255,255,.26); }
#bar button.go { background: var(--gold); color: #3a2700; animation: pulse .7s infinite alternate; }
#bar button:disabled { opacity: .4; }
@keyframes pulse { to { transform: scale(1.06); } }

/* ---------- Tisch & Karten ---------- */
.table { position: relative; flex: 1 1 auto; overflow: hidden; touch-action: none; }
.card, .slot { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * .085); }
.card { transition: transform .2s cubic-bezier(.2,.8,.3,1); cursor: pointer; }
.card.noanim, .card.dragging { transition: none !important; }
.card.dragging .face { box-shadow: 0 10px 22px rgba(0,0,0,.45); }
.card.fly { z-index: 4000 !important; }
.face { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(170deg, #fffefa, #f6f0e2); border: 1px solid #bdb39e; box-shadow: 0 1px 2px rgba(0,0,0,.3); overflow: hidden; color: var(--cs); }
.card.s0 { --cs: var(--c0); } .card.s1 { --cs: var(--c1); } .card.s2 { --cs: var(--c2); } .card.s3 { --cs: var(--c3); }
.idx { position: absolute; left: 5%; top: 1.5%; display: flex; align-items: center; gap: 1%; height: 22%; max-width: 92%; }
.idx .r, .idx2 .r { font-weight: 700; line-height: 1; letter-spacing: -.05em; }
.idx .r { font-size: calc(var(--cw) * .37); }
.idx .si { width: calc(var(--cw) * .28); height: calc(var(--cw) * .28); fill: currentColor; flex: 0 0 auto; }
.idx2 { position: absolute; right: 5%; bottom: 2%; display: flex; align-items: center; gap: 2%; transform: rotate(180deg); opacity: .85; }
.idx2 .r { font-size: calc(var(--cw) * .2); }
.idx2 .si { width: calc(var(--cw) * .16); height: calc(var(--cw) * .16); fill: currentColor; }
.body { position: absolute; left: 10%; right: 10%; top: 26%; bottom: 12%; display: grid; place-items: center; }
.pipmid svg, .ace svg { fill: currentColor; display: block; }
.pipmid svg { width: calc(var(--cw) * .6); height: calc(var(--cw) * .6); opacity: .92; }
.ace svg { width: calc(var(--cw) * .74); height: calc(var(--cw) * .74); filter: drop-shadow(0 2px 0 rgba(0,0,0,.15)); }
.body .fig { width: 100%; height: 100%; }
.back { display: none; position: absolute; inset: 0; border-radius: inherit; border: calc(var(--cw) * .05) solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,.35), inset 0 0 0 1px rgba(0,0,0,.15);
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.25) 0 18%, transparent 19%), repeating-linear-gradient(45deg, var(--back1) 0 6px, var(--back2) 6px 12px); }
.back::after { content: "0o5"; position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cw) * .2); color: rgba(255,255,255,.85); letter-spacing: -.02em; }
.card.down .back { display: block; }
.card.down .face { visibility: hidden; }
.card.flipping .face { animation: flipin .22s ease-out; }
@keyframes flipin { from { transform: scaleX(.05); } to { transform: scaleX(1); } }
.card.shake .face, .card.shake .back { animation: shake .32s; }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.card.hl .face, .card.hl .back { box-shadow: 0 0 0 3px var(--gold), 0 0 18px var(--gold); }
.card.hl2 .face { box-shadow: 0 0 0 3px #5ee6ff, 0 0 18px #5ee6ff; }
.slot { border: 2px dashed rgba(255,255,255,.28); display: grid; place-items: center; color: rgba(255,255,255,.3); font-size: calc(var(--cw) * .36); z-index: 0; background: rgba(0,0,0,.07); }
.slot.hl, .slot.hl2 { border-color: var(--gold); border-style: solid; box-shadow: 0 0 16px var(--gold); }
.slot.stock { cursor: pointer; }
.slot.stock .redeal { opacity: 0; }
.slot.stock.empty .redeal { opacity: 1; font-size: calc(var(--cw) * .5); color: rgba(255,255,255,.6); }
.slot-c { background: rgba(0,0,0,.14); }
.table.spider .slot-f span, .table.spider .slot-f { font-size: 0; }

/* ---------- Mau-Mau ---------- */
.table.mau .card.playable .face { box-shadow: 0 0 0 2px var(--gold), 0 6px 14px rgba(0,0,0,.35); }
.mau-draw { cursor: pointer; border-style: solid; border-color: rgba(255,255,255,.2); font-size: 13px; color: #fff; align-items: end; padding-bottom: 6px; }
.mau-draw span { background: rgba(0,0,0,.6); padding: 2px 8px; border-radius: 8px; white-space: nowrap; font-size: 13px; }
.mau-draw.pulse span { background: var(--gold); color: #3a2700; animation: pulse .5s infinite alternate; }
.mau-name { position: absolute; left: 0; top: 0; z-index: 300; text-align: center; pointer-events: none; }
.mau-name b { display: inline-block; padding: 3px 12px; border-radius: 999px; background: rgba(0,0,0,.35); font-size: 15px; }
.mau-name.turn b { background: var(--gold); color: #3a2700; box-shadow: 0 0 14px var(--gold); }
.mau-name i { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.mau-name em { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -4px) scale(.8); white-space: nowrap; font-style: normal; background: #fff; color: #1b1b28; padding: 5px 12px; border-radius: 14px; font-size: 15px; opacity: 0; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.mau-name em.show { animation: bubble 2.2s ease forwards; }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.6); } 12% { opacity: 1; transform: translate(-50%, -4px) scale(1.05); } 80% { opacity: 1; transform: translate(-50%, -4px) scale(1); } 100% { opacity: 0; } }
.mau-badge { position: absolute; left: 0; top: 0; z-index: 200; display: flex; flex-direction: column; gap: 6px; }
.mau-badge .wish { display: flex; align-items: center; gap: 4px; background: #fff; color: var(--cs); padding: 4px 10px; border-radius: 12px; font-size: 13px; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.mau-badge .wish.s0 { --cs: var(--c0); } .mau-badge .wish.s1 { --cs: var(--c1); } .mau-badge .wish.s2 { --cs: var(--c2); } .mau-badge .wish.s3 { --cs: var(--c3); }
.mau-badge .wish svg { width: 22px; height: 22px; fill: currentColor; }
.mau-badge .pend { background: #e2304a; color: #fff; padding: 4px 10px; border-radius: 12px; font-size: 20px; text-align: center; animation: pulse .4s infinite alternate; }
.mau-pass { position: absolute; left: 0; top: 0; z-index: 400; }
.wishbox { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 5000; background: var(--card); border: 1.5px solid rgba(255,255,255,.2); border-radius: 18px; padding: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(92vw, 420px); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.wishbox p { grid-column: 1 / -1; margin: 0 0 4px; text-align: center; font-size: 17px; }
.wishbox button { border: 0; border-radius: 14px; background: #fff; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 700 13px "Space Grotesk", sans-serif; color: var(--cs); cursor: pointer; }
.wishbox button.s0 { --cs: var(--c0); } .wishbox button.s1 { --cs: var(--c1); } .wishbox button.s2 { --cs: var(--c2); } .wishbox button.s3 { --cs: var(--c3); }
.wishbox button svg { width: 40px; height: 40px; fill: currentColor; }
.wishbox .link { grid-column: 1 / -1; background: none; color: var(--muted); }

/* ---------- Menüs ---------- */
#ui { position: absolute; inset: 0; pointer-events: none; z-index: 6000; }
.scr { pointer-events: auto; position: absolute; inset: 0; overflow-y: auto; padding: calc(env(safe-area-inset-top) + 58px) 14px calc(env(safe-area-inset-bottom) + 70px); display: flex; flex-direction: column; align-items: center; gap: 12px; background: radial-gradient(ellipse at 50% 20%, rgba(29,122,76,.96), rgba(8,40,24,.98)); touch-action: pan-y; }
.scr.over { background: rgba(4, 24, 14, .72); justify-content: center; }
.scr > * { width: 100%; max-width: 640px; }
.logo { text-align: center; margin: 4px 0 0; }
.logo .fan { height: 92px; display: block; margin: 0 auto -6px; }
.logo h1 { margin: 0; font-size: clamp(38px, 11vw, 64px); line-height: .95; letter-spacing: -.03em; text-shadow: 0 4px 0 rgba(0,0,0,.3); }
.logo h1 span { color: var(--gold); }
.logo p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.card2 { background: var(--card); border: 1.5px solid rgba(255,255,255,.14); border-radius: 18px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.daily { display: flex; align-items: center; gap: 12px; background: linear-gradient(120deg, rgba(255,200,61,.22), rgba(255,255,255,.06)); border-color: rgba(255,200,61,.6); cursor: pointer; }
.daily .dd { width: 54px; height: 64px; border-radius: 10px; background: #fff; color: #cf1f3c; display: grid; place-items: center; font-size: 26px; flex: 0 0 auto; box-shadow: 0 4px 10px rgba(0,0,0,.3); line-height: 1; text-align: center; }
.daily .dd small { display: block; font-size: 10px; color: #555; }
.daily .dt { flex: 1; }
.daily .dt b { display: block; font-size: 18px; }
.daily .dt span { color: var(--muted); font-size: 14px; }
.daily .ok { color: var(--gold); font-size: 14px; }
.games { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gtile { background: var(--card); border: 1.5px solid rgba(255,255,255,.14); border-radius: 18px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.gtile h3 { margin: 0; font-size: 19px; }
.gtile p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.3; flex: 1; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { flex: 1; min-width: 0; border: 1.5px solid rgba(255,255,255,.25); background: rgba(0,0,0,.2); color: var(--muted); border-radius: 10px; padding: 6px 4px; font: 700 13px "Space Grotesk", sans-serif; cursor: pointer; white-space: nowrap; }
.chip.on { background: #fff; color: #0d4a2c; border-color: #fff; }
.btn { appearance: none; border: 0; border-radius: 14px; padding: 12px 16px; font: 700 17px/1.1 "Space Grotesk", sans-serif; color: #3a2700; background: linear-gradient(180deg, #ffe07a, var(--gold)); box-shadow: 0 4px 0 #a87a10, 0 8px 18px rgba(0,0,0,.25); cursor: pointer; touch-action: manipulation; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a87a10; }
.btn.alt { color: #fff; background: rgba(255,255,255,.16); box-shadow: 0 3px 0 rgba(0,0,0,.25); }
.btn.small { font-size: 15px; padding: 9px 12px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.resume { display: flex; align-items: center; gap: 10px; }
.resume span { flex: 1; color: var(--muted); font-size: 14px; }
.resume b { color: #fff; font-size: 16px; display: block; }
h2 { margin: 6px 0; text-align: center; font-size: 28px; text-shadow: 0 3px 0 rgba(0,0,0,.3); }
h3 { margin: 0 0 6px; }
.stats table { width: 100%; border-collapse: collapse; font-size: 15px; }
.stats td, .stats th { padding: 6px 4px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.1); }
.stats td:first-child, .stats th:first-child { text-align: left; }
.stats th { color: var(--muted); font-size: 12px; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 16px; }
.opt:last-child { border-bottom: 0; }
.opt small { display: block; color: var(--muted); font-size: 12px; }
.sw { position: relative; width: 52px; height: 30px; border-radius: 15px; background: rgba(255,255,255,.2); border: 0; cursor: pointer; flex: 0 0 auto; }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.sw.on { background: var(--gold); }
.sw.on::after { left: 25px; }
.seg { display: flex; gap: 4px; }
.seg button { border: 1.5px solid rgba(255,255,255,.25); background: rgba(0,0,0,.2); color: var(--muted); border-radius: 10px; padding: 6px 8px; font: 700 13px "Space Grotesk", sans-serif; cursor: pointer; }
.seg button.on { background: #fff; color: #0d4a2c; }
.swatch { width: 30px; height: 40px; border-radius: 6px; border: 3px solid #fff; padding: 0; cursor: pointer; opacity: .7; }
.swatch.on { opacity: 1; box-shadow: 0 0 0 3px var(--gold); }
.help h3 { margin-top: 10px; color: var(--gold); font-size: 17px; }
.help p, .help li { font-size: 15px; line-height: 1.45; color: #eaf3ee; margin: 4px 0; }
.help ul { padding-left: 18px; margin: 4px 0; }
.win { text-align: center; }
.win .big { font-size: 46px; line-height: 1.05; }
.win .meta { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; color: var(--muted); margin-top: 6px; font-size: 16px; }
.win .rec { color: var(--gold); letter-spacing: .06em; animation: pulse .5s infinite alternate; }
#toast { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 7000; background: rgba(0,0,0,.78); color: #fff; padding: 9px 16px; border-radius: 14px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 92vw; text-align: center; }
#toast.show { opacity: 1; }
#confetti { position: absolute; inset: 0; pointer-events: none; z-index: 5500; }
.noscript { padding: 20px; }
@media (max-width: 380px) { .games { grid-template-columns: 1fr; } }
@media (orientation: landscape) and (max-height: 520px) {
  #hud { height: 42px; } #bar { padding: 4px 8px; } #bar button { min-height: 40px; flex-direction: row; gap: 6px; } #bar button i { font-size: 16px; }
  .scr { padding-top: 54px; }
  .games { grid-template-columns: repeat(4, 1fr); }
  .scr > * { max-width: 900px; }
  .logo .fan { display: none; }
}
@media (prefers-reduced-motion: reduce) { .card { transition-duration: .05s; } #bar button.go, .win .rec { animation: none; } }
