 /* Futuristic neon grid theme */
 :root {
   --bg: #020311;
   --bg-soft: #05091d;
   --grid: #00f5ff;
   --accent: #ff3bff;
   --accent-soft: rgba(255, 59, 255, 0.25);
   --text: #e6f9ff;
   --muted: #8aa2b8;
   --border-glow: rgba(0, 245, 255, 0.55);
   --panel-bg: rgba(4, 10, 32, 0.9);
 }

 body.grid-body.theme-red {
  --grid: #ff4d4d;
  --accent: #ff9b3b;
  --accent-soft: rgba(255, 77, 77, 0.25);
  --text: #ffeef0;
  --muted: #f0a0a8;
  --border-glow: rgba(255, 77, 77, 0.65);
  --panel-bg: rgba(40, 4, 4, 0.9);
  background:
    radial-gradient(circle at top, rgba(255, 77, 77, 0.25) 0, transparent 60%),
    radial-gradient(circle at bottom, rgba(255, 180, 0, 0.2) 0, transparent 55%),
    linear-gradient(180deg, #150104 0, #200106 40%, #120002 100%);
}

body.grid-body.theme-dark-red {
  --grid: #ff1a40;
  --accent: #ff6a00;
  --accent-soft: rgba(255, 26, 64, 0.26);
  --text: #ffe6ea;
  --muted: #f5a0aa;
  --border-glow: rgba(255, 26, 64, 0.8);
  --panel-bg: rgba(24, 2, 6, 0.96);
  background:
    radial-gradient(circle at top, rgba(255, 26, 64, 0.32) 0, transparent 60%),
    radial-gradient(circle at bottom, rgba(255, 100, 0, 0.3) 0, transparent 55%),
    linear-gradient(180deg, #080005 0, #160008 40%, #050003 100%);
}

body.grid-body.theme-dark-yellow {
  --grid: #ffd233;
  --accent: #ff9b3b;
  --accent-soft: rgba(255, 210, 51, 0.28);
  --text: #fff7e6;
  --muted: #f0d29a;
  --border-glow: rgba(255, 210, 51, 0.85);
  --panel-bg: rgba(32, 22, 4, 0.95);
  background:
    radial-gradient(circle at top, rgba(255, 210, 51, 0.3) 0, transparent 60%),
    radial-gradient(circle at bottom, rgba(255, 140, 0, 0.28) 0, transparent 55%),
    linear-gradient(180deg, #120a01 0, #1f1401 40%, #100800 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.grid-body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top, rgba(0, 245, 255, 0.15) 0, transparent 60%),
    radial-gradient(circle at bottom, rgba(255, 59, 255, 0.15) 0, transparent 55%),
    linear-gradient(180deg, #020311 0, #020311 40%, #020108 100%);
  position: relative;
  overflow-x: hidden;
}

body.grid-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 245, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px, 40px 40px;
  opacity: 0.7;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: grid-scroll 40s linear infinite;
}

@keyframes grid-scroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-40px, -40px, 0); }
}

.site-header,
.site-footer {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.9), rgba(9, 18, 56, 0.95));
  border-bottom: 1px solid var(--border-glow);
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.35);
  position: relative;
  z-index: 2;
}

.site-footer {
  border-top: 1px solid var(--border-glow);
  border-bottom: none;
  justify-content: center;
  box-shadow: 0 -4px 16px rgba(0, 245, 255, 0.15);
}

.site-footer a {
  color: var(--grid);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-header {
  justify-content: flex-start;
}

.main-nav {
  display: flex;
  align-items: center;
  margin-left: 2.5rem;
}

@media (max-width: 640px) {
  .site-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .logo {
    margin-bottom: 0.4rem;
  }

  .main-nav {
    margin-left: 0;
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }

  .main-nav > a {
    margin-left: 0.75rem;
    font-size: 0.8rem;
  }

  .nav-more {
    margin-left: 0.75rem;
  }
}

.logo {
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--grid);
  text-transform: uppercase;
  font-size: 0.95rem;
  text-shadow: 0 0 12px rgba(0, 245, 255, 0.9);
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  box-shadow:
    0 0 8px rgba(255, 59, 255, 0.7),
    0 0 14px rgba(0, 245, 255, 0.4);
  background: rgba(5, 9, 29, 0.9);
}

.logo-badge:hover {
  color: var(--grid);
  border-color: var(--grid);
}

.main-nav > a {
  color: var(--text);
  text-decoration: none;
  margin-left: 1.1rem;
  font-size: 0.92rem;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.main-nav > a:first-child {
  margin-left: 0;
}

.main-nav > .nav-more > a {
  color: var(--text);
  text-decoration: none;
  margin-left: 0;
  font-size: 0.92rem;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.main-nav > a::before,
.main-nav > .nav-more > a::before {
  content: '';
  position: absolute;
  left: -0.9rem;
  top: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 2px;
  border: 1px solid var(--grid);
  box-shadow:
    0 0 6px rgba(0, 245, 255, 0.8),
    0 0 10px rgba(255, 59, 255, 0.5);
  transform: translateY(-50%) rotate(45deg);
}

.main-nav > a::after,
.main-nav > .nav-more > a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--grid), var(--accent));
  box-shadow: 0 0 10px var(--accent-soft);
  transition: width 0.18s ease-out;
}

.main-nav > a:hover::after,
.main-nav > .nav-more > a:hover::after {
  width: 100%;
}

.site-main {
  flex: 1;
  padding: 1.75rem 1rem 2.25rem;
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
}

/* Admin console layout tweaks */
body.grid-body.admin-body {
  max-width: 1120px;
  margin: 0 auto;
}

.admin-body .site-header {
  border-bottom-color: rgba(0, 245, 255, 0.8);
  box-shadow:
    0 0 18px rgba(0, 245, 255, 0.5),
    0 0 30px rgba(255, 59, 255, 0.35);
}

.admin-body .logo {
  letter-spacing: 0.24em;
  font-size: 0.9rem;
}

.admin-body .main-nav > a {
  font-size: 0.82rem;
  opacity: 0.9;
}

