/* UI REDESIGN v3.0 - REFERENCE MATCH */
:root {
    --ui-bg-forest: #2d4f4f;
    --ui-bg-teal: #3baea0;
    --ui-bg-dark: #1e3535;
    --ui-gold: #fbc531;
    --ui-gold-dark: #e1b12c;
    --ui-teal-bright: #48d1cc;
    --ui-border-thick: 4px solid #1e272e;
    --ui-pushed: 0 4px 0 #1e272e;
    
    --font-jp: 'Potta One', system-ui;
    --font-num: 'Luckiest Guy', cursive;
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
    touch-action: manipulation; 
}

body {
    background: var(--ui-bg-forest);
    font-family: var(--font-jp);
    color: white;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    touch-action: none;
}

#app-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #243b3b;
}

.screen {
    position: absolute;
    inset: 0;
    width: 100%;
    max-width: 450px; 
    height: 100%;
    display: none;
    flex-direction: column;
    z-index: 10;
    overflow: hidden;
    margin: 0 auto;
}
.screen.active { display: flex; }

/* --- TOP HUD --- */
#top-hud {
    padding-top: env(safe-area-inset-top, 20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
}

#wave-info-center {
    background: rgba(0,0,0,0.6);
    border: var(--ui-border-thick);
    border-radius: 50px;
    padding: 5px 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}
#stage-name { font-size: 10px; color: #48d1cc; letter-spacing: 1px; }
#wave-display { font-size: 16px; font-weight: 900; }
#timer-display { font-family: var(--font-num); font-size: 24px; color: white; line-height: 1; margin-top: 2px; }

#enemy-progress-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.progress-track {
    width: 200px;
    height: 30px;
    background: #1e272e;
    border: var(--ui-border-thick);
    border-radius: 50px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}
#enemy-progress-fill {
    height: 100%;
    background: linear-gradient(0deg, #c0392b, #e74c3c);
    transition: width 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
#enemy-count-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-num);
    font-size: 16px;
    text-shadow: 0 2px 0 black;
}
.progress-icon {
    font-size: 24px;
    background: white;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: var(--ui-border-thick);
    transform: rotate(-10deg);
}

/* --- Player Status Pills --- */
#status-overlays {
    position: absolute;
    top: env(safe-area-inset-top, 20px);
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
.status-pill {
    background: rgba(0,0,0,0.4);
    padding: 4px 12px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-num);
    font-size: 18px;
    border: 2px solid rgba(255,255,255,0.1);
}

/* --- Game Canvas Area --- */
#game-main-content {
    flex: 1;
    position: relative; /* Contain absolute children or just ensure stacks */
    display: block; /* No longer flex to avoid side-by-side push */
    overflow: hidden;
}

.tab-pane {
    display: none;
    width: 100%;
    height: 100%;
}

.tab-pane.active {
    display: flex !important; /* Force display for the initial active tab */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#canvas-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
#game-canvas {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 40vh;
    border-radius: 8px;
    border: var(--ui-border-thick);
    background: #1e3535;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    display: block;
}

#hp-overlay { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); }
#hp-bar-container { width: 120px; height: 10px; background: #1e272e; border: 2px solid white; border-radius: 10px; overflow: hidden; }
#hp-bar-fill { height: 100%; width: 100%; background: #2ecc71; }
#hp-text { display: none; }

/* --- Bottom Control Panel --- */
#bottom-ops-panel {
    background: #243b3b;
    padding: 12px 15px calc(15px + env(safe-area-inset-bottom, 15px));
    border-top: var(--ui-border-thick);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Mobile / Small Screen Optimization (iPhone SE, Safari Mobile etc) --- */
