:root {
  --company-navy: #071a3b;
  --company-blue: #0e4eac;
  --company-cyan: #56d7ff;
  --company-gold: #ffbf28;
  --company-cream: #fff5dc;
  --company-ink: #061a38;
  --retro-orange: #e85d24;
  --retro-plum: #6d2f74;
  --retro-avocado: #78932f;
  --retro-paper: #f5ddb1;
}

/* Company-level architecture */
.site-header {
  border-bottom: 3px solid var(--company-gold);
  background: var(--company-navy);
}

.nav-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  min-height: 78px;
}

.brand {
  min-width: max-content;
}

.brand-copy {
  display: grid;
  color: #fff;
  font-weight: 900;
  font-size: .88rem;
  letter-spacing: .04em;
  line-height: 1;
}

.brand-copy small {
  color: var(--company-cyan);
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.site-nav {
  justify-self: center;
}

.site-nav > a,
.games-menu > summary {
  min-height: 46px;
  padding: .8rem 1rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.site-nav > a[aria-current="page"],
.games-menu[data-current="true"] > summary {
  color: var(--company-ink);
  background: var(--company-gold);
}

.games-menu {
  position: relative;
}

.games-menu > summary {
  display: flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
  list-style: none;
}

.games-menu > summary::-webkit-details-marker {
  display: none;
}

.games-menu > summary::after {
  content: "▾";
  color: var(--company-cyan);
}

.games-menu[open] > summary::after {
  transform: rotate(180deg);
}

.games-menu-panel {
  position: absolute;
  z-index: 50;
  top: calc(100% + .55rem);
  left: 50%;
  display: grid;
  width: min(310px, calc(100vw - 2rem));
  padding: .55rem;
  border: 2px solid var(--company-gold);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
  transform: translateX(-50%);
}

.games-menu-panel a {
  display: grid;
  min-height: 50px;
  padding: .7rem .85rem;
  border-radius: 12px;
  color: var(--company-ink);
  font-weight: 900;
  text-decoration: none;
}

.games-menu-panel a small {
  color: #52617a;
  font-weight: 700;
}

.games-menu-panel a:hover,
.games-menu-panel a:focus-visible {
  background: #e8f7ff;
}

.games-menu-panel a[aria-current="page"] {
  outline: 3px solid var(--company-gold);
  background: #fff5cf;
}

.header-tools {
  display: flex;
  align-items: end;
  gap: .55rem;
}

.header-language label {
  color: #fff;
}

.header-language select {
  min-width: 128px;
}

.header-settings,
.menu-toggle,
.games-menu > summary,
.games-menu-panel a,
.game-subnav a,
.palace-table-tools button,
.palace-table-tools summary {
  outline-offset: 3px;
}

.header-settings:focus-visible,
.menu-toggle:focus-visible,
.games-menu > summary:focus-visible,
.games-menu-panel a:focus-visible,
.game-subnav a:focus-visible,
.palace-table-tools button:focus-visible,
.palace-table-tools summary:focus-visible {
  outline: 3px solid var(--company-cyan);
}

/* Global dialog contains only global controls. */
.site-dialog .global-settings-note {
  max-width: 38rem;
  color: #243553;
}

/* Game-level navigation */
.game-subnav {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  background: #0a2855;
}

.game-subnav .shell {
  display: flex;
  gap: .4rem;
  align-items: center;
  overflow-x: auto;
  padding-block: .55rem;
  scrollbar-width: thin;
}

.game-subnav strong {
  flex: 0 0 auto;
  margin-right: .4rem;
  color: var(--company-gold);
}

.game-subnav a,
.game-subnav .local-status {
  flex: 0 0 auto;
  min-height: 44px;
  padding: .7rem .85rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.game-subnav a[aria-current="page"] {
  color: var(--company-ink);
  background: var(--company-gold);
}

.game-subnav .local-status {
  margin-left: auto;
  border: 1px solid var(--company-gold);
}

.palace-table-tools {
  padding: .65rem 0;
  border-bottom: 2px solid var(--company-gold);
  background: #fce49f;
  color: var(--company-ink);
}

.palace-table-tools .shell {
  display: flex;
  gap: .8rem;
  align-items: center;
  justify-content: center;
}

.palace-table-tools strong {
  text-transform: uppercase;
  letter-spacing: .12em;
}

.palace-table-tools details {
  position: relative;
}

.palace-table-tools summary {
  min-width: 140px;
  min-height: 44px;
  padding: .7rem 1rem;
  border: 2px solid var(--company-ink);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.palace-table-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + .35rem);
  left: 0;
  display: grid;
  width: 180px;
  padding: .4rem;
  border: 2px solid var(--company-ink);
  border-radius: 14px;
  background: #fff;
}

.palace-table-menu button {
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--company-ink);
  font-weight: 900;
  text-align: left;
}

.palace-table-menu button[aria-pressed="true"] {
  background: var(--company-gold);
}

/* Company homepage */
.company-home {
  color: var(--company-ink);
  background: #f7f2e8;
}

.company-hero {
  position: relative;
  display: grid;
  min-height: min(780px, calc(100svh - 78px));
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 76% 38%, rgba(86, 215, 255, .28), transparent 27%),
    linear-gradient(135deg, #04132f 5%, #0a3778 60%, #301259);
}

.company-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(3, 13, 33, .92) 0 42%, rgba(3, 13, 33, .22) 75%);
}

