:root {
    --bg: #0f172a;
    --accent: #d63031;
    --gold: #f1c40f;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-heavy: rgba(255, 255, 255, 0.9);
    --premium-glow: 0 0 20px rgba(241, 196, 15, 0.5), 0 0 40px rgba(241, 196, 15, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Outfit', sans-serif; background: #000; overflow: hidden; height: 100vh; color: white; }

#app { width: 100%; height: 100%; position: relative; background: var(--bg); }

/* Screen Management */
.screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0; visibility: hidden; transition: all 0.4s ease;
    z-index: 1; pointer-events: none;
}
.screen.active { opacity: 1; visibility: visible; z-index: 10; pointer-events: auto; }

/* Horizontal Lobby */
.lobby-header { padding: 40px; text-align: center; }
#welcome-msg { font-size: 0.9rem; color: var(--gold); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 5px; opacity: 0.8; }
.lobby-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 5px; }

/* Onboarding Screen */
#onboarding { background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%); display: flex; align-items: center; justify-content: center; }
.onboarding-content { text-align: center; max-width: 400px; padding: 40px; animation: fadeIn 1s ease-out; }
.logo-animation { font-size: 4rem; margin-bottom: 20px; animation: float 3s ease-in-out infinite; }
.onboarding-content h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 10px; background: linear-gradient(to right, #fff, var(--gold)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.onboarding-content p { font-size: 1.1rem; opacity: 0.7; margin-bottom: 40px; line-height: 1.6; animation: fadeIn 1.2s ease-out 0.3s both; }
#onboarding .input-group { gap: 10px; animation: fadeIn 1.5s ease-out 0.6s both; }
#user-name-input { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); padding: 15px 25px; border-radius: 20px; color: white; font-size: 1.1rem; text-align: center; outline: none; transition: 0.3s; transform-style: preserve-3d; }
#user-name-input:focus { border-color: var(--gold); box-shadow: 0 0 15px rgba(241, 196, 15, 0.2); }
#start-journey-btn { background: var(--gold); color: #000; padding: 15px 30px; border-radius: 20px; font-weight: 800; font-size: 1.1rem; cursor: pointer; border: none; transition: 0.3s; }
#start-journey-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(241, 196, 15, 0.3); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.lobby-header span { color: var(--gold); }
.lobby-header p { font-size: 1.1rem; opacity: 0.7; margin-bottom: 15px; }

.soul-points-container {
    display: inline-flex; align-items: center; gap: 8px;
    background: rgba(241, 196, 15, 0.1); border: 1px solid var(--gold);
    padding: 6px 16px; border-radius: 20px;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.2);
    margin-top: 5px;
}
.soul-points-container .label { font-size: 0.85rem; color: var(--gold); font-weight: 800; opacity: 0.9; }
#soul-points-display { font-size: 1.2rem; color: #fff; font-weight: 800; text-shadow: 0 0 5px var(--gold); }

.horizontal-scroll {
    display: flex; gap: 25px; padding: 30px 40px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;
    justify-content: center;
}

/* Custom Scrollbar for Chrome/Safari */
.horizontal-scroll::-webkit-scrollbar { height: 6px; }
.horizontal-scroll::-webkit-scrollbar-track { background: transparent; }
.horizontal-scroll::-webkit-scrollbar-thumb { background: rgba(241, 196, 15, 0.3); border-radius: 10px; }
.horizontal-scroll::-webkit-scrollbar-thumb:hover { background: var(--gold); }

@media (max-width: 1400px) {
    .horizontal-scroll { justify-content: flex-start; } /* Switch to start to prevent clipping when cards overflow center */
}


.game-box {
    flex: 0 0 280px; background: var(--glass); border: 2px solid rgba(255,255,255,0.1);
    border-radius: 30px; padding: 30px; scroll-snap-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer;
}
.game-box:hover { background: rgba(255,255,255,0.1); border-color: var(--gold); transform: translateY(-10px); }

.game-preview { font-size: 3rem; margin-bottom: 20px; }
.game-box h3 { font-size: 1.2rem; margin-bottom: 10px; }
.game-box p { font-size: 0.8rem; opacity: 0.6; margin-bottom: 20px; height: 40px; }
.game-how { font-size: 0.75rem; background: rgba(0,0,0,0.3); padding: 10px; border-radius: 15px; color: var(--gold); }

