/* css/base.css */
:root {
    --bg: #fafaf8;
    --surface: #ffffff;
    --surface2: #f5f3ef;
    --text: #1a1a18;
    --text2: #555;
    --accent: #c8960c;
    --accent2: #e8c547;
    --border: #e0ddd6;
    --heart: #e04545;
    --green: #3a8c5c;
    --red: #c0392b;
    --blue: #3b6fb6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    --radius: 14px;
    --radius-sm: 8px;
    --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
    --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a18;
        --surface: #252523;
        --surface2: #2e2e2b;
        --text: #e8e6e0;
        --text2: #b0aea8;
        --accent: #e8c547;
        --accent2: #f0d868;
        --border: #3d3d38;
        --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
        --heart: #f06060;
        --green: #4aac6e;
        --red: #e05550;
        --blue: #5b9aee;
    }
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

.container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.header__title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.header__user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text2);
}

.header__coins {
    font-weight: 700;
    color: var(--accent);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.card__title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Ad Slot */
.ad-slot {
    background: var(--surface2);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-align: center;
    color: var(--text2);
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Game Buttons */
.game-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.game-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    color: var(--text);
    transition: all var(--transition);
    text-decoration: none;
    box-shadow: var(--shadow);
    -webkit-user-select: none;
    user-select: none;
    min-height: 60px;
}

.game-btn:hover,
.game-btn:active {
    border-color: var(--accent);
    background: var(--surface2);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.game-btn__info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.game-btn__name {
    font-size: 1.05rem;
    font-weight: 700;
}

.game-btn__cost {
    font-size: 0.8rem;
    color: var(--green);
    font-weight: 600;
}

.game-btn__emoji {
    font-size: 1.6rem;
}

/* Leaderboard */
.leaderboard {
    list-style: none;
    counter-reset: lb;
}

.leaderboard li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

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

.leaderboard__rank {
    font-weight: 700;
    color: var(--accent);
    min-width: 28px;
}

.leaderboard__name {
    flex: 1;
    margin: 0 10px;
}

.leaderboard__score {
    font-weight: 600;
    color: var(--text2);
    font-size: 0.85rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: var(--font);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.toast--show {
    opacity: 1;
    pointer-events: auto;
}

/* Vote page specific */
.vote-option {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
}

.vote-option:hover {
    border-color: var(--accent);
}

.vote-option.selected {
    border-color: var(--accent);
    background: #fef6e0;
}

/* Game pages specific */
.question {
    font-weight: 600;
    margin-bottom: 16px;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    font-size: 1rem;
}

.option:hover {
    border-color: var(--accent);
}

.option.correct {
    border-color: #2e7d32;
    background: #e8f5e9;
}

.option.wrong {
    border-color: #c62828;
    background: #ffebee;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
    transition: opacity var(--transition);
}

.btn:hover {
    opacity: 0.85;
}

.score {
    margin: 12px 0;
    font-size: 1.1rem;
}

.back-link {
    display: inline-block;
    margin-top: 16px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 380px) {
    body {
        padding: 10px;
    }
    .header {
        padding: 10px 14px;
    }
    .game-btn {
        padding: 14px;
    }
}