:root {
  --bg: #020412;
  --bg-overlay-1: rgba(124, 84, 255, 0.26);
  --bg-overlay-2: rgba(56, 196, 255, 0.22);
  --text: #eef5ff;
  --muted: #97a8cb;
  --accent: #7ff0ff;
  --accent-strong: #64d9ff;
  --glass: rgba(10, 16, 38, 0.72);
  --glass-border: rgba(109, 156, 255, 0.18);
  --radius: 18px;
  --space: 18px;
  --space-lg: 32px;
  --maxw: 1120px;
  --pane-pad-block: 26px;
  --pane-pad-inline: clamp(20px, 4vw, 40px);
  --tile-font: clamp(16px, 2.6vw, 28px);
  --index-col: clamp(28px, 5.6vw, 44px);
  --arrow-col: clamp(20px, 4.8vw, 36px);
  --tile-gap: clamp(4px, 1.6vw, 12px);
  --tile-radius: 18px;
  --letters-per-row: 8;
}

* {
  box-sizing: border-box;
}

/* html, body { height: 100%; } */
body {
  margin: 0;
  background: linear-gradient(180deg, rgba(2, 4, 18, 0.95) 0%, #030718 100%);
  color: var(--text);
  font: 400 16px/1.6 Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

[x-cloak] {
  display: none !important;
}

body::before {
  content: "";
  position: fixed;
  inset: -40vh -20vw -40vh -20vw;
  background:
    radial-gradient(45% 60% at 15% 25%, rgba(124, 84, 255, 0.28), transparent 70%),
    radial-gradient(60% 65% at 80% 15%, rgba(56, 196, 255, 0.24), transparent 75%),
    repeating-linear-gradient(120deg, rgba(9, 17, 38, 0.9) 0px, rgba(9, 17, 38, 0.9) 60px, rgba(5, 11, 24, 0.96) 60px, rgba(5, 11, 24, 0.96) 150px);
  animation: waveShift 26s ease-in-out infinite alternate;
  opacity: 0.85;
  pointer-events: none;
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  inset: -30vh -10vw -30vh -10vw;
  background:
    radial-gradient(circle at 20% 80%, rgba(127, 240, 255, 0.18), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(100, 217, 255, 0.1), transparent 60%);
  animation: glowPulse 18s ease-in-out infinite;
  opacity: 0.7;
  pointer-events: none;
  z-index: -2;
}

@keyframes waveShift {
  0% {
    transform: translate3d(-60px, -25px, 0) scale(1.05);
  }

  50% {
    transform: translate3d(55px, 35px, 0) scale(1.12);
  }

  100% {
    transform: translate3d(-35px, 55px, 0) scale(1.08);
  }
}

@keyframes glowPulse {
  0% {
    opacity: 0.5;
    transform: scale(1);
  }

  50% {
    opacity: 0.75;
    transform: scale(1.05);
  }

  100% {
    opacity: 0.5;
    transform: scale(1);
  }
}

@keyframes caretBlock {

  0%,
  100% {
    box-shadow: inset 0 0 0 0 rgba(127, 240, 255, 0.9);
    color: var(--text);
  }

  50% {
    box-shadow: inset 0 0 0 999px rgba(127, 240, 255, 0.35);
    color: #04131c;
  }
}

@keyframes trimJiggle {

  0%,
  100% {
    transform: rotate(0deg);
  }

  20% {
    transform: rotate(-3deg);
  }

  40% {
    transform: rotate(3deg);
  }

  60% {
    transform: rotate(-2deg);
  }

  80% {
    transform: rotate(2deg);
  }
}

@keyframes hintPulse {
  0% {
    box-shadow: 0 0 0 rgba(193, 140, 255, 0.8);
  }

  100% {
    box-shadow: 0 0 18px rgba(193, 140, 255, 0.35);
  }
}

@keyframes trimSweep {
  0% {
    box-shadow: 0 0 0 rgba(126, 188, 255, 0);
  }

  50% {
    box-shadow: 0 0 22px rgba(126, 188, 255, 0.45);
  }

  100% {
    box-shadow: 0 0 0 rgba(126, 188, 255, 0);
  }
}

@keyframes clipSpark {
  0% {
    transform: scale(0.55) rotate(-6deg);
    opacity: 0;
  }

  40% {
    transform: scale(1.1) rotate(2deg);
    opacity: 1;
    box-shadow: 0 14px 32px rgba(126, 188, 255, 0.65);
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.85;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  }
}

@keyframes clipFlash {
  0% {
    opacity: 0;
    transform: scale(0.75);
  }

  30% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

@keyframes clipSweep {
  0% {
    transform: translateX(-130%);
    opacity: 0;
  }

  40% {
    opacity: 0.8;
  }

  100% {
    transform: translateX(130%);
    opacity: 0;
  }
}

@keyframes wildPulse {
  0% {
    opacity: 0.2;
    transform: scale(1);
  }

  40% {
    opacity: 0.85;
    transform: scale(1.05);
    box-shadow: 0 12px 26px rgba(127, 240, 255, 0.4);
  }

  100% {
    opacity: 0.35;
    transform: scale(1);
    box-shadow: none;
  }
}

@keyframes wildDrop {
  0% {
    transform: scale(0) rotate(-8deg);
    opacity: 0;
  }

  50% {
    transform: scale(1.15) rotate(2deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes scoreBump {
  0% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes buttonPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(127, 240, 255, 0);
  }

  50% {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(127, 240, 255, 0.6);
    color: var(--accent);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(127, 240, 255, 0);
  }
}

.pulse-once {
  animation: buttonPulse 0.6s ease-out 3;
}

@keyframes scoreFloat {
  0% {
    opacity: 0;
    transform: translate3d(-50%, -40%, 0) scale(0.75) rotate(var(--score-tilt, 0deg));
  }

  20% {
    opacity: 1;
    transform: translate3d(-50%, -50%, 0) scale(1) rotate(var(--score-tilt, 0deg));
  }

  70% {
    opacity: 1;
    transform: translate3d(-50%, -75%, 0) scale(1.08) rotate(var(--score-tilt, 0deg));
  }

  100% {
    opacity: 0;
    transform: translate3d(-50%, -105%, 0) scale(0.85) rotate(var(--score-tilt, 0deg));
  }
}

@keyframes fallOut {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  100% {
    transform: translateY(20px);
    opacity: 0;
  }
}

#app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  padding: 0 var(--space);
  margin: var(--space) auto;
}

@media (max-width: 480px) {
  .container {
    padding: 0 2px;
  }
}

/* Frosted glass utility */
.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 26px 60px rgba(2, 6, 17, 0.55);
  isolation: isolate;
  z-index: 0;
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.glass::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(180deg, rgba(142, 241, 255, 0.12), rgba(9, 18, 46, 0.4));
  backdrop-filter: blur(30px) saturate(160%);
  -webkit-backdrop-filter: blur(30px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(159, 231, 255, 0.09);
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  opacity: 0.88;
}

.pane {
  padding: var(--pane-pad-block) var(--pane-pad-inline);
  border-radius: var(--radius);
  display: grid;
  gap: var(--space);
}

.content {
  padding-bottom: var(--space-lg);
}

#content:focus {
  outline: none;
}

/* Header */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.header-backdrop,
.footer-backdrop {
  width: 100%;
  border-radius: 0;
}

.solid-shell {
  background: rgba(4, 9, 22, 0.92);
  border: 1px solid rgba(118, 160, 220, 0.25);
  box-shadow: 0 18px 40px rgba(3, 6, 16, 0.65);
}

.nav-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-radius: 0;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  gap: 1rem;
}

.locale-switcher {
  position: relative;
}

.locale-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  color: #fff;
  font-size: 0.85rem;
  backdrop-filter: blur(6px);
}

.locale-button .locale-flag,
.locale-menu .locale-flag {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
}

.locale-menu {
  position: absolute;
  right: 0;
  margin-top: 0.5rem;
  background: rgba(7, 11, 21, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  list-style: none;
  padding: 0.35rem;
  width: 240px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  z-index: 30;
}

.locale-menu li+li {
  margin-top: 0.25rem;
}

.locale-menu button {
  width: 100%;
  display: flex;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  align-items: center;
  background: transparent;
  color: #fff;
  text-align: left;
}

.locale-menu button:hover,
.locale-menu button.is-active {
  background: rgba(255, 255, 255, 0.08);
}

.locale-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.locale-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.locale-native {
  font-size: 0.75rem;
  opacity: 0.7;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 1rem;
  background: linear-gradient(135deg, #77AAFF 0%, #B8D4FF 50%, #77AAFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(119, 170, 255, 0.3);
  filter: drop-shadow(0 0 8px rgba(119, 170, 255, 0.4));
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
  position: relative;
  flex-wrap: wrap;
}

.nav-locale {
  margin-left: auto;
  display: flex;
}

.desktop-locale {
  display: inherit;
}

[data-role="mobile-locale"] {
  display: none;
  margin-left: auto;
}

.nav-link {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 6px 0;
  transition: color .2s ease;
  letter-spacing: 0.14em;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .2s ease;
}

.nav-link:hover {
  color: #fff;
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-link.active {
  color: var(--text);
}

.nav-link:focus-visible,
.button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}

.burger {
  display: none;
  background: none;
  color: var(--text);
  border: 1px solid var(--glass-border);
  padding: 8px 10px;
  border-radius: 10px;
}

#site-footer {
  margin-top: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  width: 100%;
}

.footer-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space);
  text-align: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 0;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
}

