/* ==========================================================================
   PacMan Neon Arcade Multi-Screen Flow Styles
   ========================================================================== */

body.in-game .neon-bg-stage,
body.in-game .top-bar,
body.in-game .flow-root {
    display: none !important;
}

.neon-bg-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 18%, rgba(0, 229, 255, 0.16), transparent 44%),
        radial-gradient(circle at 82% 24%, rgba(199, 125, 255, 0.16), transparent 46%),
        radial-gradient(circle at 50% 88%, rgba(255, 209, 102, 0.12), transparent 52%),
        linear-gradient(180deg, #090d18 0%, #0b0e16 55%, #070910 100%);
}

.neon-bg-grid {
    position: absolute;
    left: -15%;
    right: -15%;
    bottom: -26%;
    height: 74%;
    background-image:
        linear-gradient(to right, rgba(0, 229, 255, 0.12) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(199, 125, 255, 0.11) 1px, transparent 1px);
    background-size: 48px 48px;
    transform: perspective(540px) rotateX(62deg);
    transform-origin: center bottom;
    will-change: transform;
    animation: neonGridScroll 14s linear infinite;
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 90%);
}

.neon-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(55px);
    opacity: 0.42;
    animation: neonOrbFloat 11s ease-in-out infinite alternate;
}

.neon-bg-orb--cyan {
    width: 320px;
    height: 320px;
    top: -60px;
    left: -60px;
    background: rgba(0, 229, 255, 0.35);
}

.neon-bg-orb--crimson {
    width: 280px;
    height: 280px;
    bottom: 8%;
    right: -50px;
    background: rgba(255, 71, 87, 0.28);
    animation-delay: -4s;
}

.neon-bg-orb--gold {
    width: 220px;
    height: 220px;
    top: 38%;
    left: 44%;
    background: rgba(255, 209, 102, 0.18);
    animation-delay: -7s;
}

@keyframes neonGridScroll {
    0% { transform: perspective(540px) rotateX(62deg) translate3d(0, 0, 0); }
    100% { transform: perspective(540px) rotateX(62deg) translate3d(0, 48px, 0); }
}

@keyframes neonOrbFloat {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(28px, 18px) scale(1.12); }
}

/* Flow Shell */
.flow-root {
    position: relative;
    z-index: 10;
    max-width: 1240px;
    margin: 0 auto;
    padding: 18px 20px 44px;
    min-height: calc(100vh - 68px);
    display: flex;
    flex-direction: column;
}

.flow-screen {
    width: 100%;
    animation: flowFadeIn 0.28s ease-out;
}

@keyframes flowFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.screen-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.screen-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.screen-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    color: var(--text-primary);
    text-shadow: 0 0 18px rgba(0, 229, 255, 0.35);
}

.btn-back-arrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(15, 22, 38, 0.85);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back-arrow:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.28);
    transform: translateX(-2px);
}

/* Header Profile & Shop Pill Enhancements */
.player-chip--interactive {
    cursor: pointer;
    transition: all 0.2s;
}

.player-chip--interactive:hover {
    border-color: var(--color-cyan);
    background: rgba(0, 229, 255, 0.14);
}

.header-avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--color-cyan);
}

.lvl-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.28), rgba(251, 133, 0, 0.22));
    border: 1px solid rgba(255, 209, 102, 0.55);
    color: var(--color-gold);
}

.btn-shop-header {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, rgba(199, 125, 255, 0.25), rgba(0, 229, 255, 0.2));
    border: 1px solid rgba(199, 125, 255, 0.5);
    color: #f3e8ff;
}

.btn-shop-header:hover:not(:disabled) {
    border-color: var(--color-cyan);
    box-shadow: 0 0 18px rgba(199, 125, 255, 0.35);
}

/* ==========================================================================
   SCREEN 1: MAIN MENU
   ========================================================================== */
.main-menu-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 12px 36px;
    position: relative;
}

.menu-quick-dock {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    z-index: 5;
}

