:root {
    --bg-dark: #0B0908;
    --obsidian: #15110F;
    --ember: #E85D04;
    --gold: #F5B642;
    --scale: #253529;
    --emerald: #2DD4BF;
    --ruby: #9F1239;
    --ash: #8A817C;
    --bone: #F4E7D0;
    --text-primary: #FFF7E8;
    --text-muted: #B8A99A;
    --gradient-accent: linear-gradient(135deg, #E85D04, #F5B642);
    --gradient-secondary: linear-gradient(135deg, #253529, #2DD4BF);
    --font-main: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-heading: 'Georgia', 'Times New Roman', serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: normal;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.25s, transform 0.25s;
}

a:hover {
    color: var(--ember);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--obsidian);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
}

.btn:hover {
    background: var(--ember);
    color: var(--text-primary);
    border-color: var(--ember);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--gradient-accent);
    color: var(--bg-dark);
    border: none;
}

.btn-primary:hover {
    background: var(--gold);
    color: var(--bg-dark);
}

/* Top Bar */
.top-bar {
    background: var(--obsidian);
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.brand {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--gold);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

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

/* Sections Base */
section {
    padding: 50px 0;
}

/* Egg Awakening Gate */
#forge {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    padding-top: 60px;
}

.gate-content h1 {
    font-size: 3rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.gate-content p {
    font-size: 1.1rem;
    color: var(--bone);
    margin-bottom: 24px;
}

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

.gate-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    aspect-ratio: 600/360;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--scale);
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.1);
}

/* Forge Core Game Chamber */
#game {
    text-align: center;
}

.game-chamber {
    max-width: 1020px;
    margin: 0 auto;
    background: var(--obsidian);
    padding: 12px;
    border-radius: 24px;
    border: 2px solid var(--gold);
    position: relative;
}

/* Emerald Crystal Corners */
.corner {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--emerald);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--emerald);
}
.corner-tl { top: -8px; left: -8px; }
.corner-tr { top: -8px; right: -8px; }
.corner-bl { bottom: -8px; left: -8px; }
.corner-br { bottom: -8px; right: -8px; }

.iframe-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
}

/* Crystal Nest Panels */
#crystal-nests .container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
}

.nest-panel {
    background: var(--obsidian);
    padding: 30px;
    border-radius: 12px;
    border-top: 3px solid var(--gold);
    position: relative;
}

.nest-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 12px;
    pointer-events: none;
}

.nest-panel h3 {
    color: var(--emerald);
    border-bottom: 1px solid var(--gold);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.ledger-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(138, 129, 124, 0.2);
    color: var(--bone);
}

.standards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.standard-item h4 {
    color: var(--gold);
    font-size: 1.1rem;
}

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

.nest-image {
    margin-top: 20px;
    width: 100%;
    max-width: 600px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--scale);
}

/* Ember Trail */
.ember-trail {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 40px 0;
    max-width: 800px;
    margin: 0 auto;
}

.ember-line {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--ember);
    z-index: 1;
}

.trail-station {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 120px;
}

.egg-marker {
    width: 24px;
    height: 32px;
    background: var(--obsidian);
    border: 2px solid var(--gold);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    margin: 0 auto 10px;
    box-shadow: inset 0 0 10px var(--ember), 0 0 15px rgba(232, 93, 4, 0.4);
}

.trail-station p {
    font-size: 0.85rem;
    color: var(--bone);
    font-family: var(--font-heading);
}

/* Keeper Archive */
#keeper-archive {
    background: var(--obsidian);
    border-top: 1px solid var(--scale);
    border-bottom: 1px solid var(--scale);
    padding: 60px 0;
}

.archive-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
}

.archive-col h3 {
    color: var(--emerald);
    border-bottom: 1px solid var(--gold);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.support-email {
    font-size: 1.2rem;
    color: var(--ember);
    font-family: monospace;
    background: var(--bg-dark);
    padding: 10px;
    border-radius: 4px;
    display: inline-block;
}

.faq-list li {
    margin-bottom: 15px;
}
.faq-list strong {
    color: var(--gold);
    display: block;
}
.faq-list span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 10px;
    background: var(--bg-dark);
    border: 1px solid var(--ash);
    color: var(--text-primary);
    border-radius: 4px;
    font-family: var(--font-main);
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--ember);
}

.contact-form textarea {
    resize: vertical;
    min-height: 80px;
}

.contact-info p {
    margin-bottom: 5px;
    color: var(--bone);
}

.archive-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--scale);
}

/* Dragon Vault Footer */
footer {
    background: var(--obsidian);
    padding: 70px 0 30px;
    border-top: 4px solid var(--ember);
}

.footer-directory-title h2 {
    color: var(--gold);
    font-size: 2rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.footer-crest {
    text-align: center;
    margin-bottom: 50px;
}

.egg-crest {
    width: 90px;
    height: 120px;
    background: var(--gradient-secondary);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    margin: 0 auto;
    border: 4px solid var(--gold);
    box-shadow: 0 0 50px rgba(45, 212, 191, 0.4), inset 0 0 25px rgba(0,0,0,0.6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.egg-crest:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(45, 212, 191, 0.6), inset 0 0 30px rgba(0,0,0,0.8);
}

.footer-panels {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.footer-panel {
    background: #15110F;
    border: 1px solid rgba(245, 182, 66, 0.35);
    border-radius: 18px;
    padding: 28px;
    min-height: 260px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
}

.footer-panel:hover {
    border-color: var(--emerald);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(45, 212, 191, 0.15);
}

.footer-panel h4 {
    color: var(--gold);
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.molten-divider {
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--ember), transparent);
    margin-bottom: 15px;
    width: 60px;
}

.footer-panel p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.footer-panel ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-panel li {
    display: flex;
    align-items: center;
}

.emerald-accent {
    color: var(--emerald);
    font-size: 0.9rem;
    margin-right: 8px;
}

.footer-panel a {
    font-size: 0.95rem;
    color: var(--bone);
    transition: color 0.25s ease, transform 0.25s ease;
    display: inline-block;
}

.footer-panel a:hover {
    color: var(--emerald);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(245, 182, 66, 0.2);
    padding-top: 30px;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--ash);
    max-width: 800px;
    margin: 0 auto 10px;
    line-height: 1.6;
}

/* Cookie Popup */
.cookie-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(11, 9, 8, 0.8);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}

.cookie-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.cookie-box {
    background: var(--obsidian);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.cookie-icon {
    width: 40px;
    height: 40px;
    background: var(--emerald);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    margin: 0 auto 15px;
}

.cookie-box h3 { margin-bottom: 10px; }
.cookie-box p { font-size: 0.9rem; color: var(--bone); margin-bottom: 20px; }

.cookie-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Legal Pages */
.legal-page {
    padding: 60px 0;
}

.legal-content {
    background: var(--obsidian);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--scale);
}

.legal-content h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--emerald);
}

.legal-content h2 {
    margin-top: 30px;
    color: var(--gold);
    font-size: 1.3rem;
}

.legal-content p {
    margin-bottom: 15px;
    color: var(--bone);
}

.legal-nav {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

/* Responsive */
@media (max-width: 900px) {
    #forge, #crystal-nests .container, .archive-grid, .footer-panels {
        grid-template-columns: 1fr;
    }
    .top-bar .nav-links {
        display: none;
    }
    .ember-trail {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    .ember-line {
        width: 2px;
        height: 100%;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }
}