:root {
    --bg-color: #fffef7; /* 조금 더 부드러운 아이보리 톤 */
    --mainbox-bg: #fff35c; /* 채도를 살짝 낮춘 편안한 옐로우 */
    --text-main: #2b2b2b;
    --title-color: #ff2a8d; /* 세련된 마젠타 핑크 */
    --btn-start-bg: #00d2df; 
    --btn-hover-bg: #ff2a8d;
    
    --font-family: "Apple SD Gothic Neo", "맑은 고딕", sans-serif;
    --border-radius-lg: 20px;
    --border-radius-sm: 12px;

    --frame-line-color: #2b2b2b; 
    --frame-border-width: 2px;
}

body {
    background-color: #fff5f8;
    background-image: 
    radial-gradient(#ff85b3 1px, transparent 1px), 
    radial-gradient(#73dcff 1px, #fff5f8 1px);
    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: var(--bg-color);
    border: var(--frame-border-width) solid var(--frame-line-color);
    border-radius: 44px;
    padding: 8px;
    box-sizing: border-box;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    zoom: 0.8;
}

.iphone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    border-radius: 36px;
    overflow-y: auto;
    padding: 50px 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: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 24px;
    background-color: #2b2b2b;
    border-radius: 15px;
    z-index: 1000;
}

.color-red { color: #ff2a8d; }
.font-size { font-size: 24px; }
.font-weight { font-weight: 800; }

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

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

.app-header-icon {
    font-size: 34px;
    margin-top: 5px;
    margin-bottom: -5px;
}

.mainbox {
    background: linear-gradient(135deg, #fff9c4 0%, #fff176 100%);
    border: 2px solid #2b2b2b;
    padding: 20px 15px;
    border-radius: var(--border-radius-lg);
    width: 100%;
    box-sizing: border-box;
    margin: 15px auto;
    box-shadow: 0 6px 15px rgba(255, 235, 59, 0.25);
}

.main-title {
    color: var(--title-color);
    font-size: 26px;
    margin: 5px 0 10px 0;
    font-weight: 800;
}

.welcome-badge {
    display: inline-block;
    background-color: #ff2a8d;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
    margin-bottom: 8px;
    border: 1.5px solid #2b2b2b;
}

.sub-text {
    margin: 6px 0;
    font-size: 13px;
    color: #555555;
    font-weight: 600;
}

.guide-text {
    margin: 12px 0 4px 0;
    font-size: 13.5px;
    font-weight: 700;
    color: #2b2b2b;
    line-height: 1.4;
}

.rules-card {
    background: #ffffff;
    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 12px rgba(0, 0, 0, 0.04);
    border: 2px solid #2b2b2b;
}

.rule-item {
    font-size: 12.5px;
    text-align: left;
    background: #f7fcff;
    padding: 8px 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1.5px solid #e0e0e0;
    font-weight: 600;
}

.score-plus { color: #00a86b; } 
.score-minus { color: #ff2a8d; } 
.score-total { color: #7209b7; } 

.btn {
    border: 2px solid #2b2b2b;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 800;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

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

.btn-start {
    background: #00d2df;
    color: #2b2b2b;
    padding: 15px 30px;
    width: 100%;
    margin-top: 5px;
    font-size: 16px;
    border-radius: var(--border-radius-sm);
}

.btn-start:hover {
    background: #ff2a8d;
    color: white;
}

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

/* 톡톡 튀면서도 눈이 편안한 파스텔-비비드 액션 버튼들 */
.btn-action.check {
    background-color: #00d2df;
    color: #2b2b2b;
}
.btn-action.check:hover { background-color: #00b4c0; }

.btn-action.hint {
    background-color: #fff176;
    color: #2b2b2b;
}
.btn-action.hint:hover { background-color: #ffd54f; }

.btn-action.pass {
    background-color: #ff2a8d;
    color: white;
}
.btn-action.pass:hover { background-color: #e01e7a; }

.btn-action.delete {
    background-color: #b388ff;
    color: white;
}
.btn-action.delete:hover { background-color: #9575cd; }

.btn-action {
    border: 2px solid #2b2b2b;
    padding: 13px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}

.btn-restart {
    background-color: #00d2df;
    color: #2b2b2b;
    padding: 14px 24px;
    margin: 10px auto;
    width: 90%;
}
.btn-restart:hover { background-color: #ff2a8d; color: white; }

.btn-home { 
    background-color: #ff2a8d; 
    color: white;
    border: 2px solid #2b2b2b;
    padding: 14px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s ease;
    width: 90%;
    box-sizing: border-box;
    margin: 5px auto 15px auto;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
}
.btn-home:hover { background-color: #b388ff; }

.question-number {
    display: inline-block;
    background: #b388ff;
    color: white;
    font-size: 13px;
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 20px;
    margin-top: 15px;
    border: 1.5px solid #2b2b2b;
    letter-spacing: 0.5px;
}

.question {
    background-color: #ffffff;
    border: 2px solid #2b2b2b;
    border-radius: var(--border-radius-lg);
    padding: 20px 15px;
    font-size: 17px;
    font-weight: 800;
    color: #2b2b2b;
    margin: 15px auto;
    width: 90%;
    box-sizing: border-box;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.04);
    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: 12px;
    border: 2px solid #2b2b2b;
    box-sizing: border-box;
    text-align: center;
    outline: none;
    background-color: #ffffff;
    color: #2b2b2b;
    font-weight: 700;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.quiz-input:focus {
    border-color: #ff2a8d;
    background-color: #fffafc;
}

.quiz-result {
    font-size: 18px;
    margin: 10px 0;
    font-weight: 800;
}

.quiz-hint {
    background-color: #fff9c4;
    color: #2b2b2b;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    width: 85%;
    margin: 8px auto;
    border: 1.5px solid #fbc02d;
    font-weight: 700;
}

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

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

.divider {
    color: #b0bec5;
    letter-spacing: -1px;
    font-weight: 700;
}

.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px 18px;
    width: 88%;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.04);
    border: 2px solid #2b2b2b;
    margin: 0 auto 15px auto;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: #555555;
    padding: 8px 0;
    border-bottom: 1.5px dashed #eee;
    font-weight: 600;
}

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

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

.final-score {
    font-size: 1.15rem;
    font-weight: 800;
    color: #2b2b2b;
    margin-top: 5px;
}

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

.title-card {
    background: #fff9c4;
    border: 2px solid #2b2b2b;
    border-radius: 16px;
    padding: 16px;
    margin: 15px auto;
    width: 88%;
    box-sizing: border-box;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.04);
}

.title-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    color: white;
    background: #ff2a8d;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    border: 1.5px solid #2b2b2b;
    letter-spacing: 0.5px;
}

.user-title {
    font-size: 19px;
    font-weight: 800;
    margin: 4px 0 6px 0;
    color: #2b2b2b;
}

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

.btn-back {
    background: #fff9c4;
    border: 2px solid #2b2b2b;
    font-size: 12px;
    font-weight: 800;
    color: #2b2b2b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 15px;
    margin-bottom: 15px;
    font-family: var(--font-family);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.1s ease;
}

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

@media screen and (max-width: 768px) {
    body {
        background-color: var(--bg-color);
        display: block;
    }
    .iphone-frame {
        width: 100% !important;
        height: 100vh !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    .iphone-screen {
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        padding: 20px 16px !important;
    }
    .dynamic-island {
        display: none;
    }
}