:root {
  --bg: #0a0a0f;
  --cell-idle: #111118;
  --cell-hover: #1a1a28;
  --cell-glow: #00e5ff;
  --cell-glow-dim: rgba(0, 229, 255, 0.15);
  --text-muted: #5a7a8a;
  --text: #c8e0e8;
  --accent: #00e5ff;
  --band-color: rgba(0, 229, 255, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.overlay {
  position: fixed; inset: 0;
  background: rgba(10, 10, 15, 0.95);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  cursor: pointer;
  font-size: 1.2rem; letter-spacing: 0.15em;
  color: var(--accent);
  transition: opacity 0.4s ease;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

#app {
  display: flex; flex-direction: column;
  height: 100vh; width: 100vw;
}

#header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(0, 229, 255, 0.08);
  flex-shrink: 0;
}
#title {
  font-size: 0.85rem; font-weight: 800; letter-spacing: 0.12em;
  color: var(--accent);
}
#meter { display: flex; gap: 0.75rem; font-size: 0.65rem; }
.meta {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.meta sup {
  color: var(--accent); font-weight: 700;
}

main {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 3px;
  width: min(96vw, calc(96vh * 1.25));
  height: min(calc(96vw / 1.25), 92vh);
  aspect-ratio: 5/4;
  position: relative;
  z-index: 2;
}

.cell {
  background: var(--cell-idle);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
  transition: background 0.06s ease;
  overflow: hidden;
}
.cell::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.08s ease;
}
.cell.active {
  background: var(--cell-hover);
}
.cell.active::after {
  opacity: 1;
  background: radial-gradient(circle at center, var(--cell-glow) 0%, transparent 70%);
}
.cell.bloom {
  animation: cellBloom 0.3s ease-out;
}
@keyframes cellBloom {
  0% { background: var(--cell-glow); transform: scale(1.03); }
  100% { background: var(--cell-hover); transform: scale(1); }
}

#filter-band {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  z-index: 1;
  opacity: 0.6;
  pointer-events: none;
  transition: top 0.15s ease-out;
  filter: blur(3px);
}

@media (max-width: 600px) {
  #header { padding: 0.4rem 0.6rem; }
  #title { font-size: 0.72rem; }
  #meter { gap: 0.5rem; }
  .meta { font-size: 0.55rem; }
  #grid { gap: 2px; }
}
