:root {
  --bg: #1d2321;
  --panel: rgba(22, 27, 24, 0.9);
  --panel-solid: #1b211e;
  --raised: #29312d;
  --text: #f4f0e6;
  --muted: #b5afa2;
  --accent: #f2b33d;
  --accent-ink: #2a2110;
  --good: #6fd36f;
  --bad: #eb5757;
  --cat: #f08a3c;
  --mouse: #cfd8e3;
  --line: rgba(255, 255, 255, 0.12);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 15px/1.4 Fredoka, system-ui, sans-serif; }
canvas#game { display: block; width: 100vw; height: 100vh; cursor: crosshair; }
button, input { font: inherit; }
button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--text); cursor: pointer; transition: transform 0.08s, border-color 0.15s, background 0.15s; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { width: 100%; margin-top: 14px; padding: 11px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 16px; border: none; box-shadow: 0 4px 0 #b9831d; }
button.primary:hover { background: #ffc552; }
button.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #b9831d; }

/* ---------- Fenster ---------- */
.panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 16px; padding: 22px 26px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5); animation: pop 0.25s ease-out; }
.panel.wide { width: min(640px, calc(100vw - 32px)); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(0.97); } }
.panel h1, .panel h2 { margin: 0 0 8px; font-weight: 700; letter-spacing: 0.3px; }
.panel h1 { font-size: 38px; color: var(--accent); text-align: center; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.panel h2 { font-size: 24px; }
.panel h3 { margin: 14px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 600; }
.lead { text-align: center; color: var(--muted); margin: 0 0 8px; }
.center { text-align: center; }
#hero { display: block; width: 100%; height: auto; margin: -6px 0 2px; }
.panel label { display: block; margin: 12px 0; color: var(--muted); font-size: 14px; }
.panel input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #0f1312; color: var(--text); }
.panel input:focus { outline: none; border-color: var(--accent); }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* Lobby */
.share { display: flex; gap: 8px; }
.share input { flex: 1; margin: 0; font-size: 13px; color: var(--muted); }
.roles { display: grid; grid-template-columns: 1fr 0.8fr 1fr; gap: 10px; margin: 16px 0 4px; }
.roleCard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 12px; text-align: center; border-radius: var(--radius); border-width: 2px; }
.roleCard img { width: 64px; height: 64px; }
.roleCard b { font-size: 18px; }
.roleCard small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.roleCard.active { border-color: var(--accent); background: rgba(242, 179, 61, 0.12); }
.lobbyCols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
#lobbyList { list-style: none; padding: 0; margin: 0; }
#lobbyList li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
#lobbyList li .me { color: var(--accent); font-size: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.bots { display: flex; align-items: center; gap: 10px; }
.bots button { width: 36px; height: 36px; padding: 0; font-size: 18px; }
.bots b { font-size: 22px; min-width: 1.5em; text-align: center; }

/* Ende */
#endText { text-align: center; font-size: 32px; }
#endText.win { color: var(--accent); }
#stats { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
#stats th { text-align: right; color: var(--muted); font-weight: 500; font-size: 12px; padding: 4px 6px; }
#stats th:first-child, #stats td:first-child { text-align: left; }
#stats td { text-align: right; padding: 6px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
#stats tr.mine td { color: var(--accent); }

