@import url(/css/fonts.css);

:root {
  --bg: #0d1316;
  --bg-2: #10181c;
  --panel: #142024;
  --panel-2: #1a272c;
  --line: #22323a;
  --line-2: #30454c;
  --text: #e6ebe4;
  --muted: #93a4a2;
  --dim: #63726f;
  --gold: #dfb75e;
  --frost: #9fd6e4;
  --blood: #e2543c;
  --moss: #8cc59a;
  --r: 14px;
  --display: 'Forum', 'Cormorant', Georgia, serif;
  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

/* Цвета игроков и точек: фон + цвет текста на нём */
[data-c=cobalt]{--c:#2f66d0;--cf:#fff} [data-c=graphite]{--c:#4b5159;--cf:#fff} [data-c=pine]{--c:#1f7a4c;--cf:#fff}
[data-c=crimson]{--c:#b8352d;--cf:#fff} [data-c=peach]{--c:#f3b896;--cf:#4a1d07} [data-c=silver]{--c:#d5dbe0;--cf:#161b20}
[data-c=lilac]{--c:#d3baf0;--cf:#3a1c62} [data-c=plum]{--c:#6a3d9e;--cf:#fff} [data-c=amber]{--c:#d89a22;--cf:#261700}
[data-c=teal]{--c:#158a8a;--cf:#fff} [data-c=rose]{--c:#d64a7c;--cf:#fff} [data-c=moss]{--c:#74892b;--cf:#fff}
[data-c=indigo]{--c:#5560b8;--cf:#fff}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 400 15px/1.45 var(--sans); font-feature-settings: 'tnum' 1;
  background-image: radial-gradient(1200px 600px at 20% -10%, #15252b 0%, transparent 60%);
  background-attachment: fixed;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--frost); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───── шапка ───── */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 10px clamp(14px, 3vw, 28px); background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand b { font: 400 24px/1 var(--display); letter-spacing: .32em; margin-right: -.32em; }
.brand span { font-size: 13px; color: var(--muted); letter-spacing: .04em; }
.brand svg { align-self: center; color: var(--gold); }
#top-tools { display: flex; align-items: center; gap: 8px; }
.clock { font: 500 14px/1 var(--mono); color: var(--muted); white-space: nowrap; }
.clock b { color: var(--text); font-weight: 600; }
.iconbtn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-size: 13px; font-weight: 600;
  transition: color .15s, border-color .15s, background-color .15s;
}
.iconbtn:hover { color: var(--text); border-color: var(--dim); }
.iconbtn[aria-pressed=true] { color: #1d1606; background: var(--gold); border-color: var(--gold); }
.iconbtn svg { flex: none; }

/* ───── каркас ───── */
main { max-width: 1240px; margin: 0 auto; padding: clamp(14px, 3vw, 28px); display: grid; gap: clamp(18px, 3vw, 30px); }
.hero { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: clamp(16px, 3vw, 32px); align-items: center; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .dial-wrap { max-width: 340px; margin: 0 auto; } }
.cards { display: grid; gap: 14px; }

/* ───── циферблат суток ───── */
.dial-wrap { position: relative; width: 100%; aspect-ratio: 1; }
.dial-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.dial-hour { font: 500 11px var(--mono); fill: var(--dim); }
.dial-hour.major { fill: var(--muted); font-size: 12px; }
.dial-tick { stroke: var(--line-2); stroke-width: 1; }
.dial-tick.major { stroke: var(--dim); stroke-width: 1.5; }
.sector { transition: opacity .4s; }
.sector.free { fill: transparent; stroke: var(--line-2); stroke-dasharray: 3 3; }
.spawn-mark { stroke: var(--text); stroke-width: 2; stroke-linecap: round; opacity: .55; }
.spawn-mark.next { stroke: var(--gold); stroke-width: 3; opacity: 1; filter: drop-shadow(0 0 4px var(--gold)); }
.spawn-mark.live { stroke: var(--blood); stroke-width: 3.5; opacity: 1; animation: blink 1.2s ease-in-out infinite; }
.needle line { stroke: var(--gold); stroke-width: 2; stroke-linecap: round; }
.needle circle { fill: var(--gold); }
.dial-center {
  position: absolute; inset: 30%; display: grid; place-content: center; text-align: center; gap: 4px; pointer-events: none;
}
.dial-center .lbl { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.dial-center .cd { font: 600 clamp(26px, 5.4vw, 36px)/1 var(--mono); letter-spacing: -.02em; }
.dial-center .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dial-center.live .lbl, .dial-center.live .cd { color: var(--blood); }
.dial-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.dial-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; background: var(--c); vertical-align: middle; margin-right: 6px; }

@keyframes blink { 50% { opacity: .35; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--blood) 55%, transparent); } 60% { box-shadow: 0 0 0 10px transparent; } }

/* ───── карточка точки ───── */
.spot {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px 14px 22px; overflow: hidden;
}
.spot::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.spot.live { border-color: color-mix(in srgb, var(--blood) 55%, var(--line)); background: linear-gradient(100deg, color-mix(in srgb, var(--blood) 12%, var(--panel)), var(--panel) 60%); }
.spot-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.spot-name { font: 400 22px/1.1 var(--display); letter-spacing: .03em; }
.spot-meta { font-size: 12px; color: var(--dim); }
.spot-body { display: grid; grid-template-columns: auto 1fr; gap: 6px 22px; align-items: end; }
@media (max-width: 520px) { .spot-body { grid-template-columns: 1fr; } }
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.spot.live .eyebrow.state { color: var(--blood); }
.big { font: 600 clamp(34px, 6vw, 46px)/1.02 var(--mono); letter-spacing: -.03em; }
.spot.live .big { color: var(--blood); }
.at { font: 500 13px var(--mono); color: var(--muted); margin-top: 4px; }
.at .srv { color: var(--dim); }
.who { display: grid; gap: 8px; justify-items: start; }
.who-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
td .who-line { flex-wrap: nowrap; }
.days-note { display: none; font-size: 11px; color: var(--dim); margin-top: 2px; }
@media (max-width: 640px) { .member .days-note { display: block; } }
.spot-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.last { font-size: 13px; color: var(--muted); margin-left: auto; }
.last b { color: var(--text); font-weight: 600; }

/* ───── кнопки ───── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 14px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  font-size: 14px; font-weight: 600; line-height: 1.1; transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--dim); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.sm { min-height: 28px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }
.btn.ready { border-color: color-mix(in srgb, var(--frost) 45%, var(--line-2)); color: var(--frost); }
.btn.ready[aria-pressed=true] { background: var(--frost); color: #0c2229; border-color: var(--frost); }
.btn.take { border-color: color-mix(in srgb, var(--moss) 50%, var(--line-2)); color: var(--moss); }
.btn.kill { background: var(--gold); border-color: var(--gold); color: #1d1606; min-height: 40px; padding: 8px 18px; font-size: 15px; }
.btn.kill:hover { background: #ecc86f; }
.spot.live .btn.kill { background: var(--blood); border-color: var(--blood); color: #fff; animation: pulse 1.6s infinite; }
.btn.danger { color: #ff9b8a; border-color: color-mix(in srgb, var(--blood) 40%, var(--line-2)); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--frost); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* ───── чип игрока ───── */
.chip {
  display: inline-flex; align-items: center; max-width: 100%; height: 26px; padding: 0 11px; border-radius: 999px;
  background: var(--c, var(--panel-2)); color: var(--cf, var(--text)); font-size: 13px; font-weight: 700; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip.none { background-color: transparent; color: var(--dim); border: 1px dashed var(--line-2); font-style: normal; font-weight: 500; }
.chip.lg { height: 30px; font-size: 15px; padding: 0 13px; }
select.chip { appearance: none; border: 0; padding-right: 26px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) 11px, calc(100% - 9px) 11px; background-size: 5px 5px; background-repeat: no-repeat; background-color: var(--c, var(--panel-2)); }
select.chip option { background: var(--panel); color: var(--text); font-style: normal; }

.status { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.status.ok { color: var(--frost); }
.status.free { color: var(--moss); }
.status.claim { color: var(--gold); }
.status.wait { color: var(--muted); }

/* ───── таблица расписания ───── */
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.sheet-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 30%, var(--panel)), var(--panel) 70%); }
.sheet-head h2 { margin: 0; font: 400 21px/1.1 var(--display); letter-spacing: .03em; }
.sheet-head p { margin: 0; font-size: 12px; color: var(--muted); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--dim); text-align: left; padding: 9px 10px; white-space: nowrap; }
td { padding: 6px 10px; border-top: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
td.t { font: 500 15px var(--mono); }
td.t small { font: 500 10px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); margin-left: 6px; }
td.srv { font: 500 13px var(--mono); color: var(--dim); }
th.day, td.day { text-align: center; width: 40px; padding-left: 2px; padding-right: 2px; }
th.today { color: var(--gold); }
td.day.today { background: color-mix(in srgb, var(--gold) 7%, transparent); }
tr.next td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
tr.live td:first-child { box-shadow: inset 3px 0 0 var(--blood); }
tr.live td.t { color: var(--blood); }
tr.mine td.t { color: var(--frost); }
.daybox {
  width: 24px; height: 24px; border-radius: 6px; border: 1.5px solid var(--line-2); background: transparent;
  display: inline-grid; place-items: center; padding: 0; color: transparent;
}
.daybox[aria-checked=true] { background: var(--text); border-color: var(--text); color: var(--bg); }
.daybox:disabled { cursor: default; }
.daybox svg { width: 14px; height: 14px; }
@media (max-width: 640px) { .hide-sm { display: none; } .top { gap: 8px; } .brand span, .clock i { display: none; } .iconbtn { padding: 0 10px; } .member th.day, .member td.day { display: none; } td, th { padding-left: 6px; padding-right: 6px; } th.day, td.day { width: 30px; } .daybox { width: 22px; height: 22px; } }

/* ───── журнал ───── */
.log-grid { display: grid; grid-template-columns: 1fr 300px; gap: clamp(16px, 3vw, 28px); align-items: start; }
@media (max-width: 860px) { .log-grid { grid-template-columns: 1fr; } }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.box > h3 { margin: 0; padding: 12px 18px; font: 400 19px/1.1 var(--display); letter-spacing: .03em; border-bottom: 1px solid var(--line); }
.box .empty { padding: 16px 18px; color: var(--muted); font-size: 14px; }
.log td { font-size: 14px; }
.log .set td { color: var(--muted); font-style: italic; }
.dev { font: 500 12px var(--mono); color: var(--dim); }
.stats { list-style: none; margin: 0; padding: 12px 18px 16px; display: grid; gap: 9px; }
.stats li { display: grid; grid-template-columns: 96px 1fr 28px; gap: 10px; align-items: center; font-size: 13px; }
.stats .bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.stats .bar i { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.stats .n { font: 600 13px var(--mono); text-align: right; }

/* ───── экраны входа ───── */
.gate { min-height: calc(100vh - 140px); display: grid; place-items: center; }
.gate-card { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; gap: 14px; }
.gate-card h1 { margin: 0; font: 400 32px/1.05 var(--display); letter-spacing: .02em; }
.gate-card p { margin: 0; color: var(--muted); }
.gate-card .btn.kill { justify-self: start; text-decoration: none; }
.wait-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick .chip { border: 0; cursor: pointer; height: 32px; font-size: 14px; }
.pick .chip.taken { opacity: .45; }

/* ───── формы, диалоги ───── */
dialog {
  width: min(620px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line-2);
  border-radius: 16px; background: var(--bg-2); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
}
dialog::backdrop { background: rgba(4, 8, 10, .66); backdrop-filter: blur(2px); }
.dlg-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-2); z-index: 1; }
.dlg-head h2 { margin: 0 auto 0 0; font: 400 22px/1.1 var(--display); }
.dlg-body { padding: 16px 18px 20px; display: grid; gap: 18px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field small { color: var(--dim); font-size: 12px; }
.input, select.input {
  height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); width: 100%;
}
.input:focus { border-color: var(--gold); outline: none; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .input { flex: 1; min-width: 120px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; flex: none; transition: background-color .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked { background: var(--frost); }
.switch input:checked::after { transform: translateX(16px); background: #0c2229; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; padding: 2px; background: var(--panel); }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed=true] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button[aria-selected=true] { color: var(--text); border-bottom-color: var(--gold); }
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.item .grow { flex: 1; min-width: 140px; }
.item small { display: block; color: var(--dim); font-size: 12px; }
.section-title { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 4px 0 -6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; background: var(--c); padding: 0; }
.swatches button[aria-pressed=true] { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg-2) inset; }
.note { font-size: 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.note.warn { border-color: color-mix(in srgb, var(--gold) 40%, var(--line)); color: var(--text); }

/* ───── уведомления ───── */
#toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(440px, calc(100vw - 24px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); font-size: 14px; animation: rise .22s ease-out; }
.toast.err { border-color: color-mix(in srgb, var(--blood) 60%, var(--line-2)); }
.toast span { flex: 1; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.hint-audio { font-size: 12px; color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
