/* CSS Reset & Variables */
:root {
    --bg-dark: #090a16;
    --bg-card: rgba(15, 20, 46, 0.75);
    
    /* HSL Colors */
    --gold: hsl(45, 100%, 50%);
    --gold-glow: hsla(45, 100%, 50%, 0.45);
    --gold-light: hsl(45, 100%, 75%);
    --indigo: hsl(230, 80%, 15%);
    --text-primary: #f8fafc;
    --text-muted: #cbd5e1;
    
    --success: #10b981;
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.45);
    
    --border-glass: rgba(255, 215, 0, 0.2);
    --border-glass-hover: rgba(255, 215, 0, 0.55);
    
    --font-main: 'Noto Sans KR', sans-serif;
    --font-heading: 'Outfit', 'Noto Sans KR', sans-serif;
    --font-fancy: 'Cinzel', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    background-image: linear-gradient(rgba(9, 10, 22, 0.83), rgba(9, 10, 22, 0.88)), url('background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        background-attachment: scroll;
    }
}

/* Background glow graphics */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
}
.bg-glow-1 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    top: 10%;
    left: 10%;
}
.bg-glow-2 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(217, 119, 6, 0.15) 0%, transparent 70%);
    bottom: 10%;
    right: 10%;
}

/* Game Container & Basic Layout */
#game-container {
    width: 100%;
    max-width: 950px;
    min-height: 100vh;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

@media (max-width: 768px) {
    #game-container {
        padding: 10px;
        min-height: 100dvh;
    }
}

/* Screen Transitions */
.screen {
    display: none;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transform: translateY(0);
}

/* Glassmorphism Card Style */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid var(--border-glass);
    border-radius: 16px;
    padding: 30px 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    width: 100%;
}
@media (min-width: 768px) {
    .glass-card {
        padding: 40px;
    }
}
.glass-card:hover {
    border-color: var(--border-glass-hover);
    box-shadow: 0 20px 40px rgba(255, 215, 0, 0.1), 0 15px 35px rgba(0, 0, 0, 0.6);
}

.text-center {
    text-align: center;
}

/* Typography styles */
.title-cinzel {
    font-family: var(--font-fancy);
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 5px;
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, #b45309 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    text-shadow: 0 0 25px var(--gold-glow);
}

@media (max-width: 480px) {
    .title-cinzel {
        font-size: 2rem;
        letter-spacing: 2px;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 22px;
    }
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Buttons (Touch optimized targets) */
button {
    font-family: var(--font-heading);
    font-weight: 700;
    border: none;
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    min-height: 52px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, #d97706 100%);
    color: #000;
    padding: 16px 32px;
    font-size: 1.2rem;
    box-shadow: 0 6px 20px var(--gold-glow);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.6);
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
}
.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.15);
    padding: 16px 32px;
    font-size: 1.2rem;
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* 1. Auth Screen */
.auth-card {
    /* 가로폭 및 그리드는 하단 커스텀 섹션에서 처리 */
}
.icon-lock {
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border: 2px solid rgba(255, 215, 0, 0.65);
    border-radius: 14px;
    position: relative;
    animation: pulse 2.4s infinite;
    background: rgba(255, 215, 0, 0.06);
}
.icon-lock::before {
    content: '';
    position: absolute;
    width: 26px;
    height: 20px;
    border: 2px solid rgba(255, 215, 0, 0.65);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    left: 50%;
    top: -16px;
    transform: translateX(-50%);
}
.icon-lock::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 18px;
    border-radius: 6px;
    background: var(--gold);
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
}
.password-input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}
.password-input-group input {
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 16px;
    color: #fff;
    font-size: 1.4rem;
    text-align: center;
    letter-spacing: 4px;
    transition: all 0.3s ease;
}
.password-input-group input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}
.auth-hint {
    font-size: 0.95rem;
    color: var(--text-muted);
}
.error-msg {
    margin-top: 15px;
    color: var(--danger);
    font-size: 1.05rem;
    font-weight: 700;
}
.error-msg.hide {
    display: none;
}

/* 2. Lobby Screen */
.lobby-card {
    max-width: 680px;
}
.logo-container {
    margin-bottom: 20px;
}
.game-logo {
    max-width: 170px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.45));
    animation: float 4s ease-in-out infinite;
}
.main-title {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(to right, #fff, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}
.sub-main-title {
    font-size: 1.4rem;
    font-family: var(--font-fancy);
    color: var(--gold-light);
    letter-spacing: 4px;
    margin-bottom: 25px;
    text-transform: uppercase;
}
.story-box {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 24px;
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 30px;
    text-align: left;
    border-left: 4px solid var(--gold);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.4);
}
.story-box p {
    margin-bottom: 12px;
}
.story-box p:last-child {
    margin-bottom: 0;
}
.lobby-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 380px;
    margin: 0 auto;
    width: 100%;
}
.lobby-controls > button {
    width: 100%;
}
.sound-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    user-select: none;
}
.sound-label {
    cursor: pointer;
}
#sound-toggle {
    display: none;
}
.sound-toggle-container::after {
    content: '';
    display: inline-block;
    width: 50px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    position: relative;
    transition: background 0.3s ease;
}
.sound-toggle-container::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    position: absolute;
    z-index: 2;
    transform: translate(3px, 3px);
    transition: transform 0.3s ease;
}
#sound-toggle:checked + .sound-toggle-container::after {
    background: var(--gold);
}
#sound-toggle:checked + .sound-toggle-container::before {
    transform: translate(25px, 3px);
}

/* 3. Penalty Lockdown Overlay */
.penalty-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 5, 15, 0.96);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(15px);
    padding: 15px;
}
.penalty-overlay.hide {
    display: none !important;
}
.penalty-content {
    background: rgba(22, 10, 10, 0.85);
    border: 3px solid var(--danger);
    border-radius: 28px;
    padding: 40px 20px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 0 50px var(--danger-glow);
    animation: shake 0.5s ease-in-out;
}
@media (min-width: 600px) {
    .penalty-content {
        padding: 40px;
    }
}
.penalty-alert-icon {
    font-size: 4.5rem;
    color: var(--danger);
    margin-bottom: 12px;
    animation: pulse 1.2s infinite;
}
.penalty-content h2 {
    font-size: 2.2rem;
    color: var(--danger);
    margin-bottom: 15px;
}
.penalty-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}
.timer-circle-container {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 30px;
}
.timer-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}
.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 7;
}
.timer-progress {
    fill: none;
    stroke: var(--danger);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}
