:root {
    --bg-main: #f8fbff;
    --bg-card: #ffffff;
    --text-main: #1f2a37;
    --text-soft: #3d4f63;
    --brand: #0056b3;
    --brand-soft: #cfe6ff;
    --accent: #ffb703;
    --ok: #2f9e44;
    --danger: #c92a2a;
    --radius-lg: 18px;
    --shadow-soft: 0 10px 30px rgba(2, 29, 58, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Nunito", sans-serif;
    font-size: 18px;
    color: var(--text-main);
    background:
        radial-gradient(1200px 400px at 10% -20%, #e4f1ff 0%, transparent 65%),
        radial-gradient(900px 400px at 90% -20%, #ffeeca 0%, transparent 60%),
        var(--bg-main);
}

.top-nav {
    background: #ffffffd9;
    backdrop-filter: blur(4px);
    border-bottom: 1px solid #dce8f5;
}

.navbar .nav-link {
    font-weight: 700;
    font-size: 1rem;
}

.hero-card,
.soft-card,
.stat-card,
.game-list-card {
    border: 0;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-soft);
}

.hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #eaf4ff 100%);
}

.game-info-card {
    border-radius: var(--radius-lg);
    border: 2px solid #e7eff8;
}

.stat-card h2 {
    color: var(--text-soft);
    letter-spacing: 0.04em;
}

.stat-card .display-6 {
    color: var(--brand);
}

.game-list-card {
    border-left: 7px solid var(--brand);
}

.btn {
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 700;
}

.btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
}

.btn-primary:hover {
    background-color: #004a98;
    border-color: #004a98;
}

.question-box {
    background: var(--brand-soft);
    border-radius: 14px;
    padding: 16px;
    min-height: 74px;
}

.memory-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(65px, 1fr));
    gap: 12px;
}

.memory-card {
    height: 84px;
    border: 2px solid #d7e3f2;
    border-radius: 12px;
    background: #f1f6fd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
}

.memory-card.revealed,
.memory-card.matched {
    background: #fff;
    border-color: #9ac7ff;
}

.memory-card.matched {
    border-color: #8dd99c;
}

.wordsearch-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(32px, 1fr));
    gap: 6px;
}

.word-cell {
    border: 2px solid #d8e6f8;
    border-radius: 10px;
    min-height: 42px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: #fff;
    cursor: pointer;
}

.word-cell.selected {
    background: #ffe7b3;
    border-color: #ffb703;
}

.word-cell.found {
    background: #d3f9d8;
    border-color: #69db7c;
}

.progress-timeline {
    display: grid;
    gap: 10px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 200px 1fr 70px;
    gap: 10px;
    align-items: center;
}

.timeline-bar {
    height: 16px;
    border-radius: 999px;
    background: #e8eef6;
    overflow: hidden;
}

.timeline-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3fa7ff, #0056b3);
}

.timeline-score {
    font-weight: 800;
    text-align: right;
}

.form-control,
.form-select {
    font-size: 1.08rem;
    border-radius: 12px;
    min-height: 52px;
}

table.table th {
    white-space: nowrap;
    font-weight: 800;
}

@media (max-width: 768px) {
    body {
        font-size: 17px;
    }

    .memory-board {
        grid-template-columns: repeat(4, minmax(56px, 1fr));
        gap: 10px;
    }

    .memory-card {
        height: 72px;
        font-size: 1.7rem;
    }

    .timeline-item {
        grid-template-columns: 1fr;
    }

    .timeline-score {
        text-align: left;
    }
}
