/* ==========================================================================
   ВОЕННАЯ РУЛЕТКА: БИТВА ДЕРЖАВ - МИНИМАЛИСТИЧНЫЙ ДИЗАЙН
   ========================================================================== */

:root {
    --bg-dark: #07090e;
    --bg-card: rgba(14, 20, 32, 0.85);
    --border-card: rgba(56, 189, 248, 0.18);
    --accent-cyan: #38bdf8;
    --accent-gold: #f59e0b;
    --accent-purple: #a855f7;
    --accent-red: #f43f5e;
    --accent-green: #10b981;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.05) 0%, transparent 60%),
        linear-gradient(180deg, #090d16 0%, #06080d 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 28px;
    background: rgba(9, 13, 22, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-badge {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.logo-text h1 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

.logo-text p {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-code-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.btn-sound {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sound:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   VIEW: ЛОББИ
   ========================================================================== */
.view-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 20px;
}

.lobby-hero {
    text-align: center;
    margin-bottom: 32px;
}

.hero-tag {
    display: inline-block;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--accent-cyan);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.lobby-hero h2 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.lobby-hero p {
    color: var(--text-muted);
    font-size: 14px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

.lobby-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 800px) {
    .lobby-grid {
        grid-template-columns: 1fr;
    }
}

.card-panel {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 22px;
}

.panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.text-input {
    width: 100%;
    background: rgba(6, 9, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 10px 12px;
    color: #fff;
    font-family: var(--font-main);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

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

.avatar-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.avatar-option {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.avatar-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.avatar-option.selected {
    border-color: var(--accent-cyan);
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-cyan);
}

.color-input {
    width: 100%;
    height: 36px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-cyan);
    border: none;
    border-radius: 6px;
    color: #06090f;
    font-weight: 700;
    font-size: 13px;
    padding: 11px 16px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
    background: #7dd3fc;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.btn-quick {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid var(--accent-purple);
    color: #c084fc;
}

.btn-quick:hover:not(:disabled) {
    background: rgba(168, 85, 247, 0.25);
    color: #fff;
}

.join-row {
    display: flex;
    gap: 8px;
}

.room-display-box {
    background: rgba(6, 9, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    margin-bottom: 14px;
}

.room-code-label {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.room-code-tag {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    margin: 4px 0 8px 0;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    max-height: 200px;
    overflow-y: auto;
}

.lobby-player-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(6, 9, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 8px 10px;
}

.player-avatar {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 13px;
    font-weight: 600;
}

.player-status {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.btn-kick {
    background: transparent;
    border: none;
    color: var(--accent-red);
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
}

.room-actions {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   VIEW: РУЛЕТКА (10 ЭТАПОВ)
   ========================================================================== */
.roulette-header-zone {
    text-align: center;
    margin-bottom: 16px;
}

.stage-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stage-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.stage-desc {
    color: var(--text-muted);
    font-size: 13px;
}

.stage-progress-bar {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 14px auto 18px auto;
    max-width: 500px;
}

.stage-seg {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s;
}

.stage-seg.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.stage-seg.completed {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.turn-banner {
    padding: 10px 16px;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.turn-banner.my-turn {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
}

.turn-banner.opponent-turn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* КОЛЕСО */
.roulette-arena-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: center;
}

@media (max-width: 900px) {
    .roulette-arena-layout {
        grid-template-columns: 1fr;
    }
}

.wheel-wrapper {
    position: relative;
    width: 440px;
    height: 440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 500px) {
    .wheel-wrapper {
        width: 320px;
        height: 320px;
    }
}

#roulette-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 24px;
    z-index: 20;
    pointer-events: none;
    transition: transform 0.05s ease-out;
}

.wheel-pointer::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 18px solid var(--accent-cyan);
}

.wheel-pointer.tick-bounce {
    animation: pointerBounce 0.06s ease-out;
}

@keyframes pointerBounce {
    0% { transform: translateX(-50%) rotate(0deg); }
    50% { transform: translateX(-50%) rotate(-12deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

.wheel-center-button {
    position: absolute;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: #090d16;
    border: 2px solid var(--accent-cyan);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.15s;
    text-align: center;
}

.wheel-center-button:hover:not(.disabled) {
    background: #0e172a;
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.7);
    transform: scale(1.05);
}

.wheel-center-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

#center-btn-text {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

/* ДОСЬЕ */
.dossier-panel {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 16px;
    max-height: 480px;
    overflow-y: auto;
}

.dossier-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.players-dossier-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dossier-card {
    background: rgba(6, 9, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid;
    border-radius: 6px;
    padding: 10px;
}

.dossier-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dossier-avatar {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
}

.dossier-name {
    font-size: 12px;
    font-weight: 600;
}

.dossier-items-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.dossier-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    padding: 3px 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
}

.dossier-stage-num {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 9px;
}

.dossier-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   МОДАЛКА: ВЫПАДЕНИЕ ПРЕДМЕТА
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.reveal-card {
    background: #090e18;
    border: 1px solid;
    border-radius: 12px;
    padding: 28px 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.reveal-player {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.reveal-badges-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

.reveal-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: 3px;
}

.reveal-rarity-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    border: 1px solid;
    padding: 3px 8px;
    border-radius: 3px;
}

.reveal-title {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
}

.reveal-stats {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--accent-cyan);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.reveal-desc {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 20px;
}

/* ==========================================================================
   VIEW: АРЕНА ВОЙНЫ
   ========================================================================== */
.battle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.battle-title h2 {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
}

.battle-title p {
    color: var(--text-muted);
    font-size: 12px;
}

.battle-controls {
    display: flex;
    gap: 6px;
}

.btn-speed {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    padding: 5px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
}

.btn-speed.active {
    background: var(--accent-cyan);
    color: #06090f;
    border-color: var(--accent-cyan);
}

.battle-arena-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .battle-arena-layout {
        grid-template-columns: 1fr;
    }
}

.battle-countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.battle-country-card {
    background: var(--bg-card);
    border: 1px solid;
    border-radius: 8px;
    padding: 14px;
    position: relative;
    transition: all 0.2s;
}

.battle-country-card.defeated {
    opacity: 0.35;
    border-color: #334155 !important;
}

.battle-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.battle-card-avatar {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
}

.battle-country-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.battle-country-sub {
    font-size: 10px;
    color: var(--text-muted);
}

.status-badge-dead {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    padding: 2px 6px;
    border-radius: 3px;
}

.battle-stats-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.stat-bar-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.bar-track {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    transition: width 0.25s ease-out;
}

.hp-fill {
    background: var(--accent-green);
}

.shield-fill {
    background: var(--accent-cyan);
}

.battle-cards-tactics {
    display: flex;
    gap: 6px;
}

.battle-tactic-pill, .battle-weapon-pill {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 10px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.pill-tag {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-muted);
}

.pill-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

/* ЖУРНАЛ БОЯ */
.battle-log-panel {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px;
    height: 460px;
    display: flex;
    flex-direction: column;
}

.log-panel-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.combat-log-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-mono);
}

.combat-log-item {
    font-size: 11px;
    line-height: 1.4;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(6, 9, 15, 0.6);
    border-left: 2px solid rgba(255, 255, 255, 0.15);
}

.log-round-header {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-cyan);
    color: var(--accent-cyan);
    font-weight: 700;
}

.log-tactic {
    border-left-color: var(--accent-purple);
}

.log-superweapon {
    border-left-color: var(--accent-red);
}

.log-death {
    border-left-color: var(--accent-red);
    color: #fda4af;
}

.log-winner {
    border-left-color: var(--accent-gold);
    color: #fde047;
    font-weight: 700;
}

/* ==========================================================================
   МОДАЛКА: ПОБЕДА
   ========================================================================== */
.victory-card {
    background: #090e18;
    border: 1px solid var(--accent-gold);
    border-radius: 12px;
    padding: 32px 24px;
    max-width: 440px;
    width: 90%;
    text-align: center;
}

.victory-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 10px;
}

.victory-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.victory-sub {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 16px;
}

.victory-winner-avatar {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    border: 2px solid;
    margin: 0 auto 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
}

.victory-winner-name {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
}

.victory-stats-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
}

.vic-stat {
    display: flex;
    justify-content: space-between;
}

.vic-stat span {
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}
