:root {
  --ink-1000: #00020e;
  --ink-950: #000512;
  --navy-900: #0d1726;
  --navy-800: #0c2a47;
  --royal-blue: #203682;
  --electric-blue: #2877c3;
  --sky-blue: #67bcea;
  --ruby-dark: #900c0d;
  --ruby: #d92820;
  --emerald: #428d1e;
  --royal-purple: #743391;
  --gold: #f0b222;
  --gold-light: #f8de78;
  --silver-ivory: #dad7b9;
  --white: #fff;
  --muted: #b7c5da;
  --line: rgba(218, 215, 185, .2);
  --panel: rgba(13, 23, 38, .88);
  --palace-gradient: linear-gradient(135deg, var(--ink-1000), var(--navy-800) 55%, var(--royal-blue));
  --gold-gradient: linear-gradient(135deg, #9b5b08, var(--gold), var(--gold-light), #c77b0d);
  --silver-gradient: linear-gradient(135deg, #9099a9, var(--white), var(--silver-ivory));
  --ruby-gradient: linear-gradient(135deg, var(--ruby-dark), var(--ruby));
  --purple-gradient: linear-gradient(135deg, #351345, var(--royal-purple));
  --emerald-gradient: linear-gradient(135deg, #173f18, var(--emerald));
  --space-1: .375rem;
  --space-2: .75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
  --space-7: 4.5rem;
  --space-8: 6.5rem;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-pill: 999px;
  --shadow-panel: 0 24px 70px rgba(0, 2, 14, .42);
  --shadow-gold: 0 0 30px rgba(240, 178, 34, .22);
  --focus: 0 0 0 4px var(--ink-1000), 0 0 0 7px var(--gold-light);
  --motion-fast: 160ms;
  --motion-base: 320ms;
  --motion-slow: 700ms;
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  background: var(--ink-1000);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 70% 4%, rgba(40, 119, 195, .17), transparent 28rem),
    var(--ink-1000);
  color: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--sky-blue); text-underline-offset: .18em; }
a:hover { color: var(--gold-light); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
  border-radius: 6px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: .6rem;
  left: .6rem;
  translate: 0 -180%;
  min-height: 44px;
  padding: .7rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--gold-light);
  color: var(--ink-1000);
  font-weight: 900;
}

.skip-link:focus { translate: 0; }

.shell { width: min(1180px, calc(100% - 2rem)); margin-inline: auto; }
.narrow { width: min(780px, calc(100% - 2rem)); margin-inline: auto; }

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgba(218, 215, 185, .13);
  background: rgba(0, 5, 18, .91);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  min-height: 76px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: .7rem;
  min-height: 44px;
  color: var(--white);
  font-weight: 900;
  letter-spacing: .01em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(248, 222, 120, .7);
  border-radius: 50%;
  background: var(--palace-gradient);
  color: var(--gold-light);
  box-shadow: var(--shadow-gold);
  font-family: Georgia, serif;
  font-size: 1.18rem;
}

.brand-copy small {
  display: block;
  color: var(--sky-blue);
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1;
  text-transform: uppercase;
}

.menu-toggle {
  display: none;
  min-width: 48px;
  min-height: 48px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--navy-900);
  color: var(--white);
  font-weight: 900;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .25rem;
  width: 100%;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .65rem .72rem;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(103, 188, 234, .1);
  color: var(--white);
}

.site-nav .nav-play {
  border: 1px solid rgba(240, 178, 34, .44);
  color: var(--gold-light);
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: min(820px, calc(100svh - 76px));
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(0, 2, 14, .98) 0%, rgba(0, 5, 18, .9) 43%, rgba(12, 42, 71, .5) 100%),
    var(--palace-gradient);
}

.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(circle at var(--pointer-x, 72%) var(--pointer-y, 38%), rgba(103, 188, 234, .22), transparent 22rem),
    linear-gradient(115deg, transparent 44%, rgba(240, 178, 34, .08) 44.2%, transparent 45%);
  content: "";
}

.hero::after {
  position: absolute;
  z-index: -1;
  right: -10%;
  bottom: -48%;
  width: 70%;
  aspect-ratio: 1;
  border: 1px solid rgba(103, 188, 234, .16);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgba(32, 54, 130, .07), 0 0 0 160px rgba(32, 54, 130, .04);
  content: "";
}

