/* ============================================================
   GLOBAL RESET + THEME
============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0d1116;
    font-family: "Inter", "Segoe UI", sans-serif;
    color: #fff;
}

/* Centering utility */
.center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================================
   BRAND LOGO (TOP-LEFT)
============================================================ */

#brand-logo {
    position: fixed;
    top: 20px;
    left: 20px;

    width: 115px;
    height: auto;

    opacity: 0.92;
    pointer-events: none;
    z-index: 50;

    transition: width 0.25s ease, opacity 0.25s ease, top 0.25s ease;
}

/* Logo size inside gameplay */
#brand-logo.game-small {
    width: 60px;
    opacity: 0.75;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    #brand-logo {
        width: 80px;
        top: 12px;
        left: 12px;
    }

    #brand-logo.game-small {
        width: 42px;
    }
}

/* ============================================================
   SCREEN SYSTEM
============================================================ */

.screen {
    position: absolute;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: transparent;
    z-index: 20;
}

.screen.active {
    display: flex;
}

/* ============================================================
   HERO SCREEN (MAIN MENU)
============================================================ */

.hero-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 28px;
    padding: 40px 50px;
    text-align: center;
    width: 520px;
    backdrop-filter: blur(12px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Circular portrait */
.hero-driver {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;

    margin-top: -70px;
    margin-bottom: 15px;

    border: 5px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 25px rgba(0, 160, 255, 0.55);
}

.hero-panel h1 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 35px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

.actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

/* ============================================================
   BUTTONS — GLOBAL
============================================================ */

.btn {
    background: #1d6ff3;
    padding: 12px 28px;
    border-radius: 12px;
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    transition: 0.2s ease;
}

.btn:hover {
    background: #3a82ff;
}

.btn.small {
    padding: 8px 18px;
    font-size: 14px;
}

.btn.primary {
    background: #1980ff;
}

.btn.primary:hover {
    background: #3296ff;
}

/* ============================================================
   PANEL STYLING (USED BY DRIVER/VEHICLE/TEAM)
============================================================ */

.panel {
    background: rgba(255, 255, 255, 0.06);
    padding: 32px 40px;
    border-radius: 20px;
    width: 520px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 26px rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.08);
}

.panel h2 {
    font-size: 28px;
    margin-bottom: 24px;
    font-weight: 700;
}

/* ============================================================
   CAROUSEL CARD (Driver / Vehicle)
============================================================ */

.card {
    background: rgba(0,0,0,0.25);
    padding: 22px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.card img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    border-radius: 10px;
}

.card .name {
    font-size: 20px;
    font-weight: 600;
    margin-top: 14px;
}

.card .bio {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 4px;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 14px;
}

/* ============================================================
   TEAM SCREEN
============================================================ */

#team-name {
    font-size: 28px;
    font-weight: 700;
    margin: 18px 0;
}

/* ============================================================
   HUD OVERLAY
============================================================ */

#hud {
    position: absolute;
    top: 20px;
    right: 25px;
    display: flex;
    gap: 16px;
    z-index: 15;
}

.tag {
    background: rgba(255,255,255,0.08);
    padding: 8px 14px;
    border-radius: 10px;
    display: flex;
    gap: 6px;
}

/* ============================================================
   COUNTDOWN
============================================================ */

#big-count {
    position: absolute;
    inset: 0;
    display: none;
    font-size: 160px;
    font-weight: 900;
    color: #fff;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 20px rgba(0,0,0,0.6);
    z-index: 25;
}

/* ============================================================
   LETTER RAIL (bottom bar)
============================================================ */

#letters {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 12;
}

/* ============================================================
   MODAL (How-To)
============================================================ */

dialog#howto {
    background: rgba(0,0,0,0.65);
    color: white;
    width: 520px;
    border: none;
    border-radius: 14px;
    padding: 25px 30px;
    backdrop-filter: blur(8px);
    text-align: left;
}

/* ============================================================
   PAUSE, LEVEL UP, GAME OVER, VICTORY
============================================================ */

#screen-pause .panel,
#screen-levelup .panel,
#screen-gameover .panel,
#screen-victory .panel {
    width: 450px;
}

#winVideo {
    width: 100%;
    border-radius: 14px;
    margin: 18px 0;
}