.countdown-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-heading);
}
.penalty-hint-box {
    background: rgba(255, 215, 0, 0.07);
    border: 1.5px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 16px;
    margin: 10px auto 25px;
    max-width: 440px;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.penalty-hint-box .hint-title {
    display: block;
    color: var(--gold-light);
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 6px;
}
.penalty-hint-box p {
    color: #e2e8f0;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    font-weight: 500;
}
.penalty-warning {
    font-size: 0.95rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 20px;
}


/* 4. Game Screen Layout */
.game-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 15px;
}
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-radius: 14px;
    gap: 12px;
}
@media (min-width: 768px) {
    .game-header {
        padding: 20px 30px;
    }
}
.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.stage-indicator {
    background: linear-gradient(135deg, var(--gold) 0%, #b45309 100%);
    color: #000;
    font-size: 0.9rem;
    font-weight: 900;
    padding: 5px 12px;
    border-radius: 10px;
    font-family: var(--font-heading);
}
.stage-name {
    font-size: 1.15rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.header-timer {
    font-size: 1.1rem;
    color: var(--gold-light);
    font-family: var(--font-heading);
    font-weight: 700;
    white-space: nowrap;
}
.test-skip-panel {
    display: flex;
    justify-content: flex-end;
    margin-top: -6px;
}
.test-skip-panel button {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: #fecaca;
    font-size: 0.78rem;
    font-weight: 800;
}
.test-skip-panel button:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fff;
}

@media (max-width: 640px) {
    .game-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px;
    }

    .header-info {
        width: 100%;
    }

    .stage-name {
        font-size: 0.98rem;
        white-space: normal;
    }

    .header-timer {
        font-size: 0.95rem;
    }

    .test-skip-panel {
        justify-content: stretch;
    }

    .test-skip-panel button {
        width: 100%;
    }
}

