/**
 * HyperOrbit: Game & HUD Stylesheet
 * Rich Glassmorphism, Space Grotesk typography, responsive telemetry controls,
 * and cinematic dark mode aesthetics.
 */

@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('../../../assets/fonts/space-grotesk-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../../../assets/fonts/outfit-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Fredoka';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('../../../assets/fonts/fredoka-latin.woff2') format('woff2');
}

:root {
    --bg-void: #050716;
    --card-glass: rgba(15, 23, 42, 0.78);
    --card-border: rgba(56, 189, 248, 0.22);
    --card-border-gold: rgba(251, 191, 36, 0.35);
    --cyan-glow: #38bdf8;
    --gold: #fbbf24;
    --gold-deep: #f59e0b;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --good: #34d399;
    --bad: #f87171;
    --radius-hud: 16px;
    --radius-modal: 22px;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-void);
    color: var(--text-primary);
    font-family: 'Outfit', -apple-system, sans-serif;
    line-height: 1.5;
    user-select: none;
}

/* Master Layout */
#appContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Canvas Viewport */
.canvas-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

canvas#spaceCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Top Glass Navigation Bar */
.top-hud {
    position: absolute;
    top: 14px;
    left: 16px;
    right: 16px;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.hud-group {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}

.brand-badge {
    background: var(--card-glass);
    border: 1px solid var(--card-border-gold);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-hud);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    text-decoration: none;
}

.brand-badge b {
    color: var(--cyan-glow);
}

.hud-btn {
    background: var(--card-glass);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 14px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.hud-btn:hover {
    border-color: var(--cyan-glow);
    color: var(--cyan-glow);
    transform: translateY(-1px);
}

.hud-btn:active {
    transform: translateY(1px);
}

.hud-btn.active {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--cyan-glow);
    color: #ffffff;
}

.star-counter {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold);
    border-radius: 999px;
    padding: 6px 14px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.interactive-counter {
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.interactive-counter:hover {
    background: rgba(251, 191, 36, 0.28);
    border-color: #fde047;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.45);
}

.interactive-counter:active {
    transform: translateY(1px);
}

.interactive-rank {
    cursor: pointer;
}

.interactive-rank:hover {
    border-color: var(--cyan-glow);
    color: var(--cyan-glow);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.explainer-nav-btn {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.45);
    color: var(--cyan-glow);
    font-weight: 700;
}

.explainer-nav-btn:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: #7dd3fc;
    color: #ffffff;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
}

.explainer-nav-btn .full-label {
    display: inline;
}

.explainer-nav-btn .short-label {
    display: none;
}

@media (max-width: 1180px) {
    .explainer-nav-btn .full-label {
        display: none;
    }
    .explainer-nav-btn .short-label {
        display: inline;
    }
}

.explainer-bottom-btn {
    color: #fde047;
    border-color: rgba(251, 191, 36, 0.4);
}

.explainer-bottom-btn:hover {
    border-color: var(--gold);
    color: #ffffff;
    background: rgba(251, 191, 36, 0.2);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.35);
}

/* Bottom HUD Floating Controls */
.bottom-hud {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 12px;
    background: var(--card-glass);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(14px);
    border-radius: 999px;
    padding: 8px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Tier Selector Bar (Top-Center) */
.tier-switcher {
    position: static;
    transform: none;
    z-index: 10;
    display: flex;
    background: var(--card-glass);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 999px;
    padding: 4px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
}

.tier-btn {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 6px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tier-btn.active {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.45);
}

/* Zoom controls right side */
.zoom-controls {
    position: absolute;
    right: 20px;
    bottom: 85px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.round-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    border: 0;
    border-radius: 12px;
    padding: 12px 24px;
    font-family: 'Space Grotesk', Outfit, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #0b0f19;
    background: linear-gradient(180deg, #fef08a, var(--gold-deep));
    box-shadow: 0 4px 0 #b45309, 0 8px 20px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn:hover {
    filter: brightness(1.08);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #b45309;
}

.btn-pulse {
    animation: pulseGlow 1.6s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 0 #b45309, 0 0 15px rgba(251, 191, 36, 0.3); }
    50% { box-shadow: 0 4px 0 #b45309, 0 0 28px rgba(251, 191, 36, 0.65); }
}

/* Planet Inspection Flyout Drawer */
.planet-drawer {
    position: absolute;
    top: 75px;
    right: -420px;
    width: 380px;
    max-height: calc(100vh - 100px);
    background: var(--card-glass);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(18px);
    border-radius: var(--radius-modal);
    z-index: 20;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.planet-drawer.open {
    right: 20px;
}

.drawer-header {
    padding: 18px 20px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    color: var(--cyan-glow);
}

.btn-close {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
}

.btn-close:hover {
    color: #ffffff;
}

.drawer-content {
    padding: 16px 20px;
    overflow-y: auto;
    font-size: 0.93rem;
}

.tagline-badge {
    display: inline-block;
    color: var(--gold);
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}

.stat-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 12px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-val {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.95rem;
}

.layers-list {
    margin-top: 14px;
}

.layer-card {
    background: rgba(15, 23, 42, 0.5);
    border-left: 3px solid var(--cyan-glow);
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 0 8px 8px 0;
}

.layer-card h4 {
    color: var(--gold);
    font-size: 0.9rem;
}

.fun-fact-box {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid var(--card-border-gold);
    border-radius: 12px;
    padding: 12px;
    margin: 14px 0;
    font-size: 0.88rem;
    color: #fef08a;
}

/* Modal Overlay for Applied Mission Challenges */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 22, 0.82);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 16px;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-window {
    background: #090e24;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-modal);
    width: 100%;
    max-width: 760px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
}

.modal-window::-webkit-scrollbar {
    width: 8px;
}

.modal-window::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
}

.modal-window::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.35);
    border-radius: 4px;
}

.modal-window::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.6);
}

.modal-head {
    padding: 20px 24px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-head h2 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--cyan-glow);
    font-size: 1.4rem;
}

.modal-body {
    padding: 24px;
}

/* Challenge Specific Styling */
.challenge-hint {
    color: var(--text-muted);
    font-size: 0.98rem;
    margin-bottom: 14px;
}

.mnemonic-banner {
    background: rgba(251, 191, 36, 0.12);
    border: 1px dashed var(--gold);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 18px;
    color: #fef08a;
    font-size: 0.92rem;
}

.order-slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.order-slot {
    background: rgba(15, 23, 42, 0.7);
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 10px;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.order-slot:hover {
    border-color: var(--cyan-glow);
}

.slot-num {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.placed-planet {
    background: rgba(56, 189, 248, 0.15);
    border-left: 3px solid var(--cyan-glow);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.88rem;
}

.order-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
    background: rgba(15, 23, 42, 0.5);
    padding: 14px;
    border-radius: 14px;
}

.bank-planet-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-left-width: 4px;
    border-radius: 8px;
    padding: 8px 14px;
    color: #ffffff;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.bank-planet-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
}

.challenge-success-box {
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid var(--good);
    color: #a7f3d0;
    border-radius: 12px;
    padding: 14px;
    margin-top: 16px;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

.challenge-error-box {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid var(--bad);
    color: #fca5a5;
    border-radius: 12px;
    padding: 14px;
    margin-top: 16px;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease;
}

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

/* Canvas Wrappers inside Modals */
.day-night-canvas-wrap,
.eclipse-canvas-wrap,
.comet-canvas-wrap,
.kepler-canvas-wrap,
.insertion-canvas-wrap {
    width: 100%;
    background: #03040b;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.day-night-canvas-wrap canvas,
.eclipse-canvas-wrap canvas,
.comet-canvas-wrap canvas,
.kepler-canvas-wrap canvas,
.insertion-canvas-wrap canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Range Sliders */
input[type="range"] {
    width: 100%;
    accent-color: var(--cyan-glow);
    height: 6px;
    border-radius: 4px;
    margin: 10px 0;
    cursor: pointer;
}

/* Quiz Specific */
.quiz-progress {
    color: var(--cyan-glow);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.quiz-question {
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 18px;
    line-height: 1.4;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-opt-btn {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 18px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quiz-opt-btn:hover:not([disabled]) {
    border-color: var(--cyan-glow);
    background: rgba(56, 189, 248, 0.1);
}

.quiz-opt-btn.correct {
    background: rgba(52, 211, 153, 0.25) !important;
    border-color: var(--good) !important;
    color: #ffffff;
}

.quiz-opt-btn.wrong {
    background: rgba(248, 113, 113, 0.25) !important;
    border-color: var(--bad) !important;
    color: #ffffff;
}

.quiz-feedback-box {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.quiz-feedback-box.good {
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid var(--good);
    color: #a7f3d0;
}

.quiz-feedback-box.bad {
    background: rgba(248, 113, 113, 0.15);
    border: 1px solid var(--bad);
    color: #fca5a5;
}

.quiz-summary-card {
    text-align: center;
    padding: 20px 10px;
}

.score-display {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.2rem;
    color: var(--gold);
    margin: 12px 0 16px;
}

.mission-takeaway {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Certificate Modal */
.cert-frame {
    background: linear-gradient(135deg, #0c122c, #050716);
    border: 3px solid var(--gold);
    border-radius: 18px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 35px rgba(251, 191, 36, 0.35);
    position: relative;
    overflow: hidden;
}

.cert-frame::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px dashed rgba(251, 191, 36, 0.4);
    pointer-events: none;
}

.cert-header {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--gold);
    font-size: 1.6rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.cert-rank {
    font-size: 2.4rem;
    color: var(--cyan-glow);
    font-weight: 700;
    margin: 12px 0;
}

/* Floating Onboarding Helper Tip */
.onboarding-tip {
    position: absolute;
    bottom: 84px;
    left: 20px;
    z-index: 25;
    max-width: 440px;
    background: rgba(15, 23, 42, 0.94);
    border: 1px solid rgba(251, 191, 36, 0.55);
    backdrop-filter: blur(14px);
    border-radius: 16px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 20px rgba(251, 191, 36, 0.22);
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-tip.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.tip-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
}

.tip-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tip-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
    font-family: 'Space Grotesk', sans-serif;
}

.tip-desc {
    font-size: 0.82rem;
    color: #cbd5e1;
    line-height: 1.35;
}

.tip-cta {
    background: linear-gradient(180deg, #fef08a, var(--gold-deep));
    border: 0;
    color: #0b0f19;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tip-cta:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.tip-dismiss {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.15s;
}

.tip-dismiss:hover {
    color: #ffffff;
}

/* Explainer Modal Styles */
.explainer-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.explainer-status-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.status-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.status-val.rank-val {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--cyan-glow);
}

.status-val.star-val {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gold);
}

.status-val.star-val small {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.explainer-progress-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #fbbf24);
    border-radius: 999px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.progress-bar-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.84rem;
    color: #cbd5e1;
    flex-wrap: wrap;
    gap: 8px;
}

.next-rank-hint {
    color: #fef08a;
}

.explainer-section-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    color: #f8fafc;
    margin-bottom: 4px;
}

.explainer-section-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.explainer-steps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.explainer-step-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.step-badge {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(56, 189, 248, 0.15);
    color: var(--cyan-glow);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 6px;
    padding: 2px 8px;
}

.step-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-right: 50px;
}

.step-icon {
    font-size: 1.3rem;
    line-height: 1;
}

.step-card-head h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    color: #ffffff;
}

.explainer-step-card p {
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.45;
}

.tier-pills-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

.tier-pill {
    background: rgba(30, 41, 59, 0.7);
    border-left: 3px solid var(--cyan-glow);
    padding: 5px 10px;
    border-radius: 0 6px 6px 0;
    font-size: 0.8rem;
    color: #e2e8f0;
}

.step-bullets {
    margin-top: 8px;
    padding-left: 18px;
    font-size: 0.82rem;
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.4;
}

.reward-highlight {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0 8px;
}

.reward-chip {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 6px;
    border: 1px solid;
}

.reward-chip.gold {
    background: rgba(251, 191, 36, 0.15);
    border-color: var(--gold);
    color: #fde047;
}

.reward-chip.cyan {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--cyan-glow);
    color: #7dd3fc;
}

.reward-chip.green {
    background: rgba(52, 211, 153, 0.15);
    border-color: var(--good);
    color: #a7f3d0;
}

.micro-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}

.ranks-ladder-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.rank-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 10px;
    text-align: center;
    position: relative;
    transition: all 0.2s ease;
}

.rank-card.active {
    background: rgba(56, 189, 248, 0.16);
    border-color: var(--cyan-glow);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.3);
}

.rank-card .rank-icon {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.rank-card .rank-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    color: #ffffff;
}

.rank-card .rank-req {
    font-size: 0.8rem;
    color: var(--gold);
    font-weight: 700;
    margin: 3px 0;
}

.rank-card .rank-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.current-tag {
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.controls-cheatsheet {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px;
}

.control-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.86rem;
    color: #cbd5e1;
    line-height: 1.4;
}

.ctrl-icon {
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}

.explainer-action-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .tier-switcher {
        position: absolute;
        top: auto;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
    }

    .bottom-hud {
        bottom: 16px;
        padding: 6px 12px;
        gap: 6px;
    }

    .planet-drawer {
        width: 100vw;
        right: -100vw;
        top: 0;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .planet-drawer.open {
        right: 0;
    }

    .order-slots-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .explainer-steps-grid {
        grid-template-columns: 1fr;
    }

    .ranks-ladder-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .controls-cheatsheet {
        grid-template-columns: 1fr;
    }

    .onboarding-tip {
        left: 12px;
        right: 12px;
        bottom: 130px;
        max-width: none;
    }
}
