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

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

#scene-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#scene-container canvas {
    display: block;
}

/* Start Screen */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 20, 0.88);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.start-content {
    text-align: center;
    max-width: 500px;
    padding: 20px;
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ff6b35, #ffd700, #ff6b35);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease infinite;
    margin-bottom: 12px;
    text-shadow: 0 0 40px rgba(255, 107, 53, 0.3);
}

@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

.game-subtitle {
    color: #8892b0;
    font-size: 1.15rem;
    font-weight: 300;
    margin-bottom: 36px;
    font-style: italic;
    letter-spacing: 0.5px;
}

#start-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 16px 48px;
    border: 2px solid #ff6b35;
    background: transparent;
    color: #ff6b35;
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#start-btn:hover {
    background: #ff6b35;
    color: #0a0a1a;
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.5), 0 0 60px rgba(255, 107, 53, 0.2);
    transform: scale(1.05);
}

.controls-info {
    margin-top: 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
    text-align: left;
}

.control-row {
    color: #5a6380;
    font-size: 0.85rem;
    padding: 4px 0;
}

.key {
    display: inline-block;
    background: rgba(255, 107, 53, 0.15);
    color: #ff9060;
    padding: 2px 8px;
    border-radius: 3px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    margin-right: 6px;
    min-width: 42px;
    text-align: center;
    border: 1px solid rgba(255, 107, 53, 0.25);
}

.footer-link {
    margin-top: 40px;
}

.footer-link a {
    color: #3a4060;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s;
}

.footer-link a:hover {
    color: #ff6b35;
}

/* HUD */
#speed-display {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(10, 10, 30, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 12px;
    padding: 14px 24px;
    text-align: center;
    z-index: 50;
}

.speed-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    color: #ffd700;
    line-height: 1;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.speed-unit {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: #5a6380;
    letter-spacing: 3px;
    margin-top: 2px;
}

#gear-display {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: rgba(10, 10, 30, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 12px;
    padding: 12px 20px;
    z-index: 50;
}

#gear-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #00ff88;
    letter-spacing: 2px;
}

#help-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 36px;
    height: 36px;
    background: rgba(10, 10, 30, 0.75);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 50%;
    color: #8892b0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: all 0.2s;
}

#help-btn:hover {
    background: rgba(255, 107, 53, 0.2);
    color: #ff6b35;
}

#help-panel {
    position: fixed;
    top: 64px;
    left: 20px;
    background: rgba(10, 10, 30, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 10px;
    padding: 14px 18px;
    color: #8892b0;
    font-size: 0.8rem;
    line-height: 1.8;
    z-index: 50;
}

#minimap {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 164px;
    height: 164px;
    background: rgba(10, 10, 30, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 12px;
    overflow: hidden;
    z-index: 50;
    padding: 2px;
}

#minimap-canvas {
    border-radius: 10px;
}

#toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 60;
    pointer-events: none;
}

.toast {
    background: rgba(255, 40, 40, 0.85);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    animation: toastAnim 2s ease forwards;
    margin-bottom: 8px;
    white-space: nowrap;
}

@keyframes toastAnim {
    0% { opacity: 0; transform: translateY(20px) scale(0.9); }
    15% { opacity: 1; transform: translateY(0) scale(1); }
    75% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* Mobile Controls */
#mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 180px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px 30px;
    z-index: 50;
    pointer-events: none;
}

#mobile-left, #mobile-right-cluster {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

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

.mobile-btn {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 53, 0.4);
    background: rgba(10, 10, 30, 0.7);
    color: #ff9060;
    font-size: 1.2rem;
    font-family: 'Orbitron', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.mobile-btn:active {
    background: rgba(255, 107, 53, 0.3);
}

.small-btn {
    width: 48px;
    height: 48px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .game-title { font-size: 2rem; }
    .game-subtitle { font-size: 0.95rem; }
    #start-btn { font-size: 1rem; padding: 12px 32px; }
    .controls-info { display: none; }
    #speed-display { bottom: 190px; right: 15px; padding: 10px 16px; }
    .speed-value { font-size: 2rem; }
    #gear-display { bottom: 190px; left: 15px; }
    #minimap { width: 120px; height: 120px; }
    #minimap-canvas { width: 116px; height: 116px; }
}