* {
    box-sizing: border-box;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}
#root {
    min-height: 100vh;
}
:root {
    --bg-grad-1: #243b55;
    --bg-grad-2: #141e30;
    --panel: rgba(255, 255, 255, 0.05);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text: #fff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent: #2b8be6;
    --accent-hover: #3fa0ff;
    --muted: rgba(255, 255, 255, 0.6);
    --btn-warning: #e02b2b;
    --btn-warning-hover: #ff3838;
    --board-bg: rgba(255, 255, 255, 0.02);
    --board-border: rgba(255, 255, 255, 0.08);
    --stat-bg: rgba(255, 255, 255, 0.08);
}

/* light theme overrides */
.theme-light {
    --bg-grad-1: #f5f7fb;
    --bg-grad-2: #e8eef7;
    --panel: rgba(255, 255, 255, 0.8);
    --panel-border: rgba(12, 20, 30, 0.12);
    --text: #111827;
    --text-secondary: rgba(17, 24, 39, 0.7);
    --accent: #0b6edd;
    --accent-hover: #0956b8;
    --muted: rgba(17, 24, 39, 0.6);
    --btn-warning: #b91c1c;
    --btn-warning-hover: #991b1b;
    --board-bg: rgba(12, 20, 30, 0.03);
    --board-border: rgba(12, 20, 30, 0.1);
    --stat-bg: rgba(12, 20, 30, 0.06);
}
body {
    margin: 0;
    background: linear-gradient(135deg, var(--bg-grad-1), var(--bg-grad-2));
    min-height: 100vh;
    color: var(--text);
    padding: 20px;
}

#game-container {
    max-width: 960px;
    margin: 0 auto;
    background: var(--panel);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(10px);
}

header {
    margin-bottom: 24px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

header h1 {
    font-size: 2rem;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stat-item {
    background: var(--stat-bg);
    padding: 12px 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 120px;
    border: 1px solid var(--board-border);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

#instructions {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 12px 0;
}
#board {
    height: 480px;
    border-radius: 12px;
    background: var(--board-bg);
    margin: 24px 0;
    position: relative;
    overflow: hidden;
    border: 2px dashed var(--board-border);
    transition: border-color 0.3s ease;
}

#board:hover {
    border-color: var(--accent);
}

.drop-target {
    position: absolute;
    right: 24px;
    bottom: 24px;
    width: 140px;
    height: 140px;
    border-radius: 16px;
    background: var(--stat-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
    border: 2px solid var(--board-border);
    transition: all 0.3s ease;
}

.basket-icon {
    font-size: 56px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.basket-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.star {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffd65a, #ff8a00);
    color: #2b2b2b;
    font-weight: bold;
    font-size: 1.8rem;
    box-shadow: 0 8px 24px rgba(255, 170, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: grab;
    user-select: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.star:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(255, 170, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.star:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.star.no-transition {
    transition: none !important;
}
#controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

button,
.btn {
    border: 0;
    background: var(--accent);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

button:hover,
.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

button:active,
.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

button#reset,
.btn-reset {
    background: var(--btn-warning);
}

button#reset:hover,
.btn-reset:hover {
    background: var(--btn-warning-hover);
}

.btn-icon {
    font-size: 1.2rem;
    line-height: 1;
}
#theme-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
}

#theme-switcher label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#theme-toggle {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--board-border);
    background: var(--stat-bg);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#theme-toggle:hover {
    background: var(--board-border);
    border-color: var(--accent);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    #game-container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .stats-bar {
        gap: 12px;
    }

    .stat-item {
        min-width: 100px;
        padding: 10px 16px;
    }

    #board {
        height: 380px;
    }

    .drop-target {
        width: 110px;
        height: 110px;
    }

    .basket-icon {
        font-size: 44px;
    }
}

/* End Game Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.show {
    opacity: 1;
    pointer-events: all;
}

.end-game-card {
    background: var(--panel);
    border: 2px solid var(--panel-border);
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.end-game-title {
    font-size: 2.2rem;
    margin: 0 0 32px 0;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}

.end-game-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.end-stat {
    background: var(--stat-bg);
    padding: 20px 32px;
    border-radius: 12px;
    border: 1px solid var(--board-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.end-stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
}

.end-stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

.end-game-message {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0 0 32px 0;
    line-height: 1.6;
}

.btn-primary {
    background: var(--accent);
    font-size: 1.1rem;
    padding: 16px 40px;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

@media (max-width: 640px) {
    .end-game-card {
        padding: 32px 24px;
    }

    .end-game-title {
        font-size: 1.6rem;
    }

    .end-stat-value {
        font-size: 2.2rem;
    }
}
