/* ===== CSS Variables: Neon Cyberpunk Theme ===== */
:root {
    --bg-dark: #0a0a0f;
    --bg-panel: rgba(20, 20, 30, 0.85);
    --border-light: rgba(0, 255, 255, 0.3);
    --neon-cyan: #00f3ff;
    --neon-pink: #ff00ea;
    --neon-green: #00ff66;
    --neon-yellow: #f0ff00;
    --neon-red: #ff2a2a;
    --text-primary: #f0f0f0;
    --text-muted: #8892b0;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Noto Sans JP', sans-serif;
    --color-r: #a0a0a0;
    --color-sr: #4da6ff;
    --color-ssr: #ffcc00;
    --color-ur: #ff00ea;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image:
        linear-gradient(rgba(0, 243, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.04) 1px, transparent 1px);
    background-size: 30px 30px;
}

.app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    height: 100dvh;
    max-height: 900px;
    background: radial-gradient(circle at top, #12122a 0%, var(--bg-dark) 100%);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.15);
    border-left: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.neon-text {
    font-family: var(--font-heading);
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan), 0 0 10px var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ===== Header ===== */
.top-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    z-index: 10;
    flex-wrap: nowrap;
}

.currency-box {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid;
    font-size: 0.85rem;
}

.credit-box {
    color: var(--neon-green);
    border-color: rgba(0, 255, 102, 0.3);
    text-shadow: 0 0 5px var(--neon-green);
}

.gem-box {
    color: var(--neon-pink);
    border-color: rgba(255, 0, 234, 0.3);
    text-shadow: 0 0 5px var(--neon-pink);
}

.level-box {
    font-family: var(--font-heading);
    color: var(--neon-cyan);
    font-size: 0.8em;
    margin-left: auto;
}

.btn-lang {
    font-family: var(--font-heading);
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 6px;
    height: 26px;
    border-radius: 4px;
    transition: all 0.2s;
    text-shadow: 0 0 5px var(--neon-cyan);
}

.btn-account {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(255, 0, 234, 0.4);
    background: rgba(255, 0, 234, 0.08);
    color: #ffd5fb;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-account::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -1px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #52606d;
    border: 2px solid #090b13;
}

.btn-account.authenticated::after {
    background: var(--neon-green);
}

.btn-account.syncing::after {
    background: var(--neon-yellow);
    box-shadow: 0 0 10px rgba(240, 255, 0, 0.55);
}

.btn-account:active {
    transform: scale(0.93);
}

.btn-lang:active {
    background: rgba(0, 243, 255, 0.2);
    transform: scale(0.9);
}

/* ===== Sub-bar: Stamina + EXP ===== */
.sub-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
}

.system-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    font-size: 0.7rem;
    line-height: 1.4;
}

.system-banner-copy {
    flex: 1;
    min-width: 0;
}

.system-banner-text {
    display: block;
}

.system-banner-action {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
}

.system-banner-action.hidden {
    display: none;
}

.system-banner.warn {
    background: rgba(255, 42, 42, 0.12);
    border-bottom: 1px solid rgba(255, 42, 42, 0.35);
    color: #ffb4b4;
}

.system-banner.info {
    background: rgba(0, 243, 255, 0.1);
    border-bottom: 1px solid rgba(0, 243, 255, 0.3);
    color: #b8fbff;
}

.system-banner.warn .system-banner-action {
    border: 1px solid rgba(255, 42, 42, 0.4);
    background: rgba(255, 42, 42, 0.14);
    color: #ffe2e2;
}

.system-banner.info .system-banner-action {
    border: 1px solid rgba(0, 243, 255, 0.35);
    background: rgba(0, 243, 255, 0.12);
    color: #d7feff;
}

.system-banner.hidden {
    display: none;
}

.stamina-section {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
}

.stamina-bar-container {
    flex-grow: 1;
    height: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 255, 102, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.stamina-bar-fill {
    height: 100%;
    width: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #00cc66, #00ff88);
    transition: width 0.3s ease;
}

.stamina-text {
    font-family: var(--font-heading);
    color: var(--neon-green);
    min-width: 50px;
    text-align: right;
}

.stamina-timer {
    font-family: var(--font-heading);
    color: var(--neon-yellow);
    font-size: 0.7rem;
    min-width: 35px;
}

.exp-section {
    width: 100%;
}

.exp-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.exp-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    transition: width 0.3s ease;
}

/* ===== Main Content ===== */
#main-content {
    flex-grow: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 15px;
    background: var(--bg-dark);
    transition: opacity 0.2s ease;
}

.view.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: 1;
}

.view.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    z-index: 5;
}

/* ===== Battle View ===== */
.battle-arena {
    height: 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.stage-display {
    position: absolute;
    top: 5px;
    left: 10px;
    font-family: var(--font-heading);
    color: var(--neon-pink);
    font-size: 0.8rem;
    text-shadow: 0 0 5px var(--neon-pink);
}

.stage-num {
    color: var(--neon-yellow);
}

.dps-meter {
    position: absolute;
    top: 5px;
    right: 10px;
    font-family: var(--font-heading);
    color: var(--neon-cyan);
    font-size: 0.9rem;
    text-shadow: 0 0 5px var(--neon-cyan);
}

.contract-chip {
    position: absolute;
    top: 36px;
    right: 10px;
    max-width: 48%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 213, 74, 0.4);
    background: rgba(255, 213, 74, 0.08);
    font-size: 0.63rem;
    line-height: 1.4;
    color: #ffeaa7;
    box-shadow: 0 0 16px rgba(255, 213, 74, 0.12);
}

