/* ============================================================
   057 COMMUNITY — публічний сайт
   Візуальна ідея: підпільний картярський стіл під однією лампою.
   Кольори й теми живуть у tokens.css — його треба підключати
   ПЕРЕД цим файлом.
   ============================================================ */

/* ---------- БАЗА ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Onest', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background 0.5s var(--ease), color 0.5s var(--ease);
}

/* Світло лампи над столом + віньєтка. Тримає око в центрі сторінки. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: var(--lamp), var(--vignette);
}

/* Ледь відчутна фактура сукна. На світлій темі її немає: на паперовому тлі
   діагональ читалась як брудні смуги, а не як матеріал. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.22;
    background-image:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 3px);
}

body.theme-light::after {
    display: none;
}

main, header, footer {
    position: relative;
    z-index: 1;
}

/* height: auto тут не косметика, а обов'язковий супутник атрибутів width/height
   у розмітці. Без нього атрибут height="1173" стає реальною висотою картинки:
   фото 300px завширшки розтягується на 1173px — саме так і поламалась галерея,
   коли з'явились розміри для резервування місця. Атрибути лишаються (вони
   рятують від стрибків верстки), а пропорцію рахує браузер. */
img {
    max-width: 100%;
    height: auto;
    display: block;
    -webkit-user-drag: none;
}

/* Вміст сайту не виділяється й не копіюється. Виняток — поля форм і те,
   що позначене .allow-copy: там людина працює зі своїм власним текстом. */
body {
    -webkit-user-select: none;
    user-select: none;
}

input,
textarea,
select,
[contenteditable="true"],
.allow-copy,
.allow-copy * {
    -webkit-user-select: text;
    user-select: text;
}

a {
    color: inherit;
    text-decoration: none;
}

:focus-visible {
    outline: 2px solid var(--accent-hot);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Елементи, яким фокус ставлять програмно (skip-link, діалог), не кнопки —
   рамка на них тільки збиває з пантелику */
main:focus,
.modal:focus,
.settings-sheet__panel:focus {
    outline: none;
}

/* Стрибок через шапку. Лежить за верхнім краєм і виїжджає лише під фокусом:
   миша його ніколи не побачить, клавіатура — першим же Tab. */
.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.82rem;
    transform: translateY(calc(-100% - 20px));
    transition: transform 0.2s var(--ease);
}

.skip-link:focus-visible {
    transform: translateY(0);
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* ---------- ТИПОГРАФІКА ---------- */
h1, h2, h3, .display {
    font-family: 'Unbounded', 'Onest', system-ui, sans-serif;
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -0.02em;
    margin: 0;
    text-wrap: balance;
}

h1, .h1 {
    font-size: clamp(2.4rem, 7vw, 4.6rem);
    text-transform: uppercase;
}

h2, .h2 {
    font-size: clamp(1.6rem, 3.6vw, 2.6rem);
    text-transform: uppercase;
}

h3, .h3 {
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    letter-spacing: -0.01em;
}

p {
    margin: 0;
}

.lead {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    color: var(--ink-dim);
    max-width: 62ch;
}

.mono {
    font-family: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
    font-variant-numeric: tabular-nums;
}

/* Надрядковий ярлик — маркує розділ і дає ритм без зайвих ліній */
.eyebrow {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.64rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--brass);
    display: flex;
    align-items: center;
    gap: 12px;
}

.eyebrow::before {
    content: '';
    width: 26px;
    height: 1px;
    background: var(--brass);
    opacity: 0.7;
    flex: none;
}

.eyebrow.center {
    justify-content: center;
}

.accent {
    color: var(--accent);
}

.dim {
    color: var(--ink-dim);
}

.faint {
    color: var(--ink-faint);
}

/* ---------- РОЗКЛАДКА ---------- */
.wrap {
    width: 100%;
    max-width: var(--max);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.section {
    padding-block: clamp(52px, 8vw, 92px);
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: clamp(24px, 4vw, 40px);
}

.section-head p {
    color: var(--ink-dim);
    max-width: 50ch;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.grid {
    display: grid;
    gap: clamp(14px, 2.2vw, 22px);
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.divider {
    height: 1px;
    background: var(--line);
    border: 0;
    margin: 0;
}

/* ---------- ШАПКА ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 66px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-size: 0.95rem;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand__name small {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.56rem;
    letter-spacing: 0.26em;
    color: var(--ink-faint);
    font-weight: 400;
    text-transform: uppercase;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav a {
    padding: 8px 13px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink-dim);
    border-radius: var(--radius);
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.nav a:hover {
    color: var(--ink);
    background: var(--surface-2);
}

.nav a.is-active {
    color: var(--ink);
}

.nav a.is-active::after {
    content: '';
    display: block;
    height: 2px;
    margin-top: 5px;
    background: var(--accent);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav__prefs {
    display: none;
}

/* Перемикачі мови й теми — однакова «шайба», відрізняються лише вмістом */
.switch {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
}

.switch button,
.switch a {
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}

.switch button:hover,
.switch a:hover {
    color: var(--ink);
}

.switch .is-on {
    background: var(--accent);
    color: #fff;
}

body.theme-light .switch .is-on {
    color: #fff;
}

.switch .is-on-soft {
    background: var(--surface-3);
    color: var(--ink);
}

.burger {
    display: none;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink);
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
}

/* ---------- КНОПКИ ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 13px 22px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-family: 'Unbounded', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease),
    background 0.2s, color 0.2s, border-color 0.2s;
    line-height: 1;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 30px -14px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hot);
    box-shadow: 0 18px 38px -14px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink);
}

.btn-ghost:hover:not(:disabled) {
    border-color: var(--brass);
    color: var(--brass);
}

.btn-solid {
    background: var(--surface-2);
    border-color: var(--line);
    color: var(--ink);
}

.btn-solid:hover:not(:disabled) {
    background: var(--surface-3);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 9px 15px;
    font-size: 0.7rem;
}

.link-arrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brass);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.2s var(--ease);
}

.link-arrow:hover {
    gap: 14px;
}

/* ---------- ПОВЕРХНІ ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    padding: clamp(20px, 3vw, 30px);
}

.panel-quiet {
    background: color-mix(in srgb, var(--surface) 60%, transparent);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--line-strong);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-dim);
    white-space: nowrap;
}

.chip-accent {
    border-color: transparent;
    background: var(--accent-soft);
    color: var(--accent);
}

.chip-good {
    border-color: transparent;
    background: color-mix(in srgb, var(--good) 16%, transparent);
    color: var(--good);
}

.chip-warn {
    border-color: transparent;
    background: color-mix(in srgb, var(--warn) 16%, transparent);
    color: var(--warn);
}

/* ---------- ФІРМОВА ГРАФІКА ---------- */
/* Знак клубу в шапці та підвалі */
.seal {
    flex: none;
    display: block;
    border-radius: 50%;
    border: 1px solid var(--brass);
    background: #0b0a0e;
    object-fit: cover;
}

/* Смуга героя: жодної геометрії у фоні — лише тепле світло лампи, що згасає
   донизу. Раніше тут був векторний силует міста, але на широких екранах він
   розтягувався у мутні прямокутники й давав видимий шов між секціями. */
.hero-band {
    position: relative;
    overflow: hidden;
}

/* Місто стоїть на самому низу смуги, а верхівки будинків розчиняються —
   так силует не ріже рядок зі статистикою над ним */
.hero-band__sky {
    position: absolute;
    inset: auto 0 -1px 0;
    height: clamp(280px, 34vw, 520px);
    pointer-events: none;
    opacity: 0.9;
    /* Довгий, м'який вхід зверху: місто не обривається різкою лінією,
       а проступає з нічної імли. Знизу — коротке згасання, інакше основи
       будинків і світло ліхтарів зрізало б рівною межею секції. */
    mask-image: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.25) 18%,
                                rgba(0, 0, 0, 0.7) 42%, #000 74%,
                                rgba(0, 0, 0, 0.55) 93%, transparent 100%);
    -webkit-mask-image: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.25) 18%,
                                        rgba(0, 0, 0, 0.7) 42%, #000 74%,
                                        rgba(0, 0, 0, 0.55) 93%, transparent 100%);
}

