/* Mingle — dark theme by default (see the design doc's Interface section). */
/* Fonts are self-hosted (works offline). One family covers Latin, Cyrillic and Armenian;
   Noto Sans Armenian is drawn smaller than Noto Sans, so it is scaled up to match. */
@font-face {
    font-family: 'Mingle Sans'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('../fonts/noto-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Mingle Sans'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('../fonts/noto-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Mingle Sans'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('../fonts/noto-sans-cyrillic.woff2') format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Mingle Sans'; font-style: normal; font-weight: 100 900; font-display: swap;
    src: url('../fonts/noto-sans-armenian.woff2') format('woff2');
    unicode-range: U+0530-058F, U+FB13-FB17;
    size-adjust: 110%;
}

:root {
    --bg: #121216;
    --surface: #1C1C22;
    --surface-2: #22222A;
    --surface-hover: #2A2A33;
    --border: #2E2E36;
    --border-strong: #34343E;
    --border-dashed: #55555F;
    --text: #F2F1EE;
    --text-soft: #D6D5DC;
    --muted: #A8A7B0;
    --accent: #FF8A65;
    --accent-hover: #FF9A7A;
    --accent-text: #FF9A76;
    --on-accent: #1A1210;
    --accent-tint: #24191A;
    --accent-soft: #3A2620;
    --accent-soft-text: #FFC2AD;
    --danger: #FF8A8A;
    --radius: 16px;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    /* No double-tap zoom (a quick double tap while playing zoomed the page in); pinch to zoom still works. */
    touch-action: manipulation;
    background: var(--bg);
    color: var(--text);
    font-family: 'Mingle Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--accent-text); }
a:hover { color: #FFB79C; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.app {
    max-width: 480px;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.main {
    flex: 1;
    padding: 16px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.top { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 8px 12px 0; }
.top.spread { justify-content: space-between; padding-left: 20px; }

.foot {
    position: sticky;
    bottom: 0;
    /* Above the swipe cards (z-index 1), so a long card never covers the footer's buttons. */
    z-index: 2;
    padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
    border-top: 1px solid #26262E;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.foot.row { flex-direction: row; align-items: center; }

.stack { display: flex; flex-direction: column; gap: 8px; }
.push-down { margin-top: auto; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.center { text-align: center; }

.brand { font-size: 34px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.lang-pick {
    min-height: 40px; padding: 0 32px 0 12px; border-radius: 12px; cursor: pointer; font-size: 14px;
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong);
    appearance: none; -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat;
}
.h1 { font-size: 24px; line-height: 1.2; font-weight: 700; margin: 0; }
.h1.big { font-size: 30px; margin-top: 32px; }
.h2 { font-size: 17px; font-weight: 700; margin: 0; }
.label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 8px 0 0; }
.muted { color: var(--muted); font-size: 14px; margin: 0; }
.small { font-size: 13px; }
.lead { font-size: 16px; }
.row-title { font-size: 15px; font-weight: 700; }
.accent-text { color: var(--accent-text); font-weight: 700; }
.who { margin: 0; font-size: 15px; font-weight: 500; color: var(--text); }
.error { color: var(--danger); margin: 0 20px 16px; font-size: 14px; }
.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Buttons */
.btn, .btn2 {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 54px; padding: 0 18px; border-radius: var(--radius);
    font-size: 17px; text-decoration: none; cursor: pointer;
}
.btn { background: var(--accent); color: var(--on-accent); font-weight: 700; border: 0; }
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:disabled { background: #2A2A33; color: #8A8992; cursor: not-allowed; }
.btn2 { background: var(--surface-2); color: var(--text); font-weight: 500; border: 1px solid var(--border-strong); }
.btn2:hover { background: var(--surface-hover); color: var(--text); }
.text-btn { background: none; border: 0; color: var(--accent-text); min-height: 44px; padding: 0 8px; cursor: pointer; font-size: 15px; }
.icon {
    width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; color: var(--text); background: transparent; border: 0; text-decoration: none; cursor: pointer;
}
.icon:hover { background: var(--surface-2); color: var(--text); }
.ghost {
    display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    min-height: 44px; padding: 0 16px; border-radius: 22px; cursor: pointer;
    background: transparent; color: var(--accent-text); border: 1px dashed var(--border-dashed); font-size: 15px;
}
.ic { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
/* Uppercasing Armenian turns the ligature «և» into «ԵՒ», so Armenian labels keep their case. */
:lang(hy) .label, :lang(hy) .kind { text-transform: none; letter-spacing: .02em; }

.row.gap { display: flex; gap: 8px; }
.confirm {
    margin: 8px 20px 0; padding: 16px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px;
    background: var(--surface); border: 1px solid var(--accent);
}

/* Online rooms */
.code-field { font-size: 28px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; text-align: center; }
.room-code-card { align-items: stretch; gap: 10px; }
.room-code { margin: 0; font-size: 44px; font-weight: 700; letter-spacing: .18em; text-align: center; }
.player-line { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.player-line.away { opacity: 0.55; }
.lang-tag { font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 8px; padding: 3px 7px; }
.card.waiting { align-items: center; text-align: center; padding: 24px; gap: 6px; }
.banner-warn { margin: 0; padding: 10px 20px; background: var(--accent-soft); color: var(--accent-soft-text); font-size: 14px; text-align: center; }
.error-inline { color: var(--danger); margin: 0; font-size: 14px; }

/* Cards and surfaces */
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px;
    display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text);
}
.card.banner { flex-direction: row; align-items: center; justify-content: space-between; border-color: var(--accent); }
.card.banner:hover { color: var(--text); }
.card.soon { color: var(--muted); font-size: 14px; border-style: dashed; }
.card.handoff { gap: 8px; padding: 20px; }

.card-face {
    background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 24px;
    display: flex; flex-direction: column; gap: 12px;
}
.card-face.compact { padding: 18px 20px; gap: 8px; }
.kind { font-size: 12px; font-weight: 700; color: var(--accent-soft-text); text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.prompt { font-size: 26px; line-height: 1.3; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.card-face.compact .prompt { font-size: 20px; }
.options { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.options li { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-strong); font-size: 16px; }

/* Setup */
.player-row { display: flex; gap: 8px; align-items: center; }
.field {
    width: 100%; min-height: 52px; border-radius: 14px; background: var(--surface);
    border: 1px solid var(--border-strong); color: var(--text); font-family: inherit; font-size: 16px; padding: 12px 14px;
}
.field::placeholder { color: #8A8992; }
.lang-select { width: 84px; flex: none; }
.area { min-height: 120px; resize: vertical; line-height: 1.4; }

.two { display: flex; gap: 8px; }
.option, .tile, .check-row {
    display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
    color: var(--text);
}
.option { flex: 1; min-height: 112px; }
.option.on, .tile.on, .check-row.on { border: 2px solid var(--accent); background: var(--accent-tint); padding: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { min-height: 84px; padding: 12px; }
.tile.on { padding: 11px; }
.check-row { flex-direction: row; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; }
.check-row.on { padding: 9px 13px; }
.box {
    flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border-dashed);
    display: flex; align-items: center; justify-content: center; color: var(--on-accent);
}
.box.on { background: var(--accent); border-color: var(--accent); }
.box.round { border-radius: 50%; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 22px; cursor: pointer;
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); font-size: 15px;
}
.chip.on { background: var(--accent-soft); color: var(--accent-soft-text); border-color: var(--accent); }

.segs { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px; gap: 4px; }
.seg { flex: 1; min-height: 44px; border-radius: 10px; background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 15px; }
.seg.on { background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 700; }

/* Answering */
.choice {
    min-height: 60px; padding: 12px 16px; border-radius: var(--radius); cursor: pointer; text-align: left;
    background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); font-size: 17px;
}
.choice:hover { border-color: var(--accent); }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.scale-btn {
    min-height: 56px; border-radius: 14px; cursor: pointer; font-size: 20px; font-weight: 700;
    background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
}
.scale-btn:hover { border-color: var(--accent); }

/* Reveal */
.answer { display: flex; gap: 12px; align-items: flex-start; background: #1A1A20; border: 1px solid #2A2A32; border-radius: 18px; padding: 14px 16px; }
.answer.real { border: 2px solid var(--accent); padding: 13px 15px; }
.avatar {
    flex: none; width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent-soft-text); font-weight: 700;
}
.answer-text { font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.scale-value { font-size: 22px; font-weight: 700; }
.tally { display: flex; flex-direction: column; gap: 6px; background: #1A1A20; border: 1px solid #2A2A32; border-radius: 18px; padding: 14px 16px; }
.tally-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.bar { height: 10px; border-radius: 5px; background: #2E2E36; overflow: hidden; }
.fill { height: 10px; border-radius: 5px; background: var(--accent); }
.talk { text-align: center; margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.react {
    width: 54px; height: 54px; flex: none; border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-soft); cursor: pointer;
}
.react.on { background: var(--accent-soft); border: 2px solid var(--accent); color: var(--accent-soft-text); }

/* Blazor shell */
.loading-progress { position: absolute; display: block; width: 6rem; height: 6rem; inset: 20vh 0 auto 0; margin: 0 auto; }
.loading-progress circle { fill: none; stroke: #2E2E36; stroke-width: 0.5rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child {
    stroke: var(--accent);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text { position: absolute; text-align: center; font-weight: bold; inset: calc(20vh + 3.25rem) 0 auto 0.2rem; color: var(--muted); }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

#blazor-error-ui {
    background: #3A2620; color: var(--text); bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.4);
    display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* "Our topics": waiting while the cards are written */
.center-screen { justify-content: center; align-items: center; text-align: center; gap: 12px; min-height: 60vh; }
.spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 3px solid var(--border-dashed); border-top-color: var(--accent);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.chip:disabled { opacity: 0.45; }

/* Deck editor */
.check-row.incomplete { border-style: dashed; }
.btn.danger { background: #C2412F; border-color: #C2412F; color: #fff; }
.spinner.small { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: -3px; margin-right: 8px; }

/* Compact icon switches (how you play) */
.seg-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 14px; padding: 3px; gap: 3px; }
.seg button {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 6px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font: inherit; font-size: 13px;
}
.seg button.on { background: var(--accent-soft); color: var(--accent-soft-text); }

/* Bottom sheet (save as deck) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 20; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 560px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 12px; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border); border-radius: 20px 20px 0 0;
}
.text-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
    background: transparent; border: 0; padding: 4px 0; color: inherit; font: inherit;
}

/* Deck editor: ways to add cards under the list */
.add-row { display: flex; flex-direction: column; gap: 8px; }
.sheet.tall { max-height: 88vh; overflow-y: auto; }

/* Deck editor: the remove button sits in the middle of its card row */
.card-line { align-items: center; }
.card-line > .icon { flex: none; }

/* Swipe left to uncover Edit / Delete (My decks, the deck editor's cards) */
/* isolation keeps the card's z-index inside its row, so cards never cover the sticky "Save" footer. */
.swipe-row { position: relative; isolation: isolate; touch-action: pan-y; border-radius: var(--radius); overflow: hidden; }
.swipe-row .swipe-content { position: relative; z-index: 1; width: 100%; will-change: transform; }
.swipe-row.swiping .swipe-content { cursor: grabbing; }
.undo-bar {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}

/* Dropdowns: our own chevron, inset like the text instead of the browser's arrow against the edge */
select.field {
    appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A8A7B0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
select.field.lang-select { padding-right: 32px; background-position: right 10px center; }

/* The actions a swipe uncovers */
/* Inset by the card's border and rounded like its right side, so the buttons stay hidden under a closed
   card even at its rounded corners. */
.swipe-row .swipe-actions {
    position: absolute; top: 1px; right: 1px; bottom: 1px; display: flex; opacity: 0; overflow: hidden;
    border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0;
}
.swipe-row.swiping .swipe-actions, .swipe-row.open .swipe-actions { opacity: 1; }
.swipe-action {
    width: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border: 0; color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.swipe-action.edit { background: #4A4A55; }
.swipe-action.delete { background: #C2412F; }

a.check-row { text-decoration: none; color: inherit; }

/* No text selection or link dragging while swiping a row */
.swipe-row .swipe-content { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }

/* While a row is swiped or open, the card's right side meets the actions flush, without a notch. */
.swipe-row.swiping .swipe-content, .swipe-row.open .swipe-content {
    border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-color: transparent;
}

/* Swipeable pages with dots (topic groups in the deck editor) */
.pager-pages {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
.pager-pages::-webkit-scrollbar { display: none; }
.pager-page { flex: 0 0 100%; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.pager-dots { display: flex; justify-content: center; gap: 8px; padding-top: 10px; }
.pager-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--border-dashed); cursor: pointer; }
.pager-dot.on { background: var(--accent); width: 20px; border-radius: 4px; }

/* Theme tabs above the topic pages; every page keeps the height of the tallest */
/* Only sideways scrolling: on iPhone a row that can also scroll a pixel up and down ends up showing half its labels. */
.pager-tabs {
    display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; flex-shrink: 0; scrollbar-width: none;
    touch-action: pan-x; overscroll-behavior: contain; margin-bottom: 10px; box-shadow: inset 0 -1px 0 var(--border);
}
.pager-tabs::-webkit-scrollbar { display: none; }
.pager-tab {
    flex: none; padding: 8px 10px 9px; border: 0; border-bottom: 2px solid transparent; white-space: nowrap; line-height: 1.3;
    background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.pager-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.pager-pages { align-items: stretch; }

/* Topic chips sit centered on each page */
.pager-page .chips { justify-content: center; }
.chips.centered { justify-content: center; }

/* Blitz */
.edge-timer { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; }
/* Non-scaling stroke: the bar stays 4px on every side even if the viewBox and the screen differ a little. */
.edge-timer path { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.edge-timer .track { stroke: rgba(255, 255, 255, 0.07); }
.edge-timer .bar {
    stroke: var(--accent); filter: drop-shadow(0 0 6px rgba(255, 138, 101, 0.55));
    stroke-dasharray: 100 100; stroke-dashoffset: 0;
    animation-name: edge-shrink, edge-hurry; animation-timing-function: linear; animation-fill-mode: forwards;
}
/* Shrinks back to the top; turns red in the last stretch so the end is felt, not just seen. */
@keyframes edge-shrink { to { stroke-dashoffset: 100; } }
@keyframes edge-hurry { 0%, 70% { stroke: #FF8A65; } 100% { stroke: #E5484D; } }
@media (prefers-reduced-motion: reduce) { .edge-timer .bar { animation-timing-function: steps(5); filter: none; } }
.blitz-name { font-size: 40px; font-weight: 800; margin: 0; }
.blitz-countdown { font-size: 96px; font-weight: 800; margin: 0; color: var(--accent); }
.blitz-card { font-size: 44px; font-weight: 800; text-align: center; margin: 0; line-height: 1.15; overflow-wrap: anywhere; }
.blitz-clock { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.blitz-score { flex-direction: row; align-items: center; }
.blitz-letter { font-size: 72px; font-weight: 800; line-height: 1; color: var(--accent); margin: 4px 0 0; }
.blitz-count { font-size: 28px; font-weight: 800; color: var(--accent); }
.btn.blitz-yes { min-height: 64px; font-size: 20px; }
/* .grow stacks its children; a growing button keeps its icon beside the label. */
.btn.grow, .btn2.grow { flex-direction: row; gap: 8px; }

/* One-phone choice with four options: two by two */
.seg.grid2 { display: grid; grid-template-columns: 1fr 1fr; }

/* Fill-in stories */
.story-hint { font-size: 36px; font-weight: 800; margin: 0; color: var(--accent); text-align: center; }
.story-entry { width: 100%; max-width: 420px; }
.story-entry .field { font-size: 20px; text-align: center; }
.story-text { font-size: 21px; line-height: 1.6; margin: 0; }
.story-word { background: var(--accent-soft); color: var(--accent-soft-text); padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.story-gap {
    display: inline-block; padding: 0 8px; border-radius: 999px; border: 1px dashed var(--accent);
    color: var(--accent); font-size: 0.8em; font-weight: 700; line-height: 1.7;
}
.story-gap.repeat { border-style: solid; background: var(--accent-soft); color: var(--accent-soft-text); }
/* The Armenian ending the reader adds to the shouted word: «վայր -ի» → «այգու». */
.story-gap .gap-ending { margin-left: 3px; opacity: 0.7; font-weight: 500; }

/* Give it to… */
.seg.grid2 .wide { grid-column: 1 / -1; }
.handoff-players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; margin-top: 8px; }
.handoff-choices { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 8px; }
.handoff-choices .btn2 { min-height: 56px; white-space: normal; text-align: center; line-height: 1.3; padding: 10px 14px; }
.handoff-verdict { font-size: 22px; font-weight: 800; }
.handoff-verdict.right { color: var(--accent); }
.handoff-verdict.wrong { color: var(--muted); }
.handoff-reason { margin: 0; line-height: 1.4; }
.coin {
    width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-soft-text); border: 3px solid var(--accent);
    font-size: 48px; font-weight: 800; margin: 12px auto;
}
/* The coin toss: a two-faced coin that wobbles while waiting, then flies up, spins and lands on its result. */
.coin-stage { position: relative; height: 300px; width: 100%; display: grid; justify-items: center; align-items: end; padding-bottom: 36px; perspective: 900px; }
.coin3d { width: 132px; height: 132px; position: relative; transform-style: preserve-3d; animation: coin-wait 2.6s ease-in-out infinite; }
.coin3d .face {
    position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 13px; font-weight: 800; letter-spacing: 0.02em;
    border: 5px solid rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 0 0 7px rgba(0, 0, 0, 0.1), inset 0 -10px 18px rgba(0, 0, 0, 0.18), 0 10px 26px rgba(0, 0, 0, 0.35);
}
.coin3d .heads { background: radial-gradient(circle at 35% 28%, #ffe2bd, var(--accent) 58%, #a9512c); color: #3b1607; }
.coin3d .tails { background: radial-gradient(circle at 35% 28%, #e3e3ea, #8e8e9c 58%, #4b4b57); color: #17171d; transform: rotateX(180deg); }
.coin3d.toss-heads { animation: coin-toss-heads 1.7s cubic-bezier(0.25, 0.7, 0.35, 1) forwards; }
.coin3d.toss-tails { animation: coin-toss-tails 1.7s cubic-bezier(0.25, 0.7, 0.35, 1) forwards; }
.coin-shadow { position: absolute; bottom: 18px; width: 112px; height: 16px; border-radius: 50%; background: rgba(0, 0, 0, 0.5); filter: blur(5px); }
.coin-shadow.toss-heads, .coin-shadow.toss-tails { animation: coin-shadow 1.7s cubic-bezier(0.25, 0.7, 0.35, 1) forwards; }
.coin-landed { font-size: 22px; font-weight: 800; color: var(--accent); }
@keyframes coin-wait { 0%, 100% { transform: rotateY(-14deg) rotateX(6deg); } 50% { transform: rotateY(14deg) rotateX(-6deg); } }
@keyframes coin-toss-heads {
    0% { transform: translateY(0) rotateX(0) scale(1); }
    45% { transform: translateY(-130px) rotateX(900deg) scale(1.18); }
    82% { transform: translateY(0) rotateX(1800deg) scale(1); }
    90% { transform: translateY(-16px) rotateX(1800deg) scale(1.02); }
    100% { transform: translateY(0) rotateX(1800deg) scale(1); }
}
@keyframes coin-toss-tails {
    0% { transform: translateY(0) rotateX(0) scale(1); }
    45% { transform: translateY(-130px) rotateX(990deg) scale(1.18); }
    82% { transform: translateY(0) rotateX(1980deg) scale(1); }
    90% { transform: translateY(-16px) rotateX(1980deg) scale(1.02); }
    100% { transform: translateY(0) rotateX(1980deg) scale(1); }
}
@keyframes coin-shadow {
    0% { transform: scale(1); opacity: 0.5; }
    45% { transform: scale(0.4); opacity: 0.15; }
    82%, 100% { transform: scale(1); opacity: 0.5; }
}
@media (prefers-reduced-motion: reduce) {
    .coin3d, .coin-shadow { animation: none !important; }
    .coin3d.toss-tails { transform: rotateX(180deg); }
}

/* Deck badges: which game a deck is for. */
.deck-badge { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--accent-soft-text); }
.deck-badge.blitz { background: rgba(255, 196, 77, 0.16); color: #ffc44d; }
.deck-badge.handoff { background: rgba(160, 140, 255, 0.16); color: #b9adff; }

/* Fact games */
.deck-badge.facts { background: rgba(255, 214, 102, 0.16); color: #ffd666; }
.fact-prompt { gap: 6px; }
.fact-prompt .text-btn { align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; padding: 0; }
.fact-input { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.fact-input.marked { border-color: var(--accent); }
.fact-input .chip { align-self: flex-start; }
.fact-input .field.area { min-height: 64px; }
.fact-list { display: flex; flex-direction: column; gap: 10px; }
.fact-item { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 14px 16px; border-radius: 14px;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 17px; line-height: 1.35; }
button.fact-item { cursor: pointer; }
.fact-item.picked { border-color: var(--accent); background: var(--accent-soft); }
.fact-item.answer { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.fact-item.other { opacity: 0.6; }
.fact-no { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2);
    color: var(--muted); font-size: 14px; font-weight: 700; }
.fact-item.answer .fact-no { background: var(--accent); color: var(--on-accent); }
.fact-tag { color: var(--accent-text); font-weight: 700; font-size: 14px; }
.stack-tight { display: flex; flex-direction: column; gap: 4px; }
.fact-big { padding: 24px 20px; font-size: 24px; font-weight: 700; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.btn2.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-soft-text); }
.vote-line { margin: 0; color: var(--muted); }
.vote-line.right { color: var(--text); font-weight: 600; }
.scoreboard { margin-top: 8px; }
.score-line { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface); }
.score-points { font-weight: 800; font-size: 18px; min-width: 2ch; text-align: right; }
.card.award { gap: 4px; }

/* Guess the answer */
.deck-badge.guess { background: rgba(102, 214, 255, 0.16); color: #7fdcff; }
.guess-answer { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left; width: 100%; padding: 12px 16px;
    border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 17px; }
button.guess-answer { cursor: pointer; }
.guess-answer.real { border-color: var(--accent); background: var(--accent-soft); }
.guess-answer.right { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* Who got a different question? */
.deck-badge.odd { background: rgba(255, 120, 160, 0.16); color: #ff9dbb; }
.deck-badge.match { background: rgba(140, 230, 140, 0.16); color: #9be79b; }
.odd-question { font-size: 30px; }
.odd-card { border-color: var(--accent); }
.deck-badge.never { background: rgba(255, 150, 80, 0.18); color: #ffb37a; }

/* Swipe cards: swipe the card any way instead of tapping a button (js/cardswipe.js). */
.swipe-card { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; will-change: transform; }
.swipe-card.dragging { cursor: grabbing; }
.swipe-card.entering { animation: card-in 0.22s ease-out; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }

/* The deck: one big card in the middle of the screen, two more peeking out behind it. */
.swipe-deck { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 4px 0 22px; }
.swipe-stack { position: relative; --pull: 0; }
/* Two full-size cards behind the top one, the back of a card. While the top card is dragged away (--pull 0 → 1,
   set by js/cardswipe.js) the next one grows into its place. */
.swipe-stack::before, .swipe-stack::after {
    content: "Mingle"; position: absolute; inset: 0; border-radius: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800; letter-spacing: .04em; color: var(--border-dashed);
    background: var(--surface); border: 1px solid var(--border);
}
.swipe-stack::after {
    transform: translateY(calc(14px * (1 - var(--pull)))) scale(calc(0.95 + 0.05 * var(--pull)));
    opacity: calc(0.85 + 0.15 * var(--pull));
}
.swipe-stack::before { transform: translateY(26px) scale(0.9); opacity: 0.45; color: transparent; }
.swipe-stack .swipe-card { position: relative; z-index: 1; }
.swipe-deck .card-face { position: relative; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
.swipe-deck .card-face:not(.compact) { min-height: min(56dvh, 520px); justify-content: center; padding: 56px 24px 28px; gap: 18px; }
.swipe-deck .card-face:not(.compact) .kind { position: absolute; top: 24px; left: 24px; right: 24px; }
.swipe-deck .card-face:not(.compact) .prompt { font-size: 30px; }
/* The first card ever: a gentle side-to-side nudge, until the first real swipe. */
.swipe-card.hint { animation: card-nudge 1.6s ease-in-out 0.8s 2; }
@keyframes card-nudge {
    0%, 100% { transform: none; }
    25% { transform: translateX(-26px) rotate(-2deg); }
    55% { transform: translateX(20px) rotate(1.5deg); }
    80% { transform: translateX(-6px); }
}
/* The real next card under the top one (instead of the back of a card), growing into place while dragged. */
.swipe-next {
    position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 24px;
    transform: translateY(calc(14px * (1 - var(--pull)))) scale(calc(0.95 + 0.05 * var(--pull)));
    opacity: calc(0.6 + 0.4 * var(--pull));
}
.swipe-next .card-face { height: 100%; box-sizing: border-box; }
.swipe-deck .swipe-next .card-face { min-height: 0; justify-content: center; padding: 56px 24px 28px; gap: 18px; }
.swipe-deck .swipe-next .card-face .kind { position: absolute; top: 24px; left: 24px; right: 24px; }
.swipe-next .prompt { font-size: 30px; }
.swipe-stack.has-next::after { content: none; }
/* The new top card is the one that was already showing underneath: no slide-in. */
.swipe-stack.has-next > .swipe-card.entering { animation: none; }
/* A panel of results to swipe on (fact games, guesses, votes): a card that sizes to its content. */
.swipe-deck .card-face.swipe-panel { min-height: 0; padding: 22px 20px; justify-content: flex-start; gap: 14px; }
.swipe-deck .card-face.swipe-panel .kind { position: static; }
.swipe-deck .card-face.swipe-panel .prompt { font-size: 24px; }
/* Blitz: right is "got it" (green edge), left is "skip" (grey). */
.swipe-card[data-dir="right"] .card-face { border-color: #3fbf6f; box-shadow: 0 0 0 2px #3fbf6f inset, 0 12px 32px rgba(0, 0, 0, 0.35); }
.swipe-card[data-dir="left"] .card-face { border-color: var(--border-dashed); opacity: 0.85; }
.card-face.blitz-face { align-items: center; text-align: center; }
/* The last card: nothing underneath. */
.swipe-stack.last::before, .swipe-stack.last::after { content: none; }
/* A footer whose buttons are all hidden takes no room. */
.foot:not(:has(*)) { display: none; }
/* While a swipe card is on screen the page holds still: no rubber-band bounce or pull-to-refresh, and touches
   outside the card don't drag the page around (html.swipe-page is set by js/cardswipe.js). */
html.swipe-page, html.swipe-page body { overscroll-behavior: none; }
html.swipe-page .main { touch-action: manipulation; }
/* A card inside a swipe panel (the question in Guess the answer, the statement in Ես երբեք…) is part of the panel,
   not a second card: flat, and never stretched to fill the screen. */
.swipe-deck .swipe-panel .card-face {
    min-height: 0; padding: 0; gap: 10px; background: transparent; border: 0; box-shadow: none; justify-content: flex-start;
}
.swipe-deck .swipe-panel .card-face .kind { position: static; }
.swipe-deck .swipe-panel .card-face .prompt { font-size: 26px; }
.handoff-players .btn2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 10px; padding-right: 10px; }
.options.compact { gap: 6px; }
.options.compact li { padding: 8px 12px; font-size: 15px; }
/* A results panel as the next card underneath: laid out like the panel on top. */
.swipe-deck .swipe-next .card-face.swipe-panel { padding: 22px 20px; justify-content: flex-start; gap: 14px; }
.swipe-next .swipe-panel .prompt { font-size: 26px; }
.swipe-next .handoff-players .btn2 { display: flex; align-items: center; justify-content: center; }
/* Every swipe card is the same size: it fills the free space on the screen (up to a playing-card height on big
   screens), so it never grows or shrinks between cards or when an answer is revealed. Shorter content sits in the
   middle of the same box; only content taller than the screen makes it grow. */
.swipe-deck { justify-content: center; min-height: 0; }
.swipe-stack { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 320px; max-height: 640px; }
.swipe-stack .swipe-card { flex: 1 1 auto; display: flex; flex-direction: column; }
.swipe-stack .swipe-card > .card-face { flex: 1 1 auto; }
.swipe-deck .card-face:not(.compact) { min-height: 0; }
.swipe-deck .card-face.swipe-panel, .swipe-deck .swipe-next .card-face.swipe-panel { justify-content: center; }
.swipe-deck .card-face.compact { justify-content: center; }
/* On a swipe screen the footer keeps the room of one button even when it has none (a "Done" or "Reveal" button
   that goes away after the reveal), so the card above never changes size. */
html.swipe-page .foot { min-height: calc(12px + 54px + 20px + env(safe-area-inset-bottom) + 1px); }
html.swipe-page .foot:not(:has(*)) { display: flex; border-top-color: transparent; }

/* How you see me: a scale from one end (1) to the other (10). */
.deck-badge.mirror { background: rgba(170, 140, 255, 0.18); color: #c3b2ff; }
.mirror-who { display: flex; gap: 12px; align-items: center; }
.avatar.big { width: 48px; height: 48px; border-radius: 24px; font-size: 20px; }
.mirror-ends { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 4px;
    font-size: 22px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.mirror-ends span:last-child { text-align: right; }
.mirror-arrow { flex: none; color: var(--accent); font-size: 26px; }
.mirror-scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.mirror-step {
    /* From the cool end (1) to the warm end (10), so the scale reads at a glance. */
    --c: color-mix(in srgb, #8c7bff calc((1 - var(--t)) * 100%), var(--accent));
    min-height: 52px; padding: 0; border-radius: 10px; cursor: pointer; font: inherit; font-size: 17px; font-weight: 800;
    color: var(--text); background: color-mix(in srgb, var(--c) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent);
    transition: transform .12s ease, background .12s ease;
}
.mirror-step:hover { border-color: var(--c); }
.mirror-step.on { background: var(--c); color: var(--on-accent); transform: scale(1.12); box-shadow: 0 4px 14px color-mix(in srgb, var(--c) 45%, transparent); }
.mirror-legend { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.mirror-legend span:last-child { text-align: right; }
.mirror-track { position: relative; height: 84px; margin: 4px 14px 0; }
.mirror-line { position: absolute; left: 0; right: 0; top: 44px; height: 6px; border-radius: 3px;
    background: linear-gradient(90deg, #8c7bff, var(--accent)); }
.mirror-dot, .mirror-self, .mirror-avg { position: absolute; transform: translateX(-50%); }
.mirror-dot { top: calc(56px + var(--row) * 18px); width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-soft);
    animation: mirror-pop .35s ease-out both; }
.mirror-self { top: 0; font-size: 28px; animation: mirror-drop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.mirror-avg { top: 2px; font-size: 22px; opacity: .9; animation: mirror-drop .5s .15s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes mirror-pop { from { opacity: 0; transform: translateX(-50%) scale(.4); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes mirror-drop { from { opacity: 0; transform: translateX(-50%) translateY(-18px); } to { opacity: 1; transform: translateX(-50%); } }
.mirror-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.mirror-stat { align-items: center; gap: 0; padding: 8px; }
.mirror-num { font-size: 28px; font-weight: 800; }
.mirror-verdict { margin: 0; text-align: center; font-size: 19px; font-weight: 700; }
.mirror-moment { gap: 2px; }

/* Life auction: coins, a secret bid, and the hammer. */
.deck-badge.auction { background: rgba(255, 205, 80, 0.18); color: #ffd666; }
.swipe-deck .card-face.swipe-panel .prompt.auction-lot { font-size: 22px; }
.auction-wallet { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.auction-coins { font-size: 20px; font-weight: 800; color: #ffd666; }
.auction-bid { margin: 0; text-align: center; font-size: 38px; font-weight: 800; color: #ffd666; }
.auction-of { font-size: 18px; font-weight: 600; color: var(--muted); }
.auction-range { width: 100%; accent-color: #ffd666; height: 28px; margin: 0; }
/* The quick amounts on one row, even on a narrow phone. */
.auction-chips { display: flex; gap: 6px; }
.auction-chips .chip { flex: 1 1 0; min-width: 0; padding-left: 4px; padding-right: 4px; justify-content: center; text-align: center; }
.auction-chips .chip:last-child { flex-grow: 1.8; }
.auction-result { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 10px; padding: 12px 14px;
    border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); text-align: center; }
.auction-result .label { margin: 0; }
.auction-winner { font-size: 20px; font-weight: 800; }
.auction-result.sold { border-color: #ffd666; background: rgba(255, 205, 80, 0.10); animation: auction-hammer .45s ease-out; }
@keyframes auction-hammer { 0% { transform: scale(.85) rotate(-3deg); opacity: 0; } 60% { transform: scale(1.04) rotate(1deg); opacity: 1; } 100% { transform: none; } }
/* One player per short line: name, bid bar, bid, coins left. */
.auction-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid transparent; }
.auction-row.won { border-color: #ffd666; }
.auction-row-name { flex: 0 1 auto; min-width: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auction-row-bar { flex: 1; height: 6px; border-radius: 3px; background: #2E2E36; overflow: hidden; }
.auction-row-bar span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.auction-row.won .auction-row-bar span { background: #ffd666; }
.auction-row-bid { font-weight: 800; min-width: 2ch; text-align: right; }
.auction-row-left { color: var(--muted); font-size: 14px; white-space: nowrap; }
.auction-purse { align-items: flex-start; }
.auction-won { font-size: 14px; color: var(--text-soft); overflow-wrap: anywhere; }