/* Yut Dual Layout */
.yut-dual-layout { display: flex; width: 100%; height: 100%; padding-top: 80px; }
.yut-board-side { flex: 1.5; display: flex; flex-direction: column; align-items: center; position: relative; }
.yut-control-side { flex: 1; background: rgba(0,0,0,0.3); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; border-left: 1px solid rgba(255,255,255,0.1); }

#yut-canvas { width: 90%; height: 80%; }
#yut-status { font-size: 1.1rem; font-weight: 800; color: var(--gold); margin-bottom: 10px; }

/* 3D Sticks Panel */
.yut-sticks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 30px; }
.stick-3d { 
    width: 25px; height: 100px; position: relative; transform-style: preserve-3d; 
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.side { position: absolute; width: 100%; height: 100%; border-radius: 4px; font-size: 0.5rem; text-align: center; }
.side.front { 
    background: #ff9f43; transform: translateZ(5px); border: 1px solid #ee5253; color: #2e86de; 
    display: flex; flex-direction: column; align-items: center; justify-content: space-around; 
    padding: 5px 0;
}
.side.back { background: #5d4037; transform: rotateY(180deg) translateZ(5px); color: white; display: flex; align-items: center; justify-content: center; font-size: 0.4rem; }

#yut-result-display { font-size: 2rem; font-weight: 800; color: white; margin-bottom: 20px; text-shadow: 0 0 20px var(--accent); }

/* Buttons */
.fly-btn {
    background: white; color: black; border: none; padding: 15px 40px;
    border-radius: 30px; font-weight: 800; cursor: pointer; transition: 0.3s;
}
.fly-btn:hover { transform: scale(1.1); }

.back-btn { position: absolute; top: 30px; left: 30px; z-index: 1000; background: var(--glass); border: none; color: white; padding: 10px 20px; border-radius: 15px; font-weight: 800; cursor: pointer; }

/* Yut Rules & Messages */
.rule-banner {
    position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
    width: 95%; background: none; backdrop-filter: none;
    padding: 10px; z-index: 500; text-align: center;
}
.rule-banner h4 { color: var(--gold); font-size: 1.3rem; margin-bottom: 5px; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
.rule-banner p { font-size: 1rem; color: white; line-height: 1.4; text-shadow: 0 2px 8px rgba(0,0,0,0.8); }

#result-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(10px);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 1000; border-radius: 30px;
}
#result-text {
    font-size: 4rem; font-weight: 900; color: var(--gold);
    text-shadow: 0 0 50px var(--gold); margin-bottom: 30px;
    animation: resultGlow 1.5s infinite alternate;
}
@keyframes resultGlow { from { opacity: 0.7; scale: 0.95; } to { opacity: 1; scale: 1; } }

/* --- Auth Styles --- */
.auth-divider {
    margin: 20px 0;
    position: relative;
    text-align: center;
}
.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.1);
    z-index: 1;
}
.auth-divider span {
    background: #0f172a; /* Same as onboarding bg */
    padding: 0 15px;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
    position: relative;
    z-index: 2;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: white;
    color: #444;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: 0.3s;
}
.google-btn:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}
.google-btn img {
    width: 20px;
    height: 20px;
}

.user-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 900px;
    margin: 0 auto 30px;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 0 0 25px 25px;
}

.user-info-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-photo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
    object-fit: cover;
}

.user-text-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#user-display-name {
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.user-status-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 8px;
    margin-top: 4px;
    display: inline-block;
}

.user-status-badge.verified {
    color: var(--gold);
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.3);
    text-shadow: 0 0 5px rgba(241, 196, 15, 0.5);
    animation: goldGlow 2s infinite alternate;
}

.user-status-badge.guest {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    opacity: 0.8;
}

@keyframes goldGlow {
    from { box-shadow: 0 0 5px rgba(241, 196, 15, 0.2); }
    to { box-shadow: 0 0 12px rgba(241, 196, 15, 0.5); }
}

.logout-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.2);
    border-color: rgba(231, 76, 60, 0.4);
    color: #ff7675;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.2);
    transform: translateY(-2px);
}

.hidden { display: none !important; }

#yut-jeom-msg {
    font-size: 0.8rem; color: var(--gold); font-weight: 700;
    margin-bottom: 10px; opacity: 0.8; font-family: 'Noto Serif KR', serif;
}