.shop-corner-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 209, 102, 0.5);
    background: linear-gradient(135deg, rgba(28, 22, 48, 0.92), rgba(17, 25, 44, 0.92));
    color: #fff;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    box-shadow: 0 0 24px rgba(255, 209, 102, 0.22);
    transition: all 0.22s;
}

.shop-corner-btn:hover {
    transform: translateY(-2px);
    border-color: var(--color-gold);
    box-shadow: 0 0 30px rgba(255, 209, 102, 0.42);
}

.shop-corner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    overflow: hidden;
}

.menu-hero-card {
    width: 100%;
    max-width: 640px;
    padding: 34px 28px 30px;
    border-radius: 26px;
    background: rgba(15, 21, 36, 0.82);
    border: 1px solid rgba(0, 229, 255, 0.32);
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.65),
        0 0 42px rgba(0, 229, 255, 0.16),
        inset 0 0 30px rgba(199, 125, 255, 0.08);
    backdrop-filter: blur(14px);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.menu-hero-emblem {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 18px;
}

.menu-emblem-runner,
.menu-emblem-boss {
    width: 78px;
    height: 78px;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(0, 229, 255, 0.55));
    animation: heroBob 3.2s ease-in-out infinite;
}

.menu-emblem-boss {
    width: 88px;
    height: 88px;
    display: block;
    filter: drop-shadow(0 0 22px rgba(255, 71, 87, 0.6));
    animation-delay: -1.4s;
}

.menu-emblem-vs {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--color-gold);
    text-shadow: 0 0 16px rgba(255, 209, 102, 0.65);
}

@keyframes heroBob {
    0%, 100% { transform: translateY(0px) rotate(-2deg); }
    50% { transform: translateY(-7px) rotate(2deg); }
}

.menu-hero-title {
    margin: 0 0 6px;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.1rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    background: linear-gradient(90deg, #ffd166, #00e5ff, #c77dff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
}

.menu-hero-sub {
    margin: 0 0 26px;
    color: var(--text-secondary);
    font-size: 0.98rem;
}

.menu-cta-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 340px;
    margin: 0 auto;
}

.btn-neon-play {
    padding: 16px 28px;
    font-size: 1.18rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffd166 0%, #fb8500 100%);
    color: #0b0e16;
    box-shadow: 0 0 28px rgba(255, 209, 102, 0.45);
    border: 1px solid rgba(255, 232, 160, 0.8);
}

.btn-neon-play:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 38px rgba(255, 209, 102, 0.72);
    background: linear-gradient(135deg, #ffe294 0%, #ff991f 100%);
}

.btn-neon-tutorial {
    padding: 13px 24px;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 14px;
    background: rgba(0, 229, 255, 0.14);
    border: 1px solid rgba(0, 229, 255, 0.48);
    color: #bdf7ff;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.16);
}

.btn-neon-tutorial:hover:not(:disabled) {
    background: rgba(0, 229, 255, 0.24);
    box-shadow: 0 0 24px rgba(0, 229, 255, 0.35);
}

/* ==========================================================================
   SCREEN 2: MODE SELECT (CO-OP vs PVP)
   ========================================================================== */
.mode-banners-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    margin: 12px 0 24px;
    align-items: stretch;
}

.mode-banner-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(16, 22, 38, 0.92);
    border: 2px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    text-align: left;
    padding: 0;
    color: var(--text-primary);
    transition: transform 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.2), border-color 0.24s, box-shadow 0.24s;
}

.mode-banner-card:hover {
    border-color: rgba(0, 229, 255, 0.45);
    transform: translateY(-3px);
}

.mode-banner-card.active {
    transform: scale(1.03);
    border-color: var(--color-cyan);
    box-shadow: 0 0 36px rgba(0, 229, 255, 0.34);
    z-index: 2;
}

.mode-banner-card--pvp.active {
    border-color: var(--color-crimson);
    box-shadow: 0 0 36px rgba(255, 71, 87, 0.38);
}

.mode-banner-card.locked {
    filter: saturate(0.65);
}

.mode-carousel-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #080b14;
}

.mode-carousel-track {
    display: flex;
    width: 300%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.85, 0.35, 1);
}

.mode-carousel-slide {
    width: 33.3333%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mode-carousel-dots {
    position: absolute;
    bottom: 10px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 3;
}

.mode-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transition: all 0.2s;
}

.mode-carousel-dot.active {
    width: 20px;
    border-radius: 999px;
    background: var(--color-cyan);
    box-shadow: 0 0 10px var(--color-cyan);
}

.mode-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 11, 20, 0.56);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 4;
}

.mode-lock-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(18, 24, 42, 0.94);
    border: 1.5px solid rgba(255, 209, 102, 0.7);
    color: var(--color-gold);
    font-weight: 900;
    font-size: 0.98rem;
    box-shadow: 0 0 22px rgba(255, 209, 102, 0.32);
}

.mode-banner-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mode-banner-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mode-banner-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--text-primary);
}

.mode-banner-desc {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.42;
}

.mode-proceed-bar {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.btn-mode-proceed {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 36px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 1.08rem;
    font-weight: 900;
    cursor: not-allowed;
    transition: all 0.25s;
}

.btn-mode-proceed.lit {
    cursor: pointer;
    border-color: var(--color-cyan);
    background: linear-gradient(135deg, #00e5ff, #0096c7);
    color: #06131d;
    box-shadow: 0 0 32px rgba(0, 229, 255, 0.58);
    animation: arrowPulseGlow 1.6s ease-in-out infinite;
}

.btn-mode-proceed.lit:hover {
    transform: translateY(-2px) scale(1.04);
}

@keyframes arrowPulseGlow {
    0%, 100% { opacity: 0.88; }
    50% { opacity: 1; }
}

/* ==========================================================================
   SCREEN 3: CO-OP FLOATING ISLANDS CAROUSEL (1 CENTER + HALF SIDES) & BOSSES
   ========================================================================== */
.worlds-island-carousel {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.worlds-island-viewport {
    --island-w: 48%;
    --island-margin: 2.5%;
    --island-pitch: 53%;
    --island-center-offset: 23.5%;
    --active-island: 2;
    flex: 1;
    overflow: hidden;
    padding: 14px 0 20px;
    mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.worlds-island-track {
    display: flex;
    align-items: stretch;
    transform: translateX(calc(var(--island-center-offset) - (var(--active-island) * var(--island-pitch))));
    transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.world-island-card {
    position: relative;
    flex: 0 0 var(--island-w);
    width: var(--island-w);
    margin: 0 var(--island-margin);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 14px 16px;
    border-radius: 24px;
    background: radial-gradient(circle at 50% 35%, rgba(28, 38, 66, 0.92), rgba(11, 15, 28, 0.95));
    border: 2px solid rgba(255, 255, 255, 0.14);
    color: var(--text-primary);
    cursor: pointer;
    text-align: center;
    transform: scale(0.84);
    opacity: 0.58;
    filter: saturate(0.75);
    transition: transform 0.36s ease, opacity 0.32s ease, border-color 0.25s ease, box-shadow 0.25s ease, filter 0.28s ease;
}

.world-island-card:hover:not(.active) {
    opacity: 0.82;
    transform: scale(0.89);
}

.world-island-card.active {
    transform: scale(1.02);
    opacity: 1;
    filter: saturate(1.1);
    z-index: 3;
    border-color: var(--color-gold);
    box-shadow: 0 0 34px rgba(255, 209, 102, 0.32), 0 18px 36px rgba(0, 0, 0, 0.55);
}

.world-island-card--arena.active {
    border-color: var(--color-crimson);
    box-shadow: 0 0 34px rgba(255, 71, 87, 0.36), 0 18px 36px rgba(0, 0, 0, 0.55);
}

.world-island-card--open.active {
    border-color: var(--color-cyan);
    box-shadow: 0 0 34px rgba(0, 229, 255, 0.36), 0 18px 36px rgba(0, 0, 0, 0.55);
}

.world-island-art-wrap {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 3 / 2;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #080b14;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.world-island-card.active .world-island-art-wrap img {
    animation: islandFloat 3.8s ease-in-out infinite;
}

.world-island-art-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@keyframes islandFloat {
    0%, 100% { transform: translateY(0) scale(1.01); }
    50% { transform: translateY(-5px) scale(1.03); }
}

.world-island-code {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 209, 102, 0.18);
    color: var(--color-gold);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.world-island-title {
    font-family: var(--font-display);
    font-size: clamp(0.95rem, 2.2vw, 1.25rem);
    font-weight: 900;
    line-height: 1.2;
}

.world-island-lock {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(11, 14, 22, 0.92);
    border: 1px solid rgba(255, 209, 102, 0.65);
    color: var(--color-gold);
    font-size: 0.76rem;
    font-weight: 800;
}

.island-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 6;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 229, 255, 0.55);
    background: rgba(11, 16, 30, 0.88);
    color: var(--color-cyan);
    font-size: 1rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.28);
    transition: all 0.2s;
}

.island-nav-btn:hover:not(:disabled) {
    background: rgba(0, 229, 255, 0.24);
    transform: translateY(-50%) scale(1.08);
}

.island-nav-btn:disabled {
    opacity: 0.28;
    cursor: default;
}

.island-nav-btn--prev { left: 6px; }
.island-nav-btn--next { right: 6px; }

.stage-code-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(0, 229, 255, 0.16);
    border: 1px solid rgba(0, 229, 255, 0.42);
    color: #b8f6ff;
    font-size: 0.72rem;
    font-weight: 800;
}

.btn-jump-last-world {
    flex-shrink: 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(0, 229, 255, 0.14);
    border: 1px solid rgba(0, 229, 255, 0.45);
    color: var(--color-cyan);
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-jump-last-world:hover {
    background: rgba(0, 229, 255, 0.24);
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.32);
}

/* World Summary Hero + Boss Column */
.world-stage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 18px;
    background: rgba(18, 24, 42, 0.88);
    border: 1px solid var(--border-subtle);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.world-stage-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.world-stage-meta img {
    width: 84px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
}

.world-rewards-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.reward-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 700;
}