.skyline {
    width: 100%;
    height: 100%;
    display: block;
}

/* Будинки темніші за небо, і кожен план — на свій крок темніший.
   Глибина різкості: що далі план, то він розмитіший — так силует читається
   об'ємно, а не як пласка аплікація. */
.skyline__far {
    fill: var(--skyline-far);
    filter: blur(3.5px);
}

.skyline__mid {
    fill: var(--skyline-mid);
    filter: blur(1.4px);
}

.skyline__lights--far {
    filter: blur(2.5px);
}

.skyline__lights--mid {
    filter: blur(0.8px);
}

.skyline__near {
    fill: var(--skyline-ink);
}

/* Відбиття в мокрій бруківці. Силует у воді світліший за самі будинки —
   інакше він зливається з тлом сторінки, місто обривається рівною лінією,
   а під ним лишається смуга порожнечі. */
.skyline__lights rect {
    fill: var(--brass);
}

.skyline__lights--far rect {
    fill: var(--ink-faint);
}

.skyline__lamps {
    stroke: var(--skyline-ink);
    stroke-width: 2;
    fill: var(--brass);
}

/* Ореол ліхтарів — вологе повітря над бруківкою */
.skyline__lamp-glow {
    opacity: 0.7;
}

/* Удень місто — далека димка на горизонті, і вікна, звісно, не світяться */
body.theme-light .hero-band__sky {
    opacity: 0.22;
}

body.theme-light .skyline__lights {
    display: none;
}

/* ---------- ГЕРОЙ ---------- */
.hero {
    padding-block: clamp(40px, 7vw, 84px) clamp(240px, 30vw, 460px);
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: center;
}

/* Понад 1600px колонки перестають розповзатись: текст лишається читабельним,
   а картка гри — поруч із закликом, а не на іншому кінці екрана. */
@media (min-width: 1600px) {
    .hero {
        grid-template-columns: minmax(0, 1fr) 460px;
    }

    .hero__title {
        font-size: clamp(3.4rem, 4.4vw, 5.2rem);
    }

    .play-card {
        width: 360px;
    }
}

.hero__title {
    margin-block: 18px 20px;
}

.hero .lead {
    max-width: 46ch;
}

.hero__title em {
    font-style: normal;
    color: var(--accent);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

/* Обіцянка під кнопкою: що саме дає профіль. Стоїть одразу під дією,
   бо відповідає на питання, яке виникає рівно в момент натискання. */
.hero__note {
    margin-top: 14px;
    max-width: 46ch;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ink-dim);
}

.hero__note a {
    white-space: nowrap;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--line-strong);
}

.hero__note a:hover {
    text-decoration-color: currentColor;
}

/* Цифри клубу — підпис під закликом, а не окремий блок: тонкі роздільники
   тримають їх одним рядком і не претендують на увагу. */
.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.hero__meta > div {
    padding-inline: 22px;
    border-left: 1px solid var(--line);
}

.hero__meta > div:first-child {
    padding-left: 0;
    border-left: 0;
}

.stat__num {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 1.45rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: 7px;
}

/* ---------- ІГРАЛЬНА КАРТА (афіша) ---------- */
/* Колода: дві «сорочки» позаду головної карти. Вони — псевдоелементи контейнера,
   а не самої карти: карта повернута, а поворот створює свій контекст накладання,
   у якому z-index:-1 лягав би поверх її ж лиця. */
.deal {
    display: grid;
    place-items: center;
    perspective: 1200px;
}

.deal > *,
.deal::before,
.deal::after {
    grid-area: 1 / 1;
}

.deal::before,
.deal::after {
    content: '';
    width: min(320px, 100%);
    aspect-ratio: 5 / 7;
    border-radius: var(--radius-card);
    background: url('/static/vendor/avatar-main.png') center / 46% no-repeat,
                var(--surface-2);
    border: 1px solid var(--line);
    z-index: 0;
}

.deal::before {
    transform: rotate(6deg) translate(10px, 6px);
}

.deal::after {
    transform: rotate(11deg) translate(20px, 12px);
    opacity: 0.6;
}

.play-card {
    position: relative;
    width: min(320px, 100%);
    aspect-ratio: 5 / 7;
    border-radius: var(--radius-card);
    background: var(--card-face);
    color: var(--card-face-ink);
    box-shadow: var(--shadow-lift);
    padding: 22px;
    display: flex;
    flex-direction: column;
    transform: rotate(-3deg);
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
    animation: dealIn 0.8s var(--ease) both;
    z-index: 1;
}

/* Клубний медальйон, відтиснутий у папір картки. Файл — сама лише карта
   прозорості (tools_gen_emblem.py), а колір дає заливка під маскою, тож знак
   перефарбовується разом із темою і не тягне за собою три різні картинки. */
.play-card::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 34%;
    width: 70%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: linear-gradient(158deg,
                color-mix(in srgb, var(--brass) 82%, #fff),
                color-mix(in srgb, var(--brass) 78%, #000));
    opacity: 0.32;
    pointer-events: none;
    mask: url("/static/vendor/emblem-mask.png") center / contain no-repeat;
    -webkit-mask: url("/static/vendor/emblem-mask.png") center / contain no-repeat;
}

.play-card:hover {
    transform: rotate(0deg) translateY(-6px);
}

@keyframes dealIn {
    from {
        opacity: 0;
        transform: translate(40px, -30px) rotate(14deg);
    }
    to {
        opacity: 1;
        transform: rotate(-3deg);
    }
}

.play-card__index {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.play-card__body {
    margin-top: auto;
}

.play-card__date {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 2.1rem;
    line-height: 1;
    letter-spacing: -0.03em;
}

.play-card__rows {
    margin-top: 16px;
    display: grid;
    gap: 7px;
    font-size: 0.85rem;
}

.play-card__rows div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(23, 19, 26, 0.16);
}

.play-card__rows span:first-child {
    color: rgba(23, 19, 26, 0.68);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding-top: 3px;
}

.play-card__rows b {
    font-weight: 600;
    text-align: right;
}


.play-card__empty {
    margin: auto 0;
    text-align: center;
    color: rgba(23, 19, 26, 0.6);
    font-size: 0.9rem;
}

/* ---------- СПИСОК АФІШ ---------- */
.afisha {
    position: relative;
    display: grid;
    /* Права колонка фіксована, а не auto: з auto її ширину задавав найдовший
       текст усередині, тож картка з екстра-місцями ставала ширшою за сусідні
       і смуги з кнопками не збігались між картками. Ширина в rem, щоб
       колонка росла разом із текстом, коли гравець збільшує масштаб сайту. */
    grid-template-columns: 118px minmax(0, 1fr) 16rem;
    gap: clamp(16px, 3vw, 28px);
    align-items: center;
    padding: clamp(18px, 2.6vw, 26px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    transition: border-color 0.3s var(--ease), transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.afisha:hover {
    border-color: var(--line-strong);
    transform: translateY(-3px);
    box-shadow: var(--shadow-press);
}

.afisha.is-mine {
    border-color: color-mix(in srgb, var(--good) 45%, transparent);
}

.afisha.is-full {
    opacity: 0.72;
}

/* Дата як «ранг карти» — головний орієнтир у списку */
.afisha__date {
    background: var(--card-face);
    color: var(--card-face-ink);
    border-radius: var(--radius-field);
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--shadow-press);
}

.afisha__day {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 2rem;
    line-height: 1;
}

.afisha__month {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.64rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 6px;
}

.afisha__title {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 1.12rem;
    letter-spacing: -0.01em;
}

.afisha__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 10px;
    color: var(--ink-dim);
    font-size: 0.86rem;
}

.afisha__facts i {
    color: var(--brass);
    margin-right: 6px;
}

.afisha__side {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    /* Ширину задає колонка сітки — власний min-width тут лише заважав би */
    min-width: 0;
}

/* Заповненість столу — сенс важливіший за цифру, тому ще й смуга */
.seats {
    width: 100%;
    display: grid;
    gap: 6px;
}

.seats__bar {
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    overflow: hidden;
}

.seats__fill {
    height: 100%;
    background: var(--good);
    border-radius: var(--radius-pill);
    transition: width 0.6s var(--ease);
}

.seats__fill.is-tight {
    background: var(--warn);
}

.seats__fill.is-full {
    background: var(--accent);
}

.seats__text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    text-align: right;
}

/* Підпис над смугою: ліворуч чия це смуга, праворуч — рахунок */
.seats__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

/* Платні місця йдуть другим блоком, тож трохи відсуваємо їх від столу */
.seats__row--extra {
    margin-top: 6px;
}

.seats__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.seats__count {
    font-size: 0.72rem;
    color: var(--ink-dim);
}

/* Платні місця латунні, а не зелені: це інша, дорожча категорія */
.seats__fill.is-extra {
    background: var(--brass);
}

/* ---------- ЯК ЦЕ ВІДБУВАЄТЬСЯ ---------- */
/* Заголовок збоку тримається при гортанні, кроки йдуть повз нього стовпчиком.
   Так видно, що це послідовність, а не три рівнозначні пункти меню. */
.steps-split {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
}

/* 66px — висота липкої шапки (.site-header__inner), плюс повітря під нею */
.steps-split__head {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 14px;
}

.steps-split__head p {
    max-width: 30ch;
    font-size: 0.94rem;
}

.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
}

