:root {
  color-scheme: dark;
  --ink: #f4fbf7;
  --muted: #a8bdb4;
  --paper: #03100d;
  --surface: rgba(13, 33, 27, 0.86);
  --surface-strong: rgba(19, 44, 36, 0.94);
  --line: rgba(88, 242, 210, 0.24);
  --teal: #58f2d2;
  --teal-2: #8af79b;
  --amber: #f6c65b;
  --rose: #ff9860;
  --green: #8af79b;
  --blue: #6ac7ff;
  --purple: #b69cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --panel-shadow: 0 0 0 1px rgba(88, 242, 210, 0.16), 0 18px 46px rgba(0, 0, 0, 0.34);
  --tile-shadow: 0 8px 0 rgba(0, 0, 0, 0.28), 0 0 26px rgba(88, 242, 210, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 22% 10%, rgba(88, 242, 210, 0.18), transparent 30%),
    radial-gradient(circle at 86% 16%, rgba(246, 198, 91, 0.12), transparent 28%),
    linear-gradient(90deg, rgba(88, 242, 210, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(88, 242, 210, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, #0b1f19 0, #03100d 620px, #020907 100%);
  background-size: auto, auto, 38px 38px, 38px 38px, auto;
  line-height: 1.62;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--teal-2);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(88, 242, 210, 0.22);
  background: rgba(3, 16, 13, 0.86);
  backdrop-filter: blur(16px);
}

.header-inner,
.footer-inner,
.section-inner,
.article-layout {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(300px, 1fr) auto;
  min-height: 78px;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 820;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(88, 242, 210, 0.46);
  border-radius: 8px;
  background: #03100d;
  box-shadow: 0 0 22px rgba(88, 242, 210, 0.22);
}

.brand span {
  min-width: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.nav,
.language-switcher,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav {
  justify-content: center;
}

.nav a,
.language-switcher a,
.article-side a {
  border: 1px solid rgba(88, 242, 210, 0.22);
  border-radius: 8px;
  background: rgba(13, 33, 27, 0.7);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 760;
  text-decoration: none;
}

.nav a {
  padding: 7px 10px;
}

.nav a[aria-current="page"],
.language-switcher a[aria-current="true"],
.article-side a:hover {
  border-color: var(--teal);
  background: rgba(88, 242, 210, 0.16);
  color: #ffffff;
  box-shadow: inset 0 0 18px rgba(88, 242, 210, 0.12);
}

.language-switcher {
  justify-content: flex-end;
}

.language-switcher a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  font-size: 0.78rem;
}

.language-switcher span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  background: rgba(88, 242, 210, 0.16);
  font-size: 0.74rem;
}

.language-switcher a[aria-current="true"] span {
  background: rgba(88, 242, 210, 0.32);
}

.hero {
  padding: 54px 0 46px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(360px, 1.02fr);
  gap: 42px;
  align-items: center;
}

.hero-copy {
  position: relative;
  padding: 28px 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-2);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  line-height: 1.16;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: 4.2rem;
  text-shadow: 0 0 28px rgba(88, 242, 210, 0.12);
}

h2 {
  margin: 0;
  font-size: 2.25rem;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

.lead {
  max-width: 720px;
  margin-top: 20px;
  color: #d7e7df;
  font-size: 1.16rem;
}

.lab-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 650px;
  margin-top: 24px;
}

.lab-readout span {
  display: grid;
  min-height: 72px;
  align-content: center;
  border: 1px solid rgba(88, 242, 210, 0.24);
  border-radius: 8px;
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(88, 242, 210, 0.13), transparent 52%),
    rgba(13, 33, 27, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  box-shadow: inset 0 0 18px rgba(88, 242, 210, 0.08);
}

.lab-readout b {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(88, 242, 210, 0.72);
  border-radius: 8px;
  padding: 10px 16px;
  background:
    linear-gradient(180deg, rgba(88, 242, 210, 0.28), rgba(47, 107, 94, 0.9)),
    #0d211b;
  color: #f4fbf7;
  font-weight: 820;
  text-decoration: none;
  box-shadow: 0 5px 0 #04100d, inset 0 0 18px rgba(138, 247, 155, 0.15), 0 0 22px rgba(88, 242, 210, 0.18);
  transform: translateY(0);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  color: #ffffff;
  transform: translateY(2px);
  box-shadow: 0 3px 0 #0e3f46;
}

