/* Chart Battle. One dark theme. Gold, silver and bronze are kept for the names of the top 3 only (.nm.m1-.m3). */
:root {
  --bg: #0b0f17; --panel: #131a26; --panel2: #1a2333; --panel3: #22304a; --line: #263247; --text: #e6ebf5; --muted: #8b97ad;
  --accent: #7c5cff; --accent2: #22d3ee; --blue: #5b8cff; --up: #22c55e; --down: #ef4444; --flat: #eab308; --warn: #f59e0b;
  --radius: 14px; --shadow: 0 10px 30px rgba(0, 0, 0, .35); --head: 58px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, "Segoe UI", system-ui, -apple-system, sans-serif; }
body { min-height: 100vh; display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent2); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
input:focus-visible, button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; padding: 0; accent-color: var(--accent); }
h1 { font-size: 28px; margin: 4px 0 6px; }
h2 { font-size: 20px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 6px 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.row.tight { gap: 4px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { text-align: center; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.ok { color: var(--up); } .bad { color: var(--down); }
.pos { color: var(--up); } .neg { color: var(--down); }
.err { color: #fca5a5; margin-top: 8px; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ic.xs { width: 14px; height: 14px; }
.badge { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--down); color: #fff; font-size: 11px; font-weight: 800; align-items: center; justify-content: center; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--panel3); color: var(--text); vertical-align: 1px; }
.pill.fr { background: rgba(34, 211, 238, .14); color: var(--accent2); }
.streak { font-weight: 700; color: var(--warn); white-space: nowrap; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 28px; font-weight: 800; letter-spacing: 4px; }
.big-emoji { font-size: 54px; line-height: 1.1; margin-bottom: 6px; }
.spin { display: inline-block; animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- names: gold, silver and bronze belong to the top 3 only ---------- */
.nm { font-weight: inherit; }
.nm.m1, .nm.m2, .nm.m3 { -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; background-size: 200% 100%; animation: shine 6s linear infinite; }
.nm.m1 { background-image: linear-gradient(100deg, #b8860b 0%, #ffd700 25%, #fff3b0 40%, #ffd700 55%, #b8860b 80%); filter: drop-shadow(0 0 6px rgba(255, 215, 0, .35)); }
.nm.m2 { background-image: linear-gradient(100deg, #8e9aa6 0%, #e3e9ef 25%, #ffffff 40%, #c9d2db 55%, #8e9aa6 80%); filter: drop-shadow(0 0 6px rgba(220, 230, 240, .3)); }
.nm.m3 { background-image: linear-gradient(100deg, #8a4b1f 0%, #cd7f32 25%, #f0b27a 40%, #cd7f32 55%, #8a4b1f 80%); filter: drop-shadow(0 0 6px rgba(205, 127, 50, .35)); }
@keyframes shine { to { background-position: -200% 0; } }

/* ---------- header ---------- */
header.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: var(--head); padding: 0 16px; background: rgba(11, 15, 23, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 18px; letter-spacing: .3px; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.logo b { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.online { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--up); margin-right: 5px; box-shadow: 0 0 8px var(--up); }
nav.tabs { display: flex; gap: 2px; margin-left: auto; }
nav.tabs a { padding: 7px 11px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
nav.tabs a.on, nav.tabs a:hover { color: var(--text); background: var(--panel2); }
.hbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 10px; color: var(--muted); border: 1px solid var(--line); background: var(--panel); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.hbtn:hover { color: var(--text); background: var(--panel2); }
.hbtn .ic { width: 19px; height: 19px; }
#mechip { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mechip { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.mechip:hover { background: var(--panel2); }
.mc-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.mc-text b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.mc-text small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 16px 90px; }
body.has-drawer main { padding-right: 56px; }
footer { padding: 18px; text-align: center; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); }
footer a { color: var(--muted); }

/* ---------- buttons, cards, small parts ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); font-weight: 700; text-decoration: none; color: var(--text); transition: transform .08s, background .15s, border-color .15s; user-select: none; white-space: nowrap; }
.btn:hover { background: var(--panel3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--blue)); border-color: transparent; color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: transparent; border-color: #5b2330; color: #fca5a5; }
.btn.danger:hover { background: rgba(239, 68, 68, .1); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.tiny { padding: 5px 9px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn.big { padding: 14px 24px; font-size: 16px; border-radius: 14px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn.google { background: #fff; color: #1f2937; border-color: #fff; }
.btn.join-btn { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.join-btn:hover { background: #15803d; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.two > .card { margin-bottom: 0; }
.grid.modes { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.modes .card { margin: 0; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--panel2); border-radius: 12px; flex-wrap: wrap; }
.item.me { outline: 1px solid var(--accent); }
.verdict { font-weight: 800; }
.verdict.ok { color: var(--up); } .verdict.bad { color: var(--down); }
.seg { display: inline-flex; background: var(--panel2); border-radius: 12px; padding: 3px; border: 1px solid var(--line); flex-wrap: wrap; gap: 2px; }
.seg button { padding: 7px 12px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 14px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: #fff; }
.seg.mini button { padding: 5px 10px; font-size: 13px; }
.seg.ro button { cursor: default; }
.seg.ro button:not(.on) { opacity: .55; }
.switch, .check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check { align-items: flex-start; }
.wl b.w { color: var(--up); } .wl b.l { color: var(--down); } .wl b.t { color: var(--muted); }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-head h1 { margin: 0; }
h2.sec { font-size: 17px; margin: 18px 0 10px; color: var(--muted); font-weight: 700; letter-spacing: .2px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--panel2); color: var(--muted); }
.tag.easy { color: #86efac; } .tag.medium { color: #93c5fd; } .tag.hard { color: #fca5a5; } .tag.extreme { color: #f0abfc; } .tag.pattern { color: #fde68a; }

/* ---------- modal, toast, confetti ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .62); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s both; }
.modal .card { max-width: 460px; width: 100%; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow); margin: 0; }
.modal.avp .card { max-width: 520px; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 80; background: var(--panel2); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 92vw; animation: up .2s both; }
@keyframes up { from { transform: translate(-50%, 12px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall 2.8s cubic-bezier(.2, .6, .4, 1) forwards; }
@keyframes fall { to { transform: translate(var(--dx, 0), 105vh) rotate(var(--r, 540deg)); opacity: .2; } }
.float-text { position: fixed; z-index: 85; pointer-events: none; font-weight: 900; font-size: 20px; animation: floatup 1.4s ease-out forwards; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.float-text.ok { color: var(--up); } .float-text.bad { color: var(--down); }
@keyframes floatup { to { transform: translateY(-60px); opacity: 0; } }

/* ---------- avatars ---------- */
.av { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--panel2); box-shadow: 0 0 0 3px var(--ring, #3b82f6); flex: none; }
.av img { width: 72%; height: 72%; object-fit: contain; user-select: none; }
.av.dark-ring { box-shadow: 0 0 0 3px #0b0b0b, 0 0 0 4px #4b5563; }
.av.xs { width: 22px; height: 22px; box-shadow: 0 0 0 2px var(--ring, #3b82f6); }
.av.sm { width: 32px; height: 32px; box-shadow: 0 0 0 2.5px var(--ring, #3b82f6); }
.av.lg { width: 72px; height: 72px; box-shadow: 0 0 0 4px var(--ring, #3b82f6); }
.av.xl { width: 104px; height: 104px; box-shadow: 0 0 0 5px var(--ring, #3b82f6); }
.av .st { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--panel); background: #6b7280; }
.av .st.online, .av .st.searching { background: var(--up); }
.av .st.playing { background: var(--accent2); }
.av .st.queue, .av .st.away { background: var(--warn); }
.av.bot { background: #0e2a33; }
.avp-preview { display: flex; justify-content: center; padding: 10px 0 14px; }
.avp-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 8px 0 6px; }
.avp-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.avp-pic { aspect-ratio: 1; border-radius: 14px; background: var(--panel2); border: 2px solid transparent; display: flex; align-items: center; justify-content: center; }
.avp-pic img { width: 70%; height: 70%; }
.avp-pic.on { border-color: var(--accent2); background: var(--panel3); }
.avp-colors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avp-col { aspect-ratio: 1; border-radius: 50%; background: var(--c); border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--line); }
.avp-col.on { box-shadow: 0 0 0 3px var(--accent2); }

/* ---------- home ---------- */
.hero { text-align: center; padding: 30px 10px 22px; }
.hero h1 { font-size: clamp(32px, 6.5vw, 54px); line-height: 1.1; margin: 0; }
.hero h1 span { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); max-width: 600px; margin: 10px auto 20px; }
.welcome { display: flex; align-items: center; gap: 16px; }
.mode { cursor: pointer; transition: transform .12s, border-color .15s; text-decoration: none; color: var(--text); display: block; }
.mode:hover { transform: translateY(-2px); border-color: var(--accent); }
.mode .ico { font-size: 28px; }

/* ---------- Practice and the chart ---------- */
.pr-top { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.wallet { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 5px 6px 5px 12px; }
.wallet input { width: 92px; padding: 6px 8px; }
.game { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.board { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.qbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 34px; }
.qbar .q { font-weight: 700; font-size: 16.5px; }
.prmode { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 999px; background: rgba(124, 92, 255, .16); color: #c4b5fd; font-size: 12px; font-weight: 700; }
.prmode .tbtn { width: 22px; height: 22px; }
.tbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-width: 32px; padding: 0 7px; border-radius: 9px; color: var(--muted); border: 1px solid transparent; }
.tbtn:hover { color: var(--text); background: var(--panel2); }
.tbtn.on { color: #fff; background: var(--accent); }
.tbtn.wide { border-color: var(--line); background: var(--panel); padding: 0 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.ctools { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.tsep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.chartbox { position: relative; height: min(60vh, 560px); min-height: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; touch-action: pan-y; }
.lwc-host { position: absolute; inset: 0; }
.draw-layer { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; overflow: visible; }
.draw-layer.active { pointer-events: auto; cursor: crosshair; }
.draw-layer .zone { fill: rgba(124, 92, 255, .07); stroke: none; }
.draw-layer .zone-start { stroke: #eab308; stroke-width: 1.2; stroke-dasharray: 4 4; } /* where the call or the trade starts, like the app */
.draw-layer .zone-end { stroke: rgba(124, 92, 255, .45); stroke-width: 1; stroke-dasharray: 4 4; }
.dw .dl { stroke: #22d3ee; stroke-width: 1.6; }
.dw .dl.thin { stroke-width: 1; stroke-dasharray: 3 3; }
.dw .dh, .draw-layer > .dh { fill: #22d3ee; }
.dw .dr { fill: rgba(34, 211, 238, .08); stroke: #22d3ee; stroke-width: 1.2; }
.dw .df { stroke: #eab308; stroke-width: 1; }
.dw .df.f05, .dw .df.f0618 { stroke: #f97316; }
.dw .dm.up { fill: rgba(34, 197, 94, .12); stroke: #22c55e; }
.dw .dm.down { fill: rgba(239, 68, 68, .12); stroke: #ef4444; }
.dw text, .dw .dmt { fill: var(--text); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.dw.preview { opacity: .7; }
/* chart patterns */
.pattern .pt-line { fill: none; stroke-linecap: round; }
.pattern .pt-dot { stroke: var(--panel); stroke-width: 2; }
.pattern .pt-zone { stroke-width: 1; }
.pattern .pt-pill rect { fill: rgba(11, 15, 23, .88); stroke-width: 1; }
.pattern .pt-pill text { fill: var(--text); font-size: 11px; font-weight: 700; letter-spacing: .2px; }
/* things on top of the chart */
.ov { position: absolute; z-index: 4; pointer-events: none; }
.ov > * { pointer-events: auto; }
.ov-tl { left: 10px; top: 10px; max-width: calc(100% - 90px); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ov-tr { right: 64px; top: 10px; }
.ov-bl { left: 10px; bottom: 34px; display: flex; gap: 6px; flex-wrap: wrap; }
.ov-c { inset: 0; display: flex; align-items: center; justify-content: center; }
.ov-c:empty { display: none; }
.ov-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ov-title { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; background: rgba(11, 15, 23, .7); padding: 2px 8px; border-radius: 6px; }
.ov-note, .ov-hint { background: rgba(11, 15, 23, .82); border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.ov-hint { font-weight: 500; color: var(--muted); font-size: 12px; }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(11, 15, 23, .82); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.ov-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 700; }
.ov-grid input { padding: 6px 8px; width: 120px; }
.obtn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 10px; font-weight: 800; font-size: 14px; background: rgba(26, 35, 51, .94); border: 1px solid var(--line); color: var(--text); backdrop-filter: blur(4px); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.obtn:hover { background: var(--panel3); }
.obtn.big { padding: 12px 18px; font-size: 16px; min-width: 112px; justify-content: center; }
.obtn.up, .obtn.bullish { color: #4ade80; border-color: rgba(34, 197, 94, .55); }
.obtn.down, .obtn.bearish { color: #f87171; border-color: rgba(239, 68, 68, .55); }
.obtn.flat, .obtn.neutral { color: #facc15; border-color: rgba(234, 179, 8, .55); }
.obtn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.obtn.go { background: linear-gradient(135deg, var(--accent), var(--blue)); border-color: transparent; color: #fff; }
.obtn:disabled { opacity: .5; cursor: default; }
.verdict-badge { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 10px; font-weight: 900; font-size: 16px; color: #fff; animation: pop .35s cubic-bezier(.2, 1.4, .4, 1) both; }
.verdict-badge.ok { background: #16a34a; } .verdict-badge.bad { background: #dc2626; }
.ov-big { background: rgba(11, 15, 23, .88); border: 1px solid var(--line); border-radius: 16px; padding: 16px 26px; font-size: 26px; font-weight: 900; text-align: center; animation: pop .4s cubic-bezier(.2, 1.4, .4, 1) both; pointer-events: none; }
.ov-big small { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.ov-big.gain { color: #f9a8d4; } .ov-big.out { color: #fca5a5; } .ov-big.lvl { color: #a5b4fc; }
.live { font-weight: 900; font-size: 18px; background: rgba(11, 15, 23, .82); border-radius: 10px; padding: 4px 10px; }
.live.up { color: var(--up); } .live.down { color: var(--down); }
.live small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.done-card { pointer-events: auto; max-width: 560px; margin: 16px; background: rgba(19, 26, 38, .97); border: 1px solid var(--line); border-radius: 18px; padding: 22px; text-align: center; box-shadow: var(--shadow); animation: pop .4s cubic-bezier(.2, 1.3, .4, 1) both; }
.done-emoji { font-size: 46px; }
.done-card .row { margin-top: 12px; }
.small-btns .btn { padding: 7px 12px; font-size: 13px; }
.prog { display: flex; flex-direction: column; gap: 8px; }
.prog-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.prog-row .bar { height: 8px; border-radius: 4px; background: #1f2a3d; overflow: hidden; }
.prog-row .bar i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.side .card { margin: 0; }
.explain .notes { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.explain .notes li { margin: 3px 0; }
.reveal { border-left: 4px solid var(--accent); }
.reveal.ok { border-left-color: var(--up); } .reveal.bad { border-left-color: var(--down); }
.reveal .verdict { font-size: 20px; }
.botop { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.trade-res { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.grade { display: inline-flex; width: 26px; height: 26px; border-radius: 8px; align-items: center; justify-content: center; font-weight: 900; color: #0b0f17; }
.grade.gA { background: #22c55e; } .grade.gB { background: #84cc16; } .grade.gC { background: #eab308; } .grade.gD { background: #f97316; } .grade.gE { background: #ef4444; }
/* chart menus */
.cmenu { position: fixed; z-index: 70; min-width: 240px; max-width: 320px; max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.cm-head { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding: 6px 8px; }
.cm-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.cm-row:hover, .cm-item:hover { background: var(--panel2); }
.cm-item { display: block; width: 100%; text-align: left; padding: 7px 8px; border-radius: 8px; font-size: 14px; }
.cm-item small { display: block; color: var(--muted); font-size: 12px; }
.cm-item.on { background: rgba(124, 92, 255, .18); }
.cm-line { display: flex; align-items: center; gap: 4px; }
.cm-del { padding: 6px; border-radius: 8px; color: var(--muted); }
.cm-del:hover { color: #fca5a5; background: var(--panel2); }
.cm-save { display: flex; gap: 6px; padding: 8px; }
.cm-save input { flex: 1; padding: 6px 8px; font-size: 13px; }
.cm-note { font-size: 12px; color: var(--muted); padding: 6px 8px; }
.sw { display: inline-block; width: 22px; height: 6px; border-radius: 3px; flex: none; }
.sw.off { background: transparent; box-shadow: inset 0 0 0 1px #3a4660; }
.ind-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel2); margin: 2px 4px 2px 0; }

/* ---------- Play ---------- */
.play-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 10px; }
.play-card { margin: 0; display: flex; flex-direction: column; }
.pc-head { display: flex; gap: 12px; align-items: center; }
.pc-head h2 { margin: 0; }
.pc-head p { margin: 2px 0 0; }
.pc-ico { font-size: 34px; }
.pc-rules { color: #c2cbe0; }
.pc-act { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.pc-me { display: flex; align-items: center; gap: 10px; }
.pc-me small { display: block; color: var(--muted); }
.join-form { display: flex; gap: 8px; }
.join-form input { width: 120px; text-transform: uppercase; letter-spacing: 3px; font-weight: 800; font-family: ui-monospace, Consolas, monospace; }
.rules-box { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 6px 0; }
.rules-box summary { cursor: pointer; font-weight: 600; font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.sets { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.set-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.set-row > span:first-child { min-width: 150px; color: var(--muted); font-weight: 600; }
.searching { text-align: center; padding: 10px 0; width: 100%; }
.radar { position: relative; width: 110px; height: 110px; margin: 0 auto 12px; border-radius: 50%; border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; animation: rad 2s linear infinite; }
.radar::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; border: 2px solid var(--accent2); opacity: .5; }
.radar-emoji { font-size: 38px; animation: pop .4s both; }
@keyframes rad { from { box-shadow: 0 0 0 0 rgba(124, 92, 255, .6); } to { box-shadow: 0 0 0 40px rgba(124, 92, 255, 0); } }
.found-ov { position: fixed; inset: 0; z-index: 75; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, rgba(124, 92, 255, .35), rgba(5, 6, 10, .95) 65%); animation: fade .2s both; }
.found-box { text-align: center; }
.found-title { font-size: 28px; font-weight: 900; margin-bottom: 18px; animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.found-vs { display: flex; align-items: center; gap: 24px; justify-content: center; }
.fv { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fv small { color: var(--muted); }
.fv.left { animation: inl .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.fv.right { animation: inr .6s cubic-bezier(.2, 1.4, .4, 1) .1s both; }
.fv-x { font-size: 40px; font-weight: 900; color: var(--warn); text-shadow: 0 0 24px var(--warn); }
.found-emojis { margin-top: 16px; font-size: 28px; display: flex; gap: 16px; justify-content: center; }
.found-emojis span { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.found-emojis span:nth-child(2) { animation-delay: .15s; } .found-emojis span:nth-child(3) { animation-delay: .3s; }
.ilist { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; margin: 8px 0; }
.irow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--panel2); }
.irow small { display: block; color: var(--muted); font-size: 12px; }
.istats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
.irow.offline { opacity: .6; }
.share { background: var(--panel2); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.share .code { font-size: 24px; }

/* ---------- a lobby ---------- */
.mv { min-height: 50vh; }
.lobby { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.lobby-card { margin: 0; }
.lobby-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ring { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 18px 0 8px; flex-wrap: wrap; }
.slot { width: 112px; min-height: 132px; border-radius: 16px; background: var(--panel2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; text-align: center; font-size: 13px; position: relative; }
.slot b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot small { color: var(--muted); font-size: 11.5px; }
.slot.me { width: 138px; min-height: 160px; border-color: var(--accent); background: linear-gradient(180deg, rgba(124, 92, 255, .16), var(--panel2)); cursor: pointer; }
.slot.add { border: 2px dashed #34425e; background: transparent; color: var(--muted); cursor: pointer; transition: border-color .15s, color .15s; }
.slot.add:hover { border-color: var(--accent2); color: var(--accent2); }
.slot .plus { font-size: 40px; font-weight: 300; line-height: 1; }
.slot .btn { margin-top: 2px; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 16px 0 8px; }
.team { display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 12px; border-radius: 16px; background: rgba(91, 140, 255, .06); border: 1px solid var(--line); }
.team.t1 { background: rgba(249, 115, 22, .06); }
.team-h { font-weight: 800; font-size: 13px; color: var(--muted); }
.team-vs { font-size: 26px; font-weight: 900; color: var(--warn); }
.teams.random .team-vs { color: var(--text); }
.lsets { background: var(--panel2); border-radius: 12px; padding: 12px; margin: 14px 0; }
.ls-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.lobby-go { margin-top: 10px; }
.warn-note { color: #fcd34d; font-size: 13px; }
.waiting .found-vs { margin: 12px 0; }

/* ---------- a match ---------- */
.mgame { position: relative; }
.timer { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--up), var(--warn), var(--down)); transition: width .25s linear; }
.timer-num { font-variant-numeric: tabular-nums; font-weight: 800; min-width: 38px; text-align: right; }
.timer-num.low { color: var(--down); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.myh { display: inline-flex; align-items: center; gap: 6px; }
.hearts { display: inline-flex; gap: 1px; font-size: 15px; line-height: 1; }
.heart { font-style: normal; display: inline-block; }
.heart.gone { opacity: .35; filter: grayscale(1); }
.heart.lost { animation: heartbreak 1.1s ease-in forwards; }
.heart.gain { animation: heartgain .9s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes heartbreak { 0% { transform: scale(1); } 20% { transform: scale(1.45) rotate(-12deg); } 45% { transform: scale(1.2) rotate(10deg); opacity: 1; } 100% { transform: translateY(14px) scale(.4) rotate(40deg); opacity: 0; } }
@keyframes heartgain { 0% { transform: scale(0); } 60% { transform: scale(1.6); } 100% { transform: scale(1); } }
.regain { font-size: 11.5px; color: var(--warn); font-weight: 700; }
.oppbox { display: flex; align-items: center; gap: 8px; background: rgba(11, 15, 23, .86); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; font-size: 13px; }
.oppbox small { display: block; color: var(--muted); font-size: 11.5px; }
.oppbox.many { flex-direction: column; align-items: stretch; gap: 4px; }
.om-head { font-size: 11.5px; font-weight: 800; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.om { display: flex; align-items: center; gap: 6px; }
.om.out { opacity: .45; text-decoration: line-through; }
.stakes { display: flex; gap: 8px; font-size: 11.5px; font-weight: 700; margin-top: 4px; }
.stakes .w { color: var(--up); } .stakes .d { color: var(--muted); } .stakes .l { color: var(--down); }
.res-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.res-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: rgba(11, 15, 23, .86); border: 1px solid var(--line); }
.res-chip.ok { border-color: rgba(34, 197, 94, .6); } .res-chip.bad { border-color: rgba(239, 68, 68, .6); }
.mp { padding: 12px; }
.mp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.players { display: flex; flex-direction: column; gap: 6px; }
.pl { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 10px; background: var(--panel2); }
.pl.me { outline: 1px solid var(--accent); }
.pl.out { opacity: .45; }
.pl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-txt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.pl-txt small { color: var(--muted); font-size: 11.5px; }
.team-card { border-radius: 12px; border: 1px solid var(--line); padding: 8px; background: var(--panel2); display: flex; flex-direction: column; gap: 6px; }
.team-card.mine { border-color: var(--accent); }
.team-card.out { opacity: .5; }
.tc-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions small { color: var(--muted); font-weight: 500; }
.offer-note { font-size: 12.5px; color: #fcd34d; width: 100%; }
.chat { display: flex; flex-direction: column; height: 300px; padding: 12px; }
.chat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.chatlog { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 2px 0; font-size: 13.5px; }
.chatlog .msg { padding: 4px 26px 4px 8px; border-radius: 8px; background: var(--panel2); word-break: break-word; position: relative; }
.chatlog .msg.mine { background: rgba(124, 92, 255, .14); }
.chatlog .msg .more { position: absolute; right: 4px; top: 2px; color: var(--muted); font-size: 13px; padding: 0 4px; }
.chatlog .sys { color: var(--muted); font-size: 12px; text-align: center; }
.phrases { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.phrases button { padding: 5px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.phrases button:hover { border-color: var(--accent2); }
.chat-form { margin-top: 6px; }
.chat-form input { padding: 7px 10px; }
.chat-toggle { display: none; }
.lchat .chat { height: 420px; }
/* fullscreen: the chart, the answers and the timer fill the screen */
.game.fs { position: fixed; inset: 0; z-index: 65; background: var(--bg); padding: 10px; grid-template-columns: minmax(0, 1fr); overflow: auto; }
.game.fs .chartbox { height: calc(100vh - 110px); }
.game.fs .side { display: none; }
body.fs-on { overflow: hidden; }
/* the intro: names fly in */
.intro { position: fixed; inset: 0; z-index: 72; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: radial-gradient(circle at center, #1d1550 0%, #05060a 70%); overflow: hidden; padding: 16px; }
.istage { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; }
.iname { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 20px; border-radius: 18px; background: rgba(255, 255, 255, .06); font-size: clamp(18px, 3.6vw, 30px); font-weight: 900; }
.iname small { font-size: 13px; font-weight: 600; color: var(--muted); }
.iname.left { animation: inl .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.iname.right { animation: inr .7s cubic-bezier(.2, 1.4, .4, 1) .15s both; }
.many { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 900px; }
.many .iname { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.iteam { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.iteam.left { animation: inl .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.iteam.right { animation: inr .7s cubic-bezier(.2, 1.4, .4, 1) .15s both; }
.iteam-h { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent2); font-weight: 800; }
.intro .vs { font-size: clamp(40px, 9vw, 86px); font-weight: 900; color: var(--warn); animation: vs .6s .6s both; text-shadow: 0 0 30px var(--warn); }
.ititle { font-size: 15px; letter-spacing: 6px; color: var(--accent2); font-weight: 800; animation: fade .8s both; text-transform: uppercase; text-align: center; }
.isub { color: #c2cbe0; font-size: 14px; text-align: center; animation: fade .8s .9s both; }
.istakes { font-size: 13.5px; font-weight: 700; animation: fade .8s 1s both; }
.intro .count { font-size: 54px; font-weight: 900; min-height: 64px; }
.intro .flash { position: absolute; inset: 0; background: #fff; animation: flash .6s .55s both; pointer-events: none; }
@keyframes inl { from { transform: translateX(-120vw) rotate(-8deg); } to { transform: none; } }
@keyframes inr { from { transform: translateX(120vw) rotate(8deg); } to { transform: none; } }
@keyframes vs { from { transform: scale(4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(0); } to { transform: none; } }
@keyframes flash { 0% { opacity: 0; } 20% { opacity: .5; } 100% { opacity: 0; } }
/* the end */
.over { text-align: center; padding: 26px 14px; }
.over-emoji { font-size: 60px; animation: pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.over .big { font-size: clamp(36px, 8vw, 62px); font-weight: 900; }
.over .big.win { color: var(--up); text-shadow: 0 0 30px rgba(34, 197, 94, .5); }
.over .big.loss { color: var(--down); }
.over .big.tie { color: var(--flat); }
.rating-anim { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; margin: 14px auto; padding: 12px 22px; border-radius: 16px; background: var(--panel2); min-width: 220px; }
.ra-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.ra-num { font-size: 42px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ra-num.bump { animation: bump .25s; }
@keyframes bump { 50% { transform: scale(1.12); } }
.ra-delta { font-weight: 900; font-size: 18px; }
.ra-delta.up { color: var(--up); } .ra-delta.down { color: var(--down); }
.ra-bar { width: 100%; height: 6px; border-radius: 3px; background: #1f2a3d; overflow: hidden; }
.ra-bar i { display: block; height: 100%; background: var(--blue); transition: width .1s linear; }
.streak-line { font-weight: 700; }
.standings { display: flex; flex-direction: column; gap: 6px; max-width: 460px; margin: 12px auto; text-align: left; }
.standings .place { width: 34px; }
.invite-pop { position: fixed; right: 16px; top: calc(var(--head) + 12px); z-index: 78; display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--accent); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); animation: slidein .3s cubic-bezier(.2, 1.2, .4, 1) both; }
@keyframes slidein { from { transform: translateX(120%); } }

/* ---------- friends: the drawer on the right ---------- */
.fdrawer { position: fixed; right: 0; top: var(--head); bottom: 0; z-index: 25; width: 280px; transform: translateX(100%); transition: transform .25s cubic-bezier(.2, .9, .3, 1); }
.fdrawer.open { transform: none; }
.fd-handle { position: absolute; left: -46px; top: 18px; width: 46px; padding: 10px 0; border-radius: 12px 0 0 12px; background: var(--panel); border: 1px solid var(--line); border-right: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 18px; box-shadow: -6px 6px 18px rgba(0, 0, 0, .25); }
.fd-handle b { font-size: 12px; color: var(--up); }
.fd-inner { height: 100%; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 12px; box-shadow: -10px 0 30px rgba(0, 0, 0, .35); }
.fd-head { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.fd-group { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 12px 0 6px; }
.fd-row { display: flex; align-items: center; gap: 9px; padding: 7px; border-radius: 10px; }
.fd-row:hover { background: var(--panel2); }
.fd-row.offline { opacity: .6; }
.fd-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.fd-txt b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-txt small { font-size: 11.5px; color: var(--muted); }
.fd-stats { color: #a7b2c7 !important; }
.fd-empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
.fd-more { display: block; margin-top: 12px; font-size: 13px; }
.frow { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; flex-wrap: wrap; }
.frow + .frow { border-top: 1px solid var(--line); }
.ftxt { display: flex; flex-direction: column; min-width: 130px; }
.fstats { display: flex; gap: 12px; flex-wrap: wrap; color: #c2cbe0; }
.fbtns { display: flex; gap: 6px; }
.fgroup { font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 14px 0 4px; }

/* ---------- leaderboard ---------- */
table.lb { width: 100%; border-collapse: collapse; }
table.lb th, table.lb td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--line); }
table.lb th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
table.lb tr.me td { background: rgba(124, 92, 255, .12); }
table.lb tr.fr td { background: rgba(34, 211, 238, .05); }
table.lb tr.gap td { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding-top: 16px; border-bottom: 0; }
table.lb td.num, table.lb th.num { text-align: right; font-variant-numeric: tabular-nums; }
.lb-player { display: inline-flex; align-items: center; gap: 10px; }
.rk { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk.unk { color: var(--muted); }
.lb-note { margin: 10px 0 0; }

/* ---------- profile ---------- */
.prof-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.prof-head h1 { margin: 0; }
.prof-av { position: relative; border-radius: 50%; padding: 6px; }
.prof-edit { position: absolute; right: 0; bottom: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--panel); }
.lay { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; flex-wrap: wrap; }
.lay.on { background: rgba(124, 92, 255, .1); }
.lay-name { width: 160px; padding: 6px 9px; font-weight: 700; }
.lay-ind { flex: 1; min-width: 160px; }
.name-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.name-opt { font-size: 16px; }

/* ---------- analytics ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tiles.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tile small { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.tile b { font-size: 26px; font-weight: 700; line-height: 1.15; }
.tile span { font-size: 12.5px; color: #c2cbe0; }
.tile span.muted { color: var(--muted); }
.tile.big b { font-size: 34px; }
.spark { margin-top: 6px; overflow: visible; }
.spark-empty { margin-top: 8px; }
.meters { display: flex; flex-direction: column; gap: 10px; }
.meter-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) 2fr minmax(90px, auto); gap: 10px; align-items: center; font-size: 13.5px; }
.mbar { height: 8px; border-radius: 4px; background: #1f2a3d; overflow: hidden; }
.mbar i { display: block; height: 100%; border-radius: 4px; background: var(--blue); }
.mval { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tp-hero { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
.tp-hero b { font-size: 48px; font-weight: 700; line-height: 1; }
table.tp { margin-top: 8px; max-width: 460px; }
.viz { width: 100%; overflow: hidden; }
.viz .ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz .ax.strong { fill: var(--text); font-weight: 700; }
.viz .col:hover { filter: brightness(1.25); }
.viz-tip { position: fixed; z-index: 95; pointer-events: none; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; box-shadow: var(--shadow); }
.viz-tip b { font-size: 14px; }
.viz-tip span { color: var(--muted); }

/* ---------- the site queue ---------- */
body.gated-q { overflow: hidden; }
.queue-pos { font-size: 20px; margin: 12px 0; }
.queue-emoji { animation: spin 3s linear infinite; display: inline-block; }

/* ---------- phones ---------- */
@media (max-width: 1100px) {
  nav.tabs a .ic { display: none; }
  .hbtn span { display: none; }
}
@media (max-width: 900px) {
  .game, .lobby { grid-template-columns: 1fr; }
  nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; justify-content: space-around; background: rgba(11, 15, 23, .97); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); margin: 0; }
  nav.tabs a { font-size: 12px; padding: 6px 7px; }
  header.top { padding: 0 10px; gap: 8px; backdrop-filter: none; background: var(--bg); } /* a filter would trap the fixed tab bar inside the header */
  .logo b { display: none; }
  .online { font-size: 11.5px; margin-left: auto; }
  .chartbox { height: 50vh; min-height: 280px; }
  main { padding: 12px 10px 100px; }
  body.has-drawer main { padding-right: 10px; }
  .chat { height: 230px; }
  .side .chat.collapsed { display: none; }
  .chat-toggle { display: inline-flex; }
  .hide-sm { display: none; }
  .fdrawer { top: var(--head); bottom: calc(56px + env(safe-area-inset-bottom)); width: min(300px, 86vw); }
  .fd-handle { top: auto; bottom: 16px; }
  .mc-text small { display: none; }
  .mc-text b { max-width: 96px; }
  .slot { width: 96px; min-height: 118px; }
  .slot.me { width: 116px; min-height: 140px; }
  .teams { grid-template-columns: 1fr; }
  .team-vs { text-align: center; }
  .meter-row { grid-template-columns: 1fr auto; }
  .meter-row .mbar { grid-column: 1 / -1; grid-row: 2; }
  .ov-tr { right: 10px; top: auto; bottom: 34px; }
  .obtn.big { min-width: 90px; padding: 11px 12px; }
  .invite-pop { top: auto; bottom: calc(70px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
  .mechip { padding-right: 4px; }
  .mc-text { display: none; }
  .hero h1 { font-size: 30px; }
  .avp-colors { grid-template-columns: repeat(4, 1fr); }
  .ring { gap: 8px; }
}

/* ---------- the policy popup: covers the whole page until the player accepts ---------- */
body.gated { overflow: hidden; }
.policy-gate { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at top, rgba(124, 92, 255, .25), transparent 60%), rgba(5, 8, 14, .94); backdrop-filter: blur(6px); }
.policy-box { width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 22px 22px 18px; box-shadow: var(--shadow); }
.policy-box h2 { font-size: 24px; margin: 0 0 4px; }
.policy-points { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.policy-points li { display: flex; gap: 10px; align-items: flex-start; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.policy-points .pi { font-size: 20px; line-height: 1.2; }
.policy-stand { margin: 10px 0 6px; }
.policy-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.btn.policy-accept { background: #16a34a; border-color: #16a34a; color: #fff; min-width: 140px; }
.btn.policy-accept:hover { background: #15803d; }
.btn.policy-skip { background: transparent; color: var(--muted); }
.policy-lock { font-size: 48px; }
.policy-page { max-width: 780px; margin: 0 auto; }
.policy-page h2 { margin-top: 22px; }
.policy-page li { margin: 6px 0; }
@media (max-width: 560px) {
  .policy-gate { padding: 10px; }
  .policy-box { padding: 16px 14px 14px; max-height: calc(100vh - 20px); }
  .policy-box h2 { font-size: 21px; }
  .policy-points { gap: 6px; margin: 10px 0; }
  .policy-points li { padding: 7px 10px; font-size: 14px; }
  .policy-btns .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* chart patterns: answer pictures and the reveal */
.obtn.pk { gap: 8px; }
.pt-thumb { flex: none; }
.pt-evidence { background: var(--panel2); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.pt-evidence p { margin: 4px 0 0; }

/* ---------- solo challenges: Daily challenge, Speed Run, Portfolio Challenge ---------- */
.wstreak { font-weight: 700; color: #fde047; white-space: nowrap; }
.tbl-wrap { overflow-x: auto; }
.lb-modes { margin: 4px 0 10px; }
kbd { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--panel2); font: 600 12px/18px ui-monospace, Consolas, monospace; text-align: center; }
.solo-intro { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.solo-rules ul.rules { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; color: #c2cbe0; }
.solo-best { display: flex; flex-direction: column; gap: 2px; }
.solo-best b { font-size: 30px; font-variant-numeric: tabular-nums; }
.mini-lb { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mini-lb li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); }
.mini-lb li.me { color: #c4b5fd; }
.mini-lb .rk { width: 28px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.mini-lb .mini-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-lb b { font-variant-numeric: tabular-nums; }
.resume { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(91, 140, 255, .45); background: rgba(91, 140, 255, .08); }
.solo-over { max-width: 760px; margin: 0 auto; }
.so-card { padding: 26px 20px; }
.so-ico { font-size: 40px; line-height: 1; }
.so-label { margin-top: 6px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; font-size: 12.5px; }
.so-score { font-size: clamp(40px, 9vw, 64px); font-weight: 900; line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.so-best { font-size: 16px; margin: 10px 0 2px; }
.so-best.new { color: #fde047; font-weight: 800; }

/* Speed Run */
.sp { max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.sp-top { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.sp-clock { font: 900 34px/1 ui-monospace, Consolas, monospace; min-width: 88px; font-variant-numeric: tabular-nums; }
.sp-clock.hurry { color: #f87171; animation: pulse 1s ease-in-out infinite; }
.sp-bar { height: 10px; border-radius: 5px; background: #1f2a3d; overflow: hidden; }
.sp-bar i { display: block; height: 100%; width: 100%; background: var(--blue); border-radius: 5px; transform-origin: left center; }
.sp.hurry .sp-bar i { background: #ef4444; }
.sp-score { text-align: right; line-height: 1.05; }
.sp-score b { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
.sp-score small { display: block; color: var(--muted); font-size: 12px; }
.sp-chart { height: min(56vh, 520px); }
.sp-count { font-size: 64px; padding: 14px 40px; }
.sp-count.go { color: #4ade80; }
.chartbox.flash-ok { animation: flashok .35s ease-out; }
.chartbox.flash-bad { animation: flashbad .35s ease-out; }
@keyframes flashok { from { box-shadow: inset 0 0 0 3px rgba(34, 197, 94, .9); } to { box-shadow: inset 0 0 0 3px rgba(34, 197, 94, 0); } }
@keyframes flashbad { from { box-shadow: inset 0 0 0 3px rgba(239, 68, 68, .9); } to { box-shadow: inset 0 0 0 3px rgba(239, 68, 68, 0); } }
.sp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sp-btns .obtn.big { font-size: 20px; padding: 16px; justify-content: center; }
.sp-strip { display: flex; gap: 4px; overflow-x: auto; min-height: 26px; scrollbar-width: thin; }
.sp-strip.done { flex-wrap: wrap; overflow: visible; }
.sp-strip i { flex: none; width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-weight: 900; font-size: 13px; color: #fff; }
.sp-strip i.ok { background: #16a34a; } .sp-strip i.bad { background: #b91c1c; }

/* Portfolio Challenge */
.pf-head { gap: 18px; }
.pf-stat { display: flex; flex-direction: column; line-height: 1.15; }
.pf-stat small { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.pf-stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.pf-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.pf-dots i { width: 18px; height: 8px; border-radius: 4px; background: #1f2a3d; }
.pf-dots i.cur { background: var(--blue); }
.pf-dots i.win { background: #16a34a; } .pf-dots i.loss { background: #b91c1c; } .pf-dots i.skip { background: #475569; } .pf-dots i.even { background: #64748b; }
.ticket h3 { margin-bottom: 10px; }
.tk-side { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.tk-side .obtn { justify-content: center; box-shadow: none; }
.tk-side .obtn.up.on { background: #16a34a; border-color: #16a34a; color: #fff; }
.tk-side .obtn.down.on { background: #dc2626; border-color: #dc2626; color: #fff; }
.tk-amt { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.tk-amt label, .tk-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.tk-amt input[type="range"] { width: 100%; accent-color: var(--blue); padding: 0; background: none; border: 0; }
.tk-quick { display: flex; gap: 5px; flex-wrap: wrap; }
.tk-quick .btn.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.tk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tk-grid input { width: 100%; }
.tk-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.tk-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.tk-sum b.pos { color: var(--up); } .tk-sum b.neg { color: var(--down); }
.tk-go { width: 100%; margin-top: 12px; }
.verdict-badge.skip { background: #475569; }
.pf-log td, .pf-log th { white-space: nowrap; }

/* Daily challenge */
.dl-head { align-items: flex-start; }
.dl-streak { display: flex; flex-direction: column; align-items: center; padding: 8px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); line-height: 1.1; }
.dl-streak b { font-size: 26px; }
.dl-streak small { color: var(--muted); font-size: 12px; }
.dl-streak.lit { border-color: rgba(245, 158, 11, .6); background: rgba(245, 158, 11, .08); }
.dl-streak.guest { flex-direction: row; gap: 10px; }
.dl-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 4px 0 12px; }
.dl-step { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.dl-step .dn { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; background: var(--panel3); }
.dl-step .dt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.dl-step .dt b { font-size: 13px; } .dl-step .dt small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-step.cur { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.dl-step.ok .dn { background: #16a34a; color: #fff; } .dl-step.bad .dn { background: #b91c1c; color: #fff; }
.dl-step.ok, .dl-step.bad { color: var(--text); }
.dl-done { max-width: 760px; margin: 0 auto; }
.dl-card { padding: 26px 20px; }
.dl-score { font-size: 64px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.dl-score small { font-size: 28px; color: var(--muted); }
.dl-ext { font-size: 16px; }
.dl-list td.ok, .dl-list td.bad { font-weight: 900; }
.home-streak { text-decoration: none; color: inherit; padding: 8px 14px; border-radius: 14px; border: 1px solid transparent; }
.home-streak .streak { font-size: 28px; }
.home-streak.lit { border-color: rgba(245, 158, 11, .5); background: rgba(245, 158, 11, .07); }
.home-streak:hover { border-color: var(--line); }
@media (max-width: 900px) {
  .solo-intro { grid-template-columns: 1fr; }
  .dl-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .dl-step { flex-direction: column; padding: 6px 2px; gap: 3px; text-align: center; }
  .dl-step .dt small { display: none; }
  .dl-step .dt b { font-size: 11px; }
  .sp-chart { height: 46vh; min-height: 260px; }
  .sp-clock, .sp-score b { font-size: 28px; }
  .pf-head h1 { font-size: 22px; width: 100%; }
  .pf-stat b { font-size: 17px; }
}

/* ---------- the Support page ---------- */
body.support main { max-width: 860px; margin: 0 auto; width: 100%; }
.sup-hero { text-align: center; padding: 18px 0 8px; }
.sup-hero h1 { font-size: 34px; }
.sup-search { position: relative; max-width: 620px; margin: 14px auto 10px; }
.sup-search input { width: 100%; padding: 14px 92px 14px 16px; font-size: 16px; border-radius: 14px; }
.sup-count { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.sup-toc { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 6px 0 4px; }
.sup-toc a { padding: 5px 11px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; }
.sup-toc a:hover { border-color: var(--accent2); }
.sup-sec { margin: 24px 0 0; scroll-margin-top: 70px; }
.sup-sec h2 { font-size: 19px; margin-bottom: 8px; }
.qa { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; padding: 0 16px; }
.qa summary { cursor: pointer; padding: 13px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; color: var(--muted); font-weight: 800; }
.qa[open] summary::after { content: "−"; }
.qa[open] { padding-bottom: 10px; }
.qa p, .qa li { color: #c2cbe0; font-size: 14.5px; }
.qa ul { padding-left: 20px; }
.qa.hit { border-color: rgba(34, 211, 238, .45); }
.sup-contact { margin-top: 28px; }
.sup-mail { font-size: 16px; }
.sup-mail a { font-weight: 700; }

/* Printing (and the PDF of the privacy policy): black on white */
@media print {
  :root { color-scheme: light; }
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #111 !important; }
  header.top, footer, nav.tabs, .no-print, .policy-page .btn, .fdrawer { display: none !important; }
  main { padding: 0 !important; }
  .card { background: #fff !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .policy-page, .policy-page p, .policy-page li, .policy-page h1, .policy-page h2 { color: #111 !important; }
  .muted { color: #555 !important; }
  a { color: #1d4ed8 !important; }
  .policy-page h2 { break-after: avoid; }
  .policy-page li { break-inside: avoid; }
}
body.support .logo b { display: inline; } /* only one button in this header, so the name fits on phones too */
