/* Tensor Stack — self-contained neon tetris panel, always dark */
.ts-wrap {
  --ts-bg: #05080d;
  --ts-neon: #00ff9c;
  --ts-cyan: #22d3ee;
  --ts-red: #ff3b5c;
  --ts-text: #cbeee0;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--ts-bg);
  border: 1px solid #12303f;
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0,255,156,0.08);
  font-family: "Courier New", ui-monospace, monospace;
  color: var(--ts-text);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ts-wrap * { box-sizing: border-box; }
.ts-hud {
  width: 100%;
  max-width: 340px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.ts-hud .ts-val { color: var(--ts-neon); text-shadow: 0 0 6px var(--ts-neon); }
.ts-hud .ts-stats { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.ts-next {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #8fb9ad;
}
.ts-next canvas {
  width: 68px;
  height: 68px;
  background: #070b12;
  border: 1px solid #12303f;
  border-radius: 6px;
  image-rendering: pixelated;
}
.ts-stage {
  position: relative;
  width: min(74vw, 300px);
  aspect-ratio: 1 / 2;
}
.ts-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #070b12;
  border: 1px solid #12303f;
  border-radius: 8px;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.7);
  touch-action: none;
}
.ts-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  background: rgba(5,8,13,0.86);
  backdrop-filter: blur(2px);
  border-radius: 8px;
  padding: 16px;
  overflow-y: auto;
}
.ts-overlay.ts-hidden { display: none; }
.ts-overlay h1 {
  font-size: clamp(22px, 6vw, 32px);
  color: var(--ts-neon);
  text-shadow: 0 0 12px var(--ts-neon);
  letter-spacing: 2px;
  margin: 0;
}
.ts-overlay p { font-size: 13px; max-width: 260px; line-height: 1.45; color: #9fd8c4; margin: 0; }
.ts-overlay .ts-big { color: var(--ts-cyan); font-size: 17px; text-shadow: 0 0 8px var(--ts-cyan); }
.ts-btn {
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ts-bg);
  background: var(--ts-neon);
  border: none;
  border-radius: 4px;
  padding: 11px 24px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0,255,156,0.5);
  transition: transform 0.08s ease;
}
.ts-btn:active { transform: scale(0.96); }
.ts-hint { font-size: 11px; color: #4f7768; text-align: center; line-height: 1.6; }
.ts-touch {
  display: none;
  width: 100%;
  max-width: 340px;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.ts-touch .ts-pad { display: flex; gap: 8px; }
.ts-touch button {
  width: 52px;
  height: 52px;
  background: rgba(34,211,238,0.12);
  color: var(--ts-cyan);
  border: 1px solid #1c4a5a;
  font-size: 20px;
  border-radius: 10px;
  cursor: pointer;
}
.ts-touch button:active { background: rgba(34,211,238,0.3); }
.ts-touch .ts-rot {
  background: rgba(0,255,156,0.14);
  color: var(--ts-neon);
  border-color: #1c5a44;
}
@media (pointer: coarse) {
  .ts-touch { display: flex; }
  .ts-hint { display: none; }
}
