/* ===========================================================================
   NEON SNAKE — a glowing tube on a dark grid (drawn in js/games/snake.js)
   =========================================================================== */

.snake-host {
  inset: 4px 8px 10px;
  cursor: default;
}

/* A tall phone: board at the top, and the space below it is a swipe pad
   your thumb can use without covering the snake. */
@media (max-aspect-ratio: 4/5) {
  .snake-host {
    align-items: flex-start;
    inset: 8px 8px 10px;
  }

  .snake-prompt { bottom: 9%; }
}

@media (max-aspect-ratio: 4/5) and (pointer: coarse) {
  .snake-host::after {
    content: 'Swipe anywhere';
    position: absolute;
    left: 50%;
    bottom: 3%;
    translate: -50% 0;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--arena-ink-3);
    opacity: 0.6;
    pointer-events: none;
  }
}

.snake-prompt {
  position: absolute;
  left: 50%;
  bottom: 13%;
  z-index: 2;
  translate: -50% 0;
  padding: 9px 18px;
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--game-accent);
  background: rgba(4, 6, 12, 0.78);
  border: 1px solid color-mix(in srgb, var(--game-accent) 45%, transparent);
  box-shadow: 0 0 24px -6px var(--game-glow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.snake-prompt.show {
  opacity: 1;
  animation: snake-prompt 1.5s ease-in-out infinite;
}

@keyframes snake-prompt {
  50% { box-shadow: 0 0 34px -2px var(--game-glow); color: #fff; }
}

/* --- Setup: mode, and which maze --- */
.snake-picks {
  display: grid;
  gap: 10px;
  justify-items: center;
  width: 100%;
}

.snake-picks .seg {
  width: 100%;
  max-width: 440px;
  flex-wrap: nowrap;
}

.snake-picks .seg button {
  flex: 1;
  padding: 6px 6px;
  line-height: 1.2;
}

.snake-mazes {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 440px;
}

.snake-mazes[hidden] { display: none; }

.snake-mazes button {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 8px 4px 7px;
  border-radius: var(--r-md);
  background: var(--arena-chip);
  border: 1px solid var(--arena-line);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--arena-ink-2);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease);
}

.snake-mazes button:hover {
  color: var(--arena-ink);
  transform: translateY(-1px);
}

.snake-mazes button[aria-pressed="true"] {
  color: var(--arena-ink);
  border-color: var(--game-accent);
  box-shadow: 0 0 0 1px var(--game-accent) inset, 0 6px 18px -8px var(--game-glow);
}

.snake-mazes span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snake-thumb {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  background: #05070E;
  box-shadow: 0 0 0 1px rgba(116, 132, 255, 0.25);
  image-rendering: pixelated;
}

@media (max-width: 420px) {
  .snake-picks .seg button { font-size: 0.78rem; padding: 6px 3px; }
  .snake-picks .seg button small { font-size: 0.58rem; }
  .snake-mazes { gap: 4px; }
  .snake-mazes button { padding: 6px 2px; font-size: 0.56rem; }
  .snake-thumb { width: 26px; height: 26px; }
}

/* --- Menu card preview: the tube, gliding toward an apple --- */
.pv-snake {
  background:
    radial-gradient(circle at 70% 40%, rgba(255, 61, 110, 0.16), transparent 30%),
    radial-gradient(circle at 45% 55%, rgba(61, 255, 122, 0.12), transparent 60%);
}

/* Each piece slightly overlaps the next, so the chain reads as one tube. */
.pv-snake i {
  left: calc(var(--x) * 6.25cqw + 0.7cqw);
  top: calc(var(--y) * 6.25cqw + 0.7cqw);
  width: 6.6cqw;
  height: 6.6cqw;
  margin: -0.85cqw;
  border-radius: 2.2cqw;
  background: #3DFF7A;
  box-shadow: 0 0 2.6cqw rgba(61, 255, 122, 0.5);
  animation: pv-snake-ripple 1.4s ease-in-out infinite;
  animation-delay: calc(var(--n) * -0.09s);
}

/* The head: a little bigger, a little brighter, with eyes. */
.pv-snake i:first-of-type {
  z-index: 1;
  width: 7.4cqw;
  height: 7.4cqw;
  margin: -1.25cqw;
  border-radius: 50%;
  background:
    radial-gradient(circle at 70% 30%, #04110A 0 0.55cqw, transparent 0.7cqw),
    radial-gradient(circle at 70% 70%, #04110A 0 0.55cqw, transparent 0.7cqw),
    radial-gradient(circle at 64% 30%, #F5FFF8 0 1.1cqw, transparent 1.25cqw),
    radial-gradient(circle at 64% 70%, #F5FFF8 0 1.1cqw, transparent 1.25cqw),
    #7DFFA8;
  box-shadow: 0 0 3.4cqw rgba(61, 255, 122, 0.8);
}

/* The last two taper off. */
.pv-snake i:nth-last-of-type(2) { scale: 0.78; }
.pv-snake i:last-of-type { scale: 0.56; }

@keyframes pv-snake-ripple {
  50% { filter: brightness(1.45); }
}

.pv-snake b {
  left: calc(13 * 6.25cqw + 0.9cqw);
  top: calc(4 * 6.25cqw + 0.9cqw);
  width: 4.5cqw;
  height: 4.5cqw;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFC2D2, #FF3D6E 60%);
  box-shadow: 0 0 3cqw rgba(255, 61, 110, 0.8);
  animation: pv-snake-apple 0.9s ease-in-out infinite;
}

@keyframes pv-snake-apple {
  50% { scale: 1.14; }
}

/* The quick-eat ring around the apple. */
.pv-snake em {
  left: calc(13 * 6.25cqw - 0.6cqw);
  top: calc(4 * 6.25cqw - 0.6cqw);
  width: 7.5cqw;
  height: 7.5cqw;
  border-radius: 50%;
  border: 0.45cqw solid rgba(61, 255, 122, 0.6);
  border-right-color: transparent;
  border-bottom-color: transparent;
  animation: pv-snake-ring 2.4s linear infinite;
}

@keyframes pv-snake-ring {
  to { rotate: -360deg; }
}
