/* =============================================================================
   COSMIC UNIVERSE v11.0 — UNIVERSAL 50-GAME ARCADE PLAYER STYLES
   ============================================================================= */

.arcade-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.9rem 1.25rem 2.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.78rem;
}

.hidden {
    display: none !important;
}

/* Header & Action Bar */
.arcade-header-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 0.85rem 1.05rem;
}

.arcade-title-block {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-width: 0;
}

.arcade-crumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.crumb-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.72);
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.crumb-link svg {
    width: 13px;
    height: 13px;
}

.crumb-link:hover {
    color: var(--accent-sky);
    border-color: var(--border-active);
}

.crumb-story {
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.arcade-title-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.arcade-sprite-icon {
    width: 52px;
    height: 52px;
    object-fit: contain;
    image-rendering: pixelated;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.16), rgba(7, 11, 18, 0.92));
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    padding: 5px;
    flex-shrink: 0;
}

.arcade-badges-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.22rem;
}

.arcade-game-title {
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 700;
    line-height: 1.15;
}

.arcade-game-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0.15rem 0 0;
}

.arcade-action-bar {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

/* Story Mission Progress Strip */
.story-mission-banner {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(56, 189, 248, 0.08) 45%, rgba(167, 139, 250, 0.12) 75%, rgba(13, 19, 32, 0.94));
    border: 1px solid rgba(245, 158, 11, 0.42);
    border-radius: var(--radius-md);
    padding: 0.62rem 0.95rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(251, 191, 36, 0.16);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.story-mission-banner.is-complete {
    border-color: rgba(52, 211, 153, 0.55);
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.18), rgba(56, 189, 248, 0.10) 60%, rgba(13, 19, 32, 0.94));
    box-shadow: 0 8px 26px rgba(52, 211, 153, 0.18);
}

.mission-avatars-stack {
    position: relative;
    width: 58px;
    height: 46px;
    flex-shrink: 0;
}

.mission-nova-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    image-rendering: pixelated;
    border: 1.5px solid rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
    object-fit: cover;
    background: #070b12;
}

.mission-sara-avatar {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: 1.5px solid rgba(167, 139, 250, 0.78);
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.35);
    object-fit: cover;
    background: #0d1320;
}

.mission-ai-tag {
    position: absolute;
    top: -3px;
    right: -2px;
    font-size: 8.5px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(167, 139, 250, 0.92);
    color: #070b12;
    letter-spacing: 0.04em;
}

.mission-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.mission-eyebrow {
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
    letter-spacing: 0.06em;
}

.mission-objective-text {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mission-progress-bar-track {
    position: relative;
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(7, 11, 18, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

@keyframes missionBarShimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.mission-progress-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, #f59e0b, #38bdf8, #34d399, #f59e0b);
    background-size: 200% 100%;
    animation: missionBarShimmer 2.8s linear infinite;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.55);
    transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.story-mission-banner.is-complete .mission-progress-bar-fill {
    background: linear-gradient(90deg, #34d399, #6ee7b7, #38bdf8);
    background-size: 200% 100%;
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.72);
}

.mission-progress-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.28rem;
    flex-shrink: 0;
}

.mission-progress-counter {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-sky);
    letter-spacing: 0.04em;
}

.mission-progress-label {
    font-size: 11.5px;
    font-weight: 600;
    padding: 0.24rem 0.62rem;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.38);
    color: #fbbf24;
    white-space: nowrap;
}

.story-mission-banner.is-complete .mission-progress-label {
    background: rgba(52, 211, 153, 0.16);
    border-color: rgba(52, 211, 153, 0.48);
    color: var(--accent-mint);
}

/* Live HUD Strip */
.arcade-hud-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(90px, 128px)) minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.52rem 0.78rem;
}

.hud-metric {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    background: rgba(7, 11, 18, 0.55);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
}

.hud-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.hud-val {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.text-amber { color: #fbbf24; }
.text-sky { color: var(--accent-sky); }
.text-mint { color: var(--accent-mint); }

.hud-status-text {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-stars-box {
    font-size: 16px;
    letter-spacing: 0.12em;
    color: #fbbf24;
    padding: 0 0.45rem;
}

/* Level Pills */
.level-selector-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.45rem 0.78rem;
}

.level-bar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.level-pills-wrap {
    display: flex;
    align-items: center;
    gap: 0.32rem;
    flex-wrap: wrap;
}

.level-pill-btn {
    min-width: 30px;
    height: 27px;
    padding: 0 0.48rem;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast), background-color var(--transition-fast);
}

.level-pill-btn:hover {
    border-color: var(--border-active);
    color: var(--text-primary);
}

.level-pill-btn.active {
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.55);
    color: var(--accent-sky);
}

.level-pill-btn.cleared:not(.active) {
    border-color: rgba(52, 211, 153, 0.38);
    color: var(--accent-mint);
}

/* Main 16:9 Stage */
.stage-frame-wrap {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(56, 189, 248, 0.3);
    background: #04070e;
    box-shadow: 0 18px 48px -18px rgba(2, 6, 23, 0.9), 0 0 0 1px rgba(148, 163, 184, 0.08);
    overflow: hidden;
}

.arcade-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: radial-gradient(circle at 50% 45%, #0c1426 0%, #050811 100%);
    overflow: hidden;
}

.arcade-stage > canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    outline: none;
}

