:root {
  --bg: #070b18;
  --bg-2: #0b1226;
  --panel: rgba(18, 26, 50, 0.86);
  --panel-solid: #121a32;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --ink: #eef2ff;
  --muted: #8f9cc4;
  --muted-2: #66739a;
  --gold: #f5c451;
  --gold-2: #ffe7ad;
  --gold-dim: rgba(245, 196, 81, 0.14);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --radius: 20px;
  --radius-sm: 14px;
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-synthesis: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100%;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); }
::-webkit-scrollbar-track { background: transparent; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(90% 50% at 15% -10%, rgba(245, 196, 81, 0.16), transparent 60%),
    radial-gradient(70% 40% at 100% 0%, rgba(34, 211, 238, 0.12), transparent 55%),
    radial-gradient(80% 45% at 50% 110%, rgba(99, 102, 241, 0.14), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#app { position: relative; z-index: 1; }

.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; }
.boot-logo { font-size: 44px; color: var(--gold); animation: pulse 1.6s infinite; }
.boot-text { letter-spacing: 0.18em; text-transform: uppercase; font-size: 12px; color: var(--muted); }
@keyframes pulse { 0%,100% { opacity: .45; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }

/* ── layout ─────────────────────────────────────────────── */
.wrap { max-width: 620px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + var(--safe-b) + 24px); }
.wrap.no-nav { padding-bottom: 32px; }
.wrap.admin-wrap { max-width: 860px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-tabs button { white-space: nowrap; }
.admin-tabs button[aria-pressed="true"] { font-weight: 700; }
.admin-tabs #admin-pending-count { padding-inline-start: 4px; font-variant-numeric: tabular-nums; }
.admin-new summary, #hunt-editor summary { cursor: pointer; font-weight: 700; }
.team-rename { border-color: var(--line-2); }
.team-rename-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.team-rename-form .input { min-width: 0; }
.raccoon-frame { display: block; width: calc(100% + 32px); margin-inline: -16px; min-height: 180px; border: 0; }
.room-list { max-height: 55vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.msg { background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; max-width: 88%; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: rgba(246,196,83,.14); border-color: rgba(246,196,83,.35); }
.msg-name { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.msg-text { font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.room-form { display: flex; gap: 8px; align-items: center; }
.room-form .input { flex: 1; min-width: 0; }
#raccoon-results-title { scroll-margin-top: calc(var(--safe-t, 0px) + 66px); }
.raccoon-leaders { width: 100%; border-collapse: collapse; font-size: .875rem; margin-top: 8px; }
.raccoon-leaders th, .raccoon-leaders td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.raccoon-leaders th:nth-child(2) { width: 100%; text-align: left; overflow-wrap: anywhere; }
.raccoon-leaders th:first-child, .raccoon-leaders td:first-child { text-align: center; }
.raccoon-leaders thead { color: var(--muted); }
.raccoon-mine { color: var(--gold); background: rgba(246,196,83,.09); }
.raccoon-totals summary { cursor: pointer; padding-block: 8px; }
.arrival-row { padding: 8px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; border-bottom: 1px solid var(--line); }
.arrival-row:last-child { border-bottom: 0; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 10px;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(7, 11, 24, 0.94), rgba(7, 11, 24, 0.55));
}
.topbar .brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.topbar .brand b { font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand .mark { color: var(--gold); font-size: 18px; }
.topbar .spacer { flex: 1; }

.who {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 10px 5px 6px; font-size: 12px; color: var(--muted);
  max-width: 46vw;
}
.who .st { font-size: 16px; }
.who span.nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }

h1 { font-size: 26px; line-height: 1.15; letter-spacing: -0.03em; margin: 6px 0 4px; }
h2 { font-size: 18px; letter-spacing: -0.02em; margin: 26px 0 12px; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrapflex { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.hide { display: none !important; }

/* ── cards ──────────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, 0.9);
}
.card + .card { margin-top: 12px; }
.card.tight { padding: 12px 14px; }
.card.flat { background: rgba(255, 255, 255, 0.03); box-shadow: none; }

.hero {
  position: relative; overflow: hidden;
  padding: 22px 18px 18px;
  border-radius: 26px;
  border: 1px solid rgba(245, 196, 81, 0.24);
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(245, 196, 81, 0.22), transparent 60%),
    linear-gradient(160deg, #17203c, #0d1428 65%);
}
.hero .kicker { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.hero-icon { width: 62px; height: 62px; border-radius: 16px; flex: none; box-shadow: 0 12px 26px -14px rgba(245, 196, 81, 0.55); }
.hero h1 { font-size: 30px; margin: 8px 0 2px; }
.hero .sub { color: var(--muted); font-size: 13px; }
.hero .meta { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.hero .meta div b { display: block; font-size: 18px; }
.hero .meta div span { font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.08em; }

.team-card { display: flex; align-items: center; gap: 14px; }
.team-sticker {
  width: 62px; height: 62px; flex: none; border-radius: 18px;
  display: grid; place-items: center; font-size: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-2);
}
.team-name { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
.coins { color: var(--gold); font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted); background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}
.pill.gold { color: #1a1405; background: var(--gold); border-color: transparent; font-weight: 650; }
.pill.soft-gold { color: var(--gold-2); background: var(--gold-dim); border-color: rgba(245, 196, 81, 0.3); }
.pill.ok { color: #052e21; background: var(--ok); border-color: transparent; font-weight: 650; }
.pill.warn { color: #3a2600; background: var(--warn); border-color: transparent; font-weight: 650; }
.pill.dim { opacity: 0.55; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.stat b { display: block; font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.07em; }

/* ── buttons ────────────────────────────────────────────── */
button, .btn {
  font: inherit; cursor: pointer; border-radius: 14px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.06); color: var(--ink);
  padding: 11px 16px; text-align: center; transition: transform .08s, background .15s, opacity .15s;
  -webkit-user-select: none; user-select: none;
}
button:active { transform: scale(0.985); }
button.primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: #221902; border-color: transparent; font-weight: 700;
  box-shadow: 0 10px 24px -12px rgba(245, 196, 81, 0.7);
}
button.ghost { background: transparent; }
button.sm { padding: 7px 11px; font-size: 12px; border-radius: 11px; }
button.xs, .btn.xs { padding: 5px 9px; font-size: 11.5px; border-radius: 9px; text-decoration: none; }
button.block { width: 100%; }
button:disabled { opacity: 0.45; cursor: default; }
button.danger { color: var(--bad); border-color: rgba(251, 113, 133, 0.35); }

.input, select.input, textarea.input {
  width: 100%; font: inherit; color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 12px;
  outline: none;
}
.input:focus { border-color: rgba(245, 196, 81, 0.55); }
select.input { appearance: none; background-image: none; }
select.input option { color: #0b1226; background: #ffffff; }
input[type="file"].input { padding: 8px 10px; color: var(--muted); font-size: 13px; }
input[type="file"].input::file-selector-button {
  font: inherit; font-size: 13px; margin-right: 10px; cursor: pointer;
  background: rgba(245, 196, 81, 0.16); color: var(--gold-2);
  border: 1px solid rgba(245, 196, 81, 0.35); border-radius: 10px; padding: 7px 12px;
}
textarea.input { min-height: 74px; resize: vertical; }
label.field { display: block; margin-bottom: 10px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }

/* ── quest cards ────────────────────────────────────────── */
.quest {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 14px; margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quest:active { background: rgba(255, 255, 255, 0.07); }
.quest .time { font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.quest .title { font-weight: 620; letter-spacing: -0.01em; margin: 2px 0 3px; }
.quest .hint { font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quest .side { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.quest .rew { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.quest.done { border-color: rgba(52, 211, 153, 0.35); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--muted);
  cursor: pointer;
}
.chip.on { background: var(--ink); color: #0b1020; border-color: transparent; font-weight: 650; }

/* ── feed ───────────────────────────────────────────────── */
.feed-item { overflow: hidden; padding: 0; }
.feed-item .ph { height: 168px; background: linear-gradient(135deg, #1b2444, #0e1428); display: grid; place-items: center; font-size: 34px; }
.feed-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feed-item .body { padding: 12px 14px 14px; }
.feed-item .note { font-size: 13px; color: var(--muted); margin-top: 4px; }
/* компактная строка ленты: миниатюра слева, текст справа */
.feed-row { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.feed-row .body { padding: 0; flex: 1 1 auto; min-width: 0; }
.ph-thumb { width: 92px; height: 92px; flex: 0 0 92px; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #1b2444, #0e1428); display: grid; place-items: center; font-size: 30px; cursor: zoom-in; }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-thumb:active { transform: scale(.97); }
/* просмотр фото на весь экран */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(3, 6, 16, .94); display: grid; place-items: center; padding: 12px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }
.lightbox .hint { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; color: #94a3b8; font-size: 12px; }

/* ── галерея: сетка карточек ─────────────────────────────── */
.gal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
@media (min-width: 720px) { .gal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
.gal-card { position: relative; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, rgba(20, 27, 52, .95), rgba(11, 16, 34, .95));
  border: 1px solid var(--line); box-shadow: 0 10px 24px rgba(0, 0, 0, .28); }
.gal-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 16px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }
.gal-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.gal-media { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #0b1022; }
.gal-body { padding: 9px 11px 11px; }
.gal-team { font-size: 12px; font-weight: 650; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-quest { font-size: 13px; margin-top: 2px; }
.gal-note { font-size: 12px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gal-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--muted-2); }
.gal-foot .coins { font-size: 12px; }

/* ── программа поездки ──────────────────────────────── */
.trip-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.trip-fact { border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px;
  background: linear-gradient(160deg, rgba(27, 37, 71, .9), rgba(12, 18, 38, .9)); }
.trip-fact b { display: block; color: var(--gold); font-size: 15px; }
.trip-fact span { font-size: 11.5px; color: var(--muted); }

.day-card { margin-top: 14px; border-radius: 20px; border: 1px solid var(--line); padding: 14px;
  background: linear-gradient(180deg, rgba(18, 25, 48, .92), rgba(10, 15, 32, .92));
  box-shadow: 0 18px 40px -28px #000; }
.day-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.day-num { width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-items: center; align-content: center;
  background: radial-gradient(120% 120% at 30% 10%, rgba(245, 196, 81, .26), rgba(245, 196, 81, .05));
  border: 1px solid rgba(245, 196, 81, .35); }
.day-num b { font-size: 22px; line-height: 1; color: var(--gold); }
.day-num span { font-size: 9px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); }
.day-title { font-size: 15.5px; font-weight: 700; }
.day-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.flights { margin-top: 10px; border-radius: 14px; border: 1px solid rgba(56, 189, 248, .28);
  background: rgba(56, 189, 248, .07); padding: 8px 11px; }
.flights-title { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #7dd3fc; margin-bottom: 2px; }
.flight { display: grid; grid-template-columns: 98px 1fr; gap: 1px 8px; padding: 6px 0; border-top: 1px dashed rgba(56, 189, 248, .2); }
.flight:nth-child(2) { border-top: 0; }
.fl-time { font-variant-numeric: tabular-nums; font-size: 12px; color: #bae6fd; font-weight: 650; }
.fl-route { font-size: 13px; }
.fl-note { grid-column: 2; font-size: 11px; color: var(--muted-2); }

.tl { position: relative; margin-top: 10px; }
.tl::before { content: ''; position: absolute; left: 95px; top: 12px; bottom: 12px; width: 1px; background: rgba(255, 255, 255, .08); }
.tl-row { display: grid; grid-template-columns: 72px 30px 1fr; gap: 0 8px; align-items: start; padding: 8px 0; }
.tl-row + .tl-row { border-top: 1px solid rgba(255, 255, 255, .04); }
.tl-time { font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; padding-top: 4px; min-width: 0; overflow-wrap: anywhere; line-height: 1.25; }
.tl-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; position: relative; z-index: 1;
  background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 42%, transparent); }
.tl-body { min-width: 0; padding-top: 2px; }
.tl-title { font-size: 13.5px; font-weight: 600; }
.tl-detail { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.tl-place { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.tl-row.now { background: linear-gradient(90deg, rgba(245, 196, 81, .13), transparent 72%); border-radius: 12px; }
.tl-row.now .tl-mark { box-shadow: 0 0 0 3px rgba(245, 196, 81, .16); }

.trip-line { display: flex; gap: 10px; padding: 9px 0; }
.trip-line + .trip-line { border-top: 1px solid var(--line); }
.trip-ic { width: 28px; height: 28px; flex: none; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); }
.dress-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dress-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: rgba(255, 255, 255, .03); }
.dress-card b { display: block; font-size: 12.5px; }
.dress-card span { font-size: 11.5px; color: var(--muted); }
/* дни поездки — ровный ряд из шести чипов */
.sched-chips { gap: 6px; }
.sched-chips .chip { flex: 1 1 0; min-width: 0; text-align: center; padding: 7px 4px; }

/* ── leaderboard ────────────────────────────────────────── */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-place { width: 26px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted-2); font-size: 13px; }
.lb-row.top1 .lb-place { color: var(--gold); font-weight: 700; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; border-radius: 3px; }

/* ── nav ────────────────────────────────────────────────── */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: center;
  padding-bottom: var(--safe-b);
  background: linear-gradient(180deg, rgba(7, 11, 24, 0.4), rgba(7, 11, 24, 0.98) 45%);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
}
.nav-in { display: flex; width: 100%; max-width: 620px; }
.nav a {
  flex: 1; padding: 9px 2px 10px; text-align: center; text-decoration: none;
  color: var(--muted-2); font-size: 10.5px; display: grid; gap: 3px; justify-items: center;
}
.nav a .ic { font-size: 19px; line-height: 1; filter: grayscale(1); opacity: .75; }
.nav a.on { color: var(--gold); }
.nav a.on .ic { filter: none; opacity: 1; }

/* ── sheet / modal ──────────────────────────────────────── */
.sheet-bg {
  position: fixed; inset: 0; z-index: 50; background: rgba(3, 6, 16, 0.66);
  backdrop-filter: blur(3px); display: flex; align-items: flex-end; justify-content: center;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet {
  width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto;
  background: var(--panel-solid); border: 1px solid var(--line-2);
  border-radius: 24px 24px 0 0; padding: 8px 18px calc(22px + var(--safe-b));
  animation: up .22s cubic-bezier(.2, .9, .3, 1);
}
@keyframes up { from { transform: translateY(30px) } to { transform: translateY(0) } }
.sheet .grab { width: 42px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 6px auto 14px; }
.sheet h2 { margin-top: 0; }
.sheet .close { position: absolute; }

/* ── misc ───────────────────────────────────────────────── */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.notice {
  border-radius: 14px; padding: 11px 13px; font-size: 13px;
  border: 1px solid rgba(245, 196, 81, 0.28); background: rgba(245, 196, 81, 0.09); color: var(--gold-2);
}
.notice.err { border-color: rgba(251, 113, 133, 0.4); background: rgba(251, 113, 133, 0.1); color: #ffd0d8; }
.notice.ok { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.1); color: #c7ffe9; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + var(--safe-b));
  transform: translateX(-50%); z-index: 90;
  background: #1b2547; border: 1px solid var(--line-2); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-size: 13.5px; box-shadow: 0 20px 40px -18px #000;
  animation: fade .15s ease;
  max-width: 88vw;
}
/* ── уведомления ────────────────────────────────────────── */
.who.bell { position: relative; padding: 5px 9px; }
.who.bell .badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--bad); color: #2a0710; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.notif {
  display: flex; gap: 12px; align-items: flex-start; padding: 11px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.notif:last-child { border-bottom: 0; }
.notif-ic {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  border-radius: 10px; background: var(--gold-dim); color: var(--gold); font-size: 15px;
}

/* ── выбор картинки команды ────────────────────────────── */
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.avatar {
  aspect-ratio: 1; padding: 0; border-radius: 14px; font-size: 24px; line-height: 1;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.avatar.on {
  background: color-mix(in srgb, var(--c, var(--gold)) 22%, transparent);
  border-color: var(--c, var(--gold)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, var(--gold)) 45%, transparent);
}
.step-ic { font-size: 40px; margin: 0 auto; }

/* ── запуск заданий в админке ──────────────────────────── */
.q-admin {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--panel); margin-bottom: 8px; padding: 10px 13px;
}
.q-admin > summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
}
.q-admin > summary::-webkit-details-marker { display: none; }
.q-admin > summary .grow { display: flex; flex-direction: column; gap: 2px; }
.q-admin[open] { border-color: var(--line-2); }
.q-admin > summary::after { content: '⌄'; color: var(--muted-2); font-size: 15px; line-height: 1; margin-left: 2px; }
.q-admin[open] > summary::after { content: '⌃'; }
/* чеклист: свёрнутые «поправить» рядом с кнопкой «✓ Выполнено» */
.cl-more { display: inline-block; }
.cl-more > summary { cursor: pointer; list-style: none; font-size: 12px; color: var(--muted); padding: 4px 2px; }
.cl-more > summary::-webkit-details-marker { display: none; }
.cl-more > summary::before { content: '⌄ '; }
.cl-more[open] > summary::before { content: '⌃ '; }
.cl-more[open] { display: block; width: 100%; }
.chip.on[data-act="launch"] { background: var(--ok); color: #052e21; border-color: transparent; }
.lb-row.me { background: rgba(245, 196, 81, 0.08); border-radius: 10px; }
/* ── QR ─────────────────────────────────────────────────── */
.qr-badge {
  width: 64px; height: 64px; margin: 0 auto; border-radius: 18px;
  display: grid; place-items: center; font-size: 30px; color: var(--gold);
  background: var(--gold-dim); border: 1px solid rgba(245, 196, 81, 0.35);
}
.qr { width: 200px; height: 200px; background: #fff; border-radius: 16px; padding: 8px; display: inline-block; }
.qr-sm { width: 104px; height: 104px; padding: 6px; border-radius: 12px; }
.qr-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink);
}
.qr-row:last-child { border-bottom: 0; }
.qr-row img { width: 46px; height: 46px; background: #fff; border-radius: 8px; padding: 3px; flex: none; }

/* сканер */
.scan {
  position: fixed; inset: 0; z-index: 120; background: #04060d;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 20px;
}
.scan-video { position: relative; width: min(84vw, 380px); aspect-ratio: 1; border-radius: 24px; overflow: hidden; background: #000; }
.scan-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 14%; border: 3px solid var(--gold); border-radius: 18px; box-shadow: 0 0 0 999px rgba(4, 6, 13, 0.45); }
.scan-hint { font-size: 13px; color: var(--muted); text-align: center; }

/* бейджи */
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge {
  border: 1px dashed var(--line-2); border-radius: 14px; padding: 10px; text-align: center;
  background: rgba(255, 255, 255, 0.03); break-inside: avoid;
}
.badge img { width: 100%; max-width: 150px; height: auto; background: #fff; border-radius: 8px; padding: 4px; display: block; margin: 6px auto; }
.badge-team { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.badge-name { font-size: 13px; font-weight: 600; }
.badge-foot { font-size: 9px; color: var(--muted-2); margin-top: 2px; }

@media print {
  body::before, .nav, .topbar, .no-print { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .wrap { max-width: none; padding: 0; }
  .badge { border: 1px solid #bbb; background: #fff; color: #111; }
  .badge-team, .badge-foot { color: #555; }
  .badge-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  @page { size: A4; margin: 10mm; }
}

.badge-day { font-size: 11px; color: var(--muted-2); }

table.simple { width: 100%; border-collapse: collapse; font-size: 13px; }
table.simple th { text-align: left; color: var(--muted-2); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 4px; }
table.simple td { padding: 8px 4px; border-top: 1px solid var(--line); vertical-align: middle; }

.search { position: relative; }
.search .input { padding-left: 36px; }
.search::before { content: "🔎"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .7; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
@media (min-width: 520px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.prep-card > img { object-fit: cover; border-radius: 24px; }
.prep-card form { margin-top: 1.25rem; }
.roster-list { max-height: 360px; overflow: auto; margin-top: 0.75rem; }
.roster-entry { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.roster-entry[hidden] { display: none; }
.hunt-preview { display: block; max-width: 100%; max-height: 260px; border-radius: 14px; margin-bottom: 1rem; }
.aw-player { gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.aw-step { gap: 6px; flex: none; }
.aw-step button { min-width: 44px; min-height: 44px; padding: 4px; font-size: 1.2rem; }
.aw-step output { min-width: 3ch; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
