:root {
  /* Bunter Cartoon-Look: tiefes Violett, Sonnengelb, Pink/Türkis-Akzente */
  --gold: #ffd23f;
  --gold-2: #ffe27a;
  --gold-dark: #b8860b;
  --red: #ff4f6d;
  --bg: #1a0f3a;
  --panel: rgba(36, 18, 74, 0.86);
  --panel-border: rgba(255, 210, 63, 0.55);
  --text: #fff8ee;
  --muted: #c9b8f0;
  --danger: #d64545;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: Nunito, system-ui, sans-serif; user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
button { font-family: inherit; cursor: pointer; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.06); font: 600 11px Nunito, sans-serif; color: var(--gold-2); text-align: center; }

.card { background: var(--panel); border: 2px solid var(--panel-border); border-radius: 18px;
  box-shadow: 0 5px 0 rgba(0,0,0,0.3), 0 10px 30px rgba(0,0,0,0.35); backdrop-filter: blur(8px); }

.screen { position: fixed; inset: 0; z-index: 10; }
.overlay { background: rgba(5, 2, 3, 0.6); display: flex; align-items: center; justify-content: center; z-index: 30; }

/* Logo */
.logo { font-family: Fredoka, Nunito, sans-serif; font-weight: 800; font-size: clamp(42px, 6vw, 84px); letter-spacing: 0.08em; line-height: 0.95;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-dark)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(227,180,90,0.35)); }
.logo span { display: block; font-size: 0.55em; letter-spacing: 0.5em; }

/* Laden */
#loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: radial-gradient(circle at 50% 40%, #2a0b12, #070304 70%); z-index: 50; text-align: center; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(227,180,90,0.2); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Hauptmenü */
#menu { display: flex; justify-content: space-between; align-items: center; padding: 4vh 5vw; gap: 32px;
  background: linear-gradient(90deg, rgba(8,3,5,0.94) 0%, rgba(8,3,5,0.65) 38%, rgba(8,3,5,0.1) 62%, rgba(8,3,5,0.55) 100%); }
