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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background 0.4s ease, color 0.4s ease;
}

h1 {
    color: white;
    font-size: 2.5em;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

canvas {
    border-radius: 16px;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: #f9fafb;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

button {
    padding: 14px 40px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: white;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(6, 182, 212, 0.5);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.4);
}

.social-links {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    justify-content: center;
    font-size: 14px;
}

.social-links a {
    color: rgba(15, 23, 42, 0.7);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
}

.social-links a:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

.controls-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
}

.size-control {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.85);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.7);
}

.size-control label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #cbd5f5;
}

.size-control select {
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 8px;
    border: none;
    outline: none;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    cursor: pointer;
}

.dark-toggle button {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.dark-toggle button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 35px rgba(15, 23, 42, 0.7);
}

.dark-toggle button:active {
    transform: translateY(0);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.6);
}

/* Dark theme */
body.dark {
    background: radial-gradient(circle at top, #1e293b 0%, #020617 55%, #000 100%);
    color: #e5e7eb;
}

body.dark h1 {
    color: #e5e7eb;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
}

body.dark .game-container {
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
}

body.dark canvas {
    background: #020617;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
}

body.dark button#restartBtn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 18px rgba(34, 197, 94, 0.4);
}

body.dark .social-links a {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

body.dark .social-links a:hover {
    background: rgba(30, 64, 175, 0.9);
}