.admin-body .main-nav > a.is-active {
  color: var(--grid);
}

.admin-body .main-nav > a.is-active::after {
  width: 100%;
}

.admin-body .hero {
  margin-bottom: 1.4rem;
}

.admin-body .grid-panels .panel {
  border-radius: 12px;
}

.admin-body .admin-quick-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-body .admin-quick-actions .btn-play {
  font-size: 0.75rem;
  padding: 0.3rem 0.9rem;
}

.admin-body .admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-body .admin-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(0, 245, 255, 0.25);
  font-size: 0.85rem;
}

.admin-body .admin-list li:last-child {
  border-bottom: none;
}

.admin-body .admin-list strong {
  display: block;
  margin-bottom: 0.1rem;
}

.admin-body .admin-list small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.boot-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.96), rgba(0, 8, 4, 0.98));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 40;
  transition: opacity 0.22s ease-out, visibility 0.22s ease-out;
}

.boot-modal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.grid-toast {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%) translateY(8px);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.18), rgba(2, 5, 18, 0.96));
  border: 1px solid rgba(0, 245, 255, 0.8);
  color: var(--text);
  box-shadow:
    0 0 12px rgba(0, 245, 255, 0.8),
    0 0 22px rgba(255, 59, 255, 0.55);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

.grid-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.boot-window {
  width: min(640px, 90vw);
  max-height: 70vh;
  background: linear-gradient(180deg, #020806, #020f08);
  border: 1px solid rgba(0, 255, 128, 0.7);
  box-shadow:
    0 0 26px rgba(0, 255, 128, 0.6),
    0 0 40px rgba(0, 245, 255, 0.3);
  border-radius: 8px;
  padding: 0.85rem 1.1rem 0.9rem;
  display: flex;
  flex-direction: column;
}

.boot-header {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #9fffb5;
  border-bottom: 1px solid rgba(0, 255, 128, 0.5);
  padding-bottom: 0.4rem;
  margin-bottom: 0.6rem;
}

.boot-body {
  flex: 1;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.84rem;
  line-height: 1.4;
  color: #9fffb5;
  white-space: pre-wrap;
  background: radial-gradient(circle at top left, rgba(0, 255, 128, 0.12), transparent 60%);
  padding: 0.4rem 0.2rem 0.2rem;
  overflow-y: auto;
}

.boot-close {
  align-self: flex-end;
  margin-top: 0.7rem;
  font-size: 0.78rem;
  padding: 0.3rem 0.85rem;
}

.hero {
  text-align: center;
  margin-bottom: 1.75rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(220px, 60vw);
  height: min(220px, 60vw);
  border-radius: 50%;
  border: 1px solid rgba(0, 245, 255, 0.35);
  box-shadow:
    0 0 40px rgba(0, 245, 255, 0.25),
    0 0 80px rgba(255, 59, 255, 0.2);
  transform: translate(-50%, -50%);
  opacity: 0.18;
  pointer-events: none;
  z-index: -1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  text-shadow:
    0 0 10px rgba(0, 245, 255, 0.8),
    0 0 26px rgba(255, 59, 255, 0.7);
  margin-bottom: 0.6rem;
}

.hero p {
  max-width: 44rem;
  margin: 0 auto;
  opacity: 0.9;
  color: var(--muted);
}

.hero-actions {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.hero-meta {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.hero.hero--ops {
  text-align: left;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
}

.hero.hero--ops::before {
  width: min(160px, 46vw);
  height: min(160px, 46vw);
  opacity: 0.12;
}

.hero.hero--ops h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  text-shadow:
    0 0 10px rgba(0, 245, 255, 0.75),
    0 0 20px rgba(0, 245, 255, 0.55);
}

.hero.hero--ops p {
  max-width: 40rem;
}

.hero-meta a {
  color: var(--grid);
  text-decoration: none;
}

.hero-meta a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.hero-broadcast-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 255, 0.5);
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.15), transparent 60%),
              radial-gradient(circle at bottom right, rgba(255, 59, 255, 0.12), transparent 60%),
              rgba(0, 4, 20, 0.9);
}

.hero-broadcast-strip a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
}

.hero-broadcast-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--grid);
}

.hero-broadcast-message {
  font-size: 0.8rem;
  color: var(--text);
}

.hero-tag-info {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 245, 255, 0.35);
  background:
    radial-gradient(circle at top left, rgba(0, 245, 255, 0.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(255, 59, 255, 0.14), transparent 55%),
    rgba(0, 4, 20, 0.92);
  box-shadow:
    0 0 14px rgba(0, 245, 255, 0.28),
    0 0 26px rgba(255, 59, 255, 0.2);
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.hero-tag-info .hero-meta {
  margin-top: 0.35rem;
}

.hero-tag-info .hero-meta:first-child {
  margin-top: 0;
}

.grid-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.grid-panels + .grid-panels {
  margin-top: 1.5rem;
}

/* Leaderboards layout: prefer two wider panels per row on larger screens */
.grid-panels-leaderboards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 800px) {
  .grid-panels-leaderboards {
    grid-template-columns: 1fr;
  }
}

.grid-panels .panel {
  border: 1px solid var(--border-glow);
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.28), transparent 55%),
              radial-gradient(circle at bottom right, rgba(255, 59, 255, 0.24), transparent 55%),
              var(--panel-bg);
  padding: 1.1rem 1.1rem 1.25rem;
  border-radius: 10px;
  box-shadow:
    0 0 20px rgba(0, 245, 255, 0.22),
    0 0 35px rgba(255, 59, 255, 0.18);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transform: translateY(0) translateZ(0);
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out,
    background-position 0.3s ease-out;
  position: relative;
}

.panel-with-icon {
  padding-top: 1.4rem;
}

.panel-with-icon::before {
  content: '';
  display: block;
  margin: 0 auto 0.8rem;
  width: 3.5rem;
  height: 3.5rem;
  opacity: 0.85;
  pointer-events: none;
}

