:root {
    --bg: #0f1020;
    --bg-soft: #191a2a;
    --card: #ffffff;
    --ink: #1b1d2a;
    --muted: #5d6275;
    --accent: #ff7a3d;
    --accent-2: #3c7bff;
    --true: #22b07d;
    --false: #ff4d5a;
    --shadow: 0 18px 40px rgba(15, 16, 32, 0.2);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "M PLUS Rounded 1c", "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    font-size: clamp(14px, 1.6vw, 18px);
    color: var(--ink);
    background: radial-gradient(circle at 10% 10%, rgba(255, 252, 199, 0.9) 0%, transparent 35%),
        radial-gradient(circle at 90% 15%, rgba(255, 197, 244, 0.7) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(173, 233, 255, 0.7) 0%, transparent 45%),
        linear-gradient(135deg, #fff4d4 0%, #ffe2f2 45%, #e8f6ff 100%);
    display: flex;
    justify-content: center;
    padding: 36px 20px 60px;
}

.app {
    width: min(980px, 100%);
    position: relative;
}

.app::before,
.app::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(0px);
    opacity: 0.35;
    z-index: -1;
}

.app::before {
    width: 240px;
    height: 240px;
    background: #ffe08f;
    top: -40px;
    left: -40px;
}

.app::after {
    width: 320px;
    height: 320px;
    background: #ffb0e6;
    right: -80px;
    bottom: 60px;
}

.app-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    animation: fadeUp 0.6s ease-out;
}

.title {
    font-family: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    letter-spacing: 0.08em;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    color: #1b1d2a;
    text-shadow: 0 6px 0 rgba(255, 255, 255, 0.8);
}

.hud {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.hud-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    padding: 14px 18px;
    box-shadow: var(--shadow);
    border: 2px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
}

#progress-container,
#news-title,
#answer-buttons,
#final-score-container,
#result-message {
    display: none;
}

.hud-sub {
    font-size: clamp(0.9rem, 1.4vw, 1rem);
    font-weight: 700;
    color: var(--muted);
    margin-top: 6px;
}

#result-message {
    margin-top: 6px;
    font-weight: 700;
}


.game-area {
    display: grid;
    gap: 24px;
    justify-items: center;
    width: 100%;
    position: relative;
}

.rule-card {
    width: min(680px, 100%);
    padding: 22px 26px;
    border-radius: 24px;
    background: linear-gradient(135deg, #fff6bd, #ffe2f5);
    box-shadow: 0 16px 32px rgba(255, 165, 95, 0.25);
    border: 2px dashed rgba(255, 126, 61, 0.6);
}

.rule-title {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    font-weight: 800;
    margin-bottom: 10px;
    color: #ff6d5a;
    letter-spacing: 0.1em;
}

.rule-list {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 6px;
    font-weight: 700;
    font-size: clamp(0.95rem, 1.5vw, 1.05rem);
    color: #3d3f55;
}

.primary-button {
    min-width: 220px;
    padding: 14px 28px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff8a2a, #ff3d7a);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(255, 61, 122, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(255, 61, 122, 0.4);
}

.news-card {
    width: min(920px, 100%);
    padding: 0 28px;
    min-height: 160px;
    background: #ffffff;
    border-radius: 22px;
    font-size: clamp(1.1rem, 2.4vw, 1.7rem);
    font-weight: 700;
    text-align: center;
    display: grid;
    place-items: center;
    text-wrap: balance;
    line-break: strict;
    overflow-wrap: anywhere;
    line-height: 1.5;
    box-shadow: var(--shadow);
    border: 3px solid rgba(255, 138, 42, 0.3);
    animation: fadeUp 0.6s ease-out;
}

.judgement-stamp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7) rotate(-8deg);
    padding: 10px 18px;
    border-radius: 12px;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.1em;
    opacity: 0;
    pointer-events: none;
    border: 4px solid currentColor;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.judgement-stamp.is-show {
    animation: stampIn 0.8s ease-out;
    opacity: 1;
}

.judgement-stamp.is-correct {
    color: #1ca76f;
}