.lobby-footer { position: absolute; bottom: 30px; width: 100%; text-align: center; }

/* Sky Kite Styles */
.kite-world { width: 100%; height: 100%; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sky-background { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, #74b9ff, #0984e3); z-index: -1; }

.cloud { position: absolute; background: white; border-radius: 50px; opacity: 0.4; }
.cloud::after, .cloud::before { content: ''; position: absolute; background: white; border-radius: 50%; }
.cloud-1 { width: 200px; height: 60px; top: 10%; left: -250px; animation: drift 30s linear infinite; }
.cloud-1::after { width: 100px; height: 100px; top: -50px; left: 30px; }
.cloud-1::before { width: 120px; height: 120px; top: -70px; left: 70px; }

.cloud-2 { width: 150px; height: 45px; top: 30%; right: -200px; animation: drift 45s linear infinite reverse; opacity: 0.3; }
.cloud-2::after { width: 80px; height: 80px; top: -40px; left: 20px; }
.cloud-2::before { width: 100px; height: 100px; top: -60px; left: 50px; }

@keyframes drift { from { transform: translateX(-100px); } to { transform: translateX(calc(100vw + 400px)); } }

.kite-input-zone { background: var(--glass-heavy); padding: 40px; border-radius: 30px; color: black; text-align: center; width: 90%; max-width: 500px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); transition: 0.5s; }
.kite-input-zone h2 { margin-bottom: 10px; font-weight: 800; }
.kite-input-zone p { margin-bottom: 30px; opacity: 0.7; }
.kite-input-zone { animation: bannerFadeIn 1.5s cubic-bezier(0.23, 1, 0.32, 1) both; }

@keyframes bannerFadeIn {
    from { opacity: 0; transform: translate(-50%, -40%) rotateX(-20deg) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) rotateX(0) scale(1); }
}

.input-group { display: flex; flex-direction: column; gap: 15px; }
#kite-input { padding: 15px 25px; border-radius: 20px; border: 2px solid #ddd; font-size: 1.1rem; outline: none; }
#kite-input:focus { border-color: var(--accent); }

#fly-kite-btn { background: var(--accent); color: white; }

/* The Kite */
#kite-container { position: absolute; bottom: -200px; transition: all 5s cubic-bezier(0.45, 0.05, 0.55, 0.95); z-index: 100; left: 50%; transform: translateX(-50%); }
#kite-container.flying { bottom: 120%; transform: translateX(-50%) scale(0.5) rotate(15deg); }

