/* 폰트는 index.html에서 preload로 로드 */

body {
    margin: 0;
    overflow: hidden;
    background-color: #87CEEB;
    font-family: 'Noto Sans KR', sans-serif;
    user-select: none;
}

#game-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

.hearts {
    position: absolute;
    top: 30px;
    left: 30px;
    font-size: 40px;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.3));
}

.score {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Fredoka One', cursive;
    font-size: 60px;
    color: #2d3436;
    text-shadow: 2px 2px 0px #fff;
    transition: color 0.1s, text-shadow 0.1s;
}

.score.bonus {
    color: #f39c12;
    text-shadow: 0 0 20px #f39c12, 0 0 40px #e74c3c, 2px 2px 0px #fff;
}

.bonus-float {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: #e74c3c;
    text-shadow: 1px 1px 0px #fff;
    pointer-events: none;
    animation: floatUp 0.8s ease-out forwards;
    z-index: 100;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
}

.timer {
    position: absolute;
    top: 30px;
    right: 100px;
    font-family: 'Fredoka One', cursive;
    font-size: 36px;
    color: #2d3436;
    text-shadow: 2px 2px 0px #fff;
}

.combo {
    position: absolute;
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.1s;
}

.combo.active {
    font-size: 22px;
    color: #ffd700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5), 0 0 8px #ffd700;
}

.music-toggle {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid #2d3436;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
    pointer-events: auto;
}

.music-toggle:hover {
    transform: scale(1.1);
    background: #fff;
}

.music-toggle.off {
    background: rgba(200, 200, 200, 0.9);
}

.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    z-index: 500;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 60px;
    margin: 0 0 20px 0;
    color: #2d3436;
    text-shadow: 2px 2px 0 #badc58;
}

p {
    font-size: 20px;
    color: #444;
    margin-bottom: 40px;
    text-align: center;
    line-height: 1.6;
    font-weight: bold;
}

.btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    transition: transform 0.1s;
    white-space: nowrap;
}

.btn:hover { transform: scale(1.05); }
.btn:active { transform: scale(0.95); }

.loading {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

/* 로딩 화면 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #87CEEB 0%, #006994 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-beluga {
    font-size: 100px;
    animation: loadingBounce 1s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

@keyframes loadingBounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.loading-title {
    font-family: 'Fredoka One', cursive;
    font-size: 36px;
    margin: 20px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.loading-bar-container {
    width: 280px;
    height: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px auto;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6ab04c, #badc58);
    border-radius: 10px;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 10px rgba(106, 176, 76, 0.5);
}

.loading-text {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 16px;
    margin: 15px 0 5px;
    opacity: 0.9;
}

.loading-percent {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    opacity: 0.8;
}

#character-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    z-index: 100;
}

#character-container.show {
    opacity: 1;
    transform: translateY(0);
}

.char-img-box {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    overflow: hidden;
    background-color: #ffd1dc;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    font-size: 60px;
}

.speech-bubble {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 15px 25px;
    font-size: 16px;
    color: #333;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 300px;
    margin-bottom: 20px;
    border: 2px solid #333;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    left: -10px;
    bottom: 20px;
    border-style: solid;
    border-width: 10px 10px 10px 0;
    border-color: transparent #333 transparent transparent;
}

.speech-bubble::before {
    content: '';
    position: absolute;
    left: -7px;
    bottom: 20px;
    border-style: solid;
    border-width: 10px 10px 10px 0;
    border-color: transparent #fff transparent transparent;
    z-index: 1;
}

.ranking-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 20px 30px;
    margin: 20px 0;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.ranking-title {
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: #2d3436;
    margin-bottom: 15px;
    text-align: center;
}

.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 280px;
    overflow-y: auto;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    transition: transform 0.2s;
}

.ranking-item:hover {
    transform: scale(1.02);
}

.ranking-item.top1 { background: linear-gradient(135deg, #ffd700, #ffec8b); }
.ranking-item.top2 { background: linear-gradient(135deg, #c0c0c0, #e8e8e8); }
.ranking-item.top3 { background: linear-gradient(135deg, #cd7f32, #daa520); }

.rank-number {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    width: 40px;
    text-align: center;
    color: #2d3436;
}

.rank-name {
    flex: 1;
    font-weight: bold;
    font-size: 18px;
    color: #333;
    margin-left: 10px;
}

.rank-score {
    font-family: 'Fredoka One', cursive;
    font-size: 22px;
    color: #3b82f6;
}

.nickname-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.nickname-input {
    width: 250px;
    padding: 15px 20px;
    font-size: 20px;
    border: 3px solid #3b82f6;
    border-radius: 15px;
    outline: none;
    text-align: center;
    font-family: 'Noto Sans KR', sans-serif;
    margin-bottom: 15px;
}

.nickname-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.btn-group {
    display: flex;
    gap: 15px;
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    border: none;
    padding: 15px 50px;
    font-size: 24px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(75, 85, 99, 0.3);
    transition: transform 0.1s;
    white-space: nowrap;
}

.btn-secondary:hover { transform: scale(1.05); }
.btn-secondary:active { transform: scale(0.95); }

.no-ranking {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
}

.your-rank {
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 15px;
    color: white;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
}

/* 게임 모달 버튼 영역 */
#startModal .btn-base,
#gameOverModal .btn-base {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

#afterSaveSection,
#nicknameForm {
    max-width: 300px;
    margin: 0 auto;
}