/* Hilfe */
.helpCols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
dt { font-weight: 600; white-space: nowrap; }
dt::before { content: ''; }
dd { margin: 0; color: var(--muted); }
dl.general { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- Spieloberfläche ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hud > #banner, #hud > #feed, #hud > #info, #hud > #tooltip { pointer-events: none; }
#top { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 16px; background: var(--panel); padding: 6px 8px 6px 14px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
#timer { display: flex; flex-direction: column; gap: 3px; min-width: 74px; }
#clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; line-height: 1; }
.meter { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
#money { color: var(--accent); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; min-width: 64px; }
#money.bump { animation: bump 0.35s; }
@keyframes bump { 40% { transform: scale(1.25); } }
#selfHp { position: relative; width: 110px; height: 16px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
#selfHp i { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--good); transition: width 0.2s, background 0.2s; }
#selfHp span { position: relative; display: block; text-align: center; font-size: 11px; line-height: 16px; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
.iconBtn { width: 32px; height: 32px; padding: 0; border-radius: 50%; background: transparent; border-color: transparent; font-size: 16px; font-weight: 700; }
.iconBtn:hover { background: var(--raised); }
#info { position: absolute; top: 62px; left: 50%; transform: translateX(-50%); padding: 4px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); font-size: 14px; white-space: nowrap; transition: opacity 0.2s; }
#info:empty { opacity: 0; }
#info.danger { background: rgba(170, 30, 30, 0.75); animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { opacity: 0.7; } }

#roster { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 4px; width: 180px; }
.rosterRow { display: grid; grid-template-columns: 10px 1fr; gap: 3px 8px; align-items: center; background: var(--panel); padding: 5px 9px; border-radius: 9px; font-size: 13px; border: 1px solid transparent; }
.rosterRow.me { border-color: rgba(242, 179, 61, 0.5); }
.rosterRow.dead { opacity: 0.55; }
.rosterRow .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rosterRow .meter { grid-column: 2; height: 4px; }
.rosterRow .meter i { background: var(--good); }
.rosterRow.cat .meter i { background: var(--cat); }

#minimap { position: absolute; right: 10px; top: 10px; cursor: pointer; width: 192px; height: 120px; border: 2px solid var(--line); border-radius: 10px; background: #000; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
#feed { position: absolute; right: 10px; top: 142px; width: 260px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#feed div { background: var(--panel); padding: 4px 10px; border-radius: 8px; font-size: 13px; animation: slideIn 0.25s ease-out; transition: opacity 0.6s; }
#feed div.old { opacity: 0; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } }

#banner { position: absolute; top: 26%; left: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 42px; font-weight: 700; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 30px rgba(0, 0, 0, 0.5); opacity: 0; white-space: nowrap; }
#banner small { display: block; font-size: 18px; font-weight: 500; color: var(--text); }
#banner.show { animation: banner 2.6s ease-out forwards; }
#banner.good { color: var(--good); }
#banner.bad { color: #ff7b7b; }
#banner.gold { color: var(--accent); }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 20% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

#tip { position: absolute; bottom: 104px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 32px)); background: rgba(242, 179, 61, 0.95); color: var(--accent-ink); padding: 7px 8px 7px 14px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
#tip:not(.show) { display: none; }
#tip button { background: transparent; border: none; color: var(--accent-ink); padding: 0 6px; font-size: 18px; line-height: 1; }

/* Aktionsleiste */
#bar { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 6px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35); }
#bar .sep { width: 1px; align-self: stretch; margin: 4px 4px; background: var(--line); }
.slot { position: relative; width: 74px; height: 78px; padding: 6px 4px 4px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1px; border-radius: 11px; overflow: hidden; }
.slot .ico { width: 34px; height: 34px; display: grid; place-items: center; font-size: 25px; line-height: 1; }
.slot .ico img { width: 34px; height: 34px; }
.slot .name { font-size: 11.5px; line-height: 1.1; text-align: center; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.slot .cost { font-size: 11px; color: var(--accent); font-weight: 600; }
.slot .key { position: absolute; top: 3px; left: 4px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 4px; background: rgba(0, 0, 0, 0.45); font-size: 10px; line-height: 16px; font-weight: 600; color: var(--muted); }
.slot .lvl { position: absolute; top: 3px; right: 4px; font-size: 10px; font-weight: 700; color: var(--accent); }
.slot .cd { position: absolute; inset: 0; background: conic-gradient(rgba(0, 0, 0, 0.62) calc(var(--p, 0) * 1turn), transparent 0); pointer-events: none; }
.slot .cdText { position: absolute; top: 18px; left: 0; right: 0; text-align: center; font-size: 20px; font-weight: 700; text-shadow: 0 2px 4px #000; }
.slot.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.slot.active .cost, .slot.active .lvl { color: var(--accent-ink); }
.slot.poor .cost { color: var(--bad); }
.slot.poor .ico, .slot.wait .ico, .slot.inactive .ico { filter: grayscale(0.8) brightness(0.7); }
.slot.ready { box-shadow: inset 0 0 0 2px rgba(111, 211, 111, 0.6); }
.slot.flash { animation: flash 0.4s; }
@keyframes flash { 50% { background: #5a3a3a; } }

#tooltip { position: absolute; bottom: 112px; width: 240px; padding: 10px 12px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 10px; font-size: 13px; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45); }
#tooltip b { display: block; font-size: 14px; margin-bottom: 2px; }
#tooltip .tcost { color: var(--accent); font-weight: 600; }
#tooltip p { margin: 4px 0 0; color: var(--muted); }

@media (max-width: 900px) {
  #feed, #roster { display: none; }
  .slot { width: 58px; height: 66px; }
  .slot .name { font-size: 10px; }
  .slot .ico { font-size: 20px; width: 28px; height: 28px; }
  .slot .ico img { width: 28px; height: 28px; }
  #selfHp { width: 70px; }
}
@media (max-width: 600px) {
  #minimap { width: 128px; height: 80px; }
  .lobbyCols, .helpCols, .roles { grid-template-columns: 1fr; }
}

/* Lautstärke-Regler unter dem Lautsprecher-Knopf */
#volWrap { position: relative; }
#top:has(#volPanel:not([hidden])) { z-index: 30; }
#volPanel { position: absolute; top: 42px; right: -8px; z-index: 20; display: flex; flex-direction: column; gap: 10px; width: 210px; padding: 12px 14px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); }
#volPanel[hidden] { display: none; }
#volPanel label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
#volPanel input[type=range] { width: 100%; accent-color: var(--accent); cursor: pointer; }
#volPanel button { padding: 6px 10px; font-size: 13px; }

/* Viele Felder (Maus mit Kampfeinheiten): Aktionsleiste etwas schmaler */
#bar.many { gap: 4px; padding: 6px; }
#bar.many .slot { width: 62px; height: 72px; }
#bar.many .slot .name { font-size: 10.5px; }
#bar.many .slot .ico, #bar.many .slot .ico img { width: 30px; height: 30px; }

/* Phase 4: Lobby mit Teams und Karte, Chat */
.roleCard .dice { font-size: 44px; line-height: 64px; height: 64px; }
.bots span { min-width: 84px; color: var(--muted); font-size: 14px; }
.bots + .bots { margin-top: 6px; }
.maps { display: flex; gap: 8px; }
.maps button { flex: 1; }
.maps button.active { border-color: var(--accent); background: rgba(242, 179, 61, 0.12); }
#chat { position: fixed; left: 12px; bottom: 12px; width: min(340px, calc(100vw - 24px)); z-index: 30; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
#chat[data-mode="join"] { display: none; }
#chatLog { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
#chatLog div { background: var(--panel); padding: 4px 10px; border-radius: 8px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; transition: opacity 0.6s; animation: slideIn 0.25s ease-out; }
#chatLog div.sys { color: var(--muted); font-style: italic; }
#chat[data-mode="playing"] #chatLog div.old { opacity: 0; }
#chatInput { pointer-events: auto; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: #0f1312; color: var(--text); font: inherit; }
#chatInput:focus { outline: none; border-color: var(--accent); }
#chat[data-mode="playing"] { bottom: 112px; }
#chat[data-mode="playing"]:not(.typing) #chatInput { display: none; }
#chat[data-mode="ended"] #chatInput { display: none; }

/* UI-Runde nach Phase 4 */
#chat.inline { position: static; width: auto; margin-top: 14px; pointer-events: auto; }
#chat.inline #chatLog { max-height: 132px; overflow-y: auto; }
#chat.inline #chatLog:empty { display: none; }
#chat.inline #chatLog div { background: rgba(255, 255, 255, 0.05); }
[data-help].other { opacity: 0.5; }
[data-help].other:hover { opacity: 1; }
/* Kleinere Bildschirme: Leiste mit vielen Feldern und Lobby kompakter */
@media (max-width: 1150px) {
  #bar.many { gap: 3px; padding: 5px; }
  #bar.many .slot { width: 59px; height: 68px; padding: 6px 1px 4px; }
  #bar.many .slot .name { font-size: 10px; }
  #bar.many .slot .ico, #bar.many .slot .ico img { width: 27px; height: 27px; }
  #bar.many .sep { margin: 4px 2px; }
}
@media (max-height: 720px) {
  .roleCard { padding: 10px 10px; }
  .roleCard img { width: 46px; height: 46px; }
  .roleCard .dice { font-size: 34px; line-height: 46px; height: 46px; }
  .roleCard small { font-size: 11.5px; }
  #chat.inline #chatLog { max-height: 72px; }
  .panel { padding: 16px 22px; }
}

/* Handy und Tablet (Touch): größere Ziele, keine Tastenkürzel, Platz für Notch und Adressleiste */
html, body { overscroll-behavior: none; }
canvas#game, #minimap { touch-action: none; }
.touchOnly { display: none; }
body.touch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
body.touch input { -webkit-user-select: text; user-select: text; }
body.touch button { touch-action: manipulation; }
body.touch dl.touchOnly { display: grid; }
body.touch .iconBtn.touchOnly { display: inline-block; }
body.touch .keysOnly, body.touch .helpCols dl { display: none; }
body.touch .slot .key { display: none; }
body.touch .slot .ico { margin-top: 2px; }
body.touch #bar { max-width: calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)); overflow-x: auto; scrollbar-width: none; touch-action: pan-x; overscroll-behavior: contain; bottom: calc(10px + env(safe-area-inset-bottom)); }
body.touch #bar::-webkit-scrollbar { display: none; }
body.touch .slot { flex: none; }
body.touch .slot > * { flex: none; }
#help, #end { z-index: 40; } /* über dem Chat */
#tooltip { z-index: 35; }
body.touch #roster { left: max(10px, env(safe-area-inset-left)); }
body.touch #minimap { right: max(10px, env(safe-area-inset-right)); }
body.touch #feed { right: max(10px, env(safe-area-inset-right)); }
body.touch #chat { left: max(12px, env(safe-area-inset-left)); }

/* Handy quer: wenig Höhe */
@media (max-height: 500px) {
  #top { top: 6px; gap: 10px; padding: 3px 6px 3px 12px; }
  #clock { font-size: 14px; }
  #money { font-size: 15px; min-width: 52px; }
  .iconBtn { width: 30px; height: 30px; }
  #info { top: 46px; font-size: 13px; }
  #minimap { width: 128px; height: 80px; top: 6px; }
  #feed { top: 92px; }
  #roster { top: 6px; width: 150px; }
  .rosterRow { padding: 3px 8px; font-size: 12px; }
  #bar, #bar.many { gap: 3px; padding: 4px; border-radius: 12px; }
  .slot, #bar.many .slot { width: 54px; height: 60px; padding: 3px 1px 3px; border-radius: 9px; }
  .slot .ico, .slot .ico img, #bar.many .slot .ico, #bar.many .slot .ico img { width: 24px; height: 24px; font-size: 19px; }
  .slot .name, #bar.many .slot .name { font-size: 9.5px; line-height: 1.3; }
  .slot .cost { font-size: 9.5px; }
  .slot .cdText { top: 10px; font-size: 16px; }
  #bar .sep { margin: 3px 2px; }
  #tip { bottom: 74px; font-size: 12.5px; padding: 5px 6px 5px 10px; }
  #chat[data-mode="playing"] { bottom: 74px; width: min(280px, calc(100vw - 24px)); }
  #chatLog { font-size: 12.5px; }
  #tooltip { bottom: 74px; }
  #banner { font-size: 30px; top: 30%; }
  #banner small { font-size: 15px; }
  .panel { padding: 12px 18px; max-height: calc(100vh - 16px); }
  .panel h1 { font-size: 28px; }
  #hero { display: none; }
}

/* Handy hoch: schmal */
@media (max-width: 600px) {
  #top { gap: 8px; padding: 4px 6px 4px 10px; }
  #timer { min-width: 52px; }
  #selfHp { width: 56px; }
  #minimap { top: 56px; }
  #info { top: 142px; max-width: calc(100vw - 24px); white-space: normal; text-align: center; }
  #banner { font-size: 28px; white-space: normal; width: calc(100vw - 32px); }
  #tip { font-size: 13px; }
}

/* Bedienung mit Rückmeldung: Felder federn, leuchten auf, Spar-Balken, schwebende Geldänderungen */
.slot { transition: transform 0.1s, box-shadow 0.2s, background 0.15s, border-color 0.15s; }
.slot:hover:not(.inactive):not(:disabled) { transform: translateY(-2px); }
.slot:active:not(:disabled) { transform: translateY(1px) scale(0.95); }
.slot::before { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--save, 0) * 100%); background: linear-gradient(90deg, #b9831d, var(--accent)); border-radius: 0 2px 2px 0; opacity: 0.85; transition: width 0.35s; pointer-events: none; }
.slot.fire { animation: slotFire 0.26s ease-out; }
@keyframes slotFire { 0% { transform: scale(0.9); } 55% { transform: scale(1.08); } 100% { transform: scale(1); } }
.slot.unlock { animation: slotUnlock 0.75s ease-out; }
@keyframes slotUnlock {
  0% { transform: scale(1.12); box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.95), inset 0 0 0 2px var(--accent); }
  100% { transform: scale(1); box-shadow: 0 0 0 16px rgba(255, 209, 102, 0), inset 0 0 0 2px rgba(255, 209, 102, 0); }
}
.moneyFloat { position: fixed; z-index: 30; font-weight: 700; font-size: 15px; pointer-events: none; text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7); animation: moneyFloat 0.95s ease-out forwards; }
.moneyFloat.gain { color: var(--good); }
.moneyFloat.spend { color: var(--bad); }
@keyframes moneyFloat { 0% { opacity: 0; transform: translateY(-4px) scale(0.8); } 15% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(20px) scale(1); } }
@media (prefers-reduced-motion: reduce) { .slot.fire, .slot.unlock, .moneyFloat { animation-duration: 0.01s; } }

/* Wundertüte: Walze, die abbremst und einrastet, danach die Karte mit Strahlen in der Farbe der Seltenheit */
#flash { position: fixed; inset: 0; opacity: 0; pointer-events: none; z-index: 40; mix-blend-mode: screen; }
#boxReveal { position: absolute; left: 50%; bottom: 124px; width: 420px; max-width: calc(100vw - 24px); height: 150px; transform: translateX(-50%); pointer-events: none; z-index: 12; }
#boxReveal .reel { position: absolute; inset: 22px 0 auto; height: 86px; overflow: hidden; border-radius: 14px; background: var(--panel-solid); border: 2px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 24px rgba(0, 0, 0, 0.6); -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
#boxReveal .reelStrip { display: flex; height: 100%; will-change: transform; }
#boxReveal .cell { flex: none; width: 60px; margin: 0 2px; display: grid; place-items: center; font-size: 34px; background: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--c) 35%, transparent)); border-bottom: 4px solid var(--c); border-radius: 8px; }
#boxReveal .cell.r3 { background: linear-gradient(180deg, rgba(255, 194, 61, 0.12), rgba(255, 194, 61, 0.45)); }
#boxReveal .cell.tick { animation: cellTick 0.18s; }
#boxReveal .cell.hit { animation: cellHit 0.35s ease-out forwards; }
@keyframes cellTick { 50% { transform: scale(1.12); } }
@keyframes cellHit { 50% { transform: scale(1.35); } 100% { transform: scale(1.2); box-shadow: 0 0 18px var(--c); } }
#boxReveal .reelMark { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
#boxReveal .reelMark::before, #boxReveal .reelMark::after { content: ''; position: absolute; left: 50%; margin-left: -7px; border: 7px solid transparent; }
#boxReveal .reelMark::before { top: 0; border-top-color: var(--accent); }
#boxReveal .reelMark::after { bottom: 0; border-bottom-color: var(--accent); }
#boxReveal.spinning .reel { animation: reelIn 0.25s ease-out; }
#boxReveal.tense .reel { border-color: var(--rar); box-shadow: 0 0 24px var(--rar), inset 0 0 24px rgba(0, 0, 0, 0.6); animation: tense 0.09s infinite; }
@keyframes reelIn { from { transform: scale(0.8); opacity: 0; } }
@keyframes tense { 50% { transform: translateX(1.5px); } }
#boxReveal .boxCard { position: absolute; left: 50%; top: 4px; min-width: 230px; padding: 10px 22px 12px; transform: translateX(-50%); text-align: center; background: var(--panel-solid); border: 2px solid var(--rar); border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); display: none; }
#boxReveal.reveal .reel, #boxReveal.gone .reel { display: none; }
#boxReveal.reveal .boxCard, #boxReveal.gone .boxCard { display: block; }
#boxReveal.reveal .boxCard { animation: cardPop 0.5s cubic-bezier(0.2, 1.7, 0.4, 1); }
#boxReveal .boxIco { font-size: 46px; line-height: 1.1; margin-bottom: 4px; }
#boxReveal.reveal .boxIco { animation: icoPop 0.6s ease-out; }
#boxReveal .boxRarity { font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rar); }
#boxReveal .boxName { font-size: 19px; font-weight: 700; }
#boxReveal .boxValue { font-size: 15px; font-weight: 700; color: var(--accent); min-height: 19px; font-variant-numeric: tabular-nums; }
#boxReveal .boxValue.pop { animation: valuePop 0.3s; }
#boxReveal .boxRays { position: absolute; left: 50%; top: 58px; width: 380px; height: 380px; margin: -190px 0 0 -190px; border-radius: 50%; opacity: 0; background: repeating-conic-gradient(from 0deg, var(--rar) 0deg 9deg, transparent 9deg 24deg); -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent); mask-image: radial-gradient(closest-side, #000 20%, transparent); }
#boxReveal.reveal.r1 .boxRays { opacity: 0.25; animation: rays 7s linear infinite; }
#boxReveal.reveal.r2 .boxRays { opacity: 0.45; animation: rays 5s linear infinite; }
#boxReveal.reveal.r3 .boxRays { opacity: 0.7; animation: rays 3.5s linear infinite; width: 520px; height: 520px; margin: -260px 0 0 -260px; }
#boxReveal.r1 .boxCard { box-shadow: 0 0 22px rgba(79, 168, 255, 0.6), 0 10px 30px rgba(0, 0, 0, 0.5); }
#boxReveal.r2 .boxCard { box-shadow: 0 0 34px rgba(192, 108, 240, 0.75), 0 10px 30px rgba(0, 0, 0, 0.5); }
#boxReveal.r3 .boxCard { box-shadow: 0 0 50px rgba(255, 194, 61, 0.9), 0 10px 30px rgba(0, 0, 0, 0.5); background: linear-gradient(160deg, #3d2e0f, var(--panel-solid) 65%); }
#boxReveal.r3 .boxName { color: #ffd166; }
/* Glanzstreifen über seltenen Karten */
#boxReveal.r2 .boxCard, #boxReveal.r3 .boxCard { overflow: hidden; }
#boxReveal.reveal.r2 .boxCard::after, #boxReveal.reveal.r3 .boxCard::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 40px; left: -60px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent); transform: skewX(-20deg); animation: glint 1.6s 0.4s ease-in-out infinite; }
#boxReveal.gone { transition: opacity 0.4s, transform 0.4s; opacity: 0; transform: translate(-50%, 12px); }
@keyframes cardPop { 0% { transform: translateX(-50%) scale(0.5) rotate(-4deg); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes icoPop { 0% { transform: scale(0.2) rotate(-25deg); } 65% { transform: scale(1.45) rotate(8deg); } 100% { transform: scale(1); } }
@keyframes valuePop { 50% { transform: scale(1.3); } }
@keyframes rays { to { transform: rotate(360deg); } }
@keyframes glint { 0% { left: -60px; } 60%, 100% { left: 110%; } }
.flyCoin { position: fixed; z-index: 31; font-size: 22px; pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
/* Bereite Wundertüte lockt: Geschenk wippt, ein Glanz läuft übers Feld */
.slot.lure .ico { animation: lure 2.6s ease-in-out infinite; }
.slot.lure { box-shadow: inset 0 0 0 2px rgba(255, 209, 102, 0.55), 0 0 12px rgba(255, 209, 102, 0.25); }
.slot .lvl:not(:empty) { white-space: nowrap; }
@keyframes lure { 0%, 70%, 100% { transform: none; } 76% { transform: rotate(-14deg) scale(1.12); } 82% { transform: rotate(12deg) scale(1.12); } 88% { transform: rotate(-6deg) scale(1.05); } }
@media (max-height: 520px) { #boxReveal { bottom: 78px; transform: translateX(-50%) scale(0.8); transform-origin: bottom center; } }
@media (prefers-reduced-motion: reduce) { #boxReveal .boxRays, .slot.lure .ico, #boxReveal.tense .reel { animation: none; } }

/* Befriedigendes Gefühl im ganzen Spiel: Stufenaufstieg, Countdown, Endtabelle, Knöpfe */
.levelPop { position: fixed; z-index: 32; pointer-events: none; transform: translate(-50%, -100%); animation: levelPop 1.4s ease-out forwards; }
.levelPop span { position: relative; display: block; padding: 5px 12px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px; white-space: nowrap; box-shadow: 0 0 18px rgba(255, 209, 102, 0.8); }
.levelPop i { position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 209, 102, 0.55) 0deg 10deg, transparent 10deg 26deg); -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent); mask-image: radial-gradient(closest-side, #000 25%, transparent); animation: rays 2.5s linear infinite; }
@keyframes levelPop { 0% { opacity: 0; transform: translate(-50%, -60%) scale(0.5); } 15% { opacity: 1; transform: translate(-50%, -110%) scale(1.15); } 30% { transform: translate(-50%, -110%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -150%) scale(1); } }
.slot .lvl.pop { animation: valuePop 0.35s; }
#banner.count { font-size: 110px; }
#banner.count.show { animation: countIn 0.95s ease-out forwards; }
@keyframes countIn { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(0.95); } 30% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } }
#stats tr:not(:first-child) { animation: rowIn 0.35s ease-out backwards; }
#stats tr.mine td { text-shadow: 0 0 12px rgba(255, 209, 102, 0.5); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-24px); } }
#endText.win { animation: winGlow 1.8s ease-in-out infinite; }
@keyframes winGlow { 50% { text-shadow: 0 0 22px rgba(255, 209, 102, 0.85); transform: scale(1.04); } }
#lobby button.fire, #join button.fire { animation: slotFire 0.26s ease-out; }

/* ============================================================
   Erscheinungsbild 0.10: warme Holztöne, dunkle Umrisse und harte Schlagschatten wie in den Spielgrafiken.
   Dieser Abschnitt überschreibt Farben und Formen von oben; Größen und Anordnung bleiben gleich.
   ============================================================ */
:root {
  --ink: #1a120c;
  --bg: #1a130e;
  --panel: linear-gradient(180deg, rgba(64, 49, 38, 0.96), rgba(40, 30, 23, 0.97));
  --panel-solid: #32261d;
  --raised: #4a392c;
  --text: #f8eedc;
  --muted: #cdbda5;
  --accent: #ffc23d;
  --accent-ink: #2b1d0c;
  --good: #7cdc6c;
  --bad: #f0605a;
  --line: rgba(255, 232, 200, 0.14);
  --edge: 0 3px 0 var(--ink);
  --lift: inset 0 1px 0 rgba(255, 236, 205, 0.16), 0 4px 0 rgba(18, 12, 8, 0.55), 0 12px 26px rgba(0, 0, 0, 0.35);
}

/* Gezeichnete Symbole */
.ic { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -0.28em; flex: none; overflow: visible; }
i[data-ic], span[data-ic] { display: inline-grid; place-items: center; font-style: normal; vertical-align: middle; }
h3 .ic, .bots .ic, .maps .ic { width: 1.5em; height: 1.5em; vertical-align: -0.4em; }

/* Knöpfe: kleine Tasten mit Kante */
button { border: 2px solid var(--ink); background: linear-gradient(180deg, #5a4636, #46362a); box-shadow: inset 0 1px 0 rgba(255, 236, 205, 0.18), var(--edge); font-weight: 500; }
button:hover:not(:disabled) { border-color: var(--ink); background: linear-gradient(180deg, #6b5340, #524032); }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 236, 205, 0.18), 0 1px 0 var(--ink); }
button.primary { background: linear-gradient(180deg, #ffd666, #f5a932); border: 2px solid var(--ink); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 5px 0 #8f5a12, 0 6px 0 2px var(--ink); font-weight: 700; font-size: 17px; letter-spacing: 0.3px; margin-bottom: 6px; }
button.primary:hover { background: linear-gradient(180deg, #ffe08a, #ffb844); }
button.primary:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 1px 0 #8f5a12, 0 2px 0 2px var(--ink); }
.iconBtn { background: transparent; border-color: transparent; box-shadow: none; color: var(--text); }
.iconBtn:hover:not(:disabled) { background: rgba(255, 236, 205, 0.12); border-color: transparent; }
.iconBtn .ic { width: 20px; height: 20px; vertical-align: middle; }

/* Fenster */
.panel { background: var(--panel); border: 3px solid var(--ink); border-radius: 20px; box-shadow: inset 0 2px 0 rgba(255, 236, 205, 0.16), inset 0 0 0 2px rgba(255, 200, 120, 0.07), 0 8px 0 rgba(18, 12, 8, 0.6), 0 24px 60px rgba(0, 0, 0, 0.55); }
.panel h2 { font-size: 26px; text-shadow: 0 2px 0 var(--ink); }
.panel h3 { color: #e6c48a; }
.panel input, #chatInput { background: #1d150f; border: 2px solid var(--ink); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5); }
.panel input:focus, #chatInput:focus { border-color: var(--accent); }

/* Logo */
.logo { margin: 0 0 4px; line-height: 0; }
.logo svg { display: block; width: min(330px, 100%); height: auto; margin: 0 auto; overflow: visible; }
#join { padding-top: 22px; }
#join .lead { margin-bottom: 14px; }

/* Lobby */
.roleCard { background: linear-gradient(180deg, #4d3c2e, #3a2c22); border: 2px solid var(--ink); position: relative; }
.roleCard img { width: 72px; height: 72px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.3)); transition: transform 0.15s; }
.roleCard:hover img, .roleCard:hover .dice { transform: translateY(-3px) scale(1.06); }
.roleCard .dice { transition: transform 0.15s; }
.roleCard .dice .ic { width: 52px; height: 52px; }
.roleCard.active { border-color: var(--ink); background: linear-gradient(180deg, #7a5a22, #5a4018); box-shadow: inset 0 0 0 2px var(--accent), inset 0 1px 0 rgba(255, 236, 205, 0.18), var(--edge); }
.roleCard.active::after { content: ''; position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%232b1d0c' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat; border: 2px solid var(--ink); box-shadow: 0 2px 0 var(--ink); }
.roleCard.active small { color: #f1dfbd; }
.maps button.active { border-color: var(--ink); background: linear-gradient(180deg, #7a5a22, #5a4018); box-shadow: inset 0 0 0 2px var(--accent), var(--edge); }
#lobbyList li { border-bottom: 1px solid var(--line); }
.dot { box-shadow: 0 0 0 2px var(--ink); }
.share input { font-family: ui-monospace, monospace; font-size: 12px; }

.maps button { display: flex; align-items: center; justify-content: center; gap: 6px; }

/* Obere Leiste, Spielerliste, Meldungen */
#top { background: var(--panel); border: 2px solid var(--ink); box-shadow: var(--lift); padding: 6px 8px 6px 16px; }
#clock { font-size: 17px; font-weight: 700; }
.clockRow { display: flex; align-items: center; gap: 5px; }
#dayIcon { display: inline-grid; }
#dayIcon .ic { width: 18px; height: 18px; vertical-align: 0; }
#timer { min-width: 86px; }
.meter { background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); }
#money { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 6px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.45); font-size: 18px; }
#money .ic { width: 24px; height: 24px; }
#money b { font-weight: 700; min-width: 2.2em; }
#selfHp { height: 18px; border-radius: 9px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 2px var(--ink); }
#selfHp span { line-height: 18px; }
#info { background: var(--panel); border: 2px solid var(--ink); box-shadow: 0 3px 0 rgba(18, 12, 8, 0.5); padding: 4px 14px; font-weight: 500; }
#info:empty { border-color: transparent; box-shadow: none; }
#info .ic { margin-right: 6px; }
#info.danger { background: linear-gradient(180deg, #c93a32, #94201c); }
.rosterRow { background: var(--panel); border: 2px solid var(--ink); border-radius: 11px; box-shadow: 0 2px 0 rgba(18, 12, 8, 0.5); padding: 4px 9px 5px; }
.rosterRow.me { border-color: var(--ink); box-shadow: inset 0 0 0 2px rgba(255, 194, 61, 0.75), 0 2px 0 rgba(18, 12, 8, 0.5); }
.rosterRow .name .ic { width: 18px; height: 18px; }
.rosterRow small .ic { width: 13px; height: 13px; margin-left: 1px; }
.rosterRow.dead { opacity: 0.6; filter: saturate(0.5); }
#minimap { border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 0 0 2px #7a5a36, 0 0 0 4px var(--ink), 0 8px 20px rgba(0, 0, 0, 0.4); right: 14px; top: 14px; }
#feed { top: 152px; }
#feed div, #chatLog div { background: var(--panel); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 0 2px 0 rgba(18, 12, 8, 0.45); }
#feed div .ic, #chatLog div .ic { margin-right: 6px; width: 18px; height: 18px; }
#chat.inline #chatLog div { border: none; box-shadow: none; }

/* Große Einblendungen mit Comic-Umriss */
#banner { font-size: 50px; letter-spacing: 0.5px; -webkit-text-stroke: 9px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); }
#banner small { font-size: 19px; font-weight: 600; -webkit-text-stroke: 5px var(--ink); text-shadow: 0 3px 0 var(--ink); margin-top: 4px; }
#banner.night { color: #b9c8ff; }
#banner.count { -webkit-text-stroke: 16px var(--ink); text-shadow: 0 10px 0 var(--ink); }
#endText { font-size: 38px; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; text-shadow: 0 5px 0 var(--ink); }
.moneyFloat { -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; font-size: 16px; text-shadow: none; }

/* Tipp als Zettel */
#tip { background: linear-gradient(180deg, #fff1c9, #f6d98f); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 rgba(18, 12, 8, 0.55); font-weight: 500; }
#tip .ic { width: 24px; height: 24px; }
#tip button { box-shadow: none; }

/* Aktionsleiste */
#bar { background: var(--panel); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--lift); padding: 9px; }
#bar .sep { background: rgba(0, 0, 0, 0.4); width: 2px; box-shadow: 1px 0 0 rgba(255, 236, 205, 0.08); }
.slot { border: 2px solid var(--ink); border-radius: 12px; background: linear-gradient(180deg, #5b4737, #403126); box-shadow: inset 0 1px 0 rgba(255, 236, 205, 0.2), 0 3px 0 var(--ink); }
.slot:hover:not(.inactive):not(:disabled) { background: linear-gradient(180deg, #6d5542, #4b3a2d); }
.slot .ico .ic { width: 34px; height: 34px; }
.slot .ico img { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25)); }
.slot .name { font-weight: 500; }
.slot .key { background: #f1e3c8; color: #3a2a18; border-radius: 5px; box-shadow: 0 1px 0 #8a7556; font-weight: 700; }
.slot .lvl { display: inline-flex; align-items: center; gap: 1px; }
.slot .lvl .ic { width: 13px; height: 13px; }
.slot.active { background: linear-gradient(180deg, #ffd666, #f5a932); border-color: var(--ink); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), 0 3px 0 #8f5a12; }
.slot.poor, .slot.inactive { background: linear-gradient(180deg, #43362c, #32271f); }
.slot.poor .name, .slot.inactive .name { color: var(--muted); }
.slot.ready { box-shadow: inset 0 0 0 2px rgba(124, 220, 108, 0.75), 0 3px 0 var(--ink); }
.slot.lure { box-shadow: inset 0 0 0 2px rgba(255, 209, 102, 0.7), 0 3px 0 var(--ink), 0 0 14px rgba(255, 209, 102, 0.3); }
.slot::before { height: 4px; }
#tooltip { background: var(--panel); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--lift); }
#volPanel { background: var(--panel); border: 2px solid var(--ink); box-shadow: var(--lift); }

/* Wundertüte und fliegende Münzen */
#boxReveal .reel { background: #2a1f18; border: 3px solid var(--ink); }
#boxReveal .cell .ic { width: 40px; height: 40px; }
#boxReveal .boxCard { background: var(--panel); border-width: 3px; }
#boxReveal .boxIco .ic { width: 58px; height: 58px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.3)); }
.flyCoin .ic { width: 24px; height: 24px; display: block; }

/* Ende und Hilfe */
#stats td .ic { width: 18px; height: 18px; }
dt { color: #ffe2a6; }

@media (max-height: 500px) {
  .logo svg { width: 200px; }
  #banner { font-size: 32px; -webkit-text-stroke-width: 6px; }
  #minimap { top: 8px; right: 10px; }
  #feed { top: 100px; }
}
@media (max-width: 600px) {
  #minimap { top: 58px; right: 10px; }
}

/* Hilfe: breiter, damit sie auch mit den neuen Zeilen ohne Scrollen passt */
#help.panel.wide { width: min(800px, calc(100vw - 32px)); }

/* ---------- Suchtfaktor-Pass (0.11): Aufträge, Karriere, Endbildschirm ---------- */
/* Rechte Spalte unter der Minikarte: erst die Aufträge, darunter die Ereignisliste */
#hud > #side { pointer-events: none; }
#side { position: absolute; right: 14px; top: 152px; width: 250px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#side #feed { position: static; width: 260px; }
#quests { width: 100%; background: var(--panel); border: 2px solid var(--ink); border-radius: 12px; box-shadow: 0 3px 0 rgba(18, 12, 8, 0.5); padding: 6px 8px 8px; font-size: 12.5px; }
.qHead { display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: #e6c48a; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.8px; }
.qHead .ic { width: 16px; height: 16px; }
.qGift { display: inline-flex; align-items: center; gap: 4px; }
.qGift.pop { animation: valuePop 0.5s; }
.qGift .pip { width: 8px; height: 8px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); transition: background 0.3s, transform 0.3s; }
.qGift .pip.on { background: var(--accent); box-shadow: 0 0 6px rgba(255, 194, 61, 0.8); transform: scale(1.15); }
.quest { position: relative; display: grid; grid-template-columns: 20px 1fr auto; gap: 3px 6px; align-items: center; padding: 4px 6px 5px; margin-top: 4px; border-radius: 8px; background: rgba(0, 0, 0, 0.24); overflow: hidden; transition: background 0.3s; }
.quest .qIco .ic { width: 18px; height: 18px; display: block; }
.quest .qText { line-height: 1.2; }
.quest .qReward { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 700; white-space: nowrap; }
.quest .qReward .ic { width: 14px; height: 14px; }
.quest .meter { grid-column: 1 / 3; height: 4px; }
.quest .meter i { transition: width 0.35s; }
.quest .qNum { font-size: 11px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.quest.in { animation: questIn 0.4s ease-out; }
.quest.tick { animation: questTick 0.28s ease-out; }
.quest.done { background: linear-gradient(90deg, rgba(124, 220, 108, 0.42), rgba(124, 220, 108, 0.14)); }
.quest.done .qText { color: #d9ffd2; }
.quest.done .meter i { background: var(--good); }
.quest.done::after { content: ''; position: absolute; top: 0; bottom: 0; left: -60px; width: 40px; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: glint 0.9s ease-out; }
.quest.win { animation: questWin 0.55s ease-out; }
@keyframes questIn { from { opacity: 0; transform: translateX(30px); } }
@keyframes questTick { 40% { transform: scale(1.035); background: rgba(255, 194, 61, 0.25); } }
@keyframes questWin { 0% { transform: scale(1); } 35% { transform: scale(1.09); box-shadow: 0 0 18px rgba(124, 220, 108, 0.8); } 100% { transform: scale(1); } }
.questFloat { transform-origin: right center; }

/* Geschenkte Wundertüte in der Leiste */
.slot.free { box-shadow: inset 0 0 0 2px var(--accent), 0 0 16px rgba(255, 194, 61, 0.75); }
.slot.free .cost { color: #9df08c; font-weight: 700; }

/* Karriere: Stufe, Rang, Erfahrungsbalken (Lobby und Endbildschirm) */
#career, .xpRow { display: flex; align-items: center; gap: 12px; }
#career { margin: 10px 0 12px; padding: 8px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.25); border: 2px solid var(--ink); }
.cLevel { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-content: center; text-align: center; line-height: 1; color: var(--accent-ink); background: radial-gradient(circle at 35% 30%, #ffe89a, #f5a932); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.cLevel b { font-size: 22px; font-weight: 700; }
.cLevel small { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.cLevel.up { animation: levelUp 0.7s ease-out; }
@keyframes levelUp { 0% { transform: scale(1); } 30% { transform: scale(1.5) rotate(-8deg); box-shadow: 0 0 30px rgba(255, 209, 102, 0.95); } 60% { transform: scale(0.94) rotate(3deg); } 100% { transform: scale(1); } }
.cMain { flex: 1; min-width: 0; }
.cTop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cTop b { font-size: 16px; color: #ffe2a6; }
.cTop b.pop, .cTop span.pop { animation: valuePop 0.45s; }
.cTop span { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.meter.xp { height: 10px; border-radius: 6px; margin: 4px 0 5px; }
.meter.xp i { border-radius: 6px; background: linear-gradient(90deg, #ffb02e, #ffe27a); transition: width 0.6s ease-out; }
.cStats { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: 12.5px; color: var(--muted); }
.cStats .ic { width: 15px; height: 15px; }
.cStats b { color: #ffe2a6; font-weight: 600; }
.cStats b.up { color: var(--good); }
#lobbyList .lv { margin-left: auto; padding: 0 7px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); color: var(--accent); font-size: 11.5px; font-weight: 600; }

/* Endbildschirm: Auszeichnungen, Erfahrung, Nochmal */
#end.panel.wide { width: min(700px, calc(100vw - 32px)); }
#awards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 2px; }
.award { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 5px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); border: 2px solid var(--ink); font-size: 12.5px; animation: chipIn 0.35s ease-out backwards; }
.award .ic { width: 18px; height: 18px; }
.award b { color: #ffe2a6; font-weight: 600; }
.award span { color: var(--muted); }
.award.mine { background: linear-gradient(180deg, #ffd666, #f5a932); }
.award.mine b, .award.mine span { color: var(--accent-ink); }
#xpBox { margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); border: 2px solid var(--ink); }
.xpLines { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.xpChip { padding: 1px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); font-size: 12.5px; color: var(--muted); animation: chipIn 0.3s ease-out backwards; }
.xpChip b { color: var(--accent); font-weight: 700; }
@keyframes chipIn { from { opacity: 0; transform: translateY(8px) scale(0.85); } }
.endBtns { display: flex; gap: 10px; align-items: stretch; margin-top: 14px; }
.endBtns .primary { flex: 1; margin-top: 0; }
.endBtns .primary:disabled { opacity: 0.7; cursor: default; }
#end #stats { margin-top: 6px; font-size: 13.5px; }
#end #stats td { padding: 4px 6px; }

@media (max-width: 900px) {
  #side { width: 210px; }
  #quests { font-size: 11.5px; padding: 5px 6px 6px; }
}
@media (max-height: 500px) {
  #side { top: 96px; right: 10px; width: 200px; gap: 4px; }
  #quests { font-size: 11px; padding: 4px 6px 5px; }
  .quest { padding: 2px 5px 3px; margin-top: 3px; }
  .cLevel { width: 44px; height: 44px; }
  .cLevel b { font-size: 18px; }
  #career { margin: 6px 0 8px; padding: 5px 10px; }
}
@media (max-width: 600px) {
  #side { top: 146px; right: 10px; width: 180px; }
  .qHead > span:first-child { font-size: 10px; }
}
body.touch #side { right: max(10px, env(safe-area-inset-right)); }
@media (prefers-reduced-motion: reduce) { .quest.in, .quest.tick, .quest.win, .cLevel.up, .xpChip, .award { animation: none; } }
/* Wenig Höhe (Handy quer): Aufträge einzeilig, auf dem Endbildschirm stehen „Nochmal!“ und die Erfahrung vor der Tabelle */
@media (max-height: 500px) {
  .qHead > span:first-child { font-size: 10px; }
  .quest { grid-template-columns: 16px 1fr auto auto; }
  .quest .qIco .ic { width: 15px; height: 15px; }
  .quest .qText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .quest .meter { grid-column: 1 / -1; height: 3px; grid-row: 2; }
  .quest .qNum { grid-row: 1; grid-column: 3; }
  .quest .qReward { grid-column: 4; }
}
@media (max-height: 560px) {
  #end:not([hidden]) { display: flex; flex-direction: column; }
  #end #endText { font-size: 26px; }
  #end .endBtns { order: 1; margin-top: 8px; }
  #end #endCountdown { order: 2; }
  #end #xpBox { order: 3; margin-top: 8px; }
  #end #awards { order: 4; }
  #end #stats { order: 5; }
}

/* Konto */
.acct { margin: 12px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(0, 0, 0, 0.18); font-size: 14px; color: var(--muted); }
.acct b { color: var(--text); }
button.link { background: none; border: none; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; box-shadow: none; }
button.link:hover { color: #ffc552; }
.tabs { display: flex; gap: 6px; margin: 4px 0 6px; }
.tabs button { flex: 1; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.acMsg { min-height: 1.2em; margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.acMsg.bad { color: #ff8a73; }
.acMsg.ok { color: #9be27a; }
.acLinks { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; font-size: 14px; }
.reconnect { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 50; padding: 10px 18px; border-radius: 999px; background: rgba(20, 16, 12, 0.92); border: 1px solid var(--accent); color: var(--text); font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }
.panel label[hidden], .acct [hidden], .tabs[hidden], #xpSave[hidden] { display: none; }
