/* ============================================
   Controller Games - Responsive Styles
   Light / Dark Theme Support
   ============================================ */

:root {
  --bg: #f0f4f8;
  --text: #2c3e50;
  --accent: #3498db;
  --muted: #7f8c8d;
  --card-bg: #ffffff;
  --border: #bdc3c7;
  --header-bg: #ffffff;
  --shadow: rgba(0,0,0,0.08);
}

[data-theme="dark"] {
  --bg: #1a1a2e;
  --text: #e0e0e0;
  --accent: #e94560;
  --muted: #888;
  --card-bg: #16213e;
  --border: #0f3460;
  --header-bg: #16213e;
  --shadow: rgba(0,0,0,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', 'Hiragino Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

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

/* Header */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
  flex-shrink: 0;
  z-index: 10;
}

.game-header h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-controls {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.2s;
  border: 1px solid var(--border);
}

.btn-icon:hover {
  transform: scale(1.08);
  background: var(--accent);
  color: #fff;
}

/* Main / Canvas */
.game-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Footer */
.game-footer {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--header-bg);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}

.controls-hint {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 640px) {
  .game-header h1 { font-size: 1rem; }
  .controls-hint { gap: 12px; font-size: 0.7rem; }
  .btn-icon { width: 32px; height: 32px; font-size: 1rem; }
}

@media (max-width: 400px) {
  .game-header { padding: 8px 12px; }
  .controls-hint { flex-direction: column; align-items: center; gap: 4px; }
}

/* Debug panel from multipad.js styling support */
.debug-panel {
  position: fixed;
  top: 60px;
  left: 10px;
  background: rgba(0,0,0,0.85);
  color: #0f0;
  padding: 10px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 11px;
  max-height: 80vh;
  overflow-y: auto;
  display: none;
  z-index: 100;
}
.debug-panel.active { display: block; }
.debug-on { color: #0f0; font-weight: bold; }
