body.game-page {
    min-height: 100dvh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 16% 8%, rgba(124, 58, 237, 0.3), transparent 34rem),
        radial-gradient(circle at 82% 18%, rgba(249, 115, 22, 0.2), transparent 30rem),
        linear-gradient(145deg, #0b1022, var(--bg));
    color: var(--text);
}

body.game-page.light-theme {
    background:
        radial-gradient(circle at 16% 8%, rgba(167, 139, 250, 0.3), transparent 34rem),
        radial-gradient(circle at 82% 18%, rgba(251, 146, 60, 0.24), transparent 30rem),
        linear-gradient(145deg, #fff7ed, #eef2ff);
}

.game-app button {
    font-family: "Ciname", sans-serif;
}

/* ---------------------------------------------------------------
   Shell
--------------------------------------------------------------- */
.game-shell {
    width: min(96vw, 1160px);
    margin-inline: auto;
    padding: 10px 14px calc(18px + env(safe-area-inset-bottom));
}

.game-shell.play-screen {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 100px);
    min-height: calc(100svh - 100px);
}

.section-title,
.eyebrow,
.field-label,
.time-badge,
.modal li {
    font-family: "Nazanin", sans-serif;
}

/* ---------------------------------------------------------------
   Panels — chunky clay cards
--------------------------------------------------------------- */
.panel {
    background: var(--panel);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    box-shadow:
        inset 2px 2px 8px rgba(255, 255, 255, 0.07),
        inset -3px -3px 12px rgba(0, 0, 0, 0.3),
        var(--shadow);
}

body.light-theme .panel {
    border-color: rgba(109, 40, 217, 0.14);
    box-shadow:
        inset 2px 2px 8px rgba(255, 255, 255, 0.55),
        inset -3px -3px 12px rgba(70, 43, 124, 0.1),
        var(--shadow);
}

.setup-panel,
.teams-panel,
.score-panel,
.word-panel,
.results-card {
    padding: clamp(18px, 2.4vw, 34px);
}

.setup-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-title h1,
.section-title p {
    margin-bottom: 0;
}

.section-title p {
    color: var(--muted);
    font-size: clamp(0.9rem, 1.4vw, 1.15rem);
}

/* ---------------------------------------------------------------
   Form
--------------------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.field-label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

.field {
    width: 100%;
    min-height: 54px;
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px 14px;
    background: var(--bg-soft);
    color: var(--text);
    outline: none;
    direction: rtl;
    box-shadow:
        inset 2px 2px 6px rgba(255, 255, 255, 0.05),
        inset -2px -2px 8px rgba(0, 0, 0, 0.22);
    transition: border-color 0.2s, box-shadow 0.2s;
}

body.light-theme .field {
    border-color: rgba(109, 40, 217, 0.12);
    box-shadow:
        inset 2px 2px 6px rgba(255, 255, 255, 0.6),
        inset -2px -2px 8px rgba(70, 43, 124, 0.08);
}

.field:focus {
    border-color: var(--accent);
    box-shadow:
        0 0 0 3px rgba(167, 139, 250, 0.18),
        inset 2px 2px 6px rgba(255, 255, 255, 0.05),
        inset -2px -2px 8px rgba(0, 0, 0, 0.22);
}

.custom-words {
    resize: vertical;
    min-height: 118px;
}

/* ---------------------------------------------------------------
   Team editor
--------------------------------------------------------------- */
.team-list-editor {
    display: grid;
    gap: 10px;
}

.team-editor {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: center;
}

.team-number {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--panel-strong);
    border: 2px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 2px 2px 5px rgba(255, 255, 255, 0.07),
        inset -2px -2px 8px rgba(0, 0, 0, 0.26);
}

.color-swatch-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-swatch {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid rgba(255, 255, 255, 0.55);
    display: block;
    flex-shrink: 0;
    box-sizing: border-box;
    box-shadow:
        inset -2px -2px 6px rgba(0, 0, 0, 0.35),
        inset 2px 2px 6px rgba(255, 255, 255, 0.5),
        0 4px 10px rgba(0, 0, 0, 0.25);
    touch-action: manipulation;
    transition: transform 0.2s ease-out;
}