.button.secondary {
  border-color: rgba(246, 198, 91, 0.74);
  background:
    linear-gradient(180deg, rgba(246, 198, 91, 0.34), rgba(97, 68, 17, 0.78)),
    #21180a;
  box-shadow: 0 5px 0 #241705, inset 0 0 16px rgba(246, 198, 91, 0.13);
  color: #fff6d8;
}

.game-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(88, 242, 210, 0.42);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(19, 44, 36, 0.96), rgba(3, 16, 13, 0.96)),
    repeating-linear-gradient(45deg, rgba(88, 242, 210, 0.07) 0 8px, transparent 8px 16px);
  box-shadow: var(--panel-shadow);
}

.game-stage::before {
  content: "";
  position: absolute;
  inset: auto -20% 18% -20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(88, 242, 210, 0.5), transparent);
  box-shadow: 0 0 28px rgba(88, 242, 210, 0.38);
  transform: rotate(-8deg);
}

.stage-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}

.stage-label b {
  color: var(--amber);
}

.stage-hud,
.target-strip,
.stage-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  font-weight: 800;
}

.stage-hud,
.stage-stats {
  border: 1px solid rgba(88, 242, 210, 0.2);
  color: #ffffff;
  background: rgba(3, 16, 13, 0.72);
  padding: 10px 12px;
}

.stage-hud b,
.stage-stats b {
  color: #ffd166;
}

.target-strip {
  margin: 12px 0;
  border: 1px solid rgba(246, 198, 91, 0.32);
  background: rgba(13, 33, 27, 0.78);
  padding: 10px 12px;
}

.target-strip strong {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.32), transparent 28%),
    #ff9860;
  color: #ffffff;
  font-size: 1.75rem;
  box-shadow: 0 5px 0 #6c301d, 0 0 24px rgba(255, 152, 96, 0.22);
}

.target-strip small {
  color: var(--muted);
  font-weight: 800;
}

.mini-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  aspect-ratio: 1;
  border: 1px solid rgba(88, 242, 210, 0.32);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(90deg, rgba(88, 242, 210, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(88, 242, 210, 0.08) 1px, transparent 1px),
    #061512;
  background-size: 25% 25%;
}

.board-cell {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  border-radius: 8px;
  background: rgba(244, 251, 247, 0.06);
}

.element-tile {
  position: relative;
  grid-template-rows: auto auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.54);
  color: #102125;
  box-shadow: var(--tile-shadow);
  animation: tile-pop 3.8s ease-in-out infinite;
  animation-delay: calc(var(--delay) * 180ms);
}

.element-tile b {
  align-self: end;
  font-size: 1.55rem;
  line-height: 1;
}

