:root {
    --bg-color: #fffaf0; /* 부드러운 크림톤 배경 */
    --mainbox-bg: #ffe4e1; /* 사랑스러운 연핑크 포인트 */
    --text-main: #333333;
    --title-color: #ff6b6b; /* 통통 튀는 코랄 레드 */
    --sub-color: #48dbfb;
    --btn-start-bg: #ff4757;
    --btn-action-bg: #1e90ff;
    --btn-hover-bg: #ff6b81;
    
    --font-family: "맑은 고딕", sans-serif;
    --border-radius-lg: 24px;
    --border-radius-sm: 12px;

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

body {
    background-color: #f0f2f5;
    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: 54px;
    padding: 8px;
    box-sizing: border-box;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    zoom: 0.8;
}

.iphone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    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: var(--frame-line-color);
    border-radius: 20px;
    z-index: 1000;
}

.color-red { color: #ff4757; }
.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: 36px;
    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, #fff0f5 0%, #ffe4e1 100%);
    border: 2px dashed #ffb6c1;
    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, 182, 193, 0.3);
}

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

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

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

.guide-text {
    margin: 12px 0 4px 0;
    font-size: 13.5px;
    font-weight: bold;
    color: #444;
    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(0,0,0,0.04);
    border: 1px solid #f1f2f6;
}

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

.score-plus { color: #2ed573; }
.score-minus { color: #ff4757; }
.score-total { color: #1e90ff; }

/* 버튼 스타일 */
.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.80); 
    filter: brightness(0.85); 
    transition: transform 0.1s ease, filter 0.1s ease;
    background-color: #76030c;
}

.btn-start {
    background: #ff4757 ;
    color: white;
    padding: 16px 30px;
    font-weight: bold;
    width: 100%;
    margin-top: 5px;
    font-size: 16px;
    box-shadow: 0 6px 15px rgba(255, 71, 71, 0.35);
    border-radius: var(--border-radius-sm);
}

.btn-action {
    background-color: var(--btn-action-bg);
    color: white;
    padding: 12px 18px;
    margin: 5px;
}

.btn-restart {
    background-color: var(--btn-action-bg);
    color: white;
    padding: 12px 24px;
    margin-top: 20px;
}

.btn:hover {
    background-color: var(--btn-hover-bg);
    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 {
    background-color: var(--btn-action-bg);
    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: 100%;
    box-sizing: border-box;
}

.btn-action:hover {
    background-color: var(--btn-hover-bg);
    filter: brightness(1.05);
}

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

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

.question {
    background-color: white;
    border: 2px solid #dfe6e9;
    border-radius: var(--border-radius-lg);
    padding: 20px 15px;
    font-size: 17px;
    font-weight: bold;
    color: #2d3436;
    margin: 15px auto;
    width: 90%;
    box-sizing: border-box;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.03);
    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 #74b9ff;
    box-sizing: border-box;
    text-align: center;
    outline: none;
    background-color: #f7f9fc;
    transition: all 0.3s ease;
}

.quiz-input:focus {
    border-color: #0984e3;
    background-color: white;
    box-shadow: 0 0 10px rgba(116, 185, 255, 0.4);
}

.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: #fff3cd;
    color: #856404;
    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: #ced6e0;
    letter-spacing: -1px;
}

@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;
    background-color: var(--bg-color);
}

.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: #68d0bb;
}
.btn-action.check:hover { background-color: #069069; }

.btn-action.hint {
    background-color: #f1d64a;
}
.btn-action.hint:hover { background-color: #ee7f07; }

.btn-action.pass {
    background-color: #b7aef8;
}
.btn-action.pass:hover { background-color: #6d63fa; }

.btn-action.delete {
    background-color: #a0e0fc;
    color: #2d3436;
}
.btn-action.delete:hover { background-color: #2686af; }

.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.result-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 15px;
}

.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 14px 18px;
    width: 88%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    margin-bottom: 15px;
}

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

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

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

.final-score {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333;
    margin-top: 5px;
}

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

.title-card {
    background: rgba(0, 0, 0, 0.04); /* 살짝 어두운 배경 */
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 16px;
    margin: 15px 0;
    text-align: center;
}

.title-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #ff3b30;
    background: rgba(255, 59, 48, 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: #1c1c1e;
}

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