/* =========================================================
   Արմ ԿԵՐՊ - PRO ULTIMATE
   PHONE OPTIMIZED STYLE
========================================================= */

:root {
    --bg: #07111f;
    --bg2: #0d1b30;

    --card: rgba(15, 29, 49, 0.88);
    --card2: rgba(255,255,255,0.07);

    --text: #ffffff;
    --muted: #9eacc0;

    --primary: #6c63ff;
    --primary2: #8b5cf6;

    --success: #25d695;
    --danger: #ff5f6d;

    --border: rgba(255,255,255,0.10);

    --shadow:
            0 20px 60px rgba(0,0,0,.35);

    --radius: 22px;
}

:root[data-theme="light"] {
    --bg: #eef3fb;
    --bg2: #dfe7f5;

    --card: rgba(255,255,255,.92);
    --card2: rgba(20,30,50,.06);

    --text: #172033;
    --muted: #68758a;

    --border: rgba(20,30,50,.10);

    --shadow:
            0 20px 50px rgba(35,50,80,.16);
}


/* =========================
   RESET
========================= */

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

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
            system-ui,
            -apple-system,
            BlinkMacSystemFont,
            "Segoe UI",
            sans-serif;

    background: var(--bg);
    color: var(--text);

    overflow-x: hidden;

    touch-action: manipulation;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
}

input,
select {
    outline: none;
}


/* =========================
   BACKGROUND
========================= */

.bg-gradient {
    position: fixed;
    inset: 0;

    z-index: -1;

    pointer-events: none;

    background:
            radial-gradient(
                    circle at 10% 10%,
                    rgba(108,99,255,.25),
                    transparent 35%
            ),
            radial-gradient(
                    circle at 90% 20%,
                    rgba(139,92,246,.18),
                    transparent 35%
            ),
            radial-gradient(
                    circle at 50% 100%,
                    rgba(37,214,149,.08),
                    transparent 35%
            );

    background-color: var(--bg);
}


/* =========================
   APP
========================= */

#app-container {
    min-height: 100vh;
}


/* =========================
   TOPBAR
========================= */

.topbar {
    position: sticky;
    top: 0;

    z-index: 100;

    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding:
            12px
            max(14px, env(safe-area-inset-right))
            12px
            max(14px, env(safe-area-inset-left));

    background:
            rgba(7,17,31,.78);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border-bottom:
            1px solid var(--border);
}

:root[data-theme="light"] .topbar {
    background:
            rgba(255,255,255,.78);
}

.brand {
    display: flex;
    align-items: center;

    gap: 9px;

    min-width: 0;
}

.brand-icon {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background:
            linear-gradient(
                    135deg,
                    var(--primary),
                    var(--primary2)
            );

    font-size: 22px;
}

.brand strong {
    display: block;

    font-size: 15px;
}

.brand small {
    display: block;

    color: var(--muted);

    font-size: 10px;
}

.top-actions {
    display: flex;
    align-items: center;

    gap: 6px;
}

.icon-btn,
.profile-btn {
    min-height: 40px;

    border-radius: 12px;

    color: var(--text);

    background: var(--card2);

    border:
            1px solid var(--border);

    cursor: pointer;

    touch-action: manipulation;
}

.icon-btn:active,
.profile-btn:active {
    transform: scale(.96);
}

.theme-btn {
    display: flex;
    align-items: center;

    gap: 5px;

    padding: 0 10px;

    font-size: 12px;
}

.square-btn {
    width: 40px;
    padding: 0;

    display: grid;
    place-items: center;

    font-size: 17px;
}

.profile-btn {
    display: flex;
    align-items: center;

    gap: 6px;

    padding: 4px 8px 4px 5px;

    font-size: 12px;
}

#profile-avatar-button {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: var(--card2);

    font-size: 20px;
}


/* =========================
   SCREENS
========================= */

.screen {
    display: none;

    width: 100%;
    min-height: calc(100vh - 65px);

    padding:
            20px
            max(14px, env(safe-area-inset-right))
            30px
            max(14px, env(safe-area-inset-left));

    align-items: flex-start;
    justify-content: center;
}

.screen.active {
    display: flex;
}


/* =========================
   GLASS
========================= */

.glass-card {
    width: 100%;
    max-width: 620px;

    background: var(--card);

    border:
            1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}


/* =========================
   AUTH
========================= */