.game-main-content {
    background: var(--bg-card);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 2px solid var(--border-glass);
    border-radius: 16px;
    min-height: 560px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

@media (max-width: 480px) {
    .game-main-content {
        padding: 14px;
        min-height: auto;
    }

    .stage-intro h3 {
        font-size: 1.15rem;
    }

    .stage-intro p {
        font-size: 0.95rem;
    }

    .stage-actions {
        flex-direction: column;
    }

    .stage-actions button {
        width: 100%;
    }
}
@media (min-width: 768px) {
    .game-main-content {
        padding: 35px;
    }
}

.stage-content {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.stage-content.active {
    display: flex;
}

.stage-intro {
    border-bottom: 2px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.stage-intro h3 {
    font-size: 1.4rem;
    color: var(--gold-light);
    margin-bottom: 8px;
    font-weight: 800;
}
.stage-intro p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.stage-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
    margin-top: 20px;
}

/* STAGE 1: Creation Order */
.creation-game-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin: 15px 0;
}
.creation-pool {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 768px) {
    .creation-pool {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
.creation-item {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 10px;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    min-height: 90px;
    justify-content: center;
}
.creation-item .icon {
    display: inline-flex;
    min-width: 54px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--gold-light);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    font-family: var(--font-heading);
}
.creation-visual {
    position: relative;
    display: inline-block;
    width: 58px;
    height: 42px;
    flex: 0 0 auto;
}
.creation-visual.small {
    width: 44px;
    height: 32px;
}
.creation-visual::before,
.creation-visual::after {
    content: '';
    position: absolute;
    display: block;
}
.creation-light::before {
    width: 36px;
    height: 36px;
    left: 11px;
    top: 3px;
    border-radius: 50%;
    background: radial-gradient(circle, #fde68a 0 35%, #f59e0b 36% 62%, transparent 64%);
    box-shadow: 0 0 18px rgba(250, 204, 21, 0.75);
}
.creation-light::after {
    width: 54px;
    height: 2px;
    left: 2px;
    top: 20px;
    background: rgba(253, 230, 138, 0.7);
    transform: rotate(-25deg);
    box-shadow: 0 10px 0 rgba(253, 230, 138, 0.35), 0 -10px 0 rgba(253, 230, 138, 0.35);
}
.creation-sky::before {
    width: 54px;
    height: 30px;
    left: 2px;
    top: 7px;
    border-radius: 20px;
    background: linear-gradient(180deg, #38bdf8 0 45%, #1e40af 46% 100%);
}
.creation-sky::after {
    width: 28px;
    height: 10px;
    left: 15px;
    top: 16px;
    border-radius: 999px;
    background: rgba(255,255,255,0.8);
    box-shadow: 12px -6px 0 -2px rgba(255,255,255,0.7), -10px 5px 0 -2px rgba(255,255,255,0.65);
}
.creation-land::before {
    width: 54px;
    height: 28px;
    left: 2px;
    top: 10px;
    border-radius: 0 0 24px 24px;
    background: linear-gradient(180deg, #0ea5e9 0 42%, #166534 43% 100%);
}
.creation-land::after {
    width: 6px;
    height: 24px;
    left: 29px;
    top: 5px;
    border-radius: 999px;
    background: #65a30d;
    box-shadow: -8px 6px 0 2px #84cc16, 8px 7px 0 2px #22c55e;
}
.creation-stars::before {
    width: 42px;
    height: 42px;
    left: 8px;
    top: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fef3c7 0 18%, #f59e0b 19% 38%, transparent 39%);
}
.creation-stars::after {
    width: 5px;
    height: 5px;
    left: 8px;
    top: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 38px 3px 0 #fff, 31px 29px 0 #fde68a, 5px 32px 0 #bfdbfe;
}
.creation-sea-birds::before {
    width: 48px;
    height: 24px;
    left: 5px;
    top: 16px;
    border-radius: 50%;
    background: linear-gradient(180deg, #38bdf8, #0369a1);
}
.creation-sea-birds::after {
    width: 16px;
    height: 8px;
    left: 13px;
    top: 8px;
    border-top: 3px solid #f8fafc;
    border-radius: 50%;
    box-shadow: 18px -2px 0 -1px transparent;
}
.creation-people::before {
    width: 16px;
    height: 16px;
    left: 11px;
    top: 4px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 23px 0 0 #f59e0b;
}
.creation-people::after {
    width: 18px;
    height: 24px;
    left: 10px;
    top: 18px;
    border-radius: 12px 12px 4px 4px;
    background: #0ea5e9;
    box-shadow: 23px 0 0 #22c55e;
}
.creation-item:hover {
    border-color: var(--gold);
    background: rgba(255, 215, 0, 0.08);
    transform: translateY(-3px);
}
.creation-item.selected {
    opacity: 0.25;
    pointer-events: none;
    border-color: transparent;
}
.creation-slots {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}
@media (max-width: 768px) {
    .creation-slots {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 8px;
    }
}
.slot {
    background: rgba(0, 0, 0, 0.45);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 10px 5px;
    text-align: center;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.slot-num {
    font-size: 0.85rem;
    color: var(--gold-light);
    font-weight: 700;
    margin-bottom: 5px;
}
.slot-content {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 10px;
    padding: 8px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    justify-content: center;
    flex-grow: 1;
}
.slot-content.empty {
    color: rgba(255, 255, 255, 0.2);
    font-style: italic;
    font-size: 0.8rem;
    margin: auto 0;
}
.slot-content.filled {
    background: rgba(255, 215, 0, 0.12);
    border: 2px solid rgba(255, 215, 0, 0.4);
    color: #fff;
    animation: scaleUp 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* STAGE 2: Noah's Ark Animal Grid & general sharing grids */
.ark-game-container, .churches-game-container, .disciples-game-container, .magi-game-container {
    margin: 15px 0;
}
.animal-grid, .churches-grid, .disciples-grid, .magi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 768px) {
    .animal-grid, .churches-grid, .disciples-grid, .magi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
.animal-card, .church-card, .disciple-card, .magi-card {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 22px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
    min-height: 115px;
    justify-content: center;
}
.animal-card .emoji, .church-card .emoji, .disciple-card .emoji, .magi-card .emoji {
    display: inline-flex;
    min-width: 48px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--gold-light);
    font-size: 0.78rem;
    font-weight: 800;
    transition: transform 0.25s ease;
}
.animal-token {
    position: relative;
    color: transparent !important;
    width: 54px;
    min-width: 54px;
    height: 38px !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.28), rgba(30, 41, 59, 0.65)) !important;
}
.animal-token::before {
    content: '';
    position: absolute;
    width: 27px;
    height: 18px;
    border-radius: 50% 50% 45% 45%;
    background: #cbd5e1;
    left: 13px;
    top: 13px;
}
.animal-token::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
    left: 8px;
    top: 8px;
    box-shadow: 26px 0 0 #e2e8f0, 13px -4px 0 #f8fafc;
}
.animal-card .name, .church-card .name, .disciple-card .name, .magi-card .name {
    font-size: 1rem;
    font-weight: 700;
}
.magi-visual {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 44px;
}
.magi-visual::before,
.magi-visual::after {
    content: '';
    position: absolute;
    display: block;
}
.magi-gold::before {
    width: 42px;
    height: 30px;
    left: 7px;
    top: 11px;
    border-radius: 7px;
    background: linear-gradient(135deg, #fef08a, #d97706);
    box-shadow: inset 0 0 0 3px rgba(120, 53, 15, 0.35);
}
.magi-gold::after {
    width: 48px;
    height: 8px;
    left: 4px;
    top: 8px;
    border-radius: 6px;
    background: #facc15;
}
.magi-frankincense::before,
.magi-myrrh::before {
    width: 30px;
    height: 34px;
    left: 13px;
    top: 8px;
    border-radius: 9px 9px 14px 14px;
    background: linear-gradient(135deg, #e0f2fe, #64748b);
    border: 2px solid rgba(255,255,255,0.45);
}
.magi-frankincense::after {
    width: 7px;
    height: 28px;
    left: 25px;
    top: 0;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.8);
    filter: blur(1px);
    box-shadow: -11px 6px 0 -1px rgba(226,232,240,0.55), 10px 4px 0 -1px rgba(226,232,240,0.55);
}
.magi-myrrh::before {
    background: linear-gradient(135deg, #fed7aa, #92400e);
}
.magi-myrrh::after {
    width: 40px;
    height: 8px;
    left: 8px;
    top: 8px;
    border-radius: 7px;
    background: #78350f;
}
.magi-silver::before {
    width: 38px;
    height: 26px;
    left: 9px;
    top: 14px;
    border-radius: 7px;
    background: linear-gradient(135deg, #f8fafc, #94a3b8);
}
.magi-silver::after {
    width: 48px;
    height: 7px;
    left: 4px;
    top: 11px;
    border-radius: 999px;
    background: #cbd5e1;
}
.magi-jewel::before {
    width: 38px;
    height: 34px;
    left: 9px;
    top: 8px;
    clip-path: polygon(50% 0, 100% 38%, 50% 100%, 0 38%);
    background: linear-gradient(135deg, #67e8f9, #7c3aed);
}
.magi-jewel::after {
    width: 20px;
    height: 2px;
    left: 18px;
    top: 20px;
    background: rgba(255,255,255,0.6);
    transform: rotate(-35deg);
}
.magi-silk::before {
    width: 46px;
    height: 28px;
    left: 5px;
    top: 12px;
    border-radius: 18px 4px 18px 4px;
    background: linear-gradient(135deg, #fb7185, #7c2d12);
    transform: rotate(-8deg);
}
.magi-silk::after {
    width: 42px;
    height: 3px;
    left: 8px;
    top: 25px;
    background: rgba(255,255,255,0.45);
    transform: rotate(-8deg);
}
.magi-pearl::before {
    width: 34px;
    height: 34px;
    left: 11px;
    top: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0 20%, #c4b5fd 21% 72%, #64748b 73%);
}
.magi-pearl::after {
    width: 46px;
    height: 16px;
    left: 5px;
    bottom: 0;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.55);
}
.magi-meat::before {
    width: 42px;
    height: 24px;
    left: 7px;
    top: 15px;
    border-radius: 50% 45% 50% 45%;
    background: linear-gradient(135deg, #fca5a5, #991b1b);
}
.magi-meat::after {
    width: 10px;
    height: 18px;
    left: 38px;
    top: 18px;
    border-radius: 999px;
    background: #f8fafc;
    transform: rotate(35deg);
}
.animal-card:hover, .church-card:hover, .disciple-card:hover, .magi-card:hover {
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.05);
    transform: translateY(-4px);
}
.animal-card:hover .emoji, .church-card:hover .emoji, .disciple-card:hover .emoji, .magi-card:hover .emoji {
    transform: scale(1.18);
}
.animal-card.selected, .church-card.selected, .disciple-card.selected, .magi-card.selected {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--gold);
    box-shadow: 0 0 20px var(--gold-glow);
}

/* STAGE 3 & 5: Jonah & Goliath Selection Panels */
.jonah-game-container, .goliath-game-container {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}
@media (max-width: 768px) {
    .jonah-game-container, .goliath-game-container {
        flex-direction: column;
        gap: 15px;
    }
}
.jonah-selection-panel, .goliath-selection-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Commandments Selection */
.commandments-container {
    margin: 15px 0;
}
.commandments-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
@media (max-width: 768px) {
    .commandments-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
.commandment-item {
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    min-height: 70px;
}
.commandment-item:hover {
    border-color: rgba(255, 215, 0, 0.4);
    background: rgba(255, 215, 0, 0.05);
}
.commandment-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.commandment-item.selected {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--gold);
}
.commandment-item.selected .commandment-checkbox {
    background: var(--gold);
    border-color: var(--gold);
}
.commandment-item.selected .commandment-checkbox::after {
    content: '✓';
    color: #000;
    font-size: 1rem;
    font-weight: 900;
}
.commandment-text {
    font-size: 1.05rem;
    line-height: 1.5;
    font-weight: 600;
}

.selection-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 18px;
    padding: 20px;
    border: 2px solid rgba(255, 255, 255, 0.06);
}
.selection-box h4 {
    font-size: 1.05rem;
    color: var(--gold-light);
    margin-bottom: 15px;
    font-weight: 700;
}
.options-vertical {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}
@media (max-width: 768px) {
    .options-vertical {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 480px) {
    .options-vertical {
        grid-template-columns: repeat(2, 1fr);
    }
}
.option-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.option-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}
.option-btn.selected {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
    font-weight: 800;
    box-shadow: 0 0 10px var(--gold-glow);
}

.goliath-visual-card {
    flex: 1;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(22, 10, 10, 0.75) 100%);
    border: 2px solid rgba(239, 68, 68, 0.25);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    min-height: 220px;
}
.goliath-portrait {
    position: relative;
    width: 112px;
    height: 126px;
    animation: breathe 3s ease-in-out infinite;
}
.goliath-portrait::before,
.goliath-portrait::after {
    content: '';
    position: absolute;
    display: block;
}
.jonah-portrait::before {
    width: 96px;
    height: 58px;
    left: 8px;
    top: 42px;
    border-radius: 52% 48% 48% 52%;
    background: linear-gradient(135deg, #38bdf8, #075985);
    border: 3px solid rgba(186, 230, 253, 0.65);
}
.jonah-portrait::after {
    width: 30px;
    height: 30px;
    left: 30px;
    top: 26px;
    border-radius: 50%;
    background: #facc15;
    box-shadow: 50px 24px 0 -8px #082f49;
}
.goliath-standing::before {
    width: 44px;
    height: 44px;
    left: 34px;
    top: 8px;
    border-radius: 50%;
    background: #92400e;
    box-shadow: 0 40px 0 12px #7f1d1d;
}
.goliath-standing::after {
    width: 90px;
    height: 58px;
    left: 11px;
    bottom: 3px;
    border-radius: 12px 12px 26px 26px;
    background: linear-gradient(135deg, #475569, #111827);
    clip-path: polygon(50% 0, 100% 32%, 82% 100%, 18% 100%, 0 32%);
}
.goliath-hit::before {
    width: 86px;
    height: 86px;
    left: 13px;
    top: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #fef3c7 0 18%, #f59e0b 19% 42%, #991b1b 43% 70%, transparent 71%);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.65);
}
.goliath-hit::after {
    width: 82px;
    height: 10px;
    left: 15px;
    top: 58px;
    background: #fef3c7;
    transform: rotate(-24deg);
    box-shadow: 0 0 12px rgba(254, 243, 199, 0.7);
}
.goliath-status {
    font-size: 1.05rem;
    color: #fca5a5;
    text-align: center;
    font-style: italic;
    font-weight: 600;
    line-height: 1.5;
}

/* Samaritan Quiz */
.samaritan-container {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}
.samaritan-stage-step {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    padding: 25px 15px;
    width: 100%;
    max-width: 680px;
}
@media (min-width: 600px) {
    .samaritan-stage-step {
        padding: 30px;
    }
}
.step-progress {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--gold-light);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.samaritan-riddle {
    font-size: 1.25rem;
    line-height: 1.7;
    margin-bottom: 25px;
    font-weight: 700;
    color: #fff;
    border-left: 5px solid var(--gold);
    padding-left: 18px;
}
.samaritan-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.samaritan-opt-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px 20px;
    text-align: left;
    color: var(--text-primary);
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1.5;
    font-weight: 600;
}
.samaritan-opt-btn:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: var(--gold);
    transform: translateX(6px);
}
.samaritan-opt-btn:active {
    transform: translateX(3px);
}

/* Character Quiz (8지선다) */
.character-quiz-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 15px 0;
}
.character-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0.5) 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
}
.quiz-scroll {
    color: var(--gold);
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.character-desc {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #e2e8f0;
    font-weight: 600;
}
.character-options-grid-8 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
@media (max-width: 768px) {
    .character-options-grid-8 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
.character-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 18px 10px;
    font-size: 1.05rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    font-weight: 700;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.character-btn:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 4px 10px var(--gold-glow);
}

/* Fruits of the Spirit (20지선다) */
.fruits-game-container {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}
.fruits-board-20 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 100%;
}
@media (max-width: 768px) {
    .fruits-board-20 {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}
@media (max-width: 480px) {
    .fruits-board-20 {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}
.fruit-item {
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.08), transparent 40%),
        rgba(255, 255, 255, 0.035);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 18px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 112px;
    justify-content: center;
}
.fruit-visual {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 46px;
    transition: transform 0.2s ease;
}
.fruit-visual::before,
.fruit-visual::after {
    content: '';
    position: absolute;
    display: block;
}
.fruit-fig::before {
    width: 36px;
    height: 42px;
    left: 8px;
    top: 3px;
    border-radius: 55% 55% 48% 48%;
    background: linear-gradient(135deg, #a855f7, #581c87);
    box-shadow: inset 7px 7px 0 rgba(255,255,255,0.18);
}
.fruit-fig::after {
    width: 14px;
    height: 8px;
    left: 19px;
    top: 0;
    border-radius: 50%;
    background: #65a30d;
}
.fruit-olive::before {
    width: 38px;
    height: 28px;
    left: 7px;
    top: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #bef264, #4d7c0f);
    transform: rotate(-18deg);
    box-shadow: inset 5px 5px 0 rgba(255,255,255,0.22);
}
.fruit-olive::after {
    width: 36px;
    height: 4px;
    left: 9px;
    top: 7px;
    border-radius: 999px;
    background: #854d0e;
    transform: rotate(-20deg);
}
.fruit-grape::before {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    left: 18px;
    top: 7px;
    background: #7c3aed;
    box-shadow:
        -10px 12px 0 #6d28d9,
        10px 12px 0 #8b5cf6,
        0 24px 0 #5b21b6,
        -5px 33px 0 #7c3aed,
        5px 33px 0 #6d28d9;
}
.fruit-grape::after {
    width: 17px;
    height: 9px;
    left: 20px;
    top: 0;
    border-radius: 80% 0;
    background: #65a30d;
    transform: rotate(-20deg);
}
.fruit-pomegranate::before {
    width: 40px;
    height: 38px;
    left: 6px;
    top: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f87171, #991b1b);
    box-shadow: inset 7px 7px 0 rgba(255,255,255,0.18);
}
.fruit-pomegranate::after {
    width: 18px;
    height: 12px;
    left: 17px;
    top: 0;
    clip-path: polygon(0 100%, 20% 20%, 50% 100%, 80% 20%, 100% 100%);
    background: #facc15;
}
.fruit-date::before {
    width: 28px;
    height: 42px;
    left: 12px;
    top: 3px;
    border-radius: 48%;
    background: linear-gradient(135deg, #f59e0b, #78350f);
    transform: rotate(14deg);
    box-shadow: inset 6px 5px 0 rgba(255,255,255,0.18);
}
.fruit-date::after {
    width: 4px;
    height: 34px;
    left: 26px;
    top: 7px;
    border-radius: 999px;
    background: rgba(120, 53, 15, 0.55);
    transform: rotate(14deg);
}
.fruit-wheat::before {
    width: 5px;
    height: 43px;
    left: 25px;
    top: 2px;
    border-radius: 999px;
    background: #d97706;
}
.fruit-wheat::after {
    width: 12px;
    height: 18px;
    left: 14px;
    top: 5px;
    border-radius: 80% 0;
    background: #facc15;
    transform: rotate(-35deg);
    box-shadow:
        17px 4px 0 #fbbf24,
        -1px 15px 0 #eab308,
        16px 20px 0 #f59e0b;
}
.fruit-love::before {
    width: 28px;
    height: 28px;
    left: 12px;
    top: 10px;
    background: #ef4444;
    transform: rotate(45deg);
    border-radius: 4px;
}
.fruit-love::after {
    width: 28px;
    height: 28px;
    left: 4px;
    top: 2px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 16px 16px 0 #ef4444;
}
.fruit-joy::before {
    width: 34px;
    height: 34px;
    left: 9px;
    top: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, #fef3c7 0 42%, #f59e0b 43%);
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.7);
}
.fruit-joy::after {
    width: 18px;
    height: 9px;
    left: 17px;
    top: 23px;
    border-bottom: 3px solid #78350f;
    border-radius: 0 0 999px 999px;
}
.fruit-peace::before {
    width: 40px;
    height: 24px;
    left: 7px;
    top: 16px;
    border-radius: 60% 40% 55% 45%;
    background: #e0f2fe;
    transform: rotate(-10deg);
}
.fruit-peace::after {
    width: 22px;
    height: 14px;
    left: 25px;
    top: 10px;
    border-radius: 80% 10%;
    background: #bae6fd;
    transform: rotate(-28deg);
}
.fruit-patience::before {
    width: 28px;
    height: 40px;
    left: 12px;
    top: 3px;
    border: 3px solid #facc15;
    border-radius: 12px;
}
.fruit-patience::after {
    width: 20px;
    height: 18px;
    left: 16px;
    top: 13px;
    clip-path: polygon(0 0, 100% 0, 50% 55%, 100% 100%, 0 100%, 50% 55%);
    background: #fbbf24;
}
.fruit-kindness::before {
    width: 24px;
    height: 16px;
    left: 9px;
    top: 20px;
    border-radius: 999px;
    background: #fbbf24;
    transform: rotate(25deg);
    box-shadow: 16px -8px 0 #f59e0b;
}
.fruit-kindness::after {
    width: 38px;
    height: 4px;
    left: 8px;
    top: 25px;
    border-radius: 999px;
    background: #fde68a;
}
.fruit-goodness::before {
    width: 8px;
    height: 38px;
    left: 24px;
    top: 8px;
    border-radius: 999px;
    background: #65a30d;
}
.fruit-goodness::after {
    width: 22px;
    height: 16px;
    left: 25px;
    top: 8px;
    border-radius: 80% 0;
    background: #84cc16;
    box-shadow: -19px 14px 0 #22c55e;
}
.fruit-faithfulness::before {
    width: 38px;
    height: 42px;
    left: 7px;
    top: 2px;
    clip-path: polygon(50% 0, 100% 16%, 88% 76%, 50% 100%, 12% 76%, 0 16%);
    background: linear-gradient(135deg, #38bdf8, #1e3a8a);
}
.fruit-faithfulness::after {
    width: 19px;
    height: 11px;
    left: 17px;
    top: 17px;
    border-left: 4px solid #fef3c7;
    border-bottom: 4px solid #fef3c7;
    transform: rotate(-45deg);
}
.fruit-gentleness::before {
    width: 42px;
    height: 18px;
    left: 5px;
    top: 16px;
    border-radius: 80% 20%;
    background: linear-gradient(135deg, #f8fafc, #94a3b8);
    transform: rotate(-28deg);
}
.fruit-gentleness::after {
    width: 34px;
    height: 2px;
    left: 9px;
    top: 25px;
    background: rgba(15,23,42,0.35);
    transform: rotate(-28deg);
}
.fruit-self-control::before {
    width: 4px;
    height: 38px;
    left: 24px;
    top: 4px;
    background: #facc15;
    border-radius: 999px;
}
.fruit-self-control::after {
    width: 44px;
    height: 22px;
    left: 4px;
    top: 15px;
    border-top: 4px solid #facc15;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    box-shadow: -13px 11px 0 -6px #f59e0b, 13px 11px 0 -6px #f59e0b;
}
.fruit-envy::before {
    width: 42px;
    height: 24px;
    left: 5px;
    top: 13px;
    border-radius: 50%;
    background: #84cc16;
}
.fruit-envy::after {
    width: 13px;
    height: 13px;
    left: 20px;
    top: 18px;
    border-radius: 50%;
    background: #14532d;
    box-shadow: 0 0 0 4px #d9f99d;
}
.fruit-anger::before {
    width: 32px;
    height: 42px;
    left: 10px;
    top: 3px;
    border-radius: 60% 40% 55% 45%;
    background: linear-gradient(180deg, #facc15 0 25%, #ef4444 26% 72%, #7f1d1d 73%);
    clip-path: polygon(50% 0, 72% 24%, 63% 44%, 89% 62%, 60% 100%, 24% 86%, 0 52%, 31% 35%);
}
.fruit-pride::before {
    width: 42px;
    height: 30px;
    left: 5px;
    top: 13px;
    clip-path: polygon(0 100%, 0 38%, 22% 72%, 38% 12%, 50% 67%, 66% 12%, 80% 72%, 100% 38%, 100% 100%);
    background: linear-gradient(135deg, #fef08a, #d97706);
}
.fruit-pride::after {
    width: 5px;
    height: 5px;
    left: 24px;
    top: 4px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: -14px 13px 0 #38bdf8, 14px 13px 0 #22c55e;
}
.fruit-greed::before {
    width: 30px;
    height: 30px;
    left: 11px;
    top: 8px;
    border-radius: 50%;
    background: #facc15;
    box-shadow: 11px 8px 0 #d97706, -7px 9px 0 #fde68a;
}
.fruit-greed::after {
    width: 18px;
    height: 4px;
    left: 17px;
    top: 20px;
    background: #78350f;
}
.fruit-hate::before {
    width: 30px;
    height: 30px;
    left: 11px;
    top: 10px;
    background: #991b1b;
    transform: rotate(45deg);
    border-radius: 4px;
}
.fruit-hate::after {
    width: 4px;
    height: 36px;
    left: 24px;
    top: 6px;
    background: #f8fafc;
    transform: rotate(23deg);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.22);
}
.fruit-humility::before {
    width: 24px;
    height: 24px;
    left: 14px;
    top: 4px;
    border-radius: 50%;
    background: #fbbf24;
}
.fruit-humility::after {
    width: 40px;
    height: 24px;
    left: 6px;
    top: 22px;
    border-radius: 50% 50% 12px 12px;
    background: #0f766e;
    transform: skewX(-15deg);
}
.fruit-courage::before {
    width: 42px;
    height: 36px;
    left: 5px;
    top: 8px;
    clip-path: polygon(50% 0, 90% 20%, 78% 100%, 50% 82%, 22% 100%, 10% 20%);
    background: linear-gradient(135deg, #f59e0b, #7c2d12);
}
.fruit-courage::after {
    width: 22px;
    height: 10px;
    left: 15px;
    top: 20px;
    border-top: 4px solid #451a03;
    border-radius: 50%;
}
.fruit-wisdom::before {
    width: 30px;
    height: 30px;
    left: 11px;
    top: 3px;
    border-radius: 50%;
    background: #fef3c7;
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.7);
}
.fruit-wisdom::after {
    width: 18px;
    height: 13px;
    left: 17px;
    top: 30px;
    border-radius: 0 0 6px 6px;
    background: #f59e0b;
}
.fruit-honesty::before {
    width: 32px;
    height: 38px;
    left: 10px;
    top: 5px;
    border-radius: 5px;
    background: #e2e8f0;
}
.fruit-honesty::after {
    width: 24px;
    height: 4px;
    left: 15px;
    top: 16px;
    background: #0f172a;
    box-shadow: 0 9px 0 #0f172a, 0 18px 0 #0f172a;
}
.fruit-gratitude::before {
    width: 38px;
    height: 32px;
    left: 7px;
    top: 11px;
    border-radius: 7px;
    background: linear-gradient(135deg, #fb923c, #7c2d12);
}
.fruit-gratitude::after {
    width: 46px;
    height: 5px;
    left: 3px;
    top: 9px;
    background: #facc15;
    border-radius: 999px;
    box-shadow: 23px 17px 0 -9px #fef3c7;
}
.fruit-forgiveness::before {
    width: 42px;
    height: 26px;
    left: 5px;
    top: 14px;
    border-radius: 999px 999px 8px 8px;
    background: #38bdf8;
}
.fruit-forgiveness::after {
    width: 18px;
    height: 18px;
    left: 17px;
    top: 7px;
    border-left: 5px solid #f8fafc;
    border-bottom: 5px solid #f8fafc;
    transform: rotate(-45deg);
}
.fruit-item .label {
    font-size: 0.95rem;
    font-weight: 700;
}
.fruit-item:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}
.fruit-item:hover .fruit-visual {
    transform: scale(1.15);
}
.fruit-item.selected {
    background: rgba(217, 119, 6, 0.18);
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
}
.fruit-item.selected .fruit-visual {
    transform: scale(1.2);
}
.basket-status {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold-light);
    background: rgba(0, 0, 0, 0.35);
    padding: 10px 24px;
    border-radius: 24px;
    border: 2px solid rgba(255, 255, 255, 0.08);
}

/* Ending Screen */
.ending-card {
    max-width: 680px;
    position: relative;
    overflow: hidden;
}
.ending-badge {
    background: rgba(255, 215, 0, 0.15);
    border: 2px solid var(--gold);
    color: var(--gold);
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 2px;
    padding: 8px 20px;
    border-radius: 24px;
    display: inline-block;
    margin-bottom: 20px;
    font-family: var(--font-heading);
}
.ending-title {
    font-family: var(--font-fancy);
    font-size: 2.5rem;
    background: linear-gradient(to right, #fff, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 25px;
}
.ending-illustration {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pulse 1.5s infinite;
}
.ending-story {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 30px;
}
.clear-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 18px !important;
    margin-bottom: 30px;
}
.stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold-light);
    font-family: var(--font-heading);
}

/* Confetti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}
.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--gold);
    border-radius: 50%;
    animation: fall linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
    from { transform: scale(0.85); }
    to { transform: scale(1); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.08); opacity: 1; filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6)); }
    100% { transform: scale(1); opacity: 0.9; }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}

@keyframes breathe {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.06); filter: brightness(1.25) drop-shadow(0 0 20px rgba(239, 68, 68, 0.45)); }
    100% { transform: scale(1); filter: brightness(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

@keyframes fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500px) rotate(360deg);
        opacity: 0;
    }
}

/* 피지컬/인터랙션 추가 스타일 */

/* 1. 다윗의 물매돌 타이밍 게이지 바 */
.slingshot-gauge-container {
    width: 100%;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 14px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.gauge-track {
    position: relative;
    width: 100%;
    height: 28px;
    background: #1e293b;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.gauge-target-zone {
    position: absolute;
    top: 0;
    left: 42%; /* 정조준 구간 (42% ~ 58%) */
    width: 16%;
    height: 100%;
    background: linear-gradient(to right, #eab308, #facc15, #eab308);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.6);
}
.gauge-pointer {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444, 0 0 20px #ef4444;
    border-radius: 3px;
    z-index: 5;
}
.gauge-marker-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
    padding: 0 5px;
}

/* 2. 동방박사 보물함 스크래치 */
.scratch-game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin: 15px 0;
}
.scratch-canvas-wrapper {
    position: relative;
    width: 100%;
    max-width: 380px;
    height: 180px;
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid var(--gold);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px var(--gold-glow);
    background: #0f172a;
}
#magi-scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: crosshair;
    touch-action: none; /* 모바일 드래그 시 스크롤 방지 */
}
.scratch-underlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e293b 0%, #0d1226 100%);
    text-align: center;
    padding: 20px;
}
.scratch-underlay span {
    font-size: 0.9rem;
    color: var(--gold-light);
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 1px;
}
.scratch-underlay h3 {
    font-size: 2rem;
    font-family: var(--font-main);
    font-weight: 900;
    background: linear-gradient(to right, #fff, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px var(--gold-glow);
    margin: 0;
}
.scratch-progress-label {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--gold-light);
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.magi-selection-box {
    position: relative;
    width: 100%;
    border-radius: 20px;
    padding: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.magi-selection-box.locked {
    filter: blur(3px) grayscale(50%);
    opacity: 0.35;
    pointer-events: none;
}
.magi-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-weight: bold;
    font-size: 1.05rem;
    text-align: center;
    padding: 20px;
    border-radius: 20px;
}
.magi-selection-box:not(.locked) .magi-lock-overlay {
    display: none;
}

/* 수원영은교회 중등부 배지 및 QR코드 스타일 */
.church-badge-wrapper {
    width: 100%;
    margin-bottom: 20px;
}
.church-badge {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(217, 119, 6, 0.25) 100%);
    border: 2px solid var(--border-glass-hover);
    color: var(--gold-light);
    font-size: 1.05rem;
    font-weight: 800;
    padding: 10px 24px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.15);
    letter-spacing: 1px;
    animation: pulse 3s infinite;
}
.auth-card {
    max-width: 900px !important;
}
.lobby-card {
    max-width: 680px; /* 로비 카드는 다시 이전의 컴팩트한 기본 사이즈로 복원 */
}
.auth-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.8fr;
    gap: 35px;
    align-items: center;
}
@media (max-width: 768px) {
    .auth-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}