.company-hero .shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  width: 100%;
  padding-block: clamp(5rem, 10vw, 9rem);
}

.company-hero-copy {
  max-width: 690px;
}

.company-hero h1 {
  margin: .5rem 0 1.2rem;
  font-size: clamp(3.15rem, 7vw, 7.3rem);
  line-height: .87;
  letter-spacing: -.065em;
}

.company-hero h1 span {
  display: block;
  color: var(--company-gold);
}

.company-hero .lede {
  color: #e8f5ff;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.company-hero-art {
  position: relative;
  z-index: 2;
  width: 100%;
  border: 2px solid rgba(255, 191, 40, .8);
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .4);
  transform: rotate(2deg);
}

.company-kicker,
.retro-label {
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.company-kicker {
  color: var(--company-cyan);
}

.company-section {
  padding: clamp(4rem, 8vw, 8rem) 0;
}

.company-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 2.5rem;
}

.company-section-heading h2 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 5.5rem);
  line-height: .95;
}

.featured-games,
.catalog-grid {
  display: grid;
  gap: 1.25rem;
}

.featured-games {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.catalog-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  border: 2px solid #a7b6c9;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(7, 26, 59, .12);
  flex-direction: column;
}

.featured-games .catalog-card {
  border-width: 3px;
}

.catalog-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--company-navy);
}

.catalog-card.palace img {
  object-fit: contain;
  padding: 1rem;
  background: #0b2a63;
}

.catalog-card-body {
  display: flex;
  gap: .75rem;
  height: 100%;
  padding: clamp(1.25rem, 3vw, 2rem);
  flex-direction: column;
}

.catalog-card h2,
.catalog-card h3 {
  margin: 0;
  color: var(--company-ink);
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: .95;
}

.catalog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  color: #40516c;
  font-size: .86rem;
  font-weight: 850;
}

.status-badge {
  display: inline-flex;
  width: max-content;
  min-height: 36px;
  align-items: center;
  padding: .45rem .75rem;
  border-radius: 999px;
  color: var(--company-ink);
  background: var(--company-gold);
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.status-badge.coming {
  color: #fff;
  background: var(--retro-orange);
}

.catalog-card .actions {
  margin-top: auto;
}

.latest-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.latest-news-grid .news-card {
  height: 100%;
}

/* Games catalog and news */
.catalog-page,
.company-news-page {
  min-height: 70vh;
  padding: clamp(4rem, 8vw, 8rem) 0;
  color: var(--company-ink);
  background: linear-gradient(135deg, #eaf8ff, #fff8e4);
}

.catalog-intro,
.company-news-intro {
  max-width: 860px;
  margin-bottom: 3rem;
}

.catalog-intro h1,
.company-news-intro h1 {
  margin: .4rem 0 1rem;
  color: var(--company-ink);
  font-size: clamp(3rem, 7vw, 7rem);
  line-height: .9;
}

.news-filter-bar {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  margin: 0 0 2rem;
  padding: .25rem 0 .7rem;
}

.news-filter-bar button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: .65rem .9rem;
  border: 2px solid var(--company-blue);
  border-radius: 999px;
  color: var(--company-blue);
  background: #fff;
  font-weight: 900;
}

.news-filter-bar button[aria-pressed="true"] {
  color: #fff;
  background: var(--company-blue);
}

.news-card[hidden] {
  display: none;
}

.article-game-link {
  display: inline-flex;
  margin-top: 1rem;
  font-weight: 900;
}

/* Original 1970s-inspired Commander promotion */
.commander-promo {
  color: #f9eac6;
  background: #130e21;
}

.commander-promo .game-subnav {
  border-bottom-color: #d96324;
  background: #26133c;
}

.retro-hero {
  position: relative;
  display: grid;
  min-height: min(760px, calc(100svh - 122px));
  overflow: hidden;
  isolation: isolate;
}

.retro-hero-art,
.retro-hero-shade {
  position: absolute;
  inset: 0;
}

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

.retro-hero-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(10, 6, 23, .96) 0 35%, rgba(10, 6, 23, .65) 48%, rgba(10, 6, 23, .08) 72%),
    linear-gradient(0deg, rgba(10, 6, 23, .68), transparent 35%);
}