@media (max-height: 850px) {
    #top-hud { padding-top: 5px; }
    #wave-info-center { padding: 4px 20px; scale: 0.9; }
    #timer-display { font-size: 18px; }
    
    #game-screen { padding: 5px; }
    #bottom-ops-panel { 
        gap: 8px; 
        padding: 8px 10px calc(80px + env(safe-area-inset-bottom, 20px)); 
    }
    
    .nav-btn-icon { width: 44px; height: 44px; font-size: 18px; }
    .btn-battle-start { width: 48px; height: 48px; font-size: 20px; }
    
    .btn-summon-modern { padding: 8px 10px; min-height: 60px; }
    .summon-label { font-size: 16px; }
    .summon-cost { font-size: 14px; }
    
    #strengthen-btn { padding: 10px; font-size: 16px; min-height: 50px; }
    
    #result-panel { padding: 20px; scale: 0.9; transform-origin: center; }
    #result-title { font-size: 36px; margin-bottom: 10px; }
    .btn-result-ok { padding: 12px 30px; font-size: 20px; }
    #result-panel { padding-bottom: calc(40px + env(safe-area-inset-bottom, 20px)); }
    
    .ops-main { gap: 8px; }
}

.ops-row-top { display: flex; justify-content: space-between; align-items: center; }
#stamina-pill {
    background: #1e272e;
    padding: 5px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-num);
    font-size: 20px;
}

.control-pills { display: flex; gap: 8px; }
.pill-btn {
    background: #34495e;
    border: 3px solid #1e272e;
    border-radius: 50px;
    color: white;
    padding: 4px 15px;
    font-family: var(--font-num);
    font-size: 14px;
    box-shadow: 0 3px 0 #1e272e;
}

.ops-main { display: flex; align-items: center; justify-content: space-between; gap: 15px; }

.side-nav-btns, .nav-control-btns { display: flex; flex-direction: column; gap: 10px; }
.nav-btn-icon {
    width: 54px;
    height: 54px;
    background: #576574;
    border: var(--ui-border-thick);
    border-radius: 12px;
    box-shadow: var(--ui-pushed);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}

.btn-battle-start {
    width: 64px;
    height: 64px;
    background: #222f3e;
    border: var(--ui-border-thick);
    border-radius: 50%;
    box-shadow: var(--ui-pushed);
    font-size: 30px;
    color: white;
}

/* BIG SUMMON BUTTONS */
.summon-area { flex: 1; }
.summon-btns-group {
    display: flex;
    gap: 8px;
    width: 100%;
}
.btn-summon-premium {
    flex: 1;
    background: linear-gradient(180deg, #fbc531, #f1c40f);
    border: var(--ui-border-thick);
    border-radius: 12px;
    padding: 6px 4px;
    box-shadow: 0 5px 0 #1e272e;
    cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: transform 0.1s;
}
.btn-summon-premium:active { transform: translateY(3px); box-shadow: 0 2px 0 #1e272e; }

.btn-summon-premium.x10 {
    background: linear-gradient(180deg, #ff9f43, #ee5253);
}

.summon-label { font-size: 16px; font-weight: 900; -webkit-text-stroke: 1px rgba(0,0,0,0.3); white-space: nowrap; }
.summon-cost { font-family: var(--font-num); font-size: 14px; color: white; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }

/* STRENGTHEN BAR */
.strengthen-section { width: 100%; }
.btn-strengthen-full {
    width: 100%;
    background: #00d2d3;
    border: var(--ui-border-thick);
    border-radius: 12px;
    padding: 10px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-size: 24px; font-weight: 900;
    box-shadow: var(--ui-pushed);
    transition: transform 0.1s;
}
.btn-strengthen-full:active { transform: translateY(2px); box-shadow: 0 2px 0 #1e272e; }

#bottom-tabs-decor {
    display: flex; justify-content: center; gap: 40px; margin-top: 5px;
}
#bottom-tabs-decor .nav-item {
    font-size: 12px;
    color: #8395a7;
    background: rgba(0,0,0,0.2);
    padding: 2px 15px;
    border-radius: 50px;
}

/* --- Modals & Overlays --- */
#strengthen-tab {
    position: absolute; left: 0; right: 0; bottom: -100%; 
    background: #2d4f4f; border-top: var(--ui-border-thick);
    padding: 30px 20px;
    transition: bottom 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 500; border-radius: 32px 32px 0 0;
}
#strengthen-tab.active { bottom: 0; }

.strengthen-grid { display: flex; flex-direction: column; gap: 10px; }
.st-item {
    background: rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px;
    display: flex; align-items: center; gap: 15px;
}
.st-icon { font-size: 32px; }
.st-info { flex: 1; display: flex; flex-direction: column; }
.st-label { font-size: 14px; color: #48d1cc; }
.st-level { font-family: var(--font-num); font-size: 18px; }
.st-buy-btn {
    background: var(--ui-gold);
    border: 2px solid #1e272e;
    border-radius: 8px;
    padding: 5px 15px;
    font-family: var(--font-num);
    box-shadow: 0 3px 0 #1e272e;
    color: #1e272e;
}

/* --- Results Panel --- */
#gameover-screen { justify-content: center; align-items: center; z-index: 5000; background: rgba(0,0,0,0.9); }
#result-panel {
    width: 90%; background: #2d4f4f; border: var(--ui-border-thick); border-radius: 32px; padding: 30px;
    text-align: center;
}
#result-title { font-size: 48px; -webkit-text-stroke: 2px black; }
.btn-result-ok {
    background: var(--ui-gold); border: var(--ui-border-thick); border-radius: 12px; padding: 15px 50px;
    font-size: 24px; box-shadow: var(--ui-pushed);
}

@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.btn-summon-premium:not(:disabled) { animation: pulse 2s infinite; }

.hidden { display: none !important; }

/* Version Indicator */
.version-badge { position: absolute; top: 10px; right: 10px; font-size: 8px; color: rgba(255,255,255,0.3); }

/* --- Start Screen --- */
#title-screen {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--ui-bg-forest), var(--ui-bg-dark));
    position: relative;
    overflow: hidden;
}

