:root {
  color-scheme: dark;
  --green: #00ff9d;
  --green-soft: #59ffc0;
  --cyan: #00f6ff;
  --pink: #ff4f83;
  --ink: #000705;
  --panel: rgba(0, 18, 14, 0.84);
  --line: rgba(0, 245, 160, 0.22);
  --muted: #78948c;
  --text: #d8fff2;
  --display: "Orbitron", sans-serif;
  --mono: "Roboto Mono", monospace;
}

* { box-sizing: border-box; }
html { min-width: 300px; min-height: 100%; background: var(--ink); }
body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 36%, rgba(0, 89, 60, 0.2), transparent 43%),
    linear-gradient(180deg, #00100c 0%, #000604 74%);
  font-family: var(--mono);
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: #00100c;
  background: var(--green);
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.selector-atmosphere,
.selector-atmosphere > * { position: fixed; pointer-events: none; }
.selector-atmosphere { inset: 0; overflow: hidden; }
.selector-plane {
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(0, 245, 160, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 160, 0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, transparent 3%, #000 28%, #000 70%, transparent 100%);
  transform: perspective(700px) rotateX(63deg) scale(1.35) translateY(27%);
  transform-origin: 50% 100%;
}
.selector-orbit {
  width: min(64vw, 780px);
  aspect-ratio: 1;
  left: 50%;
  top: 44%;
  border: 1px solid rgba(0, 245, 160, 0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: orbitPulse 7s ease-in-out infinite;
}
.selector-orbit::before,
.selector-orbit::after { content: ""; position: absolute; border: inherit; border-radius: inherit; }
.selector-orbit::before { inset: 10%; }
.selector-orbit::after { inset: 24%; border-color: rgba(0, 216, 216, 0.09); }
.selector-orbit--two { width: min(42vw, 510px); animation-delay: -3.5s; }
.selector-scan {
  inset: -20% 0 auto;
  height: 20%;
  opacity: 0.18;
  background: linear-gradient(transparent, rgba(0, 245, 160, 0.12), transparent);
  animation: pageScan 8s linear infinite;
}

.selector-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1480px, 100%);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  border-inline: 1px solid rgba(0, 245, 160, 0.12);
}
.selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: max(1rem, env(safe-area-inset-top)) clamp(1.1rem, 3.5vw, 3rem) 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 8, 6, 0.78);
  backdrop-filter: blur(18px);
}
.selector-brand { display: inline-flex; align-items: center; gap: 0.9rem; text-decoration: none; }
.brand-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  aspect-ratio: 1;
  border: 1px solid rgba(0, 245, 160, 0.34);
  border-radius: 50%;
  box-shadow: 0 0 28px rgba(0, 245, 160, 0.12);
}
.brand-core::before,
.brand-core::after { content: ""; position: absolute; border: 1px solid rgba(0, 245, 160, 0.22); border-radius: 50%; }
.brand-core::before { width: 28px; height: 28px; }
.brand-core::after { width: 18px; height: 18px; }
.brand-core i { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.selector-brand > span:last-child { display: grid; gap: 0.16rem; }
.selector-brand strong { font: 700 0.9rem/1 var(--display); letter-spacing: 0.15em; }
.selector-brand small { color: var(--green); font: 700 0.5rem/1 var(--mono); letter-spacing: 0.18em; }
.selector-tools { position: relative; display: flex; align-items: center; gap: 0.65rem; }
.selector-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 38px;
  padding: 0.55rem 0.78rem;
  border: 1px solid rgba(0, 246, 255, 0.25);
  border-radius: 999px;
  color: #9ffcf7;
  background: rgba(0, 18, 18, 0.68);
  font-family: var(--mono);
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.selector-share svg { width: 15px; height: 15px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.selector-share strong { font-size: 0.55rem; letter-spacing: 0.13em; }
.selector-share:hover,
.selector-share:focus-visible {
  outline: none;
  color: var(--green-soft);
  border-color: rgba(0, 255, 157, 0.62);
  background: rgba(0, 35, 25, 0.8);
  box-shadow: 0 0 22px rgba(0, 255, 157, 0.1);
  transform: translateY(-1px);
}
.selector-share[data-state="complete"] { color: #00100c; border-color: var(--green); background: var(--green); }
.selector-share[data-state="error"] { color: #ffd7e3; border-color: rgba(255, 79, 131, 0.58); }
.selector-system-state {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
  min-height: 38px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #b9fce7;
  background: rgba(0, 25, 18, 0.66);
  font-size: 0.58rem;
  letter-spacing: 0.13em;
}
.selector-system-state > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: statePulse 2s ease-in-out infinite; }

.selector-main {
  display: grid;
  align-content: center;
  gap: clamp(1.2rem, 3vh, 2.4rem);
  width: min(1220px, calc(100% - clamp(2rem, 8vw, 7rem)));
  margin: auto;
  padding-block: clamp(1.5rem, 4vh, 3.5rem);
}
.selector-intro { display: grid; grid-template-columns: minmax(230px, 0.8fr) minmax(320px, 1.2fr); gap: 2rem; align-items: end; }
.selector-eyebrow { align-self: start; margin: 0.5rem 0 0; color: var(--green); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.17em; }
.selector-eyebrow span { display: inline-block; width: 7px; height: 7px; margin-right: 0.55rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.selector-intro h1 { margin: 0; font: 700 clamp(2rem, 4.8vw, 4.8rem)/0.94 var(--display); letter-spacing: -0.045em; }
.selector-intro h1 span { display: block; color: #8ba39b; font-size: 0.34em; letter-spacing: 0.2em; margin-bottom: 0.5rem; }
.selector-intro > div > p { max-width: 610px; margin: 0.9rem 0 0; color: var(--muted); font-size: clamp(0.78rem, 1.1vw, 0.95rem); line-height: 1.7; }

.game-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(0.8rem, 1.4vw, 1.15rem); }
.game-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(104px, 0.58fr) minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 0.8rem 1.35rem;
  min-height: 300px;
  padding: clamp(1rem, 1.65vw, 1.4rem);
  overflow: hidden;
  border: 1px solid rgba(0, 245, 160, 0.22);
  border-radius: 18px;
  color: inherit;
  background: linear-gradient(145deg, rgba(0, 24, 18, 0.94), rgba(0, 7, 5, 0.9));
  text-decoration: none;
  box-shadow: inset 0 0 50px rgba(0, 245, 160, 0.025), 0 20px 50px rgba(0, 0, 0, 0.24);
  isolation: isolate;
  transition: border-color 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}
.game-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at 24% 48%, rgba(0, 245, 160, 0.14), transparent 48%);
  transition: opacity 220ms ease;
}
.game-card--four::before { background: radial-gradient(circle at 24% 48%, rgba(0, 216, 216, 0.13), transparent 48%); }
.game-card--cascade::before { background: radial-gradient(circle at 24% 48%, rgba(255, 79, 131, 0.12), transparent 50%); }
.game-card:hover,
.game-card:focus-visible { outline: none; border-color: rgba(0, 245, 160, 0.68); transform: translateY(-4px); box-shadow: 0 0 34px rgba(0, 245, 160, 0.1), 0 28px 60px rgba(0, 0, 0, 0.3); }
.game-card:hover::before,
.game-card:focus-visible::before { opacity: 1; }
.game-index { grid-column: 1 / -1; color: var(--green); font-size: 0.6rem; font-weight: 700; letter-spacing: 0.18em; }
.game-card--four .game-index { color: var(--cyan); }
.game-card--cascade .game-index { color: var(--pink); }
.game-visual { position: relative; grid-row: 2; align-self: center; aspect-ratio: 1; width: min(100%, 175px); }
.game-visual--tic { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); gap: 5px; padding: 5px; }
.game-visual--tic > span { position: relative; border: 1px solid rgba(0, 245, 160, 0.16); border-radius: 4px; background: rgba(0, 0, 0, 0.34); }
.game-visual--tic [data-mark]::before,
.game-visual--tic [data-mark="x"]::after { content: ""; position: absolute; inset: 47% 18% auto; height: 2px; background: var(--green); box-shadow: 0 0 10px var(--green); transform: rotate(45deg); }
.game-visual--tic [data-mark="x"]::after { transform: rotate(-45deg); }
.game-visual--tic [data-mark="o"]::before { inset: 20%; height: auto; aspect-ratio: 1; border: 2px solid var(--cyan); border-radius: 50%; background: none; box-shadow: 0 0 10px rgba(0, 246, 255, 0.66); transform: none; }
.game-visual--tic > i { position: absolute; z-index: 2; left: 18%; top: 18%; width: 64%; height: 2px; background: white; box-shadow: 0 0 12px var(--green); transform: rotate(45deg); transform-origin: left center; animation: tracePulse 2.4s ease-in-out infinite; }
.game-visual--four { aspect-ratio: 7 / 6; width: min(100%, 190px); }
.four-dots { display: grid; grid-template: repeat(6, 1fr) / repeat(7, 1fr); gap: 4px; width: 100%; height: 100%; padding: 6px; border: 1px solid rgba(0, 216, 216, 0.18); border-radius: 8px; background: rgba(0, 10, 9, 0.68); }
.four-dots span { border: 1px solid rgba(0, 245, 160, 0.16); border-radius: 50%; background: rgba(0, 0, 0, 0.42); }
.four-dots [data-mark="x"] { border-color: var(--green); background: var(--green); box-shadow: 0 0 9px rgba(0, 245, 160, 0.66); }
.four-dots [data-mark="o"] { border-color: var(--pink); background: var(--pink); box-shadow: 0 0 9px rgba(236, 79, 145, 0.55); }
.four-trace { position: absolute; z-index: 2; left: 19%; bottom: 14%; width: 58%; height: 2px; background: white; box-shadow: 0 0 12px var(--cyan); transform: rotate(-19deg); transform-origin: left center; animation: tracePulse 2.4s ease-in-out -1.2s infinite; }
.game-visual--cascade { width: min(100%, 150px); }
.cascade-nodes { display: grid; grid-template: repeat(5, 1fr) / repeat(5, 1fr); gap: 4px; width: 100%; height: 100%; padding: 5px; border: 1px solid rgba(255, 79, 131, 0.16); border-radius: 9px; background: rgba(0, 10, 8, 0.72); }
.cascade-nodes span { position: relative; border: 1px solid rgba(0, 245, 160, 0.15); border-radius: 50%; background: rgba(0, 0, 0, 0.42); }
.cascade-nodes [data-mark="x"] { border-color: var(--green); background: radial-gradient(circle, #eafff7 0 12%, var(--green) 16% 34%, rgba(0, 255, 157, 0.15) 38% 62%, transparent 66%); box-shadow: 0 0 8px rgba(0, 255, 157, 0.62); }
.cascade-nodes [data-mark="o"] { border-color: var(--pink); background: radial-gradient(circle, #fff1f6 0 12%, var(--pink) 16% 34%, rgba(255, 79, 131, 0.14) 38% 62%, transparent 66%); box-shadow: 0 0 8px rgba(255, 79, 131, 0.58); }
.cascade-trace { position: absolute; z-index: 3; background: #fff; box-shadow: 0 0 12px var(--green); animation: tracePulse 1.8s ease-in-out infinite; pointer-events: none; }
.cascade-trace--horizontal { left: 8%; top: 49%; width: 84%; height: 2px; }
.cascade-trace--vertical { left: 49%; top: 8%; width: 2px; height: 84%; animation-delay: -0.9s; }
.game-copy { grid-column: 2; grid-row: 2; align-self: center; min-width: 0; }
.game-copy > span { color: var(--cyan); font-size: 0.55rem; font-weight: 700; letter-spacing: 0.16em; }
.game-copy h2 { margin: 0.45rem 0 0.7rem; font: 700 clamp(1.15rem, 2vw, 1.75rem)/1.05 var(--display); letter-spacing: -0.02em; }
.game-copy p { margin: 0; color: var(--muted); font-size: 0.72rem; line-height: 1.65; }
.game-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.game-meta span { padding: 0.38rem 0.5rem; border: 1px solid rgba(0, 245, 160, 0.13); border-radius: 3px; color: #72938a; font-size: 0.47rem; font-weight: 700; letter-spacing: 0.11em; }
.game-action { position: absolute; right: 1.3rem; bottom: 1.45rem; color: var(--green); font-size: 0.58rem; letter-spacing: 0.14em; opacity: 0; transform: translateX(-8px); transition: opacity 200ms ease, transform 200ms ease; }
.game-card:hover .game-action,
.game-card:focus-visible .game-action { opacity: 1; transform: none; }
.game-action i { margin-left: 0.4rem; font-style: normal; font-size: 1rem; }

.selector-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 52px; padding: 0.8rem clamp(1.1rem, 3.5vw, 3rem) max(0.8rem, env(safe-area-inset-bottom)); border-top: 1px solid rgba(0, 245, 160, 0.13); color: #526b64; font-size: 0.51rem; letter-spacing: 0.12em; }
.selector-footer nav { display: flex; gap: 1.2rem; }
.selector-footer a { color: #76958c; text-decoration: none; }
.selector-footer a:hover,
.selector-footer a:focus-visible { color: var(--green); }
.noscript-panel { margin: 1rem; padding: 1rem; border: 1px solid var(--line); background: #00100c; }

@keyframes orbitPulse { 0%, 100% { opacity: 0.35; transform: translate(-50%, -50%) scale(0.98); } 50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.03); } }
@keyframes pageScan { to { transform: translateY(700%); } }
@keyframes statePulse { 50% { opacity: 0.38; } }
@keyframes tracePulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

@media (min-width: 821px) and (max-width: 1050px) {
  .game-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-card--cascade { grid-column: 1 / -1; width: calc(50% - 0.4rem); justify-self: center; }
}

@media (max-width: 820px) {
  .selector-shell { border: 0; }
  .selector-main { width: min(100% - 2rem, 620px); padding-block: 1.4rem; }
  .selector-intro { grid-template-columns: 1fr; gap: 0.55rem; }
  .selector-eyebrow { margin: 0; }
  .selector-intro h1 { font-size: clamp(2rem, 9vw, 3.6rem); }
  .selector-intro > div > p { margin-top: 0.65rem; line-height: 1.55; }
  .game-options { grid-template-columns: 1fr; }
  .game-card { min-height: 205px; grid-template-columns: 120px 1fr; padding: 1rem; }
  .game-card--cascade { grid-column: auto; width: auto; }
  .game-visual { width: 116px; }
  .game-visual--four { width: 124px; }
  .game-visual--cascade { width: 116px; }
  .game-copy h2 { font-size: clamp(1rem, 4vw, 1.35rem); }
  .game-meta { padding-right: 0; }
  .game-action { display: none; }
}

@media (max-width: 520px) {
  .selector-header { min-height: 68px; padding-inline: 1rem; }
  .selector-brand { gap: 0.65rem; }
  .brand-core { width: 34px; }
  .selector-brand strong { font-size: 0.75rem; }
  .selector-tools { gap: 0.42rem; }
  .selector-share { min-width: 38px; padding: 0.5rem; }
  .selector-share strong { display: none; }
  .selector-system-state strong { display: none; }
  .selector-system-state { min-width: 38px; justify-content: center; padding: 0.5rem; }
  .selector-main { width: calc(100% - 1.4rem); gap: 1rem; }
  .game-card { min-height: 190px; grid-template-columns: 92px 1fr; gap: 0.6rem 0.9rem; border-radius: 13px; }
  .game-visual { width: 90px; }
  .game-visual--four { width: 94px; }
  .game-visual--cascade { width: 90px; }
  .game-copy p { font-size: 0.62rem; line-height: 1.5; }
  .game-meta span { font-size: 0.41rem; padding: 0.3rem 0.38rem; }
  .selector-footer > span { display: none; }
  .selector-footer { justify-content: center; }
}

@media (min-width: 821px) and (max-height: 720px) {
  .selector-main { padding-block: 1rem; gap: 1rem; }
  .selector-intro > div > p { display: none; }
  .game-card { min-height: 250px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