.footer-version {
  position: absolute;
  right: var(--space);
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-left {
  position: absolute;
  left: var(--space);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-link:hover {
  color: #fff;
}

.footer-sep {
  color: var(--muted);
  opacity: 0.5;
  font-size: 0.85rem;
}

.footer-dot {
  color: var(--muted);
  font-size: 0.9rem;
}

.social {
  display: flex;
  gap: 12px;
}

.social a {
  display: inline-flex;
  width: 24px;
  height: 24px;
  opacity: 0.9;
}

.social a:hover {
  opacity: 1;
}

.social img {
  width: 100%;
  height: 100%;
  filter: invert(85%);
}

@media (max-width: 640px) {
  .footer-shell {
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
  }

  .footer-left,
  .footer-version {
    position: static;
    width: 100%;
    text-align: center;
  }

  .footer-left {
    order: 3;
    margin-top: 4px;
  }

  .footer-links {
    order: 1;
  }

  .footer-version {
    order: 2;
  }
}

/* Cards and lists */
.grid {
  display: grid;
  gap: var(--space);
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  padding: var(--space);
  border-radius: var(--radius);
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space);
}

@media (min-width: 880px) {
  .split {
    grid-template-columns: 3fr 2fr;
  }
}

.card .thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
  opacity: 0.95;
}

.card h3 {
  margin: 0 0 6px;
  font-weight: 600;
}

.card p {
  margin: 0;
  color: var(--text);
}

.card a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.card a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Headings */
h1 {
  font-size: 3rem;
  line-height: 1.1;
  margin: 0 0 12px;
  font-weight: 700;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.85);
}

h2 {
  font-size: 1.6rem;
  margin: var(--space-lg) 0 var(--space);
  font-weight: 600;
}

.section-title {
  font-size: 2.2rem;
  letter-spacing: .02em;
  text-shadow: 0px 0px 8px rgba(0, 0, 0, 0.85);
}

.hero {
  display: grid;
  place-items: center;
  min-height: 12vh;
  text-align: center;
  gap: 2px;
}

.hero p {
  color: var(--muted);
  margin: 0;
}

.logo {
  width: 160px;
  height: auto;
  display: block;
  margin: 0 auto 6px;
  opacity: 0.95;
}

