* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #1F2937; }
.child-bg { background: linear-gradient(180deg, var(--soft), #ffffff 55%); }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: rgba(255,255,255,.86); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(147,51,234,.08); }
.brand-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }
.brand-logo { width: 40px; height: 40px; border-radius: 14px; object-fit: cover; }
.brand-name { font-weight: 800; color: #1F2937; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-logout { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid #E9D5FF; border-radius: 14px; padding: 0 14px; color: var(--primary); background: #fff; font-weight: 700; }
.page-shell { width: min(960px, 100%); margin: 0 auto; padding: 20px 16px 48px; }
.alert { padding: 14px 16px; border-radius: 18px; margin-bottom: 16px; font-weight: 700; line-height: 1.5; }
.alert-success { background: #DCFCE7; color: #166534; }
.alert-error { background: #FEE2E2; color: #991B1B; }
.alert-info { background: #EDE9FE; color: #5B21B6; }
.btn-primary, .btn-secondary { min-height: 48px; border-radius: 16px; padding: 13px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; border: 0; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 10px 22px rgba(147, 51, 234, .20); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--primary); border: 1px solid #E9D5FF; }
.btn-secondary:hover { background: #F5F3FF; }
.small-btn { min-height: 44px; padding: 10px 16px; border-radius: 14px; }
.btn-spinner { width: 18px; height: 18px; border-radius: 999px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.soft-pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 12px; background: #F3E8FF; color: var(--primary); font-weight: 800; font-size: 14px; }
.landing-wrap, .auth-wrap, .role-wrap { min-height: calc(100vh - 92px); display: grid; place-items: center; }
.landing-card, .auth-card, .center-card, .story-card, .quiz-card, .score-card { width: 100%; background: rgba(255,255,255,.96); border: 1px solid rgba(147,51,234,.10); border-radius: 28px; padding: 26px; box-shadow: 0 24px 60px rgba(31,41,55,.08); }
.landing-card { text-align: center; max-width: 620px; }
.landing-logo { width: 96px; height: 96px; border-radius: 30px; margin: 0 auto 16px; box-shadow: 0 18px 36px rgba(147,51,234,.18); }
.landing-card h1, .auth-card h1, .role-heading h1, .child-hero h1, .story-header h1, .score-card h1 { margin: 16px 0 10px; font-size: clamp(30px, 8vw, 52px); line-height: 1.05; font-weight: 900; color: #1F2937; }
.landing-desc, .role-heading p, .child-hero p, .story-header p, .auth-heading p, .score-text { color: #6B7280; font-size: 17px; line-height: 1.65; }
.landing-actions { display: flex; gap: 10px; margin: 28px 0 18px; justify-content: center; }
.landing-notes { display: grid; gap: 10px; margin-top: 20px; color: #6B7280; }
.landing-notes div { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #FAF5FF; border-radius: 16px; }
.auth-card { max-width: 540px; }
.auth-wrap.wide .auth-card { max-width: 660px; }
.auth-heading { text-align: center; margin-bottom: 24px; }
.icon-bubble { width: 58px; height: 58px; margin: 0 auto; display: grid; place-items: center; border-radius: 20px; background: #F3E8FF; color: var(--primary); font-size: 24px; }
.section-title-small { font-weight: 900; color: var(--primary); background: #FAF5FF; padding: 12px 14px; border-radius: 16px; }
.form-label { display: block; font-weight: 800; margin-bottom: 8px; color: #374151; }
.input-wrap { position: relative; }
.input-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #9CA3AF; pointer-events: none; }
.form-input { width: 100%; min-height: 52px; border: 1px solid #E5E7EB; border-radius: 16px; padding: 13px 14px 13px 46px; outline: none; background: #fff; color: #1F2937; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(147,51,234,.12); }
.field-hint { color: #6B7280; margin-top: 6px; font-size: 14px; line-height: 1.45; }
.province-select-wrap .input-icon { z-index: 3; }
.province-select-wrap .select2-container { width: 100% !important; display: block; }
.province-select-wrap .select2-container--default .select2-selection--single { min-height: 52px; border: 1px solid #E5E7EB; border-radius: 16px; background: #fff; display: flex; align-items: center; }
.province-select-wrap .select2-container--default.select2-container--focus .select2-selection--single, .province-select-wrap .select2-container--default.select2-container--open .select2-selection--single { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(147,51,234,.12); }
.province-select-wrap .select2-container--default .select2-selection--single .select2-selection__rendered { width: 100%; color: #1F2937; line-height: 52px; padding-left: 46px; padding-right: 44px; font-weight: 700; }
.province-select-wrap .select2-container--default .select2-selection--single .select2-selection__placeholder { color: #9CA3AF; font-weight: 700; }
.province-select-wrap .select2-container--default .select2-selection--single .select2-selection__arrow { height: 52px; right: 12px; }
.province-select-wrap .select2-container--default .select2-selection--single .select2-selection__clear { height: 52px; position: absolute; right: 20px; color: #ff1f1f; font-size: 20px; }
.province-select-wrap .select2-container--default.select2-container--disabled .select2-selection--single { background: #F9FAFB; color: #9CA3AF; }
.select2-container--open { z-index: 9999; }
.province-select-dropdown { border-color: #E9D5FF; border-radius: 16px; overflow: hidden; box-shadow: 0 18px 40px rgba(31,41,55,.12); }
.province-select-dropdown .select2-search--dropdown { padding: 12px; }
.province-select-dropdown .select2-search__field { min-height: 44px; border: 1px solid #E5E7EB !important; border-radius: 14px; padding: 10px 12px !important; outline: none; }
.province-select-dropdown .select2-search__field:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 4px rgba(147,51,234,.12); }
.province-select-dropdown .select2-results__option { padding: 12px 16px; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.province-select-dropdown .select2-results__option--highlighted.select2-results__option--selectable { background: #F3E8FF; color: var(--primary); }
.password-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 12px; color: #6B7280; background: transparent; border: 0; }
.field-error { color: #B91C1C; margin-top: 6px; font-weight: 700; font-size: 14px; }
.soft-divider { display: flex; align-items: center; gap: 12px; color: var(--primary); font-weight: 900; }
.soft-divider::before, .soft-divider::after { content: ''; flex: 1; height: 1px; background: #E9D5FF; }
.auth-bottom { margin-top: 20px; text-align: center; color: #6B7280; }
.auth-bottom a, .quiet-link { color: var(--primary); font-weight: 900; }
.role-heading { text-align: center; max-width: 620px; margin-bottom: 26px; }
.role-grid { display: grid; gap: 16px; width: min(780px, 100%); }
.role-card { position: relative; background: #fff; border: 2px solid #E9D5FF; border-radius: 26px; padding: 20px; min-height: 190px; box-shadow: 0 20px 50px rgba(31,41,55,.06); }
.role-card-button { width: 100%; height: 100%; text-align: left; background: transparent; border: 0; display: grid; gap: 12px; color: #1F2937; }
.active-card { border-color: var(--primary); }
.disabled-card { opacity: .66; display: grid; gap: 12px; }
.role-icon { width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; background: #F3E8FF; color: var(--primary); font-size: 26px; }
.role-icon.muted { background: #F3F4F6; color: #6B7280; }
.role-title { font-size: 22px; font-weight: 900; }
.role-desc { color: #6B7280; line-height: 1.5; }
.coming-badge { position: absolute; top: 16px; right: 16px; background: #F3F4F6; color: #6B7280; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 900; }
.center-card { max-width: 620px; text-align: center; margin: 56px auto; }
.center-card h1 { font-size: 42px; font-weight: 900; margin: 14px 0; }
.center-card p { color: #6B7280; line-height: 1.7; }
.child-hero, .story-header { display: grid; gap: 16px; margin: 10px 0 22px; }
.roadmap-list { display: grid; gap: 16px; }
.road-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; background: #fff; border: 1px solid #E9D5FF; border-radius: 24px; padding: 18px; box-shadow: 0 16px 40px rgba(31,41,55,.06); }
.road-index { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; background: var(--primary); color: #fff; font-weight: 900; }
.road-card.completed .road-index { background: #22C55E; }
.road-card.locked { opacity: .68; background: #F9FAFB; border-color: #E5E7EB; }
.road-card.locked .road-index { background: #D1D5DB; color: #4B5563; }
.road-content h2 { font-size: 21px; font-weight: 900; margin: 0 0 6px; }
.road-content p { color: #6B7280; line-height: 1.55; }
.road-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 14px; color: #6B7280; font-weight: 800; }
.road-action { grid-column: 1 / -1; }
.locked-label { display: inline-flex; min-height: 44px; align-items: center; border-radius: 14px; background: #E5E7EB; color: #4B5563; padding: 0 16px; font-weight: 900; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 900; min-height: 44px; }
.story-slider { max-width: 780px; margin: 0 auto; }
.story-slide { display: none; }
.story-slide.active { display: block; }
.story-media { min-height: 200px; background: #FAF5FF; border-radius: 22px; display: grid; place-items: center; overflow: hidden; }
.story-media video { width: 100%; max-height: 420px; object-fit: contain; }
.story-media img { width: 100%; }
.audio-box, .text-media { display: grid; gap: 12px; place-items: center; text-align: center; padding: 26px; color: #6B7280; }
.audio-box i, .text-media i { font-size: 46px; color: var(--primary); }
.story-text { margin-top: 20px; }
.story-count { color: var(--primary); font-weight: 900; margin-bottom: 6px; }
.story-text h2 { font-size: 28px; font-weight: 900; margin-bottom: 10px; }
.story-text p { color: #4B5563; line-height: 1.75; font-size: 18px; }
.story-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.story-nav { width: 58px; height: 58px; border: 0; border-radius: 18px; display: grid; place-items: center; background: #F3E8FF; color: var(--primary); font-size: 22px; }
.story-dots { display: flex; align-items: center; justify-content: center; gap: 8px; }
.story-dot { width: 10px; height: 10px; border-radius: 999px; background: #D8B4FE; }
.story-dot.active { width: 28px; background: var(--primary); }
.quiz-wrap { max-width: 760px; margin: 0 auto; }
.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.quiz-progress-text { font-weight: 900; color: #6B7280; }
.progress-track { height: 12px; background: #e0e0e0; border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.progress-fill { height: 100%; background: #22e40d; border-radius: 999px; }
.quiz-card h1 { font-size: clamp(24px, 7vw, 30px); line-height: 1.25; font-weight: 900; margin-bottom: 18px; }
.quiz-media { background: #FAF5FF; border-radius: 20px; overflow: hidden; padding: 12px; margin-bottom: 18px; }
.quiz-media img, .quiz-media video { width: 100%; max-height: 320px; object-fit: contain; border-radius: 16px; }
.quiz-options { display: grid; gap: 12px; }
.quiz-option { cursor: pointer; }
.quiz-option input { position: absolute; opacity: 0; pointer-events: none; }
.option-content { min-height: 60px; display: block; align-items: center; justify-content: space-between; gap: 10px; padding: 16px; border-radius: 18px; border: 2px solid #E9D5FF; background: #fff; font-size: 18px; font-weight: 900; }
.quiz-option input:checked + .option-content, .quiz-option.selected .option-content { border-color: var(--primary); background: #FAF5FF; box-shadow: 0 0 0 4px rgba(147,51,234,.10); }
.option-content small { font-size: 12px; color: #6B7280; }
.soft-modal { position: fixed; inset: 0; z-index: 50; background: rgba(31,41,55,.35); display: grid; place-items: center; padding: 18px; }
.soft-modal-card { width: min(420px, 100%); background: #fff; border-radius: 28px; padding: 28px; text-align: center; box-shadow: 0 28px 70px rgba(31,41,55,.20); }
.soft-modal-card h2 { font-size: 28px; font-weight: 900; margin: 14px 0 8px; }
.soft-modal-card p { color: #6B7280; line-height: 1.6; }
.score-card { max-width: 760px; margin: 20px auto; text-align: center; }
.score-icon { width: 78px; height: 78px; border-radius: 28px; display: grid; place-items: center; margin: 0 auto 14px; background: #F3E8FF; color: var(--primary); font-size: 34px; }
.score-card.passed .score-icon { background: #DCFCE7; color: #16A34A; }
.score-number { font-size: clamp(56px, 16vw, 96px); font-weight: 900; color: var(--primary); line-height: 1; margin: 18px 0; }
.score-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 24px 0; }
.score-grid div { background: #FAF5FF; border-radius: 18px; padding: 14px; text-align: left; }
.score-grid span { display: block; color: #6B7280; font-size: 13px; font-weight: 800; }
.score-grid strong { display: block; margin-top: 4px; font-weight: 900; }
.score-actions { display: flex; gap: 10px; justify-content: space-between; }
@media (min-width: 640px) {
    .landing-actions, .role-grid, .score-actions { grid-template-columns: repeat(2, 1fr); }
    .landing-notes { grid-template-columns: repeat(3, 1fr); }
    .road-card { grid-template-columns: auto 1fr auto; align-items: center; }
    .road-action { grid-column: auto; }
    .score-grid { grid-template-columns: repeat(2, 1fr); }
}
.story-audio-panel { display: flex; justify-content: center; justify-items: center; padding: 6px; border: 1px solid #E9D5FF; border-radius: 20px; background: #FAF5FF; width: fit-content; position: absolute; top: 98px; left: 50%;transform: translateX(-50%);}
.story-audio-toggle { width: 40px; height: 40px; border: 0; border-radius: 15px; padding: 0; display: inline-grid; place-items: center; background: var(--primary); color: #fff; font-size: 18px; cursor: pointer; box-shadow: 0 12px 24px rgba(147, 51, 234, .16); }
.story-audio-toggle i { width: 22px; text-align: center; }
.story-audio-toggle[aria-pressed="true"] { background: #6D28D9; }
.story-audio-hint { margin: 0; color: #6B7280; font-size: 13px; font-weight: 700; text-align: center; line-height: 1.5; }
.story-audio-panel audio { display: none; }