#auth-screen {
    align-items: center;
    justify-content: center;

    min-height: 100vh;

    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;

    padding: 28px 22px;

    text-align: center;

    background: var(--card);

    border:
            1px solid var(--border);

    border-radius: 26px;

    box-shadow: var(--shadow);
}

.auth-logo {
    width: 76px;
    height: 76px;

    margin: 0 auto 12px;

    display: grid;
    place-items: center;

    border-radius: 22px;

    background:
            linear-gradient(
                    135deg,
                    var(--primary),
                    var(--primary2)
            );

    font-size: 42px;
}

.auth-card h1 {
    margin: 0;

    font-size: 32px;
}

.auth-subtitle {
    margin: 3px 0 22px;

    color: var(--muted);

    font-size: 13px;
}

.auth-card h2 {
    margin: 0 0 15px;

    font-size: 20px;
}

.auth-form {
    display: flex;
    flex-direction: column;

    gap: 10px;
}

.auth-form input {
    width: 100%;
    height: 52px;

    padding: 0 15px;

    border-radius: 14px;

    border:
            1px solid var(--border);

    background: var(--card2);

    color: var(--text);

    font-size: 16px;
}

.auth-form input::placeholder {
    color: var(--muted);
}

.auth-switch {
    margin-top: 15px;

    color: var(--muted);

    font-size: 13px;
}

.auth-switch button {
    background: transparent;

    color: #8d86ff;

    cursor: pointer;

    font-weight: 700;
}

.guest-btn {
    width: 100%;

    margin-top: 16px;

    min-height: 48px;

    border-radius: 14px;

    color: var(--text);

    background: var(--card2);

    border:
            1px solid var(--border);

    cursor: pointer;
}


/* =========================
   BUTTONS
========================= */

.primary-btn,
.secondary-btn,
.login-link-btn,
.logout-btn {
    min-height: 50px;

    border-radius: 15px;

    padding: 0 18px;

    cursor: pointer;

    font-weight: 800;

    transition:
            transform .15s ease,
            opacity .15s ease;
}

.primary-btn {
    color: #fff;

    background:
            linear-gradient(
                    135deg,
                    var(--primary),
                    var(--primary2)
            );

    box-shadow:
            0 10px 25px rgba(108,99,255,.25);
}

.secondary-btn {
    color: var(--text);

    background: var(--card2);

    border:
            1px solid var(--border);
}

.primary-btn:active,
.secondary-btn:active,
.guest-btn:active,
.login-link-btn:active,
.logout-btn:active {
    transform: scale(.97);
}

.full-btn {
    width: 100%;
}

.start-btn {
    margin-top: 4px;

    min-height: 58px;

    font-size: 17px;
}


/* =========================
   SETUP
========================= */

.setup-card {
    padding: 20px 16px;
}

.section-title {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 22px;
}

.section-title > span {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    border-radius: 15px;

    background: var(--card2);

    font-size: 25px;
}

.section-title h2 {
    margin: 0;

    font-size: 22px;
}

.section-title p {
    margin: 3px 0 0;

    color: var(--muted);

    font-size: 12px;
}

.setup-section {
    margin-bottom: 18px;
}

.section-heading {
    margin-bottom: 9px;

    font-size: 14px;
    font-weight: 800;
}

.teams-container {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-bottom: 9px;
}

.team-input-row {
    display: grid;

    grid-template-columns:
        34px
        48px
        1fr
        40px;

    align-items: center;

    gap: 7px;
}

.team-number {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: var(--card2);

    color: var(--muted);

    font-weight: 800;
}

.team-avatar-input,
.team-name-input,
select,
.custom-input-row input {
    width: 100%;
    height: 48px;

    border-radius: 13px;

    border:
            1px solid var(--border);

    background: var(--card2);

    color: var(--text);

    padding: 0 11px;

    font-size: 15px;
}

.team-avatar-input {
    padding: 0 5px;

    text-align: center;

    font-size: 22px;
}

.remove-team-btn {
    width: 40px;
    height: 40px;

    border-radius: 11px;

    background: rgba(255,95,109,.12);

    color: var(--danger);

    font-size: 23px;

    cursor: pointer;
}

.settings-grid {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-top: 10px;
}

label {
    display: flex;
    flex-direction: column;

    gap: 6px;

    color: var(--muted);

    font-size: 12px;
    font-weight: 700;
}

label select {
    color: var(--text);
}

