:root {
    --region-indigo: #1a237e;
    --setouchi-blue: #40e0d0;
    --seaweed-green: #2e8b57;
    --deep-ocean: #001f3f;
    --sky-blue: #87ceeb;
    --sand-white: #f8f9fa;
    --text-dark: #1a2a3a;
    --accent-gold: #ffd700;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Zen Maru Gothic', sans-serif;
    color: var(--text-dark);
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--sky-blue);
}

/* 水中の背景デザイン */
.underwater-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #b0e0e6 0%, #4682b4 50%, #000080 100%);
    z-index: -1;
}

/* 泡のアニメーション */
.bubble {
    position: absolute;
    bottom: -50px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: rise infinite ease-in;
}

.b1 {
    width: 40px;
    height: 40px;
    left: 10%;
    animation-duration: 8s;
}

.b2 {
    width: 20px;
    height: 20px;
    left: 30%;
    animation-duration: 6s;
    animation-delay: 2s;
}

.b3 {
    width: 35px;
    height: 35px;
    left: 70%;
    animation-duration: 9s;
    animation-delay: 1s;
}

.b4 {
    width: 15px;
    height: 15px;
    left: 85%;
    animation-duration: 7s;
    animation-delay: 4s;
}

.b5 {
    width: 25px;
    height: 25px;
    left: 50%;
    animation-duration: 10s;
}

@keyframes rise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    20% {
        opacity: 0.5;
    }

    80% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-120vh) translateX(20px);
        opacity: 0;
    }
}

/* 魚の影 */
.fish-shadow {
    position: absolute;
    font-size: 3rem;
    opacity: 0.2;
    pointer-events: none;
    animation: swim-across infinite linear;
}

.fs1 {
    top: 20%;
    animation-duration: 25s;
}

.fs2 {
    top: 60%;
    animation-duration: 35s;
    animation-delay: 10s;
}

@keyframes swim-across {
    from {
        left: -100px;
        transform: scaleX(1);
    }

    50% {
        transform: scaleX(1);
    }

    51% {
        transform: scaleX(-1);
    }

    to {
        left: 110%;
        transform: scaleX(-1);
    }
}

.container {
    flex: 1;
    width: 90%;
    max-width: 600px;
    margin: 40px auto;
    z-index: 10;
}

.screen {
    display: none;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 20px;
    border-radius: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--setouchi-blue);
    text-align: center;
    backdrop-filter: blur(8px);
    animation: slideUp 0.6s ease-out;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.8rem;
    color: var(--deep-blue);
    margin-bottom: 20px;
    line-height: 1.3;
}

.start-btn {
    background: var(--coral-pink);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    padding: 12px 35px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 0 #d14a1f;
    transition: all 0.2s;
    margin-top: 20px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #d14a1f;
}

.start-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #d14a1f;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--seaweed-green);
    text-decoration: none;
    font-weight: bold;
}

/* クイズ中 */
.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    font-weight: bold;
}

.progress-box,
.score-box {
    background: var(--turquoise);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
}

.question-container {
    background: var(--shell-white);
    padding: 20px;
    border-radius: 25px;
    margin-bottom: 20px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 6px solid #e0ddd5;
}

#question-text {
    font-size: 1.4rem;
    color: var(--text-dark);
}

.choices-grid {
    display: grid;
    gap: 15px;
}

.choice-btn {
    background: white;
    border: 3px solid var(--sky-blue);
    padding: 12px 18px;
    border-radius: 20px;
    font-size: 1.15rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
}

.choice-btn:hover {
    background-color: var(--sky-blue);
    color: white;
}

/* ポップアップ */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.feedback-card {
    background: white;
    width: 85%;
    max-width: 450px;
    padding: 40px;
    border-radius: 35px;
    text-align: center;
    border: 5px solid var(--accent-yellow);
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.explanation {
    background: #f0fdfa;
    padding: 20px;
    border-radius: 20px;
    margin: 20px 0;
    text-align: left;
    color: #444;
}

.next-btn {
    background: var(--seaweed-green);
    color: white;
    padding: 12px 30px;
    font-size: 1.2rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
}

.hidden {
    display: none;
}

/* 結果発表 */
.score-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--coral-pink);
}

.rank-box {
    margin: 20px 0;
    padding: 15px;
    background: var(--shell-white);
    border-radius: 20px;
}

#rank-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--deep-blue);
}

#rank-desc {
    font-size: 1.1rem;
    color: #666;
}

.retry-btn {
    background: var(--turquoise);
    color: white;
    padding: 15px 35px;
    font-size: 1.2rem;
    border-radius: 40px;
    border: none;
    cursor: pointer;
}

footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.8rem;
}

/* スマホ対応 */
@media (max-width: 600px) {
    .container {
        width: 96%;
        margin: 15px auto;
    }

    .screen {
        padding: 25px 15px;
        border-radius: 25px;
    }

    .question-container {
        padding: 20px 10px;
        margin-bottom: 20px;
        min-height: auto;
    }

    h1 {
        font-size: 1.6rem;
    }

    #question-text {
        font-size: 1.1rem;
        word-break: break-all;
        overflow-wrap: break-word;
        line-height: 1.8;
    }

    .choice-btn {
        font-size: 0.95rem;
        padding: 12px;
    }
}

ruby {
    font-family: inherit;
}

rt {
    font-size: 0.6em;
}