/* Кинотеатр: тёмная «бархатная» гамма, код комнаты оформлен как билет. */
:root {
    --velvet-900: #12080d;
    --velvet-800: #1d0f17;
    --velvet-700: #2b1622;
    --line: #4a2733;
    --text: #f4ebe1;
    --muted: #b8a0a9;
    --brass: #e3ab3c;
    --brass-ink: #24140a;
    --rose: #e58ca3;
    --paper: #efe2c4;
    --ink: #2a1a16;
    --ink-soft: #6d5649;
    --ok: #7bd9a1;
    --warn: #f0b35a;
    --danger: #ff9a9a;

    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(90% 45% at 50% -8%, #3b1b2b 0%, rgba(59, 27, 43, 0) 70%),
        var(--velvet-900);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.5;
}

[hidden] { display: none !important; }

.page {
    max-width: 70rem;
    margin: 0 auto;
    padding: 2.25rem 1.25rem 3rem;
}

/* ---------- Шапка ---------- */
.masthead { margin-bottom: 2rem; max-width: 30rem; }

#lobby { max-width: 30rem; }

.brand {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 9vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.tagline {
    margin: 0.6rem 0 0;
    max-width: 24rem;
    color: var(--muted);
}

/* ---------- Поля и кнопки ---------- */
.field-label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.input {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.8rem 1rem;
    background: var(--velvet-700);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    font-size: 1.05rem; /* не меньше 16px, иначе iPhone приближает страницу */
}

.input::placeholder { color: #8d7580; }

.input-code {
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.input-code::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font-body); }

.input:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 2px;
}

.btn {
    min-height: 3.25rem;
    padding: 0.8rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, filter 0.15s ease;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: progress; }

.btn-primary {
    width: 100%;
    margin-top: 1rem;
    background: var(--brass);
    color: var(--brass-ink);
    font-size: 1.1rem;
}

.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--brass);
}

.btn-secondary:hover:not(:disabled) { background: rgba(227, 171, 60, 0.12); }

.btn-ghost {
    min-height: 2.5rem;
    padding: 0.4rem 0.75rem;
    background: transparent;
    color: var(--muted);
    border-color: var(--line);
    font-weight: 500;
    font-size: 0.92rem;
}

.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.btn-ink {
    width: 100%;
    background: var(--ink);
    color: var(--paper);
}

.btn-ink:hover { filter: brightness(1.2); }

/* ---------- Вход ---------- */
.join {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.join-row { display: flex; gap: 0.6rem; }
.join-row .input { flex: 1; min-width: 0; }

.error {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    background: rgba(255, 154, 154, 0.1);
    border: 1px solid rgba(255, 154, 154, 0.45);
    border-radius: 12px;
    color: var(--danger);
}

/* ---------- Комната ---------- */
.room-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.status {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    font-size: 0.95rem;
}

.dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--warn);
}

