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

:root {
    --bg-gradient-start: #fafafa;
    --bg-gradient-end: #f0f0f0;
    --container-bg: white;
    --text-primary: #111;
    --text-secondary: #666;
    --text-tertiary: #999;
    --border-color: #e8e8e8;
    --card-bg: #fafafa;
    --card-border: #f0f0f0;
    --button-bg: white;
    --score-bg-start: #fafafa;
    --score-bg-end: #f5f5f5;
    --shadow: rgba(0, 0, 0, 0.08);
}

body.dark-mode,
html.dark-mode-init body {
    --bg-gradient-start: #1a1a1a;
    --bg-gradient-end: #0f0f0f;
    --container-bg: #2a2a2a;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --border-color: #404040;
    --card-bg: #333;
    --card-border: #404040;
    --button-bg: #2a2a2a;
    --score-bg-start: #333;
    --score-bg-end: #2a2a2a;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    background: var(--container-bg);
    max-width: 480px;
    width: 100%;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 700;
    letter-spacing: -0.8px;
}

.header p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.card {
    background: var(--card-bg);
    padding: 24px;
    margin-bottom: 20px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.celebrity-image {
    width: 240px;
    height: 240px;
    margin: 0 auto 20px;
    object-fit: cover;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8);
    border-radius: 12px;
    display: block;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.celebrity-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.celebrity-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #999;
}

.celebrity-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-align: center;
    letter-spacing: -0.5px;
}

.celebrity-counter {
    font-size: 13px;
    color: #999;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
}

.buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

button {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 600;
    border: 2px solid;
    background: var(--button-bg);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

button:active {
    transform: translateY(0);
}

.btn-epstein {
    border-color: #ef4444;
    color: #ef4444;
    position: relative;
    overflow: hidden;
}

.btn-epstein::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.1), transparent);
    transition: left 0.5s;
}

.btn-epstein:hover::before {
    left: 100%;
}

.btn-epstein:hover {
    background: #fef2f2;
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-not {
    border-color: #10b981;
    color: #10b981;
    position: relative;
    overflow: hidden;
}

.btn-not::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.1), transparent);
    transition: left 0.5s;
}

.btn-not:hover::before {
    left: 100%;
}

.btn-not:hover {
    background: #f0fdf4;
    border-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.result {
    background: white;
    padding: 20px;
    margin-bottom: 16px;
    text-align: center;
    border-radius: 16px;
    display: none;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    border: 2px solid;
}

.result.show {
    display: block;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result.correct {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #10b981;
    color: #065f46;
}

.result.incorrect {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #ef4444;
    color: #991b1b;
}

.score-bar {
    background: linear-gradient(135deg, var(--score-bg-start), var(--score-bg-end));
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    transition: background 0.3s ease;
}

.score-bar .label {
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.score-bar .number {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.btn-next {
    width: 100%;
    background: linear-gradient(135deg, #111 0%, #2a2a2a 100%);
    color: white;
    border-color: #111;
    font-weight: 600;
    padding: 16px;
    font-size: 15px;
    margin-top: 0;
    position: relative;
    overflow: hidden;
}

.btn-next::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn-next:hover::before {
    left: 100%;
}

.btn-next:hover {
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    border-color: #000;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.btn-skip {
    width: 100%;
    font-size: 13px;
    color: #888;
    border-color: #e0e0e0;
}

.btn-skip:hover {
    background: #fafafa;
    color: #666;
    border-color: #d0d0d0;
}

.game-over {
    text-align: center;
    padding: 20px 0;
}

.game-over h2 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.8px;
}

.game-over .final-score {
    font-size: 56px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 20px 0;
    letter-spacing: -2px;
}

.game-over .percentage {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.game-over .message {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.btn-restart {
    width: 100%;
    background: #111;
    color: white;
    border-color: #111;
    font-weight: 600;
    padding: 16px;
    font-size: 15px;
}

.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--container-bg);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 1000;
    transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px var(--shadow);
}

.dark-mode-toggle:active {
    transform: scale(0.95);
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}

.fade-in {
    animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@media (max-width: 480px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }

    .container {
        padding: 20px;
        max-height: 100vh;
        overflow-y: auto;
    }

    .header {
        margin-bottom: 20px;
        padding-bottom: 14px;
    }

    .header h1 {
        font-size: 22px;
        margin-bottom: 4px;
    }

    .header p {
        font-size: 12px;
    }

    .card {
        padding: 18px;
        margin-bottom: 14px;
    }

    .celebrity-image {
        width: 180px;
        height: 180px;
        margin-bottom: 14px;
    }

    .celebrity-name {
        font-size: 18px;
        margin-bottom: 0;
    }

    .result {
        padding: 14px;
        font-size: 13px;
        margin-bottom: 14px;
    }

    .score-bar {
        padding: 12px;
        margin-bottom: 14px;
    }

    .score-bar .number {
        font-size: 18px;
    }

    button {
        padding: 12px;
        font-size: 14px;
    }

    .btn-next {
        padding: 12px;
    }

    .buttons {
        gap: 10px;
        margin-bottom: 14px;
    }

    .game-over {
        padding: 12px 0;
    }

    .game-over h2 {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .game-over .final-score {
        font-size: 42px;
        margin: 12px 0;
    }

    .game-over .percentage {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .game-over .message {
        font-size: 14px;
        margin-bottom: 16px;
    }
}