.auth-main-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.auth-qr-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.qr-box {
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid var(--border-glass);
    border-radius: 24px;
    padding: 24px 20px;
    width: 100%;
    max-width: 280px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    transition: all 0.3s ease;
}
.qr-box:hover {
    border-color: var(--border-glass-hover);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2), inset 0 2px 8px rgba(0,0,0,0.5);
}
.qr-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--gold-light);
    letter-spacing: 0.5px;
}
.qr-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.qr-image-container {
    background: #fff;
    padding: 10px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    width: 150px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease;
}
.qr-image-container:hover {
    transform: scale(1.05);
}
.lobby-qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.qr-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* 신규 인터랙티브 피지컬 미션 스타일 */
.physical-mission-overlay {
    position: relative;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    border: 3px solid var(--border-glass-hover);
    border-radius: 24px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 215, 0, 0.1);
    z-index: 100;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}
.physical-mission-overlay.cleared {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    display: none !important;
}

.mission-instruction {
    text-align: center;
    width: 100%;
}
.mission-badge {
    background: linear-gradient(135deg, var(--danger) 0%, #b91c1c 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 12px;
    letter-spacing: 1px;
    box-shadow: 0 0 10px var(--danger-glow);
}
.mission-instruction h3 {
    font-size: 1.8rem;
    color: var(--gold-light);
    margin-bottom: 8px;
    font-weight: 800;
}
.mission-instruction p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.stage-locked-content {
    transition: filter 0.5s ease, opacity 0.5s ease;
    width: 100%;
}
.stage-locked-content.locked {
    filter: blur(10px);
    opacity: 0.25;
    pointer-events: none;
}

/* 1. 모세의 홍해 가르기 */
.sea-split-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    height: 220px;
    background: #020617;
    border-radius: 20px;
    border: 3px solid #38bdf8;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    display: flex;
    justify-content: center;
    align-items: center;
}
.sea-split-container:active {
    cursor: grabbing;
}
.sea-wall {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.4);
    z-index: 10;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 30px rgba(2, 132, 199, 0.6);
}
.sea-wall-left {
    left: 0;
    border-right: 2px dashed rgba(255,255,255,0.4);
}
.sea-wall-right {
    right: 0;
    border-left: 2px dashed rgba(255,255,255,0.4);
}
.physical-mission-overlay.cleared .sea-wall-left {
    transform: translateX(-100%);
}
.physical-mission-overlay.cleared .sea-wall-right {
    transform: translateX(100%);
}
.sea-staff-pointer {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    transform: translate(-50%, -50%);
    top: 30px;
    left: 50%;
    width: 4px;
    height: 56px;
    border-radius: 999px;
    background: var(--gold);
    transition: top 0.05s ease, left 0.05s ease;
    filter: drop-shadow(0 0 10px var(--gold));
}
.sea-staff-pointer::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold-light);
    left: 50%;
    top: -6px;
    transform: translateX(-50%);
}
.swipe-hint-arrow {
    position: absolute;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: #38bdf8;
    z-index: 15;
    pointer-events: none;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
}
.swipe-hint-arrow::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 178px;
    background: rgba(255, 255, 255, 0.35);
    left: 50%;
    top: 24px;
    transform: translateX(-50%);
    animation: centerLinePulse 1.5s infinite;
}
.sea-accuracy-text {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 25;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 800;
    white-space: nowrap;
}
.sea-accuracy-text.passed {
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.45);
}
.sea-accuracy-text.failed {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.45);
}
@keyframes centerLinePulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.8; }
}

