:root {
    --bg-color: #87CEEB;
    --text-color: #333;
    --overlay-bg: rgba(255, 255, 255, 0.9);
    --btn-bg: #ff6b6b;
    --btn-text: #fff;
    --btn-hover: #ff5252;
    --shadow: rgba(0,0,0,0.1);
}

body.dark-mode {
    --bg-color: #1a1a2a;
    --text-color: #fff;
    --overlay-bg: rgba(26, 26, 42, 0.95);
    --btn-bg: #4ecdc4;
    --btn-text: #1a1a2a;
    --btn-hover: #45b7af;
    --shadow: rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

#game-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: var(--overlay-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    color: var(--btn-bg);
    text-shadow: 2px 2px 0px var(--shadow);
    animation: float 3s ease-in-out infinite;
}

p.subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--btn-bg);
}

.btn {
    padding: 1rem 3rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--btn-text);
    background: var(--btn-bg);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2rem;
}

.btn:hover {
    background: var(--btn-hover);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.high-scores {
    margin-top: 1rem;
    background: rgba(255,255,255,0.05);
    padding: 1.5rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(255,255,255,0.1);
}

.high-scores h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.7;
}

ul {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
}

li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(128,128,128,0.2);
    font-size: 1.1rem;
}

li:last-child {
    border-bottom: none;
}

.rank {
    font-weight: bold;
    color: var(--btn-bg);
    width: 30px;
}
.score {
    font-weight: bold;
    flex-grow: 1;
    text-align: left;
    padding-left: 10px;
}
.date {
    font-size: 0.8rem;
    opacity: 0.6;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Theme Toggle */
#theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 20;
    background: none;
    border: 2px solid currentColor;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    opacity: 0.6;
    transition: all 0.2s;
}
#theme-toggle:hover {
    opacity: 1;
    background: rgba(128,128,128,0.1);
    transform: rotate(15deg);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 600px) {
    h1 { font-size: 3rem; }
    .btn { padding: 0.8rem 2rem; font-size: 1.2rem; }
    .high-scores { padding: 1rem; }
}
