:root {
  --navy: #14324a;
  --navy-2: #1d4663;
  --navy-deep: #0d2233;
  --sea: #3f8fb0;
  --sea-light: #d9edf3;
  --sand: #fbf6ec;
  --sand-2: #f3ead7;
  --amber: #e9a23b;
  --amber-light: #ffe7b8;
  --amber-dark: #a66512;
  --signal: #d9622b;
  --signal-hover: #bf4f1d;
  --ink: #1f2a33;
  --muted: #566570;
  --line: #e3d9c4;
  --card: #ffffff;
  --radius: 14px;
  --wrap: 1140px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--sand);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sand);
  color: var(--ink);
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
a { color: var(--navy-2); text-underline-offset: 3px; }
a:hover { color: var(--amber-dark); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

h1, h2, h3 { line-height: 1.22; color: var(--navy); margin-top: 0; }
h1 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); margin-bottom: 0.35em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-bottom: 0.55em; }
h3 { font-size: 1.15rem; margin-bottom: 0.4em; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 12px;
  top: 12px;
  background: var(--card);
  color: var(--navy);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 50;
}

/* Header */
.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
}
.brand:hover { color: #ffd27a; }
.brand-mark {
  background: var(--sand);
  border-radius: 10px;
  padding: 2px;
  flex-shrink: 0;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px 20px;
  flex-wrap: wrap;
}
.site-nav a {
  color: #dbe8f0;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: #fff; border-bottom-color: var(--amber); }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid var(--amber);
  background: var(--amber);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.button:hover {
  background: #f2b453;
  border-color: #f2b453;
  color: var(--navy);
}
.button-signal {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
}
.button-signal:hover {
  background: var(--signal-hover);
  border-color: var(--signal-hover);
  color: #fff;
}
.button-secondary {
  background: transparent;
  border-color: var(--navy-2);
  color: var(--navy);
}
.button-secondary:hover {
  background: var(--sand-2);
  border-color: var(--navy);
  color: var(--navy);
}
.button-outline-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.48);
  color: #fff;
}
.button-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}
.button-subtle-light {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #e6f0f6;
}
.button-subtle-light:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

/* Badges */
.game-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--navy);
  background: var(--amber-light);
  border-radius: 999px;
  padding: 3px 11px;
  line-height: 1.4;
}
.badge-muted {
  background: var(--sand-2);
  color: var(--muted);
}

/* Home Hero & Featured Showcase */
.arcade-hero {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 72%, #245777 100%);
  color: #e8f1f6;
  padding: 36px 0 48px;
}
.hero-intro {
  max-width: 46rem;
  margin-bottom: 24px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffd27a;
  margin: 0 0 8px;
}
.arcade-hero h1 { color: #fff; }
.lead {
  font-size: 1.06rem;
  margin: 0;
  color: #d6e5ee;
}

.featured-wrap .game-card.is-featured {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  background: var(--card);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(7, 22, 34, 0.32);
}
.featured-wrap .game-card.is-featured > * { min-width: 0; }
.featured-wrap .game-card.is-featured .game-card-media {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 260px;
  aspect-ratio: auto;
  overflow: hidden;
  background: var(--navy-deep);
}
.featured-wrap .game-card.is-featured .game-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.featured-wrap .game-card.is-featured .game-card-body {
  padding: 26px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.featured-wrap .game-card.is-featured h3 {
  font-size: clamp(1.5rem, 2.5vw, 1.95rem);
  margin: 2px 0 0;
}
.featured-wrap .game-card.is-featured h3 a {
  color: var(--navy);
  text-decoration: none;
}
.featured-wrap .game-card.is-featured h3 a:hover { color: var(--signal); }
.featured-wrap .game-card.is-featured .game-card-body > a.button,
.featured-wrap .game-card.is-featured .game-card-actions a.button:first-child {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
}
.featured-wrap .game-card.is-featured .game-card-body > a.button:hover,
.featured-wrap .game-card.is-featured .game-card-actions a.button:first-child:hover {
  background: var(--signal-hover);
  border-color: var(--signal-hover);
  color: #fff;
}
.game-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

/* Sections & Catalog Grid */
.section { padding: 48px 0; }
.section-alt { background: var(--sand-2); }
.section-compact { padding: 36px 0; }
.section-head { margin-bottom: 24px; }
.section-intro {
  color: var(--muted);
  max-width: 44rem;
  margin: 0;
  font-size: 1.02rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 22px;
}
.game-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 20px rgba(20, 50, 74, 0.06);
}
.game-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: linear-gradient(155deg, var(--sea-light), #b9dbe7);
  overflow: hidden;
}
.game-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.game-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy);
  padding: 16px;
}
.game-card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.game-card-body h3 { margin: 2px 0 0; font-size: 1.22rem; }
.game-card-body h3 a { color: var(--navy); text-decoration: none; }
.game-card-body h3 a:hover { color: var(--signal); }
.game-subtitle {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--sea);
  letter-spacing: 0.02em;
}
.game-tagline {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.96rem;
}
.game-card-body > .button {
  margin-top: auto;
  align-self: flex-start;
}