/* Крок відділений лінією, а не рамкою картки: рамка робила з послідовності
   три однакові коробки, а лінія лишає її списком */
.step {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr);
    gap: clamp(14px, 2vw, 24px);
    padding-block: clamp(20px, 3vw, 30px);
    border-top: 1px solid var(--line);
}

.step:first-child {
    border-top: 0;
    padding-top: 0;
}

.step__suit {
    font-size: 1.5rem;
    line-height: 1;
    color: var(--brass);
}

.step h3 {
    font-size: 1.08rem;
    margin-bottom: 8px;
}

.step p {
    color: var(--ink-dim);
    font-size: 0.94rem;
    max-width: 52ch;
}

@media (max-width: 860px) {
    .steps-split {
        grid-template-columns: minmax(0, 1fr);
    }

    .steps-split__head {
        position: static;
    }
}

/* ---------- НОВИНИ ---------- */
.news-item {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: clamp(16px, 3vw, 30px);
    padding-block: 26px;
    border-top: 1px solid var(--line);
}

.news-item:first-child {
    border-top: 0;
}

.news-item__stamp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    padding-top: 4px;
}

.news-item__text {
    font-size: 1rem;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-width: 68ch;
}

.news-item__photo {
    margin-top: 16px;
    border-radius: var(--radius-field);
    border: 1px solid var(--line);
    max-height: 420px;
    object-fit: cover;
    width: 100%;
    height: auto;
}

/* ---------- ГАЛЕРЕЯ ---------- */
.gallery {
    columns: 4 220px;
    column-gap: 12px;
}

.gallery figure {
    margin: 0 0 12px;
    break-inside: avoid;
    border-radius: var(--radius-field);
    overflow: hidden;
    border: 1px solid var(--line);
    position: relative;
    background: var(--surface-2);
}

.gallery img {
    width: 100%;
    transition: transform 0.6s var(--ease), filter 0.4s var(--ease);
    filter: saturate(0.82) contrast(1.05);
}

.gallery figure:hover img {
    transform: scale(1.04);
    filter: none;
}

.gallery figcaption {
    position: absolute;
    inset: auto 0 0 0;
    padding: 26px 12px 10px;
    font-size: 0.76rem;
    color: #f4efe6;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery figure:hover figcaption {
    opacity: 1;
}

/* ---------- СОЦМЕРЕЖІ ---------- */
.socials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.social {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 22px;
    border-radius: var(--radius-card);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: border-color 0.3s, transform 0.3s var(--ease), background 0.3s;
}

.social:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
}

.social i {
    font-size: 1.5rem;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-field);
    background: var(--surface-2);
    flex: none;
}

.social--tg:hover i {
    background: #229ed9;
    color: #fff;
}

.social--ig:hover i {
    background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7);
    color: #fff;
}

.social b {
    display: block;
    font-size: 0.95rem;
}

/* Приглушується лише нік під назвою. Раніше правило висіло на обгортці
   <span><b>Назва</b><span>@нік</span></span>, тож гасило й саму назву. */
.social span span {
    font-size: 0.78rem;
    color: var(--ink-dim);
    font-family: 'JetBrains Mono', monospace;
}

/* ---------- ФОРМИ ---------- */
.form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 13px 15px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-3);
}

.field input::placeholder {
    color: var(--ink-faint);
}

.field small {
    font-size: 0.76rem;
    color: var(--ink-faint);
}

/* Поле з помилкою: підсвічуємо рамку й пишемо, що саме не так */
.field--bad input {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.field-bad {
    font-size: 0.78rem;
    color: var(--accent);
}

/* Поки поле з помилкою — показуємо, що виправити, а не загальну підказку */
.field--bad small:not(.field-bad) {
    display: none;
}

.form-note {
    font-size: 0.86rem;
    color: var(--ink-dim);
}

/* Згода з угодою — обов'язковий крок реєстрації, тож стоїть поруч із кнопкою */
.check {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    font-size: 0.88rem;
    color: var(--ink-dim);
    cursor: pointer;
    line-height: 1.5;
}

.check input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: none;
    accent-color: var(--accent);
    cursor: pointer;
}

.check a {
    color: var(--brass);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Адресат коду + швидкий шлях назад до форми */
.verify-target {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 15px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.88rem;
}

.verify-target__label {
    color: var(--ink-faint);
    margin-right: 6px;
}

.verify-target b {
    overflow-wrap: anywhere;
}

.verify-target button {
    border: 0;
    background: transparent;
    color: var(--brass);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 2px;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.verify-target button:hover {
    color: var(--accent);
}

.code-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    letter-spacing: 0.5em;
    text-align: center;
    text-indent: 0.5em;
}

.alert {
    padding: 12px 15px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 40%, transparent);
    color: var(--accent);
}

.alert-good {
    background: color-mix(in srgb, var(--good) 14%, transparent);
    border-color: color-mix(in srgb, var(--good) 40%, transparent);
    color: var(--good);
}

.alert-info {
    background: var(--brass-soft);
    border-color: color-mix(in srgb, var(--brass) 35%, transparent);
    color: var(--brass);
}

/* ---------- ВУЗЬКІ СТОРІНКИ (вхід, реєстрація) ---------- */
.narrow {
    max-width: 480px;
    margin-inline: auto;
}

.auth-split {
    display: grid;
    gap: 18px;
}

.or {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink-faint);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.or::before,
.or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ---------- ДОКУМЕНТ (угода) ---------- */
/* Довгий текст читають, а не сканують: вузька колонка і спокійний ритм заголовків */
.doc {
    max-width: 68ch;
    margin-inline: auto;
}

.doc h3 {
    margin: 34px 0 12px;
    font-size: 1.05rem;
    color: var(--brass);
    text-transform: none;
}

.doc p {
    margin-bottom: 12px;
    color: var(--ink-dim);
    line-height: 1.75;
}

/* ---------- ЮРИДИЧНІ ДОКУМЕНТИ ----------
   Оферта й політика — довгі нумеровані тексти. Головне тут: вузька міра
   рядка для читання, липкий зміст збоку й номер пункту, який не з'їжджає
   в текст, а стоїть окремою колонкою. */
.legal {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 48px;
    margin-top: 40px;
    align-items: start;
}

.legal__toc {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 14px;
}