/* Horizontal PacMan Boss Banners Column */
.boss-banner-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.boss-horiz-banner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(22, 29, 50, 0.94), rgba(14, 18, 32, 0.96));
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.boss-horiz-banner.expanded {
    border-color: var(--color-gold);
    box-shadow: 0 0 28px rgba(255, 209, 102, 0.2);
}

.boss-horiz-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.boss-horiz-identity {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 280px;
    min-width: 0;
}

.boss-avatar-anim-wrap {
    position: relative;
    width: 78px;
    height: 78px;
    border-radius: 18px;
    background: radial-gradient(circle, rgba(255, 209, 102, 0.22), rgba(11, 14, 22, 0.9));
    border: 1.5px solid rgba(255, 209, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.boss-avatar-anim-wrap img,
.boss-avatar-anim-wrap canvas {
    width: 68px;
    height: 68px;
    display: block;
    object-fit: contain;
    animation: bossIdleBounce 2.2s ease-in-out infinite;
}

@keyframes bossIdleBounce {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.06) translateY(-3px); }
}

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

.boss-horiz-info h3 {
    margin: 0 0 3px;
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--text-primary);
}

.boss-horiz-subtitle {
    font-size: 0.8rem;
    color: var(--color-gold);
    font-weight: 700;
    margin-bottom: 7px;
}

.boss-hp-bars {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.boss-hp-seg {
    width: 28px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff4757, #ff7b54);
    box-shadow: 0 0 8px rgba(255, 71, 87, 0.55);
}

.boss-hp-label {
    font-size: 0.74rem;
    color: var(--text-secondary);
    font-weight: 700;
    margin-left: 4px;
}

.boss-abilities-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.boss-ability-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
}

.boss-ability-chip:hover {
    border-color: var(--color-cyan);
    background: rgba(0, 229, 255, 0.15);
    transform: translateY(-1px);
}

.boss-ability-chip--unknown {
    border-style: dashed;
    color: var(--text-muted);
}

.boss-horiz-banner--world-boss {
    border-color: rgba(239, 68, 68, 0.55);
    background: linear-gradient(135deg, rgba(44, 14, 22, 0.95), rgba(16, 12, 22, 0.96));
    box-shadow: 0 12px 34px rgba(185, 28, 28, 0.24);
}

.boss-world-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(220, 38, 38, 0.25);
    border: 1px solid rgba(248, 113, 113, 0.65);
    color: #fecaca;
}

.boss-ability-chip--world-boss {
    background: rgba(220, 38, 38, 0.22);
    border-color: rgba(248, 113, 113, 0.72);
    color: #fecaca;
}

.boss-horiz-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.map-preview-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(11, 16, 30, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: #c2f8ff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
}

.map-preview-chip:hover {
    border-color: var(--color-cyan);
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.25);
}

.btn-fight-cta {
    padding: 12px 22px;
    border-radius: 14px;
    font-size: 0.98rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffd166, #fb8500);
    color: #0b0e16;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(255, 209, 102, 0.3);
    transition: all 0.2s;
}

.btn-fight-cta.is-ready-start {
    background: linear-gradient(135deg, #2ed573, #00b894);
    color: #061b12;
    box-shadow: 0 0 22px rgba(46, 213, 115, 0.45);
}

/* Expandable Battle Options Bar (Open Room with Green/Red Lock + PIN vs Bots) */
.boss-fight-drawer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.14);
    animation: flowFadeIn 0.18s ease-out;
}

.fight-mode-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fight-option-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
}

.fight-option-btn.active {
    border-color: var(--color-cyan);
    background: rgba(0, 229, 255, 0.14);
    color: var(--text-primary);
    box-shadow: 0 0 16px rgba(0, 229, 255, 0.24);
}

.lock-toggle-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.lock-toggle-badge.is-open {
    background: rgba(46, 213, 115, 0.2);
    border-color: rgba(46, 213, 115, 0.65);
    color: #2ed573;
}

.lock-toggle-badge.is-private {
    background: rgba(255, 71, 87, 0.22);
    border-color: rgba(255, 71, 87, 0.72);
    color: #ff6b81;
}

.pin-inline-input {
    width: 112px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #090d18;
    border: 1.5px solid rgba(255, 71, 87, 0.55);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    outline: none;
}

/* Open Worlds Lobbies & Arena Panel */
.open-worlds-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.open-worlds-code-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.open-lobby-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(18, 24, 42, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.24);
    flex-wrap: wrap;
}

.open-lobby-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.open-lobby-left img {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
}

.arena-entry-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(45, 22, 42, 0.85), rgba(16, 22, 40, 0.95));
    border: 1.5px solid rgba(255, 209, 102, 0.35);
    flex-wrap: wrap;
}

.arena-entry-left {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1 1 280px;
}

.arena-entry-left img {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 0 26px rgba(255, 209, 102, 0.35);
}

.arena-section-block {
    margin-bottom: 24px;
}

.arena-section-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--color-gold);
}

/* ==========================================================================
   SCREEN 5: WAITING ROOM + ABILITY TREE (1-2-3)
   ========================================================================== */
.waiting-room-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 18px;
    align-items: start;
}

.waiting-room-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(16, 22, 38, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.3);
    margin-bottom: 14px;
}

.room-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(0, 229, 255, 0.14);
    border: 1px solid rgba(0, 229, 255, 0.45);
    color: var(--color-cyan);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: 0.1em;
}

.waiting-players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.waiting-player-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.18s;
}

.waiting-player-card:hover {
    border-color: rgba(0, 229, 255, 0.4);
}

.waiting-player-card.selected {
    border-color: var(--color-cyan);
    background: rgba(0, 229, 255, 0.08);
}

.waiting-player-card.is-ready {
    border-color: rgba(46, 213, 115, 0.65);
}

.waiting-player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.waiting-player-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.waiting-player-left img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.25);
}

.waiting-player-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.14);
}

/* Ability Tree Builder */
.ability-branches-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.branch-dir-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 8px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 800;
    font-size: 0.86rem;
    transition: all 0.2s;
}

.branch-dir-btn.active[data-branch-dir="survival"] {
    border-color: #2ed573;
    background: rgba(46, 213, 115, 0.16);
    color: #d8ffea;
    box-shadow: 0 0 20px rgba(46, 213, 115, 0.25);
}

.branch-dir-btn.active[data-branch-dir="magic"] {
    border-color: #00e5ff;
    background: rgba(0, 229, 255, 0.16);
    color: #d4fbff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.25);
}

.branch-dir-btn.active[data-branch-dir="attack"] {
    border-color: #ff4757;
    background: rgba(255, 71, 87, 0.18);
    color: #ffe0e4;
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.25);
}

.ability-tree-stage {
    padding: 18px 16px;
    border-radius: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.14);
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s;
}

.ability-tree-stage[data-tree-theme="survival"] {
    background:
        radial-gradient(circle at 20% 20%, rgba(46, 213, 115, 0.22), transparent 55%),
        linear-gradient(160deg, #0d241b 0%, #0d1422 100%);
    border-color: rgba(46, 213, 115, 0.45);
}

.ability-tree-stage[data-tree-theme="magic"] {
    background:
        radial-gradient(circle at 50% 15%, rgba(0, 229, 255, 0.22), transparent 55%),
        radial-gradient(circle at 85% 85%, rgba(199, 125, 255, 0.22), transparent 55%),
        linear-gradient(160deg, #0d1d34 0%, #120e29 100%);
    border-color: rgba(0, 229, 255, 0.45);
}

.ability-tree-stage[data-tree-theme="attack"] {
    background:
        radial-gradient(circle at 80% 20%, rgba(255, 71, 87, 0.25), transparent 55%),
        linear-gradient(160deg, #2b1019 0%, #12101c 100%);
    border-color: rgba(255, 71, 87, 0.48);
}

.ability-tree-nodes {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    max-width: 420px;
    margin: 6px auto 16px;
}

.ability-tree-nodes::before {
    content: '';
    position: absolute;
    left: 44px;
    right: 44px;
    top: 32px;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.18));
    z-index: 0;
}

.tree-skill-node {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0;
    width: 96px;
}

.tree-skill-circle {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10, 14, 24, 0.92);
    border: 2px solid rgba(255, 255, 255, 0.25);
    font-size: 1.2rem;
    font-weight: 900;
    transition: all 0.2s;
}

.tree-skill-circle small {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.tree-skill-node.active .tree-skill-circle {
    transform: scale(1.1);
    border-color: var(--color-gold);
    box-shadow: 0 0 22px rgba(255, 209, 102, 0.52);
}

.tree-skill-name {
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.skill-preview-box {
    display: grid;
    grid-template-columns: 1fr 230px;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 14px;
    background: rgba(8, 12, 22, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.preview-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    border: 1px solid rgba(0, 229, 255, 0.28);
    background: #080d18;
}

.waiting-launch-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-ready-launch {
    flex: 1 1 200px;
    padding: 14px 22px;
    font-size: 1.05rem;
    font-weight: 900;
    border-radius: 14px;
}

/* ==========================================================================
   MODALS: READY CHECK, TUTORIAL, PREVIEW, PROFILE
   ========================================================================== */
.ready-check-card {
    max-width: 460px;
    text-align: center;
    border: 2px solid var(--color-cyan);
    box-shadow: 0 0 42px rgba(0, 229, 255, 0.35);
}

.ready-timer-bar-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin: 12px 0;
}

.ready-timer-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #2ed573, #00e5ff);
    transition: width 0.1s linear;
}

.ready-check-roster {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 14px 0;
}

.ready-pill {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.ready-pill.accepted {
    background: rgba(46, 213, 115, 0.22);
    border-color: #2ed573;
    color: #b8ffda;
}

.tutorial-modal-card {
    max-width: 560px;
}

.tutorial-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 12px 0;
}

.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    padding: 0;
}