#afterSaveSection .btn-row,
#nicknameForm .btn-row {
    margin-bottom: 12px;
}

#afterSaveSection .btn-base,
#nicknameForm .btn-base {
    margin-bottom: 8px;
}

/* btn-row 내부 버튼은 max-width 해제 */
.btn-row > .btn-base {
    max-width: none;
}

.onboarding-container {
    max-width: 500px;
    width: 90%;
}

.onboarding-step {
    display: none;
    text-align: center;
}

.onboarding-step.active {
    display: block;
}

.onboarding-icon {
    font-size: 100px;
    margin-bottom: 20px;
}

.onboarding-title {
    font-family: 'Fredoka One', cursive;
    font-size: 36px;
    color: #2d3436;
    margin-bottom: 15px;
}

.onboarding-desc {
    font-size: 20px;
    color: #444;
    line-height: 1.8;
    margin-bottom: 30px;
}

.onboarding-highlight {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
    margin: 5px;
}

.highlight-good {
    background: #d4edda;
    color: #155724;
}

.highlight-bad {
    background: #f8d7da;
    color: #721c24;
}

.dots-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    transition: background 0.3s;
}

.dot.active {
    background: #3b82f6;
}

.btn-skip {
    background: transparent;
    color: #666;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.btn-skip:hover {
    color: #333;
    text-decoration: underline;
}

.popup-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    transition: opacity 0.3s;
}

.popup-content {
    position: relative;
    background: white;
    border-radius: 30px;
    padding: 40px 50px;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popupIn 0.3s ease-out;
}

@keyframes popupIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.popup-close:hover {
    background: #e0e0e0;
    color: #333;
    transform: scale(1.1);
}

.popup-title {
    font-family: 'Fredoka One', cursive;
    font-size: 48px;
    color: #ef4444;
    margin: 0 0 5px 0;
    text-align: center;
}

.popup-subtitle {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 20px;
    color: #2d3436;
    font-weight: bold;
    margin: 0 0 20px 0;
    text-align: center;
}