.contract-chip.hidden {
    display: none;
}

.battle-loadout {
    position: absolute;
    top: 74px;
    left: 10px;
    width: min(220px, calc(100% - 32px));
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 243, 255, 0.2);
    background: rgba(5, 10, 20, 0.88);
    box-shadow: 0 0 18px rgba(0, 243, 255, 0.08);
    font-size: 0.58rem;
    line-height: 1.4;
    color: #d7feff;
    z-index: 20;
}

.battle-loadout.hidden {
    display: none;
}

.battle-loadout-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
}

.battle-loadout-row.compact {
    color: var(--text-primary);
}

.battle-loadout-row.compact.muted {
    color: var(--text-muted);
}

.battle-mix-pill {
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-family: var(--font-heading);
    letter-spacing: 0.04em;
}

.battle-mix-pill.tap {
    border-color: rgba(255, 120, 90, 0.28);
    color: #ffab8a;
}

.battle-mix-pill.auto {
    border-color: rgba(0, 243, 255, 0.3);
    color: var(--neon-cyan);
}

.battle-mix-pill.echo {
    border-color: rgba(164, 124, 255, 0.28);
    color: #cbb9ff;
}

.battle-loadout-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.battle-loadout-role {
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.battle-loadout-meta {
    color: var(--text-muted);
}

/* Combo Display */
.combo-display {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 20;
    transition: transform 0.2s ease;
}

.combo-display.hidden {
    display: none;
}

.combo-label {
    font-family: var(--font-heading);
    color: var(--neon-yellow);
    font-size: 0.7rem;
    letter-spacing: 3px;
}

.combo-count {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow), 0 0 20px var(--neon-yellow);
    animation: comboPulse 0.3s ease;
}

.combo-mult {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--neon-pink);
    text-shadow: 0 0 5px var(--neon-pink);
}

.combo-milestone {
    animation: comboFlash 0.4s ease !important;
}

@keyframes comboPulse {
    0% {
        transform: scale(1.3);
    }

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

@keyframes comboFlash {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(3);
    }
}

.enemy-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: default;
    position: relative;
}

.enemy.sprite {
    width: 130px;
    height: 130px;
    background-color: transparent;
    border: 2px solid var(--neon-red);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 42, 42, 0.5) inset, 0 0 10px rgba(255, 42, 42, 0.5);
    background-size: cover;
    background-position: center;
    transition: transform 0.05s ease;
    pointer-events: none;
}

.enemy.sprite:active {
    transform: scale(0.92);
}

.enemy.sprite.boss {
    width: 160px;
    height: 160px;
    animation: bossGlow 1s ease-in-out infinite alternate;
}

@keyframes bossGlow {
    0% {
        box-shadow: 0 0 20px rgba(255, 0, 234, 0.5) inset, 0 0 15px rgba(255, 0, 234, 0.5);
    }

    100% {
        box-shadow: 0 0 40px rgba(255, 0, 234, 0.8) inset, 0 0 30px rgba(255, 0, 234, 0.8);
    }
}

.health-bar-container {
    width: 200px;
    height: 12px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--neon-red);
    border-radius: 6px;
    overflow: hidden;
}

.health-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff0000, var(--neon-red));
    box-shadow: 0 0 10px var(--neon-red);
    transition: width 0.1s linear;
}

.enemy-name {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--neon-red);
    text-shadow: 0 0 5px var(--neon-red);
}

/* Floating combat text */
.floating-text {
    position: absolute;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 1.3rem;
    color: white;
    text-shadow: 0 0 5px var(--neon-red), -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    z-index: 100;
}

.floating-text.crit {
    color: var(--neon-yellow);
    font-size: 1.8rem;
    text-shadow: 0 0 10px var(--neon-yellow), -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    50% {
        transform: translateY(-30px) scale(1.2);
        opacity: 1;
    }

    100% {
        transform: translateY(-60px) scale(1);
        opacity: 0;
    }
}

.battle-controls {
    height: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 15px;
}

.tap-damage-info {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 8px;
}

/* ===== Buttons ===== */
.btn {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s ease;
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-primary);
}

.primary-btn {
    width: 80%;
    height: 70px;
    font-size: 1.3rem;
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3) inset, 0 0 10px rgba(0, 243, 255, 0.3);
    background: linear-gradient(180deg, rgba(0, 243, 255, 0.1) 0%, rgba(0, 0, 0, 0.8) 100%);
}

.primary-btn:active {
    transform: scale(0.95);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.6) inset, 0 0 20px rgba(0, 243, 255, 0.6);
}

.gacha-btn {
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 10px rgba(255, 0, 234, 0.2) inset;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gacha-btn.multi-pull {
    background: linear-gradient(45deg, rgba(255, 0, 234, 0.2), rgba(0, 0, 0, 0.8));
    border: 2px solid var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 234, 0.5) inset, 0 0 15px rgba(255, 0, 234, 0.3);
}

.gacha-btn:active {
    transform: scale(0.98);
}

/* ===== Gacha View ===== */
.gacha-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-top: 5px;
    height: 100%;
}

.gacha-container p {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

.gacha-banner {
    width: 100%;
    height: 180px;
    border: 1px solid var(--neon-pink);
    border-radius: 10px;
    background: rgba(255, 0, 234, 0.1);
    box-shadow: 0 0 20px rgba(255, 0, 234, 0.2);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.banner-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 0, 234, 0.3) 0%, rgba(0, 243, 255, 0.3) 100%);
    z-index: 1;
}

.rates {
    z-index: 2;
    background: rgba(0, 0, 0, 0.85);
    padding: 8px;
    font-size: 0.75rem;
    font-family: var(--font-heading);
    text-align: center;
    border-top: 1px solid rgba(255, 0, 234, 0.5);
}

.r-ur {
    color: var(--color-ur);
    text-shadow: 0 0 5px var(--color-ur);
}

.r-ssr {
    color: var(--color-ssr);
    text-shadow: 0 0 5px var(--color-ssr);
}

.r-sr {
    color: var(--color-sr);
}

.r-r {
    color: var(--color-r);
}

.gacha-actions {
    width: 100%;
    margin-top: auto;
    padding-bottom: 15px;
}

.debug-drawer {
    position: absolute;
    right: 10px;
    top: 84px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.debug-toggle {
    padding: 4px 8px;
    font-size: 0.65rem;
    border: 1px solid rgba(255, 204, 0, 0.4);
    color: var(--neon-yellow);
    background: rgba(10, 12, 22, 0.9);
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.15);
}

.debug-panel {
    width: min(360px, calc(100vw - 32px));
    max-height: 40vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 204, 0, 0.2);
    background: rgba(7, 9, 18, 0.96);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

.debug-panel.hidden {
    display: none;
}

.debug-panel-header,
.debug-panel-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.debug-panel-header {
    justify-content: space-between;
}

.debug-panel-title {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    color: var(--neon-yellow);
}

.debug-action {
    padding: 4px 7px;
    font-size: 0.6rem;
    border: 1px solid rgba(0, 243, 255, 0.35);
    color: var(--neon-cyan);
    background: transparent;
}

.debug-action.danger {
    border-color: rgba(255, 0, 234, 0.35);
    color: var(--neon-pink);
}

.debug-live-summary,
.debug-log-output {
    margin: 0;
    padding: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.58rem;
    line-height: 1.45;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.debug-live-summary {
    max-height: 110px;
}

.debug-log-output {
    max-height: 180px;
}

.debug-status {
    font-size: 0.58rem;
    color: var(--text-muted);
}

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.overlay.hidden {
    display: none;
}

.result-box {
    background: var(--bg-dark);
    border: 2px solid var(--neon-pink);
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    box-shadow: 0 0 30px rgba(255, 0, 234, 0.3);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gacha-result-box {
    align-items: stretch;
    max-width: 520px;
}

.gacha-result-box > h3,
.gacha-result-box > button {
    align-self: center;
}

.gacha-result-box .result-sprites {
    width: 100%;
}

.onboarding-box {
    align-items: stretch;
    gap: 18px;
}

.onboarding-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.onboarding-title {
    font-family: var(--font-heading);
    color: var(--neon-cyan);
    text-shadow: 0 0 12px rgba(0, 243, 255, 0.55);
    font-size: 1.4rem;
}

.onboarding-subtitle,
.onboarding-hint {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.6;
}

.onboarding-highlight {
    border: 1px solid rgba(0, 243, 255, 0.35);
    background: linear-gradient(135deg, rgba(0, 243, 255, 0.12), rgba(255, 0, 234, 0.1));
    border-radius: 10px;
    padding: 12px;
}

.onboarding-highlight-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.onboarding-highlight-name {
    font-family: var(--font-heading);
    color: var(--neon-yellow);
    font-size: 1rem;
}

.onboarding-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.onboarding-step {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    line-height: 1.5;
}

.onboarding-step-index {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 243, 255, 0.18);
    color: var(--neon-cyan);
    font-family: var(--font-heading);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.onboarding-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.account-box {
    align-items: stretch;
    gap: 14px;
    max-width: 430px;
    padding: 20px;
}

.account-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.account-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--neon-cyan);
}

.account-subtitle,
.account-summary-line,
.account-empty {
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.account-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.account-tab {
    padding: 10px 12px;
    font-size: 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
}

.account-tab.active {
    border-color: rgba(0, 243, 255, 0.35);
    color: var(--neon-cyan);
    box-shadow: inset 0 0 0 1px rgba(0, 243, 255, 0.18);
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-field label {
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.account-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 243, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    font-size: 0.85rem;
    user-select: text;
    -webkit-user-select: text;
}

.account-input:focus {
    outline: none;
    border-color: rgba(0, 243, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 243, 255, 0.08);
}

.account-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.account-actions.stack {
    grid-template-columns: 1fr;
}

.account-note,
.account-message {
    font-size: 0.7rem;
    line-height: 1.5;
}

.account-note {
    color: var(--text-muted);
}

.account-message {
    color: #ffe57d;
}

.account-message.error {
    color: #ffb4b4;
}

.account-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.account-user-name {
    font-family: var(--font-heading);
    color: var(--text-primary);
}

.account-user-email {
    font-size: 0.66rem;
    color: var(--text-muted);
}

.account-badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.58rem;
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 243, 255, 0.3);
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

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

.result-sprites {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    max-height: min(58vh, 480px);
    overflow-y: auto;
}

.gacha-item {
    width: 100%;
    min-height: 0;
    background: #222;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px;
    border: 2px solid #555;
    position: relative;
    overflow: hidden;
}

.gacha-item-top {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
}

.gacha-item-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.gacha-item-reasons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gacha-item .portrait {
    width: 60px;
    height: 60px;
    background-color: #333;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
}

.gacha-item .name {
    font-size: 0.76rem;
    text-align: left;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    width: 100%;
    color: var(--text-primary);
    line-height: 1.35;
}

.operator-result-meta,
.operator-result-passive {
    width: 100%;
    font-size: 0.48rem;
    line-height: 1.35;
    text-align: center;
    color: var(--text-muted);
}

.operator-result-passive {
    color: var(--neon-cyan);
}

.gacha-item .dupe-tag {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 204, 0, 0.9);
    color: #000;
    font-size: 0.5rem;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: bold;
}

.gacha-item .new-tag {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 243, 255, 0.9);
    color: #000;
    font-size: 0.5rem;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: bold;
}

.gacha-item.rarity-ur {
    border-color: var(--color-ur);
    box-shadow: 0 0 15px rgba(255, 0, 234, 0.5) inset;
    background: linear-gradient(180deg, rgba(255, 0, 234, 0.2) 0%, rgba(0, 0, 0, 1) 100%);
}

.gacha-item.rarity-ssr {
    border-color: var(--color-ssr);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.5) inset;
    background: linear-gradient(180deg, rgba(255, 204, 0, 0.2) 0%, rgba(0, 0, 0, 1) 100%);
}

.gacha-item.rarity-sr {
    border-color: var(--color-sr);
}

.gacha-item.rarity-r {
    border-color: var(--color-r);
}

/* ===== Roster View ===== */
.roster-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
}

.upgrade-global {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-light);
    border-radius: 5px;
    padding: 8px;
}

.upgrade-btn {
    width: 100%;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 8px 12px;
}

.upgrade-btn .cost-text {
    color: var(--neon-green);
    font-size: 0.85em;
}

.roster-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 15px;
}

.roster-card {
    display: flex;
    align-items: stretch;
    background: linear-gradient(180deg, rgba(18, 22, 35, 0.92), rgba(7, 11, 22, 0.88));
    border: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.roster-card.selected {
    border-color: rgba(255, 0, 234, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 0, 234, 0.22), 0 12px 28px rgba(255, 0, 234, 0.14);
}

.roster-card-main {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    width: 100%;
}

.roster-card.rarity-ur {
    border-color: var(--color-ur);
}

.roster-card.rarity-ssr {
    border-color: var(--color-ssr);
}

.roster-card.rarity-sr {
    border-color: var(--color-sr);
}

.roster-card.rarity-r {
    border-color: var(--color-r);
}

.roster-card .portrait {
    width: 56px;
    height: 56px;
    background: #333;
    border-radius: 10px;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    border: 2px solid #555;
    box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.05);
}

.roster-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.roster-card-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.roster-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
}

.roster-status-pill {
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    text-transform: uppercase;
}

.roster-status-pill.active {
    border-color: rgba(0, 255, 102, 0.35);
    color: var(--neon-green);
    background: rgba(0, 255, 102, 0.08);
}

.roster-status-pill.bench {
    border-color: rgba(255, 255, 255, 0.08);
}

.roster-status-pill.selected {
    border-color: rgba(255, 0, 234, 0.35);
    color: var(--neon-pink);
    background: rgba(255, 0, 234, 0.08);
}

.roster-info .name {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.35;
}

.roster-info .stars {
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.operator-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.operator-reason-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.operator-reason-stack.compact {
    gap: 5px;
}

.operator-meta-row.compact {
    margin-bottom: -2px;
}

.operator-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    border: 1px solid rgba(0, 243, 255, 0.18);
    background: rgba(0, 243, 255, 0.05);
    color: var(--neon-cyan);
    font-size: 0.56rem;
    letter-spacing: 0.04em;
}

.operator-meta-pill.muted {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

.operator-passive-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 0, 234, 0.16);
    background: rgba(255, 0, 234, 0.04);
    font-size: 0.62rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.operator-passive-row.compact {
    margin-bottom: -2px;
}

.operator-passive-row strong {
    color: var(--text-primary);
    font-size: 0.68rem;
}

.operator-passive-title {
    font-size: 0.52rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--neon-pink);
}

.operator-synergy-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid rgba(0, 243, 255, 0.18);
    background: rgba(0, 243, 255, 0.05);
    font-size: 0.62rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.operator-synergy-row.compact {
    margin-bottom: -2px;
}

