/* =============================================
   점프 게임 (두들점프) 스타일
   ============================================= */

html { background: #000; }

.jg-body {
    overflow: hidden;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
}

.jg-game {
    width: 100%;
    height: 100dvh;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    transition: background-color 0.2s;
}

/* States */
.state-intro { background: #1a1a2e; justify-content: flex-start; overflow-y: auto; padding-top: 70px; }

/* Countdown */
.state-countdown { background: #0f0f1a; }
.state-countdown .jg-content {
    justify-content: center;
    padding: 0;
}
.jg-countdown-wrap { text-align: center; }
.jg-countdown-num {
    font-size: 120px;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    animation: jgCountPop 0.5s ease-out;
}
.jg-countdown-num.jg-countdown-pop {
    animation: jgCountPop 0.5s ease-out;
}
.jg-countdown-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 16px;
}
@keyframes jgCountPop {
    0% { transform: scale(1.6); opacity: 0.3; }
    50% { transform: scale(0.95); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.state-playing { background: #1a1a2e; justify-content: center; overflow: hidden; }
.state-result { background: #1a1a2e; justify-content: flex-start; overflow-y: auto; padding-top: 60px; }

/* Top Bar */
.jg-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    z-index: 10;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(8px);
}
.jg-back {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
}
.jg-back:hover { color: #fff; }
.jg-info-badge {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255,255,255,0.8);
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(0,0,0,0.2);
}

/* Content */
.jg-content {
    text-align: center;
    padding: 16px;
    width: 100%;
    max-width: 480px;
}

.state-playing .jg-content {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Canvas */
#jgCanvas {
    display: block;
    border-radius: 0;
    background: #0f0f23;
    touch-action: none;
}

/* Intro */
.jg-intro-emoji { font-size: 72px; margin-bottom: 12px; }
.jg-intro-title { font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.jg-intro-desc { font-size: 15px; color: rgba(255,255,255,0.6); line-height: 1.6; margin-bottom: 20px; }
.jg-intro-best {
    background: rgba(255,215,0,0.15);
    border: 1px solid rgba(255,215,0,0.3);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 15px;
    color: #ffd700;
}
.jg-intro-best strong { font-size: 22px; display: block; margin-top: 4px; }

.jg-intro-controls {
    background: rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 24px;
    text-align: left;
}
.jg-intro-controls-title { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.5); margin-bottom: 8px; }
.jg-intro-controls-item { font-size: 14px; color: rgba(255,255,255,0.7); line-height: 1.8; }

.jg-btn-start {
    display: inline-block;
    padding: 16px 48px;
    background: #6C5CE7;
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.jg-btn-start:active { transform: scale(0.95); }

/* Platform legend */
.jg-legend {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.jg-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
}
.jg-legend-color {
    width: 20px;
    height: 8px;
    border-radius: 4px;
}

/* Touch controls overlay */
.jg-touch-left, .jg-touch-right {
    position: fixed;
    bottom: 20px;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: rgba(255,255,255,0.5);
    z-index: 20;
    cursor: pointer;
}
.jg-touch-left { left: 20px; }
.jg-touch-right { right: 20px; }
.jg-touch-left:active, .jg-touch-right:active {
    background: rgba(255,255,255,0.2);
}

/* Result */
.jg-result-badge { font-size: 64px; margin-bottom: 8px; }
.jg-result-grade {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 4px;
}
.jg-result-grade-label {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 20px;
}

.jg-result-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(255,255,255,0.06);
    border-radius: 14px;
}
.jg-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    color: rgba(255,255,255,0.7);
}
.jg-stat-val { color: #fff; font-weight: 700; }
.jg-stat-best { color: #ffd700; }

.jg-result-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.jg-btn-share {
    padding: 16px 32px;
    background: #FEE500;
    color: #191919;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(254,229,0,0.3);
    transition: transform 0.1s;
}
.jg-btn-share:active { transform: scale(0.95); }
.jg-btn-retry {
    padding: 16px 32px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}
.jg-btn-retry:active { transform: scale(0.95); }

/* Ranking */
.jg-ranking-section {
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 40px;
}
.jg-ranking-title {
    font-size: 15px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    margin-bottom: 12px;
}
.jg-ranking-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}
.jg-ranking-item:last-child { border-bottom: none; }
.jg-ranking-val { color: #ffd700; font-weight: 600; }

/* Toast */
.jg-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.jg-toast-show { opacity: 1; }
