:root {
    --bg: #f6f4ff;
    --card: #ffffff;
    --text: #1f1f1f;
    --muted: #666666;
    --accent: #7c3aed;
    --accent-hover: #6d28d9;
    --border: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.08);
}

body.dark {
    --bg: #0f1117;
    --card: #1b1f2a;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --border: #2d3748;
    --shadow: rgba(0, 0, 0, 0.35);
}

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

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);

    transition:
        background 0.25s ease,
        color 0.25s ease;
}

.hidden {
    display: none !important;
}

/* =========================
   HEADER
========================= */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 20px;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* =========================
   BUTTONS
========================= */

button {
    border: none;
    border-radius: 12px;

    cursor: pointer;

    padding: 12px 18px;

    font-size: 1rem;
    font-weight: 600;

    transition:
        transform 0.15s ease,
        background 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: scale(0.98);
}

.primary {
    background: var(--accent);
    color: white;
}

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

.large {
    width: 100%;
    max-width: 320px;
    padding: 16px;
    font-size: 1.1rem;
}

/* =========================
   SETUP SCREEN
========================= */

.setup-screen {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

.setup-content {
    width: 100%;
    max-width: 700px;

    margin: auto;

    display: flex;
    flex-direction: column;
    gap: 20px;

    padding: 20px;
}

.panel {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: 20px;

    padding: 20px;

    box-shadow:
        0 4px 16px var(--shadow);
}

.panel h2 {
    margin-bottom: 16px;
}

/* =========================
   CATEGORIES
========================= */

.categories,
.levels {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.categories label,
.levels label {
    display: flex;
    align-items: center;
    gap: 10px;

    cursor: pointer;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* =========================
   GAME SCREEN
========================= */

.game-screen {
    width: 100%;
    min-height: 100vh;
}

.card-screen {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    gap: 30px;

    padding: 24px;
}

/* =========================
   CARD
========================= */

.card {
    width: 100%;
    max-width: 700px;

    min-height: 320px;

    background: var(--card);

    border: 2px solid var(--border);

    border-radius: 28px;

    box-shadow:
        0 10px 30px var(--shadow);

    display: flex;
    justify-content: center;
    align-items: center;

    text-align: center;

    padding: 40px;

    perspective: 1000px;

    cursor: pointer;

    user-select: none;

    transition:
        transform 0.35s ease,
        opacity 0.35s ease,
        background 0.25s ease;
}

.card:hover {
    transform: translateY(-3px);
}

.question {
    font-size: clamp(1.4rem, 2vw, 2rem);
    line-height: 1.6;
    font-weight: 600;
}

/* =========================
   CARD ACTIONS
========================= */

.card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;

    gap: 12px;
}

/* =========================
   ANIMATIONS
========================= */

.flipping {
    transform: rotateY(90deg);
}

.shuffle {
    transform: scale(0.96);
    opacity: 0.5;
}

/* =========================
   FULLSCREEN
========================= */

:fullscreen .card-screen {
    min-height: 100vh;
}

:fullscreen .card {
    width: min(900px, 90vw);
    min-height: 60vh;
}

:fullscreen .question {
    font-size: clamp(2rem, 4vw, 3rem);
}

/* =========================
   MOBILE
========================= */

@media (max-width: 768px) {

    .header {
        padding: 16px;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .card {
        min-height: 260px;
        padding: 24px;
    }

    .question {
        font-size: 1.3rem;
    }

    .card-actions {
        width: 100%;
        flex-direction: column;
    }

    .card-actions button {
        width: 100%;
    }
}

/* =========================
   SMALL PHONES
========================= */

@media (max-width: 480px) {

    .setup-content {
        padding: 16px;
    }

    .panel {
        padding: 16px;
    }

    .card {
        min-height: 220px;
        border-radius: 20px;
    }

    .question {
        font-size: 1.15rem;
        line-height: 1.5;
    }
}