.legal__toc ol {
    counter-reset: toc;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.legal__toc li {
    counter-increment: toc;
    font-size: 0.82rem;
    line-height: 1.4;
}

.legal__toc li::before {
    content: counter(toc);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    color: var(--brass);
    margin-right: 8px;
}

.legal__toc a {
    color: var(--ink-dim);
}

.legal__toc a:hover {
    color: var(--ink);
}

.legal__other {
    margin-top: 6px;
    font-size: 0.78rem;
}

.legal__body {
    max-width: 74ch;
}

.legal__preamble {
    color: var(--ink-dim);
    line-height: 1.75;
    margin: 0 0 14px;
}

.legal__section {
    margin-top: 44px;
    scroll-margin-top: 96px;
}

.legal__section h3 {
    display: flex;
    gap: 12px;
    align-items: baseline;
    font-size: 1.08rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    margin: 0 0 18px;
}

.legal__num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8em;
    color: var(--brass);
}

.legal__sub {
    margin: 26px 0 12px;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brass);
}

.legal__sub--num {
    letter-spacing: 0.04em;
}

/* Номер пункту стоїть окремою колонкою — так абзаци вирівняні по лівому краю
   тексту, а не «сходинками» від довжини номера. */
.legal__clause {
    display: grid;
    grid-template-columns: 3.6em minmax(0, 1fr);
    gap: 4px;
    margin: 0 0 12px;
    color: var(--ink-dim);
    line-height: 1.75;
}

.legal__n {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    color: var(--ink-faint);
    padding-top: 0.28em;
}

.legal__list {
    margin: 0 0 14px;
    padding-left: 3.6em;
    display: grid;
    gap: 7px;
    color: var(--ink-dim);
    line-height: 1.7;
}

.legal__list li::marker {
    color: var(--brass);
}

.legal__defs {
    margin: 0 0 16px;
    display: grid;
    gap: 12px;
}

.legal__defs dt {
    font-weight: 600;
    color: var(--ink);
}

.legal__defs dd {
    margin: 4px 0 0;
    color: var(--ink-dim);
    line-height: 1.7;
}

.legal__defs--tight {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 8px 16px;
}

.legal__defs--tight dt {
    font-weight: 500;
    color: var(--ink-faint);
    font-size: 0.82rem;
}

.legal__defs--tight dd {
    margin: 0;
}

.legal__annex {
    margin-top: 64px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
    .legal {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .legal__toc {
        position: static;
        padding: 18px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius-card);
    }

    .legal__clause {
        grid-template-columns: 3.1em minmax(0, 1fr);
    }

    .legal__list {
        padding-left: 3.1em;
    }

    .legal__defs--tight {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }

    .legal__defs--tight dd {
        margin-bottom: 10px;
    }
}

/* ---------- ПРОФІЛЬ ---------- */
.profile-head {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brass);
    background: var(--surface-2);
    display: grid;
    place-items: center;
    font-family: 'Unbounded', sans-serif;
    font-size: 1.9rem;
    color: var(--brass);
    flex: none;
}

.kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 20px;
    font-size: 0.92rem;
}

.kv dt {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding-top: 3px;
}

.kv dd {
    margin: 0;
}

.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

/* На телефоні вкладки не влазять і їдуть за край. Смугу прокрутки система
   ховає, тож без підказки видно лише перші дві — праву межу розмиваємо,
   щоб було зрозуміло, що ряд продовжується. */
@media (max-width: 720px) {
    .tabs {
        mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
    }
}

.tabs button {
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.tabs button:hover {
    color: var(--ink);
}

.tabs button.is-on {
    color: var(--ink);
    border-bottom-color: var(--accent);
}

/* ---------- КАРТКА РОЛІ ---------- */
.reveal {
    display: grid;
    place-items: center;
    gap: 22px;
    text-align: center;
    padding-block: clamp(24px, 5vw, 48px);
}

.reveal__card {
    position: relative;
    width: min(300px, 84vw);
    aspect-ratio: 5 / 7;
    border-radius: var(--radius-card);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    transform-style: preserve-3d;
    transition: transform 0.65s var(--ease);
    box-shadow: var(--shadow-lift);
    touch-action: none;
}

.reveal__card.is-open {
    transform: rotateY(180deg);
}

.reveal__face {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-card);
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Сорочка карти: візерунок градієнтами і знак клубу посередині */
.reveal__back {
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 6px, transparent 6px 12px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.06) 0 6px, transparent 6px 12px),
        linear-gradient(160deg, #3a1020, #17131a 60%);
    border: 2px solid var(--brass);
    display: grid;
    place-items: center;
    color: var(--brass);
}

.reveal__logo {
    width: 58%;
    border-radius: 50%;
    border: 1px solid var(--brass);
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.35);
}

.reveal__front {
    transform: rotateY(180deg);
    background: var(--card-face);
}

.reveal__front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.reveal__hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.reveal__role {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: clamp(1.4rem, 4vw, 2rem);
    text-transform: uppercase;
}

/* Пульс очікування роздачі — єдина «жива» деталь на порожній сторінці */
.pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent-glow);
    animation: pulse 2s infinite;
    flex: none;
}

@keyframes pulse {
    70% {
        box-shadow: 0 0 0 14px transparent;
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
    }
}

/* ---------- ПІДВАЛ ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-deep);
    padding-block: 44px 32px;
    margin-top: clamp(40px, 7vw, 80px);
}

.site-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
}

.site-footer a {
    color: var(--ink-dim);
    font-size: 0.88rem;
}

.site-footer a:hover {
    color: var(--accent);
}

/* Пальцем у рядок 19px не влучиш: там, де вказівник грубий (телефон, планшет),
   посилання підвалу стають повноцінними цілями у 44px. Проміжок при цьому
   стискаємо, інакше колонка з шести пунктів розтягне підвал удвічі. */
@media (pointer: coarse) {
    .site-footer .stack {
        gap: 2px;
    }

    .site-footer .stack > a:not(.brand) {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
    }

    .site-footer .stack > .eyebrow,
    .site-footer .stack > p {
        margin-bottom: 6px;
    }
}

.site-footer__bottom {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--ink-faint);
}

/* ---------- ПОВІДОМЛЕННЯ ---------- */
/* Шари сайту: .modal-bg 96 > .settings-sheet 95, бо модалка — це завжди
   найсвіжіша дія користувача; лайтбокс 100 над ними, а тости 120 над усім:
   їх має бути видно поверх будь-якого затемнення. */
.toast-host {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 120;
    display: grid;
    gap: 8px;
    width: min(420px, calc(100vw - 32px));
}

.toast {
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 0.88rem;
    box-shadow: var(--shadow-lift);
    animation: toastIn 0.3s var(--ease) both;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

/* ---------- ДІАЛОГОВЕ ВІКНО ----------
   Вікно — це карта, яку поклали на стіл під лампою, а не сіра панель
   поверх сторінки. Звідси три речі, які роблять усю різницю:

   1. Оправа. Карта не лежить на сукні голим прямокутником — у неї є кант.
      Робимо його тінями, а не вкладеними div-ами: розмітка лишається
      тією самою, а кант виходить концентричним і однаковим з усіх боків.
   2. Світло згори. Та сама латунна пляма, що над столом у панелі: вона
      дає вікну верх і низ, і воно перестає бути пласким.
   3. Вага в русі. Вікно не «з'являється», а піднімається й стає на місце —
      з власною кривою, повільніше, ніж тло.
*/
@keyframes backdropIn {
    from {
        opacity: 0;
    }
}

@keyframes dialogIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.965);
    }
}

.modal-bg {
    position: fixed;
    inset: 0;
    z-index: 96;
    display: grid;
    place-items: center;
    padding: var(--gutter);
    /* Віньєтка збирає увагу до центру — те саме світло, що над столом */
    background:
        radial-gradient(80% 60% at 50% 42%, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.86) 100%),
        rgba(4, 3, 6, 0.72);
    backdrop-filter: blur(10px) saturate(0.9);
    -webkit-backdrop-filter: blur(10px) saturate(0.9);
    /* Догортавши вікно до краю, палець не має тягнути сторінку під ним */
    overscroll-behavior: contain;
    animation: backdropIn 0.22s ease both;
}

