[data-theme="aurora"] {
  --bg: #040f12;
  --surface: rgba(6, 22, 25, 0.93);
  --surface-solid: #081b1e;
  --sidebar: #071419;
  --text: #e2fff4;
  --muted: #91b6b1;
  --line: #254741;
  --green: #89ffd4;
  --lime: #89ffd4;
  --green-soft: #123b33;
  --orange: #c4b0ff;
  --secondary: #c4b0ff;
  --game-empty: #0c2b2b;
}
[data-theme="abyss"] {
  --bg: #030c17;
  --surface: rgba(5, 18, 33, 0.94);
  --surface-solid: #08182b;
  --sidebar: #06111e;
  --text: #defaff;
  --muted: #8cafc3;
  --line: #224258;
  --green: #66e9ed;
  --lime: #66e9ed;
  --green-soft: #10353f;
  --orange: #aeacff;
  --secondary: #aeacff;
  --game-empty: #0a2a3b;
}
[data-theme="ember"] {
  --bg: #110805;
  --surface: rgba(26, 15, 10, 0.94);
  --surface-solid: #1c100b;
  --sidebar: #170c08;
  --text: #fff0e0;
  --muted: #c0a391;
  --line: #573521;
  --green: #ffb06d;
  --lime: #ffb06d;
  --green-soft: #492715;
  --orange: #ffd787;
  --secondary: #ffd787;
  --game-empty: #352014;
}
[data-theme="blueprint"] {
  --bg: #071322;
  --surface: rgba(10, 27, 47, 0.94);
  --surface-solid: #0c1e34;
  --sidebar: #09182a;
  --text: #e8f4ff;
  --muted: #9fb6ce;
  --line: #2c4f70;
  --green: #a8d6ff;
  --lime: #a8d6ff;
  --green-soft: #203f5b;
  --orange: #ffe4a0;
  --secondary: #ffe4a0;
  --game-empty: #142f4b;
}
.preview-aurora {
  background:
    radial-gradient(ellipse at 30% 30%, #52eaa066, transparent 60%),
    radial-gradient(ellipse at 70% 10%, #a85cef66, transparent 55%), #041019;
}
.preview-aurora:after {
  content: "";
  position: absolute;
  inset: 15% 0 20%;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    #88ffa61b 2px,
    transparent 5px
  );
  transform: skewY(-15deg);
  filter: blur(2px);
}
.preview-abyss {
  background: radial-gradient(ellipse at 65% 35%, #214d78, #040f1b 70%);
}
.preview-abyss i {
  position: absolute;
  width: 40px;
  height: 22px;
  top: 35%;
  left: 35%;
  border-radius: 50% 50% 30% 30%;
  border: 1px solid #69e4eb;
  box-shadow: 0 0 20px #62cddd44;
}
.preview-abyss i:after {
  content: "";
  position: absolute;
  top: 100%;
  left: 20%;
  width: 60%;
  height: 30px;
  border-left: 1px solid #69e4eb88;
  border-right: 1px solid #69e4eb88;
  transform: skewX(10deg);
}
.preview-abyss i:nth-child(2) {
  left: 65%;
  top: 50%;
  transform: scale(0.65);
}
.preview-abyss i:nth-child(3) {
  left: 12%;
  top: 20%;
  transform: scale(0.5);
}
.preview-ember {
  background: radial-gradient(ellipse at bottom, #872b0e, #170b06 65%);
}
.preview-ember:after {
  content: "";
  position: absolute;
  left: 35%;
  top: 20%;
  height: 90%;
  width: 10px;
  background: #ff802d;
  box-shadow: 0 0 20px #ff6324;
  transform: rotate(30deg);
  clip-path: polygon(
    40% 0,
    100% 20%,
    50% 40%,
    100% 60%,
    30% 80%,
    100% 100%,
    0 100%,
    0 70%,
    50% 55%,
    0 35%
  );
}
.preview-blueprint {
  background:
    linear-gradient(#7faad41c 1px, transparent 1px),
    linear-gradient(90deg, #7faad41c 1px, transparent 1px), #0b2038;
  background-size: 14px 14px;
}
.preview-blueprint i {
  position: absolute;
  border: 2px dashed #9ed3ff88;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  top: 20%;
  left: 40%;
}
.preview-blueprint i:after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid #9ed3ff88;
  border-radius: 50%;
}
.preview-blueprint i:nth-child(2) {
  left: 65%;
  top: 40%;
  width: 40px;
  height: 40px;
}
.preview-blueprint i:nth-child(3) {
  left: 22%;
  top: 45%;
  width: 35px;
  height: 35px;
}
.game-result {
  margin: 14px 0;
  padding: 24px;
  border: 1px solid var(--green);
  background: var(--green-soft);
  animation: result-in 0.3s ease-out;
  position: relative;
}
.game-result[hidden] {
  display: none;
}
.game-result[data-outcome="loss"] {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 9%, var(--surface-solid));
}
.game-result h2 {
  font-size: 28px;
  color: var(--green);
  margin: 8px 0 14px;
}
.game-result[data-outcome="loss"] h2 {
  color: var(--danger);
}
.game-result p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 18px;
}
.game-result .game-actions {
  margin: 0;
}
.game-result .eyebrow {
  font-size: 9px;
}
.tetris-overlay {
  pointer-events: none;
  z-index: 2;
}
.tetris-overlay strong {
  font-size: clamp(22px, 4vw, 34px);
}
.snake-board {
  aspect-ratio: 1;
  width: 100%;
  display: block;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  touch-action: none;
}
.mine-board {
  display: grid;
  grid-template-columns: repeat(var(--mine-size), minmax(0, 1fr));
  gap: 3px;
  max-width: 480px;
  aspect-ratio: 1;
  margin-inline: auto;
}
.mine-cell {
  font:
    600 clamp(12px, 3vw, 18px) "IBM Plex Mono",
    monospace;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--game-empty);
  color: var(--text);
  cursor: pointer;
  aspect-ratio: 1;
}
.mine-cell.revealed {
  background: var(--surface-solid);
  border-color: color-mix(in srgb, var(--line) 40%, transparent);
}
.mine-cell[data-count="1"] {
  color: #76cbff;
}
.mine-cell[data-count="2"] {
  color: #95e0a7;
}
.mine-cell[data-count="3"] {
  color: #ffa58e;
}
.mine-cell[data-count="4"] {
  color: #c9a2ff;
}
.mine-cell.flagged {
  color: var(--secondary);
}
.mine-cell.exploded {
  background: #9f2639;
  color: #fff;
}
.arcade-extra {
  display: grid;
  place-items: center;
  min-height: 180px;
  font-size: 88px;
  color: var(--green);
  background: radial-gradient(ellipse, var(--green-soft), var(--surface-solid));
}
.arcade-snakes {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 25px 25px;
}
.arcade-mines {
  color: var(--secondary);
}
@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 861px) and (max-width: 1180px) {
  .nav {
    gap: 2px;
  }
  .nav a {
    font-size: 9px;
    padding: 7px 5px;
  }
  .nav .count {
    display: none;
  }
  .sidebar {
    gap: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-result {
    animation: none;
  }
}

[data-theme="aurora"] #matrix-rain,
[data-theme="abyss"] #matrix-rain,
[data-theme="ember"] #matrix-rain,
[data-theme="blueprint"] #matrix-rain {
  opacity: 0.9;
}
