/* PGF Grapple Map — site/grapplemap/style.css */
:root {
  --bg: #0a0a0d;
  --panel: #0e0e12;
  --panel2: #13131a;
  --border: #222230;
  --text: #f0ece0;
  --muted: #8a8598;
  --gold: #f0c060;
  --gold-dim: #b8922a;
  --cyan: #67e8f9;
  --cyan-dim: #1e8a98;
  --mat: #0c1008;
  --grid: rgba(240,192,96,0.12);
  --radius: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
  font: 15px/1.55 "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ──────────────────────────────────────────────────────── */
#header {
  position: sticky; top: 0; z-index: 80;
  background: rgba(10,10,13,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.6rem 1.2rem; flex-wrap: wrap;
}
.brand {
  font-size: 1.05rem; font-weight: 900; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold); white-space: nowrap;
  flex-shrink: 0;
}
.brand span { color: var(--cyan); }
.stats-row {
  display: flex; gap: 1rem; flex-shrink: 0;
  font-size: 0.75rem; color: var(--muted); white-space: nowrap;
}
.stats-row b { color: var(--gold); }
#search-box {
  flex: 1; min-width: 160px;
  background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px;
  padding: 0.45rem 1rem; font-size: 0.88rem; outline: none;
}
#search-box:focus { border-color: var(--gold-dim); }
.home-btn {
  background: none; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); padding: 0.4rem 0.9rem; cursor: pointer;
  font-size: 0.8rem; white-space: nowrap; flex-shrink: 0;
}
.home-btn:hover { border-color: var(--gold-dim); color: var(--gold); }

/* ── Layout ──────────────────────────────────────────────────────── */
#main {
  max-width: 1280px; margin: 0 auto;
  padding: 1.2rem 1.2rem 4rem;
}

/* ── Views ───────────────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }

/* ── Home view ───────────────────────────────────────────────────── */
.section-title {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 0.8rem;
}
.tag-grid {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2.5rem;
}
.tag-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.38rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel);
  font-size: 0.82rem; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.tag-pill:hover { border-color: var(--gold-dim); background: var(--panel2); }
.tag-pill .tag-count {
  background: rgba(240,192,96,0.15); color: var(--gold);
  border-radius: 999px; padding: 0.05rem 0.45rem;
  font-size: 0.72rem; font-weight: 700;
}
.quick-section { margin-bottom: 2.5rem; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

/* ── Technique card ──────────────────────────────────────────────── */
.tech-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.85rem 1rem;
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.tech-card:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 1px rgba(240,192,96,0.15), var(--shadow);
}
.tech-card .tc-name { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.3rem; }
.tech-card .tc-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.badge-pos { background: rgba(240,192,96,0.18); color: var(--gold); }
.badge-tr  { background: rgba(103,232,249,0.18); color: var(--cyan); }
.tag-chip {
  display: inline-block; padding: 0.1rem 0.45rem; border-radius: 999px;
  background: var(--panel2); border: 1px solid var(--border);
  font-size: 0.68rem; color: var(--muted); cursor: pointer;
}
.tag-chip:hover { border-color: var(--gold-dim); color: var(--gold); }
.tc-frames { font-size: 0.7rem; color: var(--muted); margin-left: auto; }

/* ── Tag view ────────────────────────────────────────────────────── */
#tag-heading {
  font-size: 1.3rem; font-weight: 800; color: var(--gold);
  margin-bottom: 1.2rem; text-transform: capitalize;
}

/* ── Search results ──────────────────────────────────────────────── */
#search-count { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.8rem; }

/* ── Technique detail view ───────────────────────────────────────── */
#detail-view {
  display: none;
  grid-template-columns: 1fr minmax(300px, 420px);
  gap: 1.2rem;
}
#detail-view.active { display: grid; }

@media (max-width: 820px) {
  #detail-view.active { display: flex; flex-direction: column; }
}

/* Canvas column */
.viewer-col {}
#viewer-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  background: var(--mat);
  cursor: grab;
  touch-action: none;
}
#viewer-canvas:active { cursor: grabbing; }

/* Playback bar */
#playback-bar {
  display: none;
  align-items: center; gap: 0.6rem;
  margin-top: 0.6rem;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.6rem 0.9rem;
}
#playback-bar.visible { display: flex; }
#play-btn {
  background: var(--gold); border: none; border-radius: 50%;
  width: 34px; height: 34px; cursor: pointer; flex-shrink: 0;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  color: #000; font-weight: 900;
}
#play-btn:hover { background: #ffd070; }
#scrub {
  flex: 1; accent-color: var(--gold); cursor: pointer; min-width: 60px;
}
#speed-sel {
  background: var(--panel2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 0.2rem 0.4rem;
  font-size: 0.78rem; cursor: pointer;
}
#autorot-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted); padding: 0.2rem 0.55rem; cursor: pointer; font-size: 0.78rem;
}
#autorot-btn.on { border-color: var(--cyan-dim); color: var(--cyan); }

/* Info column */
.info-col {}
.detail-name {
  font-size: 1.4rem; font-weight: 900; line-height: 1.15;
  color: var(--text); margin-bottom: 0.5rem;
}
.detail-badges { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.info-block { margin-bottom: 1.2rem; }
.info-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem;
}
.info-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.approval-note {
  font-size: 0.82rem; color: var(--muted); font-style: italic;
  border-left: 2px solid var(--gold-dim); padding-left: 0.7rem;
}
.references-list { font-size: 0.78rem; color: var(--muted); }
.references-list li { margin-bottom: 0.2rem; }

/* Graph panel */
.graph-panel { margin-bottom: 1.2rem; }
.graph-title {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 0.5rem;
}
.graph-list { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.graph-list li a {
  display: block; padding: 0.45rem 0.75rem;
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.83rem; color: var(--text);
  transition: border-color 0.12s;
}
.graph-list li a:hover { border-color: var(--cyan-dim); text-decoration: none; }
.graph-none { font-size: 0.82rem; color: var(--muted); font-style: italic; }
.graph-pos-card {
  display: block; padding: 0.55rem 0.8rem;
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.88rem; color: var(--text);
  margin-bottom: 0.4rem; transition: border-color 0.12s;
}
.graph-pos-card:hover { border-color: var(--gold-dim); text-decoration: none; }
.graph-pos-card small { display: block; font-size: 0.72rem; color: var(--muted); }

/* ── Spinner ─────────────────────────────────────────────────────── */
#loading-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(10,10,13,0.75); z-index: 200;
  align-items: center; justify-content: center; flex-direction: column; gap: 0.8rem;
}
#loading-overlay.visible { display: flex; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ──────────────────────────────────────────────────────── */
#footer {
  text-align: center; padding: 2rem 1rem;
  border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--muted);
}
#footer a { color: var(--muted); }
#footer a:hover { color: var(--gold); }

/* ── Responsive tweaks ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { padding: 0.5rem 0.8rem; }
  .stats-row { display: none; }
  #main { padding: 0.8rem 0.8rem 3rem; }
}