.modal {
    position: relative;
    width: min(460px, 100%);
    max-height: calc(100dvh - var(--gutter) * 2 - 18px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(24px, 3.4vw, 32px);
    border: 0;
    border-radius: var(--radius-lg);
    color: var(--ink);
    background:
        radial-gradient(120% 78% at 50% -12%, var(--brass-soft), transparent 60%),
        linear-gradient(180deg, color-mix(in srgb, var(--ink) 4%, transparent), transparent 38%),
        var(--surface);
    /* Оправа: волосина по краю карти, підкладка, зовнішня латунна нитка */
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--ink) 9%, transparent),
        0 0 0 1px color-mix(in srgb, var(--brass) 26%, transparent),
        0 0 0 7px color-mix(in srgb, var(--surface-2) 92%, transparent),
        0 0 0 8px color-mix(in srgb, var(--brass) 14%, transparent),
        0 44px 90px -34px rgba(0, 0, 0, 0.95);
    animation: dialogIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Смуга прокрутки всередині вікна. Системна сіра тут видно найкраще —
   вона й видає «дешеву» коробку, скільки б не було канта навколо. */
.modal,
.settings-sheet__panel,
.roster {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--brass) 45%, transparent) transparent;
}

.modal::-webkit-scrollbar,
.settings-sheet__panel::-webkit-scrollbar,
.roster::-webkit-scrollbar {
    width: 10px;
}

.modal::-webkit-scrollbar-track,
.settings-sheet__panel::-webkit-scrollbar-track,
.roster::-webkit-scrollbar-track {
    background: transparent;
}

.modal::-webkit-scrollbar-thumb,
.settings-sheet__panel::-webkit-scrollbar-thumb,
.roster::-webkit-scrollbar-thumb {
    border-radius: var(--radius-pill);
    /* Прозора рамка робить повзунок вужчим за смугу, не звужуючи саму смугу */
    border: 3px solid transparent;
    background-clip: padding-box;
    background-color: color-mix(in srgb, var(--brass) 42%, transparent);
}

.modal::-webkit-scrollbar-thumb:hover,
.settings-sheet__panel::-webkit-scrollbar-thumb:hover,
.roster::-webkit-scrollbar-thumb:hover {
    background-color: color-mix(in srgb, var(--brass) 70%, transparent);
}

/* Масть у кутку — знак клубу, а не прикраса: те саме, що на картках столу */
.modal::after {
    content: "♠";
    position: absolute;
    right: 18px;
    bottom: 12px;
    font-size: 2.4rem;
    line-height: 1;
    color: var(--ink);
    opacity: 0.03;
    pointer-events: none;
}

.modal > * {
    position: relative;
    z-index: 1;
}

/* Заголовок вікна — головний напис, під ним латунна волосина */
.modal > h3:first-of-type,
.modal > .row:first-of-type {
    padding-right: 44px;
    padding-bottom: 14px;
    margin-bottom: 18px;
    border-bottom: 1px solid color-mix(in srgb, var(--brass) 22%, transparent);
}

.modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface-2) 80%, transparent);
    color: var(--ink-dim);
    cursor: pointer;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease), transform 0.25s var(--ease);
}

.modal__close:hover {
    color: var(--ink);
    border-color: var(--brass);
    background: var(--surface-3);
    transform: rotate(90deg);
}

.modal__close:active {
    transform: rotate(90deg) scale(0.92);
}

@media (prefers-reduced-motion: reduce) {
    .modal-bg,
    .modal {
        animation: none;
    }

    .modal__close:hover,
    .modal__close:active {
        transform: none;
    }
}

/* ---------- ЗАПИС З ДРУЗЯМИ ---------- */
.join-friends {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.join-friend {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.join-friend input {
    flex: 1;
    min-width: 0;
}

.join-friend__drop {
    width: 38px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
}

.join-friend__drop:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.join-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 0.86rem;
    color: var(--ink-dim);
}

.join-total b {
    font-size: 1.3rem;
    color: var(--ink);
}

/* ---------- ОЧІКУВАННЯ ОПЛАТИ ---------- */
.pay-anim {
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 26px 0 8px;
    text-align: center;
}

.pay-anim__card {
    position: relative;
    width: 96px;
    height: 62px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: var(--radius-field);
    border: 1px solid var(--brass);
    background: var(--brass-soft, var(--surface-2));
    color: var(--brass);
    font-size: 1.4rem;
    animation: payPulse 1.4s var(--ease) infinite;
}

.pay-anim__shine {
    position: absolute;
    inset: 0 auto 0 -60%;
    width: 60%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    animation: payShine 1.4s var(--ease) infinite;
}

.pay-anim__done {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--good);
    color: var(--good);
    font-size: 1.6rem;
    animation: payDone 0.45s var(--ease) both;
}

.pay-anim__text {
    margin: 0;
    color: var(--ink-dim);
    font-size: 0.9rem;
}

@keyframes payPulse {
    0%, 100% {
        transform: translateY(0) rotate(-2deg);
    }
    50% {
        transform: translateY(-6px) rotate(2deg);
    }
}

@keyframes payShine {
    to {
        left: 110%;
    }
}

