:root {
  --bg: #f7f1e8;
  --card: #fffaf2;
  --text: #2b2118;
  --muted: #6b5b4b;
  --accent: #c2562f;
  --accent-hover: #a64422;
  --gold: #e0a03a;
  --arena-bg: #1b1714;
  --arena-card: #26201c;
  --arena-border: #3d332c;
  --arena-text: #f7f1e8;
  --arena-muted: #b8a898;
  --border: #e5d8c5;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --font-head: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--text);
}

h1 { font-size: 36px; }
h2 { font-size: 28px; margin-top: 32px; }
h3 { font-size: 22px; margin-top: 24px; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
}

.brand:hover { text-decoration: none; }

.brand-icon {
  border-radius: 8px;
}

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

.nav-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
  text-decoration: none;
}

/* Buttons */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  text-decoration: none;
}

.btn-outline {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.btn-primary:focus-visible,
.btn-outline:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

/* Hero & Tool Shell */
.tool-hero {
  padding: 24px 0 48px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.hero-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  max-width: 70ch;
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius);
  background: var(--arena-bg);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.sim-shell {
  background: var(--arena-bg);
  color: var(--arena-text);
  border-radius: var(--radius);
  border: 1px solid var(--arena-border);
  box-shadow: var(--shadow-md);
  padding: 24px;
}


/* Engage Bar */
.engage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.engage-left,
.engage-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.engage-like[data-gf-liked],
.engage-like[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.engage-like[data-gf-liked] .count-pill,
.engage-like[aria-pressed="true"] .count-pill {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.count-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.share-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.share-msg {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* Mode Callout */
.mode-callout {
  padding: 0 0 48px;
}

.callout-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.callout-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}

.callout-text h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.callout-text p {
  margin: 0;
  color: var(--muted);
  max-width: 70ch;
}

/* Editorial Content */
.content-section,
.page-section {
  padding: 48px 0;
}

.page-lead,
.legal-updated {
  color: var(--muted);
  font-size: 18px;
  max-width: 70ch;
  margin: 0 0 24px;
}

.legal-updated {
  font-size: 14px;
}

.prose {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.prose p,
.prose li {
  max-width: 70ch;
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  padding-left: 24px;
  margin: 0 0 24px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.prose th,
.prose td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.prose th {
  font-weight: 600;
  background: var(--bg);
}

/* FAQ */
.faq-section {
  padding: 0 0 48px;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  box-shadow: var(--shadow-sm);
}

.faq-item summary {
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq-item summary::after {
  content: '+';
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  margin: 12px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

/* Comments */
.comments-section {
  padding: 0 0 64px;
}

.comments-intro {
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 70ch;
}

.comment-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.form-row {
  margin-bottom: 12px;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

[data-gf-reply-cancel],
.reply-banner:empty {
  display: none;
}

.comment-form[data-gf-replying] [data-gf-reply-cancel] {
  display: inline-flex;
}

.reply-banner {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.comment-msg {
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.comments-list {
  display: grid;
  gap: 12px;
}

.comments-list[data-gf-empty]::before {
  content: 'No arena reports yet. Run a simulation and post the first victor!';
  display: block;
  padding: 24px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}

.comment-card,
.reply-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.comment-card[data-gf-owner],
.reply-card[data-gf-owner] {
  border-color: var(--gold);
  background: #fff7e6;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 8px;
}

.comment-meta time,
.reply-to-tag {
  color: var(--muted);
  font-size: 12px;
}

.owner-badge {
  display: none;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--arena-bg);
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}

[data-gf-owner] > .comment-meta .owner-badge {
  display: inline-block;
}

.comment-body {
  margin: 0 0 8px;
  white-space: pre-wrap;
  max-width: 70ch;
}

.reply-btn {
  background: transparent;
  border: none;
  padding: 4px 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.comment-replies {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 8px;
}

.comment-replies:empty {
  display: none;
}

/* Footer */
.site-footer {
  background: var(--arena-bg);
  color: var(--arena-text);
  padding: 48px 0 32px;
  border-top: 3px solid var(--gold);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--arena-border);
}

.footer-title {
  font-family: var(--font-head);
  font-size: 18px;
  display: block;
  margin-bottom: 8px;
}

.footer-tagline {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 14px;
}

.footer-note {
  margin: 0;
  color: var(--arena-muted);
  font-size: 12px;
  max-width: 56ch;
}

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

.footer-links a {
  color: var(--arena-text);
  font-size: 14px;
}

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

.footer-bottom {
  padding-top: 16px;
  color: var(--arena-muted);
  font-size: 12px;
}

.not-found-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

@media (max-width: 640px) {
  h1 { font-size: 28px; }
  h2 { font-size: 22px; }
  .container { padding: 0 16px; }
  .header-inner { flex-wrap: wrap; padding: 8px 0; }
  .site-nav { gap: 16px; width: 100%; }
  .sim-shell { padding: 16px; }
  .prose { padding: 20px; }
  .callout-box { flex-direction: column; align-items: flex-start; padding: 20px; }
  .callout-box .btn-primary,
  .not-found-actions .btn-primary,
  .not-found-actions .btn-outline { width: 100%; }
  .engage-bar { flex-direction: column; align-items: stretch; }
  .engage-left, .engage-right { justify-content: space-between; }
}
