/* LEVEL ARENA — the page follows the chart's theme: the chart sets html[data-theme] to light or dark. */
:root {
  --bg: #F4F3F8; --panel: #FFFFFF; --panel2: #ECEAF3; --ink: #17141F; --mute: #605A72; --line: #DDD9E6;
  --accent: #6D3BE0; --accent-ink: #FFFFFF; --level: #7C3AED;
  /* right / wrong marks use the accent and a neutral tone: green and red mean long / short only */
  --stop: #F5B544; --target: #22D3EE;
  --stop-hit: #DC2626;   /* the stop-hit dot on the chart: red marks the loss (an agreed exception to the long/short colour rule) */
  /* VECTOR's dial strip: on the page surface in light, the desk's dark card in dark */
  --dial-bg: var(--panel); --dial-line: var(--line); --dial-lbl: var(--mute); --dial-lbl-b: var(--ink);
  --dial-track: rgba(23,20,31,.10); --dial-needle: #2A2535; --dial-hub: rgba(23,20,31,.35);
  --dial-up: #0B9A54; --dial-dn: #D61F35; --dial-mut: #8A8499;
  --font: "Segoe UI", "Arial Hebrew", Arial, system-ui, sans-serif;
  --mono: Consolas, "SF Mono", ui-monospace, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0D0B13; --panel: #16131E; --panel2: #201C2B; --ink: #ECE8F4; --mute: #9C95AE; --line: #2B2637;
  --accent: #A78BFA; --accent-ink: #120E1A; --level: #A78BFA;
  --stop-hit: #EF4444;
  --dial-bg: #0b0b12; --dial-line: #2a2237; --dial-lbl: #9a92b0; --dial-lbl-b: #c9c3d6;
  --dial-track: rgba(245,245,247,.09); --dial-needle: #f5f5f7; --dial-hub: rgba(245,245,247,.3);
  --dial-up: #00e87a; --dial-dn: #ff2740; --dial-mut: #5a5a68;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.mute { color: var(--mute); }
[hidden] { display: none !important; }

/* top bar */
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; justify-content: space-between; align-items: center;
       gap: 10px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { background: none; border: 0; font-weight: 800; letter-spacing: .12em; font-size: 15px; padding: 4px 0; }
.bar-r { display: flex; align-items: center; gap: 8px; }
.hud { font-size: 13px; color: var(--mute); }
.hud b { color: var(--ink); }
.ghost { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; }

main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 48px; }
.loading { text-align: center; color: var(--mute); }