@keyframes payDone {
    from {
        transform: scale(0.6);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pay-anim__card,
    .pay-anim__shine,
    .pay-anim__done {
        animation: none;
    }
}

.seats__note {
    font-size: 0.68rem;
    color: var(--ink-faint);
    text-align: right;
}

/* ---------- ІСТОРІЯ ОПЛАТ ----------
   Рядок, а не картка: це реєстр, його читають згори вниз і порівнюють
   суми. Картки перетворили б його на плитку, де нічого не порівняти. */
.payline {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(12px, 2vw, 24px);
    padding-block: 16px;
    border-top: 1px solid var(--line);
}

.payline:first-child {
    border-top: 0;
}

.payline__when {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.payline__when span {
    font-size: 0.8rem;
    color: var(--ink-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payline__what {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.payline__sum {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 1.02rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Скасоване не ховаємо, а приглушуємо: сума лишається читабельною,
   бо саме її й прийшли перевірити */
.payline--off .payline__when b,
.payline--off .payline__sum {
    color: var(--ink-dim);
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

.payline__refund {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: -4px 0 14px;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: var(--accent-soft);
    font-size: 0.8rem;
    color: var(--ink-dim);
}

.payline__refund .mono {
    font-size: 0.72rem;
    color: var(--ink-faint);
}

@media (max-width: 620px) {
    .payline {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .payline__what {
        grid-column: 1 / -1;
    }
}

/* Місце в черзі. Не тривога й не успіх — стан очікування, тому латунь:
   той самий колір, яким у клубі позначено «зараз твій хід». */
.queue-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--brass) 45%, transparent);
    background: var(--brass-soft);
    color: var(--brass);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ---------- СТАНИ ---------- */
.empty {
    text-align: center;
    padding: clamp(36px, 7vw, 70px) 20px;
    color: var(--ink-faint);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-card);
}

.empty i {
    font-size: 1.8rem;
    display: block;
    margin-bottom: 14px;
    color: var(--brass);
    opacity: 0.6;
}

[v-cloak] {
    display: none;
}

/* Клас на кшталт .btn задає display і переважує браузерне правило для [hidden],
   тому прихований елемент лишався видимим. Тут ставимо крапку. */
[hidden] {
    display: none !important;
}

/* ---------- АДАПТИВ ---------- */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .deal {
        order: -1;
    }

    .play-card {
        transform: rotate(-2deg);
        width: min(280px, 82vw);
    }

    .nav {
        position: fixed;
        inset: 66px 0 auto;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 14px var(--gutter) 22px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        margin-left: 0;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s, transform 0.2s var(--ease);
    }

    .nav.is-open {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .nav a {
        padding: 12px 10px;
        font-size: 0.95rem;
    }

    .nav a.is-active::after {
        width: 26px;
    }

    .burger {
        display: block;
        order: 3;
    }

    /* Шапка на телефоні: лише знак клубу й бургер. Мова та тема — у меню,
       інакше вони не вміщаються в рядок і виїжджають за край екрана. */
    .header-tools > .switch {
        display: none;
    }

    .header-tools {
        margin-left: auto;
    }

    .nav__prefs {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        padding-top: 14px;
        margin-top: 8px;
        border-top: 1px solid var(--line);
    }

    .brand__name small {
        display: none;
    }
}

@media (max-width: 720px) {
    .afisha {
        grid-template-columns: 84px minmax(0, 1fr);
    }

    .afisha__side {
        grid-column: 1 / -1;
        align-items: stretch;
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 0;
    }

    .afisha__side .btn {
        flex: 1;
    }

    .afisha__day {
        font-size: 1.5rem;
    }

    .news-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .gallery {
        columns: 2 140px;
    }

    .site-footer__grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   РУХ: сайт як партія в мафію
   Одна поставлена сцена на завантаженні (роздача), тиха атмосфера
   і відгук карт на курсор. Усе інше лишається нерухомим — інакше
   сторінка перетворюється на атракціон.
   ============================================================ */

/* ---------- СЦЕНА ЗАВАНТАЖЕННЯ: герой збирається по черзі ---------- */
.hero > div > * {
    animation: riseIn 0.7s var(--ease) both;
}

.hero .eyebrow {
    animation-delay: 0.05s;
}

.hero__title {
    animation-delay: 0.14s;
}

.hero .lead {
    animation-delay: 0.24s;
}

.hero__actions {
    animation-delay: 0.34s;
}

.hero__meta {
    animation-delay: 0.44s;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

/* Карта прилітає на стіл останньою — як здача від ведучого */
.play-card {
    animation: dealIn 0.9s cubic-bezier(0.2, 1.1, 0.3, 1) 0.5s both;
}

/* Сорочки колоди з'являються слідом, ніби ведучий домішує решту */
.deal::before,
.deal::after {
    animation: deckIn 0.7s var(--ease) both;
}

.deal::before {
    animation-delay: 0.72s;
}

.deal::after {
    animation-delay: 0.84s;
}

@keyframes deckIn {
    from {
        opacity: 0;
        transform: rotate(0deg) translate(-10px, -6px);
    }
}

/* ---------- АТМОСФЕРА: дим над столом і вікна, що гаснуть ---------- */
/* Дуже повільний дрейф світла — сторінка «дихає», але погляд не смикається */
.hero-band::before {
    content: '';
    position: absolute;
    inset: -20% -10% auto -10%;
    height: 120%;
    pointer-events: none;
    background:
        radial-gradient(38% 44% at 22% 30%, var(--brass-soft), transparent 70%),
        radial-gradient(34% 40% at 78% 60%, var(--accent-soft), transparent 72%);
    opacity: 0.7;
    animation: smoke 34s ease-in-out infinite alternate;
}

@keyframes smoke {
    from {
        transform: translate3d(-2%, 0, 0) scale(1);
    }
    to {
        transform: translate3d(3%, -2%, 0) scale(1.08);
    }
}

/* У місті гасне й засвічується світло — рідко, вроздріб */
/* Гасне лише частина вікон — інакше все місто блимає, як гірлянда */
.skyline__lights--near rect:nth-child(7n),
.skyline__lights--mid rect:nth-child(11n) {
    animation: window 9s ease-in-out infinite;
}

.skyline__lights--near rect:nth-child(13n) {
    animation: window 14s ease-in-out infinite 2.4s;
}

.skyline__lights--mid rect:nth-child(17n) {
    animation: window 11s ease-in-out infinite 1.2s;
}

@keyframes window {
    0%, 42%, 100% {
        opacity: 0.9;
    }
    48%, 62% {
        opacity: 0.18;
    }
}

/* ---------- ВІДГУК: карти реагують на руку ---------- */
/* Афіша піднімається й ледь повертається — як карта, яку беруть зі столу */
.afisha {
    will-change: transform;
}

.afisha:hover {
    transform: translateY(-4px) rotate(-0.35deg);
}

/* Золота нитка проявляється по верхньому краю картки */
.afisha::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brass), transparent);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
}

.afisha:hover::before {
    opacity: 0.8;
}

/* Блик по головній кнопці — глянець гральної карти */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0 auto 0 -60%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-18deg);
    transition: left 0.55s var(--ease);
}

.btn-primary:hover::after {
    left: 120%;
}

/* Масті в кроках: кожен крок позначений своєю — дрібниця зі світу гри */
.step {
    overflow: hidden;
}

.step::after {
    content: attr(data-suit);
    position: absolute;
    right: -10px;
    bottom: -26px;
    font-size: 5.5rem;
    line-height: 1;
    color: var(--ink);
    opacity: 0.05;
    transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
    pointer-events: none;
}

.step:hover::after {
    opacity: 0.12;
    transform: translateY(-6px) rotate(-8deg);
}

/* ---------- ПОЯВА ПРИ ГОРТАННІ ---------- */
/* Клас додає JS і лише там, де браузер це вміє: без скрипта весь вміст
   лишається видимим, а не застрягає прозорим. */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: none;
}

/* Роздільник мастей між великими секціями */
.suits,
.club-strip__suits {
    display: flex;
    justify-content: center;
    gap: 18px;
    font-size: 0.95rem;
    color: var(--ink-faint);
    padding-block: 6px;
    letter-spacing: 0.2em;
}

.suits span:nth-child(2),
.suits span:nth-child(4),
.club-strip__suits span:nth-child(2),
.club-strip__suits span:nth-child(4) {
    color: var(--accent);
    opacity: 0.75;
}

/* ---------- ЦИФРИ КЛУБУ ----------
   Власна смуга одразу під героєм: цифри мають місце, а заклик у герої
   більше ні з чим не ділить увагу. Масті замикають рядок праворуч. */
.club-strip {
    border-block: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.club-strip__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: clamp(20px, 4vw, 54px);
    padding-block: clamp(20px, 3vw, 30px);
}

.club-strip__cell {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.club-strip__cell .stat__label {
    margin-top: 0;
}

.club-strip__suits {
    margin-left: auto;
}

@media (max-width: 720px) {
    .club-strip__suits {
        display: none;
    }
}

/* ---------- СМУГА З ВЛАСНИМ ТЛОМ ----------
   Секція на всю ширину з іншим тлом. Тон лишається в межах теми: це зміна
   ритму, а не стрибок у світлу тему посеред темної сторінки. */
.band {
    border-top: 1px solid var(--line);
    background:
        radial-gradient(90% 120% at 50% 0%, var(--brass-soft), transparent 62%),
        color-mix(in srgb, var(--surface) 65%, transparent);
}

.band__inner {
    display: grid;
    gap: clamp(22px, 3.4vw, 38px);
}

.band__head {
    display: grid;
    gap: 12px;
    max-width: 46ch;
}

/* Посилання «усі новини» під стрічкою, а не в шапці секції */
.section-more {
    margin-top: clamp(18px, 2.6vw, 26px);
}

@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        opacity: 1;
        transform: none;
    }

    .hero-band::before,
    .skyline__lights rect {
        animation: none;
    }
}

/* ---------- СТОРІНКА ПОМИЛКИ ---------- */
.error-page {
    text-align: center;
    max-width: 46ch;
    margin-inline: auto;
    padding-block: clamp(20px, 6vw, 60px);
}

.error-page .lead {
    margin-inline: auto;
}

/* Код помилки подано лицем карти — та сама мова, що й на решті сайту */
.error-page__card {
    width: 132px;
    aspect-ratio: 5 / 7;
    margin: 0 auto 32px;
    border-radius: var(--radius-field);
    background: var(--card-face);
    color: var(--card-face-ink);
    box-shadow: var(--shadow-lift);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 14px;
    transform: rotate(-4deg);
}

