* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, "Hiragino Sans", "Yu Gothic", sans-serif;
    background: #f8fafc;
    color: #1f2937;
    line-height: 1.5;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin-top: 0;
}

/* ------------------------------
   共通レイアウト・UI
------------------------------ */

.card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    border-color: #dbeafe;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
}

.muted-text {
    color: #6b7280;
}

.small-muted {
    color: #9ca3af;
    font-size: 0.875rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.badge-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-orange {
    background: #ffedd5;
    color: #c2410c;
}

.badge-gray {
    background: #f3f4f6;
    color: #374151;
}

/* ------------------------------
   ボタン
------------------------------ */

.start-button,
.primary-button,
.secondary-button,
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 12px;
}

.start-button,
.primary-button,
.btn-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.start-button:hover,
.primary-button:hover,
.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.secondary-button,
.btn-secondary {
    background: #e5e7eb;
    color: #111827;
}

.secondary-button:hover,
.btn-secondary:hover {
    background: #d1d5db;
    transform: translateY(-1px);
}

/* 横幅いっぱいにしたくない時用 */
.button-inline {
    width: auto;
}

/* ------------------------------
   モードカード
------------------------------ */

.mode-button {
    display: block;
    text-decoration: none;
    border-radius: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.mode-button:hover {
    transform: translateY(-2px);
}

/* ------------------------------
   ゲーム画面
------------------------------ */

.game-card {
    text-align: center;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-weight: 700;
    font-size: 15px;
    color: #374151;
}

.question-area {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: 4px;
    margin: 28px 0;
    padding: 20px 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    color: #111827;
}

.choices-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.choice-button {
    padding: 18px 12px;
    font-size: 20px;
    font-weight: 600;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.choice-button:hover {
    background: #f8fafc;
    border-color: #93c5fd;
    transform: translateY(-1px);
}

.choice-button:disabled {
    cursor: not-allowed;
    opacity: 1;
}

.choice-button.correct {
    background: #dcfce7;
    border-color: #16a34a;
    color: #166534;
}

.choice-button.wrong {
    background: #fee2e2;
    border-color: #dc2626;
    color: #991b1b;
}

.message {
    min-height: 32px;
    margin-top: 20px;
    font-weight: 700;
    font-size: 18px;
}

.correct-text {
    color: #16a34a;
}

.wrong-text {
    color: #dc2626;
}

.result-area {
    margin-top: 20px;
}

.result-buttons {
    margin-top: 20px;
}

/* ------------------------------
   汎用
------------------------------ */

.hidden {
    display: none !important;
}

/* ------------------------------
   モバイル調整
------------------------------ */

@media (max-width: 768px) {
    .card {
        padding: 18px;
        border-radius: 16px;
    }

    .game-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .question-area {
        font-size: 32px;
        letter-spacing: 2px;
        padding: 18px 10px;
    }

    .choice-button {
        font-size: 18px;
        padding: 16px 10px;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 16px;
    }

    .question-area {
        font-size: 28px;
        letter-spacing: 1px;
        margin: 22px 0;
    }

    .choices-area {
        grid-template-columns: 1fr;
    }

    .choice-button {
        font-size: 17px;
        padding: 15px 10px;
    }

    .start-button,
    .primary-button,
    .secondary-button,
    .btn-primary,
    .btn-secondary {
        font-size: 15px;
        padding: 13px 14px;
    }
}