/* Retro hacker-style console panel */
.panel-console {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 255, 128, 0.08) 0,
      rgba(0, 255, 128, 0.08) 1px,
      transparent 1px,
      transparent 3px
    ),
    linear-gradient(180deg, rgba(0, 0, 0, 0.96), rgba(3, 18, 10, 0.98));
  border-color: rgba(0, 255, 128, 0.7);
  box-shadow:
    0 0 18px rgba(0, 255, 128, 0.55),
    0 0 32px rgba(0, 245, 255, 0.25);
}

.panel-console,
.panel-console p,
.panel-console li {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  color: #9fffb5;
}

.panel-console strong {
  color: #e7ffe7;
}

.panel-console ul {
  list-style: none;
  padding-left: 0;
}

.panel-console li {
  position: relative;
  padding-left: 1.2rem;
}

.panel-console li::before {
  content: '> ';
  position: absolute;
  left: 0;
  color: #5cf59a;
}

/* Pulse icon for telemetry/analytics */
.panel-with-icon[data-icon="pulse"]::before {
  border-radius: 50%;
  border: 3px solid var(--grid);
  box-shadow:
    0 0 20px rgba(0, 245, 255, 0.9),
    0 0 35px rgba(255, 59, 255, 0.7),
    inset 0 0 15px rgba(0, 245, 255, 0.5);
  animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% {
    transform: scale(1);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* Lightcycle icon - horizontal bars */
.panel-with-icon[data-icon="lightcycle"]::before {
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 20%,
    var(--grid) 20%,
    var(--grid) 30%,
    transparent 30%,
    transparent 45%,
    var(--accent) 45%,
    var(--accent) 55%,
    transparent 55%,
    transparent 70%,
    var(--grid) 70%,
    var(--grid) 80%,
    transparent 80%
  );
  box-shadow:
    0 0 20px rgba(0, 245, 255, 0.8),
    0 0 30px rgba(255, 59, 255, 0.6);
  border-radius: 4px;
}

/* Grid icon - 3x3 grid pattern */
.panel-with-icon[data-icon="grid"]::before {
  background-image:
    linear-gradient(var(--grid) 2px, transparent 2px),
    linear-gradient(90deg, var(--grid) 2px, transparent 2px);
  background-size: 33.33% 33.33%;
  border: 2px solid var(--accent);
  border-radius: 6px;
  box-shadow:
    0 0 20px rgba(0, 245, 255, 0.8),
    0 0 30px rgba(255, 59, 255, 0.6);
}

/* Grid Lab controls */
.lab-controls {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.lab-control label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #9fffb5;
}

.lab-control span {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.lab-control input[type="range"] {
  width: 100%;
  margin-top: 0.2rem;
}

.lab-output {
  margin-top: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  border: 1px dashed rgba(0, 255, 128, 0.6);
  background: rgba(0, 8, 4, 0.7);
}

.lab-output h3 {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.lab-output p {
  font-size: 0.8rem;
  color: #9fffb5;
}

/* Grid Shell console */
.shell-window {
  margin-top: 0.6rem;
  padding: 0.7rem 0.8rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 128, 0.7);
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 0 18px rgba(0, 255, 160, 0.35);
}

.shell-output {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.8rem;
  color: #9fffb5;
  min-height: 6rem;
  max-height: 12rem;
  overflow-y: auto;
  white-space: pre-wrap;
  text-shadow: 0 0 6px rgba(0, 255, 160, 0.45);
}

.shell-line {
  line-height: 1.35;
}

.shell-input-row {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.shell-prompt {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  color: #5cf59a;
}

.shell-input {
  flex: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 255, 128, 0.6);
  background: rgba(0, 10, 5, 0.9);
  color: #e7ffe7;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.8rem;
}

.shell-input:focus {
  outline: none;
  box-shadow: 0 0 8px rgba(0, 255, 128, 0.8);
}

.shell-hint {
  margin-top: 0.35rem;
}

.lab-game {
  margin-top: 0.9rem;
}

.lab-game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  max-width: 18rem;
  margin: 0.25rem auto 0;
}

.lab-game-controls .btn-play.btn-small {
  padding: 0.35rem 0.85rem;
  font-size: 0.7rem;
  margin-top: 0; /* override global btn margin to keep row aligned */
  text-align: center;
}

.lab-game-controls .btn-play.btn-small::before,
.lab-game-controls .btn-play.btn-small::after {
  display: none;
}

.lab-game-controls .btn-play.is-active {
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.55), rgba(0, 20, 40, 0.98));
}

/* Evolve icon - concentric circles */
.panel-with-icon[data-icon="evolve"]::before {
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 30%, var(--grid) 30%, var(--grid) 35%, transparent 35%),
    radial-gradient(circle at center, transparent 55%, var(--accent) 55%, var(--accent) 60%, transparent 60%),
    radial-gradient(circle at center, transparent 80%, var(--grid) 80%, var(--grid) 85%, transparent 85%);
  box-shadow:
    0 0 20px rgba(0, 245, 255, 0.8),
    0 0 30px rgba(255, 59, 255, 0.6);
}

/* Forum icon - speech bubble */
.panel-with-icon[data-icon="forum"]::before {
  border: 3px solid var(--grid);
  border-radius: 8px;
  box-shadow:
    0 0 20px rgba(0, 245, 255, 0.8),
    0 0 30px rgba(255, 59, 255, 0.6);
}

.panel-with-icon[data-icon="forum"]::after {
  content: '';
  position: absolute;
  top: 3.8rem;
  left: calc(50% - 0.6rem);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.7rem 0.6rem 0 0.6rem;
  border-color: var(--grid) transparent transparent transparent;
  filter: drop-shadow(0 0 8px rgba(0, 245, 255, 0.8));
  z-index: 1;
}

/* Feedback icon - star burst */
.panel-with-icon[data-icon="feedback"]::before {
  background:
    linear-gradient(45deg, transparent 45%, var(--accent) 45%, var(--accent) 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, var(--accent) 45%, var(--accent) 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, var(--grid) 45%, var(--grid) 55%, transparent 55%),
    linear-gradient(90deg, transparent 45%, var(--grid) 45%, var(--grid) 55%, transparent 55%);
  border-radius: 50%;
  box-shadow:
    0 0 20px rgba(0, 245, 255, 0.8),
    0 0 30px rgba(255, 59, 255, 0.6);
}

