:root {
  color-scheme: dark;
  --black: #050505;
  --panel: #0d0b09;
  --gold: #d7af55;
  --gold-bright: #f3d784;
  --red: #8f1f24;
  --red-bright: #c33b3f;
  --muted: #bdb5a4;
  --line: rgba(215, 175, 85, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--black); }
body { min-height: 100vh; margin: 0; background: var(--black); color: var(--muted); font-family: Georgia, "Times New Roman", serif; }
a { color: var(--gold); }

.site-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.site-header, .site-footer { background: linear-gradient(180deg, #100d09, #050505); border-color: var(--line); }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-inner { min-height: 84px; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--gold-bright); text-decoration: none; text-transform: uppercase; letter-spacing: .18em; font-size: clamp(.95rem, 2vw, 1.2rem); }
.header-logo { width: 64px; height: 64px; flex: 0 0 64px; object-fit: contain; }
.main-nav, .header-actions { display: flex; align-items: center; gap: clamp(.6rem, 1.5vw, 1.25rem); }
.main-nav a { color: #bcae91; text-decoration: none; font: 700 .68rem/1 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--gold-bright); }
.join-link { color: var(--gold-bright); text-decoration: none; font: 700 .75rem/1 Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.portal-link, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .65rem 1rem; border: 1px solid var(--red-bright); border-radius: 4px; background: linear-gradient(180deg, #a52c31, #681419); color: #fff2d0; text-decoration: none; font: 700 .8rem/1 Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.portal-link:hover, .button:hover { background: linear-gradient(180deg, #c33b3f, #7e191e); }

.landing { min-height: 0; display: grid; place-items: center; padding: clamp(2rem, 6vw, 5rem) 1rem; background: radial-gradient(circle at 50% 45%, rgba(143,31,36,.11), transparent 38%), #000; }
.logo { display: block; width: min(100%, 820px); height: auto; object-fit: contain; }
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 86px; padding: 1rem 0; color: #8f887b; font: .82rem/1.5 Arial, sans-serif; }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: var(--gold); text-decoration: none; }

.auth-main, .portal-main, .content-main { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2rem, 6vw, 5rem) 0; }
.auth-card, .panel { background: linear-gradient(145deg, rgba(20,16,11,.98), rgba(8,7,6,.98)); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
.auth-card { width: min(460px, 100%); margin: 0 auto; padding: clamp(1.5rem, 5vw, 2.5rem); }
h1, h2 { margin-top: 0; color: var(--gold-bright); font-weight: 500; letter-spacing: .04em; }
.eyebrow { color: var(--red-bright); font: 700 .75rem/1 Arial, sans-serif; letter-spacing: .18em; text-transform: uppercase; }
label { display: block; margin: 1rem 0 .4rem; color: var(--gold); font: .8rem/1.2 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
input { width: 100%; min-height: 46px; padding: .75rem; border: 1px solid #4b4030; border-radius: 4px; background: #050505; color: #fff; font: 1rem Arial, sans-serif; }
input:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.auth-card .button { width: 100%; margin-top: 1.25rem; }
.error { padding: .75rem; border-left: 3px solid var(--red-bright); background: rgba(143,31,36,.15); color: #ffd6d6; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
.stat, .panel { padding: 1.25rem; }
.stat strong { display: block; color: var(--gold-bright); font-size: 2rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font: .82rem/1.45 Arial, sans-serif; }
th, td { padding: .7rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--gold); }
.privacy-copy { max-width: 760px; line-height: 1.7; }

.promo-main { overflow: hidden; }
.hero { position: relative; min-height: min(760px, calc(100vh - 72px)); display: grid; place-items: center; padding: clamp(4rem, 9vw, 8rem) 1rem; text-align: center; background: radial-gradient(circle at 50% 38%, rgba(143,31,36,.24), transparent 30%), linear-gradient(180deg, rgba(0,0,0,.25), #050505 88%), url('/assets/living-realms-logo.png') center 24% / min(58vw, 620px) auto no-repeat; }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.72), transparent 30%, transparent 70%, rgba(0,0,0,.72)); pointer-events: none; }
.hero-content { position: relative; z-index: 1; max-width: 850px; margin-top: clamp(12rem, 28vw, 23rem); }
.hero h1, .page-hero h1 { color: #f4d987; font-size: clamp(2.25rem, 6vw, 5.2rem); line-height: .98; text-shadow: 0 4px 30px #000; }
.hero p { max-width: 720px; margin: 1rem auto 1.8rem; color: #ded5c4; font-size: clamp(1rem, 2vw, 1.3rem); line-height: 1.6; }
.button-row { display: flex; justify-content: center; flex-wrap: wrap; gap: .8rem; }
.button.secondary { border-color: var(--gold); background: rgba(8,7,6,.82); color: var(--gold-bright); }
.section { padding: clamp(3.5rem, 8vw, 7rem) 1rem; }
.section-inner { width: min(1120px, 100%); margin: 0 auto; }
.section-heading { max-width: 760px; margin: 0 auto 2.5rem; text-align: center; }
.section-heading p, .lead { font-size: 1.12rem; line-height: 1.75; }
.feature-grid, .card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1.25rem; }
.feature-card, .lore-card, .signup-card { padding: clamp(1.3rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(145deg, rgba(22,18,13,.96), rgba(8,7,6,.98)); }
.feature-card h3, .lore-card h2, .lore-card h3 { color: var(--gold-bright); }
.feature-card p, .lore-card p { line-height: 1.7; }
.page-hero { padding: clamp(5rem, 10vw, 9rem) 1rem clamp(3rem, 7vw, 5rem); text-align: center; border-bottom: 1px solid var(--line); background: radial-gradient(circle at 50% 35%, rgba(23,71,46,.22), transparent 38%), #050505; }
.page-hero .lead { max-width: 850px; margin: 0 auto; }
.lore-meta { color: var(--red-bright); font: 700 .72rem/1 Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.lore-quote { color: #e5dcc8; font-size: 1.04rem; line-height: 1.75; }
.progression { color: var(--gold-bright); font-weight: 700; line-height: 1.8; }
.chronicle { display: grid; grid-template-columns: 90px 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.chronicle-day { color: var(--red-bright); font-weight: 700; }
.sample-badge { display: inline-block; padding: .35rem .6rem; border: 1px solid var(--gold); color: var(--gold); font: 700 .7rem/1 Arial,sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.character-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.character-grid img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.signup-layout { display: grid; grid-template-columns: .85fr 1.15fr; gap: 2rem; align-items: start; }
.signup-card input, .signup-card select, .signup-card textarea { width: 100%; min-height: 46px; padding: .75rem; border: 1px solid #4b4030; border-radius: 4px; background: #050505; color: #fff; font: 1rem Arial,sans-serif; }
.signup-card textarea { min-height: 100px; resize: vertical; }
.signup-card .button { width: 100%; margin-top: 1rem; }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; align-items: stretch; }
.password-field .password-toggle { min-width: 74px; border: 1px solid var(--gold); border-radius: 4px; background: #1a1209; color: var(--gold-bright); font-weight: 700; cursor: pointer; }
.password-field .password-toggle:hover { background: #2a1c0e; }
.account-action-row { display: grid; grid-template-columns: 1fr 1.35fr; gap: .65rem; }
.compact-form .button { margin-top: .4rem; }
.form-note { font: .82rem/1.5 Arial,sans-serif; color: #9d9588; }
.success { padding: 1rem; border-left: 3px solid #3a9662; background: rgba(40,120,75,.16); color: #d7ffe7; }
.honeypot { position: absolute !important; left: -10000px !important; }
.portal-tabs { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0 1.5rem; }
.portal-tabs a { padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.download-panel { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 1.5rem; margin: 0 0 1.5rem; padding: 1.5rem; }
.download-panel .button { display: flex; margin: .55rem 0; white-space: nowrap; }
.danger-button { padding: .45rem .65rem; border: 1px solid var(--red-bright); border-radius: 4px; background: transparent; color: #ffb8b8; cursor: pointer; }
.feedback-heading { max-width: 820px; margin-bottom: 2rem; }
.feedback-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr); gap: 1.5rem; align-items: start; }
.feedback-card { padding: clamp(1.4rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(145deg, rgba(22,18,13,.96), rgba(8,7,6,.98)); }
.feedback-card input, .feedback-card select, .feedback-card textarea, .feedback-filter select, .feedback-admin-form select, .feedback-admin-form textarea { width: 100%; min-height: 46px; padding: .75rem; border: 1px solid #4b4030; border-radius: 4px; background: #050505; color: #fff; font: 1rem Arial,sans-serif; }
.feedback-card textarea, .feedback-admin-form textarea { resize: vertical; line-height: 1.45; }
.feedback-card input:focus, .feedback-card select:focus, .feedback-card textarea:focus, .feedback-filter select:focus, .feedback-admin-form select:focus, .feedback-admin-form textarea:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.feedback-fields.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-optional { color: #928a7d; font-size: .72rem; text-transform: none; letter-spacing: 0; }
.feedback-guide { position: sticky; top: 1.5rem; }
.feedback-guide ol { padding-left: 1.2rem; line-height: 1.7; }
.feedback-history { margin-top: 3rem; }
.feedback-ticket-list, .admin-feedback-list { display: grid; gap: 1rem; }
.feedback-ticket { padding: 1.2rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(13,11,9,.92); }
.feedback-ticket-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.feedback-ticket-heading h2, .feedback-ticket-heading h3 { margin: .3rem 0 0; }
.ticket-number { color: var(--red-bright); font: 700 .76rem/1 Arial,sans-serif; letter-spacing: .1em; }
.status-badge { flex: 0 0 auto; display: inline-flex; padding: .42rem .65rem; border: 1px solid var(--gold); border-radius: 999px; color: var(--gold-bright); font: 700 .7rem/1 Arial,sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.status-badge.status-completed { border-color: #3a9662; color: #9fe2b9; }
.status-badge.status-declined { border-color: #777; color: #bbb; }
.status-badge.status-in_progress, .status-badge.status-reviewing { border-color: var(--red-bright); color: #ffaaa5; }
.feedback-meta { color: #a79e90; font: .8rem/1.55 Arial,sans-serif; }
.player-response { margin-top: 1rem; padding: 1rem; border-left: 3px solid var(--gold); background: rgba(215,175,85,.08); }
.player-response p { margin-bottom: 0; }
.feedback-filter { display: grid; grid-template-columns: 1fr 1fr auto; gap: 1rem; align-items: end; margin-bottom: 1rem; }
.feedback-filter label { margin-top: 0; }
.feedback-filter .button { margin-bottom: 1px; }
.admin-feedback-ticket { scroll-margin-top: 1rem; }
.feedback-report-body { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem 1.5rem; margin: 1rem 0; }
.feedback-report-body h3 { margin-bottom: .35rem; color: var(--gold); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.feedback-report-body p { margin-top: 0; line-height: 1.55; white-space: normal; }
.feedback-admin-form { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.feedback-admin-form .button { margin-top: 1rem; }

@media (max-width: 680px) {
  .brand { letter-spacing: .1em; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: 1fr; }
  .feature-grid, .card-grid, .character-grid, .signup-layout, .download-panel, .feedback-layout, .feedback-fields.two-column, .feedback-filter, .feedback-report-body { grid-template-columns: 1fr; }
  .feedback-guide { position: static; }
  .feedback-ticket-heading { align-items: flex-start; flex-direction: column; }
  .chronicle { grid-template-columns: 1fr; gap: .25rem; }
  .header-inner { flex-wrap: wrap; padding: .75rem 0; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; padding: .75rem 0 .15rem; border-top: 1px solid var(--line); }
  .main-nav a { flex: 0 0 auto; }
  .header-actions { gap: .5rem; }
  .account-action-row { grid-template-columns: 1fr; gap: 0; }
  .join-link { display: none; }
  .portal-link { padding: .55rem .7rem; }
}