.game-card.is-upcoming {
  background: var(--sand);
  border-style: dashed;
  border-color: #cfc1a4;
  box-shadow: none;
}
.upcoming-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(155deg, #e7eef2 0%, #f3ead7 100%);
}
.upcoming-lantern { opacity: 0.85; }

/* Pillars */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.pillar-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--sea);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.pillar-card p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* Theater Band (Game Play Page) */
.theater-band {
  background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: #e6f0f6;
  padding: 20px 0 28px;
}
.theater-wrap { max-width: 1120px; }
.game-header { margin-bottom: 14px; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  color: #a9c1d1;
  margin-bottom: 8px;
}
.breadcrumb a { color: #ffd27a; text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

.game-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 20px;
  flex-wrap: wrap;
}
.game-title-group {
  display: flex;
  align-items: baseline;
  gap: 8px 14px;
  flex-wrap: wrap;
}
.theater-band h1 {
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  margin: 0;
}
.game-header-sub {
  margin: 0;
  color: #ffd27a;
  font-weight: 600;
  font-size: 0.98rem;
}
.game-header-lead {
  margin: 8px 0 0;
  color: #cddde7;
  font-size: 0.98rem;
  max-width: 56rem;
}

.rotate-hint {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(233, 162, 59, 0.16);
  border: 1px solid rgba(233, 162, 59, 0.55);
  color: #fff3da;
  font-size: 0.88rem;
  line-height: 1.4;
}
.rotate-icon { flex-shrink: 0; color: #ffd27a; }

.stage-shell {
  position: relative;
  width: min(100%, 1040px);
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #081520;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 44px rgba(4, 14, 24, 0.45);
}
.stage-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #081520;
}
.stage-shell:fullscreen,
.stage-shell:-webkit-full-screen {
  width: 100vw;
  max-width: none;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  border: 0;
  background: #000;
}

.stage-toolbar {
  width: min(100%, 1040px);
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
}
.stage-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.stage-hint {
  margin: 0;
  font-size: 0.86rem;
  color: #a9c1d1;
}

/* Game Editorial Sections */
.content-two-col {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: start;
}
.controls-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  margin-top: 20px;
  align-items: start;
}
.editorial-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: 0 6px 20px rgba(20, 50, 74, 0.05);
}
.editorial-card p:last-child { margin-bottom: 0; }

.play-steps,
.tips-list {
  margin: 0;
  padding-left: 1.35rem;
}
.play-steps li,
.tips-list li {
  margin-bottom: 0.7em;
}
.play-steps li:last-child,
.tips-list li:last-child { margin-bottom: 0; }
.play-steps li::marker { color: var(--signal); font-weight: 700; }
.tips-list li::marker { color: var(--amber-dark); }

.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.controls-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.controls-table th,
.controls-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.controls-table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  padding-top: 4px;
}
.controls-table tbody th {
  width: 38%;
  font-weight: 700;
  color: var(--navy);
}
.controls-table tbody tr:last-child th,
.controls-table tbody tr:last-child td { border-bottom: 0; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sand);
  padding: 12px 16px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--signal);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "-"; }
.faq-item p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.support-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  flex-wrap: wrap;
}
.support-copy { flex: 1 1 320px; }
.support-copy h2 { font-size: 1.3rem; margin-bottom: 0.35em; }
.support-copy p { margin: 0; color: var(--muted); }
.support-links {
  display: flex;
  align-items: center;
  gap: 12px 18px;
  flex-wrap: wrap;
}
.support-text-link { font-weight: 600; font-size: 0.94rem; }

