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

:root {
    --bg: #eef4fb;
    --surface: #ffffff;
    --surface-soft: #eff6ff;
    --text: #102a43;
    --muted: #475569;
    --line: #d7e3fc;
    --brand: #2563eb;
    --brand-dark: #1d4ed8;
    --accent: #0f766e;
    --warning-bg: #fffbeb;
    --warning-line: #fcd34d;
    --danger-bg: #fef2f2;
    --danger-line: #fecaca;
    --shadow: 0 24px 64px rgba(15, 23, 42, 0.08);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 26rem),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.10), transparent 22rem),
        linear-gradient(180deg, #f7faff 0%, var(--bg) 100%);
    color: var(--text);
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    line-height: 1.7;
    padding: 40px 20px 32px;
}

.container,
.page {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.page {
    padding-bottom: 24px;
}

.page-header {
    margin-bottom: 28px;
}

.eyebrow {
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.2em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

h1 {
    color: #0f172a;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.05;
    margin-bottom: 14px;
}

h2 {
    color: #102a43;
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 10px;
}

h3 {
    color: #1e293b;
    font-size: 18px;
    margin-top: 22px;
    margin-bottom: 10px;
}

h3:first-child {
    margin-top: 0;
}

p {
    margin-bottom: 14px;
}

.subtitle {
    max-width: 740px;
    color: var(--muted);
    font-size: 18px;
    margin-bottom: 36px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.card,
.section {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.card {
    display: flex;
    flex-direction: column;
    min-height: 230px;
    padding: 32px;
    text-decoration: none;
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 28px 72px rgba(15, 23, 42, 0.14);
    transform: translateY(-4px);
}

.card::before {
    content: "";
    width: 64px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(37, 99, 235, 1), rgba(56, 189, 248, 0.8));
    margin-bottom: 22px;
}

.card-image {
    display: block;
    width: 100%;
    margin-bottom: 18px;
}

.card-image img,
.scenario-image img {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    display: block;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.scenario-image {
    display: block;
    width: 100%;
    margin-bottom: 22px;
}

.card p {
    color: var(--muted);
    margin-bottom: 26px;
    font-size: 15.4px;
}

.section {
    margin-bottom: 24px;
    padding: 32px;
}

ul,
ol {
    margin-left: 24px;
}

li {
    margin-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    margin: 18px 0 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
}

th,
td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

th {
    background: #1e40af;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 700;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr:nth-child(even) {
    background: #f8fbff;
}

.btn,
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
}

.btn {
    width: fit-content;
    min-width: 120px;
    margin-right: 10px;
    padding: 12px 22px;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    color: #ffffff;
    box-shadow: 0 16px 30px rgba(56, 189, 248, 0.18);
}

.btn.dark {
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.16);
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
}

.card .btn:first-of-type {
    margin-top: 0;
}

.btn:hover,
.back-btn:hover {
    transform: translateY(-1px);
}

.btn:hover {
    box-shadow: 0 20px 34px rgba(56, 189, 248, 0.22);
}

.btn.dark:hover {
    background: #1e293b;
}

.back-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    width: fit-content;
    margin-bottom: 28px;
    padding: 12px 18px;
    background: #ffffff;
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.18);
}

.back-btn::before {
    content: "<";
    margin-right: 10px;
    font-weight: 900;
}

.speech-box,
.problem-box,
.note {
    border-radius: 20px;
    padding: 22px;
}

.speech-box {
    background: rgba(236, 245, 255, 0.95);
    border: 1px solid rgba(191, 219, 254, 0.7);
}

.speech-box p:last-child,
.problem-box p:last-child,
.note {
    margin-bottom: 0;
}

.problem-box {
    background: var(--danger-bg);
    border: 1px solid var(--danger-line);
}

.note {
    background: var(--warning-bg);
    border: 1px solid var(--warning-line);
    color: #92400e;
    font-weight: 700;
}

.hint {
    background: rgba(229, 246, 253, 0.95);
    padding: 16px;
    border-radius: 18px;
    margin-top: 14px;
    margin-bottom: 18px;
    color: #0f172a;
    line-height: 1.8;
    font-size: 15px;
}

.hint-box {
    margin-top: 14px;
    margin-bottom: 18px;
}

.hint-box summary {
    cursor: pointer;
    background: #111827;
    color: white;
    padding: 12px 14px;
    border-radius: 14px;
    width: fit-content;
    font-size: 14px;
    list-style: none;
}

.hint-box summary:hover {
    background: #334155;
}

.slang-term {
    display: inline-block;
    position: relative;
    margin: 0 0.1rem;
}

.slang-term summary {
    cursor: pointer;
    list-style: none;
    text-decoration: underline;
    text-underline-offset: 4px;
    color: #0f172a;
    font-weight: 700;
}

.slang-term summary::-webkit-details-marker {
    display: none;
}

.slang-term .slang-meaning {
    display: none;
    position: absolute;
    top: 120%;
    left: 0;
    min-width: 12rem;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    color: #102a43;
    z-index: 20;
    font-size: 0.95rem;
    white-space: normal;
}

.slang-term[open] .slang-meaning {
    display: block;
}

.shopping-list {
    margin-top: 20px;
    margin-bottom: 20px;
    list-style: none;
    padding: 0;
}

.shopping-list li {
    background: #f8fafc;
    padding: 14px 18px;
    border-radius: 16px;
    margin-bottom: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.shopping-list label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.shopping-list input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.shopping-table td:nth-child(4) {
    background: #fffbeb;
}

.shopping-table td:nth-child(5) {
    background: #eff6ff;
}

@media (max-width: 840px) {
    body {
        padding: 30px 16px 28px;
    }

    .game-grid {
        grid-template-columns: 1fr;
    }

    .card,
    .section {
        padding: 26px;
    }

    .btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 12px;
    }

    .card::before {
        width: 48px;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: clamp(30px, 10vw, 42px);
    }

    .subtitle {
        font-size: 16px;
    }

    .btn {
        min-width: 0;
    }
}

.scenario-image img{
    width:100%;
    max-width:700px;
    border-radius:16px;
    margin-top:20px;
}

.shopping-table details summary{
    cursor:pointer;
    font-weight:600;
}

.shopping-table details{
    min-width:180px;
}

.total-row{
    background:#f3f4f6;
    font-size:18px;
}

#budgetMessage{
    font-weight:bold;
}

.item-check{
    width:20px;
    height:20px;
    cursor:pointer;
}

.price-input{
    width:80px;
    padding:8px;
    border-radius:8px;
    border:1px solid #ccc;
    font-size:16px;
}

.total-row{
    background:#f3f4f6;
    font-size:18px;
}

#budgetMessage{
    font-weight:bold;
}

