:root {
    /* Backgrounds */
    --bg-primary: #070A0C;
    --bg-secondary: #101820;
    --castle-stone: #161B20;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(18px);
    
    /* Accents - Gradients */
    --royal-gold: linear-gradient(135deg, #B8860B, #FACC15);
    --kingdom-emerald: linear-gradient(135deg, #065F46, #10B981);
    --royal-blue: linear-gradient(135deg, #1E3A8A, #3B82F6);
    --sword-steel: linear-gradient(135deg, #64748B, #CBD5E1);
    
    /* Glows */
    --glow-gold: rgba(250, 204, 21, 0.45);
    --glow-emerald: rgba(16, 185, 129, 0.35);
    --glow-blue: rgba(59, 130, 246, 0.30);
    
    /* Typography */
    --text-primary: #F8FAFC;
    --text-secondary: #E2E8F0;
    --text-muted: #94A3B8;
    
    /* Layout */
    --max-width: 1280px;
    --spacing-desktop: 120px;
    --spacing-tablet: 80px;
    --spacing-mobile: 60px;
    
    /* Components */
    --radius-btn: 18px;
    --radius-card: 16px;
    --radius-game: 24px;
}

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

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cinzel', serif;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Layout System */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

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

section {
    padding: var(--spacing-desktop) 0;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 0;
    transition: all 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 10px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.header-inner::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 100px;
    padding: 1px;
    background: var(--royal-gold);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    pointer-events: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-secondary);
    position: relative;
}

.nav-links a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px var(--glow-gold);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--royal-gold);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: var(--radius-btn);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--royal-gold);
    color: var(--bg-primary);
    box-shadow: 0 4px 15px var(--glow-gold);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--glow-gold);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--kingdom-emerald);
    color: #fff;
    box-shadow: 0 4px 15px var(--glow-emerald);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--glow-emerald);
    filter: brightness(1.1);
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 120px;
    background-image: url('images/arthurs-legacy-mythical-camelot-castle-hero.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(7, 10, 12, 0.6) 0%, rgba(7, 10, 12, 0.9) 100%);
    z-index: 1;
}

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

.hero-title {
    font-size: 4.5rem;
    margin-bottom: 24px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.8);
    background: var(--royal-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInDown 1s ease forwards;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 48px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.hero-actions {
    display: flex;
    gap: 24px;
    justify-content: center;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-legal {
    margin-top: 40px;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.6s;
}

/* Story Section */
.story-image-col img {
    width: 100%;
    border-radius: var(--radius-game);
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border: 1px solid var(--glass-border);
    display: block;
}

/* Game Section */
.game-section {
    background: var(--bg-primary);
    position: relative;
}

.game-section::before {
    content: '';
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: var(--glow-gold);
    filter: blur(150px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 16px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Premium Game Frame */
.game-container-wrapper {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 3px;
    border-radius: calc(var(--radius-game) + 3px);
    background: linear-gradient(45deg, #B8860B, #10B981, #FACC15, #065F46);
    background-size: 300% 300%;
    animation: borderGradient 8s ease infinite;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px var(--glow-gold);
    z-index: 2;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.game-container-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 60px var(--glow-gold);
}

.game-frame {
    background: var(--castle-stone);
    border-radius: var(--radius-game);
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.game-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.game-controls {
    background: var(--bg-secondary);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--glass-border);
}

.game-info h3 {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.game-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.game-buttons {
    display: flex;
    gap: 16px;
}

/* Feature Cards */
.features-section {
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    position: relative;
    z-index: 2;
}

.feature-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    padding: 40px 32px;
    position: relative;
    transition: all 0.4s ease;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0.05;
    z-index: 0;
    pointer-events: none;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: rgba(250, 204, 21, 0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), inset 0 0 20px rgba(250,204,21,0.05);
}

.feature-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--castle-stone);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--glass-border);
}

.feature-card:hover .feature-icon-wrapper {
    background: var(--royal-gold);
}

.feature-icon-wrapper img {
    width: 32px;
    height: 32px;
    filter: invert(1);
    transition: filter 0.3s ease;
}

.feature-card:hover .feature-icon-wrapper img {
    filter: invert(0);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.feature-card p {
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

/* Interior Pages (About, Contact, Legal) */
.page-hero {
    padding: 180px 0 80px;
    text-align: center;
    background: linear-gradient(to bottom, var(--bg-secondary), var(--bg-primary));
    border-bottom: 1px solid var(--glass-border);
}

.page-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 16px;
    background: var(--royal-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.content-section {
    padding: 80px 0;
    max-width: 800px;
    margin: 0 auto;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    padding: 48px;
    margin-bottom: 32px;
}

.glass-panel h2 {
    margin-bottom: 24px;
    font-size: 2rem;
    color: var(--text-primary);
}

.glass-panel p {
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.glass-panel ul {
    margin-bottom: 24px;
    padding-left: 24px;
    color: var(--text-secondary);
}

.glass-panel li {
    margin-bottom: 12px;
}

/* Contact Form */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

.form-control {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #FACC15;
    box-shadow: 0 0 15px var(--glow-gold);
}

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

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    padding: 80px 0 40px;
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: var(--royal-gold);
    opacity: 0.2;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 60px;
}

.footer-brand .logo {
    display: flex;
    margin-bottom: 24px;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 400px;
}

.footer-links h4 {
    font-size: 1.2rem;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--text-primary);
}

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

.footer-legal-notice {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 24px;
    padding: 16px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background: var(--castle-stone);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-game);
    max-width: 600px;
    width: 100%;
    padding: 40px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 2rem;
    color: var(--text-primary);
}

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

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

/* Responsive */
@media (max-width: 1024px) {
    section { padding: var(--spacing-tablet) 0; }
    .hero-title { font-size: 3.5rem; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    section { padding: var(--spacing-mobile) 0; }
    .header-inner { padding: 10px 16px; }
    .nav-links { display: none; }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .hero-actions { flex-direction: column; }
    .section-title { font-size: 2.2rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .game-controls { flex-direction: column; gap: 16px; text-align: center; }
    
    .story-image-col, .story-text-col {
        grid-column: span 12 !important;
    }
    .story-text-col {
        margin-top: 32px;
        text-align: center;
    }
}