/* Admin Panel Header and Titles */
.admin-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 2rem;
}
.admin-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--color-primary-light);
    margin-bottom: 0.25em;
}
.admin-subtitle {
    color: var(--color-text-dim);
    font-size: 1.1rem;
    margin-bottom: 0.5em;
}
.back-link {
    display: inline-block;
    margin: 1.5rem 0 1rem 0;
    color: var(--color-primary-light);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s;
}
.back-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}
.upload-dropzone {
    margin-top: 2.5rem;
}
.main-content {
    width: 100%;
    min-height: 400px;
}
.worlds-list {
    margin-bottom: 2.5rem;
}
#loadingMessage {
    text-align: center;
    color: var(--color-text-dim);
    padding: 2rem 0;
}
/* Admin Art Upload Preview Classes */
.preview-flex {
    display: flex;
    gap: 12px;
    align-items: center;
}
.preview-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.15);
}
.preview-link {
    margin-top: 10px;
}
/* Art image for world cards in admin panel */
.world-art {
    display: block;
    margin: 1.5rem auto 0 auto;
    max-width: 320px;
    max-height: 220px;
    border-radius: 12px;
    box-shadow: 0 0 24px rgba(124, 91, 245, 0.18);
    object-fit: contain;
    background: #18182a;
    border: 1px solid rgba(124, 91, 245, 0.13);
}

/* Drag-and-drop image upload box for admin */
.drag-drop-box {
    border: 2px dashed #a78bfa;
    background: rgba(30, 30, 50, 0.4);
    border-radius: 14px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #a78bfa;
    font-size: 1.1rem;
    margin: 2rem auto 2.5rem auto;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
    max-width: 400px;
}
.drag-drop-box.dragover {
    background: rgba(124, 91, 245, 0.08);
    border-color: #7c5bf5;
    color: #7c5bf5;
}
.drag-drop-box input[type="file"] {
    display: none;
}
.drag-drop-box .upload-preview {
    margin-top: 1.5rem;
}
/* ============================================
   Admin Panel Styles
   ============================================ */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}
/* Centered login-required section styled as admin card */
.login-required {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2em auto;
    padding: 2em;
    background: #fff;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    max-width: 420px;
}
.login-required h2 {
    margin-bottom: 0.5em;
    font-size: 1.3em;
    font-weight: 600;
    color: #222;
}
.btn.btn-discord-login {
    background: #5865f2;
    color: #fff;
    border: none;
    padding: 0.7em 1.5em;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(88,101,242,0.08);
    transition: background 0.2s, box-shadow 0.2s;
    margin-top: 1em;
}
.btn.btn-discord-login:hover {
    background: #404eed;
    box-shadow: 0 4px 16px rgba(88,101,242,0.16);
}
.planet-content {
    padding: 2rem 0 4rem 0;
}

/* .world-card:hover { border-color and box-shadow removed to eliminate red line on hover } */
.world-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.world-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: #a78bfa;
}
.world-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--color-text-dim);
    font-size: 0.9rem;
}
.world-type {
    background: rgba(124, 58, 237, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}
.world-locked {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
}
.world-description {
    color: var(--color-text-dim);
    margin-bottom: 1rem;
    line-height: 1.7;
}
.world-fields {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.world-fields summary {
    cursor: pointer;
    color: var(--color-accent);
    font-weight: 500;
}
.world-fields-content {
    margin-top: 1rem;
}
.field-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.field-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.field-label {
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 0.25rem;
}
.field-value {
    color: var(--color-text-dim);
    white-space: pre-wrap;
}
.world-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-dim);
}
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-dim);
}
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}
.error-message {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--color-danger);
    border-radius: 8px;
    padding: 1rem;
    color: #fca5a5;
    margin-bottom: 1rem;
}
/* Utility for flex gap in admin panel header */
.world-header-flexgap {
    display: flex;
    gap: 0.5rem;
}
/* ============================================
   Fabled Galaxy - Landing Page Styles
   ============================================ */

/* CSS Variables */
:root {
    --color-bg-dark: #0a0a0f;
    --color-bg-medium: #12121a;
    --color-primary: #7c5bf5;
    --color-primary-light: #9d85f7;
    --color-secondary: #00d9ff;
    --color-accent: #ff6b9d;
    --color-gold: #ffd700;
    --color-text: #e8e6f0;
    --color-text-dim: #a8a5b5;
    --color-discord: #5865F2;
    
    --font-display: 'Cinzel', serif;
    --font-body: 'Quicksand', sans-serif;
    
    --glow-primary: 0 0 20px rgba(124, 91, 245, 0.5);
    --glow-secondary: 0 0 20px rgba(0, 217, 255, 0.5);
    --glow-accent: 0 0 20px rgba(255, 107, 157, 0.5);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-dark);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Image optimization defaults */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img[loading="lazy"] {
    content-visibility: auto;
}

/* Prevent layout shift with aspect-ratio placeholders */
img[width][height] {
    aspect-ratio: attr(width) / attr(height);
}

/* Starfield Background */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a0f 100%);
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: var(--opacity); transform: scale(1); }
    50% { opacity: 0.2; transform: scale(0.8); }
}

/* Particles - Galaxy Spin with Differential Rotation */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    /* Each particle orbits around screen center at its own speed */
    animation: particleOrbit var(--orbit-duration, 60s) linear infinite;
    /* Use transform-origin at screen center */
    transform-origin: var(--center-x) var(--center-y);
}

@keyframes particleOrbit {
    from { transform: rotate(0deg) translateX(var(--orbit-radius)) rotate(0deg); }
    to { transform: rotate(360deg) translateX(var(--orbit-radius)) rotate(-360deg); }
}

.landing {
    min-height: 100vh;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    contain: layout style;
}

.hero-content {
    max-width: 900px;
    z-index: 1;
    /* Prevent layout shift from transforms */
    will-change: auto;
    transform: none !important;
    min-height: 500px;
}

.logo-container {
    margin-bottom: 1.5rem;
    min-height: 180px;
}

.logo-image {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    margin: 0 auto;
    border-radius: 12px;
    filter: drop-shadow(0 0 30px rgba(124, 91, 245, 0.4));
    animation: logoGlow 4s ease-in-out infinite;
    object-fit: contain;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 30px rgba(124, 91, 245, 0.4)); }
    50% { filter: drop-shadow(0 0 50px rgba(124, 91, 245, 0.7)); }
}

.title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
}

.tagline {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--color-text-dim);
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    /* Reserve space to prevent CLS */
    min-height: 1.6em;
}

.intro-text {
    margin-bottom: 3rem;
    min-height: 180px;
    overflow: hidden;
}

.story-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-text);
    max-width: 700px;
    margin: 0 auto;
    /* Reserve space for all lines */
    min-height: 180px;
}

.story-line {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    display: block;
    margin-bottom: 0.5em;
    text-shadow: 0 1px 2px rgba(124, 91, 245, 0.6), 0 2px 5px rgba(124, 91, 245, 0.4);
}

.story-line.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Buttons */
.cta-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 60px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white;
    box-shadow: var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 40px rgba(124, 91, 245, 0.7);
}

.btn-secondary {
    background: transparent;
    color: var(--color-secondary);
    border: 2px solid var(--color-secondary);
}

.btn-secondary:hover {
    background: rgba(0, 217, 255, 0.1);
    box-shadow: var(--glow-secondary);
    transform: translateY(-3px);
}

.btn-large {
    padding: 1.25rem 2.5rem;
    font-size: 1.2rem;
}

.btn-discord {
    background: var(--color-discord);
    color: white;
    padding: 1rem 2rem;
}

.btn-discord:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(88, 101, 242, 0.6);
}

.discord-icon {
    width: 24px;
    height: 24px;
}

/* Site Navigation */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    z-index: 100;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.95), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-nav-inline {
    position: absolute;
    background: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--color-text-dim);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--color-primary-light);
}

.nav-links a.active {
    color: var(--color-primary-light);
}

.nav-logo {
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 40px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Auth Container */
.auth-container {
    display: flex;
    align-items: center;
}

.auth-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
}

.auth-username {
    color: var(--color-text);
    font-size: 0.9rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-auth {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-discord-login {
    background: var(--color-discord);
    color: white;
}

.btn-discord-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-dim);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-text);
}

.discord-icon-small {
    width: 18px;
    height: 18px;
}