/* home */
.home { display: grid; gap: 22px; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: clamp(28px, 6vw, 44px); line-height: 1.05; margin: 0 0 8px; letter-spacing: .02em; }
.hero p { margin: 0; color: var(--mute); max-width: 60ch; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.card h2 { margin: 0; font-size: 18px; }
.card p { margin: 0; color: var(--mute); font-size: 14px; }
.btn { border-radius: 8px; padding: 12px 14px; font-weight: 700; border: 1.5px solid var(--ink); background: transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .45; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sel { display: grid; gap: 4px; font-size: 13px; color: var(--mute); }
.sel select { font: inherit; padding: 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.rankline { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.big { font-size: 30px; font-weight: 800; line-height: 1; }
.meter { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.toggle button { border: 0; background: none; padding: 8px 12px; font-size: 13px; color: var(--mute); }
.toggle button[aria-pressed="true"] { background: var(--panel2); color: var(--ink); font-weight: 700; }
.prize { border-style: dashed; }

/* play */
.play { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .play { grid-template-columns: minmax(0, 1fr); } }
.play-chart { display: grid; gap: 8px; min-width: 0; }
.scen-head { display: grid; gap: 2px; }
.scen-head .t1 { font-weight: 800; font-size: 17px; }
.scen-head .t2 { font-size: 13px; color: var(--mute); }
.tfs { display: flex; gap: 6px; flex-wrap: wrap; }
.tfs button { border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.tfs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chartbox { position: relative; height: clamp(240px, 52vh, 520px); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.chartbox canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.readout { position: absolute; top: 8px; left: 8px; font: 12px var(--mono); background: rgba(10, 8, 16, .82); color: #ECE8F4;
           padding: 4px 8px; border-radius: 4px; pointer-events: none; direction: ltr; }
.readout:empty { display: none; }
.play-side { display: grid; gap: 12px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; }
.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; direction: ltr; }
.g { display: grid; gap: 3px; }
.g .b { height: 7px; background: var(--panel2); position: relative; border-radius: 2px; overflow: hidden; }
.g .b i { position: absolute; top: 0; bottom: 0; background: var(--ink); }
.g .b::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--mute); }
.g span { font-size: 11.5px; color: var(--mute); text-align: center; unicode-bidi: plaintext; }
.q { font-weight: 800; font-size: 17px; line-height: 1.3; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.answers.three { grid-template-columns: 1fr 1fr 1fr; }
.ans { border: 1.5px solid var(--ink); background: transparent; border-radius: 8px; padding: 12px 8px; font-weight: 800; text-align: center; }
.ans small { display: block; font-weight: 500; font-size: 12px; color: var(--mute); margin-top: 2px; }
.ans[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ans[aria-pressed="true"] small { color: var(--accent-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 6px 11px; font-size: 13px; color: var(--mute); }
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); font-weight: 700; }
.hint { font-size: 12.5px; color: var(--mute); }
.vread { font-size: 13.5px; padding: 8px 10px; border-radius: 6px; background: var(--panel2); }

/* reveal */
.verdict { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.verdict .v { font-size: 20px; font-weight: 800; }
.mark { font-weight: 800; padding: 4px 10px; border-radius: 6px; font-size: 14px; }
.mark.ok { color: var(--accent-ink); background: var(--accent); border: 1.5px solid var(--accent); }
.mark.no { color: var(--mute); border: 1.5px dashed var(--mute); }
.chip:disabled { opacity: .4; cursor: default; }
details.hint summary { cursor: pointer; }
details.hint .why { margin-top: 6px; }
.pts { display: grid; gap: 3px; font-size: 13.5px; }
.pts div { display: flex; justify-content: space-between; gap: 10px; }
.pts .tot { border-top: 1px solid var(--line); padding-top: 4px; font-weight: 800; }
.why { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; font-size: 13.5px; }
.disc { font-size: 12px; color: var(--mute); }

/* stats */
.stats { display: grid; gap: 18px; max-width: 900px; margin: 0 auto; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.acc { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; gap: 7px 10px; align-items: center; font-size: 13px; }
.acc .r { display: contents; }
.acc .r .m { height: 8px; background: var(--panel2); border-radius: 4px; overflow: hidden; }
.acc .r .m i { display: block; height: 100%; background: var(--accent); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.badge { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 2px; font-size: 13px; opacity: .5; }
.badge.on { opacity: 1; border-color: var(--accent); }
.badge b { font-size: 14px; }
@media (max-width: 600px) { .chartbox { height: clamp(240px, 40vh, 380px); } }
.scen-head .t0 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tfbig { font-size: 22px; font-weight: 900; letter-spacing: .06em; color: var(--level); }
.scen-head .sym { font-size: 18px; font-weight: 800; }
.gwrap { display: grid; gap: 4px; max-width: 520px; margin-top: 4px; }
.askline .q2 { font-size: 18px; font-weight: 800; }
.ans.buy[aria-pressed="true"] { background: #0b7a55; border-color: #0b7a55; color: #fff; }
.ans.sell[aria-pressed="true"] { background: #c42840; border-color: #c42840; color: #fff; }
.ans.buy[aria-pressed="true"] small, .ans.sell[aria-pressed="true"] small { color: #fff; }
.presets button { flex: 1; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.warn { color: var(--ink); font-weight: 700; }
.mark.flat { color: var(--ink); border: 1.5px solid var(--line); }
details.det { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
details.det summary { cursor: pointer; font-weight: 700; }
details.det .kv { margin-top: 8px; }
.acc .m.mid { position: relative; }
.acc .m.mid::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--mute); }
.bigR { font-size: 34px; font-weight: 900; line-height: 1; font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.bigR.no { color: var(--stop); }
.bigR.ok { color: var(--target); }
.bigR.flat { color: var(--ink); }
:root[dir="rtl"] .bigR, [dir="rtl"] .bigR { text-align: right; }
/* VECTOR's dial strip (colours: --dial-* tokens); always G1 fast on the left → G4 trend on the right, in RTL too */
.dials { display: flex; gap: 6px; direction: ltr; background: var(--dial-bg); border: 1px solid var(--dial-line); border-radius: 8px; padding: 6px 8px; }
.dial { flex: 1; min-width: 0; text-align: center; display: grid; gap: 1px; }
.dial .dl { font-size: 11px; color: var(--dial-lbl); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.dial .dl b { color: var(--dial-lbl-b); }
.dial canvas { width: 100%; height: 26px; display: block; }
.dial .dv { font-size: 13px; font-weight: 700; }
.dial .dd { font-size: 11px; color: var(--dial-lbl); }      /* the change since the touch: neutral ink, never green / red */
.steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.caps { flex-wrap: wrap; }
.caps button { flex: 1 1 auto; }
.lessons { gap: 8px; }
.btn.lesson { text-align: start; font-weight: 700; }
.btn.lesson small { display: block; font-weight: 500; font-size: 12px; color: var(--mute); margin-top: 2px; }
.counts { grid-template-columns: auto 1fr auto; margin-top: 8px; }
@media (max-width: 600px) { .readout { display: none; } }
details.hint summary { cursor: pointer; font-weight: 600; }
h3 { margin: 6px 0 0; font-size: 15px; }
/* the gate: landing + sign-in */
.gate { display: grid; gap: 34px; max-width: 980px; margin: 0 auto; }
.g-hero { display: grid; gap: 14px; padding-block: 12px; }
.g-hero h1 { font-size: clamp(34px, 9vw, 64px); line-height: 1; margin: 0; letter-spacing: .04em; }
.g-lead { font-size: 18px; max-width: 60ch; margin: 0; }
.g-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.g-cta .btn { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }
.g-how h2, .g-signin h2 { margin: 0 0 12px; }
.g-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.g-step { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: grid; position: relative; }
.g-step img { display: block; width: 100%; height: auto; aspect-ratio: 720 / 460; object-fit: cover; background: var(--panel2); }
.g-step figcaption { padding: 10px 12px 12px; font-size: 14px; }
.g-n { position: absolute; top: 8px; inset-inline-start: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; }
.g-form { display: grid; gap: 12px; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.g-form label, .sel { display: grid; gap: 4px; font-size: 13px; color: var(--mute); }
.g-form input, .sel input { font: inherit; padding: 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.g-err { color: var(--ink); font-weight: 700; min-height: 1em; }
.acct { font-size: 13px; display: inline-flex; gap: 8px; align-items: center; }
.acct a { color: var(--accent); }
@media (max-width: 600px) { .acct .mute { display: none; } }
.board { grid-template-columns: auto 1fr auto; }
.board .me span { font-weight: 800; color: var(--accent); }
.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; }

/* the stop-hit dot's layer over the chart: see-through, never takes a touch or a click */
.cv-top { pointer-events: none; }
