* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    background-color: #05080d;
    color: #8b9cb5;
    font-family: 'Courier New', 'Consolas', monospace;
    overflow-x: hidden;
    overflow-y: auto;
}

.war-room {
    padding: 8px;
    max-width: 1900px;
    margin: 0 auto;
}

/* COMPACT TOP BAR */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #0a1220 0%, #151a28 100%);
    border: 2px solid #3d5470;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 8px;
    box-shadow: 0 0 20px rgba(90, 143, 199, 0.2);
}

.title-section {
    flex-shrink: 0;
}

.title-section h1 {
    margin: 0;
    color: #5a8fc7;
    font-size: 16px;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(90, 143, 199, 0.5);
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { text-shadow: 0 0 15px rgba(90, 143, 199, 0.5); }
    50% { text-shadow: 0 0 25px rgba(90, 143, 199, 0.8); }
}

.system-status {
    font-size: 9px;
    color: #7aa8d9;
    letter-spacing: 1px;
    margin-top: 2px;
}

.match-section {
    flex-grow: 1;
    text-align: center;
    font-size: 12px;
    color: #7aa8d9;
    font-weight: bold;
}

.controls-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@keyframes border-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(90, 143, 199, 0.3); }
    50% { box-shadow: 0 0 30px rgba(90, 143, 199, 0.6); }
}

.pulse-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #5a8fc7;
    border-radius: 50%;
    margin-right: 10px;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* BUTTONS */
.primary-btn, .secondary-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
    border: 2px solid;
    transition: all 0.3s ease;
}

.primary-btn {
    background-color: #4a7aaa;
    color: #e8ecf0;
    border-color: #5a8fc7;
}

.primary-btn:hover {
    background-color: #5a8fc7;
    box-shadow: 0 0 15px rgba(90, 143, 199, 0.5);
    transform: translateY(-2px);
}

.primary-btn:disabled {
    background-color: #2a3a4a;
    color: #4a5a6a;
    cursor: not-allowed;
    border-color: #3d5470;
}

.secondary-btn {
    background-color: transparent;
    color: #7aa8d9;
    border-color: #3d5470;
}

.secondary-btn:hover {
    background-color: #1f2938;
    border-color: #5a8fc7;
}

.control-group {
    margin-top: 6px;
}

.control-group label {
    color: #7aa8d9;
    font-size: 11px;
    letter-spacing: 1px;
}

input[type="range"] {
    width: 150px;
    vertical-align: middle;
    margin: 0 6px;
}

#speedValue {
    color: #5a8fc7;
    font-weight: bold;
}