.operator-synergy-row strong {
    color: var(--text-primary);
    font-size: 0.68rem;
}

.operator-synergy-row.active {
    border-color: rgba(0, 255, 102, 0.24);
    background: rgba(0, 255, 102, 0.06);
}

.operator-synergy-row.ready {
    border-color: rgba(255, 204, 0, 0.24);
    background: rgba(255, 204, 0, 0.06);
}

.operator-synergy-row.build {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.operator-synergy-status {
    display: inline-flex;
    align-self: flex-start;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.55rem;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
}

.operator-synergy-status.active {
    border-color: rgba(0, 255, 102, 0.3);
    color: var(--neon-green);
    background: rgba(0, 255, 102, 0.08);
}

.operator-synergy-status.ready {
    border-color: rgba(255, 204, 0, 0.28);
    color: var(--neon-yellow);
    background: rgba(255, 204, 0, 0.08);
}

.operator-synergy-status.build {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
}

.roster-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.roster-stat-box {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
    padding: 7px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.roster-stat-box span {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.roster-stat-box strong {
    font-size: 0.78rem;
    color: var(--text-primary);
}

.roster-stat-box.emphasis {
    border-color: rgba(0, 243, 255, 0.22);
    background: rgba(0, 243, 255, 0.06);
}

.roster-upgrade-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px dashed rgba(0, 255, 102, 0.24);
    background: rgba(0, 255, 102, 0.04);
    font-size: 0.62rem;
    color: var(--text-muted);
}

.roster-upgrade-line strong {
    color: var(--neon-green);
}

.gear-bonus {
    font-size: 0.62rem;
    color: var(--neon-yellow);
}

.roster-info .frag-info {
    font-size: 0.65rem;
    color: var(--neon-yellow);
}

.equipment-slot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.equipment-slot-chip {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px;
    border: 1px solid rgba(0, 243, 255, 0.15);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.35);
    font-size: 0.55rem;
}

.equipment-slot-chip span {
    color: var(--text-muted);
}

.equipment-slot-chip strong {
    color: var(--text-primary);
    font-weight: 700;
}

.roster-card-note {
    font-size: 0.63rem;
    line-height: 1.45;
    color: var(--text-muted);
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.roster-card-note.info {
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 243, 255, 0.18);
    background: rgba(0, 243, 255, 0.05);
}

.roster-card-note.armed {
    color: var(--neon-pink);
    border: 1px solid rgba(255, 0, 234, 0.22);
    background: rgba(255, 0, 234, 0.05);
}

.roster-card-note.locked {
    color: var(--neon-yellow);
    border: 1px solid rgba(255, 204, 0, 0.18);
    background: rgba(255, 204, 0, 0.05);
}

.roster-action-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.roster-action-sub {
    display: block;
    font-size: 0.58rem;
    opacity: 0.8;
    margin-top: 2px;
}

.squad-btn,
.gear-btn,
.disassemble-btn {
    min-height: 46px;
    padding: 8px 10px;
    font-size: 0.7rem;
    background: transparent;
}

.squad-btn {
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
}

.gear-btn {
    border: 1px solid var(--neon-pink);
    color: var(--neon-pink);
}

.gear-btn.selected {
    background: rgba(255, 0, 234, 0.12);
    box-shadow: 0 0 8px rgba(255, 0, 234, 0.3);
}

.disassemble-btn {
    border: 1px solid #8844cc;
    color: #b78dff;
    line-height: 1.2;
}

.disassemble-btn.armed {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    background: rgba(255, 0, 234, 0.08);
}

.lvl-up-btn {
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    background: transparent;
}

.lvl-up-btn:active {
    background: rgba(0, 255, 102, 0.2);
}

.lvl-up-btn:disabled {
    border-color: #555;
    color: #555;
    cursor: not-allowed;
}

.awaken-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    border: 1px solid var(--neon-yellow);
    color: var(--neon-yellow);
    background: rgba(255, 204, 0, 0.1);
    animation: awakeGlow 1s ease-in-out infinite alternate;
}

@keyframes awakeGlow {
    0% {
        box-shadow: 0 0 5px rgba(255, 204, 0, 0.3);
    }

    100% {
        box-shadow: 0 0 15px rgba(255, 204, 0, 0.6);
    }
}

.equipment-panel {
    border: 1px solid rgba(0, 243, 255, 0.25);
    border-radius: 14px;
    background: rgba(8, 12, 22, 0.92);
    padding: 12px;
    max-height: 48%;
    overflow-y: auto;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.equipment-panel.hidden {
    display: none;
}

.equipment-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 10px;
}