.hero-grid {
  display: grid;
  min-height: inherit;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  align-items: center;
  gap: var(--space-5);
  padding-block: var(--space-7);
}

.hero-copy { position: relative; z-index: 2; }

.status-line,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin: 0 0 1rem;
  color: var(--gold-light);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.status-line::before,
.eyebrow::before {
  width: 24px;
  height: 2px;
  background: var(--gold);
  content: "";
}

.alpha-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: .25rem .72rem;
  border: 1px solid rgba(103, 188, 234, .36);
  border-radius: var(--radius-pill);
  background: rgba(40, 119, 195, .12);
  color: var(--sky-blue);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-weight: 800;
  letter-spacing: .015em;
  line-height: .98;
  text-wrap: balance;
}

h1 { max-width: 12ch; font-size: clamp(3.8rem, 8.2vw, 8.25rem); text-transform: uppercase; }
h2 { font-size: clamp(2.5rem, 5.7vw, 5.25rem); text-transform: uppercase; }
h3 { font-size: clamp(1.55rem, 2.5vw, 2.35rem); }

.hero h1 .gold,
.metal-gold {
  background: var(--gold-gradient);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
}

.lede {
  max-width: 66ch;
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.8vw, 1.32rem);
}

.hero .lede { max-width: 55ch; color: #dce8f6; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1.75rem;
}

.button {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: .8rem 1.2rem;
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  background: var(--gold-gradient);
  color: var(--ink-1000);
  font-weight: 950;
  text-decoration: none;
  transition: translate var(--motion-fast), box-shadow var(--motion-fast);
}

.button:hover {
  color: var(--ink-1000);
  translate: 0 -2px;
  box-shadow: 0 12px 34px rgba(240, 178, 34, .26);
}

.button.secondary {
  background: rgba(13, 23, 38, .76);
  color: var(--white);
}

.button.blue {
  border-color: var(--sky-blue);
  background: linear-gradient(135deg, var(--royal-blue), var(--electric-blue));
  color: var(--white);
}

.button.small { min-height: 44px; padding: .62rem 1rem; font-size: .88rem; }

.palace-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
}

.palace-art img {
  position: relative;
  z-index: 2;
  width: min(100%, 570px);
  filter: drop-shadow(0 32px 65px rgba(0, 0, 0, .7));
  animation: palace-float 6s ease-in-out infinite;
}

.palace-art::before {
  position: absolute;
  width: 85%;
  aspect-ratio: 1;
  border: 1px solid rgba(248, 222, 120, .45);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(40, 119, 195, .27), transparent 65%);
  box-shadow: 0 0 90px rgba(40, 119, 195, .32);
  content: "";
}

.floating-card {
  position: absolute;
  z-index: 3;
  display: grid;
  width: 82px;
  aspect-ratio: .71;
  place-items: center;
  border: 2px solid var(--gold-light);
  border-radius: 12px;
  background: var(--silver-gradient);
  color: var(--ink-1000);
  box-shadow: var(--shadow-panel);
  font-family: Georgia, serif;
  font-size: 1.65rem;
  font-weight: 900;
}

.floating-card.one { top: 14%; left: 0; rotate: -13deg; animation: card-drift 5.5s ease-in-out infinite; }
.floating-card.two { right: 0; bottom: 18%; rotate: 12deg; animation: card-drift 6.3s 1s ease-in-out infinite reverse; color: var(--ruby); }

.section {
  position: relative;
  overflow: clip;
  padding-block: var(--space-8);
}

.section.compact { padding-block: var(--space-6); }
.section.navy { background: var(--navy-900); }
.section.royal { background: linear-gradient(135deg, var(--navy-800), var(--royal-blue)); }
.section.ruby { background: var(--ruby-gradient); }

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: var(--space-5);
  align-items: end;
  margin-bottom: var(--space-6);
}

.section-heading h2 { max-width: 13ch; }
.section-heading .lede { margin: 0; }

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

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: var(--shadow-panel);
}

.feature-card { min-height: 340px; padding: var(--space-5); }
.feature-card .number { color: var(--gold); font-size: 3rem; font-weight: 950; line-height: 1; }
.feature-card h3 { margin-top: 3.5rem; }
.feature-card p { color: var(--muted); }