/* 404 Page */
.page { padding-top: 56px; padding-bottom: 72px; }
.page-404 { text-align: center; }
.lost-lantern { margin-bottom: 12px; }
.page-404 .lead { color: var(--muted); max-width: 30rem; margin: 0 auto 24px; }

/* Footer */
.site-footer {
  background: var(--navy);
  color: #c9d9e3;
  padding: 36px 0 24px;
  font-size: 0.94rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ffd27a; }
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px 48px;
}
.footer-name,
.footer-heading {
  color: #fff;
  font-weight: 700;
  margin: 0 0 6px;
}
.footer-note { margin: 0 0 8px; color: #b5cad7; }
.footer-contact { margin: 0; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 4px 0; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 24px;
  padding-top: 14px;
}
.footer-bottom p { margin: 0; color: #9cb4c3; font-size: 0.88rem; }

/* Desktop theater height comfort so full stage + toolbar fit cleanly above fold */
@media (min-width: 900px) and (min-height: 700px) {
  .stage-shell {
    width: min(100%, 1040px, calc((100vh - 240px) * 16 / 9));
    width: min(100%, 1040px, calc((100dvh - 240px) * 16 / 9));
  }
}

/* Tablet & Mobile stacking */
@media (max-width: 900px) {
  .featured-wrap .game-card.is-featured { grid-template-columns: 1fr; }
  .featured-wrap .game-card.is-featured .game-card-media {
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
  .pillars-grid { grid-template-columns: 1fr; }
  .content-two-col,
  .controls-grid { grid-template-columns: 1fr; }
}

/* Phone Portrait: show landscape hint & comfortable touch buttons */
@media (max-width: 680px) and (orientation: portrait) {
  .rotate-hint { display: flex; }
}

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .arcade-hero { padding: 26px 0 34px; }
  .section { padding: 36px 0; }
  .featured-wrap .game-card.is-featured .game-card-body { padding: 18px 18px 20px; }
  .editorial-card { padding: 18px 18px; }
  .support-card { padding: 18px; }
  .footer-grid { grid-template-columns: 1fr; }
  .stage-actions { width: 100%; }
  .stage-actions .button { flex: 1 1 auto; padding: 10px 14px; font-size: 0.9rem; }
  .controls-table tbody th { width: 42%; }
}

/* Phone Landscape (e.g. 844x390): keep theater & controls compact with zero overflow */
@media (max-height: 500px) and (orientation: landscape) {
  .header-inner { padding-top: 6px; padding-bottom: 6px; }
  .brand { font-size: 0.95rem; }
  .brand-mark { width: 26px; height: 26px; }
  .site-nav a { padding: 2px 0; font-size: 0.88rem; }
  .arcade-hero { padding: 14px 0 20px; }
  .hero-intro { margin-bottom: 12px; }
  .arcade-hero h1 { font-size: 1.55rem; }
  .arcade-hero .lead { font-size: 0.95rem; }
  .featured-wrap .game-card.is-featured { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .featured-wrap .game-card.is-featured .game-card-media {
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }
  .featured-wrap .game-card.is-featured .game-card-body { padding: 14px 16px; gap: 6px; }
  .featured-wrap .game-card.is-featured h3 { font-size: 1.28rem; }
  .featured-wrap .game-card.is-featured .game-tagline { font-size: 0.88rem; margin-bottom: 4px; }
  .featured-wrap .game-card.is-featured .button { min-height: 36px; padding: 6px 14px; font-size: 0.86rem; }
  .theater-band { padding: 8px 0 10px; }
  .game-header { margin-bottom: 6px; }
  .breadcrumb,
  .game-header .game-badges,
  .game-header-lead,
  .stage-hint { display: none; }
  .theater-band h1 { font-size: 1.15rem; }
  .game-header-sub { font-size: 0.88rem; }
  .stage-shell {
    width: min(100%, calc((100vh - 142px) * 16 / 9));
    width: min(100%, calc((100dvh - 142px) * 16 / 9));
    border-radius: 10px;
  }
  .stage-toolbar { margin-top: 8px; justify-content: center; }
  .stage-actions .button { min-height: 36px; padding: 6px 14px; font-size: 0.85rem; }
}