.judgement-stamp.is-wrong {
    color: #ff4d5a;
}

.answer-group {
    display: flex;
    gap: 16px;
    width: min(980px, 100%);
    margin: 0 auto;
    justify-content: center;
}

.answer-button {
    flex: 0 0 calc(50% - 8px);
    min-width: 0;
    padding: 20px 24px;
    border: none;
    border-radius: 16px;
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.answer-button.is-true {
    background: linear-gradient(135deg, #2ecc8f, #1ca76f);
    box-shadow: 0 10px 20px rgba(34, 176, 125, 0.3);
}

.answer-button.is-false {
    background: linear-gradient(135deg, #ff6a7a, #ff4d5a);
    box-shadow: 0 10px 20px rgba(255, 77, 90, 0.3);
}

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

.progress-track {
    margin-top: 8px;
    width: 100%;
    height: 14px;
    background: rgba(31, 31, 31, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff9a2a, #ff3d7a);
    transition: width 0.3s ease;
}

.progress-bar.glow {
    animation: glow 0.45s ease-out;
}

.progress-bar.bounce {
    animation: bounce 0.35s ease-out;
}

.hearts {
    display: flex;
    gap: 8px;
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    margin-top: 8px;
}

.hearts.shake-small {
    animation: shakeSmall 0.35s ease-in-out;
}

.heart {
    color: #ffd2d7;
    text-shadow: 0 2px 0 rgba(255, 77, 90, 0.3);
}

.heart.is-on {
    color: #ff4d5a;
}

.shake {
    animation: shake 0.35s ease-in-out;
}

.final-card {
    margin-top: 40px;
    padding: 28px;
    border-radius: 22px;
    background: #ffffff;
    text-align: center;
    box-shadow: var(--shadow);
    animation: fadeUp 0.6s ease-out;
}

#final-score {
    font-size: 1.6rem;
    font-weight: 700;
}

.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
    padding: 12px 22px;
    border-radius: 999px;
    background: #1f1f1f;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(31, 31, 31, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(31, 31, 31, 0.35);
}

.share-logo {
    width: 20px;
    height: 20px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-6px);
    }
    50% {
        transform: translateX(6px);
    }
    75% {
        transform: translateX(-4px);
    }
    100% {
        transform: translateX(0);
    }
}

@media screen and (max-width: 768px) {
    body {
        padding: 28px 16px 50px;
        font-size: clamp(16px, 3.6vw, 22px);
    }

    .answer-group {
        width: 100%;
    }

    .answer-button {
        padding: 84px 20px;
        font-size: clamp(1.8rem, 6vw, 2.6rem);
    }

    .news-card {
        padding: 0 24px;
        min-height: 280px;
    }

    #progress-container {
        position: relative;
    }

    .progress-track {
        height: 28px;
    }

    #progress-text {
        position: absolute;
        left: 50%;
        top: 22px;
        transform: translateX(-50%);
        width: calc(100% - 36px);
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        font-size: clamp(0.95rem, 3.8vw, 1.2rem);
        color: #1b1d2a;
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
        pointer-events: none;
    }

    .primary-button {
        width: 100%;
    }
}

@keyframes shakeSmall {
    0% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-3px);
    }
    50% {
        transform: translateX(3px);
    }
    75% {
        transform: translateX(-2px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 0 rgba(255, 61, 122, 0);
    }
    50% {
        box-shadow: 0 0 14px rgba(255, 61, 122, 0.8);
    }
    100% {
        box-shadow: 0 0 0 rgba(255, 61, 122, 0);
    }
}

@keyframes bounce {
    0% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(1.18);
    }
    100% {
        transform: scaleY(1);
    }
}

@keyframes stampIn {
    0% {
        transform: translate(-50%, -50%) scale(0.55) rotate(-12deg);
        opacity: 0;
    }
    55% {
        transform: translate(-50%, -46%) scale(1.1) rotate(-8deg);
        opacity: 1;
    }
    75% {
        transform: translate(-50%, -52%) scale(0.98) rotate(-8deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(-8deg);
        opacity: 1;
    }
}