:root {
    --primary-color: #ff758c;
    --secondary-color: #ff7eb3;
    --bg-color: #fff5f7;
    --text-color: #333;
    --gray-color: #888;
    --border-radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    color: var(--text-color);
}

.container {
    width: 100%;
    max-width: 480px;
    background: white;
    min-height: 100vh;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    position: relative;
    padding: 20px;
}

.page {
    display: none;
    flex-direction: column;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: flex;
}

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

header {
    text-align: center;
    margin: 40px 0;
}

header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

header p {
    color: var(--gray-color);
    font-size: 1rem;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
}

.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.option-btn {
    padding: 15px;
    border: 2px solid #eee;
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.option-btn.selected {
    border-color: var(--primary-color);
    background-color: #fff0f3;
    color: var(--primary-color);
    font-weight: bold;
}

.select-box {
    width: 100%;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: var(--border-radius);
    font-size: 1rem;
    outline: none;
}

.main-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: opacity 0.2s;
}

.main-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Quiz Styles */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

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

.question-item {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.question-item p {
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 1.05rem;
}

.answer-options {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

.answer-btn {
    flex: 1;
    padding: 10px 5px;
    font-size: 0.8rem;
    border: 1px solid #eee;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

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

/* Loading Styles */
.loading-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.heart-loader {
    width: 72px;
    height: 72px;
    position: relative;
    display: grid;
    place-items: center;
    margin-bottom: 30px;
    color: var(--primary-color);
    animation: heartBeat 1.2s infinite;
}

.heart-loader::before {
    content: '';
    position: absolute;
    inset: 7px;
    border: 3px solid #ffd6df;
    border-radius: 50%;
    box-shadow: 0 0 0 6px #fff5f7;
}

.heart-loader::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    right: 8px;
    top: 12px;
    background: #ffd166;
    box-shadow:
        -48px 9px 0 #ff9fb1,
        -10px 44px 0 #ff9fb1,
        -38px 47px 0 #ffd166;
}

.heart-loader span {
    position: relative;
    z-index: 1;
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 4.2rem;
    line-height: 1;
    color: var(--primary-color);
    text-shadow: 0 4px 0 rgba(255, 117, 140, .16);
    transform: translateY(-2px);
}

@keyframes heartBeat {
    0%, 45%, 100% { transform: scale(0.92); }
    8% { transform: scale(1.04); }
    16% { transform: scale(0.96); }
    24% { transform: scale(1.1); }
}

/* Ad Slot */
.ad-slot {
    width: 100%;
    height: 100px;
    background: #f9f9f9;
    border: 1px dashed #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    font-size: 0.9rem;
    margin: 20px 0;
}

/* Result Styles */
.result-card {
    text-align: center;
    padding: 20px;
}

.level-badge {
    display: inline-block;
    padding: 5px 15px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-weight: bold;
    margin: 10px 0;
}

/* Result Styles - Cyworld Minimi Aesthetic */
.result-card {
    text-align: center;
    padding: 10px;
}

.polaroid-frame {
    background: white;
    padding: 15px 15px 40px 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 4px;
    margin: 20px 0;
    transform: rotate(-1deg);
    transition: transform 0.3s;
}

.result-scene {
    width: 100%;
    aspect-ratio: 1.18 / 1;
    background: linear-gradient(#ffe6ed 0 56%, #ead6b8 56% 100%);
    border: 1px solid #b99a8b;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    image-rendering: pixelated;
    box-shadow: inset 0 0 0 4px rgba(255,250,242,.58);
}

.result-scene::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.13) 1px, transparent 1px);
    background-size: 6px 6px;
    pointer-events: none;
    z-index: 1;
}

