@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Outfit:wght@300;400;600&display=swap');

:root {
    --bg-primary: #02030a;
    --bg-secondary: #0b0f1f;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5f5;
    --text-muted: #6b7280;
    
    --gold-gradient: linear-gradient(135deg, #d4af37, #facc15);
    --sapphire-gradient: linear-gradient(135deg, #1e3a8a, #3b82f6);
    --purple-gradient: linear-gradient(135deg, #6d28d9, #9333ea);
    --flame-gradient: linear-gradient(135deg, #f59e0b, #ea580c);
    
    --gold-glow: rgba(212, 175, 55, 0.45);
    --blue-glow: rgba(59, 130, 246, 0.35);
    --purple-glow: rgba(147, 51, 234, 0.35);
    
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(212, 175, 55, 0.15);
    
    --font-heading: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;
    
    --nav-width: 80px;
    --container-max: 1280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

/* Ambient Cosmic/Desert Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(30, 58, 138, 0.15), transparent 60%),
                radial-gradient(circle at 80% 80%, rgba(109, 40, 217, 0.1), transparent 50%);
    z-index: -2;
    pointer-events: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Utilities */
.text-gold {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Layout */
.page-wrapper {
    padding-left: calc(var(--nav-width) + 40px);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.section-spacing {
    padding: 120px 0;
}

/* Floating Royal Orbit Nav */
.orbit-nav {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    width: var(--nav-width);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 0;
    gap: 30px;
    z-index: 1000;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.1), inset 0 0 20px rgba(255, 255, 255, 0.02);
    animation: float 6s ease-in-out infinite;
}

.orbit-nav::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 40px;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.nav-item {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transition: all 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    color: #fff;
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 15px var(--gold-glow);
    transform: scale(1.15);
}

.nav-item.active {
    background: var(--gold-gradient);
    color: #000;
}

/* Tooltip for nav */
.nav-item::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    margin-left: 15px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    border: 1px solid var(--glass-border);
    white-space: nowrap;
}

.nav-item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Top Header */
.top-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 40px 30px calc(var(--nav-width) + 60px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    fill: url(#goldGradient);
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.auth-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 12px 28px;
    border-radius: 20px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(212, 175, 55, 0.5);
}

.btn-gold {
    background: var(--gold-gradient);
    color: #000;
    border: none;
    box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-gold::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    transition: 0.5s;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.btn-gold:hover::before {
    left: 150%;
}

.btn-large {
    padding: 16px 40px;
    font-size: 16px;
    border-radius: 24px;
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,255,255,0.1);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('images/photo-1542361345-89e58247f2d5.png') center/cover no-repeat;
    opacity: 0.4;
    z-index: -1;
    mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-subtitle {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    color: #facc15;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
    animation: fadeUp 1s ease both;
}

.hero h1 {
    font-size: clamp(40px, 5vw, 64px);
    margin-bottom: 24px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.8);
    animation: fadeUp 1s ease 0.2s both;
}

.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    animation: fadeUp 1s ease 0.4s both;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    animation: fadeUp 1s ease 0.6s both;
}

/* Magic Particles / Lanterns */
.particles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.lantern {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #facc15;
    border-radius: 50%;
    box-shadow: 0 0 10px 2px rgba(250, 204, 21, 0.8), 0 0 20px 5px rgba(250, 204, 21, 0.4);
    animation: floatUp linear infinite;
    opacity: 0;
}

.lantern:nth-child(1) { left: 10%; animation-duration: 15s; animation-delay: 0s; }
.lantern:nth-child(2) { left: 30%; animation-duration: 20s; animation-delay: 5s; width: 4px; height: 4px; }
.lantern:nth-child(3) { left: 50%; animation-duration: 18s; animation-delay: 2s; }
.lantern:nth-child(4) { left: 70%; animation-duration: 22s; animation-delay: 8s; width: 8px; height: 8px; }
.lantern:nth-child(5) { left: 90%; animation-duration: 16s; animation-delay: 4s; }

/* Game Section */
.game-section {
    position: relative;
    z-index: 5;
    margin-top: -80px;
}

.game-wrapper {
    padding: 2px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.8), rgba(212, 175, 55, 0.1), rgba(109, 40, 217, 0.5));
    border-radius: 26px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 40px var(--gold-glow);
    animation: borderShimmer 4s linear infinite;
    background-size: 200% 200%;
}

.game-inner {
    background: var(--bg-primary);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
}

.game-header {
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.game-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.game-title h2 {
    font-size: 20px;
    margin: 0;
}

.game-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite;
}

.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}

.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Features Section */
.features-header {
    text-align: center;
    margin-bottom: 60px;
}

.features-header h2 {
    font-size: 40px;
    margin-bottom: 15px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

.feature-card {
    padding: 40px 30px;
    transition: all 0.4s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(212, 175, 55, 0.4);
    background: rgba(255,255,255,0.08);
}

.card-tall { grid-column: span 5; }
.card-wide { grid-column: span 7; }
.card-half { grid-column: span 6; }

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.feature-icon svg {
    width: 30px;
    height: 30px;
    fill: url(#goldGradient);
}

.feature-card h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
}

/* Treasure Experience Section */
.treasure-section {
    position: relative;
    padding: 100px 0;
    overflow: hidden;
}

.treasure-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--purple-gradient);
    opacity: 0.05;
    z-index: 0;
}

.treasure-content {
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.treasure-text {
    flex: 1;
}

.treasure-text h2 {
    font-size: 48px;
    margin-bottom: 20px;
}

.treasure-text p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.treasure-visual {
    flex: 1;
    position: relative;
    height: 400px;
}

.floating-lamp {
    width: 100%;
    height: 100%;
    background: url('images/photo-1541753866388-0b3c701627d3.png') center/cover;
    border-radius: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 40px rgba(147, 51, 234, 0.3);
    animation: float 8s ease-in-out infinite;
    position: relative;
}

.floating-lamp::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 30px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding: 60px 0 30px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 60px;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-brand {
    max-width: 300px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 60px;
}

.link-group h4 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 16px;
    font-family: var(--font-body);
}

.link-group ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-group a {
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.3s;
}

.link-group a:hover {
    color: #facc15;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 30px;
    text-align: center;
}

.legal-notice {
    color: var(--text-muted);
    font-size: 12px;
    max-width: 800px;
    margin: 0 auto 15px;
    line-height: 1.8;
}

.copyright {
    color: #4b5563;
    font-size: 12px;
}

/* Inner Pages (About, Terms, etc.) */
.inner-page-header {
    padding: 180px 0 80px;
    text-align: center;
    position: relative;
}

.inner-page-header h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.inner-page-header p {
    color: var(--text-secondary);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

.content-box {
    padding: 60px;
    margin-bottom: 80px;
}

.content-box h2 {
    margin: 40px 0 20px;
    color: #facc15;
    font-size: 28px;
}

.content-box h2:first-child {
    margin-top: 0;
}

.content-box p {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.content-box ul {
    margin-bottom: 20px;
    padding-left: 20px;
    color: var(--text-secondary);
}

.content-box li {
    margin-bottom: 10px;
    list-style-type: disc;
}

/* Contact Page Specific */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-body);
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(-50%) translateY(0); }
    50% { transform: translateY(-50%) translateY(-10px); }
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0.5); opacity: 0; }
    20% { opacity: 0.8; }
    80% { opacity: 0.8; }
    100% { transform: translateY(-20vh) scale(1.5); opacity: 0; }
}

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

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

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Responsive */
@media (max-width: 1024px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    .card-tall, .card-wide, .card-half {
        grid-column: span 1;
    }
    .treasure-content {
        flex-direction: column;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --nav-width: 0px;
    }
    
    .page-wrapper {
        padding-left: 0;
        padding-bottom: 80px; /* Space for bottom nav */
    }
    
    .orbit-nav {
        top: auto;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        flex-direction: row;
        justify-content: space-around;
        padding: 15px 20px;
        border-radius: 30px;
        animation: none;
    }
    
    .orbit-nav::after {
        display: none;
    }
    
    .nav-item::after {
        display: none; /* Hide tooltips on mobile */
    }
    
    .top-header {
        padding: 20px;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .game-section {
        margin-top: 0;
        padding-top: 40px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .content-box {
        padding: 30px 20px;
    }
}