/* =========================
    COLOR VARIABLES
========================= */
:root {
    --primary-color: #3b5bdb;
    --accent-color: #f03e3e;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333;
    --gray-text: #666;
    --correct-color: #40c057;
    --wrong-color: #fa5252;
}

/* =========================
    RESET & BASE
========================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Gowun Dodum', 'Noto Sans KR', system-ui, sans-serif;
}


/* =========================
    LAYOUT
========================= */
body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 30px;
    overflow: hidden;
    position: relative;
}

.screen {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
    HEADINGS & TEXT
========================= */
h1::before {
    content: "🌸 ";
}

h1::after {
    content: " 🌸";
}

h1,
h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 20px;
}

h1 {
    white-space: nowrap;
    font-size: clamp(1.4rem, 6vw, 2.5rem);
    width: 100%;
}

.score-box::before {
    content: "🎀 ";
}

.score-box::after {
    content: " 🎀";
}

.score-box {
    text-align: center;
    font-size: 1.4rem;
    font-weight: bold;
    margin: 20px 0;
}

/* =========================
    HEADER
========================= */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: var(--gray-text);
    font-size: 0.9rem;
}

#category-badge::before {
    content: "🇰🇷 ";
}


#category-badge {
    background-color: #eee;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    color: var(--text-color);
}

/* =========================
    PROGRESS BAR
========================= */
.progress-bar {
    width: 100%;
    height: 6px;
    background-color: #eee;
    border-radius: 3px;
    margin-bottom: 25px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* =========================
    SCENARIO
========================= */
.scenario-box {
    margin-bottom: 25px;
    text-align: left;
}

#scenario-text::before {
    content: "💬 ";
}

.situation-text {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 15px;
}

.q-image {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.question-text {
    font-size: 1.2rem;
    color: var(--text-color);
    text-align: left;
    line-height: 1.4;
}

/* =========================
    BUTTONS
========================= */
.btn {
    display: block;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
}

a.btn {
    display: flex;
    justify-content: center;
    align-items: center;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
}

.primary-btn:hover {
    background-color: #2b42a3;
}

/* =========================
    OPTIONS
========================= */
.option-btn {
    background: #fff7ef;
    border: 2px solid #e8d6c3;
    color: #3f3a34;
    margin-bottom: 14px;
    text-align: left;
    border-radius: 22px;
    font-size: 1.2rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Hover = pop */
.option-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}


.option-btn.correct {
    background-color: var(--correct-color);
    color: white;
    border-color: var(--correct-color);
}

.option-btn.wrong {
    background-color: var(--wrong-color);
    color: white;
    border-color: var(--wrong-color);
}

/* =========================
    FEEDBACK
========================= */
.feedback {
    margin-top: 20px;
    padding: 20px;
    background-color: #f1f3f5;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
    line-height: 1.6;
}

.feedback.hidden {
    display: none;
}

#feedback-title {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.next-btn {
    background-color: var(--primary-color);
    color: white;
    margin-top: 15px;
}

/* =========================
    LEVEL GUIDE
========================= */

/* Level card */
.level-card {
    background: #f4ede3;
    border-radius: 16px;
    text-align: center;
    padding: 20px;
    margin-bottom: 10px;
}

.level-guide-box {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: left;
    font-size: 0.9rem;
}

.level-guide-box h4 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1rem;
}

.level-guide-box ul {
    list-style: none;
}

.level-guide-box li {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed #dee2e6;
}

.level-guide-box li:last-child {
    border-bottom: none;
}

.guide-level {
    font-weight: 600;
}

.guide-score {
    color: var(--primary-color);
    font-weight: bold;
}

#level-image {
    max-width: 100%;
    width: 350px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
    border-radius: 12px;
}

/* =========================
    HANOK–MODERN THEME
    (OVERRIDES)
========================= */

/* Background */
body {
    background: linear-gradient(180deg, #f6f1e7 0%, #ede6d8 100%);
    color: #3f3a34;
}

/* Card */
.app-container {
    background: #fffaf2;
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(90, 70, 40, 0.12);
}

/* Titles */
h1,
h2,
h3 {
    color: #3b332a;
    font-weight: 600;
    letter-spacing: -0.01em;

}

/* Category badge */
#category-badge {
    background: #efe5d6;
    color: #6a4e2f;
    border-radius: 999px;
}