.custom-toggle {
    width: 100%;
    min-height: 48px;

    border-radius: 13px;

    background: var(--card2);

    color: var(--text);

    border:
            1px solid var(--border);

    cursor: pointer;

    font-weight: 700;
}

.custom-input-row {
    display: grid;

    grid-template-columns: 1fr 48px;

    gap: 7px;

    margin-top: 9px;
}

.add-word-btn {
    border-radius: 13px;

    background: var(--primary);

    color: white;

    font-size: 24px;

    cursor: pointer;
}

#added-words-chips {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;

    margin-top: 9px;
}

.word-chip {
    display: flex;
    align-items: center;

    gap: 5px;

    padding: 7px 9px;

    border-radius: 10px;

    background: var(--card2);

    border:
            1px solid var(--border);

    font-size: 12px;
}

.word-chip button {
    background: transparent;

    color: var(--danger);

    cursor: pointer;

    font-size: 17px;
}


/* =========================
   READY
========================= */

#ready-screen {
    align-items: center;
}

.ready-card {
    max-width: 430px;

    padding: 30px 20px;

    text-align: center;
}

.ready-avatar {
    width: 100px;
    height: 100px;

    margin: 0 auto 15px;

    display: grid;
    place-items: center;

    border-radius: 28px;

    background: var(--card2);

    font-size: 58px;
}

.ready-label {
    color: var(--muted);

    font-size: 13px;
}

.ready-card h2 {
    margin: 5px 0;

    font-size: 28px;
}

.ready-card p {
    margin: 0 0 25px;

    color: var(--muted);
}

.ready-start-btn {
    width: 100%;

    min-height: 58px;

    font-size: 17px;
}


/* =========================
   COUNTDOWN
========================= */

.countdown-overlay {
    position: fixed;
    inset: 0;

    z-index: 10000;

    display: flex;

    align-items: center;
    justify-content: center;

    background:
            rgba(3,8,18,.88);

    backdrop-filter: blur(10px);
}

.countdown-box {
    text-align: center;
}

#countdown-team {
    margin-bottom: 12px;

    font-size: 20px;
    font-weight: 800;
}

#countdown-number {
    font-size: clamp(90px, 30vw, 180px);

    line-height: .9;

    font-weight: 1000;

    background:
            linear-gradient(
                    135deg,
                    #fff,
                    #9c96ff
            );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;

    animation:
            countdownPop
            .65s ease;
}

@keyframes countdownPop {
    0% {
        transform: scale(.5);
        opacity: 0;
    }

    60% {
        transform: scale(1.15);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}


/* =========================
   GAME
========================= */

#game-screen {
    padding-top: 10px;
}

.game-card {
    position: relative;

    max-width: 700px;

    padding: 15px 12px 25px;
}

.game-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.game-team {
    display: flex;
    align-items: center;

    gap: 9px;

    min-width: 0;
}

.game-avatar {
    width: 45px;
    height: 45px;

    flex: 0 0 45px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    background: var(--card2);

    font-size: 27px;
}

.game-team strong {
    display: block;

    max-width: 170px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 14px;
}

.game-team small {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;
}

.game-stats {
    display: flex;
    align-items: center;

    gap: 7px;
}

.timer,
.score-counter {
    min-width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    background: var(--card2);

    border:
            1px solid var(--border);

    font-weight: 900;
}

.timer {
    font-size: 20px;
}

.score-counter {
    color: var(--success);

    font-size: 16px;
}

.timer-warning {
    color: #ffc857;
}

.timer-danger {
    color: var(--danger);

    animation:
            timerDanger
            .55s infinite;
}

@keyframes timerDanger {
    50% {
        transform: scale(1.08);
    }
}

.combo-box {
    width: max-content;

    margin: 13px auto 8px;

    padding: 7px 13px;

    border-radius: 20px;

    background: var(--card2);

    color: var(--muted);

    font-size: 12px;
    font-weight: 800;
}

.combo-box.active {
    color: #ffc857;

    animation:
            comboPop
            .25s ease;
}

@keyframes comboPop {
    50% {
        transform: scale(1.08);
    }
}

.game-instruction {
    margin-bottom: 10px;

    text-align: center;

    color: var(--muted);

    font-size: 11px;
}


/* =========================
   WORDS
========================= */

#words-container {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 8px;
}

