.luman-snake {
  --snake-bg: #0b0d0e;
  --snake-panel: #111416;
  --snake-line: #293033;
  --snake-ink: #f1f3f2;
  --snake-muted: #abb3b5;
  --snake-accent: #c9fb8c;
  padding: clamp(118px, 10vw, 152px) 24px 56px;
  min-height: 85vh;
  background:
    radial-gradient(ellipse at 8% 24%, #1b2225 0%, transparent 48%),
    radial-gradient(ellipse at 88% 78%, #181e1a 0%, transparent 43%),
    #080a0b;
  color: var(--snake-ink);
  font-family: Montserrat, system-ui, sans-serif;
}

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

.luman-snake [hidden] { display: none !important; }

.luman-snake__inner { max-width: 1050px; margin-inline: auto; }

.luman-snake__back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  color: var(--snake-muted);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}

.luman-snake__back:hover { color: var(--snake-ink); }

.luman-snake__intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 15px 0 25px;
}

.luman-snake__eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
  color: var(--snake-muted);
  font-size: .69rem;
  font-weight: 800;
  letter-spacing: .17em;
}

.luman-snake__eyebrow > span:first-child:not(.luman-snake__eyebrow-divider),
.luman-snake__phase i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--snake-accent);
  box-shadow: 0 0 11px #b8fa7166;
}

.luman-snake__eyebrow-divider { color: #647075; }

.luman-snake h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: .91;
  font-weight: 900;
  letter-spacing: -.08em;
}

.luman-snake h1 span { color: #b8c4c7; }

.luman-snake__tagline {
  max-width: 275px;
  margin: 0 0 3px;
  color: var(--snake-muted);
  font-size: .9rem;
  line-height: 1.55;
}

.luman-snake__layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(236px, 2fr);
  align-items: start;
  gap: 18px;
}

.luman-snake__game,
.luman-snake__aside {
  min-width: 0;
  border: 1px solid var(--snake-line);
  border-radius: 22px;
  background: var(--snake-panel);
  box-shadow: 0 16px 45px #0004;
}

.luman-snake__game { padding: 13px; }

.luman-snake__hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 2px 4px 13px;
}

.luman-snake__hud > div { min-width: 0; }

.luman-snake__hud > div:last-child { justify-self: end; }

.luman-snake__hud > div > span {
  display: block;
  margin-bottom: 4px;
  color: var(--snake-muted);
  font-size: .66rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.luman-snake__hud strong {
  font-size: .86rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.luman-snake__phase { display: flex; align-items: center; gap: 6px; }
.luman-snake__phase i { width: 6px; height: 6px; flex-basis: 6px; }

.luman-snake__board {
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid #344045;
  border-radius: 14px;
  background: #0c1112;
}

.luman-snake__board canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.luman-snake__game.is-playing .luman-snake__board {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.luman-snake__board:focus-within {
  border-color: #9facad;
}

.luman-snake__board canvas:focus-visible { outline-offset: -4px; }

.luman-snake__overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 10px;
  background: #0c111277;
}

.luman-snake__dialog {
  width: min(100%, 330px);
  padding: clamp(14px, 3vw, 22px);
  border: 1px solid #404a4d;
  border-radius: 16px;
  background: #13181a;
  box-shadow: 0 10px 30px #0006;
}

.luman-snake__dialog-label {
  margin: 0 0 5px;
  color: var(--snake-accent);
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .12em;
}

.luman-snake__dialog h2 {
  margin: 0;
  font-size: clamp(1.34rem, 4vw, 1.85rem);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 880;
}

.luman-snake__dialog > p:not(.luman-snake__dialog-label),
.luman-snake__reward p {
  margin: 8px 0 0;
  color: var(--snake-muted);
  font-size: .75rem;
  line-height: 1.45;
}

.luman-snake__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.luman-snake__button,
.luman-snake__dpad button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--snake-ink);
  color: #101413;
  font: inherit;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.luman-snake__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  text-align: center;
}

.luman-snake__button:not(:disabled):hover { background: var(--snake-accent); }

.luman-snake__button--quiet,
.luman-snake__dpad button {
  border-color: #3a4448;
  background: #1b2225;
  color: var(--snake-ink);
}

.luman-snake__button--quiet:not(:disabled):hover,
.luman-snake__dpad button:not(:disabled):hover {
  border-color: #aebcbe;
  background: #283236;
}

.luman-snake__button:disabled,
.luman-snake__dpad button:disabled { opacity: .48; cursor: default; }

.luman-snake__button:focus-visible,
.luman-snake__dpad button:focus-visible,
.luman-snake__back:focus-visible,
.luman-snake__reward input:focus-visible {
  outline: 2px solid var(--snake-accent);
  outline-offset: 2px;
}

.luman-snake__reward { margin-top: 10px; }

.luman-snake__reward label {
  display: block;
  margin-bottom: 4px;
  color: var(--snake-muted);
  font-size: .67rem;
  font-weight: 800;
}