/* Option buttons */
.option-btn {
    background: #fbf7f1;
    border: 2px solid #e3d8c8;
    color: #3f3a34;
    border-radius: 16px;
}

.option-btn:hover:not(:disabled) {
    background: #f1e7d8;
    border-color: #c9b08a;
}

/* Correct / Wrong */
.option-btn.correct {
    background-color: #7fb77e;
    border-color: #7fb77e;
}

.option-btn.wrong {
    background-color: #e07a5f;
    border-color: #e07a5f;
}

/* Primary buttons */
.primary-btn {
    background: linear-gradient(180deg, #ddb892, #d4a373);
    color: #fffaf2;
    border-radius: 30px;
    font-size: 1.4rem;
    letter-spacing: 0.03em;
    padding: 16px 42px;

    box-shadow:
        0 12px 30px rgba(212, 163, 115, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);

    transition: all 0.3s ease;
}

/* Hover = subtle glow */
.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 18px 40px rgba(212, 163, 115, 0.55);
}


/* Emoji inside buttons */
.primary-btn::after {
    content: " ✨";
}

/* Decorative hanbok image */
/* Characters on ALL pages */
body::before {
    content: "";
    position: fixed;
    bottom: 20px;
    right: 30px;
    width: 300px;
    height: 300px;
    background-image: url("./images/hanbok-characters.png");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0.18;
    pointer-events: none;
}

/* ❌ Remove characters ONLY on start page */
.start-page::before {
    display: none;
}


/* =========================
    START PAGE - CHARACTERS
    (ONLY start page)
========================= */

.start-characters {
    width: 260px;
    height: 260px;
    margin: 20px auto 30px auto;

    background-image: url("./images/hanbok-characters.png");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;

    opacity: 0.9;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-18px);
    }

    100% {
        transform: translateY(0);
    }
}

.start-characters {
    animation: float 2.6s ease-in-out infinite;
}

/* =========================
    START PAGE – HANOK DOORS
    (ONLY start page)
========================= */

.start-page .start-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* ===== Start Page Doors ===== */
/* Doors */
.start-page .door {
    position: fixed;
    top: 50%;
    width: 400px;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
}

/* Left door */
.start-page .door-left {
    left: calc(50% - 490px);
}

/* Right door */
.start-page .door-right {
    right: calc(50% - 490px);
    transform: translateY(-50%) scaleX(-1);
}

/* Floating animation (VISIBLE) */
@keyframes doorFloat {
    0% {
        transform: translateY(-50%) translateY(0);
    }

    50% {
        transform: translateY(-50%) translateY(-18px);
    }

    100% {
        transform: translateY(-50%) translateY(0);
    }
}

/* ===== Door Open Animation ===== */
.start-page .door.open-left {
    animation: openLeft 1s ease forwards;
}

.start-page .door.open-right {
    animation: openRight 1s ease forwards;
}

@keyframes openLeft {
    to {
        transform: translate(-180%, -50%);
        opacity: 0;
    }
}

@keyframes openRight {
    to {
        transform: translate(180%, -50%) scaleX(-1);
        opacity: 0;
    }
}

/* =========================
    SCREEN TRANSITION
========================= */

.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

img[src=""],
img:not([src]) {
    display: none;
    visibility: hidden;
}

/* =========================
    INTRO PAGE STYLES
========================= */

.intro-content {
    text-align: left;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 25px;
}

.intro-content p {
    margin-bottom: 15px;
}

.note-box {
    background-color: #fff7ef;
    border-left: 4px solid var(--primary-color);
    padding: 12px 15px;
    margin: 20px 0;
    font-size: 0.95rem;
    color: #555;
    border-radius: 4px;
}

/* =========================
   DESCRIPTION PAGE STYLES
========================= */

.definition-box {
    background-color: #f1f3f5;
    padding: 15px;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #495057;
    border: 1px dashed #ced4da;
}

.def-title {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 4px;
}

.character-result {
    text-align: center;
    margin: 30px 0;
}

.character-result img {
    width: 180px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0);
    }
}