.kite { position: relative; width: 80px; height: 100px; }
.kite-body { width: 100%; height: 100%; background: #ff7675; clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); border: 2px solid #d63031; }
.kite-string { position: absolute; bottom: 0; left: 50%; width: 2px; height: 150px; background: rgba(255,255,255,0.5); transform-origin: top center; transform: rotate(5deg); }

.kite-banner {
    position: absolute; top: 110px; left: 50%; transform: translateX(-50%);
    background: white; color: #d63031; padding: 10px 30px; border-radius: 5px;
    font-weight: 800; white-space: nowrap; font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    animation: wave 2s ease-in-out infinite alternate;
}
.kite-banner::before { content: ''; position: absolute; top: -10px; left: 50%; width: 2px; height: 10px; background: #666; }

@keyframes wave { from { transform: translateX(-50%) rotate(-5deg); } to { transform: translateX(-50%) rotate(5deg); } }

#kite-success-msg { text-align: center; background: var(--glass-heavy); padding: 40px; border-radius: 30px; color: black; animation: fadeIn 1s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
/* Premium Center Styles */
.premium-card { border: 2px solid var(--gold) !important; background: linear-gradient(145deg, #2d3436, #000) !important; color: var(--gold) !important; }
.premium-card .game-preview { filter: drop-shadow(0 0 10px var(--gold)); }

.premium-notice-content { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; color: white; text-align: center; background: radial-gradient(circle at center, #2d3436 0%, #000 100%); }
.diamond-icon { font-size: 4rem; margin-bottom: 20px; animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 0.8; } }

.pricing-table { display: flex; gap: 25px; margin-top: 40px; width: 100%; max-width: 800px; flex-wrap: wrap; justify-content: center; }
.price-box { background: rgba(255,255,255,0.05); padding: 30px; border-radius: 25px; width: 280px; border: 1px solid rgba(255,255,255,0.1); transition: 0.3s; position: relative; }
.price-box:hover { transform: translateY(-10px); border-color: var(--gold); }
.price-box.featured { border: 2px solid var(--gold); background: rgba(212, 175, 55, 0.05); }
.price-box h3 { font-size: 1.4rem; margin-bottom: 10px; }
.price-box .price { font-size: 2.5rem; font-weight: 800; margin-bottom: 20px; color: var(--gold); }
.price-box .price span { font-size: 1rem; opacity: 0.6; }
.price-box ul { list-style: none; padding: 0; margin-bottom: 30px; text-align: left; }
.price-box li { margin-bottom: 10px; font-size: 0.9rem; opacity: 0.8; }
.price-box li b { color: var(--gold); }
.price-box .buy-btn { width: 100%; padding: 15px; border-radius: 15px; border: none; background: white; font-weight: 800; cursor: pointer; transition: 0.3s; }
.price-box.featured .buy-btn { background: var(--gold); color: black; }
.price-box.featured {
    animation: goldGlowPulse 3s infinite alternate;
    box-shadow: var(--premium-glow);
}

@keyframes goldGlowPulse {
    0% { border-color: var(--gold); box-shadow: 0 0 15px rgba(241, 196, 15, 0.3); }
    100% { border-color: #fff; box-shadow: 0 0 35px rgba(241, 196, 15, 0.7); }
}

/* Disabled Button Style */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
    filter: grayscale(0.8);
}
.price-box .badge { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); background: var(--gold); color: black; padding: 5px 15px; border-radius: 20px; font-size: 0.7rem; font-weight: 800; }

.secure-text { margin-top: 30px; font-size: 0.8rem; opacity: 0.5; }

/* Chat Container */
.chat-container { width: 100%; height: 100%; display: flex; flex-direction: column; background: #f5f6fa; color: #2d3436; }
.chat-header { padding: 20px; background: white; border-bottom: 1px solid #ddd; display: flex; align-items: center; gap: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.master-avatar { width: 50px; height: 50px; background: var(--gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.master-info h3 { margin: 0; font-size: 1.1rem; }
.master-info span { font-size: 0.8rem; opacity: 0.6; }

/* Saju Center Styles */
#saju-center { background: #fdfaf0; color: #2d3436; }
.saju-main-content { padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 30px; height: calc(100% - 80px); overflow-y: auto; }
.saju-intro { text-align: center; }
.saju-intro .master-avatar { font-size: 5rem; margin-bottom: 20px; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.1)); animation: float 4s ease-in-out infinite; }
.high-contrast-text { font-size: 1.4rem; font-weight: 800; color: #1a1a1a; line-height: 1.6; text-shadow: 0 1px 0 rgba(255,255,255,0.8); }

.saju-results {
    width: 100%; max-width: 600px; background: white; padding: 30px; border-radius: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.05); min-height: 300px;
    display: flex; flex-direction: column; gap: 20px; border: 1px solid #eee;
}
.saju-placeholder { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; opacity: 0.4; font-weight: 700; line-height: 1.8; }
.saju-item { border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; animation: fadeIn 0.8s ease-out; }
.saju-item:last-child { border: none; }
.saju-item h4 { color: #8b4513; font-size: 1.1rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.saju-item p { color: #444; line-height: 1.7; font-size: 1rem; }

.gold-btn { background: var(--gold) !important; color: #000 !important; box-shadow: 0 10px 20px rgba(241, 196, 15, 0.3); font-size: 1.2rem !important; padding: 20px 50px !important; }
.gold-btn:hover { background: #fff !important; transform: translateY(-5px) scale(1.05) !important; }

.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.message { padding: 12px 18px; border-radius: 20px; max-width: 80%; font-size: 0.95rem; line-height: 1.5; }
.message.system { align-self: center; background: #eee; font-size: 0.8rem; opacity: 0.7; }
.message.user { align-self: flex-end; background: var(--accent); color: white; border-bottom-right-radius: 5px; }
.message.ai { align-self: flex-start; background: white; color: #2d3436; border-bottom-left-radius: 5px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

.chat-input-area { padding: 20px; background: white; display: flex; gap: 10px; border-top: 1px solid #ddd; }
#chat-input { flex: 1; padding: 12px 20px; border-radius: 25px; border: 1px solid #ddd; outline: none; }
#send-chat-btn { padding: 0 25px; border-radius: 25px; border: none; background: var(--accent); color: white; font-weight: 800; cursor: pointer; }

.lang-selector-inline { display: flex; gap: 5px; }
.lang-selector-inline button { 
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); 
    font-size: 1.1rem; padding: 2px 6px; border-radius: 8px; cursor: pointer; transition: 0.3s;
}
.lang-selector-inline button:hover { background: rgba(255,255,255,0.3); transform: scale(1.1); }
.lang-selector-inline button.active { border-color: var(--gold); background: rgba(241, 196, 15, 0.2); }

/* Jegi-Chagi Game Styles */
#jegi-game-area {
    width: 100%; height: 80vh; background: #e9e4d4; 
    position: relative; overflow: hidden; margin-top: 20px;
    border-radius: 20px; border: 4px solid #8b4513;
}
#jegi-object {
    position: absolute; font-size: 4rem; cursor: pointer;
    user-select: none; z-index: 100;
    transition: transform 0.05s ease-out;
}
/* Invisible Hitbox Expansion */
#jegi-object::after {
    content: ''; position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 180px; height: 180px;
    background: rgba(255,255,255,0); /* Transparent but clickable */
    border-radius: 50%;
}
#jegi-object.fever {
    filter: drop-shadow(0 0 15px #ff4757) drop-shadow(0 0 30px #ffa502);
    animation: jegi-vibrate 0.1s infinite;
}
#jegi-object.god-mode {
    filter: drop-shadow(0 0 20px #70a1ff) drop-shadow(0 0 40px #1e90ff);
    animation: god-glow 1s infinite alternate, jegi-vibrate 0.05s infinite;
}
@keyframes god-glow {
    from { filter: drop-shadow(0 0 20px #70a1ff) hue-rotate(0deg); }
    to { filter: drop-shadow(0 0 40px #ff4757) hue-rotate(360deg); }
}
@keyframes jegi-vibrate {
    0% { transform: translate(0,0); }
    25% { transform: translate(2px, 2px); }
    50% { transform: translate(-2px, -2px); }
    75% { transform: translate(2px, -2px); }
    100% { transform: translate(0,0); }
}
.kick-spark {
    position: absolute; width: 100px; height: 100px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    pointer-events: none; z-index: 90;
    animation: spark-out 0.3s forwards;
}
@keyframes spark-out {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}
.jegi-ground {
    position: absolute; bottom: 0; width: 100%; height: 20px;
    background: #8b4513;
}
.jegi-controls { text-align: center; margin-top: 20px; color: #fff; font-size: 1.2rem; }
.score-display { font-weight: 800; color: var(--gold); }

.game-soul-points-mini {
    position: absolute; top: 30px; right: 30px;
    background: rgba(0,0,0,0.5); border: 1px solid var(--gold);
    padding: 8px 15px; border-radius: 15px;
    font-weight: 800; color: white; display: flex; align-items: center; gap: 8px;
    backdrop-filter: blur(10px); z-index: 1001;
    box-shadow: 0 5px 15px rgba(241, 196, 15, 0.2);
}
.game-soul-points-mini .points { color: var(--gold); text-shadow: 0 0 5px var(--gold); }

/* Centering and preventing overlap for Jegi, Tuho, and Kite headers */
#jegi-screen .game-header, #tuho-screen .game-header, #kite-screen .game-header {
    display: grid;
    grid-template-columns: 110px 1fr 110px;
    align-items: center;
    padding: 20px;
    width: 100%;
}

#jegi-screen .game-header .back-btn, #tuho-screen .game-header .back-btn, #kite-screen .game-header .back-btn,
#jegi-screen .game-header .game-soul-points-mini, #tuho-screen .game-header .game-soul-points-mini, #kite-screen .game-header .game-soul-points-mini {
    position: static;
    margin: 0;
    white-space: nowrap;
}

#jegi-screen .game-header .game-soul-points-mini, #tuho-screen .game-header .game-soul-points-mini, #kite-screen .game-header .game-soul-points-mini {
    justify-self: end;
}

#jegi-screen .game-header h2, #tuho-screen .game-header h2, #kite-screen .game-header h2 {
    text-align: center;
    margin: 0;
    font-size: 1.5rem;
}

#jegi-screen .game-header .score-display, #tuho-screen .game-header .score-display, #kite-screen .game-header .score-display {
    grid-column: 1 / span 3;
    text-align: center;
    margin-top: 10px;
}

/* Tuho Shooting Game Styles */
#tuho-game-area {
    width: 100%; height: 75vh; background: linear-gradient(to bottom, #dff9fb, #c7ecee);
    position: relative; overflow: hidden; margin-top: 20px;
    border-radius: 30px; border: 4px solid #4a3c31;
    background-image: url('joseon_military_exam_bg_1777423145286.png'); background-size: cover; background-position: center;
}
#tuho-pot {
    position: absolute; bottom: 120px; right: 15%;
    width: 60px; height: 120px; z-index: 5;
}
.pot-body {
    width: 100%; height: 100%; background: #4a3c31;
    border-radius: 10px 10px 50% 50%;
    box-shadow: inset -10px 0 20px rgba(0,0,0,0.5);
}
.pot-top {
    position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
    width: 110%; height: 30px; background: #5d4037;
    border-radius: 50%; border: 4px solid #3d2b1f;
}
#tuho-bow-system {
    position: absolute; bottom: 100px; left: 10%;
    width: 100px; height: 200px; z-index: 10;
    cursor: grab;
}
#tuho-drag-indicator {
    position: absolute; left: -80px; top: 50%; transform: translateY(-50%);
    color: white; font-weight: 800; font-size: 0.9rem;
    opacity: 0.6; animation: pulse 1.5s infinite;
    background: rgba(0,0,0,0.3); padding: 5px 12px; border-radius: 15px;
    pointer-events: none; white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.2);
}
#bow-svg { width: 100%; height: 100%; overflow: visible; }
#tuho-arrow-unit {
    position: absolute; top: 100px; left: 40px;
    width: 120px; height: 10px; transform-origin: left center;
    display: flex; align-items: center; pointer-events: none;
    z-index: 11;
}
.arrow-shaft { flex: 1; height: 4px; background: #5d4037; border-radius: 2px; }
.arrow-head { width: 15px; height: 10px; background: #2f3640; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.arrow-feather { 
    width: 20px; height: 10px; background: #3d2b1f; /* Dark wood/feather color */
    opacity: 0.6; clip-path: polygon(0 0, 100% 0, 80% 50%, 100% 100%, 0 100%); 
}

.arrow-flying-unit {
    position: absolute; width: 120px; height: 10px; z-index: 8; pointer-events: none;
    display: flex; align-items: center; transform-origin: left center;
}
.arrow-flying-unit .arrow-shaft { height: 3px; }
.arrow-flying-unit .arrow-head { width: 10px; height: 7px; }
.arrow-flying-unit .arrow-feather { width: 20px; height: 10px; }

/* Fire Arrow & Golden Mode */
.fire-arrow .arrow-shaft { background: #e67e22 !important; box-shadow: 0 0 10px #e67e22; }
.fire-arrow .arrow-head { background: #e74c3c !important; box-shadow: 0 0 15px #e74c3c; }
.fire-arrow::after {
    content: ''; position: absolute; left: -20px; top: -5px;
    width: 40px; height: 20px;
    background: radial-gradient(circle, #f1c40f, #e67e22, transparent);
    filter: blur(5px); opacity: 0.8; animation: flame 0.2s infinite alternate;
}

@keyframes flame {
    from { transform: scale(1) translateX(0); opacity: 0.6; }
    to { transform: scale(1.2) translateX(-5px); opacity: 0.9; }
}

.golden-bow-mode #bow-frame {
    stroke: #f1c40f !important; stroke-width: 12 !important;
    filter: drop-shadow(0 0 15px #f1c40f) !important;
}
.golden-bow-mode #bow-string { stroke: #fff !important; stroke-width: 3 !important; }

#tuho-streak-badge {
    position: absolute; top: 120px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.7); color: var(--gold);
    padding: 8px 25px; border-radius: 25px; border: 2px solid var(--gold);
    font-weight: 800; font-size: 1.5rem; display: none; z-index: 100;
    backdrop-filter: blur(5px); box-shadow: 0 0 20px rgba(241, 196, 15, 0.3);
}

/* Sky Kite Styles */
#kite-game-area {
    width: 100%; height: 75vh; background: #87ceeb;
    background-image: url('sky_kite_bg_1777426103907.png');
    background-size: cover; background-position: center;
    position: relative; overflow: hidden; margin-top: 20px;
    border-radius: 30px; border: 4px solid #fff;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.1);
    display: flex; align-items: center; justify-content: center;
    perspective: 1000px;
}
.kite-input-zone {
    /* Styles now handled in index.html for ripple filter integration */
}
.kite-btn-area {
    position: absolute; bottom: 30px; left: 50%;
    transform: translateX(-50%); z-index: 101;
}
#kite-unit { display: none; }

#kite-wind-zone {
    position: absolute; top: 30%; left: 0; width: 100%; height: 20%;
    background: rgba(255, 255, 255, 0.1);
    border-top: 2px dashed rgba(255,255,255,0.5);
    border-bottom: 2px dashed rgba(255,255,255,0.5);
    backdrop-filter: blur(2px); z-index: 5;
}
#kite-instruction {
    position: absolute; bottom: 50px; width: 100%; text-align: center;
    color: white; font-weight: 800; text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    font-size: 1.5rem; animation: pulse 1.5s infinite;
    z-index: 20;
}

/* Wind Particles */
.wind-particle {
    position: absolute;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    pointer-events: none;
    z-index: 2;
}
@keyframes wind-move {
    from { transform: translateX(-100px); opacity: 0; }
    20% { opacity: 0.6; }
    80% { opacity: 0.6; }
    to { transform: translateX(calc(100vw + 100px)); opacity: 0; }
}
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}
#tuho-trajectory {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 2;
}

/* Global Game Notification */
#game-notification {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9); border: 2px solid var(--gold);
    color: white; padding: 30px 60px; border-radius: 25px;
    z-index: 5000; backdrop-filter: blur(20px);
    box-shadow: 0 0 50px rgba(0,0,0,0.6), 0 0 30px rgba(241,196,15,0.4);
    text-align: center; pointer-events: none;
    transition: opacity 0.5s, transform 0.5s, visibility 0.5s;
    display: flex; flex-direction: column; align-items: center; gap: 15px;
    visibility: visible; opacity: 1;
}
#game-notification.hidden { 
    opacity: 0; transform: translate(-50%, -70%); visibility: hidden;
}
#game-notification .noti-content { display: flex; flex-direction: column; align-items: center; gap: 10px; }
#noti-icon { font-size: 2.5rem; }
#noti-message { font-size: 1.2rem; font-weight: 700; margin: 0; line-height: 1.5; }
.trajectory-dot {
    position: absolute; width: 4px; height: 4px; background: rgba(255,255,255,0.5);
    border-radius: 50%;
}
.tuho-controls { text-align: center; margin-top: 20px; color: #fff; }
#tuho-guide { font-size: 1.1rem; opacity: 0.8; font-family: 'Noto Serif KR', serif; }

.pot-hit {
    animation: pot-shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
    filter: drop-shadow(0 0 15px rgba(241, 196, 15, 0.6));
}
@keyframes pot-shake {
    10%, 90% { transform: translate3d(-1px, 0, 0) rotate(-1deg); }
    20%, 80% { transform: translate3d(2px, 0, 0) rotate(2deg); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0) rotate(-4deg) scale(1.05); }
    40%, 60% { transform: translate3d(4px, 0, 0) rotate(4deg) scale(1.05); }
}
/* Custom Premium Modal */
#custom-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(15px);
    z-index: 10000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
#custom-modal.active { opacity: 1; visibility: visible; }
.modal-content {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 40px; border-radius: 30px; text-align: center;
    max-width: 450px; width: 90%; border: 1px solid rgba(255,255,255,0.1);
    transform: translateY(30px) scale(0.9); transition: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#custom-modal.active .modal-content { transform: translateY(0) scale(1); box-shadow: var(--premium-glow); }
.modal-icon { font-size: 4rem; margin-bottom: 20px; display: block; }
.modal-title { font-size: 1.8rem; font-weight: 800; color: var(--gold); margin-bottom: 15px; }
.modal-text { font-size: 1.1rem; opacity: 0.8; line-height: 1.6; margin-bottom: 30px; }
.modal-btn { 
    background: white; color: black; border: none; padding: 12px 40px; 
    border-radius: 20px; font-weight: 800; cursor: pointer; transition: 0.3s;
}
.modal-btn:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(255,255,255,0.2); }

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    width: 100%;
}

#modal-cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