.word-card {
    position: relative;

    width: 100%;

    min-height: 61px;

    display: flex;
    align-items: center;

    padding: 9px 50px 9px 9px;

    border-radius: 15px;

    border:
            1px solid var(--border);

    background:
            linear-gradient(
                    135deg,
                    rgba(255,255,255,.08),
                    rgba(255,255,255,.035)
            );

    color: var(--text);

    text-align: left;

    cursor: pointer;

    font-size: clamp(17px, 5vw, 24px);
    font-weight: 850;

    line-height: 1.15;

    transition:
            transform .12s ease,
            opacity .2s ease,
            background .2s ease;
}

.word-card:active {
    transform: scale(.985);
}

.word-card:hover {
    background: rgba(255,255,255,.11);
}

.word-card-number {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    margin-right: 10px;

    display: grid;
    place-items: center;

    border-radius: 9px;

    background: var(--card2);

    color: var(--muted);

    font-size: 12px;

    pointer-events: none;
}

.word-card-text {
    min-width: 0;

    overflow-wrap: anywhere;

    pointer-events: none;
}

.word-card-check {
    position: absolute;

    right: 11px;

    top: 50%;

    width: 29px;
    height: 29px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    opacity: 0;

    transform:
            translateY(-50%)
            scale(.6);

    background: rgba(37,214,149,.15);

    color: var(--success);

    transition:
            opacity .18s ease,
            transform .18s ease;
}

.word-card.guessed {
    opacity: .38;

    cursor: default;
}

.word-card.guessed .word-card-check {
    opacity: 1;

    transform:
            translateY(-50%)
            scale(1);
}

.word-card.guessed .word-card-text {
    text-decoration: line-through;
}


/* =========================
   POPUP
========================= */

.points-popup {
    position: fixed;

    left: 50%;
    bottom: 20%;

    z-index: 500;

    opacity: 0;

    pointer-events: none;

    color: var(--success);

    font-size: 35px;
    font-weight: 1000;

    transform:
            translate(-50%, 15px)
            scale(.8);
}

.points-popup.show {
    animation:
            pointsUp
            .6s ease forwards;
}

@keyframes pointsUp {
    25% {
        opacity: 1;

        transform:
                translate(-50%, 0)
                scale(1.15);
    }

    100% {
        opacity: 0;

        transform:
                translate(-50%, -45px)
                scale(1);
    }
}


/* =========================
   RESULTS
========================= */

.result-card,
.winner-card {
    padding: 25px 17px;

    text-align: center;
}

.result-icon,
.winner-trophy {
    font-size: 55px;
}

.result-card h2 {
    margin: 8px 0;

    font-size: 25px;
}

.result-card > p {
    color: var(--muted);
}

.result-stats {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 8px;

    margin: 17px 0;
}

.result-stats div {
    min-height: 58px;

    display: grid;
    place-items: center;

    padding: 8px;

    border-radius: 13px;

    background: var(--card2);

    font-size: 12px;
    font-weight: 800;
}

.achievements {
    display: flex;
    flex-wrap: wrap;

    justify-content: center;

    gap: 7px;

    margin-bottom: 15px;
}

.achievement-chip {
    padding: 7px 10px;

    border-radius: 20px;

    background: var(--card2);

    font-size: 11px;
    font-weight: 700;
}


/* =========================
   SCOREBOARD
========================= */

.scoreboard {
    display: flex;
    flex-direction: column;

    gap: 7px;

    margin: 15px 0;
}

.score-row {
    min-height: 52px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    padding: 7px 10px;

    border-radius: 13px;

    background: var(--card2);

    border:
            1px solid var(--border);
}

.score-left {
    display: flex;
    align-items: center;

    gap: 8px;

    min-width: 0;
}

.score-rank {
    width: 24px;

    color: var(--muted);

    font-size: 11px;
}

.score-avatar {
    font-size: 23px;
}

.score-team-name {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 13px;
    font-weight: 700;
}

.score-points {
    font-size: 18px;
    font-weight: 1000;
}


/* =========================
   WINNER
========================= */

.winner-label {
    color: var(--muted);

    font-size: 13px;
}

.winner-card h1 {
    margin: 5px 0;

    font-size: 28px;
}

.winner-card > p {
    color: var(--muted);

    margin: 0 0 12px;
}

.winner-achievement {
    padding: 10px;

    border-radius: 13px;

    background: var(--card2);

    font-size: 12px;
    font-weight: 800;
}

.winner-actions {
    display: flex;
    flex-direction: column;

    gap: 8px;
}


/* =========================
   PROFILE
========================= */

