/* ═══════════════════════════════════════════════════════════════════
   07 CONTROLS
   Buttons, statusbar (legacy), play overlay
   Sourced from monolithic main.css lines 1569-1843.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Buttons (Liquid Glass) ─────────────────────────────────────── */
.btn-sm {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  font-size: 12px;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.btn-sm:hover {
  background: rgba(255,255,255,0.09);
  border-color: var(--glass-border-strong);
}
.btn-sm:active { transform: scale(0.98); }
.btn-accent {
  background: var(--accent-grad);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px -4px rgba(124,117,255,0.5), 0 0 0 1px rgba(255,255,255,0.1) inset;
}
.btn-accent:hover {
  filter: brightness(1.1);
  box-shadow: 0 8px 22px -4px rgba(124,117,255,0.6), 0 0 0 1px rgba(255,255,255,0.14) inset;
  transform: translateY(-1px);
}
.btn-secondary {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.09); border-color: var(--glass-border-strong); }
.btn-danger {
  background: var(--red);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}
.btn-danger:hover { opacity: 0.85; }
.btn-tiny {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg4);
  font-size: 12px;
}
.btn-tiny:hover { background: var(--border); }

/* ── Statusbar ──────────────────────────────────────────────────── */
#statusbar {
  display: flex;
  align-items: center;
  height: var(--status-h);
  padding: 0 12px;
  background: var(--bg1);
  border-top: 1px solid var(--border);
  font-size: 12px;
  flex-shrink: 0;
  gap: 12px;
}
.save-ok   { color: var(--green); }
.save-dirty{ color: var(--yellow); }
.statusbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}
.statusbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}
.status-version {
  font-family: ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  opacity: 0.7;
  cursor: default;
  user-select: text;
}
.status-version:hover { opacity: 1; }
#btn-undo, #btn-redo {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
#btn-undo:not([disabled]):hover,
#btn-redo:not([disabled]):hover { background: var(--bg3); }
#btn-undo[disabled], #btn-redo[disabled] { opacity: 0.3; cursor: not-allowed; }

/* ── Play Overlay ───────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #000;
  display: flex;
  flex-direction: column;
}
.overlay.hidden { display: none; }
.play-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--bg1);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.play-title { font-weight: 700; color: var(--green); flex: 1; }
.game-canvas-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}
#game-canvas {
  image-rendering: pixelated;
  display: block;
  touch-action: none;
}
.play-controls-hud {
  position: absolute;
  bottom: 18px;
  right: 18px;
  display: flex;
  gap: 10px;
  pointer-events: all;
}
.play-hud-btn {
  background: rgba(108,99,255,0.82);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  transition: transform 0.08s, background 0.1s;
  user-select: none;
}
.play-hud-btn:active { transform: scale(0.93); background: rgba(74,66,204,0.95); }
.play-touch-controls {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.play-touch-stick {
  position: absolute;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 128px;
  height: 128px;
  pointer-events: auto;
  touch-action: none;
}
.play-touch-stick-base {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.13), rgba(10,12,22,0.62));
  border: 1px solid rgba(255,255,255,0.24);
  box-shadow: inset 0 0 22px rgba(0,0,0,0.34), 0 10px 28px rgba(0,0,0,0.32);
  backdrop-filter: blur(8px);
}
.play-touch-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(132,124,255,0.96), rgba(61,214,245,0.82));
  border: 2px solid rgba(255,255,255,0.34);
  box-shadow: 0 8px 18px rgba(0,0,0,0.38);
  transition: transform 70ms ease-out;
}
.play-touch-stick.active .play-touch-stick-knob {
  transition: none;
}
.play-touch-stick-label {
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.42);
  color: rgba(255,255,255,0.76);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
}
.play-touch-actions {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(2, 68px);
  gap: 10px;
  pointer-events: auto;
}
.play-touch-btn {
  min-width: 0;
  min-height: 62px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.26);
  background: rgba(12,14,24,0.64);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.34);
  backdrop-filter: blur(9px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  touch-action: none;
}
.play-touch-btn span {
  font-size: 23px;
  line-height: 1;
}
.play-touch-btn small {
  color: rgba(255,255,255,0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.play-touch-btn-jump,
.play-touch-btn-attack {
  min-height: 74px;
}
.play-touch-btn-jump {
  background: rgba(61,220,132,0.72);
  color: #06150c;
}
.play-touch-btn-jump small {
  color: rgba(6,21,12,0.78);
}
.play-touch-btn-attack {
  background: rgba(255,85,85,0.78);
}
.play-touch-btn.active,
.play-touch-btn:active {
  transform: translateY(2px) scale(0.96);
  filter: brightness(1.18);
}
.debug-panel {
  position: absolute;
  top: 60px; left: 10px;
  background: rgba(0,0,0,0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.8;
  color: var(--green);
  pointer-events: none;
}
.debug-panel.hidden { display: none; }