/* 2. 여리고 성벽 무너뜨리기 */
.jericho-game-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 400px;
}
.jericho-wall-visual {
    position: relative;
    background:
        linear-gradient(90deg, rgba(15,23,42,0.22) 2px, transparent 2px) 0 0 / 44px 26px,
        linear-gradient(90deg, transparent 22px, rgba(15,23,42,0.22) 22px, rgba(15,23,42,0.22) 24px, transparent 24px) 0 13px / 44px 26px,
        linear-gradient(180deg, rgba(15,23,42,0.28) 2px, transparent 2px) 0 0 / 44px 26px,
        linear-gradient(135deg, #b45309 0%, #78350f 100%);
    border: 3px solid #334155;
    border-radius: 20px;
    width: 100%;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    user-select: none;
    transition: transform 0.05s ease;
    overflow: hidden;
}
.jericho-wall-visual::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 74px;
    height: 78px;
    transform: translateX(-50%);
    border-radius: 38px 38px 0 0;
    background: linear-gradient(135deg, #1e293b, #020617);
    border: 5px solid rgba(15, 23, 42, 0.75);
}
.jericho-wall-visual::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 18px;
    background:
        repeating-linear-gradient(90deg, #92400e 0 26px, #78350f 26px 32px);
}
.jericho-wall-visual.shake-heavy {
    animation: shakeHeavy 0.15s infinite;
    border-color: #ef4444;
}
@keyframes shakeHeavy {
    0% { transform: translate(2px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}
.jericho-progress-group {
    width: 100%;
}
.jericho-bar-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 700;
}
.jericho-progress-track {
    width: 100%;
    height: 22px;
    background: #1e293b;
    border-radius: 11px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.15);
}
.jericho-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
    transition: width 0.1s ease;
}
.jericho-timer-group {
    font-size: 1.15rem;
    font-weight: bold;
    color: #ef4444;
    font-family: var(--font-heading);
}
.jericho-controls {
    width: 100%;
}
.jericho-controls button {
    width: 100%;
    height: 56px;
}