.profile-panel,
.avatar-modal {
    position: fixed;
    inset: 0;

    z-index: 9999;

    display: flex;

    align-items: flex-end;
    justify-content: center;

    padding: 10px;

    background:
            rgba(0,0,0,.65);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.profile-card,
.avatar-card {
    position: relative;

    width: 100%;
    max-width: 440px;

    max-height: 88vh;

    overflow-y: auto;

    padding: 24px 17px;

    border-radius: 24px 24px 16px 16px;

    background: var(--card);

    border:
            1px solid var(--border);

    box-shadow: var(--shadow);
}

.modal-close {
    position: absolute;

    top: 10px;
    right: 10px;

    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    border-radius: 10px;

    background: var(--card2);

    color: var(--text);

    font-size: 23px;

    cursor: pointer;
}

.profile-big-avatar {
    width: 86px;
    height: 86px;

    margin: 10px auto;

    display: grid;
    place-items: center;

    border-radius: 25px;

    background: var(--card2);

    font-size: 50px;
}

.profile-card h2 {
    margin: 8px 0 18px;

    text-align: center;
}

.profile-card .primary-btn,
.profile-card .secondary-btn {
    margin-bottom: 8px;
}

.login-link-btn {
    width: 100%;

    margin-top: 10px;

    background: transparent;

    color: #8d86ff;

    cursor: pointer;
}

.logout-btn {
    width: 100%;

    margin-top: 3px;

    background: rgba(255,95,109,.10);

    color: var(--danger);

    cursor: pointer;
}

.history-container {
    display: flex;
    flex-direction: column;

    gap: 8px;

    margin-top: 12px;
}

.history-item {
    padding: 12px;

    border-radius: 13px;

    background: var(--card2);

    border:
            1px solid var(--border);
}

.history-main {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.history-winner {
    font-weight: 800;

    font-size: 13px;
}

.history-date {
    color: var(--muted);

    font-size: 10px;
}

.history-category {
    margin-top: 4px;

    color: var(--muted);

    font-size: 11px;
}

.history-teams {
    display: flex;
    flex-direction: column;

    gap: 4px;

    margin-top: 8px;
}

.history-team {
    display: flex;
    justify-content: space-between;

    font-size: 11px;
}

.empty-history {
    padding: 20px;

    text-align: center;

    color: var(--muted);

    font-size: 12px;
}


/* =========================
   AVATAR PICKER
========================= */

.avatar-card h2 {
    margin: 5px 0 20px;

    text-align: center;

    font-size: 21px;
}

.avatar-grid {
    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 9px;
}

.avatar-option {
    aspect-ratio: 1;

    display: grid;
    place-items: center;

    border-radius: 15px;

    background: var(--card2);

    border:
            2px solid transparent;

    font-size: 31px;

    cursor: pointer;
}

.avatar-option:active {
    transform: scale(.93);
}

.avatar-option.selected {
    border-color: var(--primary);

    background:
            rgba(108,99,255,.15);
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

    .theme-btn {
        width: 40px;
        padding: 0;

        justify-content: center;
    }

    .theme-btn #theme-name {
        display: none;
    }

    .profile-btn span:last-child {
        display: none;
    }

    .topbar {
        padding-top:
                max(10px, env(safe-area-inset-top));
    }

    .screen {
        padding-top: 12px;
        padding-bottom:
                max(25px, env(safe-area-inset-bottom));
    }

    .setup-card {
        border-radius: 20px;

        padding: 18px 13px;
    }

    .team-input-row {
        grid-template-columns:
            30px
            46px
            1fr
            36px;
    }

    .team-number {
        width: 30px;
        height: 30px;
    }

    .team-avatar-input {
        font-size: 20px;
    }

    .remove-team-btn {
        width: 36px;
        height: 36px;
    }

    .settings-grid {
        gap: 7px;
    }

    .game-card {
        border-radius: 18px;

        padding:
                12px
                9px
                max(22px, env(safe-area-inset-bottom));
    }

    .word-card {
        min-height: 59px;

        font-size: 18px;
    }

    .ready-card {
        border-radius: 20px;
    }

    .result-card,
    .winner-card {
        border-radius: 20px;
    }
}


/* =========================
   VERY SMALL PHONES
========================= */

@media (max-width: 360px) {

    .brand-icon {
        width: 36px;
        height: 36px;
    }

    .brand strong {
        font-size: 13px;
    }

    .top-actions {
        gap: 4px;
    }

    .icon-btn,
    .profile-btn {
        min-height: 36px;
    }

    .square-btn {
        width: 36px;
    }

    #profile-avatar-button {
        width: 29px;
        height: 29px;
    }

    .word-card {
        font-size: 17px;
    }

    .word-card-number {
        width: 30px;
        height: 30px;

        flex-basis: 30px;
    }

    .result-stats {
        grid-template-columns: 1fr;
    }
}