.palace-band {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  align-items: center;
  gap: var(--space-6);
}

.palace-band img {
  width: min(100%, 440px);
  margin-inline: auto;
  filter: drop-shadow(0 30px 45px rgba(0, 0, 0, .45));
}

.layer-stack {
  position: relative;
  min-height: 390px;
  perspective: 900px;
}

.layer-card {
  position: absolute;
  left: 50%;
  display: grid;
  width: min(92%, 540px);
  min-height: 176px;
  translate: -50% 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(12, 42, 71, .95), rgba(13, 23, 38, .98));
  box-shadow: var(--shadow-panel);
  padding: var(--space-4);
  transform: rotateX(54deg) rotateZ(-2deg);
  transform-origin: center bottom;
}

.layer-card:nth-child(1) { top: 0; opacity: .72; }
.layer-card:nth-child(2) { top: 88px; transform: rotateX(49deg) rotateZ(1deg); }
.layer-card:nth-child(3) { top: 184px; transform: rotateX(41deg) rotateZ(-1deg); }
.layer-card strong { color: var(--gold-light); font-size: 1.3rem; }
.layer-card span { color: var(--muted); }

.news-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  color: var(--white);
  text-decoration: none;
  transition: translate var(--motion-base), border-color var(--motion-base);
}

.news-card:hover,
.news-card:focus-visible { translate: 0 -5px; border-color: var(--gold); color: var(--white); }
.news-art { aspect-ratio: 16/9; overflow: hidden; background: var(--palace-gradient); }
.news-art img { width: 100%; height: 100%; object-fit: cover; transition: scale var(--motion-slow); }
.news-card:hover .news-art img { scale: 1.04; }
.news-body { display: flex; flex: 1; flex-direction: column; padding: 1.25rem; }
.news-meta { display: flex; flex-wrap: wrap; gap: .55rem; color: var(--sky-blue); font-size: .74rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.news-body h3 { margin-top: .85rem; font-size: 1.8rem; }
.news-body p { color: var(--muted); }
.news-body .read-more { margin-top: auto; color: var(--gold-light); font-weight: 900; }

.featured-news {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  margin-bottom: 1rem;
}

.featured-news .news-art { min-height: 460px; aspect-ratio: auto; }
.featured-news .news-body { justify-content: center; padding: clamp(1.5rem, 4vw, 3.5rem); }
.featured-news h2 { font-size: clamp(2.5rem, 4.4vw, 4.5rem); }

.game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.game-tile { padding: 1rem; }
.game-tile img { width: 100%; border-radius: calc(var(--radius-md) - 7px); }
.game-tile-content { padding: 1rem .35rem .45rem; }
.game-tile p { color: var(--muted); }
.game-tile.hearts { --accent: var(--ruby); }
.game-tile.spades { --accent: var(--royal-purple); }
.game-tile.euchre { --accent: var(--emerald); }
.game-tile { border-top: 3px solid var(--accent); }
.game-tile .text-link { color: color-mix(in srgb, var(--accent), white 35%); }

.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: .45rem;
  font-weight: 900;
  text-decoration: none;
}

.text-link::after { content: "→"; transition: translate var(--motion-fast); }
.text-link:hover::after { translate: .25rem 0; }

.future-card {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px dashed rgba(218, 215, 185, .35);
  border-radius: var(--radius-md);
  background: rgba(13, 23, 38, .55);
  padding: var(--space-5);
  text-align: center;
}

.page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--palace-gradient);
  padding-block: var(--space-7);
}

.page-hero::after {
  position: absolute;
  top: -120px;
  right: -100px;
  width: 420px;
  aspect-ratio: 1;
  border: 1px solid rgba(103, 188, 234, .22);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgba(40, 119, 195, .05);
  content: "";
}

.page-hero h1 { max-width: 15ch; font-size: clamp(3.25rem, 7vw, 7rem); }
.page-content { padding-block: var(--space-7); }

