/* DodgeWall - School Blue Theme */

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 50%, #0d2840 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
    background: linear-gradient(180deg, #0d2840 0%, #1a3a5c 100%);
    overflow: hidden;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: opacity 0.3s ease;
}

.screen.hidden {
    display: none;
}

/* Logo and Title */
.logo-container {
    text-align: center;
    margin-bottom: 25px;
}

.school-logo {
    margin-bottom: 15px;
}

#school-logo-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #4A90D9;
    box-shadow: 0 0 25px rgba(74, 144, 217, 0.5);
    object-fit: cover;
}

.game-title {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: clamp(42px, 9vw, 68px);
    font-weight: bold;
    letter-spacing: 5px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #6BA3E0 0%, #4A90D9 50%, #2A5A8C 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(3px 3px 5px rgba(0,0,0,0.7));
}

.game-title.small {
    font-size: clamp(28px, 5vw, 42px);
}

.tagline {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: clamp(12px, 2.5vw, 16px);
    color: #6BA3E0;
    letter-spacing: 6px;
    font-weight: bold;
    margin-top: 5px;
}

/* Form Container */
.form-container {
    background: rgba(13, 40, 64, 0.9);
    border: 2px solid #4A90D9;
    border-radius: 10px;
    padding: 25px 30px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* Input Styles */
.input-container, .speed-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-container label, .speed-container label {
    color: #6BA3E0;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#username, #speed-select {
    width: 220px;
    padding: 12px 18px;
    font-size: 16px;
    text-align: center;
    border: 2px solid #4A90D9;
    border-radius: 5px;
    background: rgba(10, 30, 50, 0.9);
    color: #6BA3E0;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 2px;
    outline: none;
    transition: all 0.3s ease;
}

#username:focus, #speed-select:focus {
    border-color: #6BA3E0;
    box-shadow: 0 0 12px rgba(74, 144, 217, 0.4);
}

#username::placeholder {
    color: #2A5A8C;
    text-transform: uppercase;
}

#speed-select {
    cursor: pointer;
}

#speed-select option {
    background: #0d2840;
    color: #6BA3E0;
}

.input-hint {
    color: #2A5A8C;
    font-size: 11px;
    margin-top: 5px;
}

/* Buttons */
.game-btn {
    padding: 14px 45px;
    font-size: clamp(16px, 3.5vw, 22px);
    font-family: Impact, 'Arial Black', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #fff;
    background: linear-gradient(180deg, #4A90D9 0%, #2A5A8C 100%);
    border: 3px solid #6BA3E0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 0 #1a3a5c,
        0 6px 10px rgba(0, 0, 0, 0.4);
}

.game-btn:hover {
    background: linear-gradient(180deg, #5A9AE0 0%, #4A90D9 100%);
    transform: translateY(-2px);
    box-shadow:
        0 6px 0 #1a3a5c,
        0 8px 15px rgba(0, 0, 0, 0.4);
}

.game-btn:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 #1a3a5c,
        0 3px 5px rgba(0, 0, 0, 0.4);
}

.secondary-btn {
    padding: 10px 28px;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #6BA3E0;
    background: transparent;
    border: 2px solid #4A90D9;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
}

.secondary-btn:hover {
    background: rgba(74, 144, 217, 0.25);
    border-color: #6BA3E0;
}

.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.exit-btn {
    padding: 8px 18px;
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    color: #ff6b6b;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #ff6b6b;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.exit-btn:hover {
    background: rgba(255, 107, 107, 0.25);
}

/* Controls Info */
.controls-info {
    margin-top: 15px;
    color: #4A90D9;
    font-size: 13px;
    text-align: center;
}

.controls-info p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 5px 0;
}

.mobile-hint {
    color: #2A5A8C;
    font-size: 11px;
}

.key {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 28px;
    height: 28px;
    padding: 0 7px;
    background: linear-gradient(180deg, #4A90D9 0%, #2A5A8C 100%);
    border: 2px solid #6BA3E0;
    border-radius: 4px;
    color: #fff;
    font-family: monospace;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 0 #1a3a5c;
}

/* Game Screen */
#game-screen {
    background: #000;
    padding: 0;
}