.menu-left { display: flex; flex-direction: column; gap: 22px; max-width: 460px; }
.tagline { margin: 0; color: var(--muted); font-size: 15px; letter-spacing: 0.04em; }
.menu-buttons { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.btn { appearance: none; border: 1px solid var(--panel-border); background: linear-gradient(180deg, rgba(60,24,30,0.9), rgba(28,10,14,0.9));
  color: var(--text); padding: 14px 26px; border-radius: 10px; font-weight: 800; font-size: 15px; letter-spacing: 0.18em; text-align: left;
  transition: transform .12s, border-color .12s, box-shadow .12s, background .12s; }
.btn:hover { transform: translateX(6px); border-color: var(--gold); box-shadow: 0 0 22px rgba(227,180,90,0.25); }
.btn:active { transform: translateX(6px) scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn.primary { background: linear-gradient(180deg, var(--gold-2), var(--gold) 50%, #b5832f); color: #2a1206; border-color: var(--gold-2); }
.btn.danger:hover { border-color: var(--danger); box-shadow: 0 0 22px rgba(214,69,69,0.3); }
.server-status { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.server-status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #777; }
.server-status.online::before { background: #3ddc84; box-shadow: 0 0 10px #3ddc84; }
.server-status.offline::before { background: #e0a030; }
.busy { color: var(--gold-2); font-weight: 600; }

.menu-right { width: 340px; padding: 20px; display: flex; flex-direction: column; gap: 12px; max-height: 92vh; overflow-y: auto; }
.menu-right h2 { margin: 0; font-family: Fredoka, Nunito, sans-serif; color: var(--gold); letter-spacing: 0.08em; font-size: 20px; }
#preview { width: 100%; height: 250px; border-radius: 10px; background: radial-gradient(circle at 50% 35%, #3a1218, #120607 75%); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input[type=text], .field input:not([type]), input#name-input, .code-input {
  background: rgba(0,0,0,0.4); border: 1px solid var(--panel-border); color: var(--text); border-radius: 8px; padding: 10px 12px; font: 600 15px Nunito, sans-serif; outline: none; }
.field input:focus, .code-input:focus { border-color: var(--gold); }
.opt-row { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.opt-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.opt-buttons button { border: 1px solid var(--panel-border); background: rgba(255,255,255,0.04); color: var(--text); border-radius: 7px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.opt-buttons button.active { border-color: var(--gold); background: rgba(227,180,90,0.18); color: var(--gold-2); }
.opt-buttons button.swatch { width: 28px; height: 28px; padding: 0; border-radius: 50%; border-width: 2px; }
.opt-buttons button.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--gold); }

/* Modal */
.modal-card { width: min(480px, 92vw); padding: 26px; position: relative; max-height: 90vh; overflow-y: auto; }
.modal-card h2, .pause-card h2 { margin: 0 0 18px; font-family: Fredoka, Nunito, sans-serif; color: var(--gold); letter-spacing: 0.08em; }
.icon-btn { border: 1px solid var(--panel-border); background: rgba(255,255,255,0.05); color: var(--text); border-radius: 8px; width: 34px; height: 34px; font-size: 16px; line-height: 1; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.close { position: absolute; top: 14px; right: 14px; }
#modal-body p { line-height: 1.55; color: var(--text); }
#modal-body .field { margin-bottom: 16px; }
.code-input { font-size: 28px !important; letter-spacing: 0.4em; text-align: center; text-transform: uppercase; width: 100%; }
.modal-error { color: #ff7b7b; min-height: 20px; font-size: 14px; margin: 8px 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }
.modal-actions .btn { text-align: center; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.04); color: var(--text); border-radius: 8px; padding: 8px; font-weight: 600; }
.seg button.active { border-color: var(--gold); background: rgba(227,180,90,0.18); color: var(--gold-2); }
input[type=range] { width: 100%; accent-color: var(--gold); }
.field.check label { display: flex; gap: 8px; align-items: center; color: var(--text); }
.credits h3 { color: var(--gold-2); margin: 16px 0 4px; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; }
.credits p { margin: 0; color: var(--muted) !important; }

/* Pause */
.pause-card { width: min(360px, 90vw); padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.pause-card .btn { text-align: center; }
.pause-card .btn:hover { transform: none; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
.hud-tl { position: absolute; top: 16px; left: 16px; padding: 12px 18px; min-width: 190px; }
.hud-name { font-weight: 800; letter-spacing: 0.05em; margin-bottom: 4px; }
.balance { display: flex; align-items: center; gap: 8px; font: 800 22px Nunito, sans-serif; color: var(--gold-2); }
.chip-icon { width: 22px; height: 22px; border-radius: 50%; background: repeating-conic-gradient(var(--red) 0 30deg, #fff 30deg 45deg);
  box-shadow: inset 0 0 0 4px var(--red), inset 0 0 0 6px #fff, 0 0 8px rgba(0,0,0,0.6); }
.hud-area { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-family: Fredoka, Nunito, sans-serif; font-weight: 800;
  font-size: 22px; letter-spacing: 0.15em; color: var(--gold-2); text-shadow: 0 2px 12px rgba(0,0,0,0.9); pointer-events: none !important; transition: opacity .4s; }
.hud-tr { position: absolute; top: 16px; right: 16px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; }
.room b { letter-spacing: 0.25em; color: var(--gold-2); font-size: 17px; }
.room { display: flex; align-items: center; gap: 6px; }
.room .icon-btn { width: 28px; height: 28px; font-size: 13px; }
#chat { position: absolute; left: 16px; bottom: 16px; width: 360px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: rgba(18,9,11,0.6); }
#chat-log { height: 170px; overflow-y: auto; font-size: 13px; line-height: 1.45; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; user-select: text; }
#chat-log .sys { color: var(--muted); font-style: italic; }
#chat-log .name { font-weight: 800; color: var(--gold-2); }
#chat-log .self .name { color: #8fd3ff; }
#chat-input { background: rgba(0,0,0,0.45); border: 1px solid var(--panel-border); color: var(--text); border-radius: 8px; padding: 8px 10px; font: 13px Nunito, sans-serif; outline: none; }
#chat-input:focus { border-color: var(--gold); }
#emotes { position: absolute; right: 16px; bottom: 16px; padding: 6px; display: flex; gap: 6px; }
#emotes button { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--panel-border); background: rgba(255,255,255,0.05); font-size: 20px; }
#emotes button:hover { border-color: var(--gold); transform: translateY(-2px); }
.prompt { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); padding: 10px 18px; border-radius: 30px; background: rgba(10,5,6,0.8);
  border: 1px solid var(--gold); font-weight: 600; font-size: 15px; pointer-events: none !important; white-space: nowrap; }
.prompt span { color: var(--muted); font-weight: 400; }
.lock-hint { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); font-size: 13px; color: var(--muted); pointer-events: none !important;
  text-shadow: 0 1px 6px #000; transition: opacity .3s; }
.help { position: absolute; right: 16px; top: 80px; padding: 12px 16px; font-size: 12px; display: flex; flex-direction: column; gap: 5px; pointer-events: none !important; }
.help b { color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px; }

.toast { position: fixed; left: 50%; top: 80px; transform: translate(-50%, -20px); opacity: 0; padding: 12px 20px; border-radius: 10px;
  background: rgba(20,10,12,0.95); border: 1px solid var(--gold); z-index: 60; transition: opacity .25s, transform .25s; pointer-events: none; font-weight: 600; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Nachfüllen */
.refill { margin-top: 8px; width: 100%; border: 1px solid var(--gold); background: rgba(227,180,90,0.15); color: var(--gold-2);
  border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 12px; }
.refill:hover { background: rgba(227,180,90,0.3); }

/* Spiel-Panels */
body.panel-open .help, body.panel-open #emotes { display: none; }
.game-panel { position: absolute; top: 76px; right: 16px; bottom: 16px; width: 360px; padding: 14px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px; background: rgba(14,7,9,0.9); }
.rl-head { display: flex; justify-content: space-between; align-items: center; }
.rl-head h3 { margin: 0; font-family: Fredoka, Nunito, sans-serif; color: var(--gold); letter-spacing: 0.12em; font-size: 20px; }
.rl-status { font-size: 13px; min-height: 18px; color: var(--text); }
.rl-status b { color: var(--gold-2); }
.rl-history { display: flex; gap: 4px; flex-wrap: wrap; min-height: 24px; font-size: 12px; }
.rl-num { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; border-radius: 50%;
  font-weight: 800; font-size: 11px; color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.rl-num.red { background: #b3121f; } .rl-num.black { background: #151515; } .rl-num.green { background: #0f7a3a; }
.rl-board { display: grid; grid-template-columns: 52px repeat(3, 1fr); grid-template-rows: repeat(14, 25px); gap: 2px;
  background: #0b4a29; padding: 4px; border-radius: 8px; border: 2px solid var(--gold-dark); }
.rl-outside { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: #0b4a29; padding: 4px; border-radius: 8px; border: 2px solid var(--gold-dark); }
.rl-outside .rl-cell { height: 30px; }
.rl-cell { position: relative; border: 1px solid rgba(243,236,214,0.55); color: #fff; font: 800 12px Nunito, sans-serif; border-radius: 3px; padding: 0;
  background: transparent; transition: filter .1s, transform .1s; }
.rl-cell.red { background: #a8121d; } .rl-cell.black { background: #161616; } .rl-cell.green { background: #0f7a3a; }
.rl-cell.outside { background: rgba(0,0,0,0.15); font-size: 11px; }
.rl-cell.red-txt { color: #ff6b77; }
.rl-cell.dozen span { display: inline-block; transform: rotate(-90deg); white-space: nowrap; }
.rl-cell:hover { filter: brightness(1.35); }
.rl-cell.winner { box-shadow: 0 0 0 3px var(--gold-2), 0 0 18px var(--gold); z-index: 1; animation: pulse 0.8s infinite alternate; }
@keyframes pulse { to { filter: brightness(1.6); } }
.locked .rl-cell { cursor: not-allowed; opacity: 0.75; }
.rl-badge { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); min-width: 20px; height: 20px; padding: 0 3px; border-radius: 10px;
  background: radial-gradient(circle, #f6d78f 40%, #b5832f); color: #2a1206; font: 800 10px/20px Nunito, sans-serif; border: 2px dashed #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.6); pointer-events: none; z-index: 2; }
.rl-chips { display: flex; gap: 8px; justify-content: center; }
.rl-chip { width: 46px; height: 46px; border-radius: 50%; color: #fff; font: 800 13px Nunito, sans-serif; border: 4px dashed rgba(255,255,255,0.85);
  box-shadow: 0 3px 8px rgba(0,0,0,0.6); transition: transform .1s; }
.rl-chip.c0 { background: #6b6b6b; } .rl-chip.c1 { background: #b3121f; } .rl-chip.c2 { background: #1d7a3a; }
.rl-chip.c3 { background: #151515; } .rl-chip.c4 { background: #6b2a9a; }
.rl-chip.active { transform: translateY(-4px) scale(1.08); box-shadow: 0 0 0 3px var(--gold-2), 0 6px 14px rgba(0,0,0,0.6); }
.rl-info { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.rl-info b { color: var(--gold-2); }
.rl-players { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.rl-players .me { color: #8fd3ff; }
.rl-actions .btn { width: 100%; text-align: center; padding: 10px; font-size: 13px; letter-spacing: 0.05em; }
.rl-actions .btn:hover { transform: none; }
.rl-banner { text-align: center; padding: 12px; border-radius: 10px; border: 1px solid var(--gold); background: rgba(227,180,90,0.12);
  font-size: 16px; line-height: 1.7; }
.rl-banner .win { color: #6dff9a; } .rl-banner .lose { color: #ff8a8a; }
.rl-note { margin: 0; font-size: 11px; color: var(--muted); text-align: center; }

/* Blackjack */
.bj-area, .bj-player { padding: 8px 10px; border-radius: 10px; background: rgba(26,122,138,0.18); border: 1px solid rgba(59,209,255,0.25); }
.bj-players { display: flex; flex-direction: column; gap: 6px; }
.bj-player.me { border-color: #8fd3ff; background: rgba(59,209,255,0.12); }
.bj-label { font-size: 12px; font-weight: 700; color: var(--gold-2); margin-bottom: 4px; }
.bj-cards { display: flex; gap: 4px; flex-wrap: wrap; min-height: 46px; align-items: center; }
.pc { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 32px; height: 46px; border-radius: 4px;
  background: #fbfaf5; color: #111; box-shadow: 0 2px 4px rgba(0,0,0,0.5); font-family: Georgia, serif; line-height: 1; animation: deal .25s ease-out; }
.pc b { font-size: 14px; } .pc i { font-style: normal; font-size: 15px; }
.pc.red { color: #c0141f; }
.pc.back { background: repeating-linear-gradient(45deg, #8a1020 0 4px, #6a0c18 4px 8px); border: 2px solid #e3b45a; }
@keyframes deal { from { transform: translateY(-12px) rotate(-8deg); opacity: 0; } }
.bj-hand { padding: 4px; border-radius: 8px; border: 1px solid transparent; }
.bj-hand + .bj-hand { margin-top: 4px; }
.bj-hand.active { border-color: var(--gold); box-shadow: 0 0 12px rgba(227,180,90,0.4); }
.bj-hand-info { font-size: 12px; color: var(--muted); margin-top: 3px; }
.bj-res { font-weight: 800; margin-left: 4px; }
.bj-res.win, .bj-res.blackjack { color: #6dff9a; } .bj-res.lose, .bj-res.bust { color: #ff8a8a; } .bj-res.push { color: var(--gold-2); }
.bj-empty { font-size: 13px; padding: 4px 0; }
.bj-bet-row { display: flex; flex-direction: column; gap: 8px; }
.bj-bet-buttons, .bj-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.bj-bet-buttons .btn, .bj-actions .btn { text-align: center; padding: 10px 6px; font-size: 13px; letter-spacing: 0.04em; }
.bj-bet-buttons .btn:hover, .bj-actions .btn:hover { transform: none; }

/* Spielautomat */
.sl-canvas { width: 100%; aspect-ratio: 420 / 300; border-radius: 10px; border: 3px solid var(--gold); box-shadow: 0 0 18px rgba(255,190,80,0.25); background: #000; }
.sl-info { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.sl-info b { color: var(--gold-2); }
.sl-label { font-size: 12px; color: var(--muted); text-align: center; }
.sl-buttons { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; }
.sl-buttons .btn { text-align: center; padding: 12px 6px; font-size: 14px; letter-spacing: 0.06em; }
.sl-buttons .btn:hover { transform: none; }
.sl-buttons .btn:disabled { opacity: 0.55; cursor: default; }
.sl-spin small { font-weight: 600; opacity: 0.7; font-size: 10px; }
.sl-pay { font-size: 13px; }
.sl-pay summary { cursor: pointer; color: var(--gold-2); }
.sl-pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: 8px 0 4px; }
.sl-pay-grid b { color: var(--gold-2); }
.sl-pay p { margin: 4px 0 0; font-size: 11px; }
.sl-stats { font-size: 12px; text-align: center; min-height: 15px; }

/* Poker */
.pk-board-wrap { padding: 10px; border-radius: 10px; background: rgba(20,90,50,0.35); border: 1px solid rgba(86,255,138,0.25); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pk-pot { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pk-pot b { color: var(--gold-2); font-size: 15px; }
.pk-seats { display: flex; flex-direction: column; gap: 4px; }
.pk-seat { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 8px; padding: 6px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); font-size: 13px; }
.pk-seat.me { border-color: #8fd3ff; }
.pk-seat.turn { border-color: var(--gold-2); box-shadow: 0 0 10px rgba(255,200,90,0.35); }
.pk-seat.folded { opacity: 0.5; }
.pk-name { font-weight: 700; }
.pk-chips { color: var(--gold-2); }
.pk-chips em { color: var(--muted); font-style: normal; }
.pk-tag { display: inline-block; font-size: 10px; padding: 1px 5px; border-radius: 6px; background: rgba(255,255,255,0.12); margin-left: 2px; font-weight: 600; }
.pk-tag.dealer { background: #f5f0e0; color: #111; }
.pk-tag.allin { background: #b3121f; }
.pk-mini .pc { width: 24px; height: 34px; font-size: 10px; }
.pk-mini { min-height: 0; }
.pk-me { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: rgba(59,209,255,0.12); border: 1px solid rgba(59,209,255,0.35); }
.pk-hand { font-weight: 800; color: var(--gold-2); }
.pk-join, .pk-actions { display: flex; flex-direction: column; gap: 8px; }
.pk-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pk-row input[type=range] { flex: 1; accent-color: var(--gold); }
.pk-num { width: 80px; padding: 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.4); color: var(--text); }
.pk-quick, .pk-manage { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pk-manage { grid-template-columns: 1fr 1fr; }
.pk-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pk-quick .btn, .pk-btns .btn, .pk-manage .btn, .pk-join .btn { text-align: center; padding: 9px 6px; font-size: 13px; letter-spacing: 0.03em; }
.pk-quick .btn:hover, .pk-btns .btn:hover, .pk-manage .btn:hover, .pk-join .btn:hover { transform: none; }
.pk-btns .btn:disabled, .pk-join .btn:disabled, .pk-manage .btn:disabled { opacity: 0.5; cursor: default; }
.pk-solo { font-size: 13px; color: var(--gold-2); }
/* Ziel-Modus */
.goal-hud { position: absolute; top: 96px; left: 16px; width: 270px;
  padding: 10px 14px 10px; border-radius: 18px; background: rgba(36,18,74,0.88); border: 3px solid #ffd23f; box-shadow: 0 6px 0 rgba(0,0,0,0.35), 0 10px 30px rgba(0,0,0,0.4);
  pointer-events: none !important; }
.goal-top { display: flex; justify-content: space-between; align-items: baseline; font-family: Fredoka, Nunito, sans-serif; color: #ffd23f; letter-spacing: 0.08em; }
.goal-top b { font-size: 17px; font-weight: 700; }
.goal-top span { font: 700 20px Fredoka, Nunito, sans-serif; letter-spacing: 0.04em; color: #fff; font-variant-numeric: tabular-nums; }
.goal-total { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; font-family: Fredoka, Nunito, sans-serif; font-variant-numeric: tabular-nums; }
#goal-sum { font-size: 38px; font-weight: 700; color: #ffd23f; line-height: 1.05; text-shadow: 0 3px 0 rgba(0,0,0,0.35); transition: color .3s; }
#goal-sum.done { color: #5dff9a; }
#goal-sum.bump { animation: goal-bump .35s ease; }
@keyframes goal-bump { 40% { transform: scale(1.15); } }
#goal-of { font-size: 16px; color: #cbb8ff; font-weight: 600; }
.goal-board { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; font: 600 13px Fredoka, Nunito, sans-serif; }
.goal-board div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 8px; border-radius: 8px; background: rgba(255,255,255,0.06); }
.goal-board div.me { background: rgba(93,255,154,0.12); }
.goal-board .pos { color: #5dff9a; font-variant-numeric: tabular-nums; }
.goal-board .neg { color: #ff6a7a; font-variant-numeric: tabular-nums; }
.goal-board .zero { color: #cbb8ff; font-variant-numeric: tabular-nums; }
.goal-board .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Große, aufsteigende Gewinnzahlen in der Bildmitte */
.win-pops { position: absolute; left: 50%; top: 46%; width: 0; height: 0; pointer-events: none !important; z-index: 25; }
.win-pop { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font: 700 64px Fredoka, Nunito, sans-serif; color: #5dff9a;
  text-shadow: 0 4px 0 #0d5a2c, 0 0 24px rgba(93,255,154,0.7); animation: win-pop 2.2s ease-out forwards; }
.win-pop.big { font-size: 92px; color: #ffd23f; text-shadow: 0 5px 0 #7a4a00, 0 0 34px rgba(255,210,63,0.8); }
.win-pop.loss { font-size: 44px; color: #ff6a7a; text-shadow: 0 3px 0 #5a0d18; }
@keyframes win-pop { 0% { opacity: 0; transform: translate(-50%, -20%) scale(0.5); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  30% { transform: translate(-50%, -50%) scale(1); } 65% { opacity: 1; transform: translate(-50%, -90%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); } }
.goal-hud.urgent .goal-top span { color: #ff5a6a; animation: goal-pulse .6s infinite alternate; }
@keyframes goal-pulse { from { transform: scale(1); } to { transform: scale(1.12); } }
.goal-bar { position: relative; margin-top: 6px; height: 22px; border-radius: 11px; background: rgba(255,255,255,0.08); overflow: hidden; border: 1px solid rgba(255,255,255,0.12); }
.goal-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 11px; background: linear-gradient(90deg, #ff5fa2, #ffd23f); transition: width .5s ease; }
.goal-fill.done { background: linear-gradient(90deg, #2fbf6a, #7dffb0); }
#goal-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 13px Nunito, sans-serif; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9); font-variant-numeric: tabular-nums; }
.goal-sub { margin-top: 4px; font-size: 11px; color: var(--muted); text-align: center; }
.goal-banner { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); text-align: center; padding: 22px 38px; border-radius: 20px;
  background: rgba(20,10,28,0.92); border: 3px solid var(--gold); box-shadow: 0 0 60px rgba(255,200,90,0.35); pointer-events: none !important;
  animation: goal-pop .45s cubic-bezier(.2,1.6,.4,1); z-index: 30; }
body:has(.goal-banner:not(.hidden)) .hud-area { opacity: 0; }
@media (max-height: 640px) { .goal-board { display: none; } }
.goal-banner h2 { margin: 0 0 6px; font-family: Fredoka, Nunito, sans-serif; font-weight: 700; font-size: 46px; letter-spacing: 0.06em; color: #ffd23f; text-shadow: 0 4px 0 rgba(0,0,0,0.35); }
.goal-banner.lost { border-color: #ff4a5a; box-shadow: 0 0 60px rgba(255,60,80,0.35); }
.goal-banner.lost h2 { color: #ff6a78; }
.goal-banner p { margin: 4px 0; font-size: 16px; }
@keyframes goal-pop { from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

/* Ladefehler / Hinweise */
.load-error { color: var(--gold-2); font-family: Fredoka, Nunito, sans-serif; margin: 24px 0 8px; }
.load-error-text { max-width: 460px; text-align: center; color: var(--text); line-height: 1.5; }
.touch-hint { font-size: 13px; color: var(--gold-2); margin-top: 8px; }

/* Würfeltisch */
.cr-top { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; background: rgba(20,60,120,0.3); border: 1px solid rgba(91,200,255,0.25); }
.cr-puck { width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-align: center; font: 800 12px Nunito, sans-serif;
  background: #222; color: #ddd; border: 3px solid #888; flex: none; }
.cr-puck.on { background: #f5f0e0; color: #111; border-color: var(--gold); box-shadow: 0 0 12px rgba(255,210,100,0.5); }
.cr-dice { font-size: 40px; line-height: 1; color: #f4f1ea; display: flex; align-items: center; gap: 4px; min-width: 96px; }
.cr-dice small { font-size: 18px; color: var(--gold-2); font-weight: 800; margin-left: 6px; }
.cr-rolling { font-size: 28px; animation: cr-shake .25s infinite alternate; display: inline-block; }
@keyframes cr-shake { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.cr-history { display: flex; flex-wrap: wrap; gap: 3px; font-size: 11px; color: var(--muted); }
.cr-history span { padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,0.08); }
.cr-shooter { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; min-height: 36px; }
.cr-shooter .btn { padding: 8px 12px; font-size: 13px; }
.cr-shooter .btn:hover { transform: none; }
.cr-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cr-field { display: grid; grid-template-columns: 1fr auto; gap: 2px 6px; text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  background: rgba(29,122,58,0.35); border: 1px solid rgba(255,255,255,0.15); color: var(--text); font: 600 13px Nunito, sans-serif; }
.cr-field.line { background: rgba(29,122,58,0.55); }
.cr-field:last-child { grid-column: span 2; }
.cr-field:hover:not(:disabled) { border-color: var(--gold-2); }
.cr-field:disabled { opacity: 0.45; cursor: default; }
.cr-field.mine { border-color: #8fd3ff; box-shadow: inset 0 0 0 1px #8fd3ff; }
.cr-name { font-weight: 800; }
.cr-pay { color: var(--gold-2); font-size: 11px; }
.cr-amt { grid-column: span 2; font-size: 12px; min-height: 15px; }
.cr-amt b { color: #8fd3ff; }
.cr-rules { font-size: 12px; display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.pk-log { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }

@media (max-width: 900px) {
  #menu { flex-direction: column; justify-content: flex-start; overflow-y: auto; padding: 24px 16px; background: rgba(8,3,5,0.85); }
  .menu-right { width: 100%; max-width: 460px; max-height: none; }
  #chat { width: calc(100% - 32px); }
  .help { display: none; }
}

/* =====================================================================
   DESIGNSYSTEM „Tusche & Pappe“
   Ein Look wie gedruckt/ausgeschnitten: dunkle Tuscheränder, harte Schatten
   ohne Weichzeichner, wenige feste Farben, gedrückte Buttons. Kein Glow,
   keine Glas-Unschärfe, keine Farbverläufe in Bedienelementen.
   ===================================================================== */
:root {
  --ink: #1d0f38;
  --paper: #fff3dc;
  --sun: #ffcc33;
  --sun-dark: #e0a400;
  --pink: #ff4f8b;
  --teal: #22c7b8;
  --plum: #3a1f6e;
  --plum-2: #4d2c8f;
  --plum-3: #2a1552;
  --gold: var(--sun);
  --gold-2: #ffe08a;
  --muted: #c7b6ee;
  --text: var(--paper);
  --panel: var(--plum);
  --panel-border: var(--ink);
  --bw: 3px;                         /* Tuschestrich */
  --lift: 0 5px 0 var(--ink);        /* harter Schatten */
}
html, body { font-family: Nunito, system-ui, sans-serif; font-weight: 700; }
.ico { width: 20px; height: 20px; display: block; flex: none; }
.die { width: 34px; height: 34px; display: inline-block; vertical-align: middle; }
.ico.cherry { width: 18px; height: 18px; display: inline-block; vertical-align: -3px; }

/* Flächen */
.card { background: var(--plum); border: var(--bw) solid var(--ink); border-radius: 16px; box-shadow: var(--lift); backdrop-filter: none; }
.card::before { content: none; }
#chat { background: rgba(42,21,82,0.82); }
.game-panel { background: var(--plum); }
.overlay { background: rgba(29,15,56,0.55); }

/* Überschriften: cremeweiß mit Tusche-Schatten */
.rl-head h3, .menu-right h2, .modal-card h2, .pause-card h2 {
  font-family: Fredoka, Nunito, sans-serif; font-weight: 700; letter-spacing: 0.02em; color: var(--paper);
  text-shadow: 0 3px 0 var(--ink); text-transform: none; }
.rl-head h3 { font-size: 24px; }

/* Buttons: Pappe mit Tuscherand, beim Drücken „eingedrückt“ */
.btn { background: var(--plum-2); color: var(--paper); border: var(--bw) solid var(--ink); border-radius: 14px; box-shadow: var(--lift);
  font: 700 17px Fredoka, Nunito, sans-serif; letter-spacing: 0.04em; padding: 12px 22px; transition: transform .08s, box-shadow .08s, background .12s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); border-color: var(--ink); background: #5a36a3; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.btn.primary { background: var(--sun); color: var(--ink); border-color: var(--ink); }
.btn.primary:hover { background: #ffd65c; }
.btn.danger { background: var(--pink); color: var(--paper); }
.btn.danger:hover { background: #ff6b9e; border-color: var(--ink); box-shadow: 0 7px 0 var(--ink); }
.btn:disabled { opacity: 0.45; }
.menu-buttons .btn { text-align: left; }
.menu-buttons .btn:hover { transform: translate(4px, -2px); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; background: var(--plum-2); color: var(--paper);
  border: var(--bw) solid var(--ink); border-radius: 10px; box-shadow: 0 3px 0 var(--ink); width: 36px; height: 36px; padding: 0; transition: transform .08s, box-shadow .08s; }
.icon-btn:hover { color: var(--sun); border-color: var(--ink); transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.icon-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.room .icon-btn { width: 30px; height: 30px; }
.room .icon-btn .ico { width: 16px; height: 16px; }

/* Logo: gestapelter Schriftzug, leicht schräg, mit Tusche-Kontur */
.logo { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; color: var(--sun); background: none; -webkit-background-clip: initial; background-clip: initial;
  filter: none; letter-spacing: 0.02em; line-height: 0.9; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink); transform: rotate(-3deg); transform-origin: left center; font-size: clamp(54px, 7.5vw, 104px); }
.logo span { display: inline-block; font-size: 0.45em; letter-spacing: 0.04em; color: var(--paper); background: var(--pink); -webkit-text-stroke: 0;
  padding: 2px 16px 6px; border: var(--bw) solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink); text-shadow: none;
  transform: rotate(-4deg) translateY(-6px); margin-bottom: 6px; }
.tagline { color: var(--paper); font-weight: 700; font-size: 16px; letter-spacing: 0; max-width: 380px; line-height: 1.4; }

/* Menü-Hintergrund: ruhige Fläche statt Verlauf */
#menu { background: linear-gradient(90deg, rgba(29,15,56,0.9) 0 36%, rgba(29,15,56,0) 60%); }
#loading { background: var(--plum-3); }
.spinner { border: 5px solid var(--plum-2); border-top-color: var(--sun); }
#preview { background: var(--plum-3); border: var(--bw) solid var(--ink); border-radius: 12px; }
.server-status { color: var(--paper); font-weight: 700; }
.server-status.online::before { background: var(--teal); box-shadow: 0 0 0 2px var(--ink); }
.server-status.offline::before { background: var(--sun); box-shadow: 0 0 0 2px var(--ink); }

/* Eingaben */
.field input[type=text], .field input:not([type]), input#name-input, .code-input, #chat-input, .pk-num {
  background: var(--plum-3); border: var(--bw) solid var(--ink); border-radius: 12px; color: var(--paper); font-family: Nunito, sans-serif; font-weight: 800; }
.field input:focus, .code-input:focus, #chat-input:focus { border-color: var(--sun); }
.opt-buttons button, .seg button { background: var(--plum-2); border: 2px solid var(--ink); color: var(--paper); border-radius: 10px; box-shadow: 0 3px 0 var(--ink); font-weight: 800; }
.opt-buttons button.active, .seg button.active { background: var(--sun); color: var(--ink); border-color: var(--ink); }
.opt-buttons button.swatch { border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.opt-buttons button.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 3px var(--sun), 0 3px 0 3px var(--ink); }
kbd { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 0 2px 0 var(--ink); font-family: Nunito, sans-serif; font-weight: 900; }

/* HUD */
.balance { font: 700 26px Fredoka, Nunito, sans-serif; color: var(--sun); text-shadow: 0 2px 0 var(--ink); }
.chip-icon { box-shadow: inset 0 0 0 4px var(--pink), inset 0 0 0 6px #fff, 0 0 0 2px var(--ink); background: repeating-conic-gradient(var(--pink) 0 30deg, #fff 30deg 45deg); }
.hud-name { font-family: Fredoka, Nunito, sans-serif; font-weight: 600; color: var(--paper); }
.hud-area { font-family: Fredoka, Nunito, sans-serif; font-weight: 700; letter-spacing: 0.04em; color: var(--paper); font-size: 24px;
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.room b { color: var(--sun); letter-spacing: 0.18em; }
#emotes { gap: 8px; }
#emotes button { position: relative; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; color: var(--paper);
  background: var(--plum-2); border: var(--bw) solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }
#emotes button .ico { width: 26px; height: 26px; }
#emotes button kbd { position: absolute; right: -6px; bottom: -8px; font-size: 10px; min-width: 0; padding: 0 4px; }
#emotes button:hover { color: var(--sun); transform: translateY(-2px); border-color: var(--ink); }
.prompt { background: var(--paper); color: var(--ink); border: var(--bw) solid var(--ink); box-shadow: var(--lift); font-weight: 800; }
.prompt span { color: #6a5590; }
.prompt kbd { background: var(--sun); }
.lock-hint { color: var(--paper); text-shadow: 0 2px 0 var(--ink); font-weight: 800; }
.toast { background: var(--sun); color: var(--ink); border: var(--bw) solid var(--ink); box-shadow: var(--lift); font-weight: 800; }
.help { background: var(--plum); }
.help b { color: var(--sun); }
#chat-log .name { color: var(--sun); }
#chat-log .self .name { color: var(--teal); }
#chat-log .sys { color: var(--muted); font-style: normal; font-weight: 700; }

/* Ziel-Panel + Banner im selben Stil */
.goal-hud { background: var(--plum); border: var(--bw) solid var(--ink); box-shadow: var(--lift); border-radius: 16px; }
.goal-top, .goal-top b { color: var(--sun); }
#goal-sum { color: var(--sun); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
#goal-sum.done { color: #6dffa8; }
.goal-bar { background: var(--plum-3); border: 2px solid var(--ink); }
.goal-fill { background: var(--pink); border-right: 2px solid var(--ink); }
.goal-fill.done { background: var(--teal); }
#goal-text { text-shadow: 0 1px 0 var(--ink); }
.goal-board div { background: var(--plum-3); }
.goal-board div.me { background: #2b6a60; }
.goal-banner { background: var(--plum); border: 4px solid var(--ink); box-shadow: 0 8px 0 var(--ink); }
.goal-banner h2 { color: var(--sun); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink); }
.goal-banner.lost { border-color: var(--ink); box-shadow: 0 8px 0 var(--ink); }
.goal-banner.lost h2 { color: var(--pink); }
.win-pop { -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); color: #6dffa8; }
.win-pop.big { color: var(--sun); text-shadow: 0 7px 0 var(--ink); }
.win-pop.loss { color: var(--pink); text-shadow: 0 5px 0 var(--ink); }

/* Spiel-Panels */
.rl-banner { background: var(--paper); color: var(--ink); border: var(--bw) solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-weight: 800; }
.rl-banner .win { color: #11804a; } .rl-banner .lose { color: #d1124c; }
.rl-banner .muted { color: #6a5590; }
.rl-status b, .rl-info b { color: var(--sun); }
.rl-chip { border: 3px dashed rgba(255,255,255,0.9); box-shadow: 0 0 0 3px var(--ink), 0 4px 0 3px var(--ink); font-family: Fredoka, Nunito, sans-serif; }
.rl-chip.active { box-shadow: 0 0 0 3px var(--ink), 0 0 0 7px var(--sun), 0 6px 0 7px var(--ink); }
.rl-board, .rl-outside { border: var(--bw) solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.rl-cell.winner { box-shadow: 0 0 0 3px var(--sun), 0 0 0 6px var(--ink); }
.bj-area, .bj-player, .pk-seat, .pk-me, .pk-board-wrap, .cr-top { border: 2px solid var(--ink); background: var(--plum-3); }
.bj-player.me, .pk-seat.me { border-color: var(--teal); }
.pk-seat.turn { border-color: var(--sun); box-shadow: 0 0 0 2px var(--sun); }
.pc { border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.sl-canvas { border: var(--bw) solid var(--ink); box-shadow: var(--lift); }
.cr-field { border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); background: #1f7a4e; color: var(--paper); }
.cr-field.line { background: #17663f; }
.cr-field.mine { box-shadow: 0 0 0 3px var(--teal), 0 3px 0 3px var(--ink); border-color: var(--ink); }
.cr-puck { border: 3px solid var(--ink); }
.cr-puck.on { background: var(--paper); border-color: var(--ink); box-shadow: 0 0 0 3px var(--sun); }
.cr-dice { gap: 6px; }
.cr-shooter .btn { display: inline-flex; align-items: center; gap: 6px; }
.cr-rolling { display: inline-flex; gap: 4px; }
.cr-rolling .ico { width: 30px; height: 30px; }
.sl-sym { -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; font-weight: 900; }
details summary { color: var(--sun); }