.brand-logo {
  height: 28px;
  width: auto;
  display: block;
  opacity: 0.95;
}

.hero {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 12px;
  padding: var(--space-lg);
}

.hero p {
  color: var(--muted);
  margin: 0 auto;
  max-width: 640px;
}

.hero-logo {
  width: clamp(240px, 32vw, 520px);
  height: auto;
  display: inline-block;
  opacity: 0.98;
  filter: drop-shadow(0px 8px 24px rgba(0, 0, 0, 0.55));
}

.hero-pane {
  text-align: center;
  justify-items: center;
  padding: clamp(32px, 6vw, 56px) var(--pane-pad-inline);
}

.hero-pane .btns {
  justify-content: center;
}

.btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 999px;
  background: rgba(17, 26, 52, 0.8);
  border: 1px solid rgba(119, 170, 255, 0.28);
  color: var(--text);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 30, 58, 0.35);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 52%, rgba(127, 240, 255, 0.4) 100%);
  color: #04121b;
  border: none;
  box-shadow: 0 16px 38px rgba(100, 217, 255, 0.35);
}

.button-outline {
  background: rgba(103, 242, 207, 0.08);
  border: 1px solid rgba(103, 242, 207, 0.25);
}

.button-ghost {
  background: transparent;
  border: 1px dashed rgba(127, 240, 255, 0.4);
  color: var(--muted);
}

.button[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.button[data-state="used"] {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
  opacity: 0.85;
}

.button.used-hint {
  background: linear-gradient(135deg, rgba(94, 137, 255, 0.3), rgba(94, 137, 255, 0.1));
  color: #dbe7ff;
}

.button.exhausted-hint {
  background: rgba(30, 32, 48, 0.65);
  color: rgba(200, 214, 235, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.store-btn img {
  height: 48px;
  width: auto;
  display: inline-block;
}

/* Utilities */
.hidden {
  display: none !important;
}

.stack {
  display: grid;
  gap: var(--space);
}

section.stack,
article.stack {
  gap: var(--space-lg);
}

.inline {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.8rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 1px, 1px);
  border: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  margin: var(--space-lg) 0 var(--space);
}

.section-heading h2 {
  margin: 0;
}

.section-heading .button {
  flex-shrink: 0;
}

.overline {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
}

.price-grid {
  display: grid;
  gap: 8px;
  margin: 8px 0 16px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(103, 242, 207, 0.08);
  border: 1px solid rgba(103, 242, 207, 0.2);
  padding: 8px 12px;
  border-radius: 10px;
}

.detail-hero {
  align-items: center;
  gap: var(--space);
}

.detail-copy {
  gap: 12px;
}

.detail-media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.detail-body {
  align-items: flex-start;
  gap: var(--space);
}

.detail-body ul,
.meta-list ul {
  margin: 0;
  padding-left: 20px;
}

.detail-body li,
.meta-list li {
  margin-bottom: 6px;
}

.meta-list h2 {
  margin-bottom: 6px;
}

.prose {
  gap: var(--space);
}

.prose h2,
.prose h3 {
  margin-bottom: 6px;
}

.prose ul {
  margin: 0;
  padding-left: 20px;
}

/* Mobile nav */
@media (max-width: 750px) {
  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    position: fixed;
    right: var(--space);
    left: var(--space);
    top: 72px;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: rgba(4, 9, 22, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.48);
    isolation: isolate;
    z-index: 160;
  }

  .nav-links.open::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: rgba(12, 16, 28, 0.48);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border-radius: inherit;
    z-index: -1;
    pointer-events: none;
  }

  .desktop-locale {
    display: none;
  }

  [data-role="mobile-locale"] {
    display: inline-flex;
  }

  .nav-locale {
    justify-content: center;
  }

  .burger {
    display: inline-flex;
  }

  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-heading .button {
    width: 100%;
    justify-content: center;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }
}

.contact-body {
  display: grid;
  gap: var(--space);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.contact-body section {
  display: grid;
  gap: 8px;
}

.contact-body ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.contact-body a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(103, 242, 207, 0.4);
}

.contact-socials {
  display: grid;
  gap: 8px;
}

.contact-socials .social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-socials .social-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(103, 242, 207, 0.35);
  background: rgba(103, 242, 207, 0.08);
  color: inherit;
  text-decoration: none;
  font-size: 0.9rem;
}

.contact-socials .social-link:hover {
  filter: brightness(1.1);
}

.home {
  gap: clamp(24px, 5vw, 36px);
}

.home-title {
  margin-bottom: 8px;
  font-size: clamp(2.25rem, 4vw, 3.2rem);
}

.home-highlights {
  display: grid;
  gap: var(--space);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-highlights ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.home-highlights h2,
.home-highlights h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.board-pane {
  display: grid;
  justify-items: center;
  padding: 0 0 5px 0;
  margin: 0 auto;
  width: 100%;
}

.board-shell {
  width: min(100%, 640px, max(320px, calc(100vh - 200px)));
  display: grid;
  gap: clamp(18px, 3vw, 26px);
  margin: 0 auto;
  justify-self: center;
  position: relative;
}

.board-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.board-utils {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.board-stats-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
}

.board-stats-row .score-card {
  justify-self: start;
}

.board-stats-row .difficulty-card {
  justify-self: end;
}

.help-btn {
  font-size: 1.8rem;
  width: 54px;
  height: 54px;
}

.board-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.hint-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.hint-panel[hidden] {
  display: none !important;
}

.win-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 20px;
}

.win-panel[hidden] {
  display: none !important;
}

.win-message {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(119, 170, 255, 0.15), rgba(103, 242, 207, 0.15));
  border: 2px solid rgba(119, 170, 255, 0.4);
  border-radius: 20px;
  padding: 16px 28px;
  box-shadow: 0 12px 32px rgba(119, 170, 255, 0.25);
  animation: winPulse 2s ease-in-out infinite;
  transition: all 0.3s ease;
}