/* GAMEPLAY PROGRESS — PHASE 2 */
.game-progress {
    width: min(100%, 680px); margin: 0 auto 18px; padding: 12px 14px;
    border: 1px solid rgba(151,126,255,.18); border-radius: 15px;
    background: linear-gradient(135deg,rgba(120,91,255,.09),rgba(56,189,248,.055));
}
.game-progress-heading {
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    margin-bottom:9px; color:var(--text-secondary,#aeb5ca); font-size:13px; font-weight:650;
}
.game-progress-heading strong { color:var(--text-primary,#fff); font-variant-numeric:tabular-nums; letter-spacing:.03em; }
.game-progress-track { height:9px; overflow:hidden; border-radius:999px; background:rgba(128,139,170,.18); }
.game-progress-track > span {
    display:block; width:0; height:100%; border-radius:inherit;
    background:linear-gradient(90deg,#8b5cf6,#38bdf8,#34d399);
    box-shadow:0 0 14px rgba(139,92,246,.35);
    transition:width .28s cubic-bezier(.2,.8,.2,1);
}
.word-card { transform:translateZ(0); transition:transform .18s ease,border-color .18s ease,background .18s ease,box-shadow .18s ease,opacity .18s ease; }
.word-card:not(:disabled):hover { transform:translateY(-2px); }
.word-card.guessed { transform:scale(.985); }
.combo-box.active { animation:combo-breathe 1.8s ease-in-out infinite; }
@keyframes combo-breathe { 0%,100% { filter:drop-shadow(0 0 0 rgba(139,92,246,0)); } 50% { filter:drop-shadow(0 0 9px rgba(139,92,246,.24)); } }
@media (prefers-reduced-motion:reduce) { .combo-box.active { animation:none; } .game-progress-track > span,.word-card { transition:none; } }


/* Phase 2 — scoreboard leader polish */
.score-row.score-leader {
    border-color: rgba(255, 205, 92, 0.48);
    background: rgba(255, 205, 92, 0.09);
}

.score-row.score-leader .score-rank {
    color: #f4c45e;
    font-weight: 800;
}

/* PHASE 3 — MOBILE EXPERIENCE */
html { -webkit-text-size-adjust:100%; }
body { min-width:0; overflow-x:hidden; }
button, input, select, textarea { font:inherit; }
button { touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline:3px solid #38bdf8; outline-offset:3px; }
@media (hover:none) and (pointer:coarse) {
  .word-card:not(:disabled):hover { transform:none; }
  .word-card:active { transform:scale(.975); }
  button { min-height:44px; }
  .word-card { touch-action:manipulation; user-select:none; -webkit-user-select:none; }
}
@media (max-width:600px) {
  .screen { width:100%; max-width:100%; padding-left:12px; padding-right:12px; }
  .glass-card, .game-card, .setup-card, .ready-card, .result-card, .winner-card, .auth-card { max-width:100%; min-width:0; box-sizing:border-box; }
  .game-card { width:100%; padding:14px 12px max(18px,env(safe-area-inset-bottom)); }
  .game-top { gap:10px; flex-wrap:wrap; }
  .game-team { min-width:0; flex:1 1 135px; }
  #game-team-name { overflow-wrap:anywhere; }
  .game-stats { flex-shrink:0; }
  .game-progress { margin-bottom:12px; padding:11px; }
  .words-container { width:100%; min-width:0; }
  .word-card { width:100%; min-height:64px; padding:12px; gap:10px; }
  .word-card-text { min-width:0; overflow-wrap:anywhere; line-height:1.35; }
  .game-instruction { line-height:1.5; }
  input, select, textarea { max-width:100%; min-width:0; font-size:16px; }
  .team-input-row input { min-width:0; }
}
@media (max-width:390px) {
  .game-card { padding-left:9px; padding-right:9px; }
  .game-top { gap:7px; }
  .word-card { font-size:16px; }
  .game-progress-heading { font-size:12px; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}
