:root {
    --bg-dark: #0a0e14;
    --primary-neon: #00ff88;
    --secondary-neon: #00e5ff;
    --accent-red: #ff5252;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-main: #e0f7fa;
    --text-muted: #b0bec5;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Zen Maru Gothic', 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 浮遊する微生物の背景 */
.micro-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(10, 14, 20, 0.4) 0%, rgba(10, 14, 20, 0.9) 100%),
        url('https://upload.wikimedia.org/wikipedia/commons/5/5a/EscherichiaColi_NIAID.jpg');
    background-size: cover;
    background-position: center;
    filter: brightness(0.7) contrast(1.2);
}

/* 顕微鏡のレンズ効果（ビネット） */
.micro-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 30%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    backdrop-filter: blur(1px);
    animation: float 20s infinite ease-in-out;
}

.bubble:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-duration: 25s;
}

.bubble:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    left: 80%;
    animation-duration: 30s;
}

.bubble:nth-child(3) {
    width: 80px;
    height: 80px;
    top: 30%;
    left: 70%;
    animation-duration: 22s;
}

.bubble:nth-child(4) {
    width: 120px;
    height: 120px;
    top: 70%;
    left: 20%;
    animation-duration: 28s;
}

.bubble:nth-child(5) {
    width: 60px;
    height: 60px;
    top: 40%;
    left: 40%;
    animation-duration: 18s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -50px) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-10deg);
    }
}

.container {
    width: 90%;
    max-width: 600px;
    z-index: 10;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.5s ease-out forwards;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* スタート画面 */
.micro-lens {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-neon), var(--secondary-neon));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.4);
}

.micro-lens .icon {
    font-size: 3rem;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    background: linear-gradient(to right, #fff, var(--secondary-neon));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* クイズ画面 */
.quiz-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.q-badge,
.score-badge {
    padding: 8px 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-weight: bold;
}

.question-card {
    width: 100%;
    padding: 20px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}

#question-text {
    font-size: 1.25rem;
    line-height: 1.6;
}

.choices-grid {
    width: 100%;
    display: grid;
    gap: 15px;
}

.choice-btn,
.main-btn,
.secondary-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 15px;
    font-family: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.choice-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.choice-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.choice-btn.correct {
    background: rgba(0, 255, 136, 0.3) !important;
    border-color: var(--primary-neon);
}

.choice-btn.incorrect {
    background: rgba(255, 82, 82, 0.3) !important;
    border-color: var(--accent-red);
}

.main-btn {
    background: linear-gradient(to right, var(--primary-neon), var(--secondary-neon));
    color: var(--bg-dark);
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.5);
}

/* フィードバックエリア */
.feedback-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.feedback-content {
    width: 85%;
    max-width: 500px;
    background: var(--bg-dark);
    border: 2px solid var(--glass-border);
    border-radius: 25px;
    padding: 30px;
}

.explanation-box {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    text-align: left;
    color: var(--text-muted);
}

.hidden {
    display: none !important;
}

/* 結果画面 */
.result-card {
    padding: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    backdrop-filter: blur(15px);
}

.final-score {
    font-size: 2rem;
    color: var(--secondary-neon);
    margin: 20px 0;
}

.result-rank {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--secondary-neon);
    color: var(--secondary-neon);
    margin-bottom: 20px;
}

.back-link {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: #fff;
}

rt {
    font-size: 0.6em;
    color: var(--secondary-neon);
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .micro-lens {
        width: 80px;
        height: 80px;
    }

    .micro-lens .icon {
        font-size: 2.5rem;
    }

    #question-text {
        font-size: 1.1rem;
        word-break: break-all;
        overflow-wrap: break-word;
        line-height: 1.8;
    }

    .choice-btn,
    .main-btn,
    .secondary-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .question-card,
    .result-card,
    .feedback-content {
        padding: 20px 15px;
    }
}