body.light-theme .color-swatch {
    border-color: rgba(255, 255, 255, 0.9);
}

.color-swatch:active {
    transform: scale(0.92);
}

.color-picker {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.setup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.setup-error {
    font-family: "Nazanin", sans-serif;
    font-size: 0.9rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 12px;
    padding: 10px 14px;
}

/* ---------------------------------------------------------------
   Scoreboard
--------------------------------------------------------------- */
.score-list {
    display: grid;
    gap: 10px;
}

.score-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border: 2px solid transparent;
    border-radius: 18px;
    background: var(--panel-strong);
    box-shadow:
        inset 2px 2px 5px rgba(255, 255, 255, 0.07),
        inset -2px -2px 8px rgba(0, 0, 0, 0.26),
        0 4px 12px rgba(0, 0, 0, 0.16);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

body.light-theme .score-row {
    box-shadow:
        inset 2px 2px 5px rgba(255, 255, 255, 0.6),
        inset -2px -2px 8px rgba(70, 43, 124, 0.09),
        0 4px 12px rgba(70, 43, 124, 0.08);
}

.score-row-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    font-size: clamp(1.05rem, 2vw, 1.4rem);
}

.score-row-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--bg-soft);
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.score-progress {
    height: 100%;
    border-radius: 999px;
    background: var(--team-color);
    transition: width 0.3s ease;
}

.time-badge {
    font-size: 0.85rem;
    color: var(--muted);
    direction: ltr;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.time-badge svg {
    width: 14px;
    height: 14px;
}

.score-row.active {
    outline: 3px solid var(--team-color);
    background: color-mix(in srgb, var(--team-color) 20%, transparent);
    box-shadow:
        0 0 18px color-mix(in srgb, var(--team-color) 30%, transparent),
        inset 2px 2px 5px rgba(255, 255, 255, 0.06),
        inset -2px -2px 8px rgba(0, 0, 0, 0.24);
}

.team-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--team-color);
    flex-shrink: 0;
    box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ---------------------------------------------------------------
   Buttons — chunky clay, orange identity, soft press
--------------------------------------------------------------- */
.primary-btn,
.secondary-btn,
.correct-btn,
.change-btn {
    min-height: 56px;
    border: 0;
    border-radius: 18px;
    padding: 12px 28px;
    font-size: 1.05rem;
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease-out, opacity 0.2s, box-shadow 0.2s;
}

.primary-btn {
    font-weight: 700;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    box-shadow:
        inset -3px -3px 8px rgba(0, 0, 0, 0.26),
        inset 2px 2px 6px rgba(255, 255, 255, 0.28),
        0 8px 18px rgba(234, 88, 12, 0.3);
}

.primary-btn:hover,
.correct-btn:hover,
.change-btn:hover {
    opacity: 0.92;
}

.primary-btn:active,
.secondary-btn:active,
.correct-btn:active,
.change-btn:active {
    transform: scale(0.96) translateY(1px);
}

.secondary-btn {
    background: var(--panel-strong);
    color: var(--text);
    box-shadow:
        inset -3px -3px 8px rgba(0, 0, 0, 0.25),
        inset 2px 2px 6px rgba(255, 255, 255, 0.08),
        0 6px 14px rgba(0, 0, 0, 0.2);
}

.correct-btn {
    min-height: 72px;
    font-size: clamp(1.2rem, 2.2vw, 1.7rem);
    border-radius: 22px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow:
        inset -3px -3px 8px rgba(0, 0, 0, 0.26),
        inset 2px 2px 6px rgba(255, 255, 255, 0.24),
        0 8px 20px rgba(34, 197, 94, 0.32);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.btn-icon svg {
    width: 26px;
    height: 26px;
    stroke-width: 2.2;
}

.icon-btn {
    background: none;
    border: 0;
    color: var(--muted);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    line-height: 1;
    touch-action: manipulation;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
    background: var(--panel);
    color: var(--text);
}

.icon-btn svg {
    width: 22px;
    height: 22px;
}

.play-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ---------------------------------------------------------------
   Play stage
--------------------------------------------------------------- */
.play-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
    flex: 1;
}