/* News icon - document with lines */
.panel-with-icon[data-icon="news"]::before {
  border: 3px solid var(--grid);
  border-radius: 4px;
  background:
    linear-gradient(var(--accent) 2px, transparent 2px) 0.5rem 0.8rem / 2.5rem 0.4rem no-repeat,
    linear-gradient(var(--grid) 2px, transparent 2px) 0.5rem 1.5rem / 2.5rem 0.4rem no-repeat,
    linear-gradient(var(--grid) 2px, transparent 2px) 0.5rem 2.2rem / 2.5rem 0.4rem no-repeat;
  box-shadow:
    0 0 20px rgba(0, 245, 255, 0.8),
    0 0 30px rgba(255, 59, 255, 0.6);
}

.grid-panels .panel h2,
.grid-panels .panel h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-left: 0;
}

.panel-with-icon h2,
.panel-with-icon h3 {
  padding-left: 0;
  text-align: center;
}

.game-device-row {
  margin-top: 0.15rem;
  margin-bottom: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.7rem;
}

.device-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 255, 0.5);
  background: rgba(0, 5, 20, 0.95);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.device-badge::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--grid), var(--accent));
  box-shadow:
    0 0 6px rgba(0, 245, 255, 0.9),
    0 0 10px rgba(255, 59, 255, 0.7);
}

.device-badge--desktop {
  border-color: rgba(0, 245, 255, 0.7);
}

.device-badge--mobile {
  border-color: rgba(255, 59, 255, 0.8);
}

.grid-panels .panel p {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--text);
}

.panel-metric {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted);
  position: relative;
  padding-left: 0.9rem;
}

.panel-metric::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.6rem;
  height: 0.16rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--grid), var(--accent));
  box-shadow:
    0 0 6px rgba(0, 245, 255, 0.8),
    0 0 10px rgba(255, 59, 255, 0.7);
  transform: translateY(-50%);
}

.grid-panels .panel ul {
  list-style: none;
  margin-top: 0.35rem;
}

.grid-panels .panel li + li {
  margin-top: 0.4rem;
}

.grid-panels .panel ul li {
  position: relative;
  padding-left: 1.1rem;
}

.grid-panels .panel ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 245, 255, 0.9);
  box-shadow:
    0 0 6px rgba(0, 245, 255, 0.9),
    0 0 10px rgba(255, 59, 255, 0.7);
}

.whatsnew-list {
  list-style: none;
  margin-top: 0.4rem;
  padding-left: 0;
}

.whatsnew-item {
  padding: 0.55rem 0;
  border-top: 1px solid rgba(0, 245, 255, 0.25);
}

.whatsnew-item:first-child {
  border-top: none;
}

.whatsnew-item h3 {
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0.02em;
  margin-bottom: 0.2rem;
}

.whatsnew-item .hero-meta {
  margin-top: 0;
  margin-bottom: 0.35rem;
}

.identity-quiz {
  margin-top: 0.75rem;
  text-align: left;
}

.identity-question {
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.identity-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.identity-option-btn {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 0.85rem;
}

.identity-option-btn::before,
.identity-option-btn::after {
  display: none;
}

#identity-skip::before,
#identity-skip::after,
#identity-reset::before,
#identity-reset::after {
  display: none;
}

.identity-role-active {
  color: var(--accent);
}

.identity-role-active strong {
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.7);
}

.grid-panels .panel:hover {
  transform: translateY(-4px);
  box-shadow:
    0 0 26px rgba(0, 245, 255, 0.55),
    0 0 40px rgba(255, 59, 255, 0.45);
  border-color: rgba(0, 245, 255, 0.9);
}

.operator-program {
  margin-top: 0.75rem;
}

.operator-track-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.operator-tab {
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 255, 0.4);
  background: rgba(2, 8, 24, 0.9);
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.operator-tab.is-active {
  color: var(--text);
  border-color: var(--border-glow);
  box-shadow:
    0 0 10px rgba(0, 245, 255, 0.55),
    0 0 18px rgba(255, 59, 255, 0.4);
}

.operator-track-body h3 {
  font-size: 0.98rem;
  margin-bottom: 0.15rem;
}

.operator-track-body .hero-meta {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.operator-task-list {
  list-style: none;
  padding-left: 0;
  margin: 0 0 0.5rem;
}

.operator-task {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-top: 1px solid rgba(0, 245, 255, 0.18);
}

.operator-task:first-child {
  border-top: none;
}

.operator-task-label {
  font-size: 0.82rem;
}

.operator-task.is-complete .operator-task-label {
  color: var(--accent);
}

.operator-task-meta {
  margin-left: auto;
}

.operator-task-toggle {
  font-size: 0.7rem;
  padding: 0.18rem 0.7rem;
  margin-top: 0;
}

.operator-rank-bar {
  position: relative;
  margin: 0.55rem 0 0.75rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(0, 245, 255, 0.18);
  overflow: hidden;
}

.operator-rank-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg, var(--grid), var(--accent));
  box-shadow:
    0 0 10px rgba(0, 245, 255, 0.7),
    0 0 16px rgba(255, 59, 255, 0.6);
}

.operator-rank-legend {
  list-style: none;
  margin-top: 0.4rem;
}

.operator-rank-legend li + li {
  margin-top: 0.35rem;
}

.oracle-root {
  margin-top: 0.75rem;
}

.oracle-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.oracle-card {
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.12), rgba(0, 8, 24, 0.95));
  border: 1px solid rgba(0, 245, 255, 0.45);
  box-shadow:
    0 0 14px rgba(0, 245, 255, 0.35),
    0 0 22px rgba(255, 59, 255, 0.25);
}

.oracle-card-title {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.oracle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.oracle-actions .btn-play.btn-small {
  margin-top: 0;
}

#oracle-spin::before,
#oracle-spin::after,
#oracle-repeat::before,
#oracle-repeat::after {
  display: none;
}

.oracle-history-list {
  list-style: none;
  margin-top: 0.4rem;
  padding-left: 0;
}