/* 3. 오병이어의 기적 슬래시 */
.loaves-fishes-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 450px;
}
#loaves-fishes-canvas {
    background: linear-gradient(135deg, #0b0f19 0%, #020617 100%);
    border: 3px solid var(--gold);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6), 0 0 20px var(--gold-glow);
    border-radius: 20px;
    cursor: crosshair;
    touch-action: none;
    width: 100%;
    height: auto;
}
.loaves-fishes-status {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold-light);
    background: rgba(0, 0, 0, 0.45);
    padding: 6px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.slice-attempt-divider {
    display: inline-block;
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.3);
}

@media (max-width: 480px) {
    .loaves-fishes-status {
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    .slice-attempt-divider {
        margin: 0 5px;
    }
}

/* ==========================================
   이름 입력 및 랭킹 리더보드, 인증서 스타일
   ========================================== */

/* 이름 입력 */
.name-input-group {
    margin: 20px 0;
    width: 100%;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.name-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.5px;
}
.player-name-input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    color: #fff;
    font-size: 1.1rem;
    text-align: center;
    font-weight: 700;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.player-name-input:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px var(--gold-glow);
}
.player-name-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
}
.name-error-msg {
    font-size: 0.85rem;
    color: #f87171;
    font-weight: 600;
    margin-top: 4px;
    animation: shake 0.4s ease;
}
.name-error-msg.hide {
    display: none;
}