.rtt { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

.status[data-ok="true"] .dot { background: var(--ok); }
.status[data-ok="false"] .dot { animation: blink 1.1s ease-in-out infinite; }

@keyframes blink { 50% { opacity: 0.25; } }

/* Билет: единственный яркий элемент страницы */
.ticket {
    --notch: 12px;
    --main-height: 7.5rem;
    background: var(--paper);
    color: var(--ink);
    border-radius: 16px;
    -webkit-mask:
        radial-gradient(circle var(--notch) at 0 var(--main-height), #0000 97%, #000) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% var(--main-height), #0000 97%, #000) right / 51% 100% no-repeat;
    mask:
        radial-gradient(circle var(--notch) at 0 var(--main-height), #0000 97%, #000) left / 51% 100% no-repeat,
        radial-gradient(circle var(--notch) at 100% var(--main-height), #0000 97%, #000) right / 51% 100% no-repeat;
    animation: ticket-in 0.35s ease-out;
}

@keyframes ticket-in {
    from { opacity: 0; transform: translateY(8px); }
}

.ticket-main {
    height: var(--main-height);
    padding: 1.1rem 1.4rem 0;
    border-bottom: 2px dashed rgba(42, 26, 22, 0.32);
}

.ticket-label {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.ticket-code {
    margin: 0.2rem 0 0;
    font-family: var(--font-mono);
    font-size: clamp(1.9rem, 9.5vw, 2.6rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.15;
    white-space: nowrap;
}

.ticket-stub {
    display: grid;
    gap: 0.6rem;
    padding: 1.1rem 1.4rem 1.3rem;
}

.input-paper {
    min-height: 2.75rem;
    background: rgba(42, 26, 22, 0.07);
    color: var(--ink);
    border-color: rgba(42, 26, 22, 0.25);
    font-size: 0.92rem;
    text-overflow: ellipsis;
}

.copy-note {
    margin: 0;
    min-height: 1.3em;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

/* ---------- Список людей и журнал ---------- */
.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 2rem;
}

.section-title {
    margin: 2rem 0 0.75rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
}

.section-head .section-title { margin: 0 0 0.75rem; }

.section-meta { margin: 0; color: var(--muted); font-size: 0.95rem; }

.people { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }

.person {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.9rem;
    background: var(--velvet-800);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--brass);
    color: var(--brass-ink);
    font-weight: 700;
    font-size: 1.1rem;
}

.avatar.tone-1 { background: var(--rose); }

.person-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.me-badge {
    margin-left: auto;
    padding: 0.1rem 0.6rem;
    border: 1px solid var(--muted);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.85rem;
}

.person.waiting {
    border-style: dashed;
    color: var(--muted);
    background: transparent;
}

.log { margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.95rem; }

.log li { display: flex; gap: 0.75rem; padding: 0.3rem 0; border-bottom: 1px solid rgba(74, 39, 51, 0.5); }

.log time { flex: none; font-variant-numeric: tabular-nums; color: #8d7580; }

/* ---------- Раскладка комнаты: на широком экране плеер слева, билет и люди справа ---------- */
.room-layout { display: grid; gap: 1.5rem; }

@media (min-width: 62rem) {
    .room-layout { grid-template-columns: minmax(0, 1fr) 21rem; align-items: start; }
    .side .section-head { margin-top: 1.75rem; }
}

.side .section-title:first-child { margin-top: 0; }

/* ---------- Плеер ---------- */
.player {
    overflow: hidden;
    background: #000;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.screen-area {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    background: #07030a;
}

.screen-area video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: radial-gradient(80% 90% at 20% 0%, #2b1622 0%, #12080d 75%);
}

.empty-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 3.2vw, 1.6rem);
    font-weight: 700;
}

.empty-note { margin: 0 0 0.75rem; max-width: 26rem; color: var(--muted); font-size: 0.95rem; }

.file-btn { display: inline-grid; place-items: center; width: auto; margin-top: 0; cursor: pointer; }

.video-notice,
.video-error {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    right: 0.75rem;
    margin: 0;
    width: fit-content;
    max-width: calc(100% - 1.5rem);
    padding: 0.45rem 0.8rem;
    background: rgba(18, 8, 13, 0.82);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 0.95rem;
}

.video-error { border-color: rgba(255, 154, 154, 0.55); color: var(--danger); }

.resume-btn {
    position: absolute;
    padding: 1rem 1.6rem;
    background: var(--brass);
    color: var(--brass-ink);
    border: 0;
    border-radius: 14px;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
}

.controls {
    display: grid;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem 0.9rem;
    background: var(--velvet-800);
}

.seek-row { display: flex; align-items: center; gap: 0.7rem; }
.seek-row .range { flex: 1; min-width: 0; }

.time {
    min-width: 3.2rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.time:last-child { text-align: right; }

.range { accent-color: var(--brass); height: 1.5rem; cursor: pointer; }
.range-volume { width: 5.5rem; flex: none; }

.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.spacer { flex: 1; }

.btn-play {
    min-width: 6.5rem;
    background: var(--brass);
    color: var(--brass-ink);
}

.btn-small {
    display: inline-grid;
    place-items: center;
    min-height: 2.75rem;
    padding: 0.4rem 0.8rem;
    background: var(--velvet-700);
    color: var(--text);
    border-color: var(--line);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-small:hover { border-color: var(--muted); }

.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.6rem;
}

.file-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

/* Во весь экран: настоящий режим браузера или запасной (для iPhone) */
.player:fullscreen,
.player.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 0;
}

.player:fullscreen .screen-area,
.player.is-fullscreen .screen-area { flex: 1; aspect-ratio: auto; }

@media (prefers-reduced-motion: reduce) {
    .ticket, .status[data-ok="false"] .dot, .btn { animation: none; transition: none; }
}

/* Когда человек уже в комнате, шапка компактнее: плеер и выбор озвучки видны без прокрутки */
.in-room .page { padding-top: 1.25rem; }
.in-room .masthead { margin-bottom: 1rem; }
.in-room .tagline { display: none; }
.in-room .brand { font-size: clamp(1.6rem, 6vw, 2rem); }

/* ---------- Выбор «фильм из библиотеки или свой файл» ---------- */
.empty-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.4rem; }

.empty-actions .btn-primary { width: auto; margin-top: 0; }

.empty-hint { margin: 0.6rem 0 0; color: #8d7580; font-size: 0.85rem; }

.select {
    min-height: 2.75rem;
    padding: 0.4rem 0.7rem;
    background: var(--velvet-700);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    font-size: 0.95rem;
}

.select:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.select:disabled { opacity: 0.55; }

/* ---------- Панель фильма под плеером ---------- */
.film-bar {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.85rem 0.95rem;
    background: var(--velvet-800);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.film-bar-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.film-bar-text { min-width: 0; flex: 1 1 12rem; }

.film-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.film-meta { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.9rem; }
.film-bar-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.film-pickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.6rem; }
.picker { display: grid; gap: 0.25rem; }
.picker-label { color: var(--muted); font-size: 0.85rem; }
.picker .select { width: 100%; }
.film-bar-note { margin: 0; color: #8d7580; font-size: 0.82rem; }

/* ---------- Каталог ---------- */
body.has-overlay { overflow: hidden; }

.catalog {
    position: fixed;
    inset: 0;
    z-index: 90;
    overflow-y: auto;
    background:
        radial-gradient(90% 35% at 50% -8%, #3b1b2b 0%, rgba(59, 27, 43, 0) 70%),
        var(--velvet-900); /* сплошной фон: страница комнаты под каталогом не просвечивает */
}

.catalog-inner { max-width: 70rem; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; }

.catalog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }

.catalog-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 700;
}

.catalog-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; }
.catalog-tools .input { grid-column: 1 / -1; } /* на телефоне поиск на всю ширину, два списка рядом */

@media (min-width: 40rem) {
    .catalog-tools { grid-template-columns: minmax(0, 1fr) auto auto; }
    .catalog-tools .input { grid-column: auto; }
}

.catalog-tools .input { min-height: 2.75rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.9rem; }

/* На телефоне жанры идут одной строкой, которую можно листать, а не занимают пол-экрана */
.catalog-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.5rem; }
.catalog-chips .chip { flex: none; }

@media (min-width: 40rem) {
    .catalog-chips { flex-wrap: wrap; overflow-x: visible; padding-bottom: 0; }
}

.chip {
    padding: 0.35rem 0.8rem;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 999px;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}

.chip:hover { border-color: var(--muted); }
.chip.is-active { background: var(--brass); color: var(--brass-ink); border-color: var(--brass); font-weight: 600; }
.chip:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.catalog-count { margin: 1rem 0 0.6rem; color: var(--muted); font-size: 0.9rem; min-height: 1.3em; }

.film-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 1.1rem 0.9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.film-card {
    display: grid;
    gap: 0.25rem;
    width: 100%;
    padding: 0;
    background: none;
    color: inherit;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.film-card:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; border-radius: 12px; }

.film-poster {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: linear-gradient(160deg, var(--velvet-700), #3a1a2a);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.film-card:hover .film-poster { transform: translateY(-3px); border-color: var(--muted); }
.film-card.is-current .film-poster { border-color: var(--brass); box-shadow: 0 0 0 2px var(--brass); }

.film-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }

.film-poster.is-placeholder {
    display: grid;
    place-items: center;
    color: var(--rose);
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
}

.film-card-title { margin-top: 0.35rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.film-card-meta { color: var(--muted); font-size: 0.85rem; }
.film-card-langs { color: var(--brass); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; }

.catalog-empty { margin: 1.5rem 0; padding: 1rem; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; }
.catalog-more { display: block; margin: 1.5rem auto 0; min-width: 12rem; }

/* ---------- Страница фильма ---------- */
.details-body { display: grid; gap: 1.25rem; margin-top: 1rem; }

@media (min-width: 40rem) {
    .details-body { grid-template-columns: 14rem minmax(0, 1fr); gap: 1.75rem; }
}

.details-poster { max-width: 14rem; }
.details-poster-box { width: 100%; }

.details-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 5vw, 2.3rem);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.details-original { margin: 0.2rem 0 0; color: var(--muted); font-style: italic; }
.details-meta { margin: 0.5rem 0 0; color: var(--muted); }
.rating-list, .tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.rating-list:empty, .tags:empty { display: none; }

.rating-badge {
    padding: 0.2rem 0.7rem;
    background: var(--brass);
    color: var(--brass-ink);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
}

.tag { padding: 0.2rem 0.7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 0.85rem; }
.details-description { margin: 1rem 0 0; max-width: 42rem; line-height: 1.55; }

.track-list { display: grid; grid-template-columns: auto 1fr; gap: 0.3rem 1rem; margin: 1rem 0 0; color: var(--muted); font-size: 0.95rem; }
.track-list dt { color: var(--text); }
.track-list dd { margin: 0; }

.details-text .btn-primary { width: auto; min-width: 14rem; margin-top: 1.5rem; }

/* ---------- Механика готовности и отсчета ---------- */
.person-status {
    margin-left: auto;
    font-size: 1.2rem;
    line-height: 1;
}

.ready-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.85rem 0.95rem;
    background: var(--velvet-800);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.ready-btn {
    min-width: 10rem;
    margin-top: 0;
    transition: background-color 0.2s, color 0.2s, filter 0.2s;
}

.ready-btn.is-ready {
    background: transparent;
    color: var(--ok);
    border-color: var(--ok);
}

.ready-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.countdown-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10;
    backdrop-filter: blur(4px);
}

.countdown-overlay span {
    font-family: var(--font-display);
    font-size: clamp(5rem, 20vw, 12rem);
    font-weight: 700;
    color: var(--brass);
    text-shadow: 0 4px 20px rgba(0,0,0,0.8);
    animation: pop 1s ease-out infinite;
}

@keyframes pop {
    0% { transform: scale(0.8); opacity: 0; }
    20% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.1); opacity: 0; }
}