/* Flagship Showcase inside Stage */
.flagship-stage-card {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-size: cover;
    background-position: center;
    background-image:
        linear-gradient(12deg, rgba(4, 7, 14, 0.95) 22%, rgba(7, 11, 18, 0.65) 62%, rgba(7, 11, 18, 0.35)),
        url('../assets/v11/portal_keyart.jpg');
}

.flagship-stage-title {
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    font-weight: 700;
    margin: 0.45rem 0;
}

.flagship-stage-desc {
    max-width: 600px;
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 1.15rem;
}

.flagship-stage-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

/* Overlay */
.stage-overlay {
    position: absolute;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(5, 8, 16, 0.78);
    backdrop-filter: blur(8px);
}

.stage-overlay-card {
    width: min(460px, 100%);
    background: rgba(13, 19, 32, 0.96);
    border: 1px solid rgba(56, 189, 248, 0.36);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.4rem;
    text-align: center;
    box-shadow: var(--shadow-card);
}

.overlay-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--accent-sky);
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    margin-bottom: 0.55rem;
}

.overlay-title {
    font-size: 1.45rem;
    margin-bottom: 0.2rem;
}

.overlay-stars {
    font-size: 28px;
    letter-spacing: 0.2em;
    color: #fbbf24;
    margin: 0.3rem 0;
}

.overlay-reason {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 0.9rem;
}

.overlay-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.55rem;
    margin-bottom: 0.95rem;
}

.ov-stat {
    background: rgba(7, 11, 18, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.45rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.ov-stat span {
    font-size: 11px;
    color: var(--text-muted);
}

.ov-stat strong {
    font-size: 15px;
}

.overlay-story-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 12.5px;
    font-weight: 600;
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.32);
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    margin-bottom: 0.9rem;
}

.overlay-story-note svg {
    width: 15px;
    height: 15px;
}

.overlay-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Info Cards Row */
.arcade-info-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
}

.info-pill-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.95rem;
}

.info-pill-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--accent-sky);
    margin-bottom: 0.3rem;
}

.info-pill-head svg {
    width: 14px;
    height: 14px;
}

.info-pill-body {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Related Games Strip */
.related-games-section {
    max-width: 960px;
    width: 100%;
    margin: 0.4rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.related-title {
    font-size: 1.05rem;
}

.related-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent-sky);
}

.related-all-link svg {
    width: 14px;
    height: 14px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.related-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.72rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.related-card:hover {
    border-color: var(--border-active);
    background: var(--bg-card);
    transform: translateY(-2px);
}

.related-card img {
    width: 38px;
    height: 38px;
    image-rendering: pixelated;
    object-fit: contain;
    flex-shrink: 0;
}

.related-card-info {
    min-width: 0;
}

.related-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-card-meta {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .arcade-hud-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .arcade-info-row {
        grid-template-columns: 1fr;
    }
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Dedicated Pre-Game Start Menu Overlay */
.pregame-menu-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: #04070e;
}

.pregame-bg-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.42) saturate(1.15);
    transform: scale(1.06);
}

.pregame-scrim {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(13, 21, 38, 0.55) 0%, rgba(4, 7, 14, 0.94) 85%);
}

.pregame-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 650px;
    background: linear-gradient(160deg, rgba(13, 19, 34, 0.95), rgba(7, 11, 18, 0.94));
    backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: var(--radius-xl);
    padding: 1.4rem 1.55rem;
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.78), 0 0 36px rgba(56, 189, 248, 0.12), inset 0 1px 0 rgba(56, 189, 248, 0.22);
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
    overflow: hidden;
}

.pregame-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-sky), var(--accent-violet), var(--accent-mint), transparent);
}

.pregame-head {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pregame-logo {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    object-fit: cover;
    border: 2px solid rgba(56, 189, 248, 0.45);
    background: #070b12;
    flex-shrink: 0;
}

.pregame-title-col {
    flex: 1;
    min-width: 0;
}

.pregame-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 0.32rem;
}

.pregame-title {
    margin: 0;
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    color: #fff;
    line-height: 1.15;
}

.pregame-tagline {
    margin: 0.25rem 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.pregame-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.pregame-config-box {
    background: rgba(7, 11, 18, 0.72);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.config-label {
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.pill-toggle-row {
    display: flex;
    gap: 0.38rem;
    flex-wrap: wrap;
}

.mode-pill {
    appearance: none;
    color-scheme: dark;
    padding: 0.42rem 0.72rem;
    border-radius: 7px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(13, 19, 32, 0.92);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition-fast), background-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.mode-pill:hover {
    border-color: var(--border-active);
    background: rgba(20, 30, 50, 0.96);
    color: #fff;
    transform: translateY(-1px);
}

.mode-pill.active {
    border-color: var(--accent-sky);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(14, 165, 233, 0.14));
    color: #fff;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35), 0 4px 12px rgba(56, 189, 248, 0.18);
}

.pregame-controls-bar {
    font-size: 12.5px;
    color: var(--text-secondary);
    background: rgba(7, 11, 18, 0.6);
    border: 1px dashed rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
}

.pregame-footer {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: center;
}

.pregame-launch-btn {
    flex: 1;
    min-width: 190px;
    justify-content: center;
    padding: 0.78rem 1.25rem;
    font-size: 14.5px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .pregame-config-grid {
        grid-template-columns: 1fr;
    }
}