.luman-snake__reward > div {
  display: flex;
  gap: 6px;
}

.luman-snake__reward input {
  min-width: 0;
  width: 100%;
  padding: 5px 7px;
  border: 1px dashed #6e8456;
  border-radius: 7px;
  background: #182217;
  color: var(--snake-accent);
  font: 750 .93rem ui-monospace, monospace;
}

.luman-snake__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.luman-snake__commands { display: flex; flex-wrap: wrap; gap: 6px; }

.luman-snake__dpad {
  display: grid;
  grid-template-columns: repeat(4, 44px);
  gap: 4px;
}

.luman-snake__dpad button {
  display: grid;
  place-items: center;
  padding: 0;
  touch-action: none;
}

.luman-snake__dpad button:not(:disabled):active {
  border-color: var(--snake-accent);
  background: var(--snake-accent);
  color: #101413;
}

.luman-snake__dpad svg { width: 20px; height: 20px; }
.luman-snake__dpad [data-snake-turn="left"] svg { transform: rotate(-90deg); }
.luman-snake__dpad [data-snake-turn="down"] svg { transform: rotate(180deg); }
.luman-snake__dpad [data-snake-turn="right"] svg { transform: rotate(90deg); }

.luman-snake__keys {
  margin: 9px 0 0;
  color: var(--snake-muted);
  font-size: .68rem;
  line-height: 1.5;
}

.luman-snake__aside { padding: clamp(13px, 3vw, 24px); }

.luman-snake__aside-heading h2 {
  margin: 0 0 13px;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: -.04em;
}

.luman-snake__levels {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.luman-snake__levels li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 6px 9px;
  border: 1px solid var(--snake-line);
  border-radius: 8px;
  background: #181d20;
  color: var(--snake-muted);
  font-size: .79rem;
}

.luman-snake__levels li[aria-current] {
  border-color: #7a925d;
  background: #222b21;
  color: var(--snake-ink);
}

.luman-snake__levels li.is-complete .luman-snake__level-number { color: var(--snake-accent); }

.luman-snake__level-number {
  font: 750 .73rem ui-monospace, monospace;
  color: #9ca9ad;
}

.luman-snake__level-prize {
  margin-inline-start: auto;
  padding: 3px 6px;
  border: 1px solid #536049;
  border-radius: 5px;
  color: var(--snake-accent);
  font-size: .69rem;
  font-weight: 850;
  white-space: nowrap;
}

.luman-snake__rules {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--snake-line);
  color: var(--snake-muted);
  font-size: .77rem;
  line-height: 1.55;
}

.luman-snake__rules p { margin: 0 0 7px; }
.luman-snake__rules p:last-child { margin: 10px 0 0; font-size: .68rem; }
.luman-snake__rules strong { color: var(--snake-ink); }

@media (max-width: 900px) {
  .luman-snake { padding-top: 72px; }
}

@media (max-width: 740px) {
  .luman-snake { padding: 64px 15px 36px; }
  .luman-snake__layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .luman-snake__back { min-height: 34px; }
  .luman-snake__intro { display: block; margin: 5px 0 12px; }
  .luman-snake__tagline { margin: 7px 0 0; font-size: .79rem; line-height: 1.4; }
  .luman-snake__game { padding: 9px; border-radius: 15px; }
  .luman-snake__hud { padding-bottom: 9px; }
  .luman-snake__board {
    width: min(100%, clamp(220px, calc(100svh - 414px), 500px));
    margin-inline: auto;
  }
  .luman-snake__controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 9px;
  }
  .luman-snake__dpad {
    --snake-pad-key: clamp(54px, 15.4vw, 64px);
    grid-template-columns: repeat(3, var(--snake-pad-key));
    grid-template-areas: ". up ." "left down right";
    gap: 5px;
  }
  .luman-snake__dpad button {
    min-height: var(--snake-pad-key);
    border-radius: 12px;
    background: #252e31;
    border-color: #465559;
  }
  .luman-snake__dpad svg { width: 25px; height: 25px; }
  .luman-snake__dpad [data-snake-turn="up"] { grid-area: up; }
  .luman-snake__dpad [data-snake-turn="left"] { grid-area: left; }
  .luman-snake__dpad [data-snake-turn="down"] { grid-area: down; }
  .luman-snake__dpad [data-snake-turn="right"] { grid-area: right; }
  .luman-snake__commands { flex-direction: column; align-items: start; min-width: 0; }
  .luman-snake__commands button { max-width: 100%; }
}

@media (max-width: 740px) and (max-height: 640px) {
  .luman-snake h1 { font-size: clamp(2.25rem, 7vw, 4rem); }
  .luman-snake__intro { margin-bottom: 7px; }
  .luman-snake__tagline { display: none; }
}

@media (max-width: 359px) {
  .luman-snake { padding-inline: 11px; }
  .luman-snake__dialog { padding: 11px; }
  .luman-snake__actions { margin-top: 8px; }
  .luman-snake__reward p { font-size: .68rem; }
}