.forest-decor-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

#title-screen .title-content { 
    position: relative; 
    z-index: 10; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    background: rgba(0,0,0,0.4);
    padding: 40px;
    border-radius: 32px;
    border: var(--ui-border-thick);
    backdrop-filter: blur(10px);
}

.title-logo { text-align: center; margin-bottom: 40px; }
.title-emoji { font-size: 80px; display: block; filter: drop-shadow(0 0 20px var(--ui-gold)); animation: float 3s ease-in-out infinite; }
.title-logo h1 { 
    font-size: 56px; margin: 0; font-weight: 900; 
    color: white;
    -webkit-text-stroke: 2px black;
    letter-spacing: -2px; 
}
.subtitle { font-family: var(--font-jp); font-size: 14px; color: var(--ui-gold); letter-spacing: 2px; margin-top: -5px; }

/* Floating Spirits */
.spirit {
    position: absolute;
    font-size: 24px;
    filter: blur(2px) drop-shadow(0 0 10px var(--ui-teal-bright));
    animation: spirit-float 8s infinite ease-in-out;
    opacity: 0.6;
}

@keyframes spirit-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.4; }
    33% { transform: translate(30px, -50px) rotate(20deg); opacity: 0.8; }
    66% { transform: translate(-20px, -100px) rotate(-10deg); opacity: 0.3; }
}

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }

/* Redesigned Buttons for Title */
.btn-primary {
    background: var(--ui-gold);
    border: var(--ui-border-thick);
    border-radius: 12px;
    padding: 15px 40px;
    font-size: 24px;
    font-weight: 900;
    box-shadow: var(--ui-pushed);
    cursor: pointer;
    transition: transform 0.1s;
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 0 0 transparent; }

.btn-secondary {
    margin-top: 15px;
    background: #34495e;
    border: var(--ui-border-thick);
    border-radius: 12px;
    padding: 10px 30px;
    font-size: 16px;
    color: white;
    box-shadow: var(--ui-pushed);
}
/* --- Tab System --- */
.tab-pane { display: none; width: 100%; height: 100%; flex-direction: column; overflow-y: auto; padding: 20px; }
.tab-pane.active { display: flex; }

/* Hero Collection View Modern Styles */
.hero-grid-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid rgba(255,255,255,0.1); }
.hero-grid-header h2 { margin: 0; font-size: 22px; color: var(--ui-gold); }
.hero-stats-summary { font-size: 14px; background: rgba(0,0,0,0.3); padding: 5px 15px; border-radius: 20px; }