.win-message:hover {
  transform: scale(1.05);
  box-shadow: 0 16px 40px rgba(119, 170, 255, 0.4);
  border-color: rgba(119, 170, 255, 0.6);
}

.win-message i {
  font-size: 2rem;
  color: #FFD700;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.6));
}

@keyframes winPulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 12px 32px rgba(119, 170, 255, 0.25);
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 16px 40px rgba(119, 170, 255, 0.35);
  }
}

.board-title {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.7rem);
  letter-spacing: 0.08em;
  color: var(--text);
  background: linear-gradient(135deg, #B8D4FF 0%, #77AAFF 50%, #B8D4FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(119, 170, 255, 0.4));
  font-weight: 600;
}

.board-title-wrap {
  flex: 1 1 100%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.board-title-wrap p {
  margin: 6px 0 0;
  max-width: 460px;
  width: 100%;
}

/* Button Icon */
.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.button-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text);
  transform: scale(1.05);
}

.button-icon i {
  font-size: 1.1rem;
}

.score-card,
.difficulty-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 16px 8px;
  border-radius: 18px;
  background: rgba(12, 22, 50, 0.9);
  border: 1px solid rgba(111, 183, 255, 0.35);
  box-shadow: 0 12px 26px rgba(5, 10, 24, 0.4);
  min-width: 110px;
  height: 84px;
  gap: 2px;
}

.difficulty-value {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

/* Difficulty icon colors matching archive badges */
.difficulty-value i[data-difficulty="easy"] {
  color: #7FD17F;
  filter: drop-shadow(0 0 8px rgba(127, 209, 127, 0.6));
}

.difficulty-value i[data-difficulty="normal"] {
  color: #77AAFF;
  filter: drop-shadow(0 0 8px rgba(119, 170, 255, 0.6));
}

.difficulty-value i[data-difficulty="hard"] {
  color: #FFA347;
  filter: drop-shadow(0 0 8px rgba(255, 163, 71, 0.6));
}

.difficulty-value i[data-difficulty="deamon"] {
  color: #FF5F5F;
  filter: drop-shadow(0 0 8px rgba(255, 95, 95, 0.6));
}

.score-label {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1;
  padding-bottom: 7px;
}

.score-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  filter: drop-shadow(0 0 12px rgba(119, 170, 255, 0.5));
  text-shadow: 0 0 20px rgba(119, 170, 255, 0.4);
  line-height: 1;
}

.score-card.bump .score-value {
  animation: scoreBump 0.6s ease;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space);
  flex-wrap: wrap;
  width: 100%;
}

.board-header h2 {
  margin: 0 0 4px;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.board-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  min-width: 120px;
}

.board-status {
  min-height: 1.2rem;
  text-align: right;
  font-size: 0.85rem;
  color: var(--accent);
}

.chain {
  display: grid;
  gap: clamp(12px, 2.8vw, 18px);
  width: 100%;
}

.row {
  display: grid;
  grid-template-columns: var(--index-col) 1fr var(--arrow-col);
  align-items: center;
  gap: clamp(10px, 2vw, 14px);
  width: 100%;
}

.row.shake {
  animation: shake 0.4s ease;
}

.index {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  background: rgba(17, 28, 62, 0.85);
  border: 1px solid rgba(116, 172, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
  flex: 0 0 auto;
  box-shadow: 0 8px 18px rgba(6, 14, 34, 0.45);
}

.letters {
  display: grid;
  grid-template-columns: repeat(var(--letters-per-row), minmax(0, 1fr));
  gap: var(--tile-gap);
  width: 100%;
}

.arrow {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  font-size: clamp(22px, 3.4vw, 32px);
  color: rgba(149, 207, 255, 0.75);
}

.arrow-action {
  cursor: pointer;
  transition: color 0.2s ease;
}

.arrow-action:hover {
  color: var(--accent);
}

.arrow-solved {
  color: var(--accent-strong);
  animation: glowPulse 1.5s ease infinite;
}

.arrow.placeholder {
  opacity: 0.45;
}

.arrow-dot {
  width: clamp(10px, 2.2vw, 16px);
  height: clamp(10px, 2.2vw, 16px);
  border-radius: 8px;
  background: rgba(126, 188, 255, 0.22);
  border: 1px solid rgba(126, 188, 255, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.box {
  width: 100%;
  aspect-ratio: 0.78;
  border-radius: var(--tile-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  text-transform: uppercase;
  font-size: var(--tile-font);
  transition: transform .15s ease;
}

.tile {
  border: 1px solid rgba(118, 174, 255, 0.35);
  background: linear-gradient(180deg, rgba(24, 40, 86, 0.92), rgba(11, 18, 46, 0.78));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(130, 216, 255, 0.08), 0 12px 28px rgba(7, 14, 35, 0.55);
}

.tile.filler {
  opacity: 0.25;
  border-style: dashed;
  animation: trimJiggle 0.6s ease;
}

.clip-spark {
  background: linear-gradient(160deg, rgba(152, 210, 255, 0.95), rgba(45, 56, 96, 0.92));
  border-color: rgba(185, 225, 255, 0.95);
  box-shadow:
    0 20px 40px rgba(55, 93, 158, 0.65),
    inset 0 0 12px rgba(255, 255, 255, 0.4);
  animation:
    clipSpark 0.65s ease var(--clip-delay, 0ms) both,
    clipGlow 1.1s ease var(--clip-delay, 0ms) both;
  position: relative;
  overflow: hidden;
}

.clip-spark::before,
.clip-spark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
}

.clip-spark::before {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, transparent 65%);
  animation: clipFlash 0.65s ease var(--clip-delay, 0ms) forwards;
}

.clip-spark::after {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0));
  transform: translateX(-130%);
  animation: clipSweep 0.75s ease var(--clip-delay, 0ms) forwards;
}

.letters.trim-activated {
  animation: trimSweep 0.55s ease;
}

.cell {
  border: 1px solid rgba(118, 180, 255, 0.32);
  background: linear-gradient(180deg, rgba(15, 24, 52, 0.9), rgba(8, 14, 34, 0.78));
  color: var(--text);
  text-align: center;
  outline: none;
  caret-color: transparent;
  position: relative;
}

.cell.locked {
  background: linear-gradient(180deg, rgba(34, 77, 70, 0.95), rgba(22, 52, 48, 0.85));
  border-color: rgba(121, 222, 187, 0.5);
  color: #e7fff6;
  font-weight: 600;
  opacity: 1 !important;
}

.letters.row-solved .cell.locked {
  background: linear-gradient(120deg,
      rgba(28, 110, 86, 0.95) 0%,
      rgba(98, 255, 210, 0.95) 50%,
      rgba(28, 110, 86, 0.95) 100%);
  background-size: 200% 100%;
  border-color: rgba(118, 255, 210, 0.8);
  color: #001a15;
  box-shadow: 0 0 18px rgba(79, 255, 198, 0.45);
  animation: glowSweep 1.5s ease-out forwards;
}

@keyframes glowSweep {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

.cell.hinted-letter {
  color: #c18cff;
  font-weight: 700;
  animation: hintPulse 0.8s ease;
}

/* Wild letter hints (revealed via hint button) - now golden/amber */
.cell.hint-correct {
  color: #042015;
  background: linear-gradient(180deg, rgba(255, 200, 95, 0.95), rgba(180, 120, 30, 0.9));
  border-color: rgba(255, 200, 95, 0.8);
  box-shadow: 0 0 16px rgba(255, 180, 60, 0.4);
  font-weight: 700;
}

/* Partial hint letters (pre-filled from puzzle data) - now green/teal */
.cell.partial-hint {
  color: #042015;
  background: linear-gradient(180deg, rgba(95, 255, 190, 0.95), rgba(22, 127, 95, 0.9));
  border-color: rgba(95, 255, 190, 0.8);
  box-shadow: 0 0 16px rgba(95, 255, 190, 0.4);
  font-weight: 700;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

.cell:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(127, 240, 255, 0.35), 0 8px 18px rgba(12, 24, 52, 0.6);
  animation: caretBlock 1s steps(2, start) infinite;
}

.cell[disabled]:not(.locked) {
  opacity: 0.55;
}

.fall-out {
  animation: fallOut 0.35s ease forwards;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.history {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  width: 100%;
}

details.history-panel {
  width: 100%;
  margin-top: 12px;
  border-top: 1px solid rgba(127, 240, 255, 0.1);
  padding-top: 12px;
}

details.history-panel summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  /* Hide default triangle */
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  transition: color 0.2s ease;
}

details.history-panel summary:hover {
  color: var(--accent);
}

details.history-panel summary::-webkit-details-marker {
  display: none;
}

details.history-panel summary::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
  margin-left: auto;
}

details.history-panel[open] summary::after {
  transform: rotate(180deg);
}

.guess-row {
  display: grid;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(127, 240, 255, 0.18);
  background: rgba(9, 16, 34, 0.85);
  box-shadow: inset 0 0 0 1px rgba(110, 183, 255, 0.05);
  width: 100%;
}

.guess-row.history-hint {
  background: rgba(12, 20, 44, 0.9);
  border-color: rgba(127, 240, 255, 0.25);
}

