:root {
  --panel: rgba(18, 22, 30, 0.72);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --accent: #b5413a;      /* HPI-ish red */
  --accent-2: #d8584f;
}
html, body { margin: 0; height: 100%; overflow: hidden; background: #8fb1d1; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(10, 14, 22, 0.1), rgba(10, 14, 22, 0.55)); z-index: 10; }
.card { width: min(360px, 100%); box-sizing: border-box; background: var(--panel); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); border: 1px solid var(--panel-border); border-radius: 16px; padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; gap: 14px; }
.brand { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.logo { color: var(--accent-2); }
.sub { margin: -8px 0 4px; color: var(--muted); font-size: 14px; }
.hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input { font: inherit; font-size: 16px; color: var(--text); background: rgba(255, 255, 255, 0.07); border: 1px solid var(--panel-border);
  border-radius: 10px; padding: 11px 12px; outline: none; transition: border-color .15s; width: 100%; box-sizing: border-box; }
input:focus { border-color: var(--accent-2); }
details { font-size: 13px; color: var(--muted); }
details input { margin-top: 8px; font-size: 13px; font-family: ui-monospace, monospace; }
summary { cursor: pointer; }
button { font: inherit; font-weight: 600; font-size: 15px; color: #fff; background: var(--accent); border: 0; border-radius: 10px;
  padding: 12px; cursor: pointer; transition: background .15s, transform .05s; }
button:hover { background: var(--accent-2); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: wait; }
.err { color: #fca5a5; font-size: 14px; min-height: 1em; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; }
.swatches button { width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.swatches button.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.3); }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: rgba(255,255,255,.7); }
#players { position: absolute; top: 14px; left: 14px; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 10px 12px; font-size: 13px; min-width: 150px; backdrop-filter: blur(8px); }
#players .ph { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
#players .pl { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
#players .pl i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; transition: box-shadow .1s; }
#players .pl.talk i { box-shadow: 0 0 0 3px rgba(34,197,94,.7); }
#players em { color: var(--muted); font-style: normal; }
#mic { position: absolute; top: 14px; right: 14px; padding: 8px 12px 8px 30px; border-radius: 999px; font-size: 13px;
  background: var(--panel); border: 1px solid var(--panel-border); pointer-events: auto; cursor: pointer; position: absolute; }
#mic::before { content: ''; position: absolute; left: 11px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 calc(var(--lvl, 0) * 6px) rgba(34,197,94,.35); }
#mic.muted::before { background: #ef4444; box-shadow: none; }
#mic.none::before { background: #6b7280; box-shadow: none; }

/* Minecraft-style hotbar */
#hotbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 0;
  background: rgba(20, 20, 20, 0.55); border: 3px solid rgba(0, 0, 0, 0.75); border-radius: 3px; padding: 2px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.12); }
.slot { width: 48px; height: 48px; box-sizing: border-box; border: 2px solid rgba(255,255,255,0.14); margin: 1px; position: relative;
  background: rgba(139, 139, 139, 0.32); display: grid; place-items: center; image-rendering: pixelated; }
