/* Hall chrome shared by the home page and the player page. Phone first; a desktop gets a centred column. */
:root {
  --bg: #2b1620;
  --bg2: #3d1f2e;
  --fg: #fff;
  --muted: rgba(255, 255, 255, 0.62);
  --panel: rgba(255, 255, 255, 0.08);
  --panel2: rgba(255, 255, 255, 0.14);
  --accent: #ffd34d;
  --pink: #ff7aa8;
  --ink: #7a3e5c;
  --safe-top: max(env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); font-family: "Fredoka", "M PLUS Rounded 1c", "SF Pro Rounded", -apple-system, "PingFang SC", sans-serif; }
body { background: radial-gradient(120% 80% at 50% 0%, var(--bg2), var(--bg) 70%); overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
a { color: inherit; }

.col { width: 100%; max-width: 520px; margin: 0 auto; padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 24px); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 16px; background: var(--panel2); font-weight: 600; font-size: 17px; transition: transform .08s; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--ink); box-shadow: 0 4px 0 #c99a1a; }
.btn.pink { background: var(--pink); color: #fff; box-shadow: 0 4px 0 #c94f7c; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.btn[disabled] { opacity: .5; box-shadow: none; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.card { background: var(--panel); border-radius: 20px; padding: 14px; }

/* Leaderboard sheet (slides up over everything). */
.sheet { position: fixed; inset: auto 0 0 0; max-height: 80%; display: flex; flex-direction: column; background: #3a1d2b; border-radius: 24px 24px 0 0; padding: 14px 16px calc(var(--safe-bottom) + 16px); box-shadow: 0 -8px 40px rgba(0,0,0,.4); z-index: 20; animation: up .22s ease-out; }
@media (min-width: 720px) { .sheet { left: 50%; right: auto; width: 520px; transform: translateX(-50%); border-radius: 24px; bottom: 24px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.dim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 19; }
.tabs { display: flex; gap: 6px; background: var(--panel); border-radius: 14px; padding: 4px; }
.tabs button { flex: 1; min-height: 36px; border-radius: 11px; background: transparent; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--panel2); color: var(--fg); }
.list { overflow: auto; margin-top: 10px; }
.rowline { display: flex; align-items: center; gap: 10px; padding: 9px 6px; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 16px; }
.rowline .n { width: 28px; color: var(--muted); font-weight: 600; }
.rowline .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowline .s { font-weight: 700; color: var(--accent); }
.rowline.me { background: rgba(255, 211, 77, .12); border-radius: 10px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 80px); transform: translateX(-50%); max-width: 90vw; text-align: center; background: var(--accent); color: var(--ink); font-weight: 700; padding: 10px 16px; border-radius: 14px; z-index: 30; animation: up .2s ease-out; }

/* Desktop frame for the player page (web/hall/desk.js adds .desk on <html> at ≥1024px with a mouse).
   The game keeps its own column in the middle; the side columns are fixed so nothing scrolls. */
html.desk #app { left: 300px; right: 320px; max-width: none; margin: 0; padding-top: 16px; }
html.desk-wide #app { left: 16px; right: 336px; }
html.desk #hud { display: none; }
html.desk .sheet, html.desk .dim { display: none !important; }
html.desk #actions { padding-bottom: 20px; }
.desk-left, .desk-right { position: fixed; top: 0; bottom: 0; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 10px; -webkit-user-select: auto; user-select: auto; }
.desk-left { left: 0; width: 300px; background: rgba(0, 0, 0, .14); border-right: 1px solid rgba(255, 255, 255, .06); }
.desk-right { right: 0; width: 320px; background: rgba(0, 0, 0, .14); border-left: 1px solid rgba(255, 255, 255, .06); }
html.desk-wide .desk-left { display: none; }
.desk-back { color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 14px; }
.desk-back:hover { color: var(--fg); }
.desk-icon { font-size: 64px; line-height: 1; }
.desk-left h1 { margin: 6px 0 0; font-size: 28px; line-height: 1.15; }
.desk-left p { margin: 0; font-size: 15px; }
.desk-left h3, .desk-right h3 { margin: 18px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.desk-left ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.4; }
.desk-brand { margin-top: auto; font-size: 13px; }
.buddy + .desk-brand { margin-top: 10px; }
.desk-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.desk-stats div { background: var(--panel); border-radius: 16px; padding: 12px 14px; }
.desk-stats small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.desk-stats b { font-size: 30px; }
.desk-right .list { margin-top: 6px; overflow: visible; }
.desk-empty { padding: 14px 6px; }
.desk-wide-title { margin: 0 0 4px; font-size: 22px; }
.desk-wide-howto { margin: 0 0 8px; padding-left: 20px; font-size: 14px; line-height: 1.4; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
#d-best-box.target { box-shadow: inset 0 0 0 2px var(--pink); }
#d-best-box.won { box-shadow: inset 0 0 0 2px var(--accent); }
#d-best-box.target #d-best-label, #d-best-box.won #d-best-label { color: var(--fg); text-transform: none; letter-spacing: 0; }
.desk-mute { align-self: flex-start; }