.oracle-history-list li {
  font-size: 0.8rem;
  padding: 0.3rem 0;
  border-top: 1px solid rgba(0, 245, 255, 0.18);
}

.oracle-history-list li:first-child {
  border-top: none;
}

.switchboard-root {
  margin-top: 0.75rem;
  text-align: center;
}

.switchboard-grid {
  display: inline-block;
  padding: 0.4rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 245, 255, 0.4);
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.18), rgba(0, 5, 20, 0.95));
  box-shadow:
    0 0 16px rgba(0, 245, 255, 0.4),
    0 0 26px rgba(255, 59, 255, 0.35);
}

.switchboard-root.is-solved .switchboard-grid {
  box-shadow:
    0 0 22px rgba(0, 245, 255, 0.8),
    0 0 32px rgba(255, 59, 255, 0.75);
}

.switchboard-row {
  display: flex;
}

.switch-cell {
  width: 2.1rem;
  height: 2.1rem;
  margin: 0.18rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 245, 255, 0.35);
  background: radial-gradient(circle at center, rgba(0, 245, 255, 0.08), rgba(0, 8, 24, 0.95));
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.35);
}

.switch-cell.is-on {
  border-color: rgba(0, 245, 255, 0.9);
  color: var(--text);
  background: radial-gradient(circle at center, rgba(0, 245, 255, 0.4), rgba(0, 12, 36, 0.98));
  box-shadow:
    0 0 16px rgba(0, 245, 255, 0.9),
    0 0 26px rgba(255, 59, 255, 0.7);
}

.switchboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.switchboard-actions .btn-play.btn-small {
  margin-top: 0;
}

#switchboard-randomise::before,
#switchboard-randomise::after,
#switchboard-reset::before,
#switchboard-reset::after {
  display: none;
}

.memory-root {
  margin-top: 0.75rem;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(2.4rem, 3rem));
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.25rem;
}

.memory-pad {
  width: 3rem;
  height: 3rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 245, 255, 0.4);
  background: radial-gradient(circle at center, rgba(0, 245, 255, 0.12), rgba(0, 7, 22, 0.96));
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.4);
  padding: 0;
}

.memory-pad.is-lit {
  border-color: rgba(0, 245, 255, 0.95);
  box-shadow:
    0 0 18px rgba(0, 245, 255, 0.9),
    0 0 26px rgba(255, 59, 255, 0.75);
  background: radial-gradient(circle at center, rgba(0, 245, 255, 0.5), rgba(0, 10, 30, 0.98));
}

.memory-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.pips-root {
  margin-top: 0.75rem;
  text-align: center;
}

.pips-grid {
  display: inline-block;
  padding: 0.4rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 245, 255, 0.4);
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.16), rgba(0, 6, 20, 0.96));
  box-shadow:
    0 0 16px rgba(0, 245, 255, 0.4),
    0 0 26px rgba(255, 59, 255, 0.35);
}

.pips-row {
  display: flex;
}

.pips-cell {
  width: 1.9rem;
  height: 1.9rem;
  margin: 0.16rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 245, 255, 0.35);
  background: radial-gradient(circle at center, rgba(0, 245, 255, 0.08), rgba(0, 8, 24, 0.95));
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.35);
}

.pips-cell.is-on {
  border-color: rgba(0, 245, 255, 0.95);
  color: var(--text);
  background: radial-gradient(circle at center, rgba(0, 245, 255, 0.4), rgba(0, 12, 32, 0.98));
  box-shadow:
    0 0 16px rgba(0, 245, 255, 0.9),
    0 0 24px rgba(255, 59, 255, 0.7);
}

.pips-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.pips-actions .btn-play.btn-small {
  margin-top: 0;
}

.ricochet-root {
  margin-top: 0.75rem;
}

.ricochet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.6rem;
  align-items: center;
}

.ricochet-angles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.flight-root {
  margin-top: 0.75rem;
}

.flight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.6rem;
  align-items: center;
}

.flight-hint {
  font-size: 0.76rem;
  color: var(--muted);
}

.rituals-root {
  margin-top: 0.75rem;
}

.rituals-row {
  margin-top: 0.6rem;
}

.rituals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.rituals-column h3 {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.rituals-field span {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.rituals-checkbox {
  display: block;
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: 0;
}

.rituals-checkbox input[type="checkbox"] {
  margin-right: 0.45rem;
}

.rituals-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

/* Nav dropdown for secondary links */
.nav-more {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 1.1rem;
}

.nav-more-toggle {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.15rem 0.75rem;
  cursor: pointer;
}

.nav-more-menu {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 10rem;
  background: rgba(1, 5, 18, 0.98);
  border-radius: 8px;
  border: 1px solid rgba(0, 245, 255, 0.5);
  box-shadow:
    0 0 18px rgba(0, 245, 255, 0.45),
    0 0 26px rgba(255, 59, 255, 0.4);
  padding: 0.3rem 0;
  display: none;
  z-index: 20;
}

.nav-more:hover .nav-more-menu,
.nav-more:focus-within .nav-more-menu {
  display: block;
}

.nav-more-menu a {
  display: block;
  padding: 0.35rem 0.9rem;
  white-space: nowrap;
}

.nav-more-menu a {
  margin-left: 0;
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: 0.06em;
  color: var(--text);
}

.nav-more-menu a::before,
.nav-more-menu a::after {
  display: none;
}

.nav-more-menu a:hover {
  background: rgba(5, 18, 40, 0.95);
  color: var(--grid);
}

/* Buttons */
button,
.btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  margin-top: 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border-glow);
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.35), rgba(0, 15, 35, 0.95));
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.5);
  transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, background 0.12s ease-out;
  position: relative;
}

.btn-play {
  padding-left: 1.9rem;
}

.btn-play::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 50%;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 245, 255, 0.9);
  box-shadow:
    0 0 8px rgba(0, 245, 255, 0.9),
    0 0 14px rgba(255, 59, 255, 0.7);
  transform: translateY(-50%);
}