/* 리더보드 순위표 */
.leaderboard-section {
    margin-top: 35px;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 25px;
}
.leaderboard-title {
    font-family: var(--font-fancy);
    font-size: 1.4rem;
    color: var(--gold-light);
    margin-bottom: 15px;
    letter-spacing: 1px;
}
.leaderboard-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    max-width: 480px;
    margin: 0 auto;
}
.leaderboard-header {
    display: grid;
    grid-template-columns: 0.65fr 1.4fr 1fr 1.35fr 0.75fr;
    background: rgba(255, 215, 0, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 15px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gold);
    text-align: center;
}
.leaderboard-list {
    max-height: 220px;
    overflow-y: auto;
}
.leaderboard-row {
    display: grid;
    grid-template-columns: 0.65fr 1.4fr 1fr 1.35fr 0.75fr;
    padding: 11px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    align-items: center;
    font-size: 0.95rem;
    text-align: center;
    transition: background-color 0.2s ease;
}
.leaderboard-row:last-child {
    border-bottom: none;
}
.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.02);
}
.leaderboard-row.my-score {
    background: rgba(255, 215, 0, 0.08);
    font-weight: bold;
}
.rank-badge {
    display: inline-flex;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin: 0 auto;
}
.rank-1 .rank-badge {
    background: #ffd700;
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}
.rank-2 .rank-badge {
    background: #c0c0c0;
    color: #000;
}
.rank-3 .rank-badge {
    background: #cd7f32;
    color: #000;
}
.col-rank {
    /* Rank Column Width */
}
.col-name {
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.col-time {
    color: var(--gold-light);
    font-weight: bold;
}
.col-played-at {
    color: #cbd5e1;
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}
.col-fail {
    color: #f87171;
}
.leaderboard-loading, .leaderboard-empty {
    padding: 25px;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
}

/* 엔딩 등급 인증서 */
.clear-certificate-card {
    border: 3px solid var(--gold);
    border-radius: 24px;
    padding: 30px 20px !important;
    margin: 25px auto;
    max-width: 440px;
    background: linear-gradient(135deg, rgba(20, 15, 5, 0.9) 0%, rgba(0, 0, 0, 0.95) 100%) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 30px var(--gold-glow);
    position: relative;
    overflow: hidden;
}
.cert-header {
    font-family: var(--font-fancy);
    font-size: 1.35rem;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255,215,0,0.3);
}
.cert-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}
.cert-name-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    letter-spacing: 1px;
}
.cert-player-name {
    font-size: 2.1rem;
    font-weight: 900;
    color: #fff;
    margin: 0 0 15px 0;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}