.prose { color: #d8e3f0; font-size: 1.08rem; }
.prose > * + * { margin-top: 1.25rem; }
.prose h2, .prose h3 { margin-top: 2.8rem; color: var(--white); }
.prose h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
.prose h3 { font-size: 1.65rem; }
.prose a { overflow-wrap: anywhere; }
.prose li + li { margin-top: .55rem; }
.prose .note { padding: 1.2rem; border-left: 4px solid var(--gold); background: rgba(240, 178, 34, .08); }

.timeline {
  position: relative;
  display: grid;
  gap: 1rem;
  margin-top: var(--space-6);
}

.timeline::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 25px;
  width: 2px;
  background: linear-gradient(var(--sky-blue), var(--gold), var(--ruby));
  content: "";
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(13, 23, 38, .82);
}

.timeline-dot {
  z-index: 1;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--ink-950);
  color: var(--gold-light);
  font-weight: 950;
}

.timeline-item p { margin-bottom: 0; color: var(--muted); }

.tutorial-stage {
  position: relative;
  min-height: 580px;
  overflow: hidden;
  border: 1px solid rgba(103, 188, 234, .35);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 20%, rgba(40, 119, 195, .24), transparent 50%),
    linear-gradient(160deg, #071225, var(--ink-1000));
  box-shadow: var(--shadow-panel);
  padding: clamp(1rem, 3vw, 2rem);
}

.tutorial-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.tutorial-progress { color: var(--sky-blue); font-size: .85rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.tutorial-board { display: grid; min-height: 460px; align-items: center; padding-block: 1.5rem; }
.tutorial-copy { max-width: 710px; margin-inline: auto; text-align: center; }
.tutorial-copy h2 { font-size: clamp(2rem, 5vw, 4rem); }
.tutorial-copy p { color: var(--muted); font-size: 1.08rem; }

.play-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .55fr);
  gap: 1.25rem;
  align-items: center;
  margin-top: 1.25rem;
}

.pile-zone,
.opponent-zone,
.player-zone {
  min-height: 145px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(0, 5, 18, .62);
  padding: 1rem;
}

.zone-label { color: var(--sky-blue); font-size: .73rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.card-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .65rem; margin-top: 1rem; }

.playing-card {
  position: relative;
  display: grid;
  width: 88px;
  min-height: 124px;
  place-items: center;
  border: 2px solid #d4d8e4;
  border-radius: 13px;
  background: linear-gradient(145deg, #fff, #dfe4ec);
  color: #091222;
  box-shadow: 0 12px 24px rgba(0, 0, 0, .32);
  font-family: Georgia, serif;
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  transition: translate var(--motion-fast), rotate var(--motion-fast), box-shadow var(--motion-fast);
}

button.playing-card { cursor: pointer; }
button.playing-card:hover { translate: 0 -7px; box-shadow: 0 18px 34px rgba(0, 0, 0, .44); }
.playing-card.red { color: var(--ruby); }
.playing-card.back {
  border-color: var(--gold);
  background:
    linear-gradient(45deg, transparent 47%, rgba(248, 222, 120, .18) 48% 52%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, rgba(103, 188, 234, .18) 48% 52%, transparent 53%),
    var(--navy-800);
  background-size: 18px 18px;
  color: transparent;
}

.playing-card.special::after {
  position: absolute;
  top: .35rem;
  right: .4rem;
  color: var(--gold);
  content: "★";
  font-family: system-ui, sans-serif;
  font-size: 1rem;
}

.playing-card.correct { border-color: var(--gold-light); box-shadow: 0 0 0 4px rgba(240, 178, 34, .25), 0 18px 36px rgba(0, 0, 0, .45); }
.playing-card.wrong { animation: card-shake 320ms ease; border-color: var(--ruby); }
.playing-card.played { animation: play-card 520ms cubic-bezier(.2, .85, .25, 1) both; }

.tutorial-feedback {
  min-height: 72px;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(13, 23, 38, .76);
  color: var(--muted);
}

.tutorial-feedback strong { color: var(--gold-light); }
.tutorial-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: 1rem; }

