/* ═══════════════════════════════════════════════════════
   🐊 CROCODILE GAME — Web App Styles
   Theme: Dark + Green accents + Glassmorphism
   ═══════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0a0f0d;
    --bg-secondary: #111a16;
    --bg-card: rgba(30, 60, 45, 0.35);
    --border-glass: rgba(80, 180, 120, 0.18);
    --green-100: #e8f5e9;
    --green-300: #81c784;
    --green-400: #66bb6a;
    --green-500: #4caf50;
    --green-600: #43a047;
    --green-700: #388e3c;
    --green-800: #2e7d32;
    --green-900: #1b5e20;
    --accent: #00e676;
    --accent-dim: rgba(0, 230, 118, 0.15);
    --gold: #ffd700;
    --danger: #ef5350;
    --danger-dim: rgba(239, 83, 80, 0.15);
    --success: #66bb6a;
    --success-dim: rgba(102, 187, 106, 0.15);
    --text-primary: #e8f5e9;
    --text-secondary: #a5d6a7;
    --text-muted: #6b8f72;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ─── Screens ─────────────────────────────────────── */

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.hidden {
    display: none !important;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.screen-content {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding-bottom: 10px;
}

/* ─── Glass ───────────────────────────────────────── */

.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

/* ─── Typography ──────────────────────────────────── */

h1,
h2,
h3 {
    font-weight: 800;
    text-align: center;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

h3 {
    font-size: 1.2rem;
}

/* ─── Buttons ─────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 320px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-600), var(--green-800));
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(76, 175, 80, 0.5);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-accent {
    background: linear-gradient(135deg, #ffd700, #ffab00);
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #ef5350, #c62828);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 83, 80, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--green-500), var(--green-700));
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

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

.btn-lg {
    padding: 16px 32px;
    font-size: 1.15rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 1.2rem;
    width: auto;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
}

.btn-round {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 2rem;
    padding: 0;
}

.btn-gear {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.btn-gear:active {
    transform: rotate(90deg) scale(0.9);
}

/* ─── Pulse animation ─────────────────────────────── */

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
    }

    50% {
        box-shadow: 0 4px 30px rgba(76, 175, 80, 0.6);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ─── HOME SCREEN ─────────────────────────────────── */

#screen-home {
    background: radial-gradient(ellipse at center bottom, rgba(30, 80, 50, 0.4) 0%, var(--bg-primary) 70%);
}

.home-bg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 400px;
}

.logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.croc-logo {
    width: 180px;
    height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0, 230, 118, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.title {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--accent), var(--green-300));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══ PAYWALL MODAL ═══ */

.paywall-box {
    text-align: center;
    padding: 32px 24px;
    max-width: 340px;
}

.paywall-emoji {
    font-size: 3.5rem;
    margin-bottom: 12px;
    animation: paywall-shake 0.6s ease-in-out;
}

@keyframes paywall-shake {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(8deg); }
    60% { transform: rotate(-4deg); }
    80% { transform: rotate(4deg); }
}

.paywall-title {
    color: var(--text-primary);
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.paywall-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.paywall-btn {
    display: block;
    width: 100%;
    text-decoration: none;
    text-align: center;
    margin-bottom: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00e676, #00c853);
    animation: paywall-pulse 2s infinite;
}

@keyframes paywall-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.4); }
    50% { box-shadow: 0 0 20px 6px rgba(0, 230, 118, 0.2); }
}

.paywall-close {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.settings-card {
    width: 100%;
    margin-bottom: 20px;
}

.settings-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
}

.settings-option h3 {
    margin: 0 0 4px;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.settings-option p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .88rem;
    line-height: 1.35;
}

.toggle-switch {
    position: relative;
    width: 58px;
    height: 34px;
    flex: 0 0 58px;
    cursor: pointer;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.09);
    transition: background .18s ease, border-color .18s ease;
}

.toggle-switch span::after {
    content: "";
    position: absolute;
    width: 26px;
    height: 26px;
    top: 3px;
    left: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,.86);
    box-shadow: 0 4px 12px rgba(0,0,0,.28);
    transition: transform .18s ease, background .18s ease;
}

.toggle-switch input:checked + span {
    background: linear-gradient(135deg, #81c784, #2e7d32);
    border-color: rgba(129,199,132,.65);
}

.toggle-switch input:checked + span::after {
    transform: translateX(24px);
    background: #07130b;
}

/* ═══ BANNED SCREEN ═══ */

/* ─── TELEGRAM-ONLY GUARD ────────────────────────────── */

.tg-guard {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-primary);
}

.tg-guard.hidden {
    display: none !important;
}

.tg-guard-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 24px;
    max-width: 320px;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
}

.tg-guard-icon {
    font-size: 4rem;
    line-height: 1;
}

.tg-guard-content h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0;
}

.tg-guard-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* ─── BANNED ─────────────────────────────────────────── */

.banned-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 40px 24px;
    background: radial-gradient(ellipse at center, rgba(80, 20, 20, 0.3) 0%, var(--bg-primary) 70%);
}

.banned-emoji {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.banned-title {
    color: var(--danger);
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 12px;
}

.banned-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* ═══ DISABLED GAME BUTTONS ═══ */

.game-option.disabled {
    opacity: 0.35;
    filter: grayscale(1);
    pointer-events: none;
    transform: scale(0.95);
    transition: all 0.3s ease;
}

.game-option.disabled-clickable {
    opacity: 0.35;
    filter: grayscale(1);
    transform: scale(0.95);
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-option.disabled-clickable:active {
    transform: scale(0.92);
}

/* ═══ GAMES COUNTER ═══ */

.games-counter {
    text-align: center;
    margin-top: 20px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.games-counter:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.games-counter span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.games-counter.warning span {
    color: #ffa726;
}

.games-counter.exhausted span {
    color: var(--danger);
}

.games-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.counter-channel-link {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    border: 1px solid var(--accent);
    border-radius: 20px;
    padding: 4px 14px;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.counter-channel-link:hover {
    background: var(--accent);
    color: #000;
}

/* ─── TRIO SELECTOR ─── */
#screen-splash {
    position: relative;
    padding: 0 20px;
    overflow: hidden;
}

#screen-splash.screen.active {
    justify-content: flex-start;
}

.game-selector-container {
    --selector-avatar: clamp(108px, 30vw, 122px);
    --selector-title: clamp(19px, 5.2vw, 23px);
    --selector-item-height: calc(var(--selector-avatar) + var(--selector-title) + 12px);
    --selector-gap: clamp(22px, 4.8vh, 34px);
    --selector-step: calc(var(--selector-item-height) + var(--selector-gap));
    --selector-mafia-bottom: clamp(190px, 19vh, 235px);
    position: absolute;
    inset: 0 20px;
    margin: 0 auto;
    max-width: 400px;
}

.game-option {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-decoration: none;
    width: 100%;
}

#btn-select-croc {
    bottom: calc(var(--selector-mafia-bottom) + (2 * var(--selector-step)));
}

#btn-select-hat {
    bottom: calc(var(--selector-mafia-bottom) + var(--selector-step));
}

#btn-select-mafia {
    bottom: var(--selector-mafia-bottom);
}

.game-option:active {
    transform: scale(0.92);
}

.circle-avatar {
    width: var(--selector-avatar);
    height: var(--selector-avatar);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transition: all 0.3s ease;
}

.circle-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin-top: 5px;
}

.game-title {
    font-family: 'Nunito', sans-serif;
    font-size: var(--selector-title);
    font-weight: 900;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    line-height: 1.1;
}

.game-title.croc { color: #81c784; }
.game-title.hat { color: #ffa726; }
.game-title.mafia { color: #ef5350; }

.mafia-border {
    border-color: rgba(239, 83, 80, 0.3);
}

.game-option:hover .circle-avatar {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 30px rgba(0, 230, 118, 0.2);
}

.game-option:hover .mafia-border {
    border-color: rgba(239, 83, 80, 0.6);
    box-shadow: 0 8px 30px rgba(239, 83, 80, 0.3);
}

/* Адаптация под маленькие экраны по высоте */
@media (max-height: 740px) {
    .game-selector-container {
        --selector-avatar: 104px;
        --selector-title: 18px;
        --selector-gap: 16px;
        --selector-mafia-bottom: 170px;
    }
}

@media (max-height: 660px) {
    .game-selector-container {
        --selector-avatar: 96px;
        --selector-title: 17px;
        --selector-gap: 12px;
        --selector-mafia-bottom: 150px;
    }
}

/* ─── MAFIA GAME STYLES ─── */

.mafia-lobby-list {
    width: 100%;
    max-width: 340px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mafia-player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    font-weight: 600;
}

.mafia-host-player {
    min-height: 58px;
    gap: 14px;
    padding: 10px 12px 10px 16px;
}

.mafia-host-player-main {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mafia-host-player-main strong {
    min-width: 92px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mafia-seat-number {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(129, 199, 132, .22);
    border: 1px solid rgba(129, 199, 132, .34);
    color: var(--accent);
    font-weight: 900;
}

.mafia-offline-name-input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.24);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
}

.mafia-offline-name-input:focus {
    outline: none;
    border-color: rgba(129, 199, 132, .58);
    box-shadow: 0 0 0 3px rgba(129, 199, 132, .14);
}

.mafia-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 112px;
    height: 34px;
    padding: 4px 10px 4px 5px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .2px;
}

.mafia-role-marker {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: .82rem;
    line-height: 1;
    box-shadow: 0 0 14px rgba(255,255,255,.1);
}

.mafia-role-label {
    color: var(--text-primary);
    white-space: nowrap;
}

.mafia-role-chip.role-mafia .mafia-role-marker { background: #ef5350; }
.mafia-role-chip.role-civilian .mafia-role-marker { background: #81c784; color: #07130b; }
.mafia-role-chip.role-commissioner .mafia-role-marker { background: #448aff; }
.mafia-role-chip.role-doctor .mafia-role-marker { background: #00c853; color: #07130b; }
.mafia-role-chip.role-maniac .mafia-role-marker { background: #ff9800; color: #201000; }
.mafia-role-chip.role-beauty .mafia-role-marker { background: #ff80ab; color: #2b0713; }
.mafia-role-chip.role-unknown .mafia-role-marker { background: #607d8b; }

.mafia-role-settings {
    width: 100%;
    margin-bottom: 20px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.08);
}

.mafia-role-settings-title {
    margin-bottom: 12px;
    font-weight: 900;
    color: var(--accent);
    text-align: center;
}

.mafia-role-setting {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.mafia-role-setting:last-of-type {
    border-bottom: 0;
}

.mafia-offline-role-setting {
    display: none;
}

.mafia-role-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: #fff;
}

.mafia-role-dot.role-mafia { background: #ef5350; }
.mafia-role-dot.role-civilian { background: #81c784; color: #07130b; }
.mafia-role-dot.role-commissioner { background: #448aff; }
.mafia-role-dot.role-doctor { background: #00c853; color: #07130b; }
.mafia-role-dot.role-maniac { background: #ff9800; color: #201000; }
.mafia-role-dot.role-beauty { background: #ff80ab; color: #2b0713; }

.mafia-role-setting-label {
    min-width: 0;
    text-align: left;
    font-weight: 800;
}

.mafia-role-stepper {
    display: grid;
    grid-template-columns: 36px 34px 36px;
    align-items: center;
    gap: 6px;
}

.mafia-role-stepper .btn-small {
    width: 36px;
    height: 36px;
    padding: 0;
}

.mafia-role-stepper .target-value {
    min-width: 34px;
    text-align: center;
    font-size: 1.15rem;
}

.mafia-role-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-weight: 900;
    color: var(--text-primary);
}

.mafia-victory-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -8px 0 12px;
    padding: 0 6px;
}

.mafia-victory-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.18);
    display: grid;
    place-items: center;
    font-weight: 900;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0,0,0,.24);
    transition: transform .15s ease, box-shadow .15s ease;
}

.mafia-victory-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(0,0,0,.32);
}

.mafia-victory-btn.victory-mafia {
    background: linear-gradient(135deg, #ef5350, #9f1717);
}

.mafia-victory-btn.victory-maniac {
    background: linear-gradient(135deg, #ffb74d, #ef6c00);
    color: #201000;
}

.mafia-victory-btn.victory-civilians {
    background: linear-gradient(135deg, #81c784, #1b5e20);
    color: #07130b;
}

.mafia-kill-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ef5350, #b71c1c);
    color: #fff;
    font-size: 1.35rem;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(239,83,80,.28);
    cursor: pointer;
}

.mafia-kill-btn:active {
    transform: scale(.96);
}

.mafia-nominate-btn {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #5b6264, #2b3031);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0,0,0,.22);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.mafia-nominate-btn.selected {
    background: linear-gradient(135deg, #81c784, #1b5e20);
    color: #07130b;
    box-shadow: 0 0 0 3px rgba(129,199,132,.16), 0 10px 24px rgba(0,0,0,.24);
}

.mafia-nominate-btn:active {
    transform: scale(.96);
}

.mafia-player-item.nominated {
    border-color: rgba(129,199,132,.5);
    box-shadow: 0 0 0 1px rgba(129,199,132,.16), 0 10px 24px rgba(0,0,0,.18);
}

.mafia-empty-vote {
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
}

.mafia-night-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.mafia-night-actions.count-4 {
    display: grid;
    grid-template-columns: repeat(2, 38px);
    grid-auto-rows: 38px;
    justify-content: end;
    align-items: center;
    gap: 8px;
}

.mafia-night-action {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
    background: linear-gradient(135deg, #5b6264, #2b3031);
    opacity: .72;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.mafia-night-actions.count-4 .mafia-night-action {
    width: 38px;
    height: 38px;
}

.mafia-night-action:hover,
.mafia-night-action.selected {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,.5);
}

.mafia-night-action.missing {
    border-color: rgba(255, 235, 59, .95);
    box-shadow: 0 0 0 3px rgba(255, 235, 59, .2), 0 0 22px rgba(255, 235, 59, .3);
    animation: mafiaMissingPulse 1.2s ease-in-out infinite;
}

.mafia-night-action.selected {
    box-shadow: 0 0 0 3px rgba(255,255,255,.14), 0 0 18px rgba(255,255,255,.18);
    opacity: 1;
}

.mafia-night-action.action-mafia.selected {
    background: linear-gradient(135deg, #ef5350, #b71c1c);
}

.mafia-night-action.action-doctor.selected {
    background: linear-gradient(135deg, #00c853, #087f23);
    color: #07130b;
}

.mafia-night-action.action-maniac.selected {
    background: linear-gradient(135deg, #ffb74d, #ef6c00);
    color: #201000;
}

.mafia-night-action.action-beauty.selected {
    background: linear-gradient(135deg, #ff80ab, #ad1457);
    color: #2b0713;
}

.mafia-player-item.dead {
    opacity: 0.5;
    background: rgba(239, 83, 80, 0.1);
    border-color: rgba(239, 83, 80, 0.3);
}

.mafia-role-reveal-row {
    cursor: pointer;
    border-color: rgba(129, 199, 132, .28);
}

.mafia-role-reveal-row:active {
    transform: scale(.99);
}

.mafia-role-show-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, .88);
    backdrop-filter: blur(8px);
}

.mafia-role-show-card {
    width: min(86vw, 360px);
    min-height: min(78vh, 560px);
    padding: 18px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(160deg, rgba(19, 32, 25, .96), rgba(5, 10, 8, .98));
    border: 1px solid rgba(255,255,255,.16);
    box-shadow: 0 28px 80px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.04);
    transform-style: preserve-3d;
    animation: mafiaRoleFlipIn .28s ease both;
}

.mafia-role-show-img {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 3 / 4;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 18px 42px rgba(0,0,0,.38);
}

.mafia-role-show-name {
    font-size: clamp(2rem, 8vw, 3.2rem);
    line-height: 1;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    color: var(--accent);
}

.mafia-role-show-player {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-primary);
    text-align: center;
}

.mafia-role-show-hint {
    max-width: 260px;
    color: var(--text-secondary);
    font-size: .9rem;
    font-weight: 800;
    text-align: center;
}

.mafia-role-show-card.role-mafia .mafia-role-show-name { color: #ef5350; }
.mafia-role-show-card.role-commissioner .mafia-role-show-name { color: #448aff; }
.mafia-role-show-card.role-doctor .mafia-role-show-name { color: #00c853; }
.mafia-role-show-card.role-maniac .mafia-role-show-name { color: #ffb74d; }
.mafia-role-show-card.role-beauty .mafia-role-show-name { color: #ff80ab; }

@keyframes mafiaRoleFlipIn {
    from {
        opacity: 0;
        transform: rotateY(88deg) scale(.96);
    }
    to {
        opacity: 1;
        transform: rotateY(0) scale(1);
    }
}

.mafia-dead-role-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 3 / 4;
    margin-top: 18px;
    padding: 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(95, 105, 112, .82), rgba(45, 49, 54, .92));
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 14px 34px rgba(0,0,0,.24);
    overflow: hidden;
    align-self: center;
}

.mafia-dead-role-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) brightness(.42);
    opacity: .6;
}

.mafia-dead-role-card::before,
.mafia-dead-role-card::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 130%;
    height: 7px;
    border-radius: 999px;
    background: rgba(239, 83, 80, .92);
    box-shadow: 0 0 18px rgba(239, 83, 80, .35);
    transform-origin: center;
    pointer-events: none;
}

.mafia-dead-role-card::before {
    transform: translate(-50%, -50%) rotate(18deg);
}

.mafia-dead-role-card::after {
    transform: translate(-50%, -50%) rotate(-18deg);
}

.mafia-dead-role-marker {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: white;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.22);
    z-index: 2;
}

.mafia-dead-role-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(0,0,0,.28);
    backdrop-filter: blur(2px);
}

.mafia-dead-role-name {
    position: relative;
    z-index: 2;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 0;
    color: rgba(255,255,255,.82);
    text-transform: uppercase;
}

.mafia-dead-role-player {
    position: relative;
    z-index: 2;
    max-width: 100%;
    font-weight: 900;
    color: rgba(255,255,255,.9);
    text-align: center;
}

.mafia-dead-role-card.role-mafia .mafia-dead-role-marker { background: #ef5350; }
.mafia-dead-role-card.role-civilian .mafia-dead-role-marker { background: #81c784; color: #07130b; }
.mafia-dead-role-card.role-commissioner .mafia-dead-role-marker { background: #448aff; }
.mafia-dead-role-card.role-doctor .mafia-dead-role-marker { background: #00c853; color: #07130b; }
.mafia-dead-role-card.role-maniac .mafia-dead-role-marker { background: #ff9800; color: #201000; }
.mafia-dead-role-card.role-beauty .mafia-dead-role-marker { background: #ff80ab; color: #2b0713; }

.role-card-container {
    perspective: 1000px;
    width: 280px;
    height: 400px;
    margin: 20px auto;
}

.role-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.role-card.flipped {
    transform: rotateY(180deg);
}

.role-card-front, .role-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.role-card-front {
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    background-image: url('assets/crocodile_mafia_2.svg'); /* Decorative back */
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%;
    opacity: 0.8;
}

.role-card-back {
    background: rgba(20, 20, 25, 0.95);
    transform: rotateY(180deg);
}

/* Neon Glows */
.role-mafia .role-card-back {
    border-color: #ef5350;
    box-shadow: 0 0 30px rgba(239, 83, 80, 0.4);
}
.role-commissioner .role-card-back {
    border-color: #448aff;
    box-shadow: 0 0 30px rgba(68, 138, 255, 0.4);
}
.role-doctor .role-card-back {
    border-color: #00e676;
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.4);
}
.role-civilian .role-card-back {
    border-color: #e8f5e9;
    box-shadow: 0 0 30px rgba(232, 245, 233, 0.2);
}

.role-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 20px;
}

.role-name {
    font-size: 2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
}

.mafia-host-controls {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.mafia-host-controls .btn {
    flex: 1 1 0;
    max-width: 320px;
    min-width: 0;
}

.mafia-host-controls .btn:disabled {
    opacity: .45;
    filter: grayscale(1);
    cursor: not-allowed;
}

.mafia-night-warning {
    width: 100%;
    max-width: 760px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 235, 59, .35);
    background: rgba(75, 63, 14, .42);
    color: #fff6b0;
    font-weight: 800;
    text-align: center;
    margin: 0 auto 10px;
}

.mafia-phase-card {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
}

.mafia-phase-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .18;
    pointer-events: none;
}

.mafia-phase-head {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.mafia-phase-icon {
    font-size: 2.4rem;
    line-height: 1;
}

#mafia-host-phase {
    font-weight: 900;
    font-size: 1.3rem;
    color: var(--accent);
    text-transform: uppercase;
}

.mafia-hints-toggle {
    min-width: 82px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(129,199,132,.3);
    background: rgba(8, 22, 14, .72);
    color: var(--text-secondary);
    font-size: .78rem;
    font-weight: 900;
    cursor: pointer;
}

#mafia-phase-instruction {
    position: relative;
    z-index: 1;
    margin: 0;
    padding-top: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

.mafia-phase-card.mafia-hints-collapsed {
    padding-block: 16px;
}

.mafia-phase-card.mafia-hints-collapsed #mafia-phase-instruction,
.mafia-phase-card.mafia-hints-disabled #mafia-phase-instruction {
    display: none;
}

.mafia-phase-card.mafia-hints-disabled .mafia-hints-toggle {
    display: none;
}

@media (max-width: 420px) {
    .mafia-phase-head {
        grid-template-columns: 34px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .mafia-phase-icon {
        font-size: 1.9rem;
    }

    #mafia-host-phase {
        font-size: 1.05rem;
    }

    .mafia-hints-toggle {
        min-width: 74px;
        min-height: 34px;
        padding: 0 10px;
        font-size: .72rem;
    }
}

.mafia-last-word-timer {
    width: 100%;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid rgba(129,199,132,.22);
    border-radius: 12px;
    background: rgba(9, 18, 13, .78);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
}

.mafia-last-word-title {
    font-weight: 900;
    color: var(--accent);
    min-width: 0;
}

.mafia-timer-value {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    min-width: 82px;
    text-align: right;
}

.mafia-timer-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mafia-timer-round {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.16);
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #81c784, #1b5e20);
    color: #07130b;
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,.22);
}

.mafia-timer-round.running {
    background: linear-gradient(135deg, #ffd54f, #f9a825);
}

.mafia-timer-round.reset {
    background: linear-gradient(135deg, #ef5350, #9f1717);
    color: #fff;
}

.mafia-timer-round:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.mafia-phase-card.phase-reveal::before {
    background: radial-gradient(circle at 50% 0%, rgba(255,193,7,.7), transparent 55%);
}

.mafia-phase-card.phase-night {
    background: rgba(12, 18, 35, .78);
    border-color: rgba(68, 138, 255, .3);
}

.mafia-phase-card.phase-night::before {
    background: radial-gradient(circle at 50% 0%, rgba(68,138,255,.75), transparent 58%);
}

.mafia-phase-card.phase-day {
    background: rgba(26, 34, 15, .78);
    border-color: rgba(255,193,7,.28);
}

.mafia-phase-card.phase-day::before {
    background: radial-gradient(circle at 50% 0%, rgba(255,193,7,.7), transparent 58%);
}

.mafia-phase-card.phase-talk {
    background: rgba(14, 31, 25, .78);
    border-color: rgba(129,199,132,.28);
}

.mafia-phase-card.phase-talk::before {
    background: radial-gradient(circle at 50% 0%, rgba(129,199,132,.65), transparent 58%);
}

.mafia-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-mafia { background: #ef5350; color: white; }
.badge-civ { background: #81c784; color: black; }
.badge-dead { background: #37474f; color: #cfd8dc; }

@keyframes nightPulse {
    0% { background-color: rgba(0,0,0,0); }
    50% { background-color: rgba(20,20,40,0.5); }
    100% { background-color: rgba(0,0,0,0); }
}

@keyframes mafiaMissingPulse {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-1px) scale(1.07); }
}

.night-effect {
    animation: nightPulse 4s infinite ease-in-out;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: center;
}

/* ─── RULES ───────────────────────────────────────── */

.rules-card {
    padding: 20px;
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-height: 60vh;
    overflow-y: auto;
}

.rules-card strong {
    color: var(--text-primary);
}

/* ─── SETUP ───────────────────────────────────────── */

.setup-card {
    padding: 20px;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setup-card label {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input {
    padding: 12px 16px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input:focus {
    border-color: var(--accent);
}

.target-card {
    align-items: center;
}

.target-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.target-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold);
    min-width: 60px;
    text-align: center;
}

/* ─── WORD PICK ───────────────────────────────────── */

.turn-header {
    text-align: center;
    margin-bottom: 10px;
}

.turn-team {
    color: var(--accent);
    font-size: 1.3rem;
}

.scoreboard {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 4px;
}

.word-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 360px;
}

.word-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid var(--border-glass);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1rem;
    text-align: left;
}

.word-card:active {
    transform: scale(0.97);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.25);
}

.word-diff {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.word-text {
    flex: 1;
    font-weight: 700;
    font-size: 1.1rem;
}

.word-pts {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* ─── TIMER ───────────────────────────────────────── */

.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
}

.timer-ring {
    position: relative;
    width: 220px;
    height: 220px;
}

.timer-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    /* 2 * PI * 90 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.timer-progress.warning {
    stroke: #ffa726;
}

.timer-progress.danger {
    stroke: var(--danger);
}

.timer-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-seconds {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text-primary);
}

.timer-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.timer-word {
    padding: 14px 28px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    text-align: center;
}

.timer-buttons {
    display: flex;
    gap: 30px;
}

.btn-stop-timer {
    margin-top: 10px;
    color: var(--danger);
    opacity: 0.7;
    font-size: 0.9rem;
    padding: 8px 20px;
    max-width: 200px;
}

/* ─── RESULT ──────────────────────────────────────── */

.result-content {
    gap: 20px;
    padding-top: 60px;
}

.result-icon {
    font-size: 5rem;
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }

    70% {
        transform: scale(1.2);
    }

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

.result-text {
    font-size: 1.5rem;
}

.result-score {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ─── GAME OVER ───────────────────────────────────── */

.gameover-content {
    gap: 16px;
    padding-top: 40px;
    position: relative;
}

.gameover-title {
    font-size: 5rem;
    animation: popIn 0.5s ease;
}

.gameover-winner {
    font-size: 1.6rem;
    color: var(--gold);
}

.gameover-score {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Confetti */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    top: -20px;
    animation: confettiFall 3s ease-in forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ═══ SETTINGS & STATUS ═══ */

.status-card {
    padding: 24px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.status-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.status-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 900;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.badge.regular { border-color: var(--text-muted); color: var(--text-secondary); }
.badge.vip { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px rgba(255, 215, 0, 0.2); }
.badge.promo { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px rgba(0, 230, 118, 0.2); }

.status-info {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.status-info small {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 4px;
}

.promo-card {
    padding: 20px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.promo-card h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}


/* ─── SUBSCRIBE ───────────────────────────────────── */

.sub-info {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    width: 100%;
    max-width: 360px;
}

.sub-plans {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 360px;
}

.sub-plan {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.sub-plan:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.sub-plan.highlight {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.plan-badge {
    position: absolute;
    top: -10px;
    right: 12px;
    background: var(--gold);
    color: #1a1a1a;
    padding: 2px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
}

.plan-icon {
    font-size: 1.8rem;
}

.plan-name {
    flex: 1;
    font-weight: 700;
    font-size: 1.05rem;
}

.plan-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-stepper .plan-name {
    min-width: 36px;
    text-align: center;
    font-size: 1.2rem;
}

.stepper-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    background: transparent;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.stepper-btn:active {
    transform: scale(0.9);
    border-color: var(--gold);
    color: var(--gold);
}

.plan-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.plan-price {
    font-weight: 800;
    color: var(--gold);
    font-size: 1.1rem;
}

.sub-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* ─── NO ACCESS ───────────────────────────────────── */

.noaccess-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

#screen-noaccess .screen-content {
    text-align: center;
}

#screen-noaccess p {
    color: var(--text-secondary);
    max-width: 300px;
}

/* ─── Scrollbar ───────────────────────────────────── */

::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 4px;
}

/* ─── Confirm Overlay ────────────────────────────── */

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.confirm-overlay.hidden {
    display: none;
}

.confirm-box {
    padding: 28px 24px;
    text-align: center;
    max-width: 300px;
    width: 85%;
    animation: popIn 0.25s ease;
}

.confirm-box p {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.confirm-buttons {
    display: flex;
    gap: 12px;
}

.confirm-buttons .btn {
    flex: 1;
    padding: 12px;
}


/* ─── HAT GAME SPECIFIC STYLES ─── */

.result-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    font-size: 1.4rem;
    font-weight: 700;
}

.score-badge {
    background: var(--gold);
    color: #1a1a1a;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 900;
}

/* Hat play: большая карточка слова */
#screen-hat-play .word-card {
    position: relative;
    min-height: 180px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

#hat-current-word {
    text-transform: uppercase;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.hat-pause-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    border-radius: inherit;
    background: rgba(8, 14, 11, .96);
    color: var(--text-primary);
    text-align: center;
    backdrop-filter: blur(12px);
}

.hat-pause-overlay strong {
    font-size: 2rem;
    letter-spacing: .12em;
}

.hat-pause-overlay span:last-child {
    color: var(--text-secondary);
    font-size: .9rem;
}

.hat-pause-icon {
    font-size: 2.2rem;
}

.hat-timer-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.hat-timer-actions .btn {
    flex: 1;
    padding-inline: 12px;
}

.hat-word-field.input-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-dim);
}

#screen-hat-play button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

/* Hat play: кнопки угадали/пропуск */
#screen-hat-play .btn-danger,
#screen-hat-play .btn-primary {
    max-width: none;
}

/* Hat home: оранжевый акцент */
#screen-hat-home {
    background: radial-gradient(ellipse at center bottom, rgba(80, 50, 20, 0.4) 0%, var(--bg-primary) 70%);
}

.title.hat {
    background: linear-gradient(135deg, #ffa726, #ff7043);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.title.mafia {
    background: linear-gradient(135deg, #ef5350, #ff80ab);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mafia-rules-card {
    max-height: 68vh;
    overflow-y: auto;
    text-align: left;
}

.mafia-rules-card h3 {
    margin: 14px 0 8px;
    color: var(--accent);
    font-size: 1.08rem;
}

.mafia-rules-card ul,
.mafia-rules-card ol {
    padding-left: 20px;
    margin: 8px 0 14px;
}

.mafia-rules-card li {
    margin-bottom: 8px;
}

.mafia-role-word {
    font-weight: 900;
    color: var(--text-primary);
}

.mafia-role-word.role-commissioner { color: #72a7ff; }
.mafia-role-word.role-doctor { color: #45e08b; }
.mafia-role-word.role-maniac { color: #ffb74d; }
.mafia-role-word.role-beauty { color: #ff80ab; }

.mafia-night-note {
    color: var(--text-primary);
    font-weight: 800;
}

/* ═══ DEVELOPER FOOTER ═══ */
.developer-footer {
    position: fixed;
    bottom: 12px;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    pointer-events: none;
    z-index: 9999;
    text-transform: lowercase;
    opacity: 0.8;
}