.error-page__code {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 2.2rem;
    line-height: 1;
    align-self: center;
}

.error-page__suit {
    color: var(--accent);
    font-size: 1rem;
    line-height: 1;
}

.error-page__suit--flip {
    align-self: flex-end;
    transform: rotate(180deg);
}

/* ---------- КАБІНЕТ: СТАТИСТИКА, ЗНАЧКИ, КОЛЕКЦІЯ ---------- */
.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.stat-row > div {
    padding-inline: 20px;
    border-left: 1px solid var(--line);
}

.stat-row > div:first-child {
    padding-left: 0;
    border-left: 0;
}

/* Співвідношення команд: пропорцію видно одразу, без читання цифр */
.teams-bar {
    display: flex;
    height: 8px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    background: var(--surface-3);
}

.teams-bar__mafia {
    background: var(--accent);
}

.teams-bar__town {
    background: var(--good);
}

.teams-bar__solo {
    background: var(--warn);
}

/* Легенда до смуги: без неї кольори нічого не означають */
.teams-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
    font-size: 0.72rem;
    color: var(--ink-dim);
}

.teams-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.teams-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.teams-dot--mafia {
    background: var(--accent);
}

.teams-dot--town {
    background: var(--good);
}

.teams-dot--solo {
    background: var(--warn);
}

/* Рівно три колонки: значків дев'ять, і на auto-fill вони лягали 4+4+1 —
   останній висів сам посеред порожнечі. */
.badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

/* Незароблений значок показуємо приглушено — видно, куди рухатись */
.badge {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 16px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface-2);
    text-align: center;
    font-size: 0.74rem;
    color: var(--ink-faint);
    opacity: 0.55;
    transition: transform 0.3s var(--ease), opacity 0.3s;
}

.badge i {
    font-size: 1.25rem;
}

.badge--earned {
    opacity: 1;
    color: var(--ink);
    border-color: var(--brass-soft);
    background: linear-gradient(160deg, var(--brass-soft), var(--surface-2) 60%);
}

.badge--earned i {
    color: var(--brass);
}

.badge--earned:hover {
    transform: translateY(-3px);
}

/* Колекція зіграних ролей — карти сорочкою донизу, відкриваються при наведенні */
.collection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 14px;
}

.collect-card {
    margin: 0;
    border-radius: var(--radius-field);
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
    transition: transform 0.35s var(--ease), border-color 0.35s;
}

.collect-card {
    cursor: zoom-in;
}

.collect-card:hover {
    transform: translateY(-4px) rotate(-1deg);
    border-color: var(--brass);
}

.collect-card img,
.collect-card__blank {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 7;
    object-fit: cover;
    display: grid;
    place-items: center;
    color: var(--ink-faint);
    font-size: 1.5rem;
    background: var(--surface-3);
}

.collect-card figcaption {
    padding: 10px 12px;
    display: grid;
    gap: 3px;
    font-size: 0.8rem;
}

.collect-card figcaption span {
    font-size: 0.68rem;
    color: var(--ink-faint);
}

.collect-card--mafia {
    border-bottom: 2px solid var(--accent);
}

.collect-card--town {
    border-bottom: 2px solid var(--good);
}

.collect-card--solo {
    border-bottom: 2px solid var(--warn);
}

/* ---------- ПЕРЕМИКАЧІ СПОВІЩЕНЬ ---------- */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
    cursor: pointer;
}

.toggle-row:first-child {
    border-top: 0;
}

.toggle-row small {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-faint);
    margin-top: 3px;
}

.toggle-row input {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    border: 1px solid var(--line-strong);
    position: relative;
    flex: none;
    cursor: pointer;
    transition: background 0.25s var(--ease);
}

.toggle-row input::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ink-faint);
    transition: transform 0.25s var(--ease), background 0.25s;
}

.toggle-row input:checked {
    background: var(--accent);
    border-color: transparent;
}

.toggle-row input:checked::after {
    transform: translateX(20px);
    background: #fff;
}

.panel-danger {
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-danger {
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    color: var(--accent);
}

.btn-danger:hover:not(:disabled) {
    background: var(--accent);
    color: #fff;
}

/* На вузькому екрані цифри стають сіткою: при перенесенні рядка вертикальні
   роздільники лишалися висіти обрізками, а відступ зсував число вбік. */
@media (max-width: 620px) {
    .stat-row,
    .hero__meta {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px 10px;
    }

    .stat-row > div,
    .hero__meta > div {
        padding-inline: 0;
        border-left: 0;
    }

    .stat__num {
        font-size: 1.3rem;
    }

    .stat__label {
        font-size: 0.55rem;
        letter-spacing: 0.1em;
    }
}

.social--donate:hover i {
    background: var(--accent);
    color: #fff;
}

/* Картка ролі на телефоні: сцена має вміститись в екран цілком. Гравець тримає
   палець на карті — прокрутити, щоб прочитати назву ролі, він не може. */
@media (max-width: 640px) {
    .reveal {
        padding-block: 10px;
        gap: 14px;
    }

    .reveal__card {
        width: min(232px, 62vw);
    }

    .reveal__role {
        font-size: 1.2rem;
    }

    /* Шапка сторінки гри займала половину екрана над карткою */
    .section-head h2 {
        font-size: clamp(1.15rem, 5.4vw, 1.5rem);
    }
}

/* ---------- ЛАЙТБОКС ГАЛЕРЕЇ ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(6, 5, 8, 0.94);
    backdrop-filter: blur(8px);
    display: grid;
    grid-template-rows: auto 1fr auto;
    animation: toastIn 0.25s var(--ease) both;
    overscroll-behavior: contain;
}

/* Фігура галереї стала кнопкою — під фокусом це має бути видно */
.gallery figure[role="button"]:focus-visible,
.collection figure[role="button"]:focus-visible {
    outline: 2px solid var(--accent-hot);
    outline-offset: 3px;
}

.lightbox__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px var(--gutter);
    color: var(--ink-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
}

.lightbox__stage {
    display: grid;
    place-items: center;
    padding: 0 var(--gutter);
    min-height: 0;
}

/* Фото вписується в екран цілком: гортати зум не потрібно */
.lightbox__stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-field);
    box-shadow: var(--shadow-lift);
}

.lightbox__caption {
    padding: 14px var(--gutter) 22px;
    text-align: center;
    color: var(--ink-dim);
    font-size: 0.88rem;
    min-height: 24px;
}

.lightbox__btn {
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--ink);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: grid;
    place-items: center;
    transition: background 0.2s, border-color 0.2s;
}

.lightbox__btn:hover {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
}

/* Стрілки прилипають до країв екрана, щоб не перекривати фото */
.lightbox__nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 101;
}

.lightbox__nav--prev {
    left: max(12px, var(--gutter));
}

.lightbox__nav--next {
    right: max(12px, var(--gutter));
}

.gallery figure {
    cursor: zoom-in;
}

/* Лічильник місць — кнопка, що відкриває склад столу */
/* Лічильник місць — це кнопка складу столу. Значок людей і підкреслення
   потрібні, щоб було видно: сюди можна натиснути. Без них це просто цифри. */
/* Склад столу — окрема кнопка з рамкою і стрілкою. Раніше це був лічильник
   місць із пунктирним підкресленням, і його читали як просто цифру. */
.seats__roster {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--ink-dim);
    font: inherit;
    font-size: 0.74rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.seats__roster i {
    font-size: 0.82em;
    color: var(--brass);
}

.seats__roster span {
    flex: 1;
    text-align: left;
}

.seats__roster-go {
    transition: transform 0.2s;
}

.seats__roster:hover {
    color: var(--ink);
    border-color: var(--brass);
    background: var(--brass-soft);
}

.seats__roster:hover .seats__roster-go {
    transform: translateX(2px);
}