.equipment-summary-card {
    border-radius: 12px;
    border: 1px solid rgba(0, 243, 255, 0.16);
    background: rgba(0, 243, 255, 0.05);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.equipment-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.equipment-summary-stat {
    border-radius: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.equipment-summary-stat span {
    font-size: 0.54rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.equipment-summary-stat strong {
    font-size: 0.78rem;
    color: var(--text-primary);
}

.equipment-summary-stat.emphasis {
    border-color: rgba(0, 255, 102, 0.2);
    background: rgba(0, 255, 102, 0.06);
}

.equipment-summary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.equipment-summary-note {
    font-size: 0.64rem;
    line-height: 1.45;
    color: var(--neon-cyan);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(0, 243, 255, 0.16);
    background: rgba(0, 0, 0, 0.16);
}

.equipment-title {
    font-family: var(--font-heading);
    color: var(--neon-cyan);
    font-size: 0.85rem;
}

.equipment-subtitle,
.equipment-count {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.equipment-formula {
    margin-bottom: 10px;
    padding: 8px;
    border-radius: 6px;
    background: rgba(255, 204, 0, 0.06);
    border: 1px solid rgba(255, 204, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.equipment-formula-title {
    font-family: var(--font-heading);
    color: var(--neon-yellow);
    font-size: 0.72rem;
}

.equipment-slot-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
    margin-top: 8px;
}

.equipment-slot-section:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.equipment-slot-title {
    font-family: var(--font-heading);
    color: var(--neon-yellow);
    font-size: 0.72rem;
    margin-bottom: 6px;
}

.equipment-slot-caption {
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.equipment-current,
.equipment-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.equipment-current {
    margin-bottom: 6px;
    border-color: rgba(0, 255, 102, 0.18);
}

.equipment-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.equipment-item-name {
    font-size: 0.72rem;
    font-weight: 700;
}

.equipment-item-tag {
    font-size: 0.54rem;
    color: var(--neon-green);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
}

.equipment-item-meta,
.equipment-item-owner,
.equipment-empty {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.equipment-item-delta {
    font-size: 0.62rem;
    margin-top: 4px;
}

.equipment-item-delta.positive {
    color: var(--neon-green);
}

.equipment-item-delta.negative {
    color: #ff7070;
}

.equipment-empty {
    padding: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

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

.equipment-btn {
    padding: 4px 8px;
    font-size: 0.65rem;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    background: transparent;
}

.equipment-btn.enhance {
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
}

.equipment-btn:disabled {
    border-color: #555;
    color: #555;
    cursor: not-allowed;
}

/* ===== Missions View ===== */
.missions-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
    overflow-y: auto;
}

.ops-section {
    border: 1px solid rgba(0, 243, 255, 0.18);
    border-radius: 14px;
    background: rgba(11, 14, 26, 0.78);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ops-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ops-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ops-meta {
    font-size: 0.66rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.ops-refresh {
    padding: 7px 10px;
    font-size: 0.62rem;
    border: 1px solid rgba(0, 243, 255, 0.28);
    color: var(--neon-cyan);
}

.contract-list,
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contract-card,
.leaderboard-row {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.contract-card {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contract-card.active {
    border-color: rgba(255, 213, 74, 0.45);
    box-shadow: 0 0 18px rgba(255, 213, 74, 0.1);
}

.contract-card.claimable {
    border-color: rgba(0, 255, 102, 0.4);
}

.contract-card.claimed {
    opacity: 0.55;
}

.contract-card-head,
.contract-card-foot,
.leaderboard-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.contract-card-head {
    align-items: flex-start;
}

.contract-card-title {
    font-family: var(--font-heading);
    font-size: 0.76rem;
    color: #fff0bf;
}

.contract-card-desc,
.contract-card-mods,
.leaderboard-secondary {
    font-size: 0.66rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.contract-card-mods {
    color: #b8fbff;
}

.contract-pill {
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 0.58rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 213, 74, 0.35);
    color: #ffe57d;
    background: rgba(255, 213, 74, 0.08);
    flex-shrink: 0;
}

.contract-pill.claimable {
    border-color: rgba(0, 255, 102, 0.35);
    color: #9bffc0;
    background: rgba(0, 255, 102, 0.08);
}

.contract-progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.contract-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ffd54a, #ff8a00);
}

.contract-progress-text {
    font-size: 0.62rem;
    color: var(--text-muted);
}

.contract-action {
    padding: 8px 12px;
    font-size: 0.66rem;
}

.leaderboard-row {
    padding: 10px 12px;
}

.leaderboard-row.self {
    border-color: rgba(0, 243, 255, 0.32);
    box-shadow: inset 0 0 0 1px rgba(0, 243, 255, 0.14);
}

.leaderboard-rank {
    width: 28px;
    font-family: var(--font-heading);
    color: var(--neon-yellow);
    flex-shrink: 0;
}

.leaderboard-main {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-family: var(--font-heading);
    font-size: 0.74rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-score {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    color: var(--neon-pink);
    text-align: right;
}

.mission-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mission-type-header {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--neon-cyan);
    margin-top: 10px;
    flex: 1;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    padding-bottom: 5px;
}

.mission-claim-all {
    padding: 5px 9px;
    font-size: 0.62rem;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    background: rgba(0, 255, 102, 0.1);
}

.mission-claim-all.hidden {
    display: none;
}

.mission-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 20px;
}

.mission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(20, 20, 30, 0.8);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px;
}

.mission-item.claimable {
    border-color: var(--neon-green);
    box-shadow: 0 0 8px rgba(0, 255, 102, 0.3);
}

.mission-item.claimed {
    opacity: 0.5;
}

.mission-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mission-desc {
    font-size: 0.8rem;
    color: var(--text-primary);
}

.mission-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.mission-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.mission-progress-text {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.mission-reward {
    flex-shrink: 0;
}

.claim-btn {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    padding: 5px 10px;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    background: rgba(0, 255, 102, 0.1);
    border-radius: 4px;
    cursor: pointer;
    animation: awakeGlow 1s ease-in-out infinite alternate;
}

.claimed-text {
    color: #555;
    font-size: 0.7rem;
    font-family: var(--font-heading);
}

.reward-preview {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-family: var(--font-heading);
}

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--neon-red);
    color: #fff;
    font-size: 0.6rem;
    font-weight: bold;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    position: absolute;
    top: 5px;
    right: 10px;
}

/* ===== Login Bonus ===== */
.login-day {
    font-family: var(--font-heading);
    color: var(--neon-yellow);
    font-size: 1.5rem;
    text-shadow: 0 0 10px var(--neon-yellow);
}

.login-reward-display {
    padding: 15px;
    border: 2px solid var(--neon-yellow);
    border-radius: 10px;
    background: rgba(255, 204, 0, 0.1);
}

.login-reward-amount {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
    display: flex;
    min-height: 54px;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
    z-index: 10;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.nav-btn:last-child {
    border-right: none;
}

.nav-btn.active {
    color: var(--neon-cyan);
    background: linear-gradient(0deg, rgba(0, 243, 255, 0.1) 0%, transparent 100%);
    text-shadow: 0 0 5px var(--neon-cyan);
    border-top: 2px solid var(--neon-cyan);
}

.nav-btn.guided {
    color: #ffe57d;
    background: linear-gradient(0deg, rgba(255, 213, 74, 0.14) 0%, transparent 100%);
    text-shadow: 0 0 6px rgba(255, 213, 74, 0.7);
    animation: navGuidePulse 1s ease-in-out infinite alternate;
}

.nav-btn.guided.active {
    border-top-color: #ffd54a;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: var(--neon-pink);
    color: var(--bg-dark);
    font-size: 0.6rem;
    font-weight: 700;
    text-shadow: none;
    box-shadow: 0 0 10px rgba(255, 0, 234, 0.45);
}

/* ===== Animations ===== */
@keyframes shake {

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

    25% {
        transform: translateX(5px);
    }

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

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

@keyframes navGuidePulse {
    0% {
        box-shadow: inset 0 0 0 rgba(255, 213, 74, 0.05);
    }

    100% {
        box-shadow: inset 0 0 14px rgba(255, 213, 74, 0.18);
    }
}

/* ===== Dark Coin Currency ===== */
.darkcoin-box {
    color: #8844cc;
    border-color: rgba(136, 68, 204, 0.3);
    text-shadow: 0 0 5px #8844cc;
}

/* ===== GLITCH HACKING ===== */
.health-bar-wrapper {
    position: relative;
    width: 200px;
}

.glitch-node-container {
    position: absolute;
    top: -8px;
    left: 0;
    width: 100%;
    height: 30px;
    pointer-events: none;
}

.glitch-node {
    position: absolute;
    top: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    z-index: 50;
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    background: rgba(0, 243, 255, 0.2);
    font-size: 1rem;
    transition: transform 0.1s, opacity 0.2s;
}

.glitch-node.hidden {
    display: none;
}

.glitch-node.glitch-pulse {
    animation: glitchPulse 0.3s ease-in-out infinite alternate;
}

.glitch-node.glitch-success {
    background: rgba(0, 255, 102, 0.8);
    border-color: var(--neon-green);
    transform: scale(1.3);
    opacity: 0;
}

.glitch-node.glitch-fail {
    background: rgba(255, 42, 42, 0.8);
    border-color: var(--neon-red);
    transform: scale(0.5);
    opacity: 0;
}

.glitch-icon {
    text-shadow: 0 0 5px var(--neon-cyan);
}

@keyframes glitchPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 5px var(--neon-cyan);
    }

    100% {
        transform: scale(1.15);
        box-shadow: 0 0 15px var(--neon-cyan), 0 0 30px rgba(0, 243, 255, 0.3);
    }
}

/* System Crack Flash */
body.system-crack-flash {
    animation: crackFlash 0.5s ease;
}

@keyframes crackFlash {

    0%,
    100% {
        background-color: var(--bg-dark);
    }

    30% {
        background-color: rgba(0, 243, 255, 0.3);
    }
}

/* Backfire Flash */
body.backfire-flash {
    animation: backfireFlash 0.3s ease 3;
}

@keyframes backfireFlash {

    0%,
    100% {
        filter: none;
    }

    50% {
        filter: sepia(1) saturate(5) hue-rotate(-20deg) brightness(0.6);
    }
}

/* ===== ECHO COMBAT ===== */
.echo-display {
    position: absolute;
    top: 50px;
    left: 10px;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    z-index: 20;
}

.echo-display.hidden {
    display: none;
}

.echo-label {
    color: #8866ff;
    text-shadow: 0 0 5px #8866ff;
    letter-spacing: 2px;
    margin-right: 4px;
}

.echo-count {
    color: #aa88ff;
    text-shadow: 0 0 3px #8866ff;
    letter-spacing: 1px;
}

.echo-ghost-tap {
    position: absolute;
    font-size: 0.8rem;
    opacity: 0.5;
    animation: ghostFade 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes ghostFade {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(0.3) translateY(-15px);
    }
}

/* ===== NEURAL SYNC ===== */
.sync-bar-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.sync-bar {
    flex: 1;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
    max-width: 80px;
}

.sync-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.sync-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 2px;
}

.sync-skill {
    font-size: 0.55rem;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(0, 243, 255, 0.15);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: var(--neon-cyan);
}

.disassemble-btn:active {
    background: rgba(136, 68, 204, 0.2) !important;
}

/* ===== KARMA GACHA ===== */
.karma-section {
    width: 100%;
    margin-top: 10px;
    border: 1px solid rgba(255, 204, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 204, 0, 0.05);
}

.ticket-section {
    width: 100%;
    margin-top: 10px;
    border: 1px solid rgba(136, 68, 204, 0.35);
    border-radius: 8px;
    padding: 10px;
    background: rgba(136, 68, 204, 0.08);
}

.ticket-header {
    font-family: var(--font-heading);
    color: #b78dff;
    text-shadow: 0 0 5px rgba(183, 141, 255, 0.6);
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 8px;
}

.ticket-actions {
    display: flex;
    gap: 6px;
}

.ticket-btn {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem !important;
    padding: 8px !important;
    border: 1px solid #9c67ff !important;
    color: #d6bcff !important;
    background: transparent !important;
}

.ticket-btn.ssr {
    border-color: var(--color-ssr) !important;
    color: var(--color-ssr) !important;
}

.ticket-count {
    font-family: var(--font-heading);
    font-size: 0.72rem;
}

.ticket-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.karma-header {
    font-family: var(--font-heading);
    color: var(--neon-yellow);
    text-shadow: 0 0 5px var(--neon-yellow);
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 8px;
}

.karma-tickets {
    display: flex;
    gap: 5px;
}

.karma-btn {
    flex: 1;
    font-size: 0.6rem !important;
    padding: 6px 4px !important;
    border: 1px solid var(--neon-green) !important;
    color: var(--neon-green) !important;
    background: transparent !important;
    text-align: center;
}

.karma-btn.ssr {
    border-color: var(--color-ssr) !important;
    color: var(--color-ssr) !important;
}

.karma-btn.ur {
    border-color: var(--color-ur) !important;
    color: var(--color-ur) !important;
}

.karma-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gacha-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

/* ===== DARK MARKET ===== */
.market-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
}

.market-title-glow {
    text-shadow: 0 0 10px #8844cc, 0 0 20px #8844cc !important;
    color: #aa88ff !important;
}

.market-subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(136, 68, 204, 0.1);
    border: 1px solid rgba(136, 68, 204, 0.3);
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    color: #aa88ff;
}

.market-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 15px;
}

.market-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(20, 20, 30, 0.8);
    border: 1px solid rgba(136, 68, 204, 0.3);
    border-radius: 8px;
    padding: 10px;
    gap: 10px;
}

.market-item.sold {
    opacity: 0.4;
}

.market-item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.market-item-name {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    color: var(--text-primary);
}

.market-item-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.market-rarity {
    font-family: var(--font-heading);
    font-size: 0.7rem;
}

.market-buy-btn {
    font-family: var(--font-heading) !important;
    font-size: 0.75rem !important;
    padding: 6px 10px !important;
    border-radius: 5px;
    background: transparent !important;
    cursor: pointer;
}

.market-buy-btn:active {
    transform: scale(0.95);
}

.market-item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.market-buy-btn.locked {
    opacity: 0.45;
    cursor: not-allowed;
}

.market-lock-reason {
    color: var(--text-muted);
    font-size: 0.58rem;
    text-align: right;
}

.market-lock-reason span {
    color: var(--neon-yellow);
    margin-right: 4px;
}

.sold-label {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    color: #555;
}

@media (max-width: 480px) {
    .top-bar {
        gap: 6px;
        padding: 9px 10px;
    }

    .currency-box {
        padding: 4px 6px;
        font-size: 0.72rem;
    }

    .level-box {
        font-size: 0.72rem;
    }

    .view {
        padding: 12px;
    }

    .enemy.sprite {
        width: 116px;
        height: 116px;
    }

    .enemy.sprite.boss {
        width: 140px;
        height: 140px;
    }

    .health-bar-container,
    .health-bar-wrapper {
        width: 180px;
    }

    .primary-btn {
        width: 100%;
        height: 64px;
        font-size: 1.08rem;
    }

    .result-box {
        width: min(92%, 420px);
        padding: 16px;
    }

    .gacha-item-top {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .gacha-item .portrait {
        width: 52px;
        height: 52px;
    }

    .gacha-item .name {
        font-size: 0.72rem;
    }

    .account-actions {
        grid-template-columns: 1fr;
    }

    .onboarding-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 760px) {
    .battle-arena {
        height: 56%;
    }

    .battle-controls {
        height: 44%;
        padding-bottom: 10px;
    }

    .gacha-banner {
        height: 150px;
    }
}