#game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    z-index: 10;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#score-display {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: clamp(18px, 3.5vw, 28px);
    color: #6BA3E0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

#current-player {
    color: #4A90D9;
}

/* Touch Zones */
.touch-zone {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50%;
    z-index: 5;
    opacity: 0;
}

#touch-left {
    left: 0;
}

#touch-right {
    right: 0;
}

/* Game Over Screen */
#gameover-screen {
    background: rgba(13, 40, 64, 0.95);
}

.gameover-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #4A90D9;
    margin-bottom: 10px;
}

#gameover-screen h2 {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: clamp(32px, 7vw, 50px);
    color: #ff4444;
    text-shadow: 3px 3px 0 #000;
    letter-spacing: 4px;
    margin-bottom: 20px;
}

.final-score {
    text-align: center;
    margin-bottom: 25px;
}

.final-score p {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: clamp(16px, 3.5vw, 22px);
    color: #6BA3E0;
    letter-spacing: 2px;
    margin: 8px 0;
}

#player-name {
    color: #4A90D9;
    font-size: clamp(20px, 4.5vw, 28px);
}

#final-score {
    color: #4A90D9;
    font-size: clamp(24px, 5.5vw, 38px);
}

/* Leaderboard Screen */
#leaderboard-screen {
    background: rgba(13, 40, 64, 0.95);
}

.leaderboard-title {
    font-family: Impact, 'Arial Black', sans-serif;
    font-size: clamp(28px, 5.5vw, 44px);
    color: #6BA3E0;
    text-shadow: 3px 3px 0 #000;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.leaderboard-subtitle {
    color: #4A90D9;
    font-size: 13px;
    margin-bottom: 18px;
    letter-spacing: 1px;
}

#leaderboard-list {
    width: 90%;
    max-width: 480px;
    max-height: 55vh;
    overflow-y: auto;
    background: rgba(10, 30, 50, 0.7);
    border: 2px solid #4A90D9;
    border-radius: 8px;
    padding: 12px;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(74, 144, 217, 0.25);
    font-family: 'Segoe UI', sans-serif;
}

.leaderboard-entry:last-child {
    border-bottom: none;
}

.leaderboard-entry.top-3 {
    background: linear-gradient(90deg, rgba(74, 144, 217, 0.2) 0%, transparent 100%);
}

.leaderboard-rank {
    font-size: 16px;
    font-weight: bold;
    color: #4A90D9;
    min-width: 38px;
}

.leaderboard-name {
    flex: 1;
    color: #6BA3E0;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 10px;
}

.leaderboard-score {
    font-size: 16px;
    font-weight: bold;
    color: #4A90D9;
}

.no-scores, .loading {
    color: #4A90D9;
    text-align: center;
    padding: 25px;
    font-style: italic;
}

/* Signature */
.signature {
    position: absolute;
    bottom: 12px;
    right: 15px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    font-size: 13px;
    color: rgba(74, 144, 217, 0.6);
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 600px) {
    #school-logo-img {
        width: 75px;
        height: 75px;
    }

    .form-container {
        padding: 20px 22px;
        width: 90%;
        max-width: 320px;
    }

    #username, #speed-select {
        width: 190px;
        font-size: 14px;
        padding: 10px 15px;
    }

    .game-btn {
        padding: 12px 35px;
    }

    .signature {
        font-size: 11px;
        bottom: 8px;
        right: 10px;
    }

    .controls-info {
        font-size: 12px;
    }
}

/* Scrollbar styling */
#leaderboard-list::-webkit-scrollbar {
    width: 7px;
}

#leaderboard-list::-webkit-scrollbar-track {
    background: rgba(44, 36, 22, 0.4);
    border-radius: 4px;
}

#leaderboard-list::-webkit-scrollbar-thumb {
    background: #8B7355;
    border-radius: 4px;
}