/* ---------- Выбор режима комнаты ---------- */
.mode-selection {
    margin-bottom: 2rem;
}

.mode-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

@media (min-width: 40rem) {
    .mode-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.mode-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    background: var(--velvet-800);
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
    color: var(--text);
}

.mode-card:hover {
    border-color: var(--muted);
    background: var(--velvet-700);
}

.mode-card.is-active {
    border-color: var(--brass);
    box-shadow: 0 0 0 1px var(--brass);
    background: rgba(227, 171, 60, 0.05); /* Легкий золотистый оттенок */
}

.mode-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.mode-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.mode-desc {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.3;
}

.mode-card.is-active .mode-title {
    color: var(--brass);
}

.mode-card.is-active .mode-desc {
    color: var(--text);
}
/* ---------- Кликабельный заголовок и кнопка Назад ---------- */
.brand-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.brand-link:hover {
    opacity: 0.8;
}

.btn-back {
    display: inline-block;
    margin-bottom: 1.5rem;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-back:hover {
    color: var(--brass);
}
/* ---------- Выбор режима комнаты ---------- */
.mode-selection { margin-bottom: 2rem; }
.mode-cards { display: grid; grid-template-columns: 1fr; gap: 0.75rem; margin-top: 0.75rem; }
@media (min-width: 40rem) { .mode-cards { grid-template-columns: repeat(3, 1fr); } }
.mode-card {
    display: flex; flex-direction: column; align-items: flex-start; padding: 1rem;
    background: var(--velvet-800); border: 1px solid var(--line); border-radius: 14px;
    cursor: pointer; transition: all 0.2s ease; text-align: left; font-family: inherit; color: var(--text);
}
.mode-card:hover { border-color: var(--muted); background: var(--velvet-700); }
.mode-card.is-active { border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass); background: rgba(227, 171, 60, 0.05); }
.mode-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.mode-title { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.25rem; }
.mode-desc { font-size: 0.85rem; color: var(--muted); line-height: 1.3; }
.mode-card.is-active .mode-title { color: var(--brass); }
.mode-card.is-active .mode-desc { color: var(--text); }