.slot img { width: 36px; height: 36px; image-rendering: pixelated; }
.slot .num { position: absolute; left: 3px; top: 1px; font-size: 10px; color: rgba(255,255,255,.55); font-weight: 600; }
.slot.sel { outline: 3px solid #fff; outline-offset: -1px; box-shadow: 0 0 0 1px #000, inset 0 0 0 2px rgba(0,0,0,.6); z-index: 1; background: rgba(170,170,170,0.38); }
#itemName { position: absolute; bottom: 82px; left: 50%; transform: translateX(-50%); font-weight: 600; font-size: 15px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.6); opacity: 0; }
#itemName.fade { animation: fade 2.2s ease-out; }
@keyframes fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
#toast { position: fixed; z-index: 50; pointer-events: none; top: 64px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; opacity: 0; }
#toast.show { animation: fade 3.5s ease-out; }

.help table { border-collapse: collapse; font-size: 14px; }
.help td { padding: 5px 4px; }
.help td:first-child { white-space: nowrap; color: var(--muted); padding-right: 14px; }
kbd { display: inline-block; min-width: 18px; text-align: center; padding: 2px 6px; margin-right: 3px; border-radius: 5px; font: 12px ui-monospace, monospace;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-bottom-width: 2px; color: var(--text); }

@media (max-width: 560px) {
  .slot { width: 34px; height: 34px; } .slot img { width: 26px; height: 26px; }
  #players { font-size: 12px; min-width: 0; }
}

/* ---- interaction prompt, counts, overlays ---- */
#prompt { position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%); padding: 7px 14px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--panel-border); font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .15s; }
#prompt.show { opacity: 1; }
.slot .cnt { position: absolute; right: 3px; bottom: 1px; font-size: 14px; font-weight: 700; color: #fff; text-shadow: 2px 2px 0 #3a3a3a; }
#charge { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px; border-radius: 50%; opacity: 0;
  background: conic-gradient(rgba(255,255,255,.85) calc(var(--c, 0) * 360deg), rgba(255,255,255,.15) 0);
  -webkit-mask: radial-gradient(circle, transparent 13px, #000 14px); mask: radial-gradient(circle, transparent 13px, #000 14px); }
#charge.on { opacity: 1; }
#charge.full { background: conic-gradient(#fbbf24 360deg, #fbbf24 0); }
#splash, #hurt { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
#splash { background: radial-gradient(ellipse at 30% 20%, rgba(255,250,230,.85) 0 12%, transparent 13%),
  radial-gradient(ellipse at 70% 35%, rgba(255,245,215,.8) 0 9%, transparent 10%), radial-gradient(ellipse at 45% 70%, rgba(240,200,90,.55) 0 16%, transparent 17%),
  radial-gradient(ellipse at center, rgba(230,180,60,.25), rgba(230,180,60,.45)); filter: blur(3px); }
#splash.show { animation: splash 3.5s ease-out; }
@keyframes splash { 0% { opacity: 1; transform: translateY(0); } 70% { opacity: .7; } 100% { opacity: 0; transform: translateY(60px); } }
#hurt { background: radial-gradient(ellipse at center, transparent 45%, rgba(220,30,30,.55)); }
#hurt.show { animation: fade 0.6s ease-out; }

/* ---- inventory (Minecraft style) ---- */
.inv-card { width: min(560px, 100%); background: #c6c6c6; color: #3f3f3f; border: 3px solid #fff; border-right-color: #555; border-bottom-color: #555;
  border-radius: 4px; backdrop-filter: none; gap: 8px; user-select: none; }
.inv-card .brand { font-size: 17px; color: #3f3f3f; }
.inv-grid { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; }
.inv-hot { margin-top: 6px; }
.inv-card .slot { cursor: pointer; background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737; width: auto; height: auto; aspect-ratio: 1; margin: 0; }
.inv-card .slot:hover { background: #a6a6a6; }
.inv-card .slot.sel { outline: 2px solid #fff; outline-offset: -2px; box-shadow: none; }
.inv-card .slot img { width: 76%; height: 76%; }
.slot.photo img { image-rendering: auto; border: 2px solid #f4f2ea; border-bottom-width: 6px; box-sizing: border-box; }
.inv-label { font-size: 13px; font-weight: 700; }
.inv-help { font-size: 11px; color: #555; }
.inv-top .slots { margin-top: 6px; }
.cursor-stack { position: fixed; width: 48px; height: 48px; pointer-events: none; background: none !important; border: 0 !important; z-index: 30; }
.cursor-stack img { width: 40px; height: 40px; }

/* ---- exam sheet ---- */
#exam { background: rgba(0,0,0,.35); pointer-events: none; }
.exam-sheet { width: min(560px, 92vw); background: #fbf9f1; color: #222; padding: 28px 34px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
  transform: rotate(-1.5deg); font-family: Georgia, serif; position: relative;
  background-image: repeating-linear-gradient(transparent 0 27px, #dfe6f0 27px 28px); }
.exam-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #333; padding-bottom: 6px; gap: 12px; flex-wrap: wrap; }
.exam-head span { font-size: 12px; color: #555; }
.exam-meta { font-size: 13px; margin: 10px 0; }
.exam-sheet ol { padding-left: 20px; line-height: 1.6; font-size: 15px; }
.exam-sheet li { margin-bottom: 8px; }
.exam-sheet em { font-style: normal; font-family: "Comic Sans MS", "Segoe Print", cursive; font-weight: 700; margin-left: 8px; }
.exam-sheet .ok { color: #1a8a3a; } .exam-sheet .half { color: #c96a00; } .exam-sheet .bad { color: #d11; }
.scribble { display: block; color: #d11; font-family: "Comic Sans MS", "Segoe Print", cursive; font-size: 13px; transform: rotate(-1deg); }
.exam-grade { display: flex; align-items: center; gap: 18px; justify-content: flex-end; font-family: "Comic Sans MS", cursive; color: #d11; }
.exam-grade .grade { font-size: 46px; font-weight: 800; border: 4px solid #d11; border-radius: 50%; width: 92px; height: 92px; display: grid; place-items: center; transform: rotate(-8deg); }
.exam-grade .pass { font-size: 18px; font-weight: 700; }
.exam-hint { font-family: system-ui, sans-serif; font-size: 12px; color: #777; margin-top: 10px; }

/* ---- rolling minigame ---- */
.minigame .mg { width: min(720px, 100%); }
.mg canvas { width: 100%; height: auto; border-radius: 8px; cursor: crosshair; touch-action: none; }
.mg-head, .mg-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mg-step { color: var(--muted); font-size: 13px; }
.mg-hint { font-size: 14px; }
.mg-cancel { background: rgba(255,255,255,.12); font-size: 13px; padding: 8px 12px; }

#underwater { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(ellipse at 50% 30%, rgba(40,110,110,.45), rgba(10,45,50,.85)); backdrop-filter: blur(3px); }
#underwater.on { opacity: 1; }

/* voice link status in the player list: connected / connecting / failed / out of range */
#players .vs { width: 7px; height: 7px; margin-left: auto; border-radius: 2px; }
#players .vs.connected { background: #22c55e; } #players .vs.connecting { background: #f59e0b; }
#players .vs.failed { background: #ef4444; } #players .vs.off { background: rgba(255,255,255,.2); }

/* compass */
#compass { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: min(420px, 70vw); height: 34px;
  background: linear-gradient(90deg, transparent, var(--panel) 15%, var(--panel) 85%, transparent); border-radius: 8px; overflow: hidden; }
.cmp-strip { position: absolute; inset: 0; }
.cmp-strip b, .cmp-strip i, .cmp-strip span { position: absolute; transform: translateX(-50%); }
.cmp-strip b { top: 2px; font-size: 13px; font-weight: 800; }
.cmp-strip i { top: 4px; width: 2px; background: rgba(255,255,255,.55); }
.cmp-p { bottom: 1px; font-size: 10px; font-weight: 600; white-space: nowrap; color: #fff; text-shadow: 0 1px 2px #000; display: flex; flex-direction: column; align-items: center; }
.cmp-p u { width: 9px; height: 9px; border-radius: 50%; background: var(--c); border: 1.5px solid #fff; margin-bottom: 1px; }
.cmp-p.edge { opacity: .55; }
.cmp-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fbbf24; opacity: .8; }
#players { top: 56px; }

.scribble.ok { color: #1a8a3a; }
#buffs { position: absolute; right: 14px; bottom: 16px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.buff { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 999px; padding: 4px 10px; font-size: 12px; }

#score { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); padding: 5px 14px; border-radius: 8px; background: var(--panel);
  border: 1px solid var(--panel-border); font-weight: 800; font-size: 15px; letter-spacing: .02em; display: none; }
#score.show { display: block; }

/* graffiti paint window */
.paint { width: min(420px, 100%); }
.paint canvas { width: 100%; aspect-ratio: 1; border-radius: 8px; cursor: crosshair; touch-action: none; }
.paint-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.paint-tools .pc { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); }
.paint-tools .sel { outline: 3px solid #fff; outline-offset: 1px; }
.paint-tools select, .paint-tools .perase { font: inherit; font-size: 13px; padding: 5px 8px; border-radius: 8px; background: rgba(255,255,255,.12); color: var(--text); border: 0; }

.recipes { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.recipe { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.recipe .slot { width: 44px; height: 44px; }
.recipe.off .slot { opacity: .5; }
.recipe button { margin-left: auto; padding: 8px 14px; font-size: 13px; }
.recipe button:disabled { opacity: .45; cursor: not-allowed; }

#photoflash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#photoflash.show { animation: fade 0.5s ease-out; }
#photo { background: rgba(0,0,0,.35); pointer-events: none; }
.polaroid { background: #f6f4ec; padding: 14px 14px 46px; box-shadow: 0 18px 50px rgba(0,0,0,.45); transform: rotate(2deg); position: relative; }
.polaroid img { width: min(360px, 70vw); aspect-ratio: 1; display: block; object-fit: cover; }
.polaroid span { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #666; font-size: 12px; }

/* battle royale HUD */
#br .br-top { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 8px; background: rgba(120,20,60,.75);
  border: 1px solid rgba(255,255,255,.2); font-weight: 700; font-size: 14px; white-space: nowrap; }
#br .br-bars { position: absolute; bottom: 82px; left: 50%; transform: translateX(-50%); width: min(420px, 80vw); display: flex; flex-direction: column; gap: 3px; }
.br-bar { height: 12px; background: rgba(0,0,0,.5); border-radius: 3px; position: relative; overflow: hidden; }
.br-bar i { position: absolute; left: 0; top: 0; bottom: 0; transition: width .15s; }
.br-bar.hp i { background: linear-gradient(#ef4444, #b91c1c); } .br-bar.sh i { background: linear-gradient(#60a5fa, #2563eb); }
.br-bar span { position: absolute; right: 6px; top: -2px; font-size: 11px; font-weight: 700; }

#clickhint { position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%); padding: 8px 16px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--panel-border); font-weight: 600; font-size: 14px; display: none; }
#clickhint.show { display: block; }

/* global text chat */
#chat { position: absolute; left: 14px; bottom: 90px; width: min(420px, 60vw); display: flex; flex-direction: column; gap: 6px; }
#chatlog { max-height: 30vh; overflow: hidden; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
#chatlog .cl { background: rgba(10,12,16,.55); padding: 3px 8px; border-radius: 6px; width: fit-content; max-width: 100%; word-wrap: break-word;
  text-shadow: 0 1px 2px #000; transition: opacity 1.5s; overflow-wrap: anywhere; }
#chatlog .cl.old { opacity: 0; }
#chatlog .cl i { color: var(--muted); }
#chat.open #chatlog { overflow-y: auto; pointer-events: auto; }
#chat.open #chatlog .cl.old { opacity: 1; }
#chatin { display: none; pointer-events: auto; }
#chat.open #chatin { display: block; }

/* money HUD + shop rows */
#money { position: absolute; right: 14px; top: 50px; background: var(--panel); border: 1px solid var(--panel-border); border-radius: 999px;
  padding: 5px 12px; font-size: 14px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
#money b { font-weight: 800; color: #fde68a; }
#money i { font-style: normal; font-size: 12px; opacity: 0; white-space: nowrap; animation: moneyflash 2.4s ease-out; }
#money i.up { color: #86efac; } #money i.down { color: #fca5a5; }
@keyframes moneyflash { 0% { opacity: 1; transform: translateY(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.shop { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.shop-row { display: flex; align-items: center; gap: 10px; text-align: left; background: rgba(0,0,0,.06); border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px; padding: 6px 10px; color: inherit; font: inherit; cursor: pointer; }
.shop-row:hover { background: rgba(0,0,0,.13); }
.shop-row img, .shop-row .ph { width: 36px; height: 36px; image-rendering: pixelated; border-radius: 6px; flex: none; }
.shop-l { flex: 1; display: flex; flex-direction: column; } .shop-l small { opacity: .65; font-size: 11px; }
.shop-p { font-weight: 800; color: #92400e; white-space: nowrap; }
.shop-row.owned .shop-p { color: #15803d; } .shop-row.off { opacity: .45; cursor: default; }
.shop-money { float: right; color: #92400e; font-size: 14px; }

/* ---- dance emote wheel (emotes.js) ---- */
#emotewheel { position: fixed; left: 50%; top: 50%; width: 360px; height: 360px; margin: -180px 0 0 -180px; border-radius: 50%;
  background: radial-gradient(circle, rgba(15,20,30,.55) 0 22%, rgba(15,20,30,.38) 23% 70%, transparent 71%); z-index: 30; pointer-events: none; font: 600 13px system-ui, sans-serif; color: #fff; }
#emotewheel.hidden { display: none; }
#emotewheel .ew-c { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; font-size: 16px; font-weight: 800; }
#emotewheel .ew-c small { display: block; font-size: 11px; opacity: .7; font-weight: 600; }
#emotewheel .ew-i { position: absolute; transform: translate(-50%, -50%); padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,.45); white-space: nowrap; text-shadow: 0 1px 2px #000; transition: transform .08s, background .08s; }
#emotewheel .ew-i b { color: #fbbf24; margin-right: 5px; }
#emotewheel .ew-i.on { background: #b1063a; transform: translate(-50%, -50%) scale(1.15); }
/* ---- smoking / vending / Pfand (smoking.js, vending.js) */
.slot .ubar { position: absolute; left: 5px; right: 5px; bottom: 3px; height: 3px; background: #1a1a1a; box-shadow: 0 0 0 1px rgba(0,0,0,.6); pointer-events: none; }
.slot .ubar i { display: block; height: 100%; }
.slot .ubar.empty::after { content: 'leer'; position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 9px; font-weight: 800; color: #fca5a5; text-shadow: 1px 1px 0 #000; }
#puffbar { position: absolute; left: calc(50% + 248px); bottom: 16px; width: 170px; padding: 4px 8px 6px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--panel-border); color: #eee; font-size: 11px; text-align: center; opacity: 0; transition: opacity .25s; pointer-events: none; }
#puffbar.on { opacity: 1; }
#puffbar .pb { height: 5px; background: #222; border-radius: 3px; overflow: hidden; margin-top: 3px; }
#puffbar .pb i { display: block; height: 100%; background: linear-gradient(90deg, #9ad0ff, #f5f5ff); }
#puffbar .pb.left i { background: linear-gradient(90deg, #f97316, #fde68a); }
.pfand-count { font: 800 34px/1.1 ui-monospace, monospace; color: #15803d; text-align: center; padding: 10px 0 4px; }
.pfand-sub { text-align: center; font-size: 12px; opacity: .75; padding-bottom: 8px; }
.shake-hint { text-align: center; font-size: 12px; opacity: .8; padding: 6px 10px 0; font-style: italic; }

/* ---- interiors: fade to black when going through a door (interiors.js) ---- */
#roomfade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 25; }
#roomfade.on { opacity: 1; }

/* playtest fixes: shop/inventory fits small screens */
.inv-card { max-height: calc(100vh - 24px); overflow-y: auto; }
.shop { max-height: max(34vh, min(50vh, calc(100vh - 380px))); }   /* more of the catalogue on tall screens, the inventory still fits */
/* ---- Golfcart-Rennen HUD (race.js) ---- */
#race-hud { position: fixed; top: 150px; left: 50%; transform: translateX(-50%); z-index: 6; pointer-events: none; text-align: center; color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.6); font-family: inherit; }
#race-hud.hidden { display: none; }
#race-hud .rh-time { font: bold 34px/1 ui-monospace, monospace; }
#race-hud .rh-cp { font-size: 14px; opacity: .9; margin-top: 4px; }
#race-hud .rh-arrow { font-size: 38px; line-height: 1; color: #3cff8a; margin: 6px auto 0; width: 40px; transition: transform .1s linear; }
#race-hud .rh-big { position: fixed; top: 30vh; left: 50%; transform: translateX(-50%); font: 900 72px/1 sans-serif; color: #ffb02e; white-space: nowrap; }
.race-board { margin: 8px 0 12px; padding: 0; list-style: none; font-size: 15px; }
.race-board li { display: flex; justify-content: space-between; gap: 24px; padding: 3px 0; }

/* ---- Hilfe & Karte (H): help.js */
#help { z-index: 40; background: rgba(6, 9, 14, .62); padding: 12px; }
#help .help-card { width: min(1500px, 100%); height: min(900px, calc(100vh - 24px)); box-sizing: border-box; display: flex; flex-direction: column; gap: 8px;
  background: var(--panel); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 12px 14px; color: #e5e7eb; }
#help .help-head { display: flex; justify-content: space-between; align-items: baseline; }
#help .help-x { color: var(--muted); font-size: 13px; }
#help .help-body { flex: 1; min-height: 0; display: flex; gap: 12px; }
#help .help-mapwrap { flex: 1; min-width: 0; position: relative; background: #11161d; border-radius: 10px; overflow: hidden; }
#help .help-map { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
#help .help-side { width: 330px; flex: none; overflow-y: auto; font-size: 13px; padding-right: 4px; }
#help .help-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
#help .help-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
#help .help-legend i.me { background: #ff3c5a; border-radius: 2px; transform: rotate(45deg); }
#help .help-legend i.other { background: #9ca3af; border: 2px solid #fff; box-sizing: border-box; }
#help .help-pois { list-style: none; margin: 0 0 10px; padding: 0; }
#help .help-pois li { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
#help .help-pois b { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 2px solid; border-radius: 50%; background: #10141b; font-size: 10px; font-weight: 800; letter-spacing: -.3px; }
#help .help-pois em { display: block; font-style: normal; font-weight: 600; }
#help .help-pois small { color: var(--muted); font-weight: normal; }
#help .help-pois span { color: var(--muted); font-size: 12px; }
#help .help-keys { border-collapse: collapse; font-size: 12px; width: 100%; }
#help .help-keys td { padding: 3px 2px; vertical-align: top; }
#help .help-keys td:first-child { white-space: nowrap; padding-right: 8px; }
@media (max-width: 800px) { #help .help-body { flex-direction: column; } #help .help-mapwrap { min-height: 50vh; } #help .help-side { width: auto; } }

/* ---- race splits vs. personal best (race.js) */
#race-hud .rh-time.good, #race-hud .rh-big small.good { color: #3cff8a; }
#race-hud .rh-time.bad, #race-hud .rh-big small.bad { color: #ff6b6b; }
#race-hud .rh-big { text-align: center; text-shadow: 0 3px 12px rgba(0,0,0,.6); }
#race-hud .rh-big small { display: block; margin-top: 10px; font: 800 28px/1 ui-monospace, monospace; color: #f4f4f4; }
/* ---- room title on entering an interior (interiors.js adds .room to #toast): solid chip, held longer */
@keyframes fade-hold { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
#toast.room { background: rgba(12, 14, 20, 0.92); color: #fff; font-weight: 700; font-size: 16px; padding: 9px 20px;
  border-color: rgba(255, 255, 255, 0.35); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35); }
#toast.room.show { animation: fade-hold 3.5s ease-out; }

/* ---- welcome card (welcome.js): once per tab after joining */
#welcome { z-index: 45; background: rgba(6, 9, 14, .55); cursor: pointer; }
#welcome .wc-card { max-width: 520px; background: rgba(18, 22, 30, .96); border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  padding: 20px 24px 16px; color: #eef2f7; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
#welcome h2 { margin: 0 0 12px; font-size: 22px; }
#welcome ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
#welcome li { display: flex; gap: 12px; align-items: baseline; font-size: 15px; line-height: 1.35; }
#welcome li b { flex: none; min-width: 42px; text-align: center; padding: 2px 6px; border-radius: 6px; background: #ffd34d; color: #1b1b1b; font-size: 14px; }
#welcome .wc-go { margin: 14px 0 0; text-align: center; color: #9aa6b5; font-size: 13px; }

/* ---- shops at low window heights (e.g. Späti at 1100×650): the offer list shrinks instead of the whole card
   scrolling too – one scrollbar, not two nested ones. The card keeps overflow-y: auto as a last resort. ---- */
.inv-card > * { flex-shrink: 0; }
.inv-card > .inv-top:has(> .shop) { flex-shrink: 1; min-height: 0; display: flex; flex-direction: column; }
.inv-top > .shop { flex: 0 1 auto; min-height: 90px; }
