/* ============================================================
   style.css
   Branch: basic-engine
   Commit: "feat: base styles and debug panel UI"
   ============================================================ */

/* ----------------------------------------------------------
   Reset & Base
   ---------------------------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:           #0a0a0f;
  --surface:      rgba(0, 0, 0, 0.60);
  --border:       rgba(255, 255, 255, 0.08);
  --text-primary: #e0e0e0;
  --text-muted:   #888;
  --accent:       #7ee8a2;
  --accent-dim:   rgba(126, 232, 162, 0.15);
  --accent-border:rgba(126, 232, 162, 0.30);
  --radius-sm:    6px;
  --radius-md:    8px;
  --font-mono:    'Courier New', Courier, monospace;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ----------------------------------------------------------
   Canvas — full-screen, sits behind everything
   ---------------------------------------------------------- */
#particleCanvas {
  display: block;
  position: fixed;
  inset: 0;           /* shorthand for top/right/bottom/left: 0 */
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* ----------------------------------------------------------
   Debug Panel — top-left stats overlay
   ---------------------------------------------------------- */
#debugPanel {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;

  font-size: 13px;
  line-height: 1.1;
  color: var(--text-muted);

  min-width: 180px;

  /* Glassmorphism — subtle blur behind the panel */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#debugPanel h3 {
  font-size: 13px;
  font-weight: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;

  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 4px 0;
}

/* The live value inside each stat row */
.stat-row span {
  color: var(--accent);
  font-weight: bold;
  font-size: 13px;
  min-width: 36px;
  text-align: right;
}

/* ----------------------------------------------------------
   Branch Label — top-right badge
   ---------------------------------------------------------- */
#branchLabel {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;

  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);

  padding: 6px 12px;
  font-size: 11px;
  letter-spacing: 0.07em;
  color: var(--accent);
}

/* ----------------------------------------------------------
   Instructions — bottom-center hint
   ---------------------------------------------------------- */
#instructions {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;

  font-size: 13px;
  letter-spacing: 0.06em;
  color: #b7c1d6e0;

  pointer-events: none;        /* clicks pass through to canvas */
  white-space: nowrap;

  /* Fade in after 1 second so it doesn't distract immediately */
  animation: fadeIn 1s ease 1s both;
}

/* ----------------------------------------------------------
   Animations
   ---------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}


/* ----------------------------------------------------------
   Keys Panel — bottom-right shortcut guide (Branch 3)
   ---------------------------------------------------------- */
#keysPanel {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 10;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  max-height: 85vh;
  overflow-y: auto;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 2px 0;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;

  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;

  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
}


/* ----------------------------------------------------------
   Keys panel section divider (Branch 4)
   ---------------------------------------------------------- */
.keys-section {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.872);
  margin-top: 8px;
  margin-bottom: 2px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.keys-section:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}


/* ----------------------------------------------------------
   Key section dividers inside keysPanel (Branch 4)
   ---------------------------------------------------------- */
.key-section {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.25);
  padding: 6px 0 2px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.key-section:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* Side-by-side kbd keys (for [ ] ) */
.key-row kbd + kbd {
  margin-left: 4px;
}


/* ----------------------------------------------------------
   Theme Switcher Panel (Branch 7)
   ---------------------------------------------------------- */
#themeSwitcher {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;

  display: flex;
  gap: 8px;
  align-items: center;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 40px;       /* pill shape */
  padding: 8px 14px;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.theme-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 20px;
  background: transparent;
  color: rgba(255, 255, 255, 0.702);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 5px 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.80);
  border-color: rgba(255, 255, 255, 0.20);
}

.theme-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* Push instructions up so switcher doesn't overlap */
#instructions {
  bottom: 68px;
}