.brand-link { color: inherit; text-decoration: none; cursor: pointer; transition: opacity 0.2s ease; }
.brand-link:hover { opacity: 0.8; }
.btn-back {
    display: inline-block; margin-bottom: 1.5rem; padding: 0; background: transparent;
    border: none; color: var(--muted); font-family: inherit; font-size: 0.95rem; cursor: pointer; transition: color 0.2s ease;
}
.btn-back:hover { color: var(--brass); }

/* ---------- Механика готовности и отсчета ---------- */
.person-status { margin-left: auto; font-size: 1.2rem; line-height: 1; }
.ready-bar {
    display: flex; align-items: center; gap: 1rem; margin-top: 0.75rem;
    padding: 0.85rem 0.95rem; background: var(--velvet-800); border: 1px solid var(--line); border-radius: 14px;
}
.ready-btn { min-width: 10rem; margin-top: 0; transition: background-color 0.2s, color 0.2s, filter 0.2s; }
.ready-btn.is-ready { background: transparent; color: var(--ok); border-color: var(--ok); }
.ready-hint { margin: 0; color: var(--muted); font-size: 0.9rem; }
.countdown-overlay {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: rgba(0, 0, 0, 0.65); z-index: 10; backdrop-filter: blur(4px);
}
.countdown-overlay span {
    font-family: var(--font-display); font-size: clamp(5rem, 20vw, 12rem); font-weight: 700;
    color: var(--brass); text-shadow: 0 4px 20px rgba(0,0,0,0.8); animation: pop 1s ease-out infinite;
}
@keyframes pop { 0% { transform: scale(0.8); opacity: 0; } 20% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }   