:root {
    --bg-darker: #0c0d0e;
    --bg-panel: #141517;
    --bg-card: #1c1e21;
    --bg-inner: #0a0b0c;
    --accent-blue: #3b82f6;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --text-primary: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #2d2f33;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background-color: #000; color: var(--text-primary); height: 100vh; overflow: hidden; }

#app-container { display: flex; width: 100vw; height: 100vh; }

/* Sidebar Base */
.sidebar {
    width: 360px;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

#right-sidebar { border-right: none; border-left: 1px solid var(--border-color); }

.section-title { font-family: 'Outfit', sans-serif; font-size: 16px; margin-bottom: 12px; color: #fff; text-align: center; }

/* Status Cards & Resources */
.status-card {
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border: 1px solid #25282b;
}
.status-card.highlight { border: 1px solid var(--accent-green); box-shadow: 0 0 10px rgba(16, 185, 129, 0.1); }
.status-card .label { font-size: 14px; color: var(--text-muted); }
.status-card .value { font-size: 16px; font-weight: 700; }

.resource-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}
.res-row { 
    display: grid;
    grid-template-columns: 28px 1fr 80px;
    align-items: center;
    gap: 15px;
    font-size: 14px; 
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    width: 100%;
}
.res-row:hover {
    background: rgba(255, 255, 255, 0.02);
}
.res-row span:last-of-type {
    text-align: right;
    font-weight: bold;
    color: var(--accent-blue);
}

/* Unit Detail Box */
.unit-stats-grid {
    display: grid;
    grid-template-columns: 80px 1fr 100px;
    gap: 12px;
    width: 100%;
}
.dark-box { background: var(--bg-inner); border: 1px solid var(--border-color); padding: 12px; border-radius: 8px; min-height: 100px; }

.unit-name-col #detail-grade { font-size: 10px; color: var(--text-muted); }
.unit-name-col #detail-name { font-size: 14px; line-height: 1.2; margin-top: 4px; }

.stat-row { font-size: 11px; margin-bottom: 4px; color: var(--text-muted); }
.stat-row.dps { color: var(--accent-gold); font-weight: 800; font-size: 13px; }
.stat-row .bonus { color: var(--accent-green); }

.combine-btn {
    margin-top: 8px;
    width: 100%;
    padding: 6px;
    background: #7c2d12;
    border: 1px solid #9a3412;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.2s;
    background: linear-gradient(to bottom, #7e22ce, #6b21a8);
    border-color: #a855f7;
}
.combine-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}
.combine-btn:active { transform: translateY(0); }

.hidden { display: none !important; }

/* Tabs */
.action-tabs { display: flex; gap: 4px; background: #000; padding: 4px; border-radius: 6px; }
.tab-btn { flex: 1; background: transparent; border: none; color: var(--text-muted); padding: 10px 0; font-size: 13px; cursor: pointer; border-radius: 4px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tab-btn.active { background: var(--bg-card); color: var(--accent-gold); border: 1px solid var(--border-color); }

.tab-pane { display: none; padding-top: 16px; }
.tab-pane.active { display: block; }

/* Shop Buttons */
.button-list { display: flex; flex-direction: column; gap: 8px; }
.speed-controls {
    display: flex;
    gap: 8px;
}
.speed-btn {
    background: #25282c;
    border: 1px solid #3e4145;
    color: #a0a0a0;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 50px;
}
.speed-btn:hover { background: #323539; color: #fff; }
.speed-btn.active {
    background: #3498db;
    border-color: #5dade2;
    color: #fff;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.4);
}
.speed-btn.paused {
    background: #e74c3c;
    border-color: #ff7675;
    color: #fff;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.4);
}
/* ?덈뱺 ?몄뭅?댄꽣: ?붾㈃ ?몄씠利??④낵 */
@keyframes noise {
    0% { transform: translate(0, 0); }
    10% { transform: translate(-1px, -1px); }
    20% { transform: translate(-2px, 2px); }
    30% { transform: translate(1px, -2px); }
    40% { transform: translate(-1px, 2px); }
    50% { transform: translate(-2px, -1px); }
    60% { transform: translate(2px, 1px); }
    70% { transform: translate(1px, 1px); }
    80% { transform: translate(-1px, -2px); }
    90% { transform: translate(2px, -1px); }
    100% { transform: translate(0, 0); }
}

.screen-noise::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 0, 0, 0.03);
    pointer-events: none;
    z-index: 9999;
    animation: noise 0.2s infinite;
}

.screen-noise {
    animation: noise 0.1s infinite;
}

.shop-btn {
    width: 100%;
    background: #1e2124;
    border: 1px solid #333;
    padding: 14px;
    border-radius: 8px;
    cursor: pointer;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
    position: relative;
    overflow: hidden;
}
.shop-btn:hover { background: #2a2d31; }
.shop-btn::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #333; transition: all 0.3s ease; }
.shop-btn.unlocked::before { background: var(--accent-blue); }
.shop-btn.rare.unlocked::before { background: #3498db; box-shadow: 0 0 10px rgba(52, 152, 219, 0.5); }
.shop-btn.epic.unlocked::before { background: #a855f7; box-shadow: 0 0 10px rgba(168, 85, 247, 0.5); }
.shop-btn.mythic-btn.unlocked::before { background: #ff00ff; box-shadow: 0 0 10px rgba(255, 0, 255, 0.5); }
.shop-btn.legendary-btn.unlocked::before { background: #f59e0b; box-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
.shop-btn.sell { opacity: 0.6; }
.shop-btn:disabled { cursor: not-allowed; pointer-events: auto !important; }

.shop-desc { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 12px; padding: 0 10px; }

/* Dispatch Management (v2) */
.work-item-v2 {
    background: #1a1c1e;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}
.work-row-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.work-name {
    font-size: 13px;
    font-weight: 600;
    min-width: 80px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.work-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
.work-mul {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
}
.work-percent {
    color: #2ecc71;
    font-size: 11px;
    flex-grow: 1;
}
.work-ctrl-v2 {
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #3498db;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: background 0.2s;
}
.btn-circle:hover { background: #2980b9; }
.btn-circle.minus { background: #2980b9; }

.work-progress-bar {
    width: 100%;
    height: 6px;
    background: #000;
    border-radius: 3px;
    overflow: hidden;
}
.work-progress-bar .fill {
    height: 100%;
    width: 0%;
    background: #2ecc71;
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.5);
    transition: width 0.1s linear;
}

.wait-count {
    text-align: center;
    margin-top: 15px;
    color: #888;
    font-size: 13px;
}

/* Upgrade Section on Training Tab */
.upgrade-list { display: flex; flex-direction: column; gap: 8px; }
.upgrade-btn {
    background: #1e2124;
    border: 1px solid #2d2f33;
    padding: 16px;
    border-radius: 8px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    gap: 12px;
}
.up-info { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.up-name { font-size: 15px; font-weight: 700; }
.up-dpm { font-size: 11px; color: var(--text-muted); }
.up-effect { font-size: 14px; color: var(--accent-gold); font-weight: bold; }
.up-cost { font-size: 11px; color: var(--text-muted); white-space: nowrap; }


/* Notification Banner & Grade Visuals (Premium Design) */
#notification-banner {
    position: absolute;
    top: 45%; /* ?댁쭩 ?꾩そ?쇰줈 諛곗튂?섏뿬 以묒븰????媛由?*/
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 11, 12, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 40px;
    border-radius: 12px;
    backdrop-filter: blur(20px) saturate(180%);
    z-index: 2000;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 320px;
}

#notification-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 12px;
    padding: 2px; 
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

#notification-banner.common { box-shadow: 0 0 30px rgba(255, 255, 255, 0.1); }
#notification-banner.uncommon { box-shadow: 0 0 40px rgba(16, 185, 129, 0.2); }
#notification-banner.uncommon::before { background: linear-gradient(135deg, #10b981, rgba(16, 185, 129, 0.1)); }

#notification-banner.rare { box-shadow: 0 0 50px rgba(59, 130, 246, 0.3); }
#notification-banner.rare::before { background: linear-gradient(135deg, #3b82f6, rgba(59, 130, 246, 0.1)); }

#notification-banner.epic { box-shadow: 0 0 60px rgba(168, 85, 247, 0.4); }
#notification-banner.epic::before { background: linear-gradient(135deg, #a855f7, rgba(168, 85, 247, 0.1)); }

#notification-banner.special { border-style: none; }
#notification-banner.special::before { background: linear-gradient(135deg, #fbbf24, #f59e0b); }

#notification-banner.legendary { box-shadow: 0 0 80px rgba(255, 0, 255, 0.5); }
#notification-banner.legendary::before { background: linear-gradient(135deg, #ff00ff, #7e22ce); }

#notification-banner.mythic { box-shadow: 0 0 100px rgba(245, 158, 11, 0.6); animation: dopamine-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), shake 0.5s infinite; }
#notification-banner.mythic::before { background: linear-gradient(135deg, #f59e0b, #ea580c); }

#notification-banner.hidden-grade { border-width: 0; animation: pulse-red 1s infinite, shake 0.5s infinite; }
#notification-banner.hidden-grade::before { background: linear-gradient(135deg, #ef4444, #7f1d1d); }

/* ?덈궡 ?꾩슜 ?ㅽ???(?묒? ?ш린) */
#notification-banner.info {
    border-color: var(--accent-blue);
    padding: 12px 24px;
    animation: none;
}
#notification-banner.failure {
    border-color: #ff4d4d;
    background: rgba(40, 0, 0, 0.9);
    padding: 12px 24px;
    animation: shake 0.3s;
}
#notification-banner.failure h4 { color: #ff4d4d; }
#notification-banner.info h4 { font-size: 13px; letter-spacing: 1px; margin-bottom: 2px; color: var(--accent-blue); }
#notification-banner.info p { font-size: 15px; font-weight: 500; margin: 0; text-shadow: none; }
#notification-banner.info .prob-tag { display: none; }

@keyframes pulse-red {
    0% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 30px rgba(239, 68, 68, 0.8); }
    100% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
}

#notification-banner.hidden { display: none; }
#notification-banner.grade-banner {
    animation: dopamine-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#notification-banner h4 { 
    font-size: 14px; 
    margin-bottom: 4px; 
    color: var(--text-muted); 
    letter-spacing: 6px;
    text-transform: uppercase;
    font-weight: 400;
}
#notification-banner p { 
    font-size: 34px; 
    font-weight: 800; 
    color: #fff; 
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    margin: 4px 0;
    font-family: 'Outfit', sans-serif;
}
#notification-banner .prob-tag { 
    display: block;
    font-size: 16px; 
    color: var(--accent-gold);
    font-weight: 600;
    margin-top: 15px;
    letter-spacing: 1px;
    background: rgba(245, 158, 11, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ?꾪뙆誘??좊컻 ?좊땲硫붿씠??*/
@keyframes dopamine-pop {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes modal-pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

#notification-banner.legendary, #notification-banner.mythic, #notification-banner.hidden-grade {
    animation: dopamine-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), shake 0.5s infinite;
}

@keyframes shake {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-51%, -49%) rotate(1deg); }
    50% { transform: translate(-49%, -51%) rotate(-1deg); }
    75% { transform: translate(-51%, -51%) rotate(1deg); }
    100% { transform: translate(-50%, -50%) rotate(0deg); }
}

/* Main Area */
#game-main { flex: 1; position: relative; background: #000; display: flex; align-items: center; justify-content: center; }
.canvas-container { width: 100%; height: 100%; position: relative; }
#game-canvas { width: 100%; height: 100%; display: block; }

/* Tech Level Box */
.tech-level-box {
    background: var(--bg-card);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-left: 4px solid #333; /* 湲곕낯媛?*/
    transition: all 0.5s ease;
}
.tech-level-box.primitive { border-left-color: #666; }
.tech-level-box.industrial { border-left-color: #3b82f6; box-shadow: 0 0 15px rgba(59, 130, 246, 0.2); }
.tech-level-box.advanced { border-left-color: #a855f7; box-shadow: 0 0 15px rgba(168, 85, 247, 0.2); }
.tech-level-box.spacer { border-left-color: #ff00ff; box-shadow: 0 0 15px rgba(255, 0, 255, 0.2); }
.tech-level-box.ultra { border-left-color: #f59e0b; box-shadow: 0 0 20px rgba(245, 158, 11, 0.3); }
.tech-info { display: flex; flex-direction: column; }
.tech-info .label { font-size: 13px; color: var(--text-muted); }
.tech-info .value { font-size: 15px; font-weight: 700; margin-top: 4px; }
.tech-up-btn {
    background: #1e2124;
    border: 1px solid #333;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
}

/* Craft Buttons */
.shop-btn.craft {
    background: rgba(30, 33, 36, 0.4);
}
.shop-btn.mythic::before { background: #ff00ff; }
.craft-list { gap: 10px; }
.shop-btn.craft .text { font-size: 13px; font-weight: 600; }

.res-mini-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: transform 0.2s;
}
.res-row:hover .res-mini-icon {
    transform: scale(1.1);
}

.inline-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
    vertical-align: sub;
    margin: 0 2px;
}

/* Mini Notifications (RimWorld Style, 5 o'clock) */
#mini-notif-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    z-index: 500;
    pointer-events: none;
}

.mini-notif {
    background: rgba(0, 0, 0, 0.65);
    color: #eee;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    border-right: 3px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    animation: mini-pop 2s forwards;
    white-space: nowrap;
}

.upgrade-list .divider {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 11px;
    color: var(--accent-gold);
    border-bottom: 1px solid rgba(245, 158, 11, 0.3);
    padding: 10px 0 5px 0;
    margin-bottom: 5px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(245, 158, 11, 0.3);
}

.upgrade-btn.prod-up {
    border-left: 3px solid #4ade80; /* ?앹궛? 珥덈줉??怨꾩뿴濡?媛뺤“ */
}

.upgrade-btn.prod-up .up-desc {
    display: block;
    font-size: 10px;
    color: #ccc;
    margin-top: 2px;
}

.mini-notif.jackpot { border-right-color: var(--accent-gold); color: #fff; font-weight: bold; background: rgba(245, 158, 11, 0.2); }
.mini-notif.failure { border-right-color: var(--accent-red); color: #ffbcbc; background: rgba(239, 68, 68, 0.2); }

.up-lv {
    font-size: 11px;
    color: var(--accent-gold);
    margin-left: 5px;
    font-weight: bold;
}

.max-lv {
    color: #ffd700;
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.buff-text {
    color: #00f2ff !important;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 242, 255, 0.5);
}

@keyframes mini-pop {
    0% { opacity: 0; transform: translateX(20px); }
    15% { opacity: 1; transform: translateX(0); }
    70% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}

/* Mood Bar */
.mood-bar-container {
    width: 160px; /* 60px?먯꽌 160px濡?????뺤옣 */
    height: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 10px;
}

.mood-bar-fill {
    height: 100%;
    width: 60%;
    background: linear-gradient(90deg, #4ade80, #22c55e);
    transition: width 0.3s ease, background 0.3s ease;
}

.mood-val-text {
    font-size: 11px;
    font-weight: bold;
    min-width: 35px;
    text-align: right;
}

/* 臾대뱶 ?곹깭 ?됱긽 */
.mood-broken { background: #ef4444 !important; } /* ?뺤떊 ?댁긽 */
.mood-bad { background: #f97316 !important; }    /* ?섏겏 */
.mood-neutral { background: #eab308 !important; } /* 蹂댄넻 */
.mood-good { background: #22c55e !important; }    /* 醫뗭쓬 */
.mood-high { background: #3b82f6 !important; }    /* 留ㅼ슦 醫뗭쓬 */
 
/* ?쎌큹 ?먯썝 移대뱶 ?ㅽ???*/
.herbal-card {
    border-left: 3px solid var(--accent-green);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, transparent 100%);
    margin-top: 5px;
}
.herbal-card .label {
    color: var(--accent-green);
    font-weight: bold;
}
.status-card.clickable {
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.status-card.clickable.disabled {
    cursor: not-allowed;
    opacity: 0.3;
    filter: grayscale(1);
    border-color: #333 !important;
}
.status-card.clickable:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-green);
    transform: translateX(5px);
}
.status-card.clickable:active {
    transform: translateX(2px) scale(0.98);
}
.status-card.clickable::after {
    content: 'CLICK TO USE';
    position: absolute;
    right: 10px;
    bottom: 2px;
    font-size: 8px;
    color: var(--accent-green);
    opacity: 0;
    transition: opacity 0.2s;
}
.status-card.clickable:hover::after {
    opacity: 0.7;
}

/* 2??諛곗튂 ?덉씠?꾩썐 */
.status-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.status-row .status-card {
    flex: 1;
    margin-bottom: 0;
    padding: 10px 8px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    text-align: center;
    min-width: 0;
}
.status-row .status-card .label {
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.status-row .status-card .value {
    font-size: 14px;
}
.status-row .status-card.clickable::after {
    display: none; /* 醫곸? 怨듦컙?먯꽌??臾멸뎄 ?④? */
}

.financial-card {
    border-left: 3px solid var(--accent-gold);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
}
.financial-card .label {
    color: var(--accent-gold);
    font-weight: bold;
}
.financial-card:hover {
    background: rgba(245, 158, 11, 0.15) !important;
    border-color: var(--accent-gold) !important;
}

/* Encounter Modal (RimWorld Style Popup) */
#encounter-modal {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: #1e2124;
    border: 2px solid #555;
    padding: 30px;
    border-radius: 4px; /* 由쇱썡?쒖뒪?ъ슫 媛곸쭊 ?붿옄??*/
    width: 450px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 0 40px rgba(0,0,0,1);
    animation: modal-pop 0.2s ease-out;
}
.modal-content h2 { margin-bottom: 15px; font-size: 22px; color: var(--accent-gold); letter-spacing: 2px; }
.modal-content p { font-size: 16px; margin-bottom: 25px; line-height: 1.6; color: #ccc; }
#event-modal-close-btn, .modal-choice-btn {
    background: #2d2f33;
    border: 1px solid #555;
    color: #fff;
    padding: 8px 30px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    font-weight: bold;
    border-radius: 4px;
}
#event-modal-close-btn:hover, .modal-choice-btn:hover { 
    background: #3d4044; 
    border-color: #888; 
    transform: scale(1.05);
}

.modal-choice-btn.accept { background: linear-gradient(135deg, #ef4444, #991b1b); border-color: #ef4444; }
.modal-choice-btn.reject { background: linear-gradient(135deg, #475569, #1e293b); border-color: #64748b; }

#event-modal-choice-btns {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

/* Active Events (On Map Bottom Left) */
.map-event-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.event-tag {
    background: rgba(15, 16, 18, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 5px solid #ef4444;
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(12px);
    pointer-events: auto;
    cursor: help;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    transition: background 0.2s;
}

.event-tag:hover {
    background: rgba(25, 26, 28, 1);
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes event-slide-in {
    from { transform: translateX(-30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.event-pulse {
    font-size: 10px;
    margin-right: 2px;
    animation: event-blink 1.2s infinite;
}

@keyframes event-blink {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.event-tag .time { 
    font-weight: 800; 
    font-family: 'Courier New', monospace;
    font-size: 13px;
}
/* Special Items UI (Left Sidebar) */
.item-section {
    margin-bottom: 25px;
}
.item-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}
.item-card.clickable:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateX(8px);
    box-shadow: -5px 0 15px rgba(59, 130, 246, 0.2);
}
.item-card.clickable:active { transform: translateX(4px) scale(0.98); }

/* ?뱀닔 ?꾩씠?? 沅ㅻ룄 ??꺽 ?꾩슜 ?ㅽ???*/
#btn-item-orbital {
    border-left: 3px solid #3b82f6;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), transparent);
}
#btn-item-orbital .item-icon {
    filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.6));
}

.item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.item-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    transition: all 0.3s;
}
.item-card:hover .item-icon {
    transform: rotate(-5deg) scale(1.1);
}
.item-card .label {
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #eee;
    letter-spacing: 0.5px;
}
.item-count {
    background: rgba(255, 255, 255, 0.15);
    color: #aaa;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
}
.item-card:hover .item-count {
    background: var(--accent-gold);
    color: #000;
}

.item-card.empty { opacity: 0.5; filter: grayscale(1); }
.item-card.on-cooldown, .status-card.on-cooldown {
    position: relative;
    overflow: hidden;
    pointer-events: auto !important; /* ?댄똻??蹂대젮硫?auto?ъ빞 ??*/
}
.item-card.on-cooldown::before, .status-card.on-cooldown::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%;
    height: var(--cd-percent, 0%);
    background: rgba(0, 0, 0, 0.6);
    z-index: 5;
    pointer-events: none;
}
.item-card.on-cooldown::after, .status-card.on-cooldown::after {
    content: "?湲?;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: #ff3e3e;
    font-weight: bold;
    z-index: 6;
    text-shadow: 0 0 3px #000;
}

/* ==========================================
   [New] 而ㅼ뒪? ?댄똻 ?ㅽ???   ========================================== */
.custom-tooltip {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    background: rgba(10, 12, 14, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 20px 24px; /* ?⑤뵫 利앷?濡??몃줈???뺣낫 */
    min-width: 240px;
    max-width: 320px; /* ?덈퉬 ?쒗븳?쇰줈 ?띿뒪??以꾨컮轅??좊룄 */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 215, 0, 0.05);
    backdrop-filter: blur(20px);
    transition: opacity 0.15s ease;
    line-height: 1.5;
}

.custom-tooltip.hidden {
    display: none;
    opacity: 0;
}

.tooltip-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #e2e2e2;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
    letter-spacing: 0.5px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    margin: 4px 0;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.res-name {
    margin-right: 15px;
}

.res-val {
    font-weight: bold;
}

.tooltip-footer {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 6px;
}

/* ==========================================
   [New] ?먯썝 ?꾨컯 ?ㅽ???   ========================================== */
.gamble-group {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.gamble-title {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
    text-align: center;
}

.gamble-btn {
    background: rgba(40, 40, 40, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
}

.gamble-btn:hover {
    transform: translateY(-2px);
    background: rgba(60, 60, 60, 0.8) !important;
}

.gamble-btn.wood { border-color: rgba(139, 69, 19, 0.5) !important; }
.gamble-btn.steel { border-color: rgba(169, 169, 169, 0.5) !important; }
.gamble-btn.silver { border-color: rgba(255, 215, 0, 0.4) !important; }

.gamble-btn:active {
    animation: gamble-shake 0.1s infinite;
}

@keyframes gamble-shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 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(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

/* ==========================================
   [New] ?뺤갑誘??뚭껄 ?湲??뚮┝ (源쒕묀???④낵)
   ========================================== */
.idle-alert {
    display: inline-flex;
    align-items: center;
    background: #ff4d4d;
    color: white;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: 12px;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(255, 77, 77, 0.6);
    animation: alert-blink 0.6s infinite alternate;
    vertical-align: middle;
    letter-spacing: -0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.idle-alert::before {
    content: '燧?;
    margin-right: 6px;
    font-size: 13px;
    display: inline-block;
    animation: arrow-move 0.4s infinite alternate;
}

@keyframes alert-blink {
    from { 
        background: #cc0000; 
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.4);
    }
    to { 
        background: #ff3e3e; 
        box-shadow: 0 0 20px rgba(255, 62, 62, 0.8);
    }
}

@keyframes arrow-move {
    from { transform: translateX(0); }
    to { transform: translateX(-5px); }
}

.idle-alert.hidden {
    display: none !important;
}

/* [New] 以묒븰 ???移댁슫?몃떎???ㅻ쾭?덉씠 */
#wave-countdown-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.countdown-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
}

#countdown-next-info {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    color: var(--accent-cyan);
    font-weight: 700;
    text-shadow: 0 0 15px rgba(0, 242, 255, 0.6);
    margin-bottom: 5px;
}

#countdown-label {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: 0.8;
}

#countdown-number {
    font-family: 'Outfit', sans-serif;
    font-size: 8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    animation: countdown-pulse 1s infinite cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wave-countdown-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.8) !important;
}

@keyframes countdown-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; text-shadow: 0 0 40px rgba(255, 255, 255, 0.4); }
    100% { transform: scale(1); opacity: 1; }
}

/* 3珥??댄븯????湲댁옣媛?洹밸???(JS?먯꽌 ?대옒??異붽? ?덉젙) */
#wave-countdown-overlay.critical #countdown-number {
    color: var(--accent-red);
    animation: countdown-shake 0.1s infinite;
}

#wave-countdown-overlay.critical #countdown-label {
    color: var(--accent-red);
}

@keyframes countdown-shake {
    0% { transform: translate(-2px, -2px) scale(1.1); }
    50% { transform: translate(2px, 2px) scale(1.1); }
    100% { transform: translate(-2px, 2px) scale(1.1); }
}

/* Game Over Result Modal */
#result-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(12px) saturate(160%);
}
#result-modal.hidden { display: none !important; }

.result-content {
    background: #141517;
    border: 1px solid #2d2f33;
    padding: 40px;
    border-radius: 20px;
    width: 480px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 242, 255, 0.05);
    animation: modal-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-pop {
    from { opacity: 0; transform: scale(0.9) translateY(30px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.result-header h2 { font-family: 'Outfit', sans-serif; font-size: 34px; color: #ff5555; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 2px; }
.result-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.stat-item { display: flex; flex-direction: column; background: #0a0b0c; padding: 15px; border-radius: 12px; border: 1px solid #1c1e21; }
.stat-item.highlight { grid-column: span 2; border: 1px solid rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.03); }
.stat-item .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-item .value { font-family: 'Courier New', monospace; font-size: 20px; font-weight: 800; color: #fff; margin-top: 5px; }
.stat-item.highlight .value { color: var(--accent-gold); }

.result-resource-summary, .result-tower-summary { text-align: left; margin-bottom: 20px; padding: 15px; background: #0a0b0c; border-radius: 12px; border: 1px solid #1c1e21; }
.result-resource-summary h4, .result-tower-summary h4 { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; border-bottom: 1px solid #1c1e21; padding-bottom: 6px; text-transform: uppercase; }
#res-resource-list, #res-tower-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 80px; overflow-y: auto; }
.res-tag { font-size: 10px; background: #1c2128; padding: 4px 8px; border-radius: 4px; border: 1px solid #2d333b; color: #adbac7; }
.res-tower-tag { font-size: 10px; background: #1c1e21; padding: 4px 8px; border-radius: 4px; border: 1px solid #2d2f33; color: #eee; }

#result-restart-btn { 
    width: 100%; padding: 18px; 
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none; color: white; font-weight: 800; border-radius: 12px; 
    cursor: pointer; font-size: 16px; transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}


/* 2-Column Result Modal Layout */
#result-modal .result-content {
    width: 900px !important; 
    max-width: 95vw;
    max-height: 90vh; 
    overflow-y: auto;
}

.result-columns {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.res-col {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.nickname-controls {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

/* Modal Responsiveness */
@media (max-width: 600px) {
    .result-columns { grid-template-columns: 1fr; }
}

/* Leaderboard & Nickname Section */
.result-section {
    text-align: left; padding: 15px; 
    background: #0a0b0c; border-radius: 12px; border: 1px solid #1c1e21;
    max-height: 450px; overflow-y: auto; /* [New] 100위까지 표시할 수 있도록 스크롤 영역 확장 */
}
.result-section h4 { 
    font-size: 11px; color: var(--text-muted); margin-bottom: 10px; 
    border-bottom: 1px solid #1c1e21; padding-bottom: 6px; text-transform: uppercase; 
}
#res-nickname-input {
    flex: 1; background: #1c1e21; border: 1px solid #2d333b; color: #fff;
    padding: 10px; border-radius: 8px; outline: none; font-size: 14px;
}
#res-nickname-input:focus { border-color: var(--accent-blue); }
#res-submit-btn {
    padding: 10px 20px; background: var(--accent-blue); border: none;
    color: #fff; border-radius: 8px; cursor: pointer; font-weight: 700; transition: 0.2s;
    white-space: nowrap;
}
#res-submit-btn:hover { filter: brightness(1.2); }
#res-submit-btn:disabled { background: #444; cursor: not-allowed; }

#leaderboard-list { font-size: 13px; color: #eee; }
.leaderboard-table { width: 100%; border-collapse: collapse; margin-top: 5px; }
.leaderboard-table th { text-align: left; color: var(--text-muted); font-size: 10px; padding: 4px; border-bottom: 1px solid #1c1e21; }
.leaderboard-table td { padding: 6px 4px; border-bottom: 1px solid #0f1113; font-size: 12px; }
.rank-col { width: 30px; color: var(--accent-gold); font-weight: 800; }
.score-col { text-align: right; color: var(--accent-blue); font-weight: 700; }
.loading-msg { padding: 20px; text-align: center; color: var(--text-muted); font-style: italic; }

/* ==========================================
   [New] 설정 모달 (Settings Menu) 스타일
   ========================================== */
#settings-modal {
    position: fixed; 
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 15000; /* 모든 UI 위에 표시 */
    display: flex; 
    align-items: center; 
    justify-content: center;
    backdrop-filter: blur(8px);
}

.settings-content {
    background: #1e2124;
    border: 2px solid #555;
    padding: 30px;
    border-radius: 4px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    animation: modal-pop 0.2s ease-out;
}

.settings-title {
    font-size: 24px;
    color: var(--accent-gold);
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 2px;
}

.settings-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.settings-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
    text-transform: uppercase;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
}

.setting-row label {
    flex: 1;
    color: #eee;
}

.vol-val {
    min-width: 45px;
    text-align: right;
    font-family: 'Courier New', monospace;
    color: #3b82f6; 
}

/* 슬라이더 스타일 */
input[type=range] {
    flex: 1;
    margin: 0 15px;
    cursor: pointer;
}

/* [New] 배경 선택 버튼 스타일 */
.setting-row-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.bg-choice-btn {
    flex: 1;
    background: #2d2f33;
    border: 1px solid #555;
    color: #888;
    padding: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.2s;
}

.bg-choice-btn:hover {
    background: #3d4044;
    border-color: #888;
    color: #fff;
}

.bg-choice-btn.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.settings-actions {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

#settings-close-btn {
    background: #2d2f33;
    border: 1px solid #555;
    color: #fff;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
}

#settings-close-btn:hover {
    background: #3d4044;
    border-color: #888;
}

/* ==========================================
   Tutorial System Styles
   ========================================== */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 6000;
}

#tutorial-msg-box {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background: rgba(18, 22, 25, 0.9);
    border: 1px solid rgba(250, 189, 47, 0.4);
    border-left: 4px solid #fabd2f;
    color: #e2e8f0;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideInRight 0.4s ease-out;
    pointer-events: auto;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.tutorial-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.tutorial-icon {
    color: #fabd2f;
    font-size: 1.2rem;
}

.tutorial-title {
    font-weight: bold;
    font-size: 0.9rem;
    color: #fabd2f;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#tutorial-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

#tutorial-text b {
    color: #00f2ff;
    font-weight: 800;
}

.tutorial-footer {
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
}

#tutorial-highlight {
    position: absolute;
    border: 3px solid #fabd2f;
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 15px #fabd2f;
    pointer-events: none;
    z-index: 5999;
    transition: all 0.3s ease;
}

.highlight-pulse {
    animation: highlightPulse 1.5s infinite;
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 0px #fabd2f; }
    50% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 20px #fabd2f; }
    100% { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5), 0 0 0px #fabd2f; }
}
#tutorial-btn-area {
    margin-top: 15px;
    text-align: right;
}

#tutorial-next-btn {
    background: #fabd2f;
    border: none;
    color: #000;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

#tutorial-next-btn:hover {
    background: #ffd571;
}

/* ==========================================
   [New] 독립형 리더보드 모달 스타일
   ========================================== */
#leaderboard-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 20000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(15px) saturate(180%);
}
#leaderboard-modal.hidden { display: none !important; }

.lb-modal-content {
    background: #141517;
    border: 1px solid #2d2f33;
    padding: 35px;
    border-radius: 16px;
    width: 500px;
    max-width: 90vw;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9);
    animation: modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lb-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    color: var(--accent-gold);
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 1px;
}

#lb-list-main {
    max-height: 50vh;
    overflow-y: auto;
    background: #0a0b0c;
    border-radius: 8px;
    margin-bottom: 25px;
}

.lb-footer {
    display: flex;
    justify-content: center;
}

#lb-modal-close-btn {
    background: #2d2f33;
    border: 1px solid #555;
    color: #fff;
    padding: 12px 50px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 6px;
    transition: all 0.2s;
}

#lb-modal-close-btn:hover {
    background: #3d4044;
    border-color: #888;
    transform: translateY(-2px);
}

.secondary-btn {
    background: rgba(155, 89, 182, 0.2) !important;
    border: 1px solid rgba(155, 89, 182, 0.4) !important;
    color: #d7bde2 !important;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
}

.secondary-btn:hover {
    background: rgba(155, 89, 182, 0.4) !important;
    border-color: rgba(155, 89, 182, 0.8) !important;
}

.danger-btn {
    background: rgba(231, 76, 60, 0.2) !important;
    border: 1px solid rgba(231, 76, 60, 0.4) !important;
    color: #fadbd8 !important;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
}

.danger-btn:hover {
    background: rgba(231, 76, 60, 0.4) !important;
    border-color: rgba(231, 76, 60, 0.8) !important;
}
/* ==========================================
   리더보드 전용 커스텀 스크롤바 
   ========================================== */
#lb-list-main::-webkit-scrollbar {
    width: 6px;
}
#lb-list-main::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}
#lb-list-main::-webkit-scrollbar-thumb {
    background: #3b82f6; /* 메인 테마 파란색 */
    border-radius: 10px;
}
#lb-list-main::-webkit-scrollbar-thumb:hover {
    background: #60a5fa; /* 호버 시 더 밝은 파랑 */
}

/* ==========================================
   [New] 커스텀 확인 모달 (Confirm Modal)
   ========================================== */
#confirm-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 20000; /* 설정 모달(15000)보다 위에 표시 */
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

#confirm-modal .modal-content {
    border: 2px solid var(--accent-red);
    width: 380px;
}