.retro-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  max-width: 760px;
  min-height: inherit;
  justify-content: center;
  padding-block: clamp(4rem, 8vw, 8rem);
  flex-direction: column;
}

.retro-issue,
.retro-kicker,
.retro-section-heading p {
  color: #f4b932;
  font-weight: 950;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.retro-hero h1 {
  margin: .5rem 0;
  color: #ffe8a7;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(4.4rem, 10vw, 9.8rem);
  font-style: italic;
  line-height: .78;
  letter-spacing: -.035em;
  text-shadow: 5px 6px 0 #a52f27, 10px 12px 0 rgba(0, 0, 0, .45);
  transform: skewY(-3deg);
}

.retro-hero h1 span {
  display: block;
  color: #75d6df;
  font-size: .42em;
  letter-spacing: .04em;
  text-shadow: 3px 4px 0 #314a7d;
}

.retro-kicker {
  margin-top: 1.4rem;
  color: #ffcc3a;
}

.retro-slogan {
  margin: .6rem 0 1.3rem;
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  font-weight: 850;
  line-height: 1.25;
}

.retro-slogan strong {
  color: #75d6df;
}

.retro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}

.retro-story,
.retro-mission,
.retro-bosses,
.retro-news {
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.retro-story {
  color: #2d1734;
  background:
    linear-gradient(rgba(116, 69, 33, .08) 1px, transparent 1px),
    var(--retro-paper);
  background-size: 100% 8px;
}

.retro-section-heading {
  max-width: 940px;
  margin-bottom: 2rem;
}

.retro-section-heading h2,
.retro-mission h2 {
  margin: .35rem 0;
  font-size: clamp(2.8rem, 6vw, 6rem);
  line-height: .9;
}

.retro-story-reel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 4px solid #2d1734;
  background: #fff0c9;
  box-shadow: 12px 12px 0 #d76029;
}

.retro-story-reel article {
  position: relative;
  min-width: 0;
  padding: clamp(1.3rem, 3vw, 2.2rem);
  border-right: 3px solid #2d1734;
}

.retro-story-reel article:last-child {
  border-right: 0;
}

.retro-story-reel article > span {
  color: #d76029;
  font-family: Impact, sans-serif;
  font-size: 3rem;
}

.retro-story-reel h3 {
  margin: .4rem 0;
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.retro-label {
  margin: 0;
  color: #633e67;
  font-size: .78rem;
}

.retro-cliffhanger {
  max-width: 900px;
  margin: 3rem auto 0;
  color: #2d1734;
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  font-weight: 900;
  text-align: center;
}

.retro-mission {
  color: #f8e9c5;
  background: #244b68;
}

.retro-mission-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.retro-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 2rem;
}

.retro-feature-grid article {
  display: grid;
  min-height: 108px;
  padding: 1rem;
  border: 2px solid #f1c35a;
  background: #17364f;
}

.retro-feature-grid b {
  color: #f0a22b;
  letter-spacing: .12em;
}

.retro-commander-card {
  margin: 0;
  padding: 1rem 1rem 0;
  border: 4px solid #f2c257;
  background: #6c2e72;
  box-shadow: 12px 12px 0 #d76029;
  transform: rotate(2deg);
}

.retro-commander-card img {
  width: 100%;
}

.retro-commander-card figcaption {
  padding: 1rem;
  color: #fff5cf;
  font-size: 1.3rem;
  font-weight: 950;
  text-align: center;
}

.retro-bosses {
  color: #281332;
  background: #d9a13c;
}

.retro-boss-reel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .65rem;
}

.retro-boss-reel article {
  display: grid;
  min-width: 0;
  padding: .75rem;
  border: 3px solid #2b1637;
  background: #f5ddb1;
  text-align: center;
}

.retro-boss-reel img {
  width: 100%;
  aspect-ratio: 1;
}

.retro-boss-reel b {
  color: #b43c2e;
}

.retro-boss-reel span {
  font-weight: 900;
}

.retro-news {
  color: #f8e9c5;
  background: #1b1128;
}

.retro-news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.retro-news-grid a {
  display: grid;
  gap: .8rem;
  min-height: 210px;
  padding: 1.4rem;
  border: 2px solid #e1a332;
  color: #f8e9c5;
  background: #321841;
  text-decoration: none;
}

.retro-news-grid a:hover,
.retro-news-grid a:focus-visible {
  color: #1b1128;
  background: #f5ddb1;
}