.word-panel {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 12px;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 16%, color-mix(in srgb, var(--team-color) 24%, transparent), transparent 30rem),
        var(--panel);
}

.play-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.35rem);
}

.time-bar-wrap {
    position: relative;
    width: 100%;
    height: 16px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
    direction: ltr;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.35);
}

body.light-theme .time-bar-wrap {
    background: rgba(70, 43, 124, 0.12);
}

.time-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--team-color), color-mix(in srgb, var(--team-color) 55%, #fff));
    transition: width 0.4s ease;
    box-shadow: 0 0 12px color-mix(in srgb, var(--team-color) 40%, transparent);
}

.danger-time .time-bar {
    background: linear-gradient(90deg, var(--danger), color-mix(in srgb, var(--danger) 55%, #fff));
    animation: aliasPulse 0.65s ease-in-out infinite alternate;
}

@keyframes aliasPulse {
    from { filter: brightness(0.9); }
    to { filter: brightness(1.2); }
}

.time-bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3em;
    font-size: clamp(0.85rem, 2.5vw, 1.05rem);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    direction: ltr;
}

.word-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    border-radius: 26px;
    background: var(--bg-soft);
    border: 2px solid color-mix(in srgb, var(--team-color) 30%, transparent);
    overflow: hidden;
    box-shadow:
        inset 2px 2px 8px rgba(255, 255, 255, 0.06),
        inset -3px -3px 12px rgba(0, 0, 0, 0.3),
        0 10px 26px rgba(0, 0, 0, 0.25);
}

body.light-theme .word-row {
    border-color: color-mix(in srgb, var(--team-color) 40%, transparent);
}

.word-row .word-card {
    flex: 1;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 2vw, 28px);
    text-align: center;
}

.word-row .word-text {
    font-size: clamp(2rem, 7vw, 5.5rem);
    line-height: 1.15;
    word-break: break-word;
}

.word-card-hint {
    margin-top: 10px;
    max-width: 92%;
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
    background: var(--panel);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 6px 14px;
    opacity: 0.88;
    line-height: 1.7;
}

body.light-theme .word-card-hint {
    background: var(--panel);
}

.word-row .change-btn {
    flex-shrink: 0;
    flex-direction: column;
    gap: 6px;
    padding: 14px 10px;
    min-width: 82px;
    border-radius: 0;
    background: linear-gradient(160deg, color-mix(in srgb, var(--team-color) 26%, transparent), transparent);
    color: var(--team-color);
    font-size: clamp(0.75rem, 1.6vw, 0.9rem);
    font-weight: 600;
    border-inline-start: 1.5px solid color-mix(in srgb, var(--team-color) 30%, transparent);
}

body.light-theme .word-row .change-btn {
    background: linear-gradient(160deg, color-mix(in srgb, var(--team-color) 22%, transparent), transparent);
}

.word-row .change-btn.clicked {
    animation: aliasChangeClick 0.3s ease;
}

@keyframes aliasChangeClick {
    0% { transform: scale(1); }
    35% { transform: scale(0.88); }
    70% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

.word-row .change-btn .change-icon {
    display: inline-flex;
    line-height: 0;
}

.change-icon svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.2;
}

.word-row .change-btn .change-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    line-height: 1.2;
}

/* ---------------------------------------------------------------
   Ready / pause / countdown overlays
--------------------------------------------------------------- */
.pause-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 12px;
    background: rgba(9, 10, 25, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-align: center;
    z-index: 5;
    border-radius: inherit;
}

.pause-overlay .primary-btn {
    min-width: min(280px, 70vw);
    min-height: 64px;
    margin-top: 16px;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.pause-overlay strong {
    font-size: clamp(3rem, 10vw, 6rem);
}

.pause-overlay span {
    color: var(--muted);
    font-size: 1.15rem;
}

.ready-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: inherit;
    z-index: 10;
}

.ready-overlay .ready-message {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    color: var(--muted);
}