/* ---------- СКЛАД СТОЛУ ---------- */
.roster {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    max-height: 46vh;
    overflow-y: auto;
    /* Вертикальна смуга з'їдала кілька пікселів ширини, і рядки вилазили
       за край — знизу з'являлась зайва горизонтальна прокрутка. */
    overflow-x: hidden;
    padding-right: 4px;
}

.roster__row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 9px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.roster__row--me {
    border-color: var(--brass);
}

/* Номер місця за столом — як на картці гравця */
.roster__seat {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--ink-faint);
    width: 22px;
    flex: none;
}

.roster__me {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--brass);
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---------- ВІДГУКИ ---------- */
.review {
    margin: 0;
    padding: 24px 26px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    display: grid;
    gap: 14px;
    position: relative;
}

/* Лапка як у друкованій цитаті — тихий знак, що це пряма мова */
.review::before {
    content: '\201C';
    position: absolute;
    top: 4px;
    right: 20px;
    font-family: Georgia, serif;
    font-size: 4.5rem;
    line-height: 1;
    color: var(--brass);
    opacity: 0.12;
}

.review__stars {
    color: var(--brass);
    font-size: 0.8rem;
    letter-spacing: 2px;
}

.review blockquote {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--ink-dim);
    overflow-wrap: anywhere;
}

.review figcaption {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
}

.review figcaption img,
.review__initial {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--brass);
    display: grid;
    place-items: center;
    color: var(--brass);
    font-family: 'Unbounded', sans-serif;
    font-size: 0.9rem;
    flex: none;
}

.review figcaption span span {
    display: block;
    font-size: 0.72rem;
    color: var(--ink-faint);
}

/* Зірки-оцінка: у розмітці йдуть від 5 до 1, тому підсвічуємо сусідів праворуч */
.stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 6px;
    font-size: 1.4rem;
}

.stars input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.stars label {
    color: var(--line-strong);
    cursor: pointer;
    transition: color 0.15s, transform 0.15s var(--ease);
}

.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label {
    color: var(--brass);
}

.stars label:hover {
    transform: scale(1.12);
}

.stars input:focus-visible + label {
    outline: 2px solid var(--accent-hot);
    outline-offset: 3px;
}

.field textarea {
    resize: vertical;
    min-height: 96px;
    font-family: inherit;
    line-height: 1.6;
}

/* ---------- ЗАВАНТАЖЕННЯ В ГАЛЕРЕЮ (для ведучого) ---------- */
.uploader__row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.uploader__caption {
    flex: 1;
    min-width: 200px;
    padding: 11px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: inherit;
    font-size: 0.9rem;
}

.uploader__caption:focus {
    outline: none;
    border-color: var(--accent);
}

.uploader.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

/* Кнопка видалення з'являється на фото при наведенні */
.gallery__remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    background: rgba(10, 9, 12, 0.75);
    color: #f4efe6;
    cursor: pointer;
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity 0.25s, background 0.2s;
}

.gallery figure:hover .gallery__remove,
.gallery__remove:focus-visible {
    opacity: 1;
}

.gallery__remove:hover {
    background: var(--accent);
}

/* На сенсорних екранах наведення немає — показуємо одразу */
@media (hover: none) {
    .gallery__remove {
        opacity: 1;
    }
}

/* ---------- РОЗДІЛ «МІЙ КЛУБ» ---------- */
.club-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.club-stats > div {
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
}

.alert-warn {
    background: color-mix(in srgb, var(--warn) 14%, transparent);
    border-color: color-mix(in srgb, var(--warn) 40%, transparent);
    color: var(--warn);
}

/* Картка гравця в базі клубу */
.player-card {
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    display: grid;
    gap: 6px;
}

.player-card__name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 0.82rem;
    color: var(--ink-dim);
}

.player-card__id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--ink-faint);
}

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.admin-row__remove {
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    transition: color 0.2s, background 0.2s;
}

.admin-row__remove:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.archive-card {
    padding: 18px 20px;
}

/* Рядок складу столу — кнопка: відкриває картку гравця */
button.roster__row {
    width: auto;
    min-width: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s var(--ease);
}

button.roster__row:hover {
    border-color: var(--brass);
    transform: translateX(2px);
}

.player-sheet {
    display: flex;
    align-items: center;
    gap: 16px;
}

.player-sheet .avatar {
    width: 64px;
    height: 64px;
    font-size: 1.4rem;
}

/* Довге ігрове ім'я не повинно розпирати рядок складу столу */
.roster__row > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* У вузькій модалці рядок цифр не вміщається в один ряд: там, де flex
   переносив елемент разом із роздільником і відступом, ставимо сітку. */
.modal .stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 16px 12px;
}

.modal .stat-row > div {
    padding-inline: 0;
    border-left: 0;
}

.modal .stat__num {
    font-size: 1.25rem;
}

/* Ім'я гравця в шапці картки не повинно розсувати модалку */
.player-sheet h3 {
    overflow-wrap: anywhere;
}

/* ---------- НАЛАШТУВАННЯ САЙТУ ---------- */
/* Масштаб інтерфейсу: усі розміри в rem рахуються від цього кореня, тож
   один повзунок змінює і текст, і відступи — без ламання верстки. */
html {
    font-size: calc(16px * var(--ui-scale, 1));
}

.settings-sheet {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: end center;
    padding: var(--gutter);
    background:
        radial-gradient(80% 60% at 50% 60%, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.84) 100%),
        rgba(4, 3, 6, 0.7);
    backdrop-filter: blur(10px) saturate(0.9);
    -webkit-backdrop-filter: blur(10px) saturate(0.9);
    overscroll-behavior: contain;
    animation: backdropIn 0.22s ease both;
}

@media (min-width: 720px) {
    .settings-sheet {
        place-items: center;
    }
}

/* Та сама оправа, що й у діалогів: налаштування — таке саме вікно */
.settings-sheet__panel {
    position: relative;
    width: min(420px, 100%);
    padding: clamp(22px, 3vw, 28px);
    border: 0;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(120% 78% at 50% -12%, var(--brass-soft), transparent 60%),
        linear-gradient(180deg, color-mix(in srgb, var(--ink) 4%, transparent), transparent 38%),
        var(--surface);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--ink) 9%, transparent),
        0 0 0 1px color-mix(in srgb, var(--brass) 26%, transparent),
        0 0 0 7px color-mix(in srgb, var(--surface-2) 92%, transparent),
        0 0 0 8px color-mix(in srgb, var(--brass) 14%, transparent),
        0 44px 90px -34px rgba(0, 0, 0, 0.95);
    display: grid;
    gap: 22px;
    animation: dialogIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
    .settings-sheet__panel {
        animation: none;
    }
}

.settings-sheet__group {
    display: grid;
    gap: 12px;
}

.settings-sheet .switch {
    flex-wrap: wrap;
    width: fit-content;
    max-width: 100%;
}

.settings-sheet .switch button,
.settings-sheet .switch a {
    font-size: 0.7rem;
    padding: 8px 12px;
}

.scale-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.scale-row b {
    min-width: 58px;
    text-align: center;
    font-size: 0.95rem;
}

/* Кроки встановлення на iPhone: Safari не показує запит, лишається інструкція */
.install-steps {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 8px;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--ink-dim);
}

.install-steps li::marker {
    color: var(--brass);
    font-weight: 700;
}

/* Кнопка налаштувань видима завжди — на відміну від бургера, який лишається
   тільки на вузьких екранах. */
.icon-btn {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-dim);
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.icon-btn:hover {
    color: var(--ink);
    border-color: var(--brass);
}

/* ---------- Донат ---------- */
.donate-panel,
.donate-result {
    max-width: 520px;
}

.donate-amounts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.donate-amount {
    padding: 13px 6px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-field);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.donate-amount:hover {
    border-color: var(--line-strong);
}

.donate-amount.is-on {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--ink);
}

.donate-amount:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (max-width: 420px) {
    .donate-amounts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