.element-tile small {
  max-width: 100%;
  align-self: start;
  overflow: hidden;
  padding: 0 4px;
  color: rgba(16, 33, 37, 0.74);
  font-size: 0.58rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.element-tile em {
  position: absolute;
  top: 5px;
  right: 6px;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  opacity: 0.72;
}

.tile-h { background: #f9f0cf; }
.tile-he { background: #cde7f4; }
.tile-li { background: #d7eec6; }
.tile-be { background: #ffe0a4; }
.tile-b { background: #f4b4a8; }
.tile-c { background: #d4d8dc; }
.tile-n { background: #b8cdf7; }
.tile-o { background: #f0a8b0; color: #3c1015; }
.tile-f { background: #c1e4bd; }
.tile-ne { background: #d8c8f0; }

.band {
  padding: 50px 0;
  border-top: 1px solid rgba(88, 242, 210, 0.12);
}

.links-band {
  background: rgba(6, 21, 18, 0.46);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

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

.tile {
  min-height: 176px;
  border: 1px solid rgba(88, 242, 210, 0.22);
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(88, 242, 210, 0.08), transparent 44%),
    var(--surface-strong);
  box-shadow: var(--panel-shadow);
}

.tile strong {
  display: inline-block;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid rgba(88, 242, 210, 0.22);
  background: rgba(88, 242, 210, 0.1);
  padding: 4px 7px;
  color: var(--teal);
  font-size: 0.78rem;
}

.tile p:last-child,
.article li:last-child {
  margin-bottom: 0;
}

.link-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.link-list a {
  display: grid;
  min-height: 86px;
  align-content: space-between;
  border: 1px solid rgba(88, 242, 210, 0.22);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(88, 242, 210, 0.1), transparent 48%),
    rgba(13, 33, 27, 0.86);
  color: var(--ink);
  font-weight: 820;
  text-decoration: none;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.link-list a:hover {
  border-color: rgba(88, 242, 210, 0.58);
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2), 0 0 24px rgba(88, 242, 210, 0.12);
}

.link-list a b {
  color: var(--amber);
  font-size: 0.82rem;
}

.article-shell {
  padding: 46px 0 66px;
}

.article-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.article-side {
  position: sticky;
  top: 106px;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(88, 242, 210, 0.24);
  border-radius: 8px;
  padding: 16px;
  background: rgba(13, 33, 27, 0.88);
  box-shadow: var(--panel-shadow);
}

.article-side img {
  border-radius: 8px;
  border: 1px solid rgba(88, 242, 210, 0.3);
  box-shadow: 0 0 22px rgba(88, 242, 210, 0.14);
}

.article-side span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.article-side nav {
  display: grid;
  gap: 8px;
}

.article-side a {
  padding: 8px 10px;
}

.article {
  border: 1px solid rgba(88, 242, 210, 0.24);
  border-radius: 8px;
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(19, 44, 36, 0.92), rgba(13, 33, 27, 0.9)),
    var(--surface);
  box-shadow: var(--panel-shadow);
}

.article header {
  margin-bottom: 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(88, 242, 210, 0.16);
}

.article h1 {
  font-size: 3.15rem;
}

.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.metadata span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 9px;
  background: rgba(3, 16, 13, 0.46);
}

.article-grid {
  margin-bottom: 26px;
}

.article-section {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}

.article-section h2 {
  margin-bottom: 14px;
  font-size: 1.55rem;
}

.article ul {
  margin: 0;
  padding-left: 1.25rem;
}

.article li {
  margin-bottom: 0.62rem;
}

.site-footer {
  border-top: 1px solid rgba(88, 242, 210, 0.2);
  padding: 28px 0;
  background: #020907;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.94rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-inner strong {
  display: block;
  color: #ffffff;
}

.footer-links a {
  color: #ffffff;
}

@keyframes tile-pop {
  0%, 78%, 100% {
    transform: translateY(0) scale(1);
  }
  84% {
    transform: translateY(-4px) scale(1.025);
  }
}

@media (max-width: 1040px) {
  .header-inner {
    grid-template-columns: 1fr;
    padding: 14px 0;
  }

  .nav,
  .language-switcher {
    justify-content: flex-start;
  }

  .hero-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-side {
    position: static;
  }

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

@media (max-width: 760px) {
  .site-header {
    position: static;
  }

  .header-inner {
    gap: 9px;
    padding: 10px 0;
  }

  .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }

  .nav a {
    overflow: hidden;
    padding: 6px 4px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .language-switcher {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    padding-top: 34px;
  }

  h1,
  .article h1 {
    font-size: 2.2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .lead {
    font-size: 1.04rem;
  }

  .lab-readout {
    grid-template-columns: 1fr;
  }

  .game-stage {
    padding: 12px;
  }

  .mini-board {
    gap: 7px;
    padding: 7px;
  }

  .element-tile b {
    font-size: 1.12rem;
  }

  .element-tile small {
    display: none;
  }

  .grid,
  .link-list {
    grid-template-columns: 1fr;
  }

  .language-switcher a {
    padding: 5px;
    font-size: 0;
  }

  .language-switcher span {
    width: 28px;
    font-size: 0.76rem;
  }

  .section-heading {
    display: block;
  }

  .article {
    padding: 22px;
  }
}

@media (max-width: 430px) {
  .header-inner,
  .footer-inner,
  .section-inner,
  .article-layout {
    width: min(100% - 24px, 1160px);
  }

  .nav a,
  .language-switcher a {
    font-size: 0.74rem;
  }

  .language-switcher a {
    font-size: 0;
  }
}

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