.hero-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    padding-bottom: 40px;
}

.hero-card-modern {
    background: rgba(45, 79, 79, 0.8);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 5px;
    text-align: center;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
    overflow: hidden;
}
.hero-card-modern.unlocked { border-color: var(--ui-teal-bright); background: rgba(30, 53, 53, 0.9); }
.hero-card-modern.locked { filter: grayscale(1) opacity(0.5); }

.hero-card-rarity {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 8px;
    font-weight: 900;
    padding: 2px 4px;
    border-radius: 4px;
    background: #576574;
}
.rarity-SSR { background: #f1c40f; color: #000; }
.rarity-SR { background: #9b59b6; color: #fff; }
.rarity-R { background: #3498db; color: #fff; }

.hero-card-emoji { font-size: 36px; display: block; margin: 5px 0; }
.hero-card-name { font-size: 10px; font-weight: 700; display: block; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hero-card-lv-box {
    background: rgba(0,0,0,0.4);
    border-radius: 6px;
    padding: 4px;
}
.hero-card-lv { font-family: var(--font-num); font-size: 12px; color: var(--ui-gold); display: block; margin-bottom: 3px; }

.hero-progress-track {
    width: 100%;
    height: 6px;
    background: #1e272e;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}
.hero-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #48d1cc, #3baea0);
    transition: width 0.3s;
}
.hero-card-count {
    position: absolute;
    bottom: 2px;
    right: 5px;
    font-size: 8px;
    font-family: var(--font-num);
    opacity: 0.8;
}

.upgrade-ready-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #4cd137;
    color: white;
    font-size: 8px;
    font-weight: 900;
    padding: 2px 4px;
    border-radius: 4px;
    animation: pulse-green 1s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76, 209, 55, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(76, 209, 55, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(76, 209, 55, 0); }
}
/* --- Modals --- */
.modal {
    display: none !important;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}
.modal.active { display: flex !important; }

.modal-content {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    text-align: center;
    animation: modal-pop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes modal-pop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.gacha-results {
    background: linear-gradient(135deg, #2d3436, #000000);
    border: 3px solid var(--ui-gold);
    border-radius: 20px;
    color: white;
}
.gacha-title { font-size: 28px; color: var(--ui-gold); margin-bottom: 20px; text-shadow: 0 0 10px rgba(251, 197, 49, 0.5); }
.gacha-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}
.gacha-item {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    animation: gacha-pop 0.3s backwards;
}
.gacha-item.rare { border-color: var(--ui-gold); background: rgba(251, 197, 49, 0.1); }
.gacha-item.new { position: relative; }
.gacha-item.new::after { content: 'NEW'; position: absolute; top: -5px; right: -5px; background: #ea2027; font-size: 8px; padding: 2px 4px; border-radius: 4px; font-weight: 900; }

.gacha-item-icon { font-size: 32px; display: block; margin-bottom: 5px; }
.gacha-item-name { font-size: 10px; opacity: 0.8; }

@keyframes gacha-pop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.how-to-grid { display: flex; flex-direction: column; gap: 20px; margin: 20px 0; text-align: left; }
.how-to-item { display: flex; gap: 15px; align-items: flex-start; }
.how-to-icon { font-size: 32px; background: rgba(255,255,255,0.1); padding: 10px; border-radius: 12px; }
.how-to-item h3 { margin: 0; font-size: 16px; color: var(--ui-gold); }
.how-to-item p { margin: 5px 0 0; font-size: 13px; opacity: 0.9; line-height: 1.4; }

/* --- Missions --- */
#mission-view { padding: 20px; overflow-y: auto; height: 100%; }
.mission-header { font-size: 18px; font-weight: 900; color: var(--ui-gold); margin-bottom: 15px; border-bottom: 2px solid var(--ui-gold); padding-bottom: 5px; }
.mission-list-container { display: flex; flex-direction: column; gap: 10px; padding-bottom: 40px; }
.mission-card {
    background: rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mission-info { flex: 1; }
.mission-title { font-size: 14px; font-weight: 700; color: #fff; }
.mission-progress-bar { width: 100%; height: 6px; background: #1e272e; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.mission-progress-fill { height: 100%; background: var(--ui-teal-bright); width: 0%; transition: width 0.3s; }
.mission-reward { font-family: var(--font-num); font-size: 14px; color: var(--ui-gold); margin-left: 15px; min-width: 60px; text-align: right; }
.mission-card.completed { border-color: var(--ui-gold); background: rgba(251, 197, 49, 0.1); }
.mission-card.completed .mission-progress-fill { background: var(--ui-gold); }

/* --- Victory State --- */
.victory-glow {
    box-shadow: 0 0 50px rgba(251, 197, 49, 0.5), inset 0 0 20px rgba(251, 197, 49, 0.5) !important;
    border-color: var(--ui-gold) !important;
}
.victory-text {
    background: linear-gradient(180deg, #fff, #fbc531);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(251, 197, 49, 0.8));
}

@keyframes rainbow-border {
    0% { border-color: #f1c40f; }
    33% { border-color: #e67e22; }
    66% { border-color: #f39c12; }
    100% { border-color: #f1c40f; }
}
.rainbow-active { animation: rainbow-border 2s linear infinite; }

/* --- Ending Screen (Celebratory) --- */
#ending-screen {
    z-index: 9000;
    background: radial-gradient(circle, rgba(15,23,42,0.95) 0%, rgba(2,6,23,1) 100%);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
#ending-screen.active { display: flex; animation: fade-in 1s forwards; }

.mission-complete-stamp {
    font-family: 'Potta One', var(--font-main);
    font-size: 60px;
    color: #fbc531;
    text-shadow: 0 0 30px rgba(251, 197, 49, 0.8), 0 0 60px rgba(251, 197, 49, 0.4);
    transform: scale(2);
    opacity: 0;
    animation: stamp-in 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    margin-bottom: 40px;
}

@keyframes stamp-in {
    0% { transform: scale(5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.credits-roll {
    text-align: center;
    color: white;
    font-family: var(--font-main);
    opacity: 0;
    animation: fade-in 2s 1s forwards;
}

.ending-stars {
    font-size: 40px;
    margin-top: 20px;
    animation: twinkle 1s infinite alternate;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes twinkle { from { opacity: 0.5; transform: scale(1); } to { opacity: 1; transform: scale(1.1); } }

.mvp-avatar { font-size: 80px; filter: drop-shadow(0 0 20px rgba(72,209,204,0.4)); }

/* Rewards Section */
.rewards-container-modern {
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid rgba(255,255,255,0.1);
}
.rewards-header {
    font-size: 14px;
    color: var(--ui-gold);
    margin-bottom: 10px;
    font-weight: 900;
}
.rewards-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.reward-item-modern {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 8px;
    width: 60px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.1);
}
.reward-icon-m { font-size: 24px; display: block; margin-bottom: 2px; }
.reward-val-m { font-family: var(--font-num); font-size: 12px; color: white; }

.stats-panel-modern {
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid rgba(255,255,255,0.1);
}

.ending-credits-wrap {
    width: 100%;
    height: 150px;
    overflow: hidden;
    background: rgba(0,0,0,0.05);
    border-radius: 12px;
    position: relative;
    margin-bottom: 20px;
}
#ending-credits {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: credits-scroll 15s linear infinite;
}
@keyframes credits-scroll {
    from { top: 100%; }
    to { top: -250%; }
}
.credit-section { margin-bottom: 30px; text-align: center; }
.credit-section h3 { font-size: 12px; color: #d946ef; margin-bottom: 5px; }
.credit-section p { font-size: 12px; margin: 2px 0; }
.thanks-final { font-size: 18px; font-weight: 900; color: #fbc531; text-shadow: 0 2px 0 #1e272e; margin-top: 10px; }

canvas#confetti-canvas {
    position: absolute;
    inset: 0;
    z-index: 6001;
    pointer-events: none;
}
