:root {
    --bg-dark: #0a0a0a;
    --neon-blue: #00e5ff;
    --neon-green: #39ff14;
    --neon-pink: #ff00ff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Segoe UI', 'Orbitron', sans-serif;
    background-color: var(--bg-dark);
    color: white;
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Welcome Screen Overlay */
#welcome-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}

#welcome-screen.hidden {
    transform: translateY(-100%);
}

.welcome-content {
    text-align: center;
    width: 90%;
    max-width: 1000px;
}

.neon-text {
    font-size: 5rem;
    margin: 0;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-blue), 0 0 40px var(--neon-blue);
    letter-spacing: 5px;
}

.neon-subtitle {
    font-size: 1.5rem;
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
    margin-bottom: 40px;
}

.side-note {
    font-size: 0.9rem;
    color: #888;
    margin-top: 20px;
    font-style: italic;
}

/* Leaderboards */
.leaderboards-container {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    justify-content: center;
}

.leaderboard-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 20px;
    flex: 1;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.leaderboard-card h3 {
    margin-top: 0;
    color: var(--neon-blue);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
    font-size: 1.2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    color: #888;
    font-size: 0.8rem;
    padding-bottom: 10px;
}

td {
    padding: 10px 0;
    border-bottom: 1px solid var(--glass-border);
    font-weight: bold;
}

/* Entry Zone */
.entry-zone {
    display: flex;
    justify-content: center;
    gap: 20px;
}

#welcome-name {
    padding: 15px 25px;
    background: var(--glass-bg);
    border: 2px solid var(--neon-blue);
    border-radius: 50px;
    color: white;
    font-size: 1.2rem;
    width: 300px;
    outline: none;
    transition: 0.3s;
}

#welcome-name:focus {
    box-shadow: 0 0 15px var(--neon-blue);
}

#start-engine-btn {
    padding: 15px 40px;
    background: var(--neon-green);
    border: none;
    border-radius: 50px;
    color: #000;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-green);
    transition: 0.3s;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(57, 255, 20, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(57, 255, 20, 0);
    }
}

#start-engine-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--neon-green);
    animation: none;
}

/* Results Overlay */
#results-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.results-content {
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.neon-text-small {
    font-size: 2rem;
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    justify-content: mb-20px;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid var(--glass-border);
}

.stat-label {
    color: #888;
}

.stat-value {
    color: var(--neon-green);
    font-weight: bold;
    font-size: 1.2rem;
}

#close-results-btn {
    margin-top: 30px;
    background-color: var(--neon-blue);
    color: #000;
    padding: 12px 30px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-blue);
}

/* Main Game Styles */
.container {
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.container h1 {
    color: var(--neon-blue);
    text-shadow: 0 0 10px var(--neon-blue);
    font-size: 3rem;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 40px 0;
}

#stopwatch {
    font-size: 4rem;
    font-family: monospace;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

.container button {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: 0.3s;
}

#start-btn {
    background-color: var(--neon-green);
    color: #000;
    box-shadow: 0 0 10px var(--neon-green);
}

#reset-btn {
    background-color: #333;
    color: white;
    border: 1px solid #555;
}

/* Grid Styling */
#grid-container {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 2px;
    background-color: #333;
    border: 4px solid var(--neon-blue);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.cell {
    width: 100%;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #1a1a1a;
    font-weight: bold;
}

.header-cell {
    background-color: #222;
    color: var(--neon-blue);
}

.input-cell input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: white;
    text-align: center;
    font-size: 1.2rem;
    outline: none;
}

.input-cell input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.correct {
    background-color: rgba(57, 255, 20, 0.2) !important;
    box-shadow: inset 0 0 10px var(--neon-green);
}

.incorrect {
    background-color: rgba(255, 0, 0, 0.2) !important;
    box-shadow: inset 0 0 10px #ff0000;
}

/* Hide arrows in number inputs */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}
