:root {
    /* 파스텔 핑크 & 피치 로맨틱 컬러 톤 */
    --bg-color: #fff0f3; 
    --mainbox-bg: #ffe5ec; 
    --text-main: #5c4033;
    --title-color: #ff5c8a; /* 사랑스러운 피치핑크 레드 */
    --sub-color: #ff8fab;
    --btn-start-bg: #ff758c;
    --btn-action-bg: #ffb7b2;
    --btn-hover-bg: #ff477e;
    
    --font-family: "맑은 고딕", sans-serif;
    --border-radius-lg: 24px;
    --border-radius-sm: 12px;

    --frame-line-color: #ffb3c6;
    --frame-border-width: 3px;
}

body {
    /* 은은한 피치-핑크 그라데이션 및 꽃 그림 SVG 패턴 배경 */
    background-color: #fff0f3;
    background-image: 
    radial-gradient(#ffccd5 15%, transparent 16%),
    radial-gradient(#ffccd5 15%, transparent 16%);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    
    color: var(--text-main);
    font-family: var(--font-family);
    text-align: center;
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.iphone-frame {
    position: relative;
    width: 393px;
    height: 852px;
    background-color: #fff9fb;
    border: var(--frame-border-width) solid var(--frame-line-color);
    border-radius: 54px;
    padding: 8px;
    box-sizing: border-box;
    box-shadow: 0 20px 40px rgba(255, 182, 193, 0.35);
    zoom: 0.8;
}

.iphone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff9fb 0%, #ffeef2 100%);
    border-radius: 46px;
    overflow-y: auto;
    padding: 60px 20px 20px 20px;
    box-sizing: border-box;
}

.iphone-screen::-webkit-scrollbar {
    display: none;
}
.iphone-screen {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.dynamic-island {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 28px;
    background-color: #ffb3c6;
    border-radius: 20px;
    z-index: 1000;
}

.color-red { color: #ff5c8a; }
.font-size { font-size: 24px; }
.font-weight { font-weight: bold; }

.page {
    display: none;
}
.page.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

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

.app-header-icon {
    font-size: 38px;
    margin-top: 10px;
    margin-bottom: -5px;
    animation: bounce 1.5s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-6px); }
}

.mainbox {
    background: linear-gradient(135deg, #fff0f3 0%, #ffccd5 100%);
    border: 2px dashed #ff8fab;
    padding: 20px 15px;
    border-radius: var(--border-radius-lg);
    width: 100%;
    box-sizing: border-box;
    margin: 15px auto;
    box-shadow: 0 8px 20px rgba(255, 143, 171, 0.2);
}

.main-title {
    color: var(--title-color);
    font-size: 26px;
    margin: 5px 0 10px 0;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.welcome-badge {
    display: inline-block;
    background-color: #ff758c;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.sub-text {
    margin: 6px 0;
    font-size: 13px;
    color: #7a5c58;
}

.guide-text {
    margin: 12px 0 4px 0;
    font-size: 13.5px;
    font-weight: bold;
    color: #6d4c41;
    line-height: 1.4;
}

/* 규칙 카드 디자인 */
.rules-card {
    background: white;
    border-radius: var(--border-radius-sm);
    padding: 12px 15px;
    margin: 15px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.15);
    border: 1px solid #ffe3e9;
}

.rule-item {
    font-size: 13px;
    text-align: left;
    background: #fff5f7;
    padding: 8px 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #5c4033;
}

.score-plus { color: #ff5c8a; }
.score-minus { color: #e056fd; }
.score-total { color: #ff758c; }

.btn {
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
}

.btn:active {
    transform: scale(0.95); 
    filter: brightness(0.9); 
}

.btn-start {
    background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
    color: white;
    padding: 16px 30px;
    font-weight: bold;
    width: 100%;
    margin-top: 5px;
    font-size: 16px;
    box-shadow: 0 6px 15px rgba(255, 117, 140, 0.4);
    border-radius: var(--border-radius-sm);
}

.btn-restart {
    background-color: #ff758c;
    color: white;
    padding: 12px 24px;
    margin: 10px auto;
    width: 90%;
}

.btn:hover {
    filter: brightness(1.05);
}

.btn-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 90%;
    margin: 20px auto 0 auto;
}

.btn-action {
    color: white;
    border: none;
    padding: 14px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
    width: 90%;
    box-sizing: border-box;
}

.btn-action:hover {
    filter: brightness(1.05);
}

.btn-action:active {
    transform: scale(0.96);
}

.btn-home { 
    background-color: #b5838d;
    color: white;
    border: none;
    padding: 15px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
    width: 90%;
    box-sizing: border-box;
    margin: 10px auto;
}

.btn-home:hover { 
    filter: brightness(1.05);
}

.question-number {
    display: inline-block;
    background: linear-gradient(135deg, #ffb3c6, #ff8fab);
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 6px 16px;
    border-radius: 20px;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(255, 143, 171, 0.3);
    letter-spacing: 0.5px;
}

.question {
    background-color: white;
    border: 2px solid #ffccd5;
    border-radius: var(--border-radius-lg);
    padding: 20px 15px;
    font-size: 17px;
    font-weight: bold;
    color: #5c4033;
    margin: 15px auto;
    width: 90%;
    box-sizing: border-box;
    box-shadow: 0 6px 15px rgba(255, 182, 193, 0.1);
    line-height: 1.6;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.quiz-input {
    width: 90%;
    padding: 14px;
    font-size: 16px;
    border-radius: 14px;
    border: 2px dashed #ff8fab;
    box-sizing: border-box;
    text-align: center;
    outline: none;
    background-color: #fff5f7;
    color: #5c4033;
    transition: all 0.3s ease;
}

.quiz-input:focus {
    border-color: #ff5c8a;
    background-color: white;
    box-shadow: 0 0 10px rgba(255, 92, 138, 0.3);
}

.quiz-result {
    font-size: 20px;
    margin: 10px 0;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.quiz-hint {
    background-color: #fff8e7;
    color: #8a6d3b;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    width: 85%;
    margin: 8px auto;
    border: 1px dashed #ffeeba;
}

.quiz-hint:empty {
    display: none;
}

.result-box {
    margin-top: 40px;
}

.divider {
    color: #ffccd5;
    letter-spacing: -1px;
}

@media screen and (max-width: 768px) {
    body {
        background-color: #fff0f3;
        display: block;
    }

    .iphone-frame {
        width: 100% !important;
        height: 100vh !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        background-color: #fff0f3;
    }

    .iphone-screen {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        padding: 20px 16px !important;
        box-sizing: border-box;
    }

    .dynamic-island {
        display: none;
    }
}

/* 퀴즈 하단 액션 버튼 색상 (로맨틱 파스텔톤 조합) */
.btn-action.check { 
    background-color: #a3c1ad; 
    color: #0a0909;
}
.btn-action.check:hover { 
    background-color: #366d4e; 
    color: #0a0909;
}

.btn-action.hint { 
    background-color: #ffd166; 
    color: #0a0909; 
}

.btn-action.hint:hover { 
    background-color: #d0a112;
    color: #0a0909;
}

.btn-action.pass { 
    background-color: #cdb4db;
    color: #0a0909; 
}

.btn-action.pass:hover { 
    background-color: #7f3fac; 
    color: #0a0909;
}

.btn-action.delete { 
    background-color: #ffb7b2; 
    color: #0a0909;
}

.btn-action.delete:hover { 
    background-color: #ed605b; 
    color: #0a0909;
}

.title-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ffe3e9;
    border-radius: 16px;
    padding: 16px;
    margin: 15px 0;
    text-align: center;
}

.title-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #ff5c8a;
    background: rgba(255, 92, 138, 0.12);
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.user-title {
    font-size: 20px;
    font-weight: 700;
    margin: 4px 0 6px 0;
    color: #5c4033;
}

.user-title-desc {
    font-size: 13px;
    color: #7a5c58;
    margin: 0;
    line-height: 1.4;
}

.btn-back {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: bold;
    color: #7a5c58;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 0;
    margin-bottom: 15px;
    font-family: var(--font-family);
    transition: opacity 0.2s ease;
}

.btn-back:hover {
    opacity: 0.7;
}

/* 결과 페이지 통계 카드 스타일 */
.stat-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    padding: 14px 18px;
    width: 90%;
    margin: 10px auto;
    box-shadow: 0 4px 12px rgba(255, 182, 193, 0.2);
    border: 1px solid #ffe3e9;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: #5c4033;
    padding: 8px 0;
    border-bottom: 1px dashed #ffd1dc;
}

.stat-item:last-child {
    border-bottom: none; 
}

.stat-item strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
}

.final-score {
    font-size: 1.1rem;
    font-weight: 700;
    color: #5c4033;
    margin: 15px 0 5px 0;
}

.final-score-num {
    color: #ff5c8a;
    font-size: 1.4rem;
    font-weight: 800;
}