/* ============================================
   STEAK 'N' SHAKE: TIP RUSH 3D — Styles
   GTA-inspired dark/red/gold aesthetic
   ============================================ */

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

body {
    overflow: hidden;
    background: #000;
    font-family: 'Russo One', sans-serif;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

canvas {
    display: block;
}

/* ============================================
   CHARACTER SELECT MENU
   ============================================ */

#menu-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, rgba(80,0,0,0.85) 0%, rgba(0,0,0,0.95) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#menu-content {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

#menu-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #FF3333;
    text-shadow: 0 0 20px rgba(255,51,51,0.6), 3px 3px 0 #000;
    letter-spacing: 4px;
    margin-bottom: -10px;
}

#menu-subtitle {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 12vw, 9rem);
    color: #FFD700;
    text-shadow: 0 0 30px rgba(255,215,0,0.5), 4px 4px 0 #000;
    letter-spacing: 6px;
    margin-bottom: 20px;
}

#menu-instruction {
    font-family: 'Russo One', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    color: #ccc;
    letter-spacing: 3px;
    margin-bottom: 30px;
}

#character-buttons {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.char-btn {
    background: rgba(30,30,30,0.8);
    border: 3px solid #555;
    border-radius: 15px;
    padding: 25px 35px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.char-btn:hover, .char-btn:focus {
    border-color: #FFD700;
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(255,215,0,0.4);
    outline: none;
}

.char-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
}

.char-name {
    font-family: 'Russo One', sans-serif;
    font-size: 1.2rem;
    color: #fff;
    letter-spacing: 2px;
}

#menu-highscore {
    margin-top: 30px;
    font-family: 'Russo One', sans-serif;
    font-size: 1.1rem;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255,215,0,0.4);
}

/* ============================================
   IN-GAME HUD
   ============================================ */

#hud {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    z-index: 50;
    pointer-events: none;
}

#hud-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.3) 80%, transparent 100%);
    border-bottom: 2px solid rgba(255,51,51,0.5);
    min-height: 55px;
}

#hud-left, #hud-center, #hud-right {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#hud-left { align-items: flex-start; }
#hud-center { align-items: center; }
#hud-right { align-items: flex-end; }

#hud-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2rem;
    color: #33FF33;
    text-shadow: 0 0 10px rgba(51,255,51,0.4);
    line-height: 1;
}

#hud-status {
    font-size: 0.8rem;
    color: #FFD700;
    letter-spacing: 1px;
    font-weight: bold;
}

#hud-status.delivering {
    color: #FFA500;
    animation: warningPulse 0.8s ease-in-out infinite;
}

#hud-status.tip-flash {
    color: #33FF33;
    font-size: 1rem;
    text-shadow: 0 0 10px rgba(51,255,51,0.6);
    animation: bounce 0.4s ease-in-out infinite alternate;
}

#hud-timer {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6rem;
    color: #fff;
    line-height: 1;
}

#hud-orders {
    font-size: 0.7rem;
    color: #FFA500;
    letter-spacing: 1px;
}

#hud-best {
    font-family: 'Russo One', sans-serif;
    font-size: 0.9rem;
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255,215,0,0.3);
}

#hud-frisco {
    font-size: 0.7rem;
    color: #FFD700;
    letter-spacing: 1px;
}

/* Milkshake Boost Bar */
#milkshake-bar {
    width: 250px;
    height: 18px;
    margin: 5px auto 0;
    background: rgba(0,0,0,0.5);
    border-radius: 9px;
    border: 1px solid rgba(255,105,180,0.5);
    overflow: hidden;
    position: relative;
}

#milkshake-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #FF69B4, #FF1493);
    border-radius: 9px;
    transition: width 0.1s linear;
}

#milkshake-text {
    font-size: 0.65rem;
    color: #FF69B4;
    text-align: center;
    margin-top: 2px;
    text-shadow: 0 0 5px rgba(255,105,180,0.5);
}

/* Francisco Warning */
#francisco-warning {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Russo One', sans-serif;
    font-size: clamp(0.8rem, 2vw, 1.1rem);
    color: #FF3333;
    text-shadow: 0 0 15px rgba(255,51,51,0.6);
    letter-spacing: 2px;
    animation: warningPulse 0.8s ease-in-out infinite;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
}

@keyframes warningPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ============================================
   GAME OVER SCREEN
   ============================================ */

#gameover-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, rgba(80,0,0,0.85) 0%, rgba(0,0,0,0.95) 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

#gameover-content {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

#gameover-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    color: #FF3333;
    text-shadow: 0 0 30px rgba(255,51,51,0.6), 4px 4px 0 #000;
    margin-bottom: 20px;
}

#gameover-score {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 12vw, 8rem);
    color: #33FF33;
    text-shadow: 0 0 20px rgba(51,255,51,0.4);
    margin-bottom: 10px;
}

#gameover-newhigh {
    font-family: 'Russo One', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: #FFD700;
    text-shadow: 0 0 15px rgba(255,215,0,0.5);
    animation: bounce 0.6s ease-in-out infinite alternate;
    margin-bottom: 10px;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-8px); }
}

#gameover-time {
    font-size: 1rem;
    color: #999;
    margin-bottom: 30px;
}

#play-again-btn {
    font-family: 'Russo One', sans-serif;
    font-size: 1.3rem;
    color: #fff;
    background: linear-gradient(to bottom, #CC0000, #990000);
    border: none;
    border-radius: 8px;
    padding: 15px 50px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

#play-again-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255,0,0,0.5);
}

/* ============================================
   TUTORIAL OVERLAY
   ============================================ */

#tutorial-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 75;
    pointer-events: auto;
}

#tutorial-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 6vw, 4rem);
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255,215,0,0.5), 3px 3px 0 #000;
    text-align: center;
    padding: 20px;
    letter-spacing: 3px;
    animation: fadeIn 0.5s ease-out;
}

/* ============================================
   MOBILE TAP-TO-MOVE (no joystick needed)
   ============================================ */
