/* Night-watch radar: deep sea green, phosphor signal, amber heat. */
:root {
  --bg: #06110e; --panel: #0c1d18; --panel-2: #12291f; --line: #1e3d31;
  --ink: #eaf5ee; --muted: #8fb0a1;
  --go: #5cf2a8; --heat: #ffb340; --stop: #ff6f61; --ice: #78d6ff;
  --display: "Suez One", "IBM Plex Sans Hebrew", serif;
  --body: "IBM Plex Sans Hebrew", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --r: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); color-scheme: dark; }
body {
  min-height: 100dvh; color: var(--ink); font: 400 16px/1.55 var(--body);
  background:
    radial-gradient(900px 500px at 85% -10%, #12402e 0%, transparent 65%),
    repeating-linear-gradient(0deg, transparent 0 39px, #ffffff06 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, #ffffff06 39px 40px),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.2; }
h2 { font-size: 1.35rem; margin: 28px 0 12px; }
a { color: var(--ice); }
.num { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.error { color: var(--stop); min-height: 1.4em; }

/* ---------- shell ---------- */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between;
  align-items: center; padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.brand { font-family: var(--display); font-size: 1.15rem; display: flex; gap: 9px; align-items: center; }
.brand b { width: 10px; height: 10px; border-radius: 50%; background: var(--go); box-shadow: 0 0 12px var(--go); animation: breathe 2.4s infinite; }
.chip { font-size: .8rem; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); }
.chip.weak { color: var(--heat); border-color: #6a4a15; }
.chip.ok { color: var(--go); border-color: #1f5b41; }
main { max-width: 760px; margin: 0 auto; padding: 4px 16px calc(100px + env(safe-area-inset-bottom)); outline: none; }
.view > * { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.view > :nth-child(2) { animation-delay: .06s; }
.view > :nth-child(3) { animation-delay: .12s; }
.view > :nth-child(4) { animation-delay: .18s; }
.view > :nth-child(n+5) { animation-delay: .22s; }

.tabs {
  position: fixed; z-index: 6; inset: auto 10px calc(10px + env(safe-area-inset-bottom)) 10px;
  display: grid; grid-template-columns: repeat(5, 1fr); max-width: 560px; margin: 0 auto;
  background: #0c1d18ee; backdrop-filter: blur(14px); border: 1px solid var(--line);
  border-radius: 24px; padding: 6px; box-shadow: 0 14px 40px #000a;
}
.tabs a { display: grid; justify-items: center; gap: 2px; padding: 7px 0; color: var(--muted); text-decoration: none; font-size: .72rem; border-radius: 18px; transition: color .2s, background .2s; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--bg); background: var(--go); font-weight: 600; }

/* ---------- radar ---------- */
.radar-wrap { position: relative; width: min(100%, 390px); margin: 0 auto; aspect-ratio: 1; }
.radar-wrap svg { width: 100%; height: 100%; overflow: visible; }
.ring { fill: none; stroke: var(--line); stroke-width: 1; }
.axis { stroke: var(--line); stroke-dasharray: 2 5; }
.sweep { position: absolute; inset: 7%; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 290deg, #5cf2a80a 300deg, #5cf2a84d 359deg, transparent 360deg);
  animation: spin 5s linear infinite; }
.sweep.idle { animation-duration: 16s; opacity: .45; }
.blip { cursor: pointer; }
.blip circle { fill: #3d6b58; transition: r .2s; }
.blip text { fill: var(--muted); font: 600 9.5px var(--mono); text-anchor: middle; }
.blip:hover text, .blip:focus text { fill: var(--ink); }
.blip.hit circle { animation: breathe 1.6s infinite; }
.blip.hit text { fill: var(--ink); font-size: 12px; }
.blip.red circle { fill: var(--go); } .blip.yellow circle { fill: var(--heat); }
.blip.early circle { fill: var(--ice); }
.core { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.core strong { font: 600 3.4rem/1 var(--mono); color: var(--go); text-shadow: 0 0 24px #5cf2a866; }
.core span { font-size: .78rem; color: var(--muted); }
.status { text-align: center; color: var(--muted); margin-top: 6px; }

/* ---------- cards ---------- */
.card { background: linear-gradient(160deg, var(--panel-2), var(--panel) 60%); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; }
.msg { border-inline-start: 4px solid var(--line); cursor: pointer; width: 100%; text-align: start; color: inherit; font: inherit; display: block; }
.msg.red { border-inline-start-color: var(--go); } .msg.yellow { border-inline-start-color: var(--heat); }
.msg.early { border-inline-start-color: var(--ice); } .msg.exit { border-inline-start-color: var(--stop); }
.msg header { display: flex; justify-content: space-between; gap: 12px; }
.msg h3 { font-size: 1.05rem; }
.msg time { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; color: #cfe3d9; }
.msg:not(.open) .body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.empty { text-align: center; padding: 28px 18px; color: var(--muted); border-style: dashed; }

/* ---------- forms ---------- */
.btn { font: 600 1rem var(--body); border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 12px 18px; cursor: pointer; transition: transform .12s, filter .2s; }
.btn:hover { filter: brightness(1.15); } .btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn.primary { background: var(--go); border-color: var(--go); color: #042015; }
.btn.small { padding: 7px 12px; font-size: .85rem; }
.btn.wide { width: 100%; }
input { width: 100%; font: 500 1.05rem var(--body); color: var(--ink); background: #04100c; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
input:focus-visible, .btn:focus-visible, a:focus-visible, .msg:focus-visible, .blip:focus-visible { outline: 2px solid var(--go); outline-offset: 2px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 5px; }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { font-family: var(--mono); text-transform: uppercase; direction: ltr; text-align: right; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.seg button { border: 0; background: none; color: var(--muted); font: 600 .95rem var(--body); padding: 9px; border-radius: 10px; cursor: pointer; }
.seg button.on { background: var(--panel-2); color: var(--go); box-shadow: inset 0 0 0 1px var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.chips button { font: 600 .8rem var(--mono); color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 6px 11px; cursor: pointer; }
.chips button:hover { color: var(--go); border-color: var(--go); }

/* ---------- result ---------- */
.result { padding: 0; overflow: hidden; }
.verdict { padding: 18px; display: grid; gap: 4px; border-bottom: 1px solid var(--line); }
.verdict.candidate, .verdict.triggered { background: linear-gradient(120deg, #0f5a3a, transparent 80%); }
.verdict.wait, .verdict.waiting, .verdict.not_open { background: linear-gradient(120deg, #5a4210, transparent 80%); }
.verdict.no, .verdict.expired, .verdict.closed { background: linear-gradient(120deg, #5a211c, transparent 80%); }
.verdict .line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.verdict h3 { font-size: 1.6rem; }
.ticker { font: 600 1.1rem var(--mono); }
.price { font-size: .95rem; color: var(--muted); }
.up { color: var(--go); } .down { color: var(--stop); }
.section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.section:last-child { border-bottom: 0; }
.section h4 { font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.section ul { list-style: none; display: grid; gap: 6px; }
.section li { padding-inline-start: 16px; position: relative; }
.section li::before { content: ""; position: absolute; inset-inline-start: 0; top: .65em; width: 6px; height: 6px; border-radius: 50%; background: var(--go); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: .82rem; border: 1px solid var(--line); border-radius: 9px; padding: 3px 9px; }
.ladder { display: grid; gap: 6px; }
.rung { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 10px 14px; border-radius: 12px; border: 1px solid; }
.rung small { display: block; color: var(--muted); font-size: .75rem; }
.rung .num { font-size: 1.15rem; font-weight: 600; }
.rung.target { border-color: #217a52; background: #0f5a3a40; } .rung.target .num { color: var(--go); }
.rung.entry { border-color: var(--line); background: #ffffff08; }
.rung.stop { border-color: #7a3028; background: #5a211c40; } .rung.stop .num { color: var(--stop); }
.meter { display: flex; height: 18px; border-radius: 99px; overflow: hidden; background: #04100c; border: 1px solid var(--line); }
.meter i { display: block; width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.meter .t { background: var(--go); } .meter .s { background: var(--stop); } .meter .n { background: #2b4a3d; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: .85rem; }
.legend b { font-family: var(--mono); }
.warn { color: var(--heat); font-size: .9rem; }
.foot { text-align: center; font-size: .78rem; color: var(--muted); margin: 14px 0; }

.loader { display: grid; justify-items: center; gap: 14px; padding: 34px; color: var(--muted); }
.loader i { width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--line);
  background: conic-gradient(transparent 0 270deg, var(--go)); animation: spin 1.1s linear infinite;
  -webkit-mask: radial-gradient(circle, #0006 55%, #000 56%); mask: radial-gradient(circle, #0006 55%, #000 56%); }

/* ---------- history, settings ---------- */
.row { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.red { background: var(--go); } .dot.yellow { background: var(--heat); } .dot.early { background: var(--ice); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font: 600 1.4rem var(--mono); }
.stat span { font-size: .75rem; color: var(--muted); }
.fields { display: grid; gap: 12px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.position { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; }
input[type=range] { padding: 0; background: none; border: 0; accent-color: var(--go); }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.switch input { width: 52px; height: 30px; appearance: none; border-radius: 99px; padding: 0; position: relative; cursor: pointer; flex: none; }
.switch input::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); top: 3px; right: 3px; transition: .2s; }
.switch input:checked { background: #0f5a3a; }
.switch input:checked::after { right: 25px; background: var(--go); }

/* ---------- login, toast ---------- */
.login { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; }
.login h1 { font-size: 2.4rem; }
.login p { color: var(--muted); }
.login form { width: min(100%, 340px); display: grid; gap: 10px; text-align: start; margin-top: 18px; }
.login-dial { width: 130px; height: 130px; border-radius: 50%; border: 1px solid var(--line); position: relative; margin-bottom: 12px;
  background: repeating-radial-gradient(circle, transparent 0 20px, var(--line) 20px 21px); }
.login-dial i { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(transparent 0 280deg, #5cf2a877); animation: spin 4s linear infinite; }
#toast { position: fixed; z-index: 9; inset: auto 16px 100px; margin: 0 auto; max-width: 420px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; text-align: center; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }
#toast.show { opacity: 1; transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: .45; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (min-width: 900px) {
  .tabs { inset: 90px 18px auto auto; grid-template-columns: 1fr; width: 92px; }
  .tabs a { padding: 12px 0; }
  .top { padding-inline: 28px; }
  #toast { bottom: 30px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
