:root {
    --bg: #130E0A;
    --surface: #21170F;
    --surface-alt: #2F2115;
    --clay: #A6532B;
    --orange: #E07A2F;
    --gold: #D6A84F;
    --leather: #6B3F24;
    --green: #557A46;
    --steel: #7F8790;
    --parchment: #D8C39B;
    --ivory: #F4E6C8;
    --muted: #B7A58B;
    --grad-accent: linear-gradient(135deg, #E07A2F, #D6A84F);
    --grad-sec: linear-gradient(135deg, #A6532B, #557A46);
    
    --font-heading: 'Georgia', serif;
    --font-body: 'Arial', sans-serif;
    --max-width: 1200px;
}

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

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

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

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: normal;
    color: var(--ivory);
}

img {
    max-width: 100%;
    display: block;
}

/* BUTTONS */
.btn-primary {
    display: inline-block;
    background: var(--grad-accent);
    color: var(--bg);
    padding: 12px 24px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-outline {
    display: inline-block;
    background: transparent;
    color: var(--gold);
    padding: 10px 22px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid var(--gold);
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

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

.text-link {
    color: var(--gold);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    font-weight: bold;
}
.text-link:hover {
    color: var(--orange);
}

/* SIGNAL BAR */
#signal-bar {
    background-color: var(--surface-alt);
    color: var(--muted);
    font-size: 0.85rem;
    padding: 8px 5%;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--leather);
}

/* HEADER */
header {
    background-color: var(--surface);
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    border-bottom: 1px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: inline-block;
    transition: opacity 0.25s ease;
}

.logo:hover {
    opacity: 0.9;
}

.logo img {
    height: 48px;
    width: auto;
    display: block;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: var(--ivory);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 5px;
}

nav a:hover, nav a.active {
    color: var(--orange);
}

nav a:hover::after, nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--orange);
}

/* HERO / CANYON VAULT */
#frontier {
    max-width: var(--max-width);
    margin: 40px auto;
    padding: 0 5%;
}

.hero-image-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--leather);
    margin-bottom: 30px;
}

.hero-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

.hero-title-group {
    flex: 1;
}

.hero-title-group h1 {
    font-size: 3rem;
    line-height: 1.1;
    color: var(--gold);
    margin-bottom: 15px;
}

.hero-subtitle {
    display: block;
    color: var(--orange);
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.hero-text-block {
    flex: 1;
}

.hero-text-block p {
    color: var(--muted);
    font-size: 1.1rem;
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}

/* ROUTE INDEX */
#route-index {
    max-width: var(--max-width);
    margin: 80px auto;
    padding: 60px 5%;
    background-color: var(--surface);
    border-top: 1px solid var(--leather);
    border-bottom: 1px solid var(--leather);
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    align-items: start;
}

.route-left {
    display: flex;
    flex-direction: column;
}

.route-number {
    font-family: var(--font-heading);
    font-size: 6rem;
    color: var(--surface-alt);
    line-height: 0.8;
    margin-bottom: 10px;
}

.route-left h2 {
    font-size: 2rem;
    color: var(--gold);
}

.route-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.route-item {
    border-bottom: 1px solid var(--leather);
    padding-bottom: 20px;
}

.route-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.route-item h3 {
    font-size: 1.2rem;
    color: var(--ivory);
    margin-bottom: 8px;
    font-family: var(--font-body);
    display: flex;
    gap: 15px;
}

.route-item h3 span {
    color: var(--clay);
}

.route-item p {
    color: var(--muted);
    font-size: 0.95rem;
    padding-left: 38px;
}

/* GAME CHAMBER */
#game {
    max-width: 1020px;
    margin: 80px auto;
    padding: 0 5%;
}

.game-chamber-wrapper {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.vertical-rail {
    width: 40px;
    background-color: var(--surface-alt);
    border-right: 2px solid var(--leather);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vertical-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    white-space: nowrap;
}

.vertical-text span {
    color: var(--gold);
    margin: 0 10px;
}

.game-main {
    flex: 1;
}

.game-frame {
    background-color: var(--bg);
    border: 8px solid var(--leather);
    border-radius: 16px;
    padding: 4px;
    position: relative;
    box-shadow: 0 0 0 2px var(--gold);
}

.game-inner {
    border: 2px solid var(--steel);
    border-radius: 8px;
    height: 600px;
    overflow: hidden;
    position: relative;
    background-color: #000;
}

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

.corner-mark {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 2;
}
.cm-tl { top: -2px; left: -2px; border-top: 3px solid var(--orange); border-left: 3px solid var(--orange); border-top-left-radius: 12px; }
.cm-tr { top: -2px; right: -2px; border-top: 3px solid var(--orange); border-right: 3px solid var(--orange); border-top-right-radius: 12px; }
.cm-bl { bottom: -2px; left: -2px; border-bottom: 3px solid var(--orange); border-left: 3px solid var(--orange); border-bottom-left-radius: 12px; }
.cm-br { bottom: -2px; right: -2px; border-bottom: 3px solid var(--orange); border-right: 3px solid var(--orange); border-bottom-right-radius: 12px; }

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

/* LEDGER GALLERY */
#ledger {
    max-width: var(--max-width);
    margin: 80px auto;
    padding: 0 5%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.ledger-panel {
    background-color: var(--surface);
    border: 1px solid var(--leather);
    padding: 30px;
    display: flex;
    flex-direction: column;
}

.ledger-img-placeholder {
    width: 100%;
    height: 180px;
    background-color: var(--surface-alt);
    margin-bottom: 20px;
    border: 1px solid var(--leather);
    position: relative;
    overflow: hidden;
}

#ledger-img-1 {
    background-image: url('images/image-ledger-room.jpg');
    background-size: cover;
    background-position: center;
}
#ledger-img-2 {
    background: linear-gradient(to bottom, var(--surface-alt), var(--bg));
    display: flex; align-items: center; justify-content: center;
}
#ledger-img-2::after { content: 'RAILWAY SCHEMATICS'; color: var(--steel); font-family: var(--font-heading); font-size: 0.8rem; letter-spacing: 2px; }
#ledger-img-3 {
    background: linear-gradient(135deg, var(--clay), var(--bg));
    display: flex; align-items: center; justify-content: center; opacity: 0.5;
}

