:root {
  --bg: #f5f2ea; --surface: #fffdf8; --surface2: #ebe6da; --fg: #1d1f24; --muted: #686a6f; --line: #dcd5c6;
  --accent: #c2412d; --accent-fg: #ffffff; --accent-soft: #f6e1da;
  --ink: #23406b; --ink-soft: #dfe6f1;
  --ok: #2a7a4c; --ok-bg: #e0f0e5; --warn: #8a6510; --warn-bg: #f5ebcd; --bad: #b3402f; --bad-bg: #f6dfd9;
  --shadow: 0 1px 2px rgba(40, 32, 15, .07);
  --f-body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-head: 'Unbounded', 'Onest', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a; --surface: #1e2125; --surface2: #2a2e33; --fg: #ebe7de; --muted: #9a9ca0; --line: #363a40;
    --accent: #ec7a62; --accent-fg: #1b0f0b; --accent-soft: #43231c;
    --ink: #9db7e0; --ink-soft: #24324a;
    --ok: #74c793; --ok-bg: #1c3426; --warn: #e3bf62; --warn-bg: #3a3017; --bad: #ef8d79; --bad-bg: #3f2420;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--f-body); }
a { color: var(--ink); }
h1, h2 { font-family: var(--f-head); letter-spacing: -.01em; text-wrap: balance; margin: 0; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 500; }
h3 { font-size: 15px; margin: 0; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.logo { font-family: var(--f-head); font-weight: 700; font-size: 17px; color: var(--fg); text-decoration: none; display: flex; align-items: center; gap: 9px; }
.logo-mark { width: 22px; height: 18px; border-radius: 3px; background: var(--accent); position: relative; }
.logo-mark::before { content: ''; position: absolute; left: 5px; top: -5px; width: 12px; height: 10px; background: var(--surface); border: 2px solid var(--fg); border-radius: 2px; }
.logo-mark::after { content: ''; position: absolute; left: 3px; top: 6px; width: 16px; height: 3px; border-radius: 2px; background: var(--fg); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }

.wrap { max-width: 820px; margin: 0 auto; padding-inline: 16px; padding-block: 22px 80px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.card.hl { border: 2px solid var(--accent); }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }

.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; font-weight: 500; padding: 8px 14px; border-radius: 9px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--surface2); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.pri:hover { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn.discord { justify-content: center; min-height: 44px; border-radius: 999px; background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.discord:hover { background: #4752c4; }
.btn[disabled] { opacity: .45; cursor: default; }
.sq { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 18px; }

input, select, textarea { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; min-height: 64px; }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.chk { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-block: 16px 16px; overflow-x: auto; }
.tab { appearance: none; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 500; padding: 8px 12px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected=true] { color: var(--fg); border-bottom-color: var(--accent); }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; background: var(--surface2); color: var(--muted); }
.b-nominate { background: var(--ink-soft); color: var(--ink); }
.b-vote { background: var(--accent-soft); color: var(--accent); }
.b-sale { background: var(--ok-bg); color: var(--ok); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.price { display: inline-flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }

.av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: #fff; object-fit: cover; }
.avs { display: flex; }
.avs .av { margin-left: -6px; border: 2px solid var(--surface); }
.avs .av:first-child { margin-left: 0; }
.person { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.person .av { width: 22px; height: 22px; font-size: 11px; }

.prop { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; }
.prop .t { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; }
.prop.won { opacity: .7; }
.vals { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.vals b { color: var(--fg); font-weight: 500; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.game { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center; }
.game img, .game .noimg { width: 96px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--surface2); }
.game a { color: inherit; }
.gs { position: relative; }
.gs-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 4px; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.gs-list button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 6px 10px; border: 0; background: transparent;
  color: inherit; font: inherit; text-align: left; cursor: pointer; }
.gs-list button:hover, .gs-list button:focus-visible { background: var(--surface2); }
.gs-list img, .gs-list .noimg { width: 48px; height: 32px; object-fit: cover; border-radius: 4px; flex: none; background: var(--surface2); }
.gs-src { padding: 6px 10px; border-top: 1px solid var(--line); }
.chip { appearance: none; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 99px; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--fg); border-color: var(--fg); color: var(--bg); }

.pick { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pick.sel { border-color: var(--accent); background: var(--accent-soft); }
.idea-more summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; }
.idea-more summary::-webkit-details-marker { display: none; }
.idea-more summary::after { content: '▾'; color: var(--muted); font-size: 12px; transition: transform .15s; }
.idea-more[open] summary::after { transform: rotate(180deg); }
.stepper { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.stepper b { min-width: 1.6em; text-align: center; font-size: 17px; }
.pts { font-family: var(--f-head); font-size: 22px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }

.timeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.timeline > div { padding: 10px 12px; font-size: 13px; border-right: 1px solid var(--line); }
.timeline > div:last-child { border-right: 0; }
.timeline .on { background: var(--accent-soft); }
.timeline .past { color: var(--muted); }
@media (max-width: 560px) { .timeline { grid-template-columns: 1fr; } .timeline > div { border-right: 0; border-bottom: 1px solid var(--line); } .timeline > div:last-child { border-bottom: 0; } }

.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.meter { grid-column: 1 / -1; height: 7px; border-radius: 4px; background: var(--surface2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); }
.meter.win i { background: var(--accent); }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.n { text-align: right; }

.field-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.field-row .opts { grid-column: 1 / -1; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.clubs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.club-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 8px; }
.club-card:hover { border-color: var(--fg); }
.hero { display: flex; flex-direction: column; gap: 14px; padding-block: 26px; }
.hero h1 { font-size: clamp(26px, 6vw, 38px); max-width: 16ch; }
.hero p { max-width: 52ch; color: var(--muted); font-size: 16px; }
.empty { text-align: center; padding: 30px 16px; }
.code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; background: var(--surface2); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: min(92vw, 440px); z-index: 50; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.toast.err { background: var(--bad); color: #fff; }

/* календарь Air Datepicker в цветах сайта */
input.dt { cursor: pointer; }
.air-datepicker {
  --adp-font-family: var(--f-body); --adp-font-size: 14px;
  --adp-background-color: var(--surface); --adp-border-color: var(--line); --adp-border-color-inner: var(--line);
  --adp-border-radius: 12px; --adp-color: var(--fg); --adp-color-secondary: var(--muted);
  --adp-accent-color: var(--accent); --adp-color-current-date: var(--accent);
  --adp-background-color-hover: var(--surface2); --adp-background-color-active: var(--surface2);
  --adp-cell-background-color-selected: var(--accent); --adp-cell-background-color-selected-hover: var(--accent);
  --adp-day-name-color: var(--accent); --adp-color-other-month: var(--muted); --adp-color-disabled: var(--line);
  --adp-nav-arrow-color: var(--muted); --adp-nav-color-secondary: var(--muted);
  --adp-btn-color: var(--accent); --adp-btn-color-hover: var(--accent); --adp-btn-background-color-hover: var(--accent-soft);
  --adp-time-track-color: var(--line); --adp-time-track-color-hover: var(--muted); --adp-time-day-period-color: var(--muted);
  --adp-overlay-background-color: rgba(0, 0, 0, .35);
  box-shadow: 0 8px 24px rgba(40, 32, 15, .15);
}
.air-datepicker-cell.-selected-, .air-datepicker-cell.-selected-.-current- { color: var(--accent-fg); }

/* встречи, дубли идей */
[hidden] { display: none !important; }
.b-done { background: var(--ok-bg); color: var(--ok); }
.notice { background: var(--warn-bg); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.card.cancelled { opacity: .75; border-style: dashed; }

/* окно идеи */
body.modal-open { overflow: hidden; }
.modal-back { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .45); display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 24px; overflow-y: auto; }
.modal-back .modal { width: 100%; max-width: 640px; flex: none; }
.modal-back .notice { width: 100%; max-width: 640px; flex: none; }