.history-header {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.guess-word {
  display: grid;
  grid-template-columns: repeat(var(--letters-per-row), minmax(0, 1fr));
  gap: var(--tile-gap);
  width: 100%;
}

.history-cost {
  margin-left: auto;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.history-cost.negative {
  color: var(--accent);
}

.history-cost.positive {
  color: #67f2cf;
}

.history-hint-body {
  font-size: 0.9rem;
  color: rgba(220, 235, 255, 0.85);
}

.tag {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.15rem 0.4rem;
  border: 1px solid rgba(119, 176, 255, 0.35);
  border-radius: 999px;
}

.ok {
  background: linear-gradient(180deg, rgba(65, 255, 188, 0.9), rgba(34, 164, 115, 0.88));
  color: #041c14;
  border: none;
}

.miss {
  background: linear-gradient(180deg, rgba(29, 36, 60, 0.95), rgba(21, 26, 44, 0.85));
  color: #aeb6bf;
  border: none;
}

.hint {
  background: rgba(18, 32, 66, 0.85);
  border: 1px dashed rgba(127, 240, 255, 0.32);
  color: var(--muted);
  font-weight: 600;
  padding: 0.5rem 0.7rem;
  border-radius: 12px;
}

.hint.lore-hint {
  border-style: solid;
  background: rgba(8, 21, 38, 0.9);
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.hint.lore-hint strong {
  color: var(--accent);
}

.board-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.board-rule {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(151, 168, 203, 0.85);
  text-align: center;
}

.share {
  font-size: 0.85rem;
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

.tests {
  border-top: 1px solid rgba(148, 176, 224, 0.18);
  padding-top: var(--space);
}

.tests summary {
  cursor: pointer;
}

.test-pass {
  color: #2fbf71;
  font-weight: 700;
}

.test-fail {
  color: #ff6b6b;
  font-weight: 700;
}

.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  border: 1px solid #2a303b;
  background: rgba(17, 21, 27, 0.8);
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.play-steps {
  display: grid;
  gap: 12px;
  padding-left: 20px;
}

.play-steps li {
  margin-left: 8px;
}

.play-tips {
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.about-list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
}

.contact-cards {
  display: grid;
  gap: var(--space);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.contact-cards section {
  display: grid;
  gap: 10px;
}

.contact-cards ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.archive-coming-soon ul {
  margin: 0 0 var(--space);
  padding-left: 18px;
  color: var(--muted);
}

.archive-coming-soon .small {
  margin-top: var(--space);
  display: block;
}

.hint-panel .button {
  font-size: 0.85rem;
}

.hint-panel .button {
  position: relative;
  padding-right: 36px;
}

.hint-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hint-badge {
  position: absolute;
  right: -6px;
  top: -6px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(3, 8, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
  color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 12px rgba(4, 6, 18, 0.45);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hint-panel .button:disabled .hint-badge,
.hint-panel .button.used-hint .hint-badge,
.hint-panel .button.exhausted-hint .hint-badge {
  opacity: 0;
  transform: translate(4px, -10px) scale(0.75);
}

.hint-modal[hidden] {
  display: none;
}

.hint-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 999;
}

.hint-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 22, 0.8);
  backdrop-filter: blur(6px);
}

.hint-modal__dialog {
  position: relative;
  width: min(90vw, 680px);
  max-height: 85vh;
  background: rgba(8, 16, 36, 0.95);
  border: 1px solid rgba(127, 240, 255, 0.3);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(2, 6, 18, 0.7);
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  padding: 4px;
  line-height: 1;
  border-radius: 50%;
  transition: color 0.2s ease, background 0.2s ease;
}

.modal-close:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  padding: 24px 48px 12px;
  /* Top, Side (extra for close btn), Bottom */
  flex-shrink: 0;
  border-bottom: 1px solid rgba(127, 240, 255, 0.1);
}

.insight-body {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.92);
}

.modal-meta {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(200, 218, 255, 0.8);
  margin: 0;
  text-align: center;
}

.modal-body {
  display: grid;
  gap: 10px;
  color: var(--text);
  line-height: 1.5;
  text-align: center;
  overflow-y: auto;
  padding: 20px 24px 24px;
  overscroll-behavior: contain;
  flex-grow: 1;
}

.synonym-group {
  border: 1px solid rgba(127, 240, 255, 0.22);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(14, 26, 48, 0.7);
  display: grid;
  gap: 4px;
  text-align: center;
}

.synonym-label {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(155, 199, 255, 0.9);
}

.synonym-value {
  font-size: 1.1rem;
  color: #e9f3ff;
  font-weight: 600;
}

@media (max-width: 720px) {
  .board-utils {
    grid-template-columns: 1fr;
  }

  .hint-panel {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  :root {
    --index-col: clamp(24px, 6vw, 36px);
    --arrow-col: clamp(16px, 5vw, 28px);
    --tile-gap: clamp(3px, 1vw, 8px);
    --tile-font: clamp(14px, 4vw, 22px);
    --tile-radius: 14px;
  }

  .board-pane {
    padding: 0;
  }

  .board-shell {
    width: 100%;
    padding: 0 4px;
  }

  .board-header {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .board-meta {
    align-items: flex-start;
    width: 100%;
  }

  .controls {
    justify-content: center;
  }

  .hint-panel .button {
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 999px;
  }

  .hint-panel .button i {
    margin: 0;
  }

  .hint-text {
    display: none;
  }

  .hint-panel .button {
    padding-right: 0;
  }

  .hint-badge {
    right: -4px;
    top: -4px;
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-4px);
  }

  40% {
    transform: translateX(4px);
  }

  60% {
    transform: translateX(-3px);
  }

  80% {
    transform: translateX(3px);
  }
}

.table-scroll {
  overflow-x: auto;
}

.matrix {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.matrix caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 8px;
}

.matrix th,
.matrix td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 176, 224, 0.22);
  font-size: 0.95rem;
}

.matrix thead th {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
}

.matrix tbody tr:last-child th,
.matrix tbody tr:last-child td {
  border-bottom: none;
}

.matrix .check {
  color: #67f2cf;
  font-weight: 700;
}

.matrix .na {
  color: rgba(167, 179, 209, 0.45);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(103, 242, 207, 0.12);
  border: 1px solid rgba(103, 242, 207, 0.25);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feature-grid,
.policy-grid {
  display: grid;
  gap: var(--space);
}

@media (min-width: 860px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

.stat-grid {
  display: grid;
  gap: var(--space);
}

@media (min-width: 720px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat-card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 176, 224, 0.18);
  background: rgba(12, 16, 28, 0.35);
  box-shadow: inset 0 0 0 1px rgba(103, 242, 207, 0.08);
}

.stat-card h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.track-icon {
  margin-bottom: 16px;
  width: 128px;
  max-width: 40vw;
  height: auto;
  filter: drop-shadow(0 8px 18px rgba(5, 12, 32, 0.35));
}

.track-hero {
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
}

.span-two {
  grid-column: 1 / -1;
}

@media (min-width: 860px) {
  .span-two {
    grid-column: span 2;
  }
}

.wild-wave {
  animation: wildPulse 0.7s ease var(--wild-delay, 0ms) both;
}

.wild-letter-drop {
  animation: wildDrop 0.6s ease both;
}

.score-float {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 12px 36px rgba(7, 8, 20, 0.65);
  filter: drop-shadow(0 12px 24px rgba(6, 9, 26, 0.55));
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 1000;
}

.score-float.negative {
  color: #ffd8a6;
  text-shadow:
    0 0 18px rgba(255, 208, 163, 0.85),
    0 12px 36px rgba(7, 8, 20, 0.65);
}

.score-float.positive {
  color: #9fffdc;
  text-shadow:
    0 0 22px rgba(144, 255, 226, 0.95),
    0 12px 36px rgba(7, 8, 20, 0.65);
}

.score-float.active {
  animation: scoreFloat 1.35s ease forwards;
}

.locale-label {
  font-size: 0.8rem;
  font-weight: 600;
}

@media (max-width: 1000px) {

  .locale-label,
  .locale-button i {
    display: none;
  }

  .locale-button {
    padding: 0.2rem 0.45rem;
  }
}

.archive-shell {
  gap: var(--space-lg);
}

.archive-actions {
  display: flex;
  gap: 0.5rem;
}

.archive-locale-picker {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 320px;
}

.archive-locale-picker select {
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 17, 33, 0.85);
  color: #fff;
  appearance: none;
  -webkit-appearance: none;
}

.archive-locale-picker select:focus {
  border-color: var(--accent);
  outline: none;
}

.archive-locale-picker select option {
  background: #0a1121;
  color: #fff;
}

.archive-layout {
  display: grid;
  gap: var(--space);
  grid-template-columns: minmax(320px, 400px) 1fr;
  align-items: flex-start;
}

@media (max-width: 920px) {
  .archive-layout {
    grid-template-columns: 1fr;
  }
}

.archive-cal.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Glass effect via pseudo-element to fix WebKit stacking issues */
.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 18, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: -1;
}