/* Site Nav & Hero Responsive */
@media (max-width: 768px) {
    .site-nav {
        padding: 0.75rem 1rem;
         flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .nav-links a {
        font-size: 0.9rem;
    }
    
    .auth-username {
        display: none;
    }
}

@media (max-width: 480px) {
    .site-nav {
        padding: 0.5rem 0.75rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-links {
        gap: 0.75rem;
    }
    
    .nav-links a {
        font-size: 0.8rem;
    }
    
    .btn-auth {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .btn-discord-login span {
        display: none;
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-dim);
    font-size: 0.9rem;
    animation: bounce 2s ease-in-out infinite;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--color-text-dim);
    border-bottom: 2px solid var(--color-text-dim);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* Section Styling */
section {
    padding: 6rem 2rem;
    position: relative;
    contain: layout style;
}

.section-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-text), var(--color-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: var(--color-text-dim);
    font-size: 1.2rem;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* About Section - Feature Grid */
.about {
    background: linear-gradient(180deg, transparent, rgba(124, 91, 245, 0.05), transparent);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background: rgba(124, 91, 245, 0.08);
    border-color: rgba(124, 91, 245, 0.3);
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.feature-card p {
    color: var(--color-text-dim);
    font-size: 1rem;
}

/* Galaxy Preview Section */
.galaxy-preview {
    background: var(--color-bg-medium);
    padding: 8rem 2rem;
}

.galaxy-map-container {
    position: relative;
    width: min(100%, 70vh, 900px);
    margin: 0 auto 3rem;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(124, 91, 245, 0.3);
    aspect-ratio: 1;
}

.galaxy-map-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.galaxy-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Planet Tooltip */
.planet-tooltip {
    /* Neutral base style for planet-tooltip, specifics set in context (e.g. .galaxy-view) */
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid var(--color-primary);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: var(--glow-primary);
}

.planet-tooltip.visible {
    opacity: 1;
}

.tooltip-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 0.25rem;
}

.tooltip-creator {
    color: var(--color-text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    font-style: italic;
}

.tooltip-type {
    color: var(--color-primary-light);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.tooltip-hint {
    color: var(--color-primary-light);
    font-size: 0.8rem;
}

/* Create Section */
.create-section {
    background: linear-gradient(180deg, var(--color-bg-medium), var(--color-bg-dark));
}

.create-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.create-step {
    text-align: center;
    padding: 2rem 1rem;
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.create-step h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.create-step p {
    color: var(--color-text-dim);
    font-size: 0.95rem;
}

/* Community Section */
.community {
    background: radial-gradient(ellipse at center, rgba(88, 101, 242, 0.1) 0%, transparent 70%);
    padding: 6rem 2rem;
}

.community-features {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.community-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-dim);
    font-size: 1.1rem;
}

.community-icon {
    font-size: 1.5rem;
}

/* ============================================
   Create Your Fable - Form Page Styles
   ============================================ */

/* Form Page Navigation */
.form-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    z-index: 100;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.95), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-dim);
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.nav-back:hover {
    color: var(--color-primary-light);
}

.nav-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.nav-back:hover .nav-arrow {
    transform: translateX(-5px);
}

/* Form Page Layout */
.form-page {
    min-height: 100vh;
    padding-top: 4rem;
}

/* Form Header */
.form-header {
    padding: 4rem 2rem 2rem;
    text-align: center;
}

.form-header-content {
    max-width: 800px;
    margin: 0 auto;
}

.form-logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin: 0 auto 2rem;
    filter: drop-shadow(0 0 30px rgba(124, 91, 245, 0.4));
    object-fit: contain;
}

.form-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.form-subtitle {
    font-size: 1.2rem;
    color: var(--color-text-dim);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Progress Indicator */
.wizard-progress {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 0 2rem;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 2px;
    width: 16.67%;
    transition: width 0.4s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    transition: all 0.3s ease;
    cursor: pointer;
}

.progress-step.active,
.progress-step.completed {
    opacity: 1;
}

.progress-step.completed .step-icon {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}

.step-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.progress-step.active .step-icon {
    background: rgba(124, 91, 245, 0.3);
    box-shadow: 0 0 20px rgba(124, 91, 245, 0.4);
}

.step-label {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Form Container */
.form-container {
    padding: 0 2rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.fable-form {
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.95), rgba(10, 10, 15, 0.98));
    border: 1px solid rgba(124, 91, 245, 0.3);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 
        0 0 40px rgba(124, 91, 245, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeInStep 0.4s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-header {
    text-align: center;
    margin-bottom: 2rem;
}

.step-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.step-header h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.step-prompt {
    color: var(--color-text-dim);
    font-size: 1.1rem;
}

/* Step Illustrations */
.step-illustration {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0 2rem;
    position: relative;
}

.step-illustration::before {
    content: '';
    position: absolute;
    inset: -10px;
    background: radial-gradient(ellipse at center, var(--color-primary-glow) 0%, transparent 70%);
    opacity: 0.3;
    border-radius: 50%;
    z-index: -1;
    animation: pulse 3s ease-in-out infinite;
}

.step-image {
    max-width: 280px;
    max-height: 200px;
    width: 280px;
    height: 200px;
    object-fit: contain;
    aspect-ratio: 280 / 200;
    border-radius: 16px;
    border: none;
    box-shadow: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-image:hover {
    transform: scale(1.02);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(124, 91, 245, 0.3);
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.radio-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.radio-fieldset legend {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    padding: 0;
}

.required {
    color: var(--color-accent);
}

/* Text Inputs */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--color-text-dim);
    opacity: 0.6;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-primary);
    background: rgba(124, 91, 245, 0.08);
    box-shadow: 0 0 0 3px rgba(124, 91, 245, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a8a5b5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-group select option {
    background: var(--color-bg-medium);
    color: var(--color-text);
}

.input-hint,
.char-count {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-dim);
    margin-top: 0.5rem;
    opacity: 0.7;
}

.char-count {
    text-align: right;
}

/* Radio & Checkbox Groups */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.radio-option:hover,
.checkbox-option:hover {
    background: rgba(124, 91, 245, 0.1);
    border-color: rgba(124, 91, 245, 0.3);
}

.radio-option input,
.checkbox-option input {
    display: none;
}

.radio-custom,
.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-custom {
    border-radius: 6px;
}

.radio-option input:checked + .radio-custom,
.checkbox-option input:checked + .checkbox-custom {
    border-color: var(--color-primary);
    background: var(--color-primary);
}

.radio-option input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.checkbox-option input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.radio-option span:last-child,
.checkbox-option span:last-child {
    color: var(--color-text-dim);
    font-size: 0.95rem;
    line-height: 1.4;
}

.radio-option input:checked ~ span:last-child,
.checkbox-option input:checked ~ span:last-child {
    color: var(--color-text);
}

/* File Upload */
.file-upload-area {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--color-primary);
    background: rgba(124, 91, 245, 0.08);
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    font-size: 3rem;
}

.upload-text {
    color: var(--color-text);
    font-size: 1rem;
}

/* Upload Art Section Styles */
.upload-art-section {
    margin: 2em 0;
    padding: 1.5em;
    background: linear-gradient(135deg, rgba(18, 18, 26, 0.95), rgba(10, 10, 15, 0.98));
    border: 1px solid rgba(124, 91, 245, 0.3);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(124, 91, 245, 0.15);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}
.upload-art-section h2 {
    margin-bottom: 1em;
    font-size: 1.5em;
    font-weight: 600;
    font-family: var(--font-display);
    color: var(--color-primary-light);
}
.upload-art-section select {
    width: 100%;
    margin-bottom: 1em;
    padding: 0.75em 1em;
    border: 1px solid rgba(124, 91, 245, 0.4);
    border-radius: 8px;
    font-size: 1em;
    font-family: var(--font-body);
    background: rgba(124, 91, 245, 0.1);
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239d85f7' fill='none' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1em center;
}
.upload-art-section select:hover,
.upload-art-section select:focus {
    border-color: var(--color-primary);
    background: rgba(124, 91, 245, 0.15);
    outline: none;
}
.upload-art-section select option {
    background: var(--color-bg-medium);
    color: var(--color-text);
}
.upload-art-section input,
.upload-art-section textarea {
    width: 100%;
    margin-bottom: 1em;
    padding: 0.75em 1em;
    border: 1px solid rgba(124, 91, 245, 0.4);
    border-radius: 8px;
    font-size: 1em;
    font-family: var(--font-body);
    background: rgba(124, 91, 245, 0.1);
    color: var(--color-text);
    transition: border-color 0.2s ease;
}
.upload-art-section input:focus,
.upload-art-section textarea:focus {
    border-color: var(--color-primary);
    outline: none;
}
.upload-art-section button {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: #fff;
    border: none;
    padding: 0.75em 1.75em;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    font-family: var(--font-body);
    box-shadow: 0 0 15px rgba(124, 91, 245, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.upload-art-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(124, 91, 245, 0.5);
}
#art-status {
    margin-top: 0.75em;
    font-size: 0.95em;
    color: var(--color-text-dim);
}


.btn-nav {
    min-width: 140px;
}

.btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none !important;
}

.btn-submit {
    background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
}

.btn-submit:hover {
    box-shadow: 0 0 40px rgba(255, 107, 157, 0.5);
}

/* Form Page Responsive */
@media (max-width: 768px) {
    .form-header {
        padding: 3rem 1.5rem 1.5rem;
    }
    
    .form-logo {
        max-width: 200px;
    }
    
    .wizard-progress {
        padding: 0 1rem;
    }
    
    .progress-steps {
        gap: 0.25rem;
    }
    
    .step-icon {
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    
    .step-label {
        font-size: 0.65rem;
    }
    
    .form-container {
        padding: 0 1rem 2rem;
    }
    
    .fable-form {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .step-emoji {
        font-size: 2.5rem;
    }
    
    .step-header h2 {
        font-size: 1.5rem;
    }
    
    .form-navigation {
        flex-wrap: wrap;
    }
    
    .btn-nav {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .progress-steps {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .progress-step {
        flex: 0 0 30%;
    }
    
    .step-label {
        display: none;
    }
    
    .fable-form {
        padding: 1rem;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group select,
    .form-group textarea {
        padding: 0.875rem 1rem;
    }
    
    .step-illustration {
        margin: 1rem 0 1.5rem;
    }
    
    .step-image {
        max-width: 200px;
        width: 200px;
        height: auto;
        aspect-ratio: 280 / 200;
    }
}

/* Footer */
.footer {
    background: var(--color-bg-dark);
    padding: 3rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-tagline {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-copyright {
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding: 1.5rem;
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
    
    .hero-content {
        min-height: auto;
    }
    
    .intro-text {
        min-height: 140px;
        margin-bottom: 2rem;
    }
    
    .story-text {
        min-height: 140px;
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        margin-bottom: 3rem;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .scroll-indicator {
        position: relative;
        bottom: auto;
        margin-top: 2rem;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .create-preview {
        grid-template-columns: 1fr 1fr;
    }
    
    .community-features {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    section {
        padding: 4rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 1rem;
        padding-top: 4.5rem;
        padding-bottom: 4rem;
    }
    
    .logo-container {
        min-height: 100px;
        margin-bottom: 1rem;
    }
    
    .intro-text {
        min-height: 120px;
        margin-bottom: 1.5rem;
    }
    
    .story-text {
        min-height: 120px;
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .tagline {
        margin-bottom: 1.5rem;
        font-size: 0.9rem;
    }
    
    .cta-buttons {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
    
    .scroll-indicator {
        margin-top: 1.5rem;
        font-size: 0.8rem;
    }
    
    .scroll-arrow {
        width: 16px;
        height: 16px;
    }
    
    .create-preview {
        grid-template-columns: 1fr;
    }
    
    .logo-image {
        max-height: 120px;
    }
}

/* Animations for scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Galaxy Gallery Page Styles
   ============================================ */

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Gallery Page Layout */
.gallery-page {
    min-height: 100vh;
    padding-top: 5rem;
}

/* Gallery Header */
.gallery-header {
    text-align: center;
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.gallery-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.gallery-subtitle {
    color: var(--color-text-dim);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.mod-access-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.mod-access-btn:hover {
    opacity: 1;
}

/* Filters */
.gallery-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

.filter-group select {
    cursor: pointer;
}

.search-group input {
    min-width: 200px;
}

/* Galaxy Map View */
.galaxy-view {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Galaxy Map Wrapper with Controls */
.galaxy-map-wrapper {
    position: relative;
    max-width: 100%;
    display: flex;
    justify-content: center;
}

.galaxy-map {
    position: relative;
    /* Square aspect ratio to match the galaxy image */
    aspect-ratio: 1;
    /* Size constraints */
    width: min(100%, 70vh);
    max-width: 800px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 0 60px rgba(124, 91, 245, 0.3);
    cursor: grab;
}

.galaxy-map.dragging {
    cursor: grabbing;
}

/* Zoomable Viewport */
.map-viewport {
    width: 100%;
    height: 100%;
    transform-origin: center center;
    transition: transform 0.2s ease-out;
    position: relative;
}

.galaxy-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Zoom Controls */
.map-controls {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(10, 10, 15, 0.85);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 20;
}

.map-control-btn {
    width: 36px;
    height: 36px;
    background: rgba(124, 91, 245, 0.2);
    border: 1px solid rgba(124, 91, 245, 0.4);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-control-btn:hover:not(:disabled) {
    background: rgba(124, 91, 245, 0.4);
    border-color: var(--color-primary);
}

.map-control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.zoom-level {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-dim);
    padding: 0.25rem 0;
}

/* Mini Map */
.mini-map {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    width: 100px;
    height: 100px;
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    overflow: hidden;
    z-index: 20;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.mini-map::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(124, 91, 245, 0.3) 0%, transparent 70%);
    pointer-events: none;
}

.mini-map-viewport {
    position: absolute;
    border: 2px solid var(--color-gold);
    background: rgba(255, 215, 0, 0.1);
    border-radius: 2px;
    pointer-events: none;
}

/* Planet Clusters */
.planet-cluster {
    position: absolute;
    width: clamp(32px, 5vmin, 48px);
    height: clamp(32px, 5vmin, 48px);
    background: radial-gradient(circle, var(--cluster-color, #7c5bf5), rgba(124, 91, 245, 0.4));
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    box-shadow: 0 0 20px rgba(124, 91, 245, 0.5);
    animation: clusterPulse 2s ease-in-out infinite;
    pointer-events: auto;
}

.planet-cluster::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: clusterSpin 10s linear infinite;
}

.cluster-count {
    font-family: var(--font-display);
    font-size: clamp(0.75rem, 2vmin, 1rem);
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes clusterPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(124, 91, 245, 0.5); }
    50% { box-shadow: 0 0 35px rgba(124, 91, 245, 0.8); }
}

@keyframes clusterSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.planets-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Planet Nodes on Map */
.planet-node {
    position: absolute;
    width: var(--planet-size, clamp(16px, 3vmin, 28px));
    height: var(--planet-size, clamp(16px, 3vmin, 28px));
    background: radial-gradient(circle, var(--planet-color, #ffd700), rgba(255, 215, 0, 0.5));
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    animation: planetPulse 3s ease-in-out infinite;
    z-index: 10;
    pointer-events: auto;
}

.planet-node::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--planet-ring-size, clamp(28px, 5vmin, 48px));
    height: var(--planet-ring-size, clamp(28px, 5vmin, 48px));
    border: 2px solid var(--planet-color, rgba(255, 215, 0, 0.3));
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: planetRing 3s ease-in-out infinite;
    opacity: 0.5;
}

.planet-node:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 30px var(--planet-color, rgba(255, 215, 0, 0.8));
}

.planet-node.open-world::after {
    content: '🔓';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
}

.planet-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    background: var(--color-accent);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.planet-node:hover .planet-delete {
    display: flex;
}

@keyframes planetPulse {
    0%, 100% { box-shadow: 0 0 10px var(--planet-color, rgba(255, 215, 0, 0.5)); }
    50% { box-shadow: 0 0 20px var(--planet-color, rgba(255, 215, 0, 0.8)); }
}

@keyframes planetRing {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.2; }
}

/* Admin Planet Drag Mode */
.galaxy-map.admin-mode .planet-node.admin-draggable {
    cursor: grab;
}

.galaxy-map.admin-mode .planet-node.admin-draggable:hover {
    outline: 2px dashed rgba(255, 215, 0, 0.6);
    outline-offset: 4px;
}

.planet-node.admin-dragging {
    cursor: grabbing !important;
    opacity: 0.85;
    filter: brightness(1.3);
    transition: none !important;
    animation: none !important;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.8) !important;
}

.planet-node.drag-saved {
    box-shadow: 0 0 30px rgba(74, 222, 128, 0.9) !important;
    transition: box-shadow 0.3s ease !important;
}

.planet-node.drag-failed {
    box-shadow: 0 0 30px rgba(255, 80, 80, 0.9) !important;
    transition: box-shadow 0.3s ease !important;
}

/* Admin mode indicator */
.galaxy-map.admin-mode::after {
    content: '🛠 Admin: drag planets to reposition';
    position: absolute;
    top: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 10, 15, 0.85);
    color: var(--color-gold);
    font-size: 0.8rem;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    z-index: 25;
    pointer-events: none;
    white-space: nowrap;
}

/* Galaxy Map Tooltip */
.galaxy-view .planet-tooltip {
    position: absolute;
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid var(--color-primary);
    border-radius: 12px;
    padding: 1rem;
    width: 280px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(-100%);
    transition: opacity 0.2s ease;
    z-index: 100;
    box-shadow: var(--glow-primary);
}

.galaxy-view .planet-tooltip.visible {
    opacity: 1;
}

.tooltip-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tooltip-type-icon {
    font-size: 1.5rem;
}

.tooltip-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--color-gold);
}

.tooltip-creator {
    color: var(--color-text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.tooltip-type {
    color: var(--color-primary-light);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.tooltip-description {
    color: var(--color-text);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-collab {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.tooltip-hint {
    font-size: 0.8rem;
    color: var(--color-primary-light);
}

/* View Toggle */
.view-toggle {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

.toggle-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--color-text-dim);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(124, 91, 245, 0.1);
    border-color: rgba(124, 91, 245, 0.3);
}

.toggle-btn.active {
    background: rgba(124, 91, 245, 0.2);
    border-color: var(--color-primary);
    color: var(--color-text);
}

/* Planet Grid (List View) */
.galaxy-list {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.planet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.planet-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.planet-card:hover {
    transform: translateY(-5px);
    border-color: rgba(124, 91, 245, 0.4);
    box-shadow: 0 10px 40px rgba(124, 91, 245, 0.2);
}

.card-image {
    height: 180px;
    min-height: 180px;
    aspect-ratio: 280 / 180;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: none;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    aspect-ratio: 280 / 180;
}

.card-emoji {
    font-size: 4rem;
}

.card-collab {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--color-text);
}

.card-delete {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 28px;
    height: 28px;
    background: var(--color-accent);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.planet-card:hover .card-delete {
    opacity: 1;
}

.card-content {
    padding: 1.25rem;
}

.card-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.card-type {
    color: var(--color-primary-light);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.card-creator {
    color: var(--color-text-dim);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.card-description {
    color: var(--color-text-dim);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Galaxy Stats */
.galaxy-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 3rem 2rem;
    background: linear-gradient(180deg, transparent, rgba(124, 91, 245, 0.05));
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-gold);
    display: block;
}

.stat-label {
    color: var(--color-text-dim);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Moderator Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--color-bg-medium);
    border: 1px solid rgba(124, 91, 245, 0.3);
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 60px rgba(124, 91, 245, 0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--color-text-dim);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-content h2 {
    font-family: var(--font-display);
    margin-bottom: 1rem;
    color: var(--color-text);
}

.modal-content p {
    color: var(--color-text-dim);
    margin-bottom: 1rem;
}

.modal-content input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.mod-error {
    color: var(--color-accent);
    font-size: 0.9rem;
}

.mod-status {
    color: var(--color-secondary);
    margin-bottom: 1rem;
}

.mod-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mod-actions .btn {
    justify-content: center;
}

/* Pending Review Section */
.mod-review-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mod-review-section h3 {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pending-badge {
    background: var(--color-accent);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pending-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pending-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.75rem;
}

.pending-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.pending-item-name {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--color-text);
}

.pending-item-type {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.pending-item-meta {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    margin-bottom: 0.5rem;
}

.pending-item-actions {
    display: flex;
    gap: 0.5rem;
}

.pending-item-actions .btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-approve {
    background: rgba(74, 222, 128, 0.2);
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: #4ade80;
}

.btn-approve:hover {
    background: rgba(74, 222, 128, 0.3);
}

.btn-reject {
    background: rgba(255, 107, 157, 0.2);
    border: 1px solid rgba(255, 107, 157, 0.4);
    color: var(--color-accent);
}

.btn-reject:hover {
    background: rgba(255, 107, 157, 0.3);
}

.pending-empty {
    color: var(--color-text-dim);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

/* ============================================
   Planet Profile Page Styles
   ============================================ */

/* Planet Navigation */
.planet-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.95), transparent);
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Planet Page Layout */
.planet-page {
    min-height: 100vh;
    padding-top: 5rem;
}

/* Loading State */
.planet-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(124, 91, 245, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.planet-loading p {
    color: var(--color-text-dim);
}

/* Not Found State */
.planet-not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    padding: 2rem;
}

.not-found-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.planet-not-found h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.planet-not-found p {
    color: var(--color-text-dim);
    margin-bottom: 2rem;
}

/* Planet Content */
.planet-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Planet Hero */
.planet-hero {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: start;
}

.planet-image-container {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(124, 91, 245, 0.3);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    aspect-ratio: 1;
}

.planet-image-container img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    aspect-ratio: 1;
}

.planet-image-fallback {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
}

.planet-type-badge {
    display: inline-block;
    background: rgba(124, 91, 245, 0.2);
    border: 1px solid rgba(124, 91, 245, 0.4);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--color-primary-light);
    margin-bottom: 0.75rem;
}

.planet-name {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    background: linear-gradient(135deg, var(--color-text), var(--color-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.planet-creator {
    color: var(--color-text-dim);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.planet-creator span {
    color: var(--color-text);
}

.planet-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

.planet-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Planet Sections */
.planet-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.planet-section h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--color-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    font-size: 1.5rem;
}

.section-content p {
    color: var(--color-text-dim);
    line-height: 1.7;
    white-space: pre-wrap;
}

.lore-block {
    margin-bottom: 1.5rem;
}

.lore-block:last-child {
    margin-bottom: 0;
}

.lore-block h3 {
    font-size: 1rem;
    color: var(--color-primary-light);
    margin-bottom: 0.5rem;
}

.tech-level-badge,
.magic-status {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 1rem;
}

/* Planet Actions */
.planet-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 2rem 0;
    flex-wrap: wrap;
}

/* Collaboration Forms */
.collab-form-container {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(124, 91, 245, 0.08);
    border: 1px solid rgba(124, 91, 245, 0.2);
    border-radius: 12px;
}

.collab-form-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--color-primary-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.collab-icon {
    font-size: 1.1rem;
}

.collab-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.collab-field-select {
    padding: 0.625rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
}

.collab-field-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.collab-input {
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    resize: vertical;
    min-height: 80px;
}

.collab-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.collab-input::placeholder {
    color: var(--color-text-dim);
}

.collab-form-footer {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.collab-name {
    flex: 1;
    padding: 0.5rem 0.875rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}

.collab-name:focus {
    outline: none;
    border-color: var(--color-primary);
}

.collab-name::placeholder {
    color: var(--color-text-dim);
}

/* Contributions Display */
.contributions-list {
    margin-top: 1rem;
}

.contribution-item {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.75rem;
}

.contribution-item:last-child {
    margin-bottom: 0;
}

.contribution-content {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.contribution-meta {
    font-size: 0.8rem;
    color: var(--color-text-dim);
    font-style: italic;
}

/* About Page */
.about-page {
    min-height: 100vh;
    padding-top: 5rem;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.about-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary), var(--color-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-section {
    margin-bottom: 2rem;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-dim);
}

/* Gallery & Planet Page Responsive */
@media (max-width: 768px) {
    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group label {
        margin-bottom: 0.25rem;
    }
    
    .search-group input {
        min-width: auto;
    }
    
    .galaxy-map {
        width: min(100%, 60vh);
        max-width: none;
    }
    
    .map-controls {
        right: 0.5rem;
        padding: 0.5rem;
    }
    
    .map-control-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .mini-map {
        width: 70px;
        height: 70px;
        left: 0.5rem;
        bottom: 0.5rem;
    }
    
    .galaxy-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .planet-hero {
        grid-template-columns: 1fr;
    }
    
    .planet-image-container {
        max-width: 300px;
        max-height: 300px;
        margin: 0 auto;
    }
    
    .planet-image-container img {
        max-height: 300px;
    }
    
    .planet-hero-info {
        text-align: center;
    }
    
    .planet-meta {
        justify-content: center;
    }
    
    .planet-section {
        padding: 1.25rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .planet-grid {
        grid-template-columns: 1fr;
    }
    
    .galaxy-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .view-toggle {
        flex-direction: column;
        align-items: center;
    }
    
    .toggle-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .collab-form-footer {
        flex-direction: column;
    }
    
    .collab-name {
        width: 100%;
    }
}
