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

body {
    background: #000;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    color: #ccc;
}

.arcade-cabinet {
    background: #1a1a1a;
    border: 4px solid #333;
    border-radius: 10px;
    padding: 30px;
}

.screen-bezel {
    background: #000;
    border: 3px solid #444;
    border-radius: 8px;
    padding: 20px;
}

.score-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    gap: 20px;
}

.score-display {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: 2px solid;
    border-radius: 5px;
    background: #000;
}

.red-score {
    border-color: #b85555;
}

.blue-score {
    border-color: #5577bb;
}

.green-score {
    border-color: #55bb55;
}

.yellow-score {
    border-color: #bbbb55;
}

.team-label {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 5px;
    color: #999;
}

.red-score .team-label {
    color: #b85555;
}

.blue-score .team-label {
    color: #5577bb;
}

.green-score .team-label {
    color: #55bb55;
}

.yellow-score .team-label {
    color: #bbbb55;
}

.status-text {
    font-size: 18px;
    font-weight: bold;
    color: #ccc;
    line-height: 1;
    margin: 5px 0;
    letter-spacing: 2px;
}

.survival-time {
    font-size: 20px;
    color: #888;
    margin-top: 5px;
    font-weight: bold;
}

.timer-display {
    flex: 1;
    text-align: center;
    padding: 10px;
    border: 2px solid #666;
    border-radius: 5px;
    background: #000;
}

.timer-label {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #999;
    margin-bottom: 5px;
}

.timer-value {
    font-size: 32px;
    font-weight: bold;
    color: #ccc;
    line-height: 1;
}

.game-screen {
    position: relative;
    background: #000;
    border: 2px solid #333;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#gameCanvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
}

.game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.game-over.show {
    display: flex;
}

.game-over-content {
    text-align: center;
}

.winner-text {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    animation: pulse 1.5s ease-in-out infinite;
}

.winner-text.red {
    color: #b85555;
}

.winner-text.blue {
    color: #5577bb;
}

.winner-text.green {
    color: #55bb55;
}

.winner-text.yellow {
    color: #bbbb55;
}

.winner-text.tie {
    color: #999;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.final-score {
    font-size: 28px;
    color: #ccc;
    margin-bottom: 30px;
}

.play-again-btn {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    font-weight: bold;
    padding: 12px 35px;
    background: rgba(51, 51, 51, 0.8);
    border: 2px solid #666;
    border-radius: 5px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
}

.play-again-btn:hover {
    background: rgba(68, 68, 68, 0.8);
    border-color: #888;
}

.play-again-btn:active {
    transform: scale(0.98);
}

.control-panel {
    margin-bottom: 20px;
    padding: 15px;
    background: #000;
    border: 2px solid #333;
    border-radius: 8px;
}

.controls-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    justify-content: center;
    align-items: center;
}

.controls-row.single-row {
    margin-bottom: 0;
    gap: 15px;
    flex-wrap: nowrap;
}

.controls-row:last-child {
    margin-bottom: 0;
}

.arcade-button {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: bold;
    padding: 10px 25px;
    border: 2px solid;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
}

.start-btn {
    background: #2a4a2a;
    border-color: #4a6a4a;
    color: #8ac88a;
}

.start-btn:hover {
    background: #3a5a3a;
    border-color: #5a7a5a;
}

.pause-btn {
    background: #3a3a2a;
    border-color: #5a5a4a;
    color: #c8c88a;
}

.pause-btn:hover {
    background: #4a4a3a;
    border-color: #6a6a5a;
}

.reset-btn {
    background: #333;
    border-color: #555;
    color: #999;
}

.reset-btn:hover {
    background: #444;
    border-color: #666;
}

.arcade-button:active {
    transform: scale(0.98);
}

.arcade-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.control-group.compact {
    flex: 0 1 auto;
    gap: 4px;
    min-width: 120px;
}

.control-group.inline {
    flex-direction: row;
    gap: 8px;
    align-items: center;
    min-width: auto;
}

.control-group label {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #888;
}

.control-group.compact label {
    font-size: 14px;
    letter-spacing: 0.5px;
}

.mode-selector {
    display: flex;
    gap: 15px;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 10px;
    color: #999;
    padding: 6px 8px;
    border: 1px solid #444;
    border-radius: 3px;
    background: #000;
    transition: all 0.2s;
}

.mode-option:hover {
    border-color: #666;
    background: #1a1a1a;
}

.mode-option input[type="radio"] {
    cursor: pointer;
}

.mode-option input[type="radio"]:checked + span {
    color: #ccc;
}

.mode-option:has(input[type="radio"]:checked) {
    border-color: #888;
    background: #1a1a1a;
}

.control-group input[type="range"] {
    width: 100%;
    max-width: 200px;
    height: 6px;
    background: #222;
    border: 1px solid #444;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.control-group.compact input[type="range"] {
    max-width: 400px;
    height: 6px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #666;
    border: 1px solid #888;
    border-radius: 50%;
    cursor: pointer;
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #666;
    border: 1px solid #888;
    border-radius: 50%;
    cursor: pointer;
}

.control-group span {
    font-size: 16px;
    font-weight: bold;
    color: #ccc;
}

.control-group.compact span {
    font-size: 14px;
}

.ai-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 16px;
}

.ai-info .control-group.compact {
    flex: 0 1 auto;
    gap: 4px;
    min-width: 120px;
}

.ai-info .control-group.compact label {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    color: #888;
}

.ai-info .control-group.compact:first-child label {
    color: #b85555;
}

.ai-info .control-group.compact:last-child label {
    color: #5577bb;
}

.ai-selector {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    padding: 6px 8px;
    background: #000;
    border: 1px solid #444;
    border-radius: 3px;
    color: #ccc;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    min-width: 100px;
}

.ai-selector:hover {
    border-color: #666;
    background: #1a1a1a;
}

.ai-selector:focus {
    border-color: #888;
    background: #1a1a1a;
}

.ai-selector option {
    background: #000;
    color: #ccc;
    padding: 4px;
}
