/* =========================================
   M.C.LAB v4 - Premium Collector Theme
   Concept: Clean, Modern, Character-Focused
   (Compatible with Nikke/Blue Archive Art Style)
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;900&family=Outfit:wght@400;600;700&display=swap');

:root {
    /* --- ì»¬ë¬ íë í¸ (Sensory Satisfaction Theme) --- */
    /* ë°°ê²½ - Deep Void (ê¹ì ì°ì£¼/ì¬ì°) */
    --bg-base: #050510;
    --bg-surface: rgba(5, 5, 16, 0.85);
    /* 85% í¬ëªë */
    --bg-glass: rgba(10, 10, 20, 0.6);
    /* ê¸ëì¤ í¨ë */
    --bg-overlay: rgba(0, 0, 0, 0.8);

    /* ì¡ì¼í¸ - Neon & Cyberpunk */
    --accent-primary: #00f3ff;
    /* Cyber Cyan: ë²í¼, íëë¦¬, ê°ì¡° */
    --accent-secondary: #e040fb;
    /* Neon Purple: ë§ë², ì ë¹ */
    --accent-tertiary: #76ff03;
    /* Acid Green: íë³µ, íë ¥ */

    --accent-danger: #e74c3c;
    /* Fatal Red: SSR, ê²½ê³ , ê³µê²© */
    --accent-gold: #f1c40f;
    /* Royal Gold: UR, íë¦¬ë¯¸ì */
    --accent-text: #ffffff;
    /* Pure White */

    /* íì¤í¸ & ê·¸ë¦¼ì */
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-glow-cyan: 0 0 10px rgba(0, 243, 255, 0.7);
    --text-glow-red: 0 0 10px rgba(231, 76, 60, 0.7);
    --text-glow-gold: 0 0 10px rgba(241, 196, 15, 0.7);

    /* UI í¨ê³¼ */
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --neon-border: 1px solid var(--accent-primary);
    --box-shadow-glow: 0 0 15px rgba(0, 243, 255, 0.3);

    /* ìì¤í */
    --radius-sm: 4px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --sidebar-width: 0px;
    /* ì¬ì´ëë° ì ê±° -> íë¨ ë */
    --header-height: 70px;

    /* ì ëë©ì´ì Key */
    --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   ê¸°ë³¸ ë¦¬ì & íì´í¬ê·¸ëí¼
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Noto Sans KR', 'Outfit', system-ui, sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif;
    font-weight: 700;
    color: var(--text-highlight);
    letter-spacing: -0.02em;
}

/* ì¤í¬ë¡¤ë° */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* =========================================
   NEW LAYOUT (Glassmorphism & Full Screen)
   ========================================= */
#app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    /* ì°ì£¼ ë°°ê²½ ê·¸ë¼ë°ì´ì */
    background: var(--bg-base);
    /* linear-gradient(180deg,
            #0a0e27 0%,
            #1a1f3a 50%,
            #0f1419 100%); */
}

/* 1. ë°°ê²½ (ìºë¦­í°/ìë) ë ì´ì´ */
#lobby-visual-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    /* main-area(10)ë³´ë¤ ìì íì */
    pointer-events: none;
    /* UI í´ë¦­ íµê³¼ */
    /* ë°°ê²½ ê·¸ë¼ë°ì´ì */
    background: radial-gradient(circle at 70% 50%, transparent 0%, rgba(5, 5, 16, 0.8) 70%);
    transition: transform 0.5s var(--ease-smooth);
}

#lobby-character-wrapper {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    /* íë©´ ì°ì¸¡ ì ë° */
    height: 100%;
    z-index: 100;
    /* ëª¨ë  UIë³´ë¤ ìì íì */
    pointer-events: none;
    /* UI í´ë¦­ íµê³¼ */
    transition: transform 0.3s ease-out;
    display: flex;
    justify-content: center;
    align-items: flex-end;
}

#lobby-character-img {
    width: auto;
    height: 90%;
    /* íë©´ ëì´ì 90% */
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.5));
    pointer-events: auto;
    /* ì´ë¯¸ì§ë§ í´ë¦­ ê°ë¥ */
    cursor: pointer;
    /* ì¨ì¬ê¸° ì ëë©ì´ì */
    animation: breathe 6s ease-in-out infinite;
}

/* 2. ë©ì¸ ì»¨íì¸  (Floating Glass Panel) */
#main-area {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100% - var(--header-height) - 80px);
    /* íë¨ ë ê³µê° íë³´ */
    z-index: 10;
    padding: 10px;
    /* padding ëí­ ì¶ì */
    display: flex;
    flex-direction: column;
    /* ì¸ë¡ ë°©í¥ ë ì´ìì */
    align-items: flex-start;
    /* ì¢ì¸¡ ì ë ¬ */
    justify-content: center;
    /* ì¸ë¡ ì¤ì ì ë ¬ */
    pointer-events: none;
    /* ë¹ ê³µê° í°ì¹ íµê³¼ */
}

/* ê³µíµ ê¸ëì¤ í¨ë ì¤íì¼ */
.glass-panel {
    background: var(--bg-card);
    /* í¬ëªë ì½ê° ì¦ê° */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    pointer-events: auto;
    /* í¨ë ë´ë¶ í°ì¹ ê°ë¥ */
    transition: all 0.2s var(--ease-smooth);
}

/* ë·°í¬í¸ (ì¤ì  ê²ì íë©´) */
#content-viewport {
    flex: 1;
    /* flex ì»¨íì´ë ë´ìì ë¨ì ê³µê° ì°¨ì§ */
    min-height: 0;
    /* flex ììì min-height ê¸°ë³¸ê° ë¬¸ì  í´ê²° */
    width: 100%;
    /* max-width ì ê±° - ì ì²´ íë©´ ì¬ì© */
    overflow-y: auto;
    /* ì¤í¬ë¡¤ë° ì¨ê¹ (ê¹ëíê²) */
    scrollbar-width: none;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    /* í´ë¦­/í°ì¹ ì´ë²¤í¸ íì±í */
}

#content-viewport::-webkit-scrollbar {
    display: none;
}

/* 3. íë¨ ë (Bottom Dock) - êµ¬ ì¬ì´ëë° ëì²´ */
#bottom-dock {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    height: 70px;
    z-index: 100;

    display: flex;
    /* Flexë¡ ë°°ì¹ */
    justify-content: space-around;
    align-items: center;
    background: var(--bg-glass);
    /* ë í¬ëªíê² */
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 0 20px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s var(--ease-elastic);
}

.nav-item .icon {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

.nav-item:hover {
    color: var(--text-primary);
    transform: translateY(-5px);
    text-shadow: 0 0 10px var(--accent-primary);
}

.nav-item.active {
    color: var(--accent-primary);
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

/* ì¨ê¹ ì²ë¦¬ */
#sidebar {
    display: none !important;
}

/* 4. ì ëë©ì´ì í¤íë ì */
@keyframes breathe {

    0%,
    100% {
        transform: scale(1) translateY(0);
    }

    50% {
        transform: scale(1.02) translateY(-5px);
    }
}

/* --- í¤ë (ìí ë°) --- */
#game-header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    background: var(--bg-surface);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

#user-info-area {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

#user-info-area>div:first-child {
    color: var(--accent-primary);
    font-size: 0.85rem;
}

.resource-bar {
    display: flex;
    gap: 16px;
}

.res-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid var(--border-subtle);
}

.res-icon {
    font-size: 1rem;
}

.res-value {
    font-weight: 700;
    font-family: 'Outfit', monospace;
    min-width: 50px;
}

.res-item:nth-child(1) .res-value {
    color: var(--accent-gold);
}

.res-item:nth-child(2) .res-value {
    color: var(--accent-primary);
}

.res-item:nth-child(3) .res-value {
    color: var(--accent-success);
}

/* --- ì½íì¸  ë·°í¬í¸ --- */
#content-viewport {
    flex: 1;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* =========================================
   ê³µì© ì»´í¬ëí¸
   ========================================= */
/* --- ê¸ëì¤ í¨ë --- */
.glass-panel {
    background: var(--bg-surface);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2,
.panel-header h3 {
    font-size: 1.1rem;
    color: var(--text-highlight);
}

/* --- ë²í¼ --- */
/* --- ë²í¼ (Neon Cyberpunk Style) --- */
.cyber-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 4px;
    /* Angled tech look */

    font-family: 'Orbitron', 'Noto Sans KR', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.5px;

    background: rgba(0, 243, 255, 0.05);
    /* Slight tint */
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);

    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    box-shadow: 0 0 5px rgba(0, 243, 255, 0.2), inset 0 0 10px rgba(0, 243, 255, 0.1);
}

/* Hover Effect: Glow & Fill */
.cyber-btn:hover {
    background: var(--accent-primary);
    color: #000;
    /* Contrast text */
    box-shadow: 0 0 20px var(--accent-primary);
    transform: translateY(-2px);
    text-shadow: none;
}

/* Active (Click) Effect: Scale Down */
.cyber-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 5px var(--accent-primary);
}

/* Premium / Action Variants */
.cyber-btn.action {
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.8), rgba(0, 150, 255, 0.8));
    color: #000;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 243, 255, 0.4);
}

.cyber-btn.action:hover {
    filter: brightness(1.2);
    box-shadow: 0 6px 25px rgba(0, 243, 255, 0.6);
}

.cyber-btn.danger {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
    background: rgba(231, 76, 60, 0.05);
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.2);
}

.cyber-btn.danger:hover {
    background: var(--accent-danger);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-danger);
}

.cyber-btn:disabled {
    opacity: 0.5;
    filter: grayscale(1);
    pointer-events: none;
}

/* Glint Animation Overlay */
.cyber-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    transition: 0.5s;
}

.cyber-btn:hover::before {
    left: 150%;
    transition: 0.5s ease-in-out;
}

/* --- ìë ¥ì°½ --- */
.cyber-input,
.cyber-select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.cyber-input:focus,
.cyber-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.15);
}

/* =========================================
   í¬ë¦¬ì² ì¹´ë (Character Card - Illustration Focused)
   ========================================= */
.creature-card {
    position: relative;
    width: 140px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
}

.creature-card:hover {
    transform: translateY(-8px) scale(1.02);
    z-index: 10;
}

.creature-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}

.creature-card .card-info {
    padding: 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.creature-card .card-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.creature-card .card-level {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ë¯¸ë ì¹´ë (ê·¸ë¦¬ëì©) - ë¤ìíê·¸ ê°í */
.creature-card-mini {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    /* ì ì¬ê°íì¼ë¡ ë³ê²½íì¬ ë ë§ì ì¹´ë íì */
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 2px solid var(--border-subtle);
}

/* ëê° ê·¸ë¦¬ë ìµì í - ë ë§ì í¬ë¦¬ì² íì */
#content-home .creature-card-mini,
.archive-mode .creature-card-mini {
    aspect-ratio: 1/1;
    min-width: 70px;
    max-width: 100px;
}

.creature-card-mini:hover {
    transform: scale(1.08) translateY(-5px);
    z-index: 5;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.creature-card-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ì¹´ë ì¤ë²ë ì´ (ë¤ìíê·¸ íì) */
.creature-card-mini .card-overlay,
.creature-card-mini .info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 6px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
    text-align: center;
}

.creature-card-mini .card-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.creature-card-mini .card-stats {
    font-size: 0.7rem;
    color: var(--accent-gold);
}

/* ë±ê¸ë³ ì¤íì¼ (ëì¼/ë¸ì ì¤íì¼ê³¼ ì¡°í) */
.rarity-Normal {
    border-color: #9E9E9E;
}

.rarity-Unique {
    border-color: #66BB6A;
}

.rarity-Rare {
    border-color: #42A5F5;
}

.rarity-Special {
    border-color: #AB47BC;
}

.rarity-SR {
    border-color: #FF7043;
    box-shadow: 0 0 12px rgba(255, 112, 67, 0.3);
}

.rarity-SSR {
    border-color: #EF5350;
    box-shadow: 0 0 15px rgba(239, 83, 80, 0.4);
}

.rarity-UR {
    border-color: var(--accent-gold);
    box-shadow: var(--glow-gold);
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(255, 213, 79, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 213, 79, 0.7);
    }
}

/* =========================================
   í­ ì½íì¸  ë ì´ìì
   ========================================= */
.tab-content {
    display: none;
    height: 100%;
}

.tab-content.active {
    display: block;
}

/* í ë ì´ìì (ì¢ì¸¡ UI + ì°ì¸¡ ë¡ë¹ ìºë¦­í°) */
.layout-dashboard {
    display: none;
    /* ê¸°ë³¸ì ì¨ê¹ */
    grid-template-columns: 1fr 1fr;
    /* ì¢ì¸¡ UI, ì°ì¸¡ ë¡ë¹ ìºë¦­í° */
    grid-template-rows: 2fr 1fr;
    /* í¬ë¦¬ì² ëª©ë¡ í¬ê², ë¡ê·¸ ìê² */
    gap: 15px;
    width: 100%;
    height: 100%;
}

.layout-dashboard.active {
    display: grid;
    /* activeì¼ ë grid íì */
}

/* ë¡ë¹ ìºë¦­í° í¨ë (UI ìì¤í íµí©) */
#lobby-character-panel {
    grid-column: 2;
    /* ì°ì¸¡ ì´ */
    grid-row: 1 / 3;
    /* ì ì²´ ëì´ ì°¨ì§ */
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    /* overflow: hidden ì ê±° - ë§íì  íìë¥¼ ìí´ */
}

/* ë¡ë¹ ìºë¦­í° ëí¼ (í¨ë ë´ë¶) */
#lobby-character-panel #lobby-character-wrapper {
    position: relative;
    width: 100%;
    /* max-width ì ê±° */
    height: 100%;
    /* ë¶ëª¨ ëì´ ë°ë¦ */
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* ë°ë¥ ë§ì¶¤ */
    z-index: 100;
    pointer-events: none;
    /* ëí¼ ìì²´ë íµê³¼ */
}

#lobby-character-img {
    height: 95%;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.5));
    animation: breathe 4s ease-in-out infinite;
    pointer-events: auto;
    /* ì´ë¯¸ì§ë í´ë¦­ ê°ë¥ */
    position: relative;
    z-index: 1;
}

/* ëì¬ ë§íì  (Speech Bubble) */
#lobby-speech-bubble {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    max-width: 300px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: bold;
    text-align: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

#lobby-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0 10px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.85) transparent transparent transparent;
}

#lobby-speech-bubble.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    animation: bubblePop 0.3s ease-out;
}

@keyframes bubblePop {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* í°ì¹ ìí¸ìì© ìì­ */
/* í°ì¹ ìí¸ìì© ìì­ - ì¬ì ì */
.touch-zone {
    position: absolute;
    left: 0;
    width: 100%;
    /* ìºë¦­í° ì´ë¯¸ì§ê° ìë wrapper ì ì²´ ìì­ ì¬ì© */
    transform: none;
    z-index: 20;
    cursor: pointer;
    pointer-events: auto;

    /* ëë²ê¹ì©: ìì¹ íì¸ í í¬ëªíê² ë³ê²½ ìì  */
    border-radius: 12px;
    transition: background 0.2s;
}

.touch-zone:active {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* ë¨¸ë¦¬ ìì­ (ìë¨ 25%) */
.touch-head {
    top: 5%;
    height: 25%;
    background: transparent;
}

/* ê°ì´/ëª¸íµ ìì­ (ì¤ë¨ 30%) */
.touch-body {
    top: 30%;
    height: 30%;
    background: transparent;
}

/* ë¤ë¦¬/íì²´ ìì­ (íë¨ 35%) */
.touch-legs {
    top: 60%;
    height: 35%;
    background: transparent;
    /* í¬ëª ì²ë¦¬ */
}

/* ë§íì  ì¤íì¼ (ê°ì  Override) */
#lobby-speech-bubble {
    position: absolute;
    top: 10%;
    right: -20px;
    /* ì¤ë¥¸ìª½ì¼ë¡ ì´ì§ ëº */
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 15px 20px;
    border-radius: 20px;
    font-size: 1rem;
    z-index: 100;
    pointer-events: none;

    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 200px;
    max-width: 320px;

    white-space: normal;
    word-break: keep-all;
    text-align: center;
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#lobby-speech-bubble.active {
    opacity: 1;
    top: 5%;
    /* ìë¡ ì¬ë¼ê°ë í¨ê³¼ */
}

/* ì¼ìª½ í¨ë(#left-panel): í¬ë¦¬ì² ë¦¬ì¤í¸ */
#left-panel {
    grid-column: 1;
    /* ì¢ì¸¡ ì´ */
    grid-row: 1;
    /* ì²« ë²ì§¸ í */
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ì¤ì í¨ë(#center-panel): ì¨ê¹ (ëª¨ë¬ë¡ ëì²´) */
#center-panel {
    display: none !important;
}

/* ì¤ë¥¸ìª½ í¨ë: ë¡ê·¸ */
#right-panel {
    grid-column: 1;
    /* ì¢ì¸¡ ì´ */
    grid-row: 2;
    /* ë ë²ì§¸ í */
    display: flex;
    flex-direction: column;
    min-height: 150px;
    max-height: 250px;
}

/* ì ì²´ ëì´ í¨ë */
.full-height {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.full-height>*:last-child {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* í¬ë¦¬ì² ë¦¬ì¤í¸ ê·¸ë¦¬ë - ì¬ë¬ ì¤ íì */
#creature-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    grid-auto-rows: max-content;
    /* í ëì´ ëªì */
    gap: 12px;
    padding: 15px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    /* ì¤ì: Flex ìì ì¤í¬ë¡¤ */
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 30000;
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

/* --- Floating Header (Glass & Gradient) --- */
#game-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 90;
    /* Floating above background, below Dock (100) */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;

    /* Transparent Gradient Top */
    background: linear-gradient(to bottom, rgba(5, 5, 16, 0.9) 0%, rgba(5, 5, 16, 0) 100%);
    pointer-events: none;
    /* ë°°ê²½ í°ì¹ íì© (ë¹ ê³µê°) */
}

#game-header>* {
    pointer-events: auto;
    /* ë²í¼ ë±ì í°ì¹ ê°ë¥ */
}

.modal-content.glass-panel {
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-tech);
    padding: 30px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    animation: slideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.detail-modal-content {
    background: linear-gradient(180deg, rgba(26, 21, 53, 0.95) 0%, rgba(13, 21, 32, 0.98) 100%);
}

.creature-portrait-large {
    width: 100%;
    aspect-ratio: 1;
    margin: 20px 0;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.creature-portrait-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Modal Speech Bubble & Rarity Badge */
.speech-bubble-modal {
    animation: floatBubble 3s ease-in-out infinite;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

@keyframes floatBubble {

    0%,
    100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, -5px);
    }
}

.rarity-badge {
    text-shadow: 0 0 5px currentColor;
    background: rgba(0, 0, 0, 0.5);
    font-family: 'Orbitron', monospace;
    letter-spacing: 1px;
}

/* ì°êµ¬ì ê·¸ë¦¬ë */
#facility-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px;
}

.facility-card.can-upgrade {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.2);
}

.facility-card.can-upgrade .btn-upgrade {
    background: var(--accent-gold);
    color: black;
    box-shadow: 0 0 10px var(--accent-gold);
}

/* Removed rigid #deck-pool styles to use the responsive definition at the end of file */

/* ìí íë©´ */
.summon-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    padding: 40px;
    flex: 1;
}

.summon-gate {
    text-align: center;
    padding: 30px 40px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.summon-gate h3 {
    margin-bottom: 8px;
}

.summon-gate p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.summon-gate .cyber-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
}

/* =========================================
   ì ëë©ì´ì
   ========================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.slide-in {
    animation: slideIn 0.4s ease-out;
}

/* =========================================
   ì¤ë²ë ì´ & ëª¨ë¬
   ========================================= */
#login-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0a0f14 0%, #1a2535 100%);
    z-index: 100000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#auth-card {
    width: 90%;
    max-width: 420px;
    background: var(--bg-surface);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-accent);
    overflow: hidden;
}

.auth-tab {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.auth-tab.active {
    color: var(--accent-primary);
    border-bottom: 2px solid var(--accent-primary);
}

.auth-tab:not(.active) {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
}

/* ì í¬ ì¤ë²ë ì´ */
#battle-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 50000;
    display: none;
    flex-direction: column;
}

#battle-overlay.active {
    display: flex;
}

/* =========================================
   ë°ìí (ëª¨ë°ì¼)
   ========================================= */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 70px;
    }

    .nav-item .label {
        display: none;
    }

    .brand-text {
        display: none;
    }

    .layout-dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #sidebar {
        display: none;
    }

    #game-header {
        padding: 0 12px;
    }

    .resource-bar {
        gap: 8px;
    }

    .res-item {
        padding: 6px 10px;
    }
}

/* =========================================
   íì¬/ì°êµ¬ì/ë¯¸ì/ë³´ê¸ì ì¹´ë ì¤íì¼
   ========================================= */

/* --- Creature Card Rarity Styles --- */
.creature-card-mini {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #1e1e2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.creature-card-mini:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* Rarity Borders */
.rarity-Normal {
    border-color: #9e9e9e;
}

.rarity-Unique {
    border-color: #66bb6a;
}

.rarity-Rare {
    border-color: #42a5f5;
}

.rarity-Special {
    border-color: #ab47bc;
    border-width: 2px;
}

/* SR+: Gradients and Glows */
.rarity-SR {
    border: 2px solid #ff7043;
    box-shadow: 0 0 10px rgba(255, 112, 67, 0.3);
}

.rarity-SSR {
    border: 2px solid #ef5350;
    box-shadow: 0 0 15px rgba(239, 83, 80, 0.4);
    background: linear-gradient(135deg, #1e1e2e 0%, #2d1b2e 100%);
}

.rarity-UR {
    border: 2px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, #1e1e2e 0%, #3d3500 100%);
    animation: pulse-gold 2s infinite;
}

@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    }

    50% {
        box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
    }

    100% {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    }
}

/* Element Icon Overlay */
.element-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ê³µíµ ê¸°ë¥ ì¹´ë */
.feature-card {
    background: linear-gradient(145deg, var(--bg-elevated), var(--bg-card));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.feature-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
    transform: translateY(-3px);
}

/* íì¬ ì¹´ë */
.expedition-card {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    padding: 16px 20px;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.1), transparent);
    border-left: 4px solid var(--accent-primary);
}

.expedition-card .exp-icon {
    font-size: 2rem;
}

.expedition-card .exp-info {
    flex: 1;
}

.expedition-card .exp-info h4 {
    color: var(--text-highlight);
    margin-bottom: 4px;
}

.expedition-card .exp-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.expedition-card .exp-rewards {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
}

.expedition-card .exp-rewards span {
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
}

/* ì°êµ¬ì ì¹´ë */
.facility-card {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    padding: 16px 20px;
    background: linear-gradient(90deg, rgba(224, 64, 251, 0.1), transparent);
    border-left: 4px solid var(--accent-secondary);
}

.facility-card .facility-icon {
    font-size: 2rem;
}

.facility-card .facility-info {
    flex: 1;
}

.facility-card .facility-info h4 {
    color: var(--text-highlight);
}

.facility-card .facility-level {
    font-size: 0.8rem;
    color: var(--accent-secondary);
}

/* ë¯¸ì ì¹´ë */
.mission-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 14px 18px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-tertiary);
}

.mission-card.completed {
    opacity: 0.6;
    border-left-color: var(--accent-success);
}

.mission-card .mission-info {
    flex: 1;
}

.mission-card .mission-info h5 {
    color: var(--text-highlight);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.mission-card .mission-progress {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.mission-card .mission-reward {
    font-size: 0.85rem;
    color: var(--accent-gold);
    padding: 6px 12px;
    background: rgba(255, 215, 64, 0.15);
    border-radius: 20px;
}

/* ë¯¸ì ì§íë¥  ë° */
.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ë³´ê¸ì ì¹´ë (ìí) */
.shop-card {
    background: linear-gradient(145deg, var(--bg-elevated), var(--bg-card));
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.shop-card:hover {
    border-color: var(--accent-gold);
    box-shadow: var(--glow-gold);
    transform: scale(1.03);
}

.shop-card.premium {
    border-color: var(--accent-secondary);
    background: linear-gradient(145deg, rgba(224, 64, 251, 0.2), var(--bg-card));
}

.shop-card .shop-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.shop-card .shop-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-highlight);
    margin-bottom: 6px;
}

.shop-card .shop-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.shop-card .shop-price {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--accent-gold), #ff9800);
    color: #000;
    font-weight: 700;
    border-radius: 25px;
}

.shop-card .shop-price.gem {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
}

/* ë³´ê¸ì ê·¸ë¦¬ë */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 20px;
}

/* íì¬ ë¦¬ì¤í¸ */
#expedition-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 16px;
}

/* =========================================
   [NEW] ìë¤ë§í± ì°ì¶ (Cinematics) 
   ========================================= */
#cinematic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1a1a2e 0%, #050510 100%);
    z-index: 999999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#cinematic-overlay.active {
    display: flex;
    animation: cinematic-fade-in 0.3s ease-out;
}

/* ë±ê¸ë³ íë§ ì»¬ë¬ ì¤ì  */
#cinematic-overlay.rarity-Normal {
    --rarity-color: #9e9e9e;
    --rarity-glow: rgba(158, 158, 158, 0.5);
}

#cinematic-overlay.rarity-Unique {
    --rarity-color: #66bb6a;
    --rarity-glow: rgba(102, 187, 106, 0.6);
}

#cinematic-overlay.rarity-Rare {
    --rarity-color: #42a5f5;
    --rarity-glow: rgba(66, 165, 245, 0.7);
}

#cinematic-overlay.rarity-Special {
    --rarity-color: #ab47bc;
    --rarity-glow: rgba(171, 71, 188, 0.8);
}

#cinematic-overlay.rarity-SR {
    --rarity-color: #ff7043;
    --rarity-glow: rgba(255, 112, 67, 0.9);
}

#cinematic-overlay.rarity-SSR {
    --rarity-color: #ef5350;
    --rarity-glow: rgba(239, 83, 80, 1.0);
}

#cinematic-overlay.rarity-UR {
    --rarity-color: #ffd700;
    --rarity-glow: rgba(255, 215, 0, 1.0);
}

/* ë§ë²ì§ (Magic Circle) */
#cinematic-circle {
    position: absolute;
    width: 600px;
    height: 600px;
    border: 2px solid var(--rarity-color);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
    box-shadow: 0 0 30px var(--rarity-glow), inset 0 0 30px var(--rarity-glow);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: center;
    align-items: center;
}

#cinematic-circle::before {
    content: '';
    position: absolute;
    width: 90%;
    height: 90%;
    border: 1px dashed var(--rarity-color);
    border-radius: 50%;
    animation: rotate-reverse 10s linear infinite;
}

#cinematic-circle.show {
    opacity: 0.8;
    transform: scale(1) rotate(360deg);
}

#cinematic-circle.reveal {
    animation: circle-explode 0.6s ease-out forwards;
}

#cinematic-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 5;
}

#cinematic-image {
    height: 110%;
    object-fit: contain;
    opacity: 0;
    filter: drop-shadow(0 0 30px var(--rarity-glow));
    transform: scale(1.2);
    transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#cinematic-image.show {
    opacity: 1;
    transform: scale(1);
    animation: ken-burns-mini 10s linear infinite alternate;
}

#cinematic-dialogue {
    position: absolute;
    bottom: 12%;
    width: 80%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--rarity-color);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(30px);
    z-index: 10;
    transition: all 0.5s ease-out;
}

#cinematic-dialogue.show {
    opacity: 1;
    transform: translateY(0);
}

#cinematic-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 1000000;
}

.do-flash {
    animation: flash-bang 0.4s ease-out forwards;
}

#cinematic-skip-hint {
    position: absolute;
    bottom: 30px;
    right: 30px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 100;
    animation: skip-blink 2s infinite;
}

@keyframes skip-blink {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }
}


/* Animations */
@keyframes rotate-reverse {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

@keyframes circle-explode {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
        filter: brightness(2);
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes ken-burns-mini {
    0% {
        transform: scale(1.0);
    }

    100% {
        transform: scale(1.1);
    }
}

@keyframes flash-bang {
    0% {
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes cinematic-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* =========================================
   [NEW] ë¡ë¹ ìºë¦­í° (Lobby Character)
   ========================================= */
.lobby-character-layer {
    position: absolute;
    bottom: 0;
    right: 5%;
    /* Right aligned */
    width: 60vh;
    /* Aspect ratio based on height */
    height: 95vh;
    z-index: 10;
    /* Behind some UI, but visible */
    pointer-events: none;
    /* Let clicks pass through if needed, but hitboxes need events */
}

#lobby-character-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    /* Enable interaction on character */
}

#lobby-character-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hitboxes for Touch Interaction */
.hitbox {
    position: absolute;
    left: 20%;
    width: 60%;
    cursor: pointer;
    /* border: 1px solid rgba(255,0,0,0.3); Debug */
}

#lobby-hitbox-head {
    top: 5%;
    height: 20%;
    z-index: 20;
}

#lobby-hitbox-chest {
    top: 25%;
    height: 25%;
    z-index: 19;
}

#lobby-hitbox-legs {
    top: 50%;
    height: 40%;
    z-index: 18;
}

/* Animations */
.touch-react-head {
    animation: shake-head 0.4s ease-in-out;
}

.touch-react-chest {
    animation: bounce-chest 0.4s ease-in-out;
}

.touch-react-legs {
    animation: tremble 0.4s ease-in-out;
}

@keyframes shake-head {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5px);
    }
}

@keyframes bounce-chest {

    0%,
    100% {
        transform: scale(1, 1);
    }

    40% {
        transform: scale(1.05, 0.95);
    }

    60% {
        transform: scale(0.95, 1.05);
    }
}

@keyframes tremble {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(2px, 0);
    }

    50% {
        transform: translate(-2px, 0);
    }

    75% {
        transform: translate(2px, 0);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    top: 10%;
    left: -180px;
    width: 220px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 15px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 30px;
    border-width: 10px 0 10px 15px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.95);
}

.speech-bubble.active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* =========================================
   ëª¨ë¬ ìì¤í
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    padding: 30px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.modal-close-btn:hover {
    color: var(--accent-primary);
    transform: scale(1.2);
}

/* í¬ë¦¬ì² ìì¸ ëª¨ë¬ ë´ë¶ ì¤íì¼ */
#modal-detail-body .detail-header {
    margin-bottom: 15px;
}

#modal-detail-body .detail-image-section {
    margin-bottom: 20px;
}

#modal-detail-body .detail-creature-img {
    border-radius: var(--radius-md);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

#modal-detail-body .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#modal-detail-body .stat-label {
    color: var(--text-secondary);
}

#modal-detail-body .stat-value {
    color: var(--accent-primary);
    font-weight: bold;
}

#modal-detail-body .action-group button {
    width: 100%;
}

/* [Fix] Expedition Grid Layout */
.grid-expedition {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Floating Heart Animation */
.floating-heart {
    position: absolute;
    color: #ff4081;
    font-size: 1.5rem;
    pointer-events: none;
    animation: floatUpFade 1.5s ease-out forwards;
    z-index: 1000;
    text-shadow: 0 0 5px rgba(255, 64, 129, 0.5);
    user-select: none;
}

@keyframes floatUpFade {
    0% {
        transform: translate(-50%, 0) scale(0.5);
        opacity: 0;
    }

    20% {
        transform: translate(-50%, -20px) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -100px) scale(1);
        opacity: 0;
    }
}

/* =========================================
   [NEW] íì¬ ìê°í (Expedition Visualization) 
   ========================================= */
#expedition-viz-zone {
    margin-top: 10px;
}

#expedition-map {
    background-color: #050510 !important;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px) !important;
    background-size: 30px 30px !important;
    border: 1px solid var(--accent-primary) !important;
    position: relative;
    overflow: hidden;
}

#expedition-map::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            rgba(0, 229, 255, 0.03) 0px,
            rgba(0, 229, 255, 0.03) 1px,
            transparent 1px,
            transparent 2px);
    pointer-events: none;
}

/* ì§ë ì ì ë ìì´ì½ */
.map-unit {
    position: absolute;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    z-index: 20;
    transition: all 1s linear;
}

.map-unit-icon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 0 10px var(--accent-primary);
}

.map-unit-icon img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.map-unit-label {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ë¡ê·¸ ì¤íì¼ */
#expedition-log-display {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.exp-log-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    animation: logFadeIn 0.3s ease-out;
}

.exp-log-item .time {
    color: #666;
    margin-right: 8px;
    font-size: 0.8em;
}

.exp-log-item .tag {
    color: var(--accent-primary);
    font-weight: bold;
    margin-right: 6px;
}

.exp-log-item .msg {
    color: #ddd;
}

@keyframes logFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Resonance Bar (Lobby) */
#lobby-resonance-bar {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 150;
    opacity: 0.9;
    text-shadow: 0 0 5px black;
}

.resonance-container {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255, 64, 129, 0.5);
    margin-top: 4px;
    position: relative;
}

.resonance-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4081, #ff80ab);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px #ff4081;
}

.resonance-heart {
    font-size: 1.2rem;
    color: #ff4081;
    animation: pumpHeart 1.5s infinite alternate;
    margin-bottom: 2px;
}

@keyframes pumpHeart {
    from {
        transform: scale(1);
        filter: brightness(1);
    }

    to {
        transform: scale(1.2);
        filter: brightness(1.3);
    }
}

/* Event Cutscene Modal */
#event-cutscene-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 99999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-family: 'Times New Roman', serif;
    text-align: center;
    padding: 40px;
}

.cutscene-text {
    font-size: 1.4rem;
    line-height: 1.8;
    color: #eee;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1.5s ease-out;
    max-width: 800px;
}

.cutscene-text.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- [Fix] Deck Pool Grid --- */
#deck-pool {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)) !important;
    /* ìì ì¹´ë í¬ê¸°ì ë§ì¶¤ */
    gap: 10px !important;
    padding: 10px !important;
    overflow-y: auto !important;
    max-height: 400px !important;
    min-height: 320px !important;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

/* --- [New] Archive Styles --- */
#archive-stats {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #eee;
}

/* Tab Navigation */
.tab-btn {
    transition: all 0.2s;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9em;
}

.tab-btn:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* World Separator */
.world-separator {
    text-shadow: 0 0 5px var(--accent-gold);
    margin-top: 20px !important;
    padding-left: 5px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.creature-card-mini.locked {
    background: rgba(0, 0, 0, 0.5);
    /* ì´ëì´ ë°°ê²½ */
    border: 1px dashed #666;
    /* ë¹ ì¬ë¡¯ ëë */
    pointer-events: auto !important;
    cursor: not-allowed;
}

.creature-card-mini.locked img {
    filter: brightness(0) invert(1) opacity(0.5);
    /* í°ì ì¤ë£¨ì£ (Visible on dark bg) */
}

/* Ensure mini card images are responsive to prevent overlap */
.creature-card-mini img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.creature-card-mini.locked .element-badge,
.creature-card-mini.locked .card-stats {
    display: none;
    /* ë±ì§ì ì¤í¯ì ì¨ê¹ */
}

.creature-card-mini.locked .card-name {
    color: #888;
    font-size: 0.8em;
}

.creature-card-mini.locked:hover img {
    opacity: 0.8;
}

.creature-card-mini.locked .card-name {
    color: #555;
    display: none;
    /* ì´ë¦ ê°ë¦¬ê¸°? ì¬ì©ì ìì²­ì ì¤ë£¨ì£ë§. ì´ë¦ì ë³´ì¬ë ëë? ??? ì²ë¦¬? ì¼ë¨ ì´ë¦ì ë³´ì´ê² (íë¦¬ê²) */
}

.creature-card-mini.locked:hover {
    opacity: 1 !important;
    /* í¸ë² ì ì½ê° ë°ê² */
}

.creature-card-mini.locked .card-name {
    color: #999;
}

/* =========================================
   ì í¬ ì ëë©ì´ì ìì¤í (Battle Animation System)
   ========================================= */

/* ê³µê²© ì ëë©ì´ì - ì¤ë¥¸ìª½ì¼ë¡ ëì§ (Hero) */
.anim-attack-right {
    animation: attackRight 0.3s ease-out;
}

/* ê³µê²© ì ëë©ì´ì - ì¼ìª½ì¼ë¡ ëì§ (Enemy) */
.anim-attack-left {
    animation: attackLeft 0.3s ease-out;
}

/* í¼ê²© ì ëë©ì´ì - ë²ì©ì + íë¤ë¦¼ */
.anim-hit {
    animation: hit 0.25s ease-out;
}

/* í¬ë¦¬í°ì»¬ í¼ê²© */
.anim-critical-hit {
    animation: criticalHit 0.4s ease-out;
}

/* íí¼ (Glancing) */
.anim-miss {
    animation: miss 0.4s ease-out;
}

/* ë°ë¯¸ì§ ì«ì ê¸°ë³¸ */
.damage-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Outfit', sans-serif;
    font-size: 1.2em;
    font-weight: 900;
    color: #ffffff;
    text-shadow:
        0 0 5px #000,
        0 0 10px #000,
        2px 2px 0 #000;
    pointer-events: none;
    z-index: 100;
    animation: damageFloat 0.8s ease-out forwards;
}

/* í¬ë¦¬í°ì»¬ ë°ë¯¸ì§ ì«ì */
.damage-number.crit {
    font-size: 1.8em;
    color: #ff4500;
    text-shadow:
        0 0 10px #ff4500,
        0 0 20px #ff0000,
        2px 2px 0 #000;
    animation: damageFloatCrit 0.9s ease-out forwards;
}

/* íë³µ ì«ì */
.damage-number.heal {
    color: #2ecc71;
    text-shadow:
        0 0 10px #2ecc71,
        0 0 20px #00ff00,
        2px 2px 0 #000;
}

/* íí¼ íì¤í¸ */
.damage-number.miss {
    color: #888888;
    font-size: 1em;
    text-shadow: none;
}

/* ìì± ì ë¦¬ (Advantage) */
.damage-number.advantage {
    color: #00ff88;
}

/* ìì± ë¶ë¦¬ (Disadvantage) */
.damage-number.disadvantage {
    color: #ff8800;
}

/* íë©´ íë¤ë¦¼ */
.screen-shake {
    animation: shake 0.3s ease-out;
}

.screen-shake-big {
    animation: shakeBig 0.4s ease-out;
}

/* =========================================
   ì í¬ í¤íë ì ì ëë©ì´ì
   ========================================= */

@keyframes attackRight {

    0%,
    100% {
        transform: translateX(0) translateY(-50%);
    }

    30% {
        transform: translateX(30px) translateY(-50%) scale(1.1);
    }

    50% {
        transform: translateX(25px) translateY(-50%);
    }
}

@keyframes attackLeft {

    0%,
    100% {
        transform: translateX(0) translateY(-50%);
    }

    30% {
        transform: translateX(-30px) translateY(-50%) scale(1.1);
    }

    50% {
        transform: translateX(-25px) translateY(-50%);
    }
}

@keyframes hit {
    0% {
        filter: none;
        transform: scale(1);
    }

    20% {
        filter: brightness(3) saturate(0);
        transform: scale(0.95);
    }

    40% {
        filter: brightness(1.5);
        transform: scale(1.02) translateX(-3px);
    }

    60% {
        transform: scale(1) translateX(3px);
    }

    100% {
        filter: none;
        transform: scale(1) translateX(0);
    }
}

@keyframes criticalHit {
    0% {
        filter: none;
        transform: scale(1);
    }

    15% {
        filter: brightness(5) saturate(0);
        transform: scale(0.9);
    }

    30% {
        filter: brightness(2) hue-rotate(30deg);
        transform: scale(1.1) translateX(-5px);
    }

    50% {
        transform: scale(1.05) translateX(5px);
    }

    70% {
        transform: scale(1) translateX(-3px);
    }

    100% {
        filter: none;
        transform: scale(1);
    }
}

@keyframes miss {

    0%,
    100% {
        opacity: 1;
    }

    30% {
        opacity: 0.3;
        transform: translateX(10px);
    }

    60% {
        opacity: 0.7;
        transform: translateX(-5px);
    }
}

@keyframes damageFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -60%) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -120%) scale(0.8);
    }
}

@keyframes damageFloatCrit {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.3) rotate(-10deg);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -55%) scale(1.5) rotate(5deg);
    }

    30% {
        transform: translate(-50%, -60%) scale(1.3) rotate(-3deg);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -140%) scale(0.9) rotate(0deg);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translate(0);
    }

    10% {
        transform: translate(-4px, 2px);
    }

    20% {
        transform: translate(4px, -2px);
    }

    30% {
        transform: translate(-3px, 3px);
    }

    40% {
        transform: translate(3px, -1px);
    }

    50% {
        transform: translate(-2px, 2px);
    }

    60% {
        transform: translate(2px, -2px);
    }

    70% {
        transform: translate(-1px, 1px);
    }

    80% {
        transform: translate(1px, -1px);
    }
}

@keyframes shakeBig {

    0%,
    100% {
        transform: translate(0);
    }

    10% {
        transform: translate(-8px, 5px) rotate(-1deg);
    }

    20% {
        transform: translate(8px, -5px) rotate(1deg);
    }

    30% {
        transform: translate(-6px, 4px) rotate(-0.5deg);
    }

    40% {
        transform: translate(6px, -3px) rotate(0.5deg);
    }

    50% {
        transform: translate(-4px, 3px);
    }

    60% {
        transform: translate(4px, -2px);
    }

    70% {
        transform: translate(-2px, 2px);
    }

    80% {
        transform: translate(2px, -1px);
    }
}

/* =========================================
   ì í¬ UI ê°ì 
   ========================================= */

/* í´ íì ê°ì  */
#battle-header {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border-bottom: 2px solid var(--accent-primary);
    padding: 10px 20px;
    text-align: center;
}

#battle-header .turn-counter {
    font-size: 1.5em;
    font-weight: 900;
    color: var(--accent-gold);
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* HP ë° ê°ì  */
.hp-bar-container {
    background: linear-gradient(to bottom, #1a0000, #330000);
    border: 1px solid #550000;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.hp-bar-fill {
    background: linear-gradient(to bottom, #00ff00, #008800);
    transition: width 0.3s ease-out;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

/* HP ë®ì ë ìì ë³ê²½ */
.hp-bar-fill.low {
    background: linear-gradient(to bottom, #ffff00, #888800);
}

.hp-bar-fill.critical {
    background: linear-gradient(to bottom, #ff0000, #880000);
    animation: hpCritical 0.5s infinite;
}

@keyframes hpCritical {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ì í¬ ìí°í° í¸ë² í¨ê³¼ */
.battle-entity:hover {
    transform: scale(1.05);
    z-index: 10;
}

/* ì¬ë§ ìí */
.battle-entity.dead {
    filter: grayscale(100%) brightness(40%);
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.5s ease;
}

/* [NEW] ê³ ê¸ ì í¬ ì°ì¶ ìì¤í */

/* 1. ëì (Motions) */
.anim-prepare-right {
    animation: prepareRight 0.2s ease-out forwards;
}

.anim-prepare-left {
    animation: prepareLeft 0.2s ease-out forwards;
}

.anim-impact-shock {
    animation: impactShock 0.15s ease-out;
}

.anim-knockback-right {
    animation: knockbackRight 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.anim-knockback-left {
    animation: knockbackLeft 0.4s cubic-bezier(0.1, 0.9, 0.2, 1);
}

/* 2. ì´íí¸ (VFX) */
.vfx-impact {
    position: absolute;
    pointer-events: none;
    z-index: 200;
    width: 200px;
    height: 200px;
    transform: translate(-50%, -50%);
}

.vfx-slash {
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    width: 4px;
    height: 150px;
    animation: vfxSlash 0.2s ease-out forwards;
}

.vfx-spark {
    background: #ffcc00;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffcc00;
    position: absolute;
}

/* 3. ì¤í¬ ì»·ì¸ (Skill Cut-in) */
.skill-cut-in-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.skill-cut-in-bg {
    position: absolute;
    width: 200%;
    height: 300px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    transform: skewX(-20deg) translateX(-150%);
    opacity: 0.7;
    animation: cutInBg 1.5s ease-in-out forwards;
}

.skill-cut-in-img {
    position: absolute;
    height: 120%;
    right: -20%;
    filter: drop-shadow(0 0 30px var(--accent-primary));
    transform: translateX(100%);
    animation: cutInImg 1.5s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

.skill-cut-in-text {
    position: absolute;
    left: 10%;
    font-size: 5em;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px var(--accent-primary), 5px 5px 0 #000;
    font-family: 'Outfit', sans-serif;
    transform: translateX(-150%) skewX(-10deg);
    animation: cutInText 1.5s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

/* 4. SP ê²ì´ì§ */
.sp-bar-container {
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    margin-top: 2px;
    border-radius: 2px;
    overflow: hidden;
}

.sp-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #3498db, #2980b9);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 5px #3498db;
}

.sp-bar-fill.full {
    background: linear-gradient(to right, #00d2ff, #fff);
    animation: spFull 0.5s infinite alternate;
}

/* [NEW] í¤íë ì (Keyframes) */

@keyframes prepareRight {
    0% {
        transform: translateX(0) translateY(-50%);
    }

    100% {
        transform: translateX(-15px) translateY(-50%) rotate(-5deg);
        filter: brightness(1.2);
    }
}

@keyframes prepareLeft {
    0% {
        transform: translateX(0) translateY(-50%);
    }

    100% {
        transform: translateX(15px) translateY(-50%) rotate(5deg);
        filter: brightness(1.2);
    }
}

@keyframes impactShock {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1) translate(2px, -2px);
        filter: contrast(200%) brightness(1.5);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes knockbackRight {
    0% {
        transform: translateX(0) scale(1.1);
    }

    20% {
        transform: translateX(40px) scale(0.9) rotate(5deg);
        filter: brightness(0.7);
    }

    100% {
        transform: translateX(0) scale(1);
    }
}

@keyframes knockbackLeft {
    0% {
        transform: translateX(0) scale(1.1);
    }

    20% {
        transform: translateX(-40px) scale(0.9) rotate(-5deg);
        filter: brightness(0.7);
    }

    100% {
        transform: translateX(0) scale(1);
    }
}

@keyframes vfxSlash {
    0% {
        transform: rotate(45deg) scaleY(0);
        opacity: 0;
    }

    50% {
        transform: rotate(45deg) scaleY(1.5);
        opacity: 1;
    }

    100% {
        transform: rotate(45deg) scaleY(2);
        opacity: 0;
    }
}

@keyframes cutInBg {
    0% {
        transform: skewX(-20deg) translateX(-150%);
    }

    20% {
        transform: skewX(-20deg) translateX(-10%);
    }

    80% {
        transform: skewX(-20deg) translateX(10%);
    }

    100% {
        transform: skewX(-20deg) translateX(150%);
    }
}

@keyframes cutInImg {
    0% {
        transform: translateX(100%) scale(1.2);
        opacity: 0;
    }

    20% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    80% {
        transform: translateX(-20px) scale(1.05);
        opacity: 1;
    }

    100% {
        transform: translateX(-100%) scale(1.2);
        opacity: 0;
    }
}

@keyframes cutInText {
    0% {
        transform: translateX(-150%) skewX(-10deg);
        opacity: 0;
    }

    25% {
        transform: translateX(0) skewX(-10deg);
        opacity: 1;
    }

    75% {
        transform: translateX(50px) skewX(-10deg);
        opacity: 1;
    }

    100% {
        transform: translateX(150%) skewX(-10deg);
        opacity: 0;
    }
}

@keyframes spFull {
    from {
        filter: brightness(1) drop-shadow(0 0 2px #fff);
    }

    to {
        filter: brightness(1.5) drop-shadow(0 0 8px #00d2ff);
    }
}

/* Expedition Map Units */
.map-unit {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    transition: all 1s linear;
}

.map-unit-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent-cyan);
    background: #000;
    box-shadow: 0 0 10px var(--accent-cyan);
    position: relative;
}

.map-unit-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.map-unit-label {
    margin-top: 4px;
    font-size: 0.75rem;
    color: white;
    text-shadow: 0 1px 2px #000;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.5);
    padding: 1px 4px;
    border-radius: 4px;
}

/* =========================================
   UI ê°ì  - 2024-12-24
   ========================================= */

/* lobby-buttons í´ë¦­ ê°ë¥íê² ìì  */
#lobby-buttons {
    pointer-events: auto !important;
    z-index: 100;
}

#lobby-buttons button {
    pointer-events: auto !important;
}

/* ëê° ëª¨ëìì íëë¡ê·¸ ì¨ê¹ */
body.archive-mode #right-panel,
body.archive-mode #log-panel {
    display: none !important;
}

/* ëê° ëª¨ëìì ì¢ì° í¨ë ë ì´ìì ì¡°ì  */
body.archive-mode #left-panel {
    flex: 1 !important;
    max-width: none !important;
}

body.archive-mode #center-panel {
    display: none !important;
}

/* =========================================
   Battle System Overhaul Animations
   ========================================= */

/* Combat Movement */
.anim-prepare-right {
    transform: translateX(-15px) scale(0.95);
    transition: transform 0.15s ease-in;
}

.anim-prepare-left {
    transform: translateX(15px) scale(0.95);
    transition: transform 0.15s ease-in;
}

.anim-attack-right {
    animation: attackRight 0.3s ease-out forwards;
    z-index: 50;
}

.anim-attack-left {
    animation: attackLeft 0.3s ease-out forwards;
    z-index: 50;
}

@keyframes attackRight {
    0% {
        transform: translateX(-15px);
    }

    30% {
        transform: translateX(50px) scale(1.1);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes attackLeft {
    0% {
        transform: translateX(15px);
    }

    30% {
        transform: translateX(-50px) scale(1.1);
    }

    100% {
        transform: translateX(0);
    }
}

.anim-knockback-right {
    animation: knockRight 0.4s ease-out forwards;
}

.anim-knockback-left {
    animation: knockLeft 0.4s ease-out forwards;
}

@keyframes knockRight {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(30px) rotate(5deg);
        filter: brightness(1.5);
    }

    100% {
        transform: translateX(0);
    }
}

@keyframes knockLeft {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-30px) rotate(-5deg);
        filter: brightness(1.5);
    }

    100% {
        transform: translateX(0);
    }
}

.anim-impact-shock {
    animation: impactShock 0.3s linear;
}

@keyframes impactShock {
    0% {
        filter: contrast(2) brightness(2);
    }

    100% {
        filter: contrast(1) brightness(1);
    }
}

.anim-miss {
    animation: missAnim 0.4s ease-out;
}

@keyframes missAnim {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(15px) skewX(5deg);
        opacity: 0.7;
    }

    50% {
        transform: translateX(-10px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Damage Numbers */
.damage-number {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 900;
    font-size: 1.4rem;
    font-family: "Orbitron", sans-serif;
    pointer-events: none;
    z-index: 100;
    animation: damageFlow 1s ease-out forwards;
}

.damage-number.normal {
    color: #f1c40f;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
}

.damage-number.crit {
    color: #ff4500;
    font-size: 2rem;
    text-shadow: 0 0 10px #ff4500;
}

.damage-number.miss {
    color: #bdc3c7;
    font-size: 1rem;
}

.damage-number.heal {
    color: #2ecc71;
    text-shadow: 0 0 10px #2ecc71;
}

.damage-number.dot {
    color: #ff7675;
    font-size: 1.1rem;
}

@keyframes damageFlow {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.5);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -20px) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -60px) scale(0.8);
    }
}

/* VFX */
.vfx-impact {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 60;
}

.vfx-slash {
    width: 60px;
    height: 4px;
    background: #fff;
    box-shadow: 0 0 15px #00f3ff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
    animation: slashFade 0.3s ease-out forwards;
}

@keyframes slashFade {
    0% {
        width: 0;
        opacity: 1;
    }

    100% {
        width: 100px;
        opacity: 0;
    }
}

/* Screen Effects */
.screen-shake {
    animation: shake 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

.screen-shake-big {
    animation: shakeBig 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes shakeBig {

    10%,
    90% {
        transform: translate3d(-4px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(8px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-12px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(12px, 0, 0);
    }
}


/* =========================================
   [NEW] Battle UI Overhaul (Visual Feedback)
   ========================================= */

/* Battle Stage Backgrounds */
#battle-stage.bg-Battle-Volcano {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('../images/bg_volcano.jpg') no-repeat center/cover;
}

#battle-stage.bg-Battle-Ocean {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('../images/bg_ocean.jpg') no-repeat center/cover;
}

#battle-stage.bg-Battle-Forest {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('../images/bg_forest.jpg') no-repeat center/cover;
}

#battle-stage.bg-Battle-Sky {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7)), url('../images/bg_sky.jpg') no-repeat center/cover;
}

#battle-stage.bg-Battle-Cave {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9)), url('../images/bg_cave.jpg') no-repeat center/cover;
}

#battle-stage {
    transition: background 0.5s ease;
}

/* Battle Entity Size & Style */
.battle-entity {
    width: 140px !important;
    /* Much bigger size */
    height: 140px !important;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-bottom: 25px;
    /* Spacing between units */
}

.battle-entity:hover {
    transform: scale(1.1) translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-primary);
    z-index: 100 !important;
}

/* Entity Image */
.battle-entity img {
    border-radius: 10px;
    object-fit: cover !important;
    /* Fill the frame */
    object-position: top center;
    /* Focus on face/upper body */
    filter: brightness(0.9);
}

.battle-entity:hover img {
    filter: brightness(1.1);
}

/* HP Bar Styling */
.hp-bar-container {
    top: -22px !important;
    height: 10px !important;
    background: #2c3e50 !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.hp-bar-fill {
    background: linear-gradient(90deg, #e74c3c, #c0392b) !important;
    /* More vivid red */
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

/* SP Bar Styling */
.sp-bar-container {
    top: -8px !important;
    height: 6px !important;
    background: #2c3e50 !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.sp-bar-fill {
    background: linear-gradient(90deg, #f1c40f, #f39c12) !important;
    box-shadow: 0 0 8px #f1c40f;
}

/* Name Tag Styling */
.name-tag {
    bottom: -40px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #fff !important;
    text-shadow: 0 2px 4px #000, 0 0 5px var(--accent-primary) !important;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    opacity: 0.9;
    letter-spacing: 0.5px;
}

/* Status Icons */
.status-effect-container {
    bottom: 5px !important;
    left: 5px !important;
    width: auto !important;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.status-icon {
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}


/* [FIX] Fallback for backgrounds and positioning */
#battle-stage {
    background-color: #1a1a2e;
    /* Dark fallback color */
}

.battle-entity {
    background-color: rgba(0, 0, 0, 0.5);
    /* Entity background fallback */
    position: relative;
    /* Ensure relative positioning context */
}


/* [URGENT FIX] Constrain Image Size to Container */
.battle-entity img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 10px;
    /* Ensure border radius matches parent */
}


/* [URGENT FIX] Skill Cut-in Image Size Limit */
.skill-cut-in-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    /* È­¸é ³ÊºñÀÇ 80% Á¦ÇÑ */
    max-height: 60vh;
    /* È­¸é ³ôÀÌÀÇ 60% Á¦ÇÑ */
    object-fit: contain;
    /* ºñÀ² À¯Áö */
    z-index: 1002;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
    animation: cutInSlide 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cutInSlide {
    0% {
        transform: translate(-150%, -50%) skewX(-20deg);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) skewX(0);
        opacity: 1;
    }
}

/* Ensure background always covers */
.battle-stage {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}


/* [System V2] UI Optimization */
.creature-card-mini {
    content-visibility: auto;
    contain-intrinsic-size: 100px 140px;
}

.btn-load-more {
    grid-column: 1 / -1;
    padding: 15px;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-load-more:hover {
    background: var(--accent-cyan);
    color: #000;
}

/* =========================================
   [NEW] Cinematic FX Additions
   ========================================= */

#cinematic-aura {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80vh;
    height: 80vh;
    border-radius: 50%;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
}

#cinematic-aura.pulse {
    opacity: 1;
    animation: aura-pulse 3s infinite alternate;
}

@keyframes aura-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.6;
    }
}

/* UR Rainbow Effect */
#cinematic-overlay.rarity-UR #cinematic-circle {
    box-shadow:
        0 0 50px #FFD700,
        0 0 100px #FFD700,
        inset 0 0 60px #FF0000;
    animation: rainbow-spin 2s linear infinite;
}

/* Screen Shake Effect */
.shake-screen {
    animation: screen-shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes screen-shake {

    10%,
    90% {
        transform: translate3d(-2px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(4px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-8px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(8px, 0, 0);
    }
}

/* Particle Explosion base style (managed by JS but needs z-index) */
.fx-particle {
    z-index: 999999 !important;
}