.retro-news-grid span,
.retro-news-grid em {
  color: #6fd2dc;
  font-size: .78rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.retro-news-grid strong {
  font-size: 1.35rem;
}

.retro-final {
  display: grid;
  gap: .55rem;
  justify-items: center;
  margin-top: 3rem;
  text-align: center;
}

.retro-final strong {
  color: #f6c143;
  font-size: clamp(1.8rem, 4vw, 3.6rem);
}

/* Footer hierarchy */
.site-footer .footer-grid {
  grid-template-columns: minmax(240px, 1.2fr) repeat(3, minmax(150px, .6fr));
}

.footer-group {
  display: grid;
  align-content: start;
  gap: .45rem;
}

.footer-group h2 {
  margin: 0 0 .5rem;
  color: var(--company-gold);
  font-size: .82rem;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.footer-group a {
  min-height: 38px;
}

@media (max-width: 1100px) {
  .brand-copy { display: none; }
  .nav-wrap { gap: .5rem; }
  .site-nav > a,
  .games-menu > summary { padding-inline: .72rem; }
  .header-language select { min-width: 112px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .nav-wrap {
    grid-template-columns: auto auto;
    min-height: 72px;
  }

  .menu-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .site-nav {
    position: absolute;
    z-index: 60;
    top: 100%;
    right: 1rem;
    left: 1rem;
    display: none;
    max-height: calc(100vh - 90px);
    overflow-y: auto;
    padding: .75rem;
    border: 2px solid var(--company-gold);
    border-radius: 18px;
    background: var(--company-navy);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
  }

  .site-nav[data-open="true"] {
    display: grid;
  }

  .site-nav > a,
  .games-menu > summary {
    justify-content: flex-start;
    width: 100%;
    min-height: 50px;
    border-radius: 10px;
  }

  .games-menu-panel {
    position: static;
    width: 100%;
    margin-top: .35rem;
    border-color: #7097c7;
    box-shadow: none;
    transform: none;
  }

  .header-tools {
    grid-column: 1 / -1;
    display: none;
    padding-bottom: .75rem;
  }

  .nav-wrap:has(.site-nav[data-open="true"]) .header-tools {
    display: flex;
  }

  .company-hero .shell,
  .company-section-heading,
  .retro-mission-layout {
    grid-template-columns: 1fr;
  }

  .company-hero::after {
    background: linear-gradient(0deg, rgba(3, 13, 33, .96) 0 48%, rgba(3, 13, 33, .28) 90%);
  }

  .company-hero-art {
    grid-row: 1;
    max-width: 560px;
    justify-self: center;
  }

  .featured-games,
  .latest-news-grid,
  .retro-story-reel,
  .retro-news-grid {
    grid-template-columns: 1fr;
  }

  .retro-story-reel article {
    border-right: 0;
    border-bottom: 3px solid #2d1734;
  }

  .retro-story-reel article:last-child {
    border-bottom: 0;
  }

  .retro-boss-reel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .nav-wrap {
    padding-inline: .75rem;
  }

  .brand-logo {
    width: 62px;
    height: auto;
  }

  .header-tools {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .header-language,
  .header-language label,
  .header-language select {
    width: 100%;
  }

  .game-subnav .shell {
    padding-inline: .75rem;
  }

  .game-subnav strong {
    display: none;
  }

  .palace-table-tools .shell {
    align-items: stretch;
    flex-direction: column;
  }

  .palace-table-tools summary {
    width: 100%;
  }

  .palace-table-menu {
    width: 100%;
  }

  .company-hero {
    min-height: 0;
  }

  .company-hero .shell {
    gap: 2rem;
    padding: 2.5rem 1rem 4rem;
  }

  .company-hero h1 {
    font-size: clamp(3rem, 16vw, 5rem);
  }

  .company-section,
  .catalog-page,
  .company-news-page {
    padding-block: 3.5rem;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .retro-hero {
    min-height: 720px;
  }

  .retro-hero-art img {
    object-position: 62% center;
  }

  .retro-hero-shade {
    background: linear-gradient(0deg, rgba(10, 6, 23, .98) 0 51%, rgba(10, 6, 23, .2) 92%);
  }

  .retro-hero-copy {
    justify-content: end;
    padding: 19rem 1rem 3.5rem;
  }

  .retro-hero h1 {
    font-size: clamp(4rem, 22vw, 6rem);
    text-shadow: 3px 4px 0 #a52f27, 6px 8px 0 rgba(0, 0, 0, .45);
  }

  .retro-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .retro-feature-grid article {
    min-height: 98px;
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .company-hero-art,
  .retro-commander-card,
  .games-menu > summary::after {
    transition: none !important;
    transform: none;
  }
}
