:root {
    --bg-deep: #020204;
    --glass-bg: rgba(10, 10, 18, 0.7);
    --glass-border: rgba(0, 229, 255, 0.15);
    --accent-cyan: #00e5ff;
    --accent-magenta: #ff00ff;
    --text-dim: #94a3b8;
    --text-bright: #f8fafc;
    --danger: #ef4444;
    --success: #4ade80;
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --bg-dots: rgba(0, 229, 255, 0.2);
}

/* THEMES */
body.theme-carbon {
    --accent-cyan: #f2f2f2;
    --accent-magenta: #a0a0a0;
    --glass-border: rgba(242, 242, 242, 0.2);
    --glass-bg: rgba(20, 20, 20, 0.9);
    --bg-deep: #0a0a0a;
    --bg-dots: rgba(242, 242, 242, 0.05);
}

body.theme-yellow {
    --accent-cyan: #fde047;
    --accent-magenta: #7c3aed;
    --glass-border: rgba(253, 224, 71, 0.25);
    --glass-bg: rgba(20, 10, 0, 0.85);
    --bg-deep: #1a1000;
    --bg-dots: rgba(253, 224, 71, 0.08);
}

body.theme-red {
    --accent-cyan: #ff0000;
    --accent-magenta: #ff4d4d;
    --glass-border: rgba(255, 0, 0, 0.4);
    --glass-bg: rgba(15, 0, 0, 0.9);
    --bg-deep: #050000;
    --bg-dots: rgba(255, 0, 0, 0.15);
}

body.theme-emerald {
    --accent-cyan: #10b981;
    --accent-magenta: #bef264;
    --glass-border: rgba(16, 185, 129, 0.2);
    --glass-bg: rgba(2, 20, 10, 0.9);
    --bg-deep: #020a05;
    --bg-dots: rgba(16, 185, 129, 0.12);
}

body.theme-nebula {
    --accent-cyan: #8b5cf6;
    --accent-magenta: #ec4899;
    --glass-border: rgba(139, 92, 246, 0.25);
    --glass-bg: rgba(10, 5, 20, 0.9);
    --bg-deep: #05020a;
    --bg-dots: rgba(139, 92, 246, 0.15);
}

body.theme-royal {
    --accent-cyan: #f59e0b;
    --accent-magenta: #ffffff;
    --glass-border: rgba(245, 158, 11, 0.3);
    --glass-bg: rgba(15, 10, 0, 0.9);
    --bg-deep: #0a0500;
    --bg-dots: rgba(245, 158, 11, 0.1);
}

body.theme-abyssal {
    --accent-cyan: #06b6d4;
    --accent-magenta: #312e81;
    --glass-border: rgba(6, 182, 212, 0.2);
    --glass-bg: rgba(0, 10, 20, 0.9);
    --bg-deep: #000205;
    --bg-dots: rgba(6, 182, 212, 0.1);
}

body.theme-noir {
    --accent-cyan: #ffffff;
    --accent-magenta: #444444;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(0, 0, 0, 0.95);
    --bg-deep: #000000;
    --bg-dots: rgba(255, 255, 255, 0.03);
    --text-dim: #666666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-deep, #020617);
    background-image:
        radial-gradient(var(--bg-dots, rgba(0, 229, 255, 0.5)) 1.5px, transparent 1.5px),
        linear-gradient(to bottom, var(--bg-deep, #020617), #000);
    background-size: 30px 30px, 100% 100%;
    animation: bgDotsRise 12s linear infinite;
    color: var(--text-bright);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    height: 100vh;
    overflow: hidden;
    padding: 1rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

@keyframes bgDotsRise {
    from {
        background-position: 0 0, 0 0;
    }

    to {
        background-position: 0 -30px, 0 0;
    }
}

img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- HEADER --- */
.main-header {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

.logo {
    font-size: 0.85rem;
    color: var(--accent-cyan);
    filter: drop-shadow(0 0 5px var(--accent-cyan));
}

.brand h1 {
    font-size: 0.85rem;
    letter-spacing: 2px;
    font-weight: 700;
}

.app-version {
    color: var(--text-dim);
    font-size: 0.52rem;
    letter-spacing: 0.06em;
    vertical-align: middle;
}

.medieval {
    color: var(--accent-magenta);
}

.global-stats {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    min-width: 0;
    flex: 0 0 auto;
}

.header-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    flex: 0 0 92px;
    height: 46px;
    padding: 0.45rem 0.6rem 0.45rem 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0%, transparent 100%);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.header-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--stat-color, var(--text-dim));
}

.header-stat .value {
    font-size: 0.98rem;
    line-height: 1.05;
    font-weight: 700;
    color: var(--stat-color, var(--accent-cyan));
    width: 66px;
    text-align: left;
    font-family: 'Montserrat', sans-serif;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-stat .label {
    font-size: 0.48rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: 0.15rem;
}

#level-stat {
    --stat-color: #f59e0b;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.1) 0%, transparent 100%);
    border-color: rgba(245, 158, 11, 0.22);
}

#click-stat {
    --stat-color: #4ade80;
    background: linear-gradient(90deg, rgba(74, 222, 128, 0.09) 0%, transparent 100%);
    border-color: rgba(74, 222, 128, 0.2);
}

#pps-stat {
    --stat-color: #a78bfa;
    --stat-glow: rgba(167, 139, 250, 0.26);
    background: linear-gradient(90deg, rgba(167, 139, 250, 0.09) 0%, transparent 100%);
    border-color: rgba(167, 139, 250, 0.2);
}

#sectors-stat {
    --stat-color: #38bdf8;
    --stat-glow: rgba(56, 189, 248, 0.25);
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.09) 0%, transparent 100%);
    border-color: rgba(56, 189, 248, 0.2);
}

.global-stats {
    display: flex;
    align-items: center;
}

.dashboard-controls {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-top-color: rgba(0, 229, 255, 0.1);
    border-radius: 8px;
    margin-top: 4px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-text {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.music-player {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.music-controls-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

.music-btn-small {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.6rem !important;
}

.music-title {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    white-space: nowrap;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
}

.volume-control i {
    font-size: 0.7rem;
}

#volume-slider {
    width: 60px;
    height: 3px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    pointer-events: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    cursor: pointer;
}

.header-actions {
    display: none;
}

.icon-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--accent-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.75rem;
}

.icon-btn:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
}

.icon-btn.danger {
    color: var(--accent-magenta);
}

.icon-btn.danger:hover {
    background: rgba(255, 0, 255, 0.1);
    border-color: var(--accent-magenta);
}

.theme-picker {
    display: flex;
    gap: 0.5rem;
    margin-right: 1rem;
    padding-right: 1rem;
    border-right: 1px solid var(--glass-border);
    align-items: center;
}

.theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s;
}

.theme-dot:hover {
    transform: scale(1.3);
    border-color: white;
}

.theme-dot.default {
    background: #00e5ff;
}

.theme-dot.carbon {
    background: #f2f2f2;
}

.theme-dot.yellow {
    background: #fde047;
}

.theme-dot.red {
    background: #ff0000;
}

.theme-dot.emerald {
    background: #10b981;
}

.theme-dot.nebula {
    background: #8b5cf6;
}

.theme-dot.royal {
    background: #f59e0b;
}

.theme-dot.abyssal {
    background: #06b6d4;
}

.theme-dot.noir {
    background: #111111;
    border: 1px solid #333;
}

.theme-dot.active {
    border-color: white;
}

/* DRAG & DROP */
.sortable-item {
    position: relative;
}

.drag-handle {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s;
    color: var(--accent-cyan);
    font-size: 0.6rem;
}

.sortable-item:hover .drag-handle {
    opacity: 1;
}

.sortable-ghost {
    opacity: 0.3;
    background: var(--accent-cyan) !important;
}

.sortable-chosen {
    border: 1px solid var(--accent-cyan) !important;
}

.drag-handle:active {
    cursor: grabbing;
}

/* --- MAIN GRID --- */
.game-grid {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
}

.dashboard-top {
    display: flex;
    gap: 1rem;
    height: 350px;
    flex-shrink: 0;
    width: 100%;
}

.dashboard-bottom {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    min-height: 0;
}

/* === UNIFIED CARD BASE === */
.dashboard-card {
    flex: 1;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-top .dashboard-card {
    height: 350px;
}

.primary-column {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-height: 0;
    overflow: hidden;
}

.card-header {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.combat-mission-head {
    flex-shrink: 0;
    margin-bottom: 0.45rem;
}

.nav-mission {
    flex: 1 1 520px;
    max-width: 680px;
    min-width: 280px;
    margin-bottom: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.1rem 0;
}

.combat-mission-row {
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0;
    border-bottom: 0;
    padding-bottom: 0.35rem;
}

.nav-mission .combat-mission-row {
    padding-top: 0;
}

.nav-mission .mission-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--accent-cyan);
    font-weight: 700;
}

.nav-mission .mission-code {
    color: #fff;
}

.combat-mission-row .mission-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.combat-mission-row .enemy-counter {
    flex: 0 0 88px;
    text-align: right;
    margin-bottom: 0;
    font-family: 'Montserrat', sans-serif;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.header-count {
    color: var(--text-dim);
    font-size: 0.6rem;
    opacity: 0.7;
}

.placeholder-content i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    animation: pulse 2s infinite;
}

.monster-name {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    opacity: 0.7;
}

.arena-visual {
    width: 100%;
    min-height: 220px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 25px;
    position: relative;
    position: relative;
    overflow: hidden;
    margin-top: -10px;
}

[data-id="arena"]::before,
[data-id="arena"]::after {
    content: '';
    position: absolute;
    left: -50%;
    right: -50%;
    height: 50%;
    background-image: 
        linear-gradient(var(--accent-cyan) 1.5px, transparent 1.5px),
        linear-gradient(90deg, var(--accent-cyan) 1.5px, transparent 1.5px);
    background-size: 50px 50px;
    background-position: center;
    opacity: 0.45; /* Much more visible */
    z-index: 1;
    animation: tronColorFade 8s infinite alternate ease-in-out;
}

[data-id="arena"]::before {
    top: 0;
    transform: perspective(400px) rotateX(-65deg);
    transform-origin: bottom;
    animation: gridMoveCeiling 0.25s linear infinite, tronColorFade 3s infinite linear, gridRotate 10s infinite ease-in-out alternate;
}

[data-id="arena"]::after {
    bottom: 0;
    transform: perspective(400px) rotateX(65deg);
    transform-origin: top;
    animation: gridMoveFloor 0.25s linear infinite, tronColorFade 3s infinite linear, gridRotate 10s infinite ease-in-out alternate;
}

@keyframes gridMoveFloor {
    from { background-position: center 0; }
    to { background-position: center 50px; }
}

@keyframes gridMoveCeiling {
    from { background-position: center 0; }
    to { background-position: center -50px; }
}

@keyframes tronColorFade {
    0% { filter: hue-rotate(0deg) brightness(1.2); }
    100% { filter: hue-rotate(360deg) brightness(1.2); }
}

@keyframes gridRotate {
    0% { rotate: 0deg; }
    25% { rotate: 15deg; }
    75% { rotate: -15deg; }
    100% { rotate: 0deg; }
}

.monster-anchor {
    background: none;
    border: none;
    padding: 0;
    cursor: crosshair;
    position: relative;
    z-index: 5;
    width: 128px;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease;
    outline: none;
    --enemy-halo-color: rgba(0, 229, 255, 0.34);
    --enemy-halo-speed: 4s;
}

.monster-anchor::before {
    content: '';
    position: absolute;
    width: 126%;
    height: 126%;
    background: radial-gradient(circle, var(--enemy-halo-color) 0%, transparent 72%);
    border-radius: 50%;
    z-index: 0;
    animation: monsterHaloPulse var(--enemy-halo-speed) infinite ease-in-out;
    pointer-events: none;
    filter: drop-shadow(0 0 10px var(--enemy-halo-color));
}

@keyframes monsterHaloPulse {

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

    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

.monster-anchor:active {
    transform: scale(0.95);
}

.monster-image {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3.2rem;
    animation: breathing 3s infinite ease-in-out;
    transition: transform 0.22s ease;
}

.monster-image img,
.monster-image i {
    max-width: 55%;
    max-height: 55%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    filter: drop-shadow(0 0 25px var(--enemy-halo-color));
    user-drag: none;
    -webkit-user-drag: none;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    transform: scale(var(--boss-sprite-scale, 1));
    transition: transform 0.22s ease;
}

.laser-beam {
    position: fixed;
    height: 5px;
    border-radius: 999px;
    pointer-events: none;
    z-index: 10000;
    transform-origin: left center;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(125, 249, 255, 0.96) 28%, rgba(0, 229, 255, 0.9) 68%, rgba(217, 70, 239, 0.78));
    box-shadow:
        0 0 6px rgba(255, 255, 255, 0.9),
        0 0 14px rgba(0, 229, 255, 0.88),
        0 0 26px rgba(217, 70, 239, 0.58);
}

.laser-beam::before,
.laser-beam::after {
    content: '';
    position: absolute;
    inset: 50% 0 auto;
    height: 1px;
    transform: translateY(-50%);
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.85);
}

.laser-beam::after {
    height: 13px;
    opacity: 0.28;
    filter: blur(7px);
    background: rgba(0, 229, 255, 0.9);
}

.laser-impact {
    position: fixed;
    width: 34px;
    height: 34px;
    border: 2px solid rgba(0, 229, 255, 0.92);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10001;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 10%, rgba(0, 229, 255, 0.58) 11% 35%, transparent 68%);
    box-shadow:
        0 0 16px rgba(0, 229, 255, 0.92),
        0 0 28px rgba(217, 70, 239, 0.52);
}

.monster-anchor.enemy-variant-special::before,
.monster-anchor.enemy-variant-elite::before,
.monster-anchor.enemy-variant-boss::before {
    width: 126%;
    height: 126%;
    opacity: 0.82;
}

.monster-anchor.enemy-variant-boss.boss-phase-2 .monster-image {
    --boss-sprite-scale: 1.14;
}

.monster-anchor.enemy-variant-boss.boss-phase-3 .monster-image {
    --boss-sprite-scale: 1.28;
    animation: bossRageShake 0.16s linear infinite;
}

.monster-anchor.enemy-variant-boss.boss-phase-2::before,
.monster-anchor.enemy-variant-boss.boss-phase-3::before {
    animation-timing-function: linear;
    filter: drop-shadow(0 0 12px var(--enemy-halo-color));
}

@keyframes bossRageShake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(-1px, 1px); }
    50% { transform: translate(1px, -1px); }
    75% { transform: translate(-1px, -1px); }
    100% { transform: translate(1px, 1px); }
}

.hp-gauge {
    width: 140px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.hp-fill {
    height: 100%;
    background: var(--accent-cyan);
    transition: width 0.3s ease;
}

.skills-bar {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-start;
    gap: 0.8rem;
    padding: 0.2rem 0.5rem;
}

.tabs-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.tab-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.55rem 0.9rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px 8px 0 0;
    color: var(--text-dim);
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tab-btn.active {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.tab-content {
    display: none;
    flex: 1;
    min-height: 0;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 0 12px 12px 12px;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

.side-placeholder-card {
    height: 350px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-dim);
    border: 1px dashed rgba(0, 229, 255, 0.1);
}

.upgrades-scroll {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    align-content: start;
    gap: 4px;
    padding: 6px;
    overflow-y: auto;
}

.upgrade-card,
.skill-shop-item {
    display: flex;
    flex-direction: column !important;
    gap: 4px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    transition: all 0.2s ease;
    min-height: 0 !important;
    overflow: hidden;
}

.upgrade-card.is-disabled,
.skill-shop-item.is-disabled {
    opacity: 0.4;
    filter: grayscale(0.8);
    pointer-events: none;
    cursor: not-allowed;
}

.skill-shop-item.locked {
    filter: blur(4px) grayscale(1);
    opacity: 0.3;
}

.skill-shop-item.owned {
    border-color: var(--success);
    background: rgba(74, 222, 128, 0.05);
}

.upgrade-card:hover,
.skill-shop-item:not(.locked):hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-cyan);
}

.item-row-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.item-icon {
    font-size: 0.85rem;
    color: var(--accent-cyan);
    flex-shrink: 0;
}

.item-name {
    flex: 1;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.item-level {
    font-size: 0.65rem;
    color: var(--accent-magenta);
    font-weight: 700;
    flex-shrink: 0;
}

.upgrade-milestone {
    font-size: 0.58rem;
    color: var(--text-dim);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: left;
}

.upgrade-card .buy-btn,
.skill-shop-item .buy-btn {
    width: 100% !important;
    height: 24px !important;
    padding: 0 8px !important;
    font-size: 0.6rem !important;
    font-weight: 700 !important;
    background: var(--accent-cyan);
    color: black;
    border-radius: 4px;
    text-transform: uppercase;
}

.upgrade-info h3 {
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.upgrade-info p {
    font-size: 0.55rem;
    color: var(--text-dim);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.buy-btn {
    width: 100%;
    background: var(--accent-cyan);
    border: none;
    color: black;
    padding: 0.7rem;
    margin-top: 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
}

/* --- SKILLS --- */
.skill-btn {
    width: 44px;
    height: 44px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--accent-cyan);
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.skill-btn.active {
    border-color: var(--accent-magenta);
}

.cooldown-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: rgba(0, 0, 0, 0.6);
}

.cooldown-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 2;
    pointer-events: none;
}

/* --- UTILS --- */
.hidden {
    display: none !important;
}

.notif-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background: var(--accent-magenta);
    border-radius: 50%;
}

@keyframes breathing {

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

    50% {
        transform: scale(1.05);
    }
}

/* SCROLLBARS */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

/* BESTIARY & STATS */
.bestiary-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 0.8rem;
    gap: 0.4rem;
    overflow-y: auto;
    align-content: start;
}

.bestiary-entry {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: border-color 0.3s;
}

.bestiary-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent-magenta);
}

.bestiary-info {
    flex: 1;
    min-width: 0;
}

.bestiary-info h4 {
    font-size: 0.65rem;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bestiary-qty {
    font-size: 0.6rem;
    color: var(--text-dim);
}

.bestiary-btn {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    cursor: not-allowed;
    transition: all 0.2s;
}

.bestiary-btn:not(:disabled) {
    cursor: pointer;
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.08);
}

.bestiary-btn:not(:disabled):hover {
    background: rgba(0, 229, 255, 0.2);
    transform: scale(1.05);
}

.stats-panel {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.stats-panel p {
    font-size: 0.68rem;
    margin: 0;
    color: var(--text-dim);
}

.stats-panel span {
    color: var(--accent-cyan);
    font-weight: 700;
}

.tier-progress-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tier-progress-full {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 229, 255, 0.22);
    background:
        linear-gradient(90deg, rgba(0, 229, 255, 0.1), transparent 60%),
        rgba(255, 255, 255, 0.03);
}

.tier-progress-full p {
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.stat-tile {
    min-height: 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 8px 9px;
    border-radius: 6px;
    border: 1px solid rgba(0, 229, 255, 0.18);
    background:
        linear-gradient(90deg, rgba(0, 229, 255, 0.08), transparent 55%),
        rgba(255, 255, 255, 0.03);
}

.stat-tile span {
    font-size: 0.5rem;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 700;
}

.stat-tile strong {
    font-size: 0.82rem;
    line-height: 1;
    color: #ffffff;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* CODEX STYLES */
.codex-container {
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
    text-align: left;
}

.codex-section {
    margin-bottom: 3rem;
}

.codex-section:last-child {
    margin-bottom: 0;
}

.codex-section h3 {
    color: var(--accent-magenta);
    font-size: 1.1rem;
    letter-spacing: 3px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 0, 255, 0.2);
    padding-bottom: 0.8rem;
    text-transform: uppercase;
}

.codex-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.codex-entry {
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--accent-cyan);
    padding: 0.8rem 1.2rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.codex-entry::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.05), transparent);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.codex-entry:hover {
    background: rgba(255, 255, 255, 0.04);
}

.codex-entry:hover::before {
    transform: translateX(0);
}

.codex-entry-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.4rem;
}

.codex-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent-cyan);
    opacity: 0.6;
    background: rgba(0, 229, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
}

.codex-entry h4 {
    color: #fff;
    font-size: 0.85rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.codex-entry p {
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-dim);
    margin: 0;
    padding-left: 0;
}

.codex-entry b {
    color: var(--accent-cyan);
}

.tier-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.tier-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
    transition: width 0.3s ease;
}

.skill-shop {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    align-content: start;
    padding: 6px;
    gap: 4px;
    overflow-y: auto;
}

.ship-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
    gap: 10px;
    height: 100%;
    padding: 8px;
    min-height: 280px;
}

.ship-stage {
    position: relative;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background:
        radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.14), transparent 52%),
        rgba(2, 6, 23, 0.82);
}

.ship-hull {
    position: absolute;
    inset: 14px;
    border: 2px solid rgba(34, 211, 238, 0.42);
    border-radius: 6px;
    overflow: hidden;
}

.ship-creatures {
    position: absolute;
    inset: 8px;
    display: grid;
    gap: 6px;
}

.ship-cell {
    position: relative;
    min-width: 0;
    min-height: 72px;
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 4px;
    background:
        linear-gradient(90deg, rgba(34, 211, 238, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(34, 211, 238, 0.08) 1px, transparent 1px),
        rgba(15, 23, 42, 0.46);
    background-size: 18px 18px;
    overflow: hidden;
}

.ship-cell.occupied {
    border-color: rgba(217, 70, 239, 0.34);
}

.ship-cell.empty,
.ship-cell.locked-slot {
    display: grid;
    place-items: center;
}

.ship-cell.empty::after,
.ship-cell.locked-slot::after {
    content: attr(data-label);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.ship-cell.empty {
    border-color: rgba(34, 211, 238, 0.32);
    background:
        linear-gradient(90deg, rgba(34, 211, 238, 0.08) 1px, transparent 1px),
        linear-gradient(0deg, rgba(34, 211, 238, 0.08) 1px, transparent 1px),
        rgba(15, 23, 42, 0.54);
}

.ship-cell.empty::after {
    color: rgba(34, 211, 238, 0.72);
}

.ship-cell.empty[data-label="PLACER"] {
    cursor: pointer;
    border-color: rgba(217, 70, 239, 0.5);
}

.ship-cell.empty[data-label="PLACER"]::after {
    color: var(--accent-magenta);
}

.ship-cell.locked-slot {
    border-color: rgba(148, 163, 184, 0.12);
    opacity: 0.46;
    background:
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(0deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        rgba(15, 23, 42, 0.32);
}

.ship-cell.locked-slot::after {
    color: rgba(148, 163, 184, 0.58);
}

.ship-creature {
    position: absolute;
    left: 50%;
    bottom: 13px;
    width: 50px;
    height: 50px;
    transform: translateX(-50%);
    animation: shipDrift var(--drift-time, 5.8s) ease-in-out infinite;
    animation-delay: var(--drift-delay, 0s);
    cursor: pointer;
}

.ship-creature-visual {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: end center;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transform-origin: 50% 82%;
    animation: shipIdle 2.8s ease-in-out infinite;
    animation-delay: var(--idle-delay, 0s);
}

.ship-creature img {
    width: 88%;
    height: 88%;
    object-fit: contain;
    object-position: bottom center;
    image-rendering: pixelated;
    pointer-events: none;
}

.ship-creature i {
    color: var(--accent-magenta);
}

.ship-creature-count {
    position: absolute;
    right: 5px;
    bottom: 5px;
    min-width: 20px;
    height: 16px;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--accent-magenta);
    color: #020617;
    font-size: 0.58rem;
    font-weight: 700;
}

.ship-care {
    display: flex;
    gap: 5px;
    pointer-events: none;
    z-index: 6;
}

.ship-mood {
    position: absolute;
    left: 5px;
    top: 5px;
}

.ship-affinity {
    position: absolute;
    left: 5px;
    bottom: 5px;
}

.ship-mood,
.ship-affinity {
    height: 16px;
    display: inline-grid;
    place-items: center;
    padding: 0 5px;
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-dim);
    font-size: 0.52rem;
    font-weight: 700;
}

.ship-mood.hungry {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.45);
}

.ship-mood.happy {
    color: var(--success);
    border-color: rgba(74, 222, 128, 0.45);
}

.ship-feed-btn {
    position: absolute;
    left: 5px;
    bottom: 25px;
    height: 20px;
    min-width: 30px;
    padding: 0 5px;
    border: 1px solid rgba(217, 70, 239, 0.45);
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--accent-magenta);
    font-size: 0.56rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 5;
}

.ship-remove-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 20px;
    height: 18px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(251, 113, 133, 0.45);
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--danger);
    font-size: 0.6rem;
    cursor: pointer;
    z-index: 7;
}

.ship-remove-btn:hover {
    background: rgba(251, 113, 133, 0.18);
}

.ship-feed-btn:hover {
    background: rgba(217, 70, 239, 0.18);
}

.ship-feed-btn,
.ship-module-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ship-speech {
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 60px;
    z-index: 6;
    min-height: 22px;
    padding: 4px 6px;
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 4px;
    background: rgba(2, 6, 23, 0.92);
    color: white;
    font-size: 0.58rem;
    line-height: 1.25;
    font-weight: 700;
    text-align: center;
    pointer-events: none;
}

.ship-speech.hidden {
    display: none;
}

.ship-bubble-fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 4;
}

.ship-bubble-particle {
    position: absolute;
    left: var(--bubble-x, 50%);
    bottom: 24px;
    width: var(--bubble-size, 8px);
    height: var(--bubble-size, 8px);
    border-radius: 50%;
    border: 1px solid rgba(34, 211, 238, 0.62);
    background: rgba(2, 6, 23, 0.68);
    box-shadow: inset 0 0 6px rgba(217, 70, 239, 0.18), 0 0 8px rgba(0, 229, 255, 0.2);
    opacity: 0;
    animation: shipBubbleRise 0.75s ease-out var(--bubble-delay, 0ms) forwards;
}

@keyframes shipBubbleRise {
    0% {
        transform: translate(-50%, 0) scale(0.55);
        opacity: 0;
    }
    25% {
        opacity: 0.9;
    }
    100% {
        transform: translate(-50%, -32px) scale(1.08);
        opacity: 0;
    }
}

.ship-empty-state {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text-dim);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.ship-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ship-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 8px;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.ship-stat-row strong {
    color: var(--accent-cyan);
}

.ship-modules-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow-y: auto;
}

.ship-module-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 8px;
    align-items: center;
    padding: 7px;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.ship-module-item.owned {
    border-color: var(--success);
    background: rgba(74, 222, 128, 0.05);
}

.ship-module-item.is-disabled {
    opacity: 0.52;
}

.ship-module-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ship-module-main > i {
    color: var(--accent-cyan);
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.ship-module-name {
    color: white;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ship-module-desc {
    color: var(--text-dim);
    font-size: 0.58rem;
    line-height: 1.25;
}

.ship-module-btn {
    width: 74px !important;
    height: 26px !important;
    padding: 0 4px !important;
    font-size: 0.58rem !important;
}

@keyframes shipDrift {
    0% {
        transform: translateX(-50%) translate(0, 0) rotate(-1deg);
    }

    22% {
        transform: translateX(-50%) translate(-10px, -5px) rotate(2deg);
    }

    48% {
        transform: translateX(-50%) translate(7px, -10px) rotate(-2deg);
    }

    72% {
        transform: translateX(-50%) translate(11px, -3px) rotate(1.5deg);
    }

    100% {
        transform: translateX(-50%) translate(0, 0) rotate(-1deg);
    }
}

@keyframes shipIdle {
    0%,
    100% {
        transform: scale(1) rotate(0deg);
        filter: brightness(1);
    }

    34% {
        transform: scale(1.04, 0.96) rotate(-2deg);
        filter: brightness(1.08);
    }

    64% {
        transform: scale(0.98, 1.05) rotate(2deg);
        filter: brightness(0.96);
    }
}

/* CONQUEST MAP */
.conquest-header {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    pointer-events: none;
}

.sectors-count {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--accent-cyan);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--accent-cyan);
    font-weight: 700;
    letter-spacing: 1px;
    backdrop-filter: blur(5px);
}

.conquest-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0a0a1a 0%, #020204 100%);
    overflow: hidden;
}

.conquest-ship {
    position: absolute;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

#conquest-map {
    width: 100%;
    height: 100%;
    cursor: grab;
}

#conquest-map:active {
    cursor: grabbing;
}

.node-info {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 200px;
    background: var(--glass-bg);
    border: 1px solid var(--accent-cyan);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    pointer-events: none;
    z-index: 10;
}

/* INVENTORY */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 4px;
    padding: 6px;
    overflow-y: auto;
    align-content: start;
}

.bestiary-entry.can-expedite {
    border-color: rgba(0, 229, 255, 0.3);
}

.bestiary-entry.ship-selected {
    border-color: var(--accent-magenta);
}

.bestiary-entry.ship-assigned {
    border-color: rgba(74, 222, 128, 0.28);
}

.bestiary-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    width: 82px;
}

/* EXPEDITIONS LIST */
.expeditions-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 5px;
}

.expeditions-list::-webkit-scrollbar {
    width: 3px;
}

.expeditions-list::-webkit-scrollbar-thumb {
    background: var(--accent-cyan);
    border-radius: 10px;
}

.placeholder-msg {
    font-size: 0.6rem;
    color: var(--text-dim);
    font-style: italic;
    margin-top: 1rem;
    opacity: 0.5;
}

.expedition-item {
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--accent-cyan);
    padding: 0.3rem 0.5rem;
    border-radius: 2px;
    animation: slideIn 0.3s ease-out;
}

.exp-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
    font-size: 0.55rem;
}

.exp-info i {
    color: var(--accent-cyan);
    width: 15px;
    text-align: center;
}

.exp-name {
    flex: 1;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.exp-time {
    color: var(--text-dim);
}

.exp-bar-bg {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1px;
    overflow: hidden;
}

.exp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
    transition: width 0.1s linear;
}

.artifact-card {
    min-height: 0;
    aspect-ratio: auto;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    padding: 6px 8px;
    overflow: hidden;
}

.artifact-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-magenta);
}

.artifact-icon {
    font-size: 0.85rem;
    color: var(--accent-magenta);
    margin-bottom: 0;
}

.artifact-name {
    flex: 1;
    font-size: 0.58rem;
    line-height: 1.15;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    color: #fff;
    text-transform: uppercase;
}

.artifact-meta {
    color: var(--text-dim);
    font-size: 0.52rem;
    line-height: 1.2;
    text-transform: uppercase;
}

.artifact-use-btn {
    height: 24px !important;
    padding: 0 8px !important;
    margin-top: 0 !important;
    font-size: 0.6rem !important;
}

/* Shared compact list-card language for desktop tabs */
.tab-content .bestiary-entry,
.tab-content .ship-module-item,
.tab-content .achievement-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 6px 8px;
    transition: all 0.2s ease;
}

.tab-content .bestiary-entry:hover,
.tab-content .ship-module-item:hover,
.tab-content .achievement-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-cyan);
}

.tab-content .bestiary-icon,
.tab-content .ach-icon {
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: var(--accent-cyan);
    font-size: 0.85rem;
}

.tab-content .bestiary-entry {
    gap: 0.5rem;
}

.tab-content .bestiary-info h4 {
    color: #fff;
    text-transform: uppercase;
}

.tab-content .bestiary-qty {
    margin-top: 2px;
    font-size: 0.52rem;
    text-transform: uppercase;
}

.tab-content .bestiary-actions {
    width: 76px;
    gap: 3px;
}

.tab-content .bestiary-btn {
    min-height: 22px;
    padding: 0 5px;
    font-size: 0.46rem;
    border-radius: 4px;
}

.tab-content .ship-module-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
}

.tab-content .ship-module-main {
    gap: 0.5rem;
}

.tab-content .ship-module-main > i {
    color: var(--accent-cyan);
    font-size: 0.85rem;
}

.tab-content .ship-module-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.tab-content .ship-module-btn {
    width: 100% !important;
    height: 24px !important;
    margin-top: 0 !important;
}

.floating-damage {
    position: fixed;
    font-weight: 700;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1000;
}

/* RANDOM EVENTS & BUFFS */
.random-event {
    position: absolute;
    width: 46px;
    height: 46px;
    background:
        radial-gradient(circle at 50% 72%, rgba(217, 70, 239, 0.16), transparent 58%),
        rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    font-size: 1.15rem;
    cursor: pointer;
    z-index: 8;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22), inset 0 0 14px rgba(0, 229, 255, 0.14);
    animation: pulseEvent 2s infinite, floatEvent 4s infinite ease-in-out;
}

body.red-alert-active .arena-visual::after {
    content: '';
    position: absolute;
    inset: 8px;
    pointer-events: none;
    border-radius: 10px;
    border: 1px solid rgba(251, 113, 133, 0.55);
    box-shadow: inset 0 0 28px rgba(251, 113, 133, 0.22), 0 0 16px rgba(251, 113, 133, 0.18);
    animation: redAlertPulse 0.8s ease-in-out infinite alternate;
    z-index: 3;
}

@keyframes redAlertPulse {
    from { opacity: 0.45; }
    to { opacity: 0.95; }
}

@keyframes pulseEvent {

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

    50% {
        transform: scale(1.2);
    }
}

@keyframes floatEvent {

    0%,
    100% {
        margin-top: 0;
    }

    50% {
        margin-top: -20px;
    }
}

.active-upgrades {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.combat-buffs {
    position: relative;
    z-index: 6;
    min-height: 37px;
    justify-content: center;
    align-items: center;
    margin-top: 0.35rem;
    padding: 0.25rem 0;
    pointer-events: none;
}

.buff-icon {
    width: 31px;
    height: 31px;
    background: rgba(255, 0, 255, 0.1);
    border: 1px solid var(--accent-magenta);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-magenta);
    font-size: 0.82rem;
    position: relative;
    overflow: hidden;
    pointer-events: auto;
}

.buff-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 0, 255, 0.3);
    pointer-events: none;
    z-index: 1;
}

.buff-time-text {
    position: absolute;
    bottom: 1px;
    right: 1px;
    font-size: 0.5rem;
    font-weight: 700;
    color: #fff;
    z-index: 2;
}

.buff-icon i {
    z-index: 2;
}

.buff-icon.active {
    animation: buffPulse 2s infinite alternate;
}

@keyframes buffPulse {
    from {
        opacity: 0.6;
    }

    to {
        opacity: 1;
    }
}

/* DASHBOARD RESOURCES */
.dashboard-resources {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    align-content: start;
    min-height: 0;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    padding: 0.55rem 0.65rem;
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.resource-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--accent-cyan);
}

.resource-item.essence {
    background: linear-gradient(90deg, rgba(0, 229, 255, 0.1) 0%, transparent 100%);
    border-color: rgba(0, 229, 255, 0.2);
}

.resource-item.ship-resource {
    background: linear-gradient(90deg, rgba(217, 70, 239, 0.1) 0%, transparent 100%);
    border-color: rgba(217, 70, 239, 0.2);
}

.resource-item.ship-resource::before {
    background: var(--accent-magenta);
}

.resource-item.ship-resource .res-icon,
.resource-item.ship-resource .res-value {
    color: var(--accent-magenta);
}

.resource-item.just-dropped {
    animation: resourceDropPulse 0.65s ease-out;
}

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

    35% {
        transform: scale(1.03);
    }

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

.res-icon {
    font-size: 1.05rem;
    color: var(--accent-cyan);
    width: 22px;
    display: flex;
    justify-content: center;
}

.res-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.res-label {
    font-size: 0.48rem;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 700;
}

.res-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-cyan);
    font-family: 'Montserrat', sans-serif;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-metrics .header-stat,
.dashboard-metrics .resource-item {
    height: 46px;
    padding: 0.45rem 0.6rem;
    width: 100%;
    flex: none;
}

.dashboard-metrics .res-details {
    width: 100%;
}

.dashboard-metrics .header-stat .value,
.dashboard-metrics .res-value {
    display: block;
    width: 100%;
    font-size: 0.98rem;
}

.dashboard-metrics .resource-item {
    min-width: 0;
}

.dashboard-primary-resource {
    grid-column: 1 / -1;
    height: 60px !important;
}

.dashboard-primary-resource .res-icon {
    font-size: 1.25rem;
    width: 28px;
}

.dashboard-primary-resource .res-value {
    font-size: 1.35rem !important;
    line-height: 1.1;
}

/* EXPLORATION HUD */

.exploration-hud {
    width: 100%;
    background: rgba(0, 255, 255, 0.03);
    border: 1px solid rgba(255, 0, 255, 0.2);
    padding: 0.6rem;
    border-radius: 4px;
    text-align: left;
    backdrop-filter: blur(10px);
    margin-bottom: 1rem;
}

.mission-label {
    font-size: 0.45rem;
    letter-spacing: 1px;
    margin-bottom: 2px;
    opacity: 0.6;
}

.enemy-counter {
    font-size: 0.55rem;
    margin-bottom: 4px;
    font-weight: 700;
}

.exploration-hud.hidden {
    display: none;
}

.toast-container {
    position: fixed;
    right: 18px;
    top: 18px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(340px, calc(100vw - 36px));
    pointer-events: none;
}

.toast-notif {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--accent-cyan);
    padding: 0.55rem 0.7rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: rewardSlideIn 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    backdrop-filter: blur(10px);
    min-width: 120px;
    min-height: 48px;
    pointer-events: auto;
    transform-origin: top right;
}

.toast-notif i {
    color: var(--accent-cyan);
    font-size: 0.85rem;
}

.toast-notif.fragment-drop {
    background: rgba(217, 70, 239, 0.12);
    border-color: var(--accent-magenta);
}

.toast-notif.fragment-drop i,
.toast-notif.fragment-drop h4 {
    color: var(--accent-magenta);
}

.toast-notif.success {
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--success);
}

.toast-notif.success i,
.toast-notif.success h4 {
    color: var(--success);
}

.toast-notif.skill {
    background: rgba(217, 70, 239, 0.1);
    border-color: var(--accent-magenta);
}

.toast-notif.skill i,
.toast-notif.skill h4 {
    color: var(--accent-magenta);
}

.toast-notif.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

.toast-notif.warning i,
.toast-notif.warning h4 {
    color: #f59e0b;
}

.toast-notif.danger {
    background: rgba(251, 113, 133, 0.1);
    border-color: var(--danger);
}

.toast-notif.danger i,
.toast-notif.danger h4 {
    color: var(--danger);
}

.toast-info h4 {
    font-size: 0.45rem;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.toast-info p {
    font-size: 0.65rem;
    font-weight: 700;
    margin: 1px 0 0 0;
    color: #fff;
}

@keyframes rewardSlideIn {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }

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

.mission-label {
    font-size: 0.5rem;
    color: var(--accent-magenta);
    letter-spacing: 1px;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.enemy-counter {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.3rem;
}

.exploration-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 0, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

#exploration-fill {
    width: 0%;
    height: 100%;
    background: var(--accent-magenta);
    transition: width 0.3s ease;
}

/* MODAL REWARD */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--glass-bg);
    border: 2px solid var(--accent-magenta);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.codex-modal-content {
    max-width: 900px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    text-align: left;
    border-color: var(--accent-cyan);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 229, 255, 0.05);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--accent-cyan);
    letter-spacing: 4px;
}

.reward-item {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.reward-item i {
    font-size: 3rem;
    color: var(--accent-magenta);
}

.reward-item h3 {
    color: #fff;
    font-size: 0.85rem;
}

.artifact-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--accent-magenta);
    color: white;
    font-size: 0.52rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    border: 1px solid white;
    z-index: 5;
}

.buff-rank {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent-magenta);
    padding: 0px 3px;
    border-radius: 3px;
    z-index: 10;
}

.monster-visuals.hidden {
    display: none;
}

.warp-feedback {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.05) 0%, rgba(0, 0, 0, 0) 80%);
    gap: 20px;
}

.warp-ship-image {
    width: 120px;
    height: auto;
    image-rendering: pixelated;
    animation: shipWarp 0.5s infinite alternate;
}

@keyframes shipWarp {
    from {
        transform: translateX(-5px);
    }

    to {
        transform: translateX(5px);
    }
}

.warp-text {
    color: var(--accent-cyan);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 3px;
    animation: warpPulse 1s infinite alternate;
}

@keyframes warpPulse {
    from {
        opacity: 0.5;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1.05);
    }
}

/* ACHIEVEMENTS */
.achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 1.5rem;
    overflow-y: auto;
    height: 100%;
    align-content: start;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.2s ease;
}

.achievement-card.is-earned {
    order: 1; /* Ready to claim at the very top */
    border-color: var(--accent-cyan);
    background: rgba(0, 229, 255, 0.05);
}

.achievement-card.is-locked {
    order: 2; /* In progress in the middle */
}

.achievement-card.is-claimed {
    order: 3; /* Completed at the bottom */
    opacity: 0.5;
    filter: grayscale(0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.ach-icon {
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.achievement-card.is-earned .ach-icon {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.ach-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.ach-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: 1px;
}

.ach-desc {
    font-size: 0.56rem;
    color: var(--text-dim);
    line-height: 1.25;
}

.ach-reward {
    margin-top: 2px;
    font-size: 0.6rem;
    color: var(--accent-magenta);
    font-weight: 700;
}

.claim-btn {
    background: var(--accent-cyan);
    color: black;
    border: none;
    padding: 7px 12px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    animation: claimPulse 1s infinite alternate;
    margin-left: auto;
    white-space: nowrap;
}

@keyframes claimPulse {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.claim-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* CASINO */
.casino-panel {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 190px 1fr 220px;
    gap: 12px;
    padding: 12px;
}

.casino-machine {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 0;
    border: 1px solid rgba(217, 70, 239, 0.28);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(217, 70, 239, 0.08), transparent),
        rgba(255, 255, 255, 0.03);
}

.casino-paytable {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow-y: auto;
}

.casino-paytable h3 {
    font-size: 0.65rem;
    color: var(--accent-magenta);
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.paytable-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.paytable-icon {
    font-size: 1.1rem;
    color: var(--accent-cyan);
    width: 24px;
    text-align: center;
}

.paytable-values {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.paytable-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    font-weight: 700;
}

.paytable-match {
    color: var(--text-dim);
}

.paytable-reward {
    color: white;
}

.paytable-reward i {
    font-size: 0.5rem;
    margin-right: 3px;
    color: var(--accent-cyan);
}

.casino-bets {
    display: grid;
    grid-template-columns: repeat(3, minmax(82px, 1fr));
    gap: 8px;
    width: min(420px, 92%);
}

.casino-bet {
    min-height: 42px;
    border: 1px solid rgba(0, 229, 255, 0.24);
    border-radius: 6px;
    background: rgba(2, 6, 23, 0.72);
    color: var(--text-dim);
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.casino-bet strong {
    display: block;
    margin-top: 3px;
    color: var(--accent-cyan);
    font-size: 0.72rem;
}

.casino-bet:hover,
.casino-bet.active {
    color: #fff;
    border-color: var(--accent-magenta);
    transform: translateY(-1px);
}

.casino-bet:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.casino-stage {
    display: grid;
    grid-template-columns: 78px minmax(0, auto) 78px;
    align-items: end;
    justify-content: center;
    gap: 12px;
    width: min(100%, 620px);
}

.casino-mascot {
    min-width: 0;
    height: 102px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    gap: 4px;
    color: var(--text-dim);
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.9;
}

.casino-mascot.empty {
    opacity: 0;
}

.casino-mascot-ring {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(0, 229, 255, 0.26);
    background:
        radial-gradient(circle at 50% 85%, rgba(217, 70, 239, 0.18), transparent 58%),
        rgba(2, 6, 23, 0.76);
}

.casino-mascot-visual {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: end center;
    transform-origin: 50% 90%;
    animation: casinoMascotIdle 2.6s ease-in-out infinite;
}

.casino-mascot-right .casino-mascot-visual {
    animation-delay: -0.8s;
}

.casino-mascot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    image-rendering: pixelated;
    pointer-events: none;
}

.casino-mascot i {
    color: var(--accent-magenta);
    font-size: 1.7rem;
}

.casino-stage.is-win .casino-mascot:not(.empty) .casino-mascot-visual {
    animation: casinoMascotJump 0.52s cubic-bezier(0.2, 0.9, 0.28, 1.25) 2;
}

.casino-stage.is-win .casino-mascot:not(.empty) .casino-mascot-ring {
    border-color: var(--accent-magenta);
}

.casino-reels {
    display: grid;
    grid-template-columns: repeat(var(--casino-reel-count, 3), minmax(48px, 78px));
    gap: 8px;
    width: min(100%, 422px);
}

.casino-reel {
    height: 86px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(0, 229, 255, 0.26);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.82);
    color: var(--accent-cyan);
    font-size: 1.55rem;
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

.casino-reel::before {
    content: "";
    position: absolute;
    inset: -40% 0;
    z-index: -1;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.14) 0 2px,
            transparent 2px 8px
        );
    opacity: 0;
    transform: translateY(-35%);
}

.casino-reels.is-spinning .casino-reel {
    animation: casinoPulse 0.18s steps(2, end) infinite;
}

.casino-reels.is-spinning .casino-reel::before {
    opacity: 0.55;
    animation: casinoScan 0.22s linear infinite;
}

.casino-reel.is-ticking i {
    animation: casinoIconFlicker 0.084s steps(2, end) infinite;
}

.casino-reel.is-winning {
    color: #fff;
    border-color: #fff;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.12), transparent 58%),
        rgba(2, 6, 23, 0.9);
}

.casino-reel.is-winning i {
    opacity: 1;
}

.casino-reels.is-jackpot .casino-reel {
    color: #fff;
    border-color: var(--accent-magenta);
    animation: casinoJackpot 0.7s ease-in-out 2;
}

.casino-status {
    min-height: 20px;
    color: var(--accent-cyan);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}

.casino-spin-btn {
    width: 190px;
}

.casino-odds {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

.casino-odds-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.62rem;
    text-transform: uppercase;
}

.casino-odds-row span {
    color: var(--text-dim);
}

.casino-odds-row strong {
    color: var(--accent-magenta);
    text-align: right;
}

@keyframes casinoPulse {
    0% { filter: saturate(1.2) brightness(1); }
    50% { filter: saturate(2.1) brightness(1.45); }
    100% { filter: saturate(1.35) brightness(1.08); }
}

@keyframes casinoScan {
    from { transform: translateY(-35%); }
    to { transform: translateY(35%); }
}

@keyframes casinoIconFlicker {
    0% { transform: translateY(-18px); opacity: 0.2; filter: blur(2px); }
    50% { transform: translateY(0); opacity: 1; filter: blur(0); }
    100% { transform: translateY(18px); opacity: 0.25; filter: blur(2px); }
}

@keyframes casinoWinGlow {
    from { transform: translateY(0); filter: brightness(1.1); }
    to { transform: translateY(-2px); filter: brightness(1.55); }
}

@keyframes casinoJackpot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes casinoMascotIdle {
    0%, 100% { transform: translateY(0) rotate(-1deg) scale(1); }
    50% { transform: translateY(-4px) rotate(1deg) scale(1.03); }
}

@keyframes casinoMascotJump {
    0%, 100% { transform: translateY(0) scale(1); }
    35% { transform: translateY(-24px) scale(1.08, 0.94); }
    62% { transform: translateY(2px) scale(0.96, 1.08); }
}

@media (max-width: 820px) {
    .casino-stage {
        grid-template-columns: 54px minmax(0, 1fr) 54px;
        gap: 6px;
    }

    .casino-mascot {
        height: 84px;
    }

    .casino-mascot-ring {
        width: 50px;
        height: 50px;
    }

    .casino-mascot-visual {
        width: 44px;
        height: 44px;
    }

    .casino-mascot span {
        display: none;
    }
}

.ach-status {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ach-status.claimed { color: var(--success); }
.ach-status.locked { color: var(--text-dim); }

/* Achievements keep a richer card layout than compact list tabs */
#tab-achievements .achievements-list {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    padding: 8px;
}

#tab-achievements .achievement-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-height: 132px;
    padding: 12px;
    border-radius: 7px;
    overflow: hidden;
}

#tab-achievements .ach-info {
    min-width: 0;
    display: contents;
    gap: 0;
    padding-right: 0;
    padding-top: 0;
}

#tab-achievements .ach-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.64rem;
    line-height: 1.25;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: normal;
    overflow-wrap: anywhere;
}

#tab-achievements .ach-name i {
    color: var(--accent-cyan);
    font-size: 0.8rem;
    flex: 0 0 auto;
}

#tab-achievements .ach-desc {
    font-size: 0.56rem;
    line-height: 1.35;
    color: var(--text-dim);
}

#tab-achievements .ach-reward {
    font-size: 0.5rem;
    line-height: 1.2;
    color: var(--accent-magenta);
}

#tab-achievements .ach-status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    font-size: 0.54rem;
    line-height: 1.25;
}

#tab-achievements .ach-status {
    position: static;
    flex: 0 0 auto;
    font-size: 0.5rem;
    max-width: none;
    text-align: left;
}

#tab-achievements .claim-btn {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 28px;
    padding: 0 7px;
    font-size: 0.54rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hidden {
    display: none !important;
}


[data-id="arena"] {
    perspective: 1000px;
}

/* Compact titles inside desktop tab panels */
.tab-content .item-name,
.tab-content .upgrade-info h3,
.tab-content .bestiary-info h4,
.tab-content .ship-module-name,
.tab-content .artifact-name,
.tab-content .ach-name,
.tab-content .codex-card h4,
.tab-content .stat-tile span {
    font-size: 0.58rem;
    line-height: 1.15;
    letter-spacing: 0.03em;
}

.tab-content .item-name,
.tab-content .bestiary-info h4,
.tab-content .ship-module-name,
.tab-content .artifact-name,
.tab-content .ach-name {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.tab-content .upgrade-info h3 {
    -webkit-line-clamp: 3;
}

.tab-content .ship-module-desc,
.tab-content .ach-desc,
.tab-content .codex-card p {
    font-size: 0.54rem;
    line-height: 1.25;
}

/* Passive Fragment Bubble */
.ship-bubble {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-magenta);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 900;
    box-shadow: 0 0 10px rgba(217, 70, 239, 0.5);
    cursor: pointer;
    z-index: 100;
    animation: bubbleFloat 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ship-bubble i {
    font-size: 0.55rem;
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}