.ledger-panel h3 {
    font-size: 1.4rem;
    color: var(--gold);
    margin-bottom: 12px;
}

.ledger-panel p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    flex: 1;
}

/* DESERT CHRONICLE */
#chronicle {
    max-width: var(--max-width);
    margin: 80px auto;
    padding: 0 5%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.chronicle-img {
    width: 100%;
    height: 450px;
    border: 1px solid var(--leather);
    border-radius: 8px;
    object-fit: cover;
}

.chronicle-text h2 {
    font-size: 2.5rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.chronicle-text ul {
    list-style: none;
    margin-top: 20px;
}

.chronicle-text li {
    color: var(--ivory);
    margin-bottom: 12px;
    padding-left: 20px;
    position: relative;
}

.chronicle-text li::before {
    content: '→';
    color: var(--orange);
    position: absolute;
    left: 0;
    top: 0;
}

/* DISPATCH OFFICE */
#support {
    max-width: var(--max-width);
    margin: 80px auto;
    padding: 60px 5%;
    background-color: var(--surface);
    border-top: 1px solid var(--leather);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.dispatch-left h2 {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 20px;
}

.support-email {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--orange);
    margin-bottom: 40px;
    display: block;
}

.faq-preview h3 {
    font-size: 1.2rem;
    color: var(--ivory);
    margin-bottom: 16px;
    border-bottom: 1px solid var(--leather);
    padding-bottom: 8px;
}

.faq-preview ul {
    list-style: none;
}

.faq-preview li {
    color: var(--muted);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input, .form-group textarea {
    background-color: var(--bg);
    border: 1px solid var(--leather);
    color: var(--ivory);
    padding: 12px;
    border-radius: 4px;
    font-family: var(--font-body);
}

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

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

/* FOOTER */
footer {
    background-color: var(--surface-alt);
    border-top: 2px solid var(--gold);
    padding: 60px 5% 20px;
    margin-top: 60px;
}

.footer-top {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 40px;
}

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

.footer-brand .logo {
    margin-bottom: 16px;
}

.footer-brand .logo img {
    height: 60px;
}

.footer-brand p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.footer-email {
    color: var(--orange);
    font-size: 0.9rem;
}

.footer-address {
    color: var(--muted);
    font-size: 0.9rem;
    font-style: normal;
    margin-top: 12px;
    line-height: 1.4;
}

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

.footer-col h4 {
    color: var(--ivory);
    font-size: 1rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

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

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

.footer-col a:hover {
    color: var(--gold);
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    border-top: 1px solid var(--leather);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.8rem;
}

/* COOKIE POPUP */
#cookie-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    background-color: var(--parchment);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 20px;
    color: var(--surface);
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: none;
}

.cookie-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.cookie-icon {
    width: 24px;
    height: 24px;
    background-color: var(--clay);
    border-radius: 50%;
    position: relative;
}
.cookie-icon::after {
    content: ''; position: absolute; top: 6px; left: 6px; width: 4px; height: 4px; background: var(--surface); border-radius: 50%; box-shadow: 6px 2px 0 var(--surface), 2px 6px 0 var(--surface);
}

#cookie-popup h4 {
    color: var(--surface);
    font-size: 1.1rem;
    font-weight: bold;
}

#cookie-popup p {
    font-size: 0.85rem;
    margin-bottom: 16px;
    color: var(--leather);
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

.btn-cookie {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.btn-cookie.accept {
    background-color: var(--surface);
    color: var(--parchment);
}

.btn-cookie.reject {
    background-color: transparent;
    color: var(--surface);
    border: 1px solid var(--surface);
}

/* SUBPAGE STYLES */
.page-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px;
    background-color: var(--surface);
    border: 1px solid var(--leather);
    border-radius: 8px;
}

.page-container h1 {
    color: var(--gold);
    margin-bottom: 24px;
    text-align: center;
    font-size: 2.5rem;
}

.page-content {
    color: var(--muted);
}

.page-content h2 {
    color: var(--ivory);
    font-size: 1.5rem;
    margin: 30px 0 15px;
}

.page-content p {
    margin-bottom: 16px;
}

.return-home-container {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--leather);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .hero-content, #route-index, .game-chamber-wrapper, #chronicle, #support, .footer-top {
        flex-direction: column;
        grid-template-columns: 1fr;
    }
    .hero-content { align-items: stretch; }
    .hero-title-group h1 { font-size: 2.2rem; }
    .route-left { flex-direction: row; align-items: baseline; gap: 20px; }
    .route-number { font-size: 4rem; }
    #ledger { grid-template-columns: 1fr; }
    .footer-links-container { flex-direction: column; gap: 30px; }
    .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
    header nav { display: none; }
}