.tutorial-dot.active {
    width: 24px;
    border-radius: 999px;
    background: var(--color-cyan);
}

.profile-xp-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin: 8px 0;
}

.profile-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd166, #00e5ff);
}

/* ==========================================================================
   PRE-MATCH CAMERA INTRO OVERLAY (INSIDE #gameView)
   ========================================================================== */
.intro-banner-overlay {
    position: absolute;
    inset: 0;
    z-index: 65;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 24px 16px 46px;
}

.intro-skip-btn {
    pointer-events: auto;
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(11, 14, 22, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.intro-banner-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(12, 18, 34, 0.94), rgba(20, 28, 52, 0.92));
    border: 2px solid var(--color-cyan);
    box-shadow: 0 0 36px rgba(0, 229, 255, 0.42);
    max-width: 440px;
    width: 100%;
    animation: introSlideUp 0.26s ease-out;
}

.intro-banner-card.intro-card--boss {
    border-color: var(--color-crimson);
    box-shadow: 0 0 42px rgba(255, 71, 87, 0.5);
}

.intro-banner-avatar {
    width: 68px;
    height: 68px;
    border-radius: 16px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
}

.intro-banner-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-gold);
    margin-bottom: 3px;
}

.intro-banner-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text-primary);
}

.intro-banner-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.intro-hp-row {
    display: flex;
    gap: 5px;
}

.intro-hp-pip {
    width: 24px;
    height: 7px;
    border-radius: 999px;
}

.intro-hp-pip--runner {
    background: #2ed573;
    box-shadow: 0 0 8px rgba(46, 213, 115, 0.6);
}

.intro-hp-pip--boss {
    background: #ff4757;
    box-shadow: 0 0 8px rgba(255, 71, 87, 0.7);
}

.intro-center-callout {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 9vw, 4.8rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 0 0 32px rgba(0, 229, 255, 0.85);
}

.intro-callout--ready {
    color: #ffd166;
    text-shadow: 0 0 32px rgba(255, 209, 102, 0.8);
}

.intro-callout--run {
    color: #2ed573;
    text-shadow: 0 0 42px rgba(46, 213, 115, 0.95);
    animation: runPop 0.35s cubic-bezier(0.2, 1.3, 0.4, 1);
}

@keyframes introSlideUp {
    from { opacity: 0; transform: translateY(18px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes runPop {
    from { transform: translate(-50%, -50%) scale(0.65); }
    to { transform: translate(-50%, -50%) scale(1.08); }
}

/* ==========================================================================
   RESPONSIVE RULES (320px PORTRAIT -> 4K)
   ========================================================================== */
@media (max-width: 900px) {
    .waiting-room-grid {
        grid-template-columns: 1fr;
    }
    .skill-preview-box {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px), (orientation: portrait) and (max-width: 1024px) {
    .mode-banners-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .flow-root {
        padding: 12px 12px 32px;
    }
    .menu-quick-dock {
        position: static;
        justify-content: center;
        margin-bottom: 14px;
    }
    .menu-hero-card {
        padding: 24px 16px;
    }
    .worlds-island-viewport {
        --island-w: 56%;
        --island-margin: 2%;
        --island-pitch: 60%;
        --island-center-offset: 20%;
    }
    .world-island-card {
        padding: 8px 8px 12px;
    }
    .island-nav-btn {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }
    .ability-tree-nodes::before {
        left: 28px;
        right: 28px;
    }
    .tree-skill-node {
        width: 82px;
    }
    .tree-skill-circle {
        width: 54px;
        height: 54px;
    }
}