.btn-play::after {
  content: '';
  position: absolute;
  left: 0.95rem;
  top: 50%;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0.18rem 0 0.18rem 0.26rem;
  border-color: transparent transparent transparent var(--grid);
  transform: translateY(-50%);
}

button:hover,
.btn-play:hover {
  transform: translateY(-1px);
  background: radial-gradient(circle at top, rgba(255, 59, 255, 0.4), rgba(0, 15, 35, 0.98));
  box-shadow:
    0 0 16px rgba(0, 245, 255, 0.7),
    0 0 24px rgba(255, 59, 255, 0.7);
}

button:active,
.btn-play:active {
  transform: translateY(0);
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.45);
}

/* Simple fade/slide for page sections (optional utility classes) */
.fade-in-up {
  opacity: 0;
  transform: translateY(8px);
  animation: fadeInUp 0.4s ease-out forwards;
}

.fade-in-delay {
  animation-delay: 0.15s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Forms */
label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.5rem;
  margin-bottom: 0.15rem;
  color: var(--muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 245, 255, 0.4);
  background: rgba(0, 5, 20, 0.95);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  box-shadow: inset 0 0 8px rgba(0, 245, 255, 0.25);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px rgba(0, 245, 255, 0.7),
    0 0 16px rgba(255, 59, 255, 0.35);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Links in panels */
.grid-panels .panel a {
  color: var(--grid);
  text-decoration: none;
}

.grid-panels .panel a:hover {
  text-decoration: underline;
}

.flash-message {
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.flash-error {
  color: #ff8080;
}

.flash-success {
  color: #00ffa6;
}

.panel-back-link {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .main-nav {
    margin-top: 0.2rem;
    margin-left: 0;
  }
}

.grid-logic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  max-width: 210px;
  margin: 0.2rem auto 0;
}

.grid-logic-cell {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  border: 1px solid rgba(0, 245, 255, 0.5);
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.25), rgba(0, 5, 20, 0.95));
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.25);
  transition: background 0.15s ease-out, box-shadow 0.15s ease-out, transform 0.1s ease-out;
}

.grid-logic-cell.active {
  background: radial-gradient(circle at center, rgba(255, 59, 255, 0.7), rgba(0, 5, 20, 0.95));
  box-shadow:
    0 0 16px rgba(0, 245, 255, 0.7),
    0 0 26px rgba(255, 59, 255, 0.7);
  transform: translateY(-1px);
}

.grid-logic-cell:focus {
  outline: none;
  box-shadow:
    0 0 0 1px rgba(0, 245, 255, 0.8),
    0 0 16px rgba(255, 59, 255, 0.4);
}

/* Override global button hover so Grid Logic cells don't jump on hover,
   but keep the `.active` visual when the game lights them. */
.grid-logic-cell:hover,
.grid-logic-cell:active {
  transform: none;
}

.grid-logic-instructions {
  margin-top: 0.4rem;
  margin-bottom: 0.3rem;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.grid-logic-instructions li + li {
  margin-top: 0.15rem;
}

.grid-logic-modes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.grid-logic-mode {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 255, 0.6);
  background: rgba(0, 10, 32, 0.9);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.7rem;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 245, 255, 0.45);
  transition: background 0.12s ease-out, box-shadow 0.12s ease-out, transform 0.1s ease-out;
}

.grid-logic-mode.is-active {
  background: radial-gradient(circle at top, rgba(255, 59, 255, 0.45), rgba(0, 10, 32, 0.95));
  box-shadow:
    0 0 12px rgba(0, 245, 255, 0.7),
    0 0 18px rgba(255, 59, 255, 0.65);
}

/* Touch controls for games (shown primarily on mobile) */
.touch-controls {
  margin-top: 0.55rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.touch-controls-row {
  gap: 1.2rem;
}

.touch-controls-dpad {
  flex-direction: column;
}

.touch-row {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
}

.touch-btn {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--border-glow);
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.35), rgba(0, 15, 35, 0.95));
  color: var(--text);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.4);
}

.game-hint {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 801px) {
  .touch-controls {
    display: none;
  }
}

/* Admin analytics charts */
.analytics-chart {
  margin-top: 0.4rem;
}

.analytics-bar-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  font-size: 0.8rem;
}

.analytics-bar-label {
  flex: 0 0 38%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.analytics-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 10, 32, 0.9);
  box-shadow: inset 0 0 6px rgba(0, 245, 255, 0.45);
  overflow: hidden;
}

.analytics-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--grid), var(--accent));
  box-shadow:
    0 0 8px rgba(0, 245, 255, 0.7),
    0 0 12px rgba(255, 59, 255, 0.6);
}

.analytics-bar-value {
  min-width: 2.5rem;
  text-align: right;
  color: var(--text);
}

/* Leaderboard tables */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.6rem;
  font-size: 0.85rem;
}

.lb-table th,
.lb-table td {
  padding: 0.3rem 0.4rem;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lb-you-col,
.lb-you-cell {
  text-align: center;
  width: 4.25rem;
  white-space: nowrap;
}

/* Runs column: keep narrower so it doesnt dominate table width */
.lb-table th:nth-child(4),
.lb-table td:nth-child(4) {
  width: 7.5rem;
}

.lb-table thead th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(0, 245, 255, 0.4);
}

.lb-table tbody tr:nth-child(even) {
  background: rgba(0, 10, 32, 0.55);
}

.lb-table tbody tr:nth-child(odd) {
  background: rgba(0, 5, 20, 0.4);
}

.lb-table tbody tr:hover {
  background: rgba(0, 245, 255, 0.08);
}

.lb-you-chip {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--grid);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--grid);
  background: rgba(0, 5, 20, 0.95);
  box-shadow:
    0 0 6px rgba(0, 245, 255, 0.6),
    0 0 10px rgba(255, 59, 255, 0.4);
}

/* Achievements list */
.ach-list {
  list-style: none;
  margin-top: 0.4rem;
  padding-left: 0;
  font-size: 0.85rem;
}

.ach-list li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--muted);
  opacity: 0.55;
}

.ach-list li.ach-category {
  margin-top: 0.6rem;
  padding-left: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 1;
}

.ach-list li.ach-category::before {
  display: none;
}

.ach-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 245, 255, 0.3);
  box-shadow: 0 0 6px rgba(0, 245, 255, 0.25);
}

.ach-list li.is-unlocked {
  color: var(--text);
  opacity: 1;
}

.ach-list li.is-unlocked::before {
  border-color: var(--accent);
  background: radial-gradient(circle at center, var(--accent) 0, transparent 60%);
  box-shadow:
    0 0 10px rgba(255, 59, 255, 0.8),
    0 0 16px rgba(0, 245, 255, 0.7);
}

.activity-feed {
  margin-top: 0.4rem;
  padding: 0.5rem 0.6rem;
  max-height: 10rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 6px;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #9fffb5;
}

.activity-legend {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
}

#activity-panel[data-has-own-events="1"] {
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.45);
}

.lb-table tr.lb-own-tag {
  background: linear-gradient(90deg,
    rgba(0, 245, 255, 0.2),
    rgba(255, 59, 255, 0.16)
  );
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.35);
}

.lb-table tr.lb-own-tag td {
  font-weight: 600;
}

.session-recap {
  margin-top: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  background: rgba(0, 5, 20, 0.9);
  font-size: 0.8rem;
  color: var(--text);
}

.session-recap-main {
  font-weight: 600;
}

.session-recap-detail {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.session-recap-actions {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn-small {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
}

.btn-small::before,
.btn-small::after {
  display: none;
}

.btn-link {
  font-size: 0.78rem;
  color: var(--accent);
}

#activity-panel[data-has-own-events="1"] {
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.45);
}

/* Keyboard shortcuts overlay */
.hotkeys-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2, 3, 17, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.hotkeys-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.hotkeys-box {
  background: var(--panel-bg);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  max-width: 420px;
  box-shadow: 0 0 30px rgba(0, 245, 255, 0.5);
}

.hotkeys-box h2 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
  color: var(--grid);
}

.hotkeys-list {
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
}

.hotkeys-list kbd {
  background: rgba(0, 245, 255, 0.15);
  border: 1px solid var(--border-glow);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--grid);
}

.hotkeys-list span {
  color: var(--muted);
  font-size: 0.8rem;
}

.hotkeys-close {
  margin-top: 1rem;
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Nickname (player tag) dialog */
.nickname-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(2, 3, 17, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nickname-dialog-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.nickname-dialog {
  background: var(--panel-bg);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  padding: 1.2rem 1.4rem 1.3rem;
  width: calc(100% - 2rem);
  max-width: 360px;
  box-shadow: 0 0 28px rgba(0, 245, 255, 0.6);
}

.nickname-dialog h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--grid);
}

.nickname-dialog p {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.nickname-dialog-input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-glow);
  background: rgba(0, 0, 0, 0.85);
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.nickname-dialog-input:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--grid), 0 0 10px rgba(0, 245, 255, 0.6);
}

.nickname-dialog-hint {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.nickname-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Achievement unlock animation */
@keyframes badge-unlock {
  0% { transform: scale(1); box-shadow: none; }
  50% { transform: scale(1.15); box-shadow: 0 0 20px var(--grid); }
  100% { transform: scale(1); box-shadow: 0 0 8px var(--grid); }
}

.ach-list li.is-unlocked.just-unlocked {
  animation: badge-unlock 0.6s ease;
}

/* Meta progress bar */
.meta-progress {
  margin-top: 0.6rem;
  background: rgba(0, 10, 20, 0.7);
  border: 1px solid var(--border-glow);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
}

.meta-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--grid), var(--accent));
  transition: width 0.4s ease;
}

.meta-progress-label {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--muted);
}

/* Session timer */
.session-timer {
  font-size: 0.7rem;
  color: var(--muted);
  margin-left: 0.5rem;
}

/* Quick play buttons */
.quick-play-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.quick-play-btn {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid var(--border-glow);
  border-radius: 4px;
  color: var(--grid);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.quick-play-btn:hover {
  background: rgba(0, 245, 255, 0.25);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.4);
}

.quick-play-btn.is-last {
  border-color: var(--accent);
  color: var(--accent);
}

/* Grid Story Chain */
.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 0.8rem;
}

.story-list li {
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(0, 245, 255, 0.1);
}

.story-list li.is-own-line {
  background:
    radial-gradient(circle at left, rgba(0, 245, 255, 0.18), transparent 60%);
  border-bottom-color: rgba(0, 245, 255, 0.35);
}

.story-list li.is-own-line .story-meta {
  color: var(--grid);
}

.story-text {
  display: block;
  color: var(--text);
}

.story-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}

/* Glitch Node */
#glitch-node.is-glitching {
  box-shadow:
    0 0 24px rgba(255, 59, 255, 0.7),
    0 0 40px rgba(0, 245, 255, 0.6);
}

.glitch-text {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text);
}

/* Grid Broadcast */
.broadcast-message {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 0.95rem;
  background: rgba(0, 10, 20, 0.85);
  border: 1px solid var(--border-glow);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.broadcast-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.broadcast-item {
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(0, 245, 255, 0.08);
}

.broadcast-body {
  display: block;
}

.broadcast-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}

/* Pattern Buffer */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 0.6rem;
}

.pattern-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 245, 255, 0.4);
  background: rgba(0, 6, 22, 0.96);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.16s ease-out, box-shadow 0.16s ease-out, transform 0.12s ease-out;
}

.pattern-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.45);
}

.pattern-card.is-active {
  border-color: var(--accent);
  box-shadow:
    0 0 18px rgba(0, 245, 255, 0.7),
    0 0 26px rgba(255, 59, 255, 0.55);
}

.pattern-card-title {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.pattern-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.pattern-swatch-row {
  margin-top: 0.45rem;
  display: flex;
  gap: 0.25rem;
}

.pattern-swatch {
  width: 1.3rem;
  height: 0.75rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 245, 255, 0.4);
}

.pattern-card-green .pattern-swatch-bg {
  background: #020311;
}

.pattern-card-green .pattern-swatch-grid {
  background: #00f5ff;
}