.result-scene-level-0,
.result-scene-level-1,
.result-scene-level-2 {
    background: linear-gradient(#e6edf3 0 56%, #d4c9b2 56% 100%);
}

.result-scene-level-3,
.result-scene-level-4 {
    background: linear-gradient(#f9e1ec 0 56%, #e4d0b5 56% 100%);
}

.result-scene-level-5,
.result-scene-level-6,
.result-scene-level-7 {
    background: linear-gradient(#ffe1e8 0 56%, #ead0aa 56% 100%);
}

.room-shelf {
    position: absolute;
    left: 22px;
    top: 74px;
    width: 86px;
    height: 30px;
    z-index: 0;
    background: #fff5df;
    border: 1px solid #b99a8b;
    box-shadow: inset 0 -7px #e8caa6;
}

.room-photo {
    position: absolute;
    right: 26px;
    top: 74px;
    width: 54px;
    height: 64px;
    z-index: 0;
    background: #fffaf4;
    border: 1px solid #b99a8b;
    transform: rotate(2deg);
}

.room-photo::after {
    content: '';
    position: absolute;
    left: 7px;
    right: 7px;
    top: 7px;
    height: 34px;
    background: #b6d7ef;
}

.room-rug {
    position: absolute;
    left: 50%;
    bottom: 32px;
    width: min(220px, 72%);
    height: 36px;
    z-index: 0;
    transform: translateX(-50%);
    background: repeating-linear-gradient(90deg, #ffd166 0 12px, #ff9fb1 12px 24px, #8dd7c2 24px 36px);
    border: 1px solid #ac8575;
}

.pixel-heart {
    position: absolute;
    left: 50%;
    top: 70px;
    width: 36px;
    height: 36px;
    z-index: 2;
    transform: translateX(-50%);
    background:
        linear-gradient(#ff6f91 0 0) 7px 7px / 7px 7px no-repeat,
        linear-gradient(#ff6f91 0 0) 18px 7px / 7px 7px no-repeat,
        linear-gradient(#ff6f91 0 0) 5px 14px / 22px 7px no-repeat,
        linear-gradient(#ff6f91 0 0) 9px 21px / 14px 6px no-repeat,
        linear-gradient(#ff6f91 0 0) 14px 27px / 4px 4px no-repeat;
}

.minimi-stage {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 28px;
}

.minimi-wrap {
    position: absolute;
    bottom: 18px;
    width: clamp(96px, 25vw, 118px);
    height: 176px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.5s ease-in-out;
}

.minimi-me {
    z-index: 2;
}

.minimi-target {
    z-index: 3;
}

.minimi-svg {
    width: 100%;
    height: 156px;
    display: flex;
    align-items: flex-end;
    image-rendering: pixelated;
    filter: drop-shadow(3px 5px 0 rgba(71,49,42,.13));
}

.minimi-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.minimi-name {
    margin-top: 4px;
    background: #fffaf2;
    padding: 2px 7px;
    border: 1px solid #b59383;
    font-size: 0.68rem;
    color: #6b564f;
    border-radius: 3px;
    box-shadow: 1px 1px 0 rgba(74,48,39,.12);
    white-space: nowrap;
}

.scene-note {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 10px;
    z-index: 4;
    background: rgba(255,250,242,.94);
    border: 1px solid rgba(137,106,91,.28);
    border-radius: 4px;
    padding: 7px 9px;
    color: #5f4740;
    font-size: 0.76rem;
    line-height: 1.35;
    word-break: keep-all;
    box-shadow: 2px 2px 0 rgba(74,48,39,.08);
}

.result-footer {
    margin-top: 15px;
}

.result-footer h2 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.level-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

#result-desc {
    margin: 12px 0;
    line-height: 1.5;
    color: #444;
    font-size: 0.9rem;
}

.vibe-tip {
    background: #fff8f9;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.85rem;
    border-left: 4px solid var(--primary-color);
    text-align: left;
}

.vibe-tip strong {
    display: block;
    margin-bottom: 3px;
    color: var(--primary-color);
}

.score-box {
    margin: 15px 0;
    font-size: 1.1rem;
}


.score-box strong {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.action-btns {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.main-btn.secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
