body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 28px;
}

.arcade-title { position: relative; z-index: 1; }

/* ── Main layout ── */
.tetris-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 22px;
  padding: 18px 16px 0;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 740px;
  box-sizing: border-box;
}

/* ── Side panels ── */
.t-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 120px;
  flex-shrink: 0;
}

.t-stat-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.t-label {
  font-size: 6px;
  color: var(--muted);
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 5px;
  margin-bottom: 2px;
}

.t-value {
  font-size: 24px;
  letter-spacing: 1px;
}
.t-value.cyan   { color: var(--cyan);   text-shadow: 0 0 10px var(--cyan); }
.t-value.yellow { color: var(--yellow); text-shadow: 0 0 10px var(--yellow); }
.t-value.orange { color: #ff8800;       text-shadow: 0 0 10px #ff8800; }

/* Speed bar */
.t-speed-bar {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.t-seg {
  width: 11px;
  height: 13px;
  background: #1a1a33;
  transition: background 0.2s, box-shadow 0.2s;
}
.t-seg.active { box-shadow: 0 0 6px currentColor; }

.t-speed-lv {
  font-size: 7px;
  color: #ff8800;
  margin-top: 5px;
  letter-spacing: 1px;
}

/* Controls */
.t-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0;
  line-height: 1.6;
}
.t-key {
  color: var(--cyan);
  display: inline-block;
  min-width: 36px;
}

/* ── Board ── */
.t-board-wrap {
  position: relative;
  flex-shrink: 0;
}

#tetris-canvas {
  display: block;
  border: 2px solid rgba(0,245,255,0.25);
  box-shadow: 0 0 30px rgba(0,245,255,0.08), 0 0 60px rgba(255,0,204,0.05);
  background: #07071a;
}

/* ── Game Over overlay — defined in style.css ── */

/* ── Easter egg ── */
.t-easter {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 50;
}
#easter-img {
  width: 160px;
  display: block;
}

/* ── Preview canvas ── */
#preview-canvas {
  display: block;
  background: #0a0a1e;
  border: 1px solid #333355;
  margin-top: 4px;
}

/* ── Touch controls ── */
#touch-controls {
  display: none;
  margin-top: 14px;
  width: 100%;
  max-width: 500px;
  padding: 0 8px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

/* Show on touch devices OR small screens — always show on mobile */
@media (hover: none) and (pointer: coarse) {
  #touch-controls { display: flex; flex-direction: column; gap: 10px; }
}
@media (max-width: 600px) {
  #touch-controls { display: flex; flex-direction: column; gap: 10px; }
}

.touch-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.touch-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #ff2df7;
  background: rgba(20,0,30,0.9);
  border: 1px solid rgba(255,45,247,0.4);
  box-shadow: 0 0 10px rgba(255,45,247,0.2);
  user-select: none;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: background 0.1s;
  border-radius: 3px;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
}
.touch-btn span { font-size: 7px; opacity: 0.7; margin-top: 2px; }
.touch-btn:active { background: rgba(255,45,247,0.25); box-shadow: 0 0 16px rgba(255,45,247,0.5); }

.btn-lg { width: 80px; height: 60px; font-size: 20px; }
.btn-md { width: 70px; height: 60px; font-size: 13px; }

.btn-yellow { color: #ffcc00; border-color: rgba(255,204,0,0.5); box-shadow: 0 0 10px rgba(255,204,0,0.2); }
.btn-yellow:active { background: rgba(255,204,0,0.2); }
.btn-cyan   { color: #00e5ff; border-color: rgba(0,229,255,0.5);  box-shadow: 0 0 10px rgba(0,229,255,0.2); }
.btn-cyan:active   { background: rgba(0,229,255,0.2); }
.btn-orange { color: #ff6b35; border-color: rgba(255,107,53,0.5); box-shadow: 0 0 10px rgba(255,107,53,0.2); }
.btn-orange:active { background: rgba(255,107,53,0.2); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .tetris-layout {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 0;
  }
  .t-panel {
    flex-direction: row;
    width: 100%;
    max-width: 420px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .t-panel-right { order: 3; }
  .t-stat-block { min-width: 70px; }
  .t-value { font-size: 18px; }
  .t-board-wrap { width: 100%; }
  #tetris-canvas { width: 100% !important; height: auto !important; max-height: none !important; }
  /* Hide title on mobile to save space */
  .arcade-title { display: none; }
}