.pattern-card-green .pattern-swatch-accent {
  background: #ff3bff;
}

.pattern-card-red .pattern-swatch-bg {
  background: #150104;
}

.pattern-card-red .pattern-swatch-grid {
  background: #ff4d4d;
}

.pattern-card-red .pattern-swatch-accent {
  background: #ff9b3b;
}

.pattern-card-dark-red .pattern-swatch-bg {
  background: #080005;
}

.pattern-card-dark-red .pattern-swatch-grid {
  background: #ff1a40;
}

.pattern-card-dark-red .pattern-swatch-accent {
  background: #ff6a00;
}

.pattern-card-dark-yellow .pattern-swatch-bg {
  background: #120a01;
}

.pattern-card-dark-yellow .pattern-swatch-grid {
  background: #ffd233;
}

.pattern-card-dark-yellow .pattern-swatch-accent {
  background: #ff9b3b;
}

/* Grid Atlas */
.atlas-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.atlas-group {
  border-radius: 8px;
  border: 1px solid rgba(0, 245, 255, 0.3);
  padding: 0.6rem 0.7rem 0.7rem;
  background: radial-gradient(circle at top left, rgba(0, 245, 255, 0.16), transparent 55%);
}

.atlas-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.atlas-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.atlas-node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 255, 0.55);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  background: rgba(0, 8, 20, 0.9);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.35);
}

.atlas-node.is-core {
  border-color: var(--grid);
}

.atlas-node.is-lab {
  border-color: var(--accent);
}

.atlas-node.is-lore {
  border-color: rgba(255, 255, 255, 0.7);
}

.atlas-node.is-experiment {
  border-color: rgba(255, 59, 255, 0.8);
}

.atlas-node.is-game {
  border-color: rgba(0, 245, 255, 0.9);
}

.atlas-node:hover {
  color: var(--grid);
  box-shadow:
    0 0 14px rgba(0, 245, 255, 0.7),
    0 0 22px rgba(255, 59, 255, 0.5);
}

/* Latency Tunnel */
.latency-tunnel-viewport {
  margin-top: 0.6rem;
  margin-bottom: 0.6rem;
}

.latency-tunnel-track {
  position: relative;
  width: 100%;
  max-width: 260px;
  height: 220px;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(0, 245, 255, 0.6);
  background: radial-gradient(circle at top, rgba(0, 245, 255, 0.22), transparent 60%),
              radial-gradient(circle at bottom, rgba(255, 59, 255, 0.18), transparent 60%),
              rgba(0, 4, 18, 0.96);
  overflow: hidden;
}

.latency-tunnel-target {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 45%;
  height: 10%;
  border-radius: 999px;
  border: 1px dashed rgba(0, 245, 255, 0.8);
  box-shadow:
    0 0 14px rgba(0, 245, 255, 0.7),
    0 0 24px rgba(255, 59, 255, 0.5);
}

.latency-tunnel-pulse {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 0;
  height: 6%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--grid), var(--accent));
  box-shadow:
    0 0 10px rgba(0, 245, 255, 0.9),
    0 0 18px rgba(255, 59, 255, 0.7);
}

.latency-tunnel-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

/* Hacker Console */
.hacker-grid .panel {
  min-height: 0;
  border-radius: 8px;
  border-color: rgba(0, 245, 255, 0.45);
  background: linear-gradient(180deg, rgba(1, 5, 18, 0.98), rgba(1, 8, 22, 0.98));
  box-shadow:
    0 0 12px rgba(0, 245, 255, 0.26),
    0 0 22px rgba(0, 0, 0, 0.85);
}

.hacker-grid .panel:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 18px rgba(0, 245, 255, 0.38),
    0 0 26px rgba(0, 0, 0, 0.9);
  border-color: rgba(0, 245, 255, 0.9);
}

.hacker-grid .panel h2 {
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.hacker-grid .panel .hero-meta,
.hacker-grid .panel .panel-metric {
  font-size: 0.78rem;
}

.hacker-status-row {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hacker-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 255, 0.4);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hacker-status-pill strong {
  margin-left: 0.25rem;
  color: var(--text);
}

.hacker-terminal-output {
  margin-top: 0.6rem;
  background: rgba(0, 3, 12, 0.96);
  border-radius: 6px;
  border: 1px solid rgba(0, 245, 255, 0.4);
  padding: 0.6rem 0.8rem;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  max-height: 220px;
  min-height: 150px;
  overflow: hidden;
  color: var(--text);
}

.hacker-map-grid {
  margin-top: 0.6rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.hacker-map-node {
  position: relative;
  padding-top: 60%;
  border-radius: 4px;
  border: 1px solid rgba(0, 245, 255, 0.25);
  background: radial-gradient(circle at center, rgba(0, 245, 255, 0.14), transparent 65%);
  box-shadow: 0 0 5px rgba(0, 245, 255, 0.2);
}

.hacker-map-node::before {
  content: attr(data-node);
  position: absolute;
  left: 0.25rem;
  top: 0.25rem;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hacker-map-node::after {
  content: '';
  position: absolute;
  inset: 20%;
  border-radius: inherit;
  border: 1px solid rgba(0, 245, 255, 0.5);
  opacity: 0.3;
}

.hacker-map-node.is-active {
  box-shadow:
    0 0 10px rgba(0, 245, 255, 0.6),
    0 0 16px rgba(255, 59, 255, 0.3);
}

.hacker-map-node.is-breach {
  border-color: var(--accent);
  box-shadow:
    0 0 14px rgba(255, 59, 255, 0.7),
    0 0 22px rgba(0, 245, 255, 0.6);
}

.hacker-stream-lines {
  margin-top: 0.6rem;
  background: rgba(0, 3, 12, 0.96);
  border-radius: 6px;
  border: 1px solid rgba(0, 245, 255, 0.4);
  padding: 0.45rem 0.7rem;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 0.7rem;
  max-height: 170px;
  overflow: hidden;
}

.hacker-stream-line {
  color: var(--muted);
  white-space: nowrap;
}

.hacker-stream-line.is-hot {
  color: var(--grid);
}