.archive-calendar {
  background: rgba(4, 9, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.calendar-nav {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.8rem;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.calendar-weekdays div {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.calendar-grid {
  margin-top: 0.35rem;
}

.calendar-cell {
  border: none;
  border-radius: 8px;
  padding: 0.45rem 0;
  color: #9fb5ff;
  background: rgba(255, 255, 255, 0.04);
}

.calendar-cell.is-muted {
  color: rgba(255, 255, 255, 0.4);
}

.calendar-cell.is-available {
  background: rgba(127, 240, 255, 0.15);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(127, 240, 255, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-cell.is-available:hover {
  background: rgba(127, 240, 255, 0.25);
  box-shadow: inset 0 0 0 1px rgba(127, 240, 255, 0.5);
  transform: translateY(-1px);
}

/* Difficulty-based calendar colors */
.calendar-cell.is-available[data-difficulty="easy"] {
  background: rgba(74, 222, 128, 0.15);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.3);
}

.calendar-cell.is-available[data-difficulty="easy"]:hover {
  background: rgba(74, 222, 128, 0.25);
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.5);
}

.calendar-cell.is-available[data-difficulty="normal"] {
  background: rgba(127, 240, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(127, 240, 255, 0.3);
}

.calendar-cell.is-available[data-difficulty="normal"]:hover {
  background: rgba(127, 240, 255, 0.25);
  box-shadow: inset 0 0 0 1px rgba(127, 240, 255, 0.5);
}

.calendar-cell.is-available[data-difficulty="hard"] {
  background: rgba(255, 180, 95, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 180, 95, 0.3);
}

.calendar-cell.is-available[data-difficulty="hard"]:hover {
  background: rgba(255, 180, 95, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 180, 95, 0.5);
}

.calendar-cell.is-available[data-difficulty="deamon"] {
  border-color: #ff5f5f;
  background: rgba(255, 95, 95, 0.15);
}

.calendar-cell.is-available[data-difficulty="deamon"]:hover {
  background: rgba(255, 95, 95, 0.25);
  box-shadow: 0 0 15px rgba(255, 95, 95, 0.3);
}

.archive-list {
  max-height: 500px;
  display: flex;
  flex-direction: column;
  background: rgba(4, 9, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
}

.archive-list table {
  width: 100%;
  border-collapse: collapse;
}

.archive-list thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(4, 9, 22, 0.95);
  backdrop-filter: blur(8px);
}

.archive-list thead th {
  padding: 1rem 0.75rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
}

.archive-list tbody {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  height: 400px;
  max-height: 400px;
}

.archive-list thead,
.archive-list tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.archive-list td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.archive-list tbody tr:last-child td {
  border-bottom: none;
}

.archive-pagination {
  display: none;
  /* Hidden since calendar controls the list */
}

.difficulty-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.05em;
}

.difficulty-badge[data-difficulty="easy"] {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.difficulty-badge[data-difficulty="normal"] {
  background: rgba(127, 240, 255, 0.2);
  color: #7ff0ff;
  border: 1px solid rgba(127, 240, 255, 0.4);
}

.difficulty-badge[data-difficulty="hard"] {
  background: rgba(255, 180, 95, 0.2);
  color: #ffb45f;
  border: 1px solid rgba(255, 180, 95, 0.4);
}

.difficulty-badge[data-difficulty="deamon"] {
  background: rgba(255, 95, 95, 0.2);
  color: #ff5f5f;
  border: 1px solid rgba(255, 95, 95, 0.4);
}

.archive-empty,
.archive-loading {
  text-align: center;
  padding: 2rem 0;
  color: var(--muted);
}

/* Keyboard Shortcuts Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 22, 0.8);
  backdrop-filter: blur(6px);
  z-index: 999;
}

.modal-dialog {
  position: relative;
  width: min(90vw, 520px);
  background: rgba(8, 16, 36, 0.95);
  border: 1px solid rgba(127, 240, 255, 0.3);
  border-radius: 20px;
  padding: clamp(24px, 5vw, 36px);
  box-shadow: 0 30px 70px rgba(2, 6, 18, 0.7);
  z-index: 1;
}

.shortcuts-modal h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
}

.shortcuts-grid {
  display: grid;
  gap: 1rem;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.shortcut-item .kbd {
  flex-shrink: 0;
}

.shortcut-item .kbd+.kbd {
  margin-left: 0.25rem;
}

.shortcut-item span:last-child {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
}

.footer-link {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.footer-link:hover {
  color: var(--accent);
}

/* How to Play Modal Styles */
.how-to-play-content {
  gap: var(--space);
}

.htp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .htp-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.htp-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  transition: background 0.2s ease;
}

.htp-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.htp-icon {
  font-size: 24px;
  color: var(--accent);
  background: rgba(127, 240, 255, 0.1);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
}

.htp-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text);
}

.htp-section-title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-align: center;
  margin: 12px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

.htp-hint-card {
  background: rgba(10, 20, 40, 0.6);
  border: 1px solid rgba(127, 240, 255, 0.15);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.htp-hint-icon {
  font-size: 20px;
  color: var(--accent);
  background: rgba(127, 240, 255, 0.08);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.htp-hint-info {
  flex: 1;
}

.htp-hint-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
}

.htp-hint-cost {
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(127, 240, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.htp-hint-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}

.anchor-icon {
  font-size: 0.7em;
  color: var(--accent);
  opacity: 0.7;
  margin-left: 2px;
  vertical-align: middle;
}

.index {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

/* Locale Modal Styles */
.locale-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
}

.locale-modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  z-index: 210;
  padding: 0;
  overflow: hidden;
  background: rgba(10, 16, 38, 0.95);
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.locale-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.locale-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.locale-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.locale-list li {
  width: 100%;
}

.locale-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  transition: all 0.2s ease;
  cursor: pointer;
}

.locale-list button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.locale-list button.is-active {
  background: rgba(127, 240, 255, 0.1);
  border-color: rgba(127, 240, 255, 0.2);
}

.locale-list .locale-flag {
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.locale-list .locale-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.locale-list .locale-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.locale-list .locale-native {
  font-size: 0.8rem;
  opacity: 0.7;
}

.locale-list .check-icon {
  color: var(--accent);
  font-size: 1.2rem;
}

/* Hide old dropdown styles if no longer needed, or keep for safety */
.locale-menu {
  display: none !important;
}

/* History Badges */
.tag.is-success {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.4);
}

.tag.is-warning {
  background: rgba(255, 180, 95, 0.2);
  color: #ffb45f;
  border: 1px solid rgba(255, 180, 95, 0.4);
}

.tag.is-info {
  background: rgba(127, 240, 255, 0.2);
  color: #7ff0ff;
  border: 1px solid rgba(127, 240, 255, 0.4);
}

.tag.is-error {
  background: rgba(255, 95, 95, 0.2);
  color: #ff5f5f;
  border: 1px solid rgba(255, 95, 95, 0.4);
}

/* Help and Status Group */
.help-status-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.button-help-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(127, 240, 255, 0.12);
  border: 1px solid rgba(127, 240, 255, 0.3);
  border-radius: 10px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.button-help-large:hover {
  background: rgba(127, 240, 255, 0.2);
  border-color: rgba(127, 240, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(127, 240, 255, 0.3);
}

.button-help-large i {
  font-size: 1.1rem;
}

/* Game Status Badge */
.game-status-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid;
}

.game-status-badge[data-status="get-started"] {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.4);
}

.game-status-badge[data-status="get-started"]:hover {
  background: rgba(74, 222, 128, 0.25);
  border-color: rgba(74, 222, 128, 0.6);
  transform: translateY(-1px);
}

.game-status-badge[data-status="playing"] {
  background: rgba(127, 240, 255, 0.15);
  color: #7ff0ff;
  border-color: rgba(127, 240, 255, 0.4);
  cursor: default;
}

.game-status-badge[data-status="share"] {
  background: rgba(255, 180, 95, 0.2);
  color: #ffb45f;
  border-color: rgba(255, 180, 95, 0.6);
  animation: statusPulse 2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255, 180, 95, 0.4);
}

.game-status-badge[data-status="share"]:hover {
  background: rgba(255, 180, 95, 0.3);
  border-color: rgba(255, 180, 95, 0.8);
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255, 180, 95, 0.6);
}

