@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;400;500;700&display=swap');

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

body {
    overflow: hidden;
    background: #0a0a1a;
    font-family: 'Rajdhani', sans-serif;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
}

.hud-left {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #00f0ff;
    font-family: 'Orbitron', monospace;
    text-shadow: 0 0 10px #00f0ff, 0 0 20px #00f0ff;
    z-index: 100;
}

.hud-item {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 10px 20px;
    margin-bottom: 10px;
    border-radius: 5px;
    backdrop-filter: blur(5px);
}

.hud-label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hud-value {
    font-size: 28px;
    font-weight: 700;
}

.stats-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 280px;
    background: rgba(10, 10, 26, 0.95);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.stats-header {
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    color: #00f0ff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-label {
    color: #888;
    font-size: 14px;
}

.stats-value {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    color: #00f0ff;
}

.stats-value.high-score {
    color: #ffcc00;
}

.stats-value.fps {
    color: #00ff88;
}

.action-history {
    margin-top: 15px;
}

.action-history-title {
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: #ff00aa;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.action-list {
    max-height: 200px;
    overflow-y: auto;
}

.action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 12px;
}

.action-item.action-left {
    border-left: 3px solid #ff6600;
}

.action-item.action-stay {
    border-left: 3px solid #00ff88;
}

.action-item.action-right {
    border-left: 3px solid #3399ff;
}

.action-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.action-time {
    color: #666;
    font-size: 10px;
}

.current-action {
    text-align: center;
    padding: 15px;
    margin-top: 15px;
    background: rgba(0, 240, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.current-action-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.current-action-value {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    font-weight: 700;
}

.current-action-value.left {
    color: #ff6600;
}

.current-action-value.stay {
    color: #00ff88;
}

.current-action-value.right {
    color: #3399ff;
}

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

.game-over-overlay.active {
    display: flex;
}

.game-over-content {
    text-align: center;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-over-title {
    font-family: 'Orbitron', monospace;
    font-size: 64px;
    color: #ff0066;
    text-shadow: 0 0 20px #ff0066, 0 0 40px #ff0066;
    margin-bottom: 20px;
    animation: glowPulse 1s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    from {
        text-shadow: 0 0 20px #ff0066, 0 0 40px #ff0066;
    }
    to {
        text-shadow: 0 0 30px #ff0066, 0 0 60px #ff0066, 0 0 80px #ff0066;
    }
}

.game-over-stats {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 15px;
    padding: 30px 50px;
    margin: 30px 0;
}

.game-over-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.game-over-stat:last-child {
    border-bottom: none;
}

.game-over-stat-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 18px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-over-stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 28px;
    color: #00f0ff;
}

.game-over-stat-value.new-record {
    color: #ffcc00;
    animation: pulse 0.5s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.new-record-badge {
    background: linear-gradient(90deg, #ffcc00, #ff9900);
    color: #000;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 10px;
    animation: pulse 0.5s ease-in-out infinite alternate;
}

.restart-button {
    font-family: 'Orbitron', monospace;
    font-size: 20px;
    padding: 15px 50px;
    background: linear-gradient(135deg, #00f0ff, #0080ff);
    border: none;
    border-radius: 10px;
    color: #000;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.restart-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
}

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

.controls-help {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    z-index: 100;
}

.controls-help span {
    background: rgba(0, 240, 255, 0.2);
    padding: 3px 8px;
    border-radius: 3px;
    margin-right: 5px;
    color: #00f0ff;
}

.model-status {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 5px;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    z-index: 100;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.model-status.loading {
    background: rgba(255, 204, 0, 0.2);
    color: #ffcc00;
    border: 1px solid #ffcc00;
}

.model-status.ready {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
}

.model-status.error {
    background: rgba(255, 0, 0, 0.2);
    color: #ff0000;
    border: 1px solid #ff0000;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 400;
    flex-direction: column;
}

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

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 240, 255, 0.3);
    border-top: 4px solid #00f0ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    color: #00f0ff;
    text-transform: uppercase;
    letter-spacing: 3px;
}

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

.pause-overlay.active {
    display: flex;
}

.pause-text {
    font-family: 'Orbitron', monospace;
    font-size: 48px;
    color: #00f0ff;
    text-shadow: 0 0 20px #00f0ff, 0 0 40px #00f0ff;
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px #00f0ff, 0 0 40px #00f0ff;
    }
    to {
        text-shadow: 0 0 30px #00f0ff, 0 0 60px #00f0ff, 0 0 80px #00f0ff;
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.5);
    border-radius: 3px;
}