.ready-overlay .countdown-number {
    font-size: clamp(5rem, 18vw, 9rem);
    font-weight: 700;
    line-height: 1;
    color: var(--text);
    animation: aliasCountPop 0.5s ease;
}

@keyframes aliasCountPop {
    0% { transform: scale(1.6); opacity: 0.3; }
    100% { transform: scale(1); opacity: 1; }
}

.ready-overlay .primary-btn {
    min-height: 60px;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    min-width: min(240px, 60vw);
}

.control-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

/* ---------------------------------------------------------------
   Results
--------------------------------------------------------------- */
.results-card {
    min-height: calc(100svh - 120px);
    display: grid;
    align-content: center;
    justify-items: center;
    text-align: center;
    gap: 28px;
    background: var(--panel);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    box-shadow:
        inset 2px 2px 8px rgba(255, 255, 255, 0.07),
        inset -3px -3px 12px rgba(0, 0, 0, 0.3),
        var(--shadow);
}

body.light-theme .results-card {
    border-color: rgba(109, 40, 217, 0.14);
    box-shadow:
        inset 2px 2px 8px rgba(255, 255, 255, 0.55),
        inset -3px -3px 12px rgba(70, 43, 124, 0.1),
        var(--shadow);
}

.results-hero {
    text-align: center;
    padding: 32px 24px;
    border-radius: 28px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--winner-color) 22%, transparent), transparent);
    border: 2px solid color-mix(in srgb, var(--winner-color) 30%, transparent);
    width: min(600px, 100%);
    box-shadow:
        inset 2px 2px 8px rgba(255, 255, 255, 0.07),
        inset -3px -3px 12px rgba(0, 0, 0, 0.28),
        0 14px 34px color-mix(in srgb, var(--winner-color) 18%, transparent);
    animation: aliasHeroPop 0.5s ease-out;
}

@keyframes aliasHeroPop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.results-trophy {
    display: block;
    margin-bottom: 4px;
    color: #fbbf24;
    filter: drop-shadow(0 6px 18px rgba(251, 191, 36, 0.35));
    animation: aliasTrophyBounce 1s ease-in-out infinite alternate;
}

.results-trophy svg {
    width: clamp(3rem, 8vw, 4.5rem);
    height: auto;
}

@keyframes aliasTrophyBounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

.results-hero h1 {
    font-size: clamp(1.7rem, 4.5vw, 3rem);
    margin: 8px 0;
}

.eyebrow {
    color: #fb923c;
    font-size: 1.2rem;
    margin-bottom: 0;
    font-weight: 700;
}

.results-hero-time {
    color: var(--muted);
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    direction: ltr;
    background: var(--panel-strong);
    border-radius: 999px;
    padding: 4px 14px;
}

.results-list {
    width: min(540px, 100%);
    display: grid;
    gap: 12px;
}

.result-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    border-radius: 20px;
    background: var(--panel-strong);
    border: 2px solid transparent;
    text-align: right;
    box-shadow:
        inset 2px 2px 5px rgba(255, 255, 255, 0.07),
        inset -2px -2px 8px rgba(0, 0, 0, 0.26),
        0 4px 12px rgba(0, 0, 0, 0.16);
    transition: transform 0.2s;
}

body.light-theme .result-card {
    box-shadow:
        inset 2px 2px 5px rgba(255, 255, 255, 0.6),
        inset -2px -2px 8px rgba(70, 43, 124, 0.09),
        0 4px 12px rgba(70, 43, 124, 0.08);
}

.result-card.winner {
    border-color: var(--team-color);
    background: linear-gradient(135deg, color-mix(in srgb, var(--team-color) 18%, transparent), var(--panel));
    box-shadow:
        0 0 30px color-mix(in srgb, var(--team-color) 22%, transparent),
        inset 2px 2px 5px rgba(255, 255, 255, 0.06),
        inset -2px -2px 8px rgba(0, 0, 0, 0.24);
}

.result-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
}

.result-medal svg {
    width: 30px;
    height: 30px;
}

.result-info {
    display: grid;
    gap: 6px;
}

.result-info strong {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.result-time-bar-wrap {
    height: 8px;
    border-radius: 999px;
    background: var(--bg-soft);
    overflow: hidden;
    direction: ltr;
    max-width: 200px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
}

.result-time-bar {
    height: 100%;
    border-radius: 999px;
    background: var(--team-color);
}

.result-card.winner .result-time-bar {
    background: linear-gradient(90deg, var(--team-color), color-mix(in srgb, var(--team-color) 50%, #fbbf24));
    box-shadow: 0 0 10px color-mix(in srgb, var(--team-color) 45%, transparent);
}

.result-time {
    font-size: 1.05rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    direction: ltr;
    min-width: 50px;
}

.big-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

/* ---------------------------------------------------------------
   Modals (base.css provides backdrop/modal; small tune-ups)
--------------------------------------------------------------- */
.confirm-modal {
    text-align: center;
}

.confirm-modal h2 {
    margin-bottom: 4px;
}

.confirm-modal p {
    color: var(--muted);
    font-size: 1.15rem;
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------
   Loading
--------------------------------------------------------------- */
.game-loading {
    display: flex;
    height: 60svh;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--muted);
}

/* ---------------------------------------------------------------
   Accessibility: visible keyboard focus
--------------------------------------------------------------- */
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.correct-btn:focus-visible,
.change-btn:focus-visible,
.icon-btn:focus-visible,
.field:focus-visible,
.color-swatch:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

/* ---------------------------------------------------------------
   Motion preferences
--------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .results-trophy,
    .danger-time .time-bar {
        animation: none;
    }
    .results-hero,
    .ready-overlay .countdown-number,
    .word-row .change-btn.clicked {
        animation: none;
    }
    .primary-btn,
    .secondary-btn,
    .correct-btn,
    .change-btn,
    .color-swatch,
    .icon-btn {
        transition: none;
    }
}

/* ---------------------------------------------------------------
   Tablet (≥641px)
--------------------------------------------------------------- */
@media (min-width: 641px) {
    .game-shell {
        padding: 16px 24px calc(24px + env(safe-area-inset-bottom));
    }
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
    .time-bar-wrap {
        height: 22px;
    }
    .word-row .word-card {
        min-height: 200px;
    }
}

/* ---------------------------------------------------------------
   Desktop (≥1024px)
--------------------------------------------------------------- */
@media (min-width: 1024px) {
    .game-shell {
        padding: 20px 28px calc(28px + env(safe-area-inset-bottom));
    }
    .setup-grid {
        grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
        gap: 22px;
    }
    .play-layout {
        grid-template-columns: minmax(270px, 0.34fr) minmax(0, 1fr);
        gap: 20px;
        align-items: stretch;
    }
    .word-panel {
        padding: clamp(18px, 2.4vw, 34px);
    }
    .word-row .word-card {
        min-height: 240px;
    }
}

/* ---------------------------------------------------------------
   Phones in landscape: compact
--------------------------------------------------------------- */
@media (orientation: landscape) and (max-width: 1023px) {
    .game-shell.play-screen {
        min-height: calc(100svh - 72px);
    }
    .word-row .word-card {
        min-height: 42svh;
    }
    .play-status {
        font-size: 0.95rem;
    }
}

/* ---------------------------------------------------------------
   Short portrait phones: tighten vertical rhythm
--------------------------------------------------------------- */
@media (max-width: 1023px) and (orientation: portrait) and (max-height: 700px) {
    .game-shell {
        padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
    }
    .game-shell.play-screen {
        min-height: calc(100svh - 80px);
    }
    .word-row .word-card {
        min-height: 36svh;
    }
    .word-panel {
        padding: 14px 12px;
    }
    .pause-overlay strong {
        font-size: clamp(2.2rem, 8vw, 4rem);
    }
    .ready-overlay .countdown-number {
        font-size: clamp(3.5rem, 14vw, 6rem);
    }
}

/* ---------------------------------------------------------------
   Small phones: hide scoreboard sidebar
--------------------------------------------------------------- */
@media (max-width: 1023px) {
    .score-panel {
        display: none;
    }
}