:root {
    --bg-dark: #090d16;
    --bg-card: #131a29;
    --bg-card-hover: #1a2336;
    --primary: #f59e0b;
    --primary-glow: rgba(245, 158, 11, 0.4);
    --secondary: #6366f1;
    --accent: #10b981;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* LANDING PAGE STYLES */
.landing-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #090d16 80%);
    padding: 20px;
}

.landing-container {
    max-width: 800px;
    width: 100%;
}

.landing-card {
    background: rgba(19, 26, 41, 0.85);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.logo-badge {
    display: inline-block;
    padding: 6px 18px;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.landing-title {
    font-family: 'Russo One', sans-serif;
    font-size: 46px;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.landing-title span {
    color: var(--primary);
    text-shadow: 0 0 25px var(--primary-glow);
}

.landing-subtitle {
    font-size: 17px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 36px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 40px;
    text-align: left;
}

.feature-item {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 18px;
}

.feature-item .icon {
    font-size: 28px;
    display: block;
    margin-bottom: 10px;
}

.feature-item h4 {
    font-size: 16px;
    margin-bottom: 6px;
    color: #fff;
}

.feature-item p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.bot-info-box {
    margin-top: 30px;
    font-size: 14px;
    color: var(--text-muted);
}

.bot-info-box a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #090d16;
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(245, 158, 11, 0.6);
}

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

.btn-large {
    padding: 18px 36px;
    font-size: 18px;
    border-radius: 18px;
}

.btn-tv {
    padding: 20px 48px;
    font-size: 22px;
    letter-spacing: 1px;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.pulse-btn:not(:disabled) {
    animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
    70% { box-shadow: 0 0 0 20px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* TV SCREEN FULLSCREEN LAYOUT */
.tv-screen-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 50% 10%, #171b30 0%, #07090e 100%);
    padding: 24px 36px;
}

.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-mini {
    font-family: 'Russo One', sans-serif;
    font-size: 20px;
    color: var(--primary);
    letter-spacing: 1px;
}

.room-tag {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
}

.room-tag span {
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
}

.round-badge {
    background: linear-gradient(135deg, var(--secondary), #4338ca);
    padding: 8px 24px;
    border-radius: 999px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.icon-control-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 20px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.2s;
}

.icon-control-btn:hover {
    background: var(--bg-card-hover);
}

.tv-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 24px;
    position: relative;
}

.view-panel {
    display: none;
    flex: 1;
    animation: fadeIn 0.4s ease forwards;
}

.view-panel.active {
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.99); }
    to { opacity: 1; transform: scale(1); }
}

/* LOBBY */
.lobby-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 36px;
    flex: 1;
}

.qr-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.qr-wrapper {
    background: #ffffff;
    padding: 16px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 24px;
}

.qr-img {
    width: 250px;
    height: 250px;
    display: block;
}

.qr-instructions h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.qr-instructions p {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.bot-link {
    color: var(--primary);
    font-size: 18px;
}

.room-code-badge {
    display: inline-block;
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed var(--primary);
    border-radius: 14px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--primary);
}

.players-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 36px;
    display: flex;
    flex-direction: column;
}

.card-header h2 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 20px;
}

.lobby-players-list {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    align-content: flex-start;
    padding: 10px 0;
    overflow-y: auto;
}

.lobby-player-chip {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lobby-player-chip .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 900;
    color: #000;
}

.no-players-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: var(--text-muted);
}

.lobby-actions {
    margin-top: 24px;
    text-align: center;
}

.lobby-hint {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-muted);
}

/* PLAY SCREEN (РАУНД) */
.round-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 24px;
}

.round-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timer-box {
    display: flex;
    align-items: center;
}

.timer-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 4px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Russo One', sans-serif;
    font-size: 38px;
    color: var(--primary);
    box-shadow: 0 0 25px var(--primary-glow);
    transition: all 0.3s;
}

.timer-circle.warning {
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
    animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.movie-meta-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 28px;
    border-radius: 18px;
}

.meta-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    margin-right: 10px;
}

.meta-val {
    font-size: 26px;
    font-weight: 900;
    color: var(--primary);
}

.association-showcase {
    background: linear-gradient(145deg, #161e31, #0f1523);
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 32px;
    padding: 48px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.showcase-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--primary);
    margin-bottom: 20px;
}

.association-main-text {
    font-family: 'Russo One', sans-serif;
    font-size: 54px;
    line-height: 1.25;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    max-width: 1000px;
}

.showcase-hint {
    margin-top: 24px;
    font-size: 16px;
    color: var(--text-muted);
}

.round-players-board {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px 32px;
    flex: 1;
}

.board-title {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.players-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.player-round-card {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.player-round-card.guessed {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.15);
}

.player-round-card .p-info .p-name {
    font-size: 18px;
    font-weight: 800;
}

.player-round-card .p-info .p-score {
    font-size: 14px;
    color: var(--text-muted);
}

.player-round-card .p-status {
    text-align: right;
}

.p-status .clues-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.p-status .guessed-badge {
    color: var(--accent);
    font-size: 16px;
    font-weight: 800;
    display: block;
    margin-top: 4px;
}

/* ROUND END SCREEN (ИНТЕРМИССИЯ) */
.round-end-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 36px;
    flex: 1;
}

.answer-reveal-card {
    background: var(--bg-card);
    border: 2px solid var(--accent);
    border-radius: 32px;
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.2);
}

.reveal-badge {
    padding: 6px 18px;
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.reveal-poster {
    font-size: 72px;
    margin-bottom: 12px;
}

.reveal-title {
    font-family: 'Russo One', sans-serif;
    font-size: 48px;
    color: #ffffff;
    margin-bottom: 8px;
}

.reveal-year {
    font-size: 22px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.associations-history-box {
    width: 100%;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 18px;
}

.associations-history-box h4 {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.assoc-pills-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.assoc-pills-list li {
    padding: 8px 14px;
    background: var(--bg-card-hover);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
}

.round-results-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 32px;
    padding: 36px;
    display: flex;
    flex-direction: column;
}

.round-results-card h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.results-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.result-row {
    background: var(--bg-card-hover);
    border-radius: 16px;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 17px;
    font-weight: 700;
}

.result-row .pts {
    font-size: 20px;
    font-weight: 900;
    color: var(--accent);
}

.result-row .pts.zero {
    color: var(--text-muted);
}

.next-round-timer {
    margin-top: 20px;
    text-align: center;
    font-size: 15px;
    color: var(--primary);
    font-weight: 700;
}

/* FINISH SCREEN */
.finish-layout {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: 36px;
    padding: 48px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 60px var(--primary-glow);
    flex: 1;
}

.finish-confetti-badge {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.finish-title {
    font-family: 'Russo One', sans-serif;
    font-size: 54px;
    margin-bottom: 28px;
}

.winner-crown-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.05));
    border: 2px solid var(--primary);
    border-radius: 28px;
    padding: 30px 60px;
    margin-bottom: 36px;
    box-shadow: 0 10px 40px var(--primary-glow);
}

.crown-icon {
    font-size: 64px;
    margin-bottom: 8px;
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.winner-name {
    font-family: 'Russo One', sans-serif;
    font-size: 42px;
    color: #fff;
    margin-bottom: 6px;
}

.winner-score {
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 2px;
}

.leaderboard-full-card {
    width: 100%;
    max-width: 650px;
    margin-bottom: 36px;
}

.leaderboard-full-card h2 {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leader-item {
    background: var(--bg-card-hover);
    border-radius: 14px;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 700;
}

.finish-actions {
    display: flex;
    gap: 20px;
}

/* AUDIO OVERLAY */
.audio-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 13, 22, 0.95);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

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

.audio-overlay-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 48px;
    text-align: center;
    max-width: 550px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
}

.audio-overlay-card h2 {
    font-size: 28px;
    margin-bottom: 16px;
}

.audio-overlay-card p {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 32px;
}

.hidden {
    display: none !important;
}