@keyframes statusPulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(255, 180, 95, 0.4);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 30px rgba(255, 180, 95, 0.7);
    transform: scale(1.02);
  }
}

/* Share Modal Platform Buttons */
.share-platforms {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.share-platform-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: rgba(127, 240, 255, 0.08);
  border: 1px solid rgba(127, 240, 255, 0.2);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-platform-btn:hover {
  background: rgba(127, 240, 255, 0.15);
  border-color: rgba(127, 240, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(127, 240, 255, 0.2);
}

.share-platform-btn i {
  font-size: 1.3rem;
}

@media (max-width: 520px) {
  .share-platforms {
    grid-template-columns: 1fr;
  }

  .help-status-group {
    width: 100%;
  }
}

/* Mobile: Hide "How to play" text, show only icon */
@media (max-width: 640px) {
  .button-help-large .mobile-hide {
    display: none;
  }

  .button-help-large {
    padding: 10px;
    min-width: 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    justify-content: center;
  }

  .button-help-large i {
    margin: 0;
    font-size: 1.2rem;
  }
}

/* Mobile: Compact score and difficulty cards */
@media (max-width: 640px) {

  .score-card,
  .difficulty-card {
    min-width: 90px;
    width: 90px;
    padding: 6px 10px;
  }

  .score-label,
  .difficulty-card .score-label {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
  }

  /* Keep score value and difficulty icon at normal size */
  .score-value {
    font-size: 1.4rem;
  }

  .difficulty-value i {
    font-size: 1.6rem;
  }
}

/* Chain tiles pulse animation */
@keyframes tilePulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(127, 240, 255, 0.4);
  }
}

.tile.pulse-intro {
  animation: tilePulse 0.6s ease-in-out 2;
}

/* Share Modal Styles */
.share-modal-body {
  text-align: center;
  padding: 10px;
}

.share-preview-text {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--text);
  font-weight: 600;
}

.share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  transition: transform 0.2s, opacity 0.2s;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 0.95rem;
}

.share-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.share-btn.facebook {
  background-color: #1877f2;
}

.share-btn.twitter {
  background-color: #000000;
  /* X brand color */
  border: 1px solid #333;
}

.share-btn.reddit {
  background-color: #ff4500;
}

.share-btn.clipboard {
  background-color: rgba(127, 240, 255, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
}

@media (max-width: 480px) {
  .share-buttons {
    grid-template-columns: 1fr;
  }
}

@keyframes textPulseGlow {

  0%,
  100% {
    text-shadow: 0 0 4px rgba(127, 240, 255, 0.3);
    transform: scale(1);
  }

  50% {
    text-shadow: 0 0 25px rgba(127, 240, 255, 1), 0 0 50px rgba(127, 240, 255, 0.8);
    color: #fff;
    transform: scale(0.95);
  }
}

.pulse-text-glow {
  animation: textPulseGlow 0.8s ease-in-out infinite;
  font-weight: bold;
}