/* DASHBOARD GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr 340px;
    gap: 8px;
    margin-bottom: 8px;
}

/* SECTION HEADERS */
.section-header {
    background: linear-gradient(90deg, #3d5470 0%, #2a3a4a 100%);
    color: #5a8fc7;
    padding: 3px 6px;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    border-left: 3px solid #5a8fc7;
    margin-bottom: 3px;
    text-shadow: 0 0 10px rgba(90, 143, 199, 0.5);
}

/* LEFT PANEL - STRATEGY CARDS */
.left-panel {
    background-color: #0a0e17;
    border: 2px solid #3d5470;
    padding: 6px;
    border-radius: 4px;
}

.strategies-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.strategy-card {
    background-color: #151a24;
    border: 1px solid #3d5470;
    padding: 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.strategy-card:hover {
    border-color: #5a8fc7;
    box-shadow: 0 0 10px rgba(90, 143, 199, 0.3);
}

.strategy-card h4 {
    margin: 0 0 3px 0;
    font-size: 10px;
    color: #6a9dd3;
    letter-spacing: 1px;
    text-align: center;
}

.score-display {
    font-size: 28px;
    font-weight: bold;
    color: #5a8fc7;
    text-align: center;
    padding: 10px 0;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(90, 143, 199, 0.7);
    animation: score-pulse 0.5s ease-out;
}

@keyframes score-pulse {
    0% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.strategy-card .stats {
    text-align: center;
    font-size: 9px;
    color: #7aa8d9;
}

/* CENTER PANEL - MAIN VISUALIZATIONS */
.center-panel {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.viz-section {
    background-color: #0a0e17;
    border: 2px solid #3d5470;
    padding: 4px;
    border-radius: 4px;
}

.viz-section canvas {
    display: block;
    width: 100%;
    background-color: #05080d;
    border: 1px solid #2a3a4a;
}

/* Make first row horizontal */
.viz-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4px;
}

/* RIGHT PANEL - ANALYTICS */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.analytics-section {
    background-color: #0a0e17;
    border: 2px solid #3d5470;
    padding: 6px;
    border-radius: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.stat-item {
    background-color: #151a24;
    padding: 4px 8px;
    border-left: 3px solid #5a8fc7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 10px;
    color: #7aa8d9;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 16px;
    color: #5a8fc7;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(90, 143, 199, 0.5);
    font-family: monospace;
}

.stat-value.updating {
    animation: value-flash 0.5s ease-in-out;
}

@keyframes value-flash {
    0%, 100% { color: #5a8fc7; }
    50% { color: #7aa8d9; text-shadow: 0 0 15px rgba(90, 143, 199, 1); }
}

.history-timeline {
    font-size: 8px;
    color: #7aa8d9;
    line-height: 1.3;
    max-height: 80px;
    overflow-y: auto;
}

.history-item {
    padding: 2px;
    margin: 2px 0;
    background-color: #151a24;
    border-left: 2px solid #5a8fc7;
    padding-left: 6px;
}

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

.rank-item {
    display: grid;
    grid-template-columns: 25px 1fr 70px;
    align-items: center;
    padding: 4px 8px;
    background-color: #151a24;
    border-left: 3px solid #3d5470;
    font-size: 10px;
    transition: all 0.3s ease;
}

.rank-item.top-rank {
    border-left-color: #5a8fc7;
    background-color: #1f2938;
}

.rank-num {
    color: #7aa8d9;
    font-weight: bold;
}

.rank-name {
    color: #6a9dd3;
    letter-spacing: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-score {
    color: #5a8fc7;
    font-weight: bold;
    text-align: right;
    font-family: monospace;
}

/* BOTTOM PANEL - TABLES */
.bottom-panel {
    background-color: #0a0e17;
    border: 2px solid #3d5470;
    padding: 4px;
    border-radius: 4px;
}

.h2h-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    margin-top: 3px;
}

.h2h-table th,
.h2h-table td {
    padding: 4px;
    text-align: center;
    border: 1px solid #2a3a4a;
}

.h2h-table th {
    background-color: #1f2938;
    color: #5a8fc7;
    font-weight: bold;
    letter-spacing: 1px;
}

.h2h-table td {
    background-color: #151a24;
    color: #7aa8d9;
}

.h2h-table .row-header {
    background-color: #1f2938;
    color: #6a9dd3;
    font-weight: bold;
    text-align: left;
    padding-left: 8px;
}

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0e17;
}

::-webkit-scrollbar-thumb {
    background: #3d5470;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a8fc7;
}

/* RESPONSIVE */
@media (max-width: 1600px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .right-panel {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .right-panel {
        grid-template-columns: 1fr;
    }
}

/* ========== NEW VISUAL EFFECTS ========== */

/* ALERT BANNER */
.alert-banner {
    background: linear-gradient(90deg, #5a8fc7 0%, #7aa8d9 100%);
    color: #fff;
    padding: 12px 20px;
    margin: 0 15px 15px 15px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
    border-radius: 4px;
    animation: alert-flash 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(90, 143, 199, 0.8);
}

@keyframes alert-flash {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.8; transform: scaleY(0.98); }
}

/* ACTIVITY FEED */
.activity-feed-section {
    margin-top: 8px;
}

.activity-feed {
    max-height: 120px;
    overflow-y: auto;
    background-color: #05080d;
    border: 1px solid #2a3a4a;
    padding: 6px;
    font-size: 9px;
    line-height: 1.4;
    font-family: 'Courier New', monospace;
}

.feed-item {
    color: #7aa8d9;
    padding: 3px 5px;
    border-left: 2px solid transparent;
    animation: feed-slide-in 0.3s ease-out;
    margin-bottom: 2px;
}

.feed-item.cooperate {
    border-left-color: #5a8fc7;
    color: #5a8fc7;
}

.feed-item.defect {
    border-left-color: #9a6b6b;
    color: #9a6b6b;
}

.feed-item.betrayal {
    border-left-color: #ff6666;
    color: #ff9999;
    font-weight: bold;
}

.feed-item.event {
    border-left-color: #b8a76d;
    color: #b8a76d;
    font-weight: bold;
}

@keyframes feed-slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* CURRENT MOVES DISPLAY */
.current-moves-display {
    background: linear-gradient(135deg, #0a0e17 0%, #151a28 100%);
    border: 2px solid #5a8fc7;
    box-shadow: 0 0 20px rgba(90, 143, 199, 0.4);
}

.moves-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 8px;
    gap: 6px;
}

.move-indicator {
    text-align: center;
}

.move-player {
    font-size: 10px;
    color: #7aa8d9;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.move-badge {
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    margin: 0 auto;
    animation: badge-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(90, 143, 199, 0.5);
}

.move-badge.cooperate {
    background: linear-gradient(135deg, #3d6690 0%, #5a8fc7 100%);
    color: #e8ecf0;
    border: 2px solid #7aa8d9;
}

.move-badge.defect {
    background: linear-gradient(135deg, #6b4a4a 0%, #9a6b6b 100%);
    color: #e8ecf0;
    border: 2px solid #b88888;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(90, 143, 199, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(90, 143, 199, 0.8); }
}

.move-vs {
    font-size: 16px;
    font-weight: bold;
    color: #5a8fc7;
    text-shadow: 0 0 10px rgba(90, 143, 199, 0.8);
}

.round-counter {
    text-align: center;
    font-size: 11px;
    color: #7aa8d9;
    margin-top: 6px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* SCANLINE EFFECT - REMOVED */

/* PERFORMANCE METRICS */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
}

.metric-item {
    background: linear-gradient(135deg, #1f2938 0%, #151a24 100%);
    padding: 8px;
    text-align: center;
    border: 1px solid #3d5470;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.metric-item:hover {
    border-color: #5a8fc7;
    box-shadow: 0 0 10px rgba(90, 143, 199, 0.4);
    transform: translateY(-1px);
}

.metric-label {
    font-size: 8px;
    color: #7aa8d9;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 20px;
    color: #5a8fc7;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(90, 143, 199, 0.7);
}

.streak-value {
    animation: streak-glow 2s ease-in-out infinite;
}

@keyframes streak-glow {
    0%, 100% {
        color: #5a8fc7;
        text-shadow: 0 0 10px rgba(90, 143, 199, 0.7);
    }
    50% {
        color: #7aa8d9;
        text-shadow: 0 0 20px rgba(90, 143, 199, 1);
    }
}

/* CROWN ICON */
.crown-icon {
    display: inline-block;
    animation: crown-float 3s ease-in-out infinite;
    font-size: 16px;
}

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

/* NUMBER COUNTER ANIMATION */
.stat-value.counting {
    animation: number-increment 0.3s ease-out;
}

@keyframes number-increment {
    0% { transform: scale(1.2); color: #7aa8d9; }
    100% { transform: scale(1); color: #5a8fc7; }
}

/* GLITCH EFFECT (for special events) */
.glitch {
    animation: glitch 0.5s ease-in-out;
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, -2px); }
    80% { transform: translate(2px, 2px); }
}

/* GRID BACKGROUND EFFECT */
.war-room::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(90, 143, 199, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90, 143, 199, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.5;
}

/* ENHANCED BORDER PULSE */
.analytics-section {
    animation: section-glow 5s ease-in-out infinite;
}

@keyframes section-glow {
    0%, 100% { border-color: #3d5470; }
    50% { border-color: #4a5f80; }
}

/* HEADER PARTICLE EFFECT */
.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at 20% 50%,
        rgba(90, 143, 199, 0.1) 0%,
        transparent 50%
    ),
    radial-gradient(
        circle at 80% 50%,
        rgba(90, 143, 199, 0.1) 0%,
        transparent 50%
    );
    pointer-events: none;
    animation: particle-drift 10s ease-in-out infinite;
}

@keyframes particle-drift {
    0%, 100% { opacity: 0.5; transform: translateX(0); }
    50% { opacity: 1; transform: translateX(20px); }
}