.layer-demo {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.layer-demo > div {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(13, 23, 38, .76);
}

.layer-demo strong { display: block; color: var(--gold-light); }
.layer-demo small { color: var(--muted); }

.lesson-list { display: grid; gap: .75rem; margin: 1.25rem 0 0; padding: 0; list-style: none; text-align: left; }
.lesson-list li { display: flex; gap: .7rem; align-items: flex-start; color: var(--muted); }
.lesson-list li::before { color: var(--gold); content: "♥"; font-weight: 900; }

.secondary-tutorial { max-width: 900px; margin-inline: auto; }
.secondary-tutorial[data-theme="hearts"] { --tutorial-accent: var(--ruby); }
.secondary-tutorial[data-theme="spades"] { --tutorial-accent: var(--royal-purple); }
.secondary-tutorial[data-theme="euchre"] { --tutorial-accent: var(--emerald); }
.secondary-tutorial .tutorial-stage { border-color: color-mix(in srgb, var(--tutorial-accent), white 25%); }

.status-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(13, 23, 38, .75);
}

.status-card .icon {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: rgba(40, 119, 195, .16);
  color: var(--sky-blue);
  font-size: 1.25rem;
}

.status-card h3 { font-size: 1.35rem; }
.status-card p { margin: .5rem 0 0; color: var(--muted); }
.values-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 1.25rem; border-top: 2px solid var(--gold); }
.stat strong { display: block; color: var(--gold-light); font-size: 1.6rem; }
.stat span { color: var(--muted); }

.article-header { max-width: 920px; padding-block: var(--space-7); }
.article-header h1 { max-width: 14ch; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--space-6); }
.article-aside { align-self: start; padding: 1rem; border-top: 2px solid var(--gold); color: var(--muted); }
.article-aside strong { color: var(--white); }
.article-art { width: 100%; max-height: 560px; object-fit: cover; border-radius: var(--radius-md); box-shadow: var(--shadow-panel); }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }

.notice {
  padding: 1rem 1.2rem;
  border: 1px solid rgba(240, 178, 34, .36);
  border-radius: var(--radius-sm);
  background: rgba(240, 178, 34, .08);
  color: var(--silver-ivory);
}

.checklist { padding-left: 1.25rem; color: var(--muted); }
.checklist li + li { margin-top: .55rem; }
.support-layout { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr); gap: var(--space-5); }
.support-card { padding: var(--space-5); }
.support-card h2 { font-size: 2.4rem; }

.social-slot:empty { display: none; }
.social-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.social-links a {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--white);
  font-weight: 900;
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink-950);
  padding-block: var(--space-6) 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: var(--space-5);
}

.footer-title { display: flex; align-items: center; gap: .55rem; font-size: 1.1rem; }
.footer-title span { color: var(--ruby); }
.footer-copy { max-width: 46ch; color: var(--muted); }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1rem; }
.footer-links a { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); font-weight: 700; text-decoration: none; }
.footer-links a:hover { color: var(--gold-light); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: var(--space-5); padding-top: 1rem; border-top: 1px solid var(--line); color: #8899ae; font-size: .84rem; }

[data-reveal] {
  opacity: 0;
  translate: 0 20px;
  transition: opacity var(--motion-slow), translate var(--motion-slow);
}

[data-reveal].revealed { opacity: 1; translate: 0; }

@keyframes palace-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

@keyframes card-drift {
  0%, 100% { translate: 0 0; }
  50% { translate: 8px -10px; }
}

@keyframes card-shake {
  25% { translate: -5px 0; }
  50% { translate: 5px 0; }
  75% { translate: -3px 0; }
}

@keyframes play-card {
  0% { translate: 0 0; rotate: 0; }
  55% { translate: 0 -36px; rotate: -3deg; }
  100% { translate: 0 0; rotate: 0; }
}

@media (max-width: 960px) {
  .menu-toggle { display: inline-grid; place-items: center; }
  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    align-items: stretch;
    flex-direction: column;
    padding: .75rem 1rem 1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(0, 5, 18, .98);
  }
  .site-nav[data-open="true"] { display: flex; }
  .site-nav a { justify-content: center; }
  .hero-grid { grid-template-columns: 1fr; padding-block: var(--space-6); }
  .hero { min-height: auto; }
  .palace-art { min-height: 430px; }
  .palace-art img { width: min(76vw, 520px); }
  .section-heading, .palace-band, .featured-news, .article-layout, .support-layout { grid-template-columns: 1fr; }
  .featured-news .news-art { min-height: 340px; }
  .game-grid, .feature-grid, .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-aside { order: -1; }
}

@media (max-width: 640px) {
  .shell, .narrow { width: min(100% - 1.25rem, 1180px); }
  .brand-copy { display: none; }
  .nav-wrap { min-height: 66px; }
  h1 { font-size: clamp(3.25rem, 17vw, 5rem); }
  .section { padding-block: var(--space-7); }
  .section-heading { margin-bottom: var(--space-5); }
  .game-grid, .feature-grid, .news-grid, .values-grid, .related-grid, .footer-grid, .layer-demo { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .palace-art { min-height: 330px; }
  .floating-card { width: 66px; font-size: 1.25rem; }
  .featured-news .news-art { min-height: 240px; }
  .play-area { grid-template-columns: 1fr; }
  .playing-card { width: 72px; min-height: 103px; font-size: 1.45rem; }
  .tutorial-stage { min-height: 620px; padding: .85rem; border-radius: var(--radius-md); }
  .tutorial-head { align-items: flex-start; flex-direction: column; }
  .timeline-item { padding: 1rem; }
  .article-header { padding-block: var(--space-6); }
}

@media (prefers-contrast: more) {
  :root { --muted: #eef4fb; --line: rgba(255, 255, 255, .55); }
  .panel, .status-card, .timeline-item { background: var(--ink-950); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1; translate: 0; }
}
/* Palace-first recovery: immersive world hero */
.palace-world {
  min-height: max(760px, calc(100svh - 70px));
  isolation: isolate;
  overflow: clip;
  border-bottom: 1px solid rgba(103, 188, 234, .35);
  background: #00020e;
}

.palace-world::before {
  z-index: -2;
  background:
    radial-gradient(circle at var(--pointer-x, 68%) var(--pointer-y, 34%), rgba(103, 188, 234, .32), transparent 24rem),
    linear-gradient(90deg, rgba(0, 2, 14, .99) 0%, rgba(0, 5, 18, .88) 34%, rgba(0, 5, 18, .18) 66%, rgba(0, 2, 14, .72) 100%);
}

.palace-world::after {
  z-index: -1;
  right: -8%;
  bottom: -42%;
  width: 76%;
  border-color: rgba(248, 222, 120, .25);
  box-shadow: 0 0 0 90px rgba(32, 54, 130, .09), 0 0 0 180px rgba(40, 119, 195, .05);
}

.palace-world-backdrop {
  position: absolute;
  z-index: -3;
  inset: -9%;
  background: url("palace-hero-1024.webp") 72% 42% / min(98vw, 1120px) auto no-repeat;
  filter: blur(28px) saturate(1.25);
  opacity: .26;
  scale: 1.08;
}

.palace-world-art {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: clamp(36%, 47vw, 52%);
  width: min(74vw, 1024px);
  translate: 0 -50%;
  filter: drop-shadow(0 42px 80px rgba(0, 0, 0, .76));
  animation: palace-float 7s ease-in-out infinite;
  -webkit-mask-image: radial-gradient(ellipse 72% 74% at 50% 50%, #000 54%, rgba(0,0,0,.92) 68%, transparent 88%);
  mask-image: radial-gradient(ellipse 72% 74% at 50% 50%, #000 54%, rgba(0,0,0,.92) 68%, transparent 88%);
}

.palace-world-art img { display: block; width: 100%; height: auto; }

.hero-stage {
  display: grid;
  min-height: inherit;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, .95fr);
  grid-template-rows: auto 1fr auto;
  gap: 1rem 2rem;
  align-items: end;
  padding-block: clamp(1rem, 3vh, 2rem) clamp(1.25rem, 3vh, 2.5rem);
}

.hero-topline {
  display: flex;
  z-index: 4;
  align-items: center;
  gap: .8rem;
  align-self: start;
  color: var(--silver-ivory);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero-news-link {
  display: flex;
  z-index: 4;
  min-height: 48px;
  align-items: center;
  justify-self: end;
  gap: .65rem;
  align-self: start;
  padding: .55rem .85rem;
  border: 1px solid rgba(103, 188, 234, .38);
  border-radius: 999px;
  background: rgba(0, 5, 18, .72);
  color: var(--white);
  font-size: .76rem;
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.hero-news-link span { color: var(--sky-blue); letter-spacing: .13em; text-transform: uppercase; }
.hero-news-link:hover, .hero-news-link:focus-visible { border-color: var(--gold); color: var(--gold-light); }

.palace-world .hero-copy {
  z-index: 4;
  max-width: 680px;
  align-self: center;
  padding-top: clamp(7rem, 18vh, 11rem);
  text-shadow: 0 3px 24px #000;
}

.hero-game-name {
  margin: 0 0 .15rem;
  color: var(--sky-blue);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: clamp(1.35rem, 2.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: .32em;
  line-height: 1;
  text-transform: uppercase;
}

.palace-world h1 { max-width: 8ch; font-size: clamp(5rem, 10.5vw, 10.5rem); }
.palace-world .lede { max-width: 48ch; font-size: clamp(1rem, 1.65vw, 1.3rem); }

.hero-layer-rail {
  display: grid;
  z-index: 4;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: end;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(103, 188, 234, .24);
  border-radius: var(--radius-md);
  background: rgba(103, 188, 234, .16);
  backdrop-filter: blur(14px);
}

.hero-layer-rail span {
  display: grid;
  min-height: 72px;
  align-content: center;
  padding: .75rem;
  background: rgba(0, 5, 18, .78);
  color: var(--silver-ivory);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}
.hero-layer-rail b { color: var(--gold-light); font-size: .67rem; letter-spacing: .14em; }

.hero-scroll {
  z-index: 4;
  min-height: 44px;
  align-self: end;
  color: var(--sky-blue);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.world-card {
  position: absolute;
  z-index: 2;
  display: grid;
  width: clamp(62px, 6.5vw, 104px);
  aspect-ratio: .7;
  align-content: space-between;
  padding: .55rem;
  border: 2px solid var(--gold-light);
  border-radius: 13px;
  background: linear-gradient(145deg, #fff, var(--silver-ivory));
  color: #101628;
  box-shadow: 0 28px 70px rgba(0,0,0,.65);
  font-family: Georgia, serif;
  font-size: clamp(1.05rem, 2vw, 1.65rem);
  animation: card-drift 6s ease-in-out infinite;
}
.world-card b { display: block; font-size: 1.2em; line-height: .8; }
.world-card.red { color: var(--ruby); }
.world-card-one { top: 23%; right: 5%; rotate: 11deg; }
.world-card-two { right: 38%; bottom: 9%; rotate: -9deg; animation-delay: -2s; }
.world-card-three { top: 16%; left: 44%; rotate: -13deg; animation-delay: -4s; }

.review-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  margin-top: 1rem;
  padding: .35rem .7rem;
  border: 1px solid rgba(248, 222, 120, .5);
  border-radius: 999px;
  color: var(--gold-light);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.faq-block details { border-top: 1px solid var(--line); }
.faq-block details:last-child { border-bottom: 1px solid var(--line); }
.faq-block summary {
  min-height: 58px;
  padding: 1rem 2.5rem 1rem 0;
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
}
.faq-block details p { margin-top: 0; padding: 0 2rem 1.25rem 0; color: var(--muted); }

@media (max-width: 900px) {
  .palace-world { min-height: 900px; }
  .hero-stage { grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto auto; align-items: start; }
  .hero-topline { grid-row: 1; }
  .hero-news-link { grid-row: 2; justify-self: start; }
  .palace-world .hero-copy { grid-row: 3; align-self: end; padding-top: 19rem; }
  .hero-layer-rail { grid-row: 4; }
  .hero-scroll { grid-row: 5; }
  .palace-world-art { top: 39%; left: 50%; width: min(94vw, 720px); translate: -50% -50%; opacity: .9; }
  .world-card-three { left: 8%; }
  .world-card-two { right: 8%; bottom: 18%; }
}

@media (max-width: 600px) {
  .palace-world { min-height: 850px; }
  .hero-stage { padding-inline: 1rem; }
  .hero-topline { align-items: flex-start; flex-direction: column; gap: .35rem; }
  .hero-news-link { max-width: 100%; border-radius: var(--radius-sm); }
  .hero-news-link span { flex: 0 0 auto; }
  .palace-world .hero-copy { padding-top: 15.5rem; }
  .hero-game-name { font-size: 1.15rem; }
  .palace-world h1 { font-size: clamp(4.3rem, 24vw, 6.6rem); }
  .palace-world .lede { max-width: 35ch; font-size: 1rem; }
  .palace-world-art { top: 36%; width: min(118vw, 560px); }
  .hero-layer-rail { grid-template-columns: 1fr; }
  .hero-layer-rail span { min-height: 46px; grid-template-columns: 2.2rem 1fr; align-items: center; }
  .world-card-one { top: 24%; right: 2%; }
  .world-card-two { display: none; }
  .world-card-three { top: 20%; left: 1%; }
}

@media (prefers-reduced-motion: reduce) {
  .palace-world-art, .world-card { animation: none; }
}
/* Palace table preview */
.tutorial-stage::before {
  position: absolute;
  inset: 64px 0 auto;
  height: 260px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(40,119,195,.3), transparent 68%),
    linear-gradient(90deg, transparent, rgba(240,178,34,.08), transparent);
  content: "";
  pointer-events: none;
}
.tutorial-head, .tutorial-board { position: relative; z-index: 1; }
.tutorial-progress { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem 1rem; }
.turn-light { color: var(--gold-light); }
.tutorial-board {
  margin-top: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid rgba(103,188,234,.2);
  border-radius: var(--radius-md);
  background:
    radial-gradient(ellipse at 50% 45%, rgba(32,54,130,.34), transparent 64%),
    linear-gradient(150deg, rgba(13,23,38,.72), rgba(0,5,18,.84));
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 24px 55px rgba(0,0,0,.32);
}
.play-area { grid-template-columns: minmax(170px,.62fr) minmax(260px,1fr) minmax(170px,.62fr); }
.player-zone { order: 2; border-color: rgba(240,178,34,.34); }
.pile-zone { order: 3; }
.opponent-zone { order: 1; opacity: .82; }
.card-row.compact { flex-wrap: nowrap; }
.card-row.compact .playing-card { width: 56px; min-height: 80px; font-size: .8rem; }
.card-row.compact .playing-card + .playing-card { margin-left: -2rem; }
.playing-card::before {
  position: absolute;
  top: .42rem;
  left: .48rem;
  color: currentColor;
  content: attr(data-card);
  font-size: .62em;
  line-height: 1;
}
.playing-card.back::before { content: "4♥"; color: var(--gold-light); }
button.playing-card:focus-visible { translate: 0 -8px; box-shadow: 0 0 0 4px var(--ink-1000), 0 0 0 7px var(--sky-blue), 0 20px 35px rgba(0,0,0,.55); }

@media (max-width: 820px) {
  .play-area { grid-template-columns: 1fr 1fr; }
  .opponent-zone { grid-column: 1 / -1; min-height: 112px; }
  .player-zone, .pile-zone { min-width: 0; }
}

@media (max-width: 560px) {
  .tutorial-stage { min-height: 680px; }
  .tutorial-board { padding: .85rem; }
  .play-area { grid-template-columns: 1fr; }
  .opponent-zone, .player-zone, .pile-zone { grid-column: auto; min-height: 112px; }
  .playing-card { width: 68px; min-height: 96px; font-size: 1.35rem; }
  .card-row { gap: .4rem; }
  .tutorial-progress { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .palace-world { min-height: 780px; }
  .hero-stage { gap: .55rem; }
  .hero-topline { font-size: .64rem; letter-spacing: .1em; }
  .hero-news-link { min-height: 44px; padding: .45rem .65rem; font-size: .66rem; }
  .palace-world .hero-copy { padding-top: 10.5rem; }
  .palace-world h1 { font-size: clamp(4rem, 21vw, 5.6rem); }
  .palace-world .lede { margin-top: .8rem; line-height: 1.45; }
  .palace-world .actions { margin-top: 1rem; }
  .palace-world-art {
    top: 30%;
    width: min(112vw, 520px);
    -webkit-mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 64%, rgba(0,0,0,.88) 76%, transparent 96%);
    mask-image: radial-gradient(ellipse 78% 78% at 50% 50%, #000 64%, rgba(0,0,0,.88) 76%, transparent 96%);
  }
  .world-card-one { top: 20%; }
  .world-card-three { top: 17%; }
}