.cert-divider {
    width: 60px;
    height: 3px;
    background: var(--gold);
    border-radius: 2px;
    margin-bottom: 20px;
}
.cert-rank-badge {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-shadow: 0 0 20px currentColor;
    font-family: var(--font-heading);
}

/* 등급별 뱃지 및 카드 색상 바리에이션 */
.clear-certificate-card.gold-tier {
    border-color: #ffd700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.35);
}
.clear-certificate-card.gold-tier .cert-rank-badge {
    color: #ffd700;
}
.clear-certificate-card.silver-tier {
    border-color: #cbd5e1;
    background: linear-gradient(135deg, rgba(15, 20, 30, 0.9) 0%, rgba(0, 0, 0, 0.95) 100%) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 30px rgba(148, 163, 184, 0.2);
}
.clear-certificate-card.silver-tier .cert-header {
    color: #cbd5e1;
}
.clear-certificate-card.silver-tier .cert-divider {
    background: #cbd5e1;
}
.clear-certificate-card.silver-tier .cert-rank-badge {
    color: #cbd5e1;
}
.clear-certificate-card.bronze-tier {
    border-color: #b45309;
    background: linear-gradient(135deg, rgba(24, 15, 10, 0.9) 0%, rgba(0, 0, 0, 0.95) 100%) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 30px rgba(180, 83, 9, 0.2);
}
.clear-certificate-card.bronze-tier .cert-header {
    color: #d97706;
}
.clear-certificate-card.bronze-tier .cert-divider {
    background: #d97706;
}
.clear-certificate-card.bronze-tier .cert-rank-badge {
    color: #d97706;
}

.cert-desc {
    font-size: 0.95rem;
    color: #e2e8f0;
    line-height: 1.6;
    max-width: 280px;
    text-align: center;
    font-weight: 500;
}
.cert-prize-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 15px;
}
.prize-tag {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--gold-light);
}
.prize-name {
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
}

/* 전체 순위표 모달 */
.leaderboard-modal-content {
    width: 90%;
    max-width: 640px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(2, 6, 23, 0.99) 100%) !important;
    border: 3px solid var(--gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 30px var(--gold-glow);
    padding: 25px;
    border-radius: 16px;
    position: relative;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 15px;
}
.modal-header h2 {
    font-family: var(--font-fancy);
    font-size: 1.5rem;
    color: var(--gold-light);
    margin: 0;
}
.btn-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}
.btn-close:hover {
    color: #ef4444;
}
.search-box-container {
    width: 100%;
}
.search-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
}
.search-input:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.08);
}
.leaderboard-modal-box {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.leaderboard-list-all {
    overflow-y: auto;
    flex: 1;
    max-height: 45vh;
}

@media (max-width: 560px) {
    .leaderboard-modal-content {
        width: calc(100vw - 20px);
        padding: 16px;
        max-height: 88dvh;
    }

    .modal-header h2 {
        font-size: 1.15rem;
    }

    .leaderboard-header {
        display: none;
    }

    .leaderboard-list-all {
        max-height: 56dvh;
    }

    .leaderboard-row {
        grid-template-columns: 42px 1fr auto;
        grid-template-areas:
            "rank name time"
            "rank played fail";
        gap: 4px 10px;
        padding: 12px;
        text-align: left;
    }

    .leaderboard-row .col-rank {
        grid-area: rank;
        align-self: center;
    }

    .leaderboard-row .col-name {
        grid-area: name;
    }

    .leaderboard-row .col-time {
        grid-area: time;
        text-align: right;
    }

    .leaderboard-row .col-played-at {
        grid-area: played;
        font-size: 0.78rem;
        color: var(--text-muted);
    }

    .leaderboard-row .col-fail {
        grid-area: fail;
        text-align: right;
        font-size: 0.82rem;
    }
}
.btn-view-leaderboard {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 20px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: 100%;
    max-width: 380px;
}
.btn-view-leaderboard:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: var(--gold);
    color: var(--gold);
}