.popup-score {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

.popup-score span {
    font-family: 'Fredoka One', cursive;
    font-size: 50px;
    color: #333;
    display: block;
    margin-top: 5px;
}

.btn-kakao {
    background: #FEE500;
    color: #3C1E1E;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(254, 229, 0, 0.4);
    transition: transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-kakao:hover { transform: scale(1.05); }
.btn-kakao:active { transform: scale(0.95); }

.btn-kakao img {
    width: 24px;
    height: 24px;
}

.btn-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(225, 48, 108, 0.4);
    transition: transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-instagram:hover { transform: scale(1.05); }
.btn-instagram:active { transform: scale(0.95); }

/* 이어하기 버튼 */
.btn-continue {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Noto Sans KR', sans-serif;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    animation: pulse-continue 2s infinite;
}

.btn-continue:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-continue:active {
    transform: scale(0.95);
}

@keyframes pulse-continue {
    0%, 100% { box-shadow: 0 5px 20px rgba(102, 126, 234, 0.5); }
    50% { box-shadow: 0 5px 30px rgba(102, 126, 234, 0.8); }
}

/* 가상 조이스틱 */
.joystick-area {
    display: none;
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.6);
    pointer-events: none;
    touch-action: none;
    transform: translate(-50%, -50%);
    z-index: 1000;
}

.joystick-area.active {
    display: block;
}

.joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #2d3436;
    box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .hearts {
        top: 15px;
        left: 15px;
        font-size: 28px;
    }

    .score {
        top: 15px;
        font-size: 36px;
    }

    .timer {
        top: 15px;
        right: 70px;
        font-size: 24px;
    }

    .music-toggle {
        top: 12px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    h1 {
        font-size: 36px;
    }

    p {
        font-size: 16px;
        padding: 0 20px;
    }

    .btn {
        padding: 12px 35px;
        font-size: 20px;
    }

    .ranking-container {
        padding: 15px 20px;
        margin: 15px 0;
    }

    .ranking-title {
        font-size: 22px;
    }

    .ranking-item {
        padding: 8px 12px;
    }

    .rank-number {
        font-size: 20px;
    }

    .rank-name {
        font-size: 16px;
    }

    .rank-score {
        font-size: 18px;
    }

    .nickname-input {
        width: 200px;
        padding: 12px 15px;
        font-size: 16px;
    }

    .btn-group {
        flex-direction: row;
        gap: 10px;
    }

    .btn-group .btn,
    .btn-group .btn-secondary {
        padding: 12px 20px;
        font-size: 16px;
    }

    .onboarding-icon {
        font-size: 70px;
    }

    .onboarding-title {
        font-size: 28px;
    }

    .onboarding-desc {
        font-size: 16px;
    }

    .char-img-box {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }

    .speech-bubble {
        font-size: 14px;
        padding: 10px 15px;
        max-width: 200px;
    }

    .popup-content {
        padding: 30px 25px;
    }

    .popup-title {
        font-size: 36px;
    }

    .popup-subtitle {
        font-size: 16px;
    }

    .popup-score span {
        font-size: 40px;
    }

    .btn-kakao,
    .btn-instagram {
        font-size: 14px;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .hearts {
        font-size: 22px;
    }

    .score {
        font-size: 28px;
    }

    .timer {
        font-size: 20px;
        right: 60px;
    }

    .combo {
        font-size: 14px;
    }

    .combo.active {
        font-size: 18px;
    }

    .bonus-float {
        top: 55px;
        font-size: 20px;
    }

    .music-toggle {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    h1 {
        font-size: 28px;
    }

    .ranking-list {
        max-height: 200px;
    }
}

/* 터치 디바이스에서 hover 효과 제거 */
@media (hover: none) {
    .btn:hover, .music-toggle:hover {
        transform: none;
    }
}

.btn-review-link {
    background: none;
    border: none;
    color: #636e72;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 15px;
}

/* ========================================
   공통 디자인 시스템
   ======================================== */

/* 기본 리셋 */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    font-family: 'Noto Sans KR', sans-serif;
}

/* 페이지 레이아웃 */
.page-body {
    background: linear-gradient(135deg, #87CEEB 0%, #006994 100%);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

@media (max-width: 480px), (max-height: 700px) {
    .page-body {
        padding: 15px 10px;
    }
}

/* 공통 컨테이너 */
.container {
    width: 100%;
    min-width: 450px;
    max-width: 500px;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow-y: auto;
}

.container-wide {
    max-width: 600px;
}

@media (max-width: 480px), (max-height: 700px) {
    .container {
        min-width: auto;
        padding: 25px 20px;
        max-height: calc(100vh - 40px);
        max-height: calc(100dvh - 40px);
    }
}

@media (max-height: 550px) {
    .page-body {
        align-items: flex-start;
        padding: 10px;
    }

    .container {
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
        padding: 15px;
    }
}

/* 타이틀 */
.page-title {
    text-align: center;
    font-family: 'Fredoka One', cursive;
    font-size: 28px;
    color: #2d3436;
    margin-bottom: 10px;
}

.page-title-lg {
    font-size: 36px;
}

.page-subtitle {
    text-align: center;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    color: #636e72;
    margin-bottom: 25px;
}

/* 섹션 */
.section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: #2d3436;
}

.section-title .icon {
    font-size: 28px;
}

.section-content {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #636e72;
}

/* 아이템/리스트 행 */
.item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    padding: 10px;
    background: white;
    border-radius: 10px;
}

.item-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.item-name {
    font-weight: 700;
    color: #2d3436;
    min-width: 80px;
}

.item-desc {
    color: #636e72;
    flex: 1;
}

.item-good { border-left: 4px solid #6ab04c; }
.item-bad { border-left: 4px solid #e74c3c; }
.item-special { border-left: 4px solid #3498db; }

/* 버튼 - Primary (초록) */
.btn-primary {
    display: block;
    width: 200px;
    margin: 30px auto 0;
    padding: 15px;
    background: linear-gradient(135deg, #6ab04c, #44bd32);
    color: white;
    border: none;
    border-radius: 30px;
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(106, 176, 76, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 176, 76, 0.5);
}

/* 버튼 - Secondary (회색) */
.btn-secondary {
    display: block;
    width: 100%;
    padding: 14px;
    background: #f1f2f6;
    color: #2d3436;
    border: none;
    border-radius: 15px;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-secondary:hover {
    background: #dfe4ea;
}

/* 관련 링크 */
.related-links {
    margin-top: 25px;
    padding: 15px;
    background: #f0f8ff;
    border-radius: 12px;
    text-align: center;
}

.related-title {
    display: block;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 12px;
    color: #636e72;
    margin-bottom: 10px;
}

.related-links a {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px;
    background: white;
    border-radius: 20px;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 13px;
    color: #2d3436;
    text-decoration: none;
    transition: background 0.2s;
}

.related-links a:hover {
    background: #e8f4fd;
}

/* 푸터 링크 */
.footer-links {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 12px;
}

.footer-links a {
    color: #636e72;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #2d3436;
}

.footer-links .divider {
    margin: 0 8px;
    color: #ddd;
}

/* 랭킹 리스트 */
.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    transition: transform 0.2s;
}

.ranking-item:hover {
    transform: translateX(3px);
}

.ranking-item.top1 { background: linear-gradient(135deg, #ffd700, #ffec8b); }
.ranking-item.top2 { background: linear-gradient(135deg, #c0c0c0, #e8e8e8); }
.ranking-item.top3 { background: linear-gradient(135deg, #cd7f32, #daa520); }

.rank-number {
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    width: 35px;
    text-align: center;
    color: #2d3436;
}

.rank-name {
    flex: 1;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: bold;
    font-size: 15px;
    color: #333;
    margin-left: 10px;
}

.rank-score {
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    color: #2d3436;
}

/* 배지 */
.badge {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    background: white;
    border-radius: 20px;
    font-size: 13px;
    color: #2d3436;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 벨루가 아이콘 */
.beluga-icon {
    font-size: 80px;
    margin-bottom: 20px;
    text-align: center;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 480px), (max-height: 700px) {
    .beluga-icon {
        font-size: 60px;
        margin-bottom: 15px;
    }
    .page-title {
        font-size: 24px;
    }
    .page-title-lg {
        font-size: 28px;
    }
}

/* ========== 메인 페이지 전용 ========== */
.main-container {
    text-align: center;
    padding: 40px 30px;
}

.btn-play {
    display: block;
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #6ab04c, #44bd32);
    color: white;
    border: none;
    border-radius: 30px;
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    cursor: pointer;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(106, 176, 76, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 176, 76, 0.5);
}

.btn-menu {
    display: block;
    width: 100%;
    padding: 14px;
    background: #f1f2f6;
    color: #2d3436;
    border: none;
    border-radius: 15px;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn-menu:hover {
    background: #dfe4ea;
}

.ranking-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.ranking-preview .ranking-title {
    font-family: 'Fredoka One', cursive;
    font-size: 24px;
    margin-bottom: 15px;
}

@media (max-width: 480px), (max-height: 700px) {
    .main-container {
        padding: 25px 20px;
    }
    .btn-play {
        padding: 14px;
        font-size: 20px;
    }
    .btn-menu {
        padding: 12px;
        font-size: 14px;
    }
    .ranking-preview {
        margin-top: 15px;
        padding-top: 15px;
    }
}

/* 카테고리 메뉴 (접이식) */
.menu-category {
    width: 100%;
    margin-bottom: 10px;
}

.btn-category {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    border: none;
    border-radius: 15px;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-category:hover {
    background: linear-gradient(135deg, #0984e3, #0652DD);
    transform: translateY(-1px);
}

.btn-category.active {
    border-radius: 15px 15px 0 0;
}

.category-arrow {
    font-size: 12px;
    transition: transform 0.2s;
}

.btn-category.active .category-arrow {
    transform: rotate(180deg);
}

.category-items {
    display: none;
    background: #f8f9fa;
    border-radius: 0 0 15px 15px;
    overflow: hidden;
    margin-top: -5px;
    padding-top: 5px;
}

.category-items.show {
    display: block;
}

.btn-sub {
    display: block;
    padding: 12px 20px;
    background: transparent;
    color: #2d3436;
    text-decoration: none;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s;
}

.btn-sub:last-child {
    border-bottom: none;
    border-radius: 0 0 15px 15px;
}

.btn-sub:hover {
    background: #e9ecef;
}

/* ========== 랭킹 페이지 전용 ========== */
.ranking-page-list .ranking-item {
    padding: 15px 20px;
    margin-bottom: 10px;
}

.ranking-page-list .ranking-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.ranking-page-list .rank-medal {
    font-size: 28px;
    width: 50px;
    text-align: center;
}

.ranking-page-list .player-info {
    flex: 1;
    margin-left: 15px;
}

.ranking-page-list .player-name {
    font-weight: 700;
    font-size: 16px;
    color: #2d3436;
}

.ranking-page-list .player-score {
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    color: #6ab04c;
}

.total-count {
    text-align: center;
    color: #636e72;
    font-size: 14px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* ========== 로딩/스피너 ========== */
.loading-area {
    text-align: center;
    padding: 40px;
    color: #636e72;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6ab04c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 광고 컨테이너 ========== */
.ad-container {
    width: 100%;
    max-width: 500px;
    margin: 15px auto;
    text-align: center;
    min-height: 260px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ========== 통계 페이지 전용 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.stat-value {
    font-family: 'Fredoka One', cursive;
    font-size: 32px;
    color: #2d3436;
    margin-bottom: 5px;
}

.stat-label {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 13px;
    color: #636e72;
    font-weight: 700;
}

.refresh-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #6ab04c, #44bd32);
    color: white;
    border: none;
    border-radius: 20px;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(106, 176, 76, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.refresh-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(106, 176, 76, 0.4);
}

.error-message {
    text-align: center;
    padding: 20px;
    font-family: 'Noto Sans KR', sans-serif;
    color: #e74c3c;
    font-size: 14px;
    background: #ffe6e6;
    border-radius: 10px;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stat-card {
        padding: 15px;
    }
    .stat-icon {
        font-size: 26px;
    }
    .stat-value {
        font-size: 24px;
    }
    .stat-label {
        font-size: 11px;
    }
}

/* ========== FAQ/문의 페이지 전용 ========== */
.faq-section {
    margin-bottom: 30px;
}

.faq-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fredoka One', cursive;
    font-size: 20px;
    color: #2d3436;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dfe6e9;
}

.faq-section-title .icon {
    font-size: 26px;
}

.faq-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #3498db;
}

.faq-question {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #2d3436;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.faq-question::before {
    content: 'Q.';
    color: #3498db;
    font-weight: 700;
    flex-shrink: 0;
}

.faq-answer {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: #636e72;
    padding-left: 24px;
}

.faq-answer::before {
    content: 'A. ';
    color: #636e72;
    font-weight: 700;
}

.feedback-section {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #6ab04c22, #44bd3222);
    border-radius: 15px;
    border: 2px dashed #6ab04c;
    text-align: center;
}

.feedback-section-title {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #2d3436;
    margin-bottom: 10px;
}

.feedback-section-content {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 14px;
    color: #636e72;
    margin-bottom: 15px;
}

.review-link-btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #6ab04c, #44bd32);
    color: white;
    border-radius: 20px;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 10px rgba(106, 176, 76, 0.3);
}

.review-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 176, 76, 0.4);
}

@media (max-width: 480px) {
    .faq-section {
        margin-bottom: 20px;
    }
    .faq-section-title {
        font-size: 18px;
    }
    .faq-section-title .icon {
        font-size: 22px;
    }
    .faq-item {
        padding: 12px;
        margin-bottom: 12px;
    }
    .faq-question {
        font-size: 14px;
    }
    .faq-answer {
        font-size: 13px;
        padding-left: 20px;
    }
    .feedback-section {
        padding: 15px;
        margin-top: 20px;
    }
    .feedback-section-title {
        font-size: 15px;
    }
    .feedback-section-content {
        font-size: 13px;
    }
    .review-link-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ========== 폼 스타일 (리뷰 페이지) ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2d3436;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Noto Sans KR', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: #6ab04c;
}

.form-textarea {
    width: 100%;
    height: 150px;
    padding: 15px;
    border: 2px solid #dfe6e9;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Noto Sans KR', sans-serif;
    resize: none;
}

.form-textarea:focus {
    outline: none;
    border-color: #6ab04c;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #636e72;
    margin-top: 5px;
}

.star-rating {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.star-rating span {
    font-size: 40px;
    cursor: pointer;
    transition: transform 0.1s;
    filter: grayscale(100%);
}

.star-rating span:hover {
    transform: scale(1.2);
}

.star-rating span.active {
    filter: grayscale(0%);
}

.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.success-text {
    font-size: 20px;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 10px;
}

.success-subtext {
    color: #636e72;
    margin-bottom: 30px;
}

@media (max-width: 480px) {
    .star-rating span {
        font-size: 32px;
    }
}

/* ========== 하이라이트 박스 ========== */
.highlight-box {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #3498db;
}

.warning-box {
    background: #fff3cd;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #f39c12;
    color: #856404;
}

/* ========== 404 페이지 전용 ========== */
.error-container {
    min-width: 380px;
    max-width: 400px;
    width: 100%;
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.error-code {
    font-family: 'Fredoka One', cursive;
    font-size: 120px;
    color: #3498db;
    margin: 0;
    line-height: 1;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.1);
}

.error-emoji {
    font-size: 80px;
    margin: 20px 0;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.error-title {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #2d3436;
    margin: 20px 0 10px;
}

.error-subtitle {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 16px;
    color: #636e72;
    margin: 10px 0 30px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
}

.btn-blue {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 30px;
    font-family: 'Fredoka One', cursive;
    font-size: 18px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.btn-blue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
}

.error-divider {
    margin: 20px 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #dfe6e9, transparent);
}

@media (max-width: 480px), (max-height: 700px) {
    .error-container {
        min-width: auto;
        padding: 30px 20px;
        border-radius: 15px;
    }
    .error-code {
        font-size: 90px;
    }
    .error-emoji {
        font-size: 60px;
    }
    .error-title {
        font-size: 20px;
    }
    .error-subtitle {
        font-size: 14px;
    }
    .button-group .btn-primary,
    .button-group .btn-blue {
        padding: 12px 16px;
        font-size: 16px;
    }
}

/* hidden 유틸리티 */
.hidden {
    display: none !important;
}

/* ========== 유튜브 카드 스타일 ========== */
.youtube-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: white;
    border-radius: 12px;
    margin: 10px 0;
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
}

.youtube-card:hover {
    transform: translateX(5px);
}

.youtube-thumb {
    width: 120px;
    height: 68px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.youtube-info {
    flex: 1;
    min-width: 0;
}

.youtube-title {
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.youtube-channel {
    font-size: 12px;
    color: #636e72;
}

@media (max-width: 480px) {
    .youtube-card {
        padding: 10px;
        gap: 12px;
    }
    .youtube-thumb {
        width: 100px;
        height: 56px;
    }
    .youtube-title {
        font-size: 13px;
    }
    .youtube-channel {
        font-size: 11px;
    }
}


/* ========================================
   버튼 디자인 시스템 (통일)
   ======================================== */

/* 버튼 기본 스타일 */
.btn-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: 50px;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.btn-base:last-child {
    margin-bottom: 0;
}

.btn-base:hover {
    transform: translateY(-2px);
}

.btn-base:active {
    transform: translateY(0) scale(0.98);
}

/* 버튼 크기 */
.btn-base.btn-sm {
    padding: 10px 20px;
    font-size: 14px;
}

.btn-base.btn-lg {
    padding: 18px 36px;
    font-size: 20px;
}

.btn-base.btn-full {
    width: 100%;
    max-width: 280px;
    display: flex;
    margin-left: auto;
    margin-right: auto;
}

/* 컨테이너 내부에서는 전체 너비 허용 */
.container .btn-base.btn-full,
.main-container .btn-base.btn-full {
    max-width: 100%;
}

/* Primary - 초록 (메인 액션) */
.btn-base.btn-green {
    background: linear-gradient(135deg, #6ab04c, #44bd32);
    color: white;
    box-shadow: 0 4px 15px rgba(106, 176, 76, 0.4);
}

.btn-base.btn-green:hover {
    box-shadow: 0 6px 20px rgba(106, 176, 76, 0.5);
}

/* Primary - 파랑 (게임 내 메인 액션) */
.btn-base.btn-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.btn-base.btn-blue:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

/* Secondary - 회색 */
.btn-base.btn-gray {
    background: #f1f2f6;
    color: #2d3436;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-base.btn-gray:hover {
    background: #dfe4ea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 카카오톡 */
.btn-base.btn-kakao {
    background: #FEE500;
    color: #3C1E1E;
    box-shadow: 0 4px 15px rgba(254, 229, 0, 0.4);
}

.btn-base.btn-kakao:hover {
    box-shadow: 0 6px 20px rgba(254, 229, 0, 0.5);
}

.btn-base.btn-kakao img {
    width: 20px;
    height: 20px;
}

/* 인스타그램 */
.btn-base.btn-insta {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(225, 48, 108, 0.4);
}

.btn-base.btn-insta:hover {
    box-shadow: 0 6px 20px rgba(225, 48, 108, 0.5);
}

/* 버튼 그룹 (가로 배치) */
.btn-row {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    margin-bottom: 10px;
}

.btn-row:last-child {
    margin-bottom: 0;
}

.btn-row > .btn-base {
    flex: 1;
    margin-bottom: 0;
}

/* 모바일 반응형 */
@media (max-width: 480px) {
    .btn-base {
        padding: 12px 24px;
        font-size: 15px;
    }

    .btn-base.btn-sm {
        padding: 10px 18px;
        font-size: 13px;
    }

    .btn-base.btn-lg {
        padding: 14px 28px;
        font-size: 18px;
    }

    .btn-row {
        gap: 8px;
    }
}
