/* ClimbCast — projector theme: pure black, neon, no chrome. */
:root {
  --bg: #000;
  --cyan: #00f0ff;
  --magenta: #ff00d4;
  --green: #39ff14;
  --amber: #ffb300;
  --yellow: #ffff00;
  --blue: #3aa0ff;
  --dim: #1e6b73;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--cyan);
  font: 400 16px/1.4 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

#cast { display: block; width: 100vw; height: 100vh; }

/* --- settings hint ------------------------------------------------ */
#hint {
  position: fixed;
  right: 3vh;
  bottom: 3vh;
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 12px;
  color: var(--dim);
  opacity: 0.75;
  /* a click target as well as a label; the padding is the hit area, and the
     negative margin keeps the icon where it was */
  padding: 14px;
  margin: -14px;
  cursor: pointer;
  transition: opacity 0.2s, color 0.2s;
}
#hint:hover { color: var(--cyan); opacity: 1; }
/* panel open: it is gone, so it must not catch clicks either */
#hint.hidden { opacity: 0; pointer-events: none; }
#hint .mic { display: none; }
/* listening for claps: the gear becomes a mic, and the hint goes live green */
#hint.listening { color: var(--green); opacity: 0.9; }
#hint.listening:hover { opacity: 1; }
#hint.listening .gear { display: none; }
#hint.listening .mic { display: block; }

/* --- controls panel ----------------------------------------------- */
#panel {
  /* vertically centred rather than in a corner: while you are dragging the
     anchors onto the wall, all four corners have to stay visible */
  position: fixed;
  right: 3vh;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;                /* over the rest timer */
  width: 520px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 28px 32px 32px;
  background: #000;
  border: 1px solid var(--cyan);
  font-size: 14px;
  color: #cfefff;
}
#panel[hidden] { display: none; }

#panel header { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
#panel h1 {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--magenta);
}

/* --- tabs: one pane at a time. Folder tabs that stand up off the top edge of
   the pane body: the open one shares the body's fill, so it reads as part of
   it; the rest are a fainter fill, set back. No rules anywhere --- */
.tabs { display: flex; gap: 4px; }
#panel .tabs button {
  padding: 12px 18px 10px;
  background: rgba(0, 240, 255, 0.04);
  border: none;
  color: #7fbfcc;
  font-size: 14px;
}
#panel .tabs button:hover:not(.on) { background: rgba(0, 240, 255, 0.08); color: var(--cyan); }
#panel .tabs button.on { background: rgba(0, 240, 255, 0.11); color: var(--yellow); }
#panel .tabs button[hidden] { display: none; }

/* all panes share one grid cell, and a hidden one only goes invisible, so the
   panel keeps the height of the tallest whichever tab is open */
.panes { display: grid; padding: 24px 22px; background: rgba(0, 240, 255, 0.11); }
.pane { grid-area: 1 / 1; min-width: 0; }
.pane[hidden] { display: block; visibility: hidden; }

/* --- the climb on the wall --- */
#p-climb { display: flex; flex-direction: column; }
/* stacked one fact to a line: name, grade, then the tags and the meta */
#p-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.facts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 14px; }
.facts.dim { color: #9fd8e6; font-size: 13px; }
.facts:empty { display: none; }
#p-grade { color: var(--magenta); font-weight: 700; font-size: 20px; }
/* the name takes the row; the benchmark pill hangs off its right edge, level
   with the first line of the name however many lines it wraps to */
.name-row { display: flex; align-items: flex-start; gap: 14px; }
#p-name { flex: 1; min-width: 0; }
#p-bench {
  flex: none;
  margin-top: 6px;
  padding: 3px 10px;
  border: 2px solid #ffd426;
  border-radius: 999px;
  color: #ffd426;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
#p-bench[hidden], #p-method:empty { display: none; }
#p-method { color: var(--amber); }
#panel #p-fav { align-self: flex-start; margin-top: 18px; }
/* the arrows sit at the two edges of the pane, the position between them,
   along its bottom whatever height the tallest pane sets */
.stepper { display: flex; align-items: center; gap: 14px; margin-top: auto; padding-top: 22px; }
#panel .stepper button { width: 64px; }
#p-pos { flex: 1; text-align: center; color: var(--cyan); }

/* --- controls --- */
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 20px; }
.row:last-child { margin-bottom: 0; }
.row > label {
  width: 76px;
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

/* actions: outlined boxes */
#panel button,
#panel .btn,
#panel input,
#panel select {
  padding: 8px 11px;
  background: #000;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 0;
  color: var(--cyan);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
#panel button, #panel .btn { font-weight: 700; cursor: pointer; text-decoration: none; }
#panel button:hover:not(:disabled), #panel .btn:hover { background: rgba(0, 240, 255, 0.12); }
#panel button:disabled { opacity: 0.3; cursor: default; }

#panel input, #panel select { flex: 1; min-width: 0; color: #cfefff; }
#panel input:focus, #panel select:focus { outline: none; border-color: var(--yellow); color: var(--yellow); }
#panel input:disabled, #panel select:disabled { opacity: 0.3; }

#panel .fav.on { color: var(--yellow); border-color: var(--yellow); background: rgba(255, 255, 0, 0.08); }
#panel .danger { border-color: var(--magenta); color: var(--magenta); }
#panel .danger:hover:not(:disabled) { background: rgba(255, 0, 212, 0.14); }
#panel .new { border-color: var(--green); color: var(--green); }
.row.buttons button { flex: 1; }

/* one of two: a dim track with the chosen half filled solid */
.seg { flex: 1; display: flex; padding: 3px; background: rgba(0, 240, 255, 0.1); }
#panel .seg button { flex: 1; background: none; border: none; color: #7fbfcc; }
#panel .seg button:hover:not(.on) { background: rgba(0, 240, 255, 0.1); color: var(--cyan); }
#panel .seg button.on { background: var(--cyan); color: #000; }

/* on / off: no box, a check square ahead of the name that fills when on */
.toggles { flex: 1; display: flex; flex-wrap: wrap; gap: 10px 20px; }
#panel .toggles button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  background: none;
  border: none;
  color: #7fbfcc;
}
#panel .toggles button::before {
  content: "";
  width: 11px;
  height: 11px;
  border: 1.5px solid currentColor;
}
#panel .toggles button:hover { background: none; color: var(--cyan); }
#panel .toggles button.on { color: var(--yellow); }
#panel .toggles button.on::before { background: currentColor; box-shadow: inset 0 0 0 2px #000; }

.hintline { font-size: 13px; letter-spacing: 0.1em; color: var(--dim); }
#editor .hintline { margin-top: 18px; }

/* the legend draws each mark the way the wall does, but with the rings
   exaggerated and the hold shrunk to a small dot, so the solid ring, the
   dashed ring and the bare hold are told apart at a glance */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 30px;
  font-size: 16px;
  color: #cfefff;
}
.legend span { display: flex; align-items: center; gap: 12px; }
.sw {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 4px, transparent 4.5px);
}
.sw.start  { border: 6px solid var(--green); }
.sw.finish { border: 6px solid var(--blue); }
.sw.foot   { border: 5px dashed var(--amber); }

.keys { margin-top: 28px; font-size: 13px; letter-spacing: 0.1em; color: var(--dim); word-spacing: 0.2em; }
.keys { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.keys span { white-space: nowrap; }
.keys b { color: var(--green); margin-right: 0.4em; }

.note {
  margin-top: 18px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--dim);
}

/* the clap meter wraps under the toggles, in line with them */
.row > .note { flex: 0 0 100%; margin: -4px 0 0 90px; }

/* --- clap listening indicator -------------------------------------- */
#clap {
  position: fixed;
  right: 3vh;
  bottom: calc(3vh + 22px);
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-size: 12px;
  color: var(--green);
  opacity: 0.75;
  pointer-events: none;
}
#clap[hidden] { display: none; }
#clap i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
#clap.off { color: var(--dim); }
#clap.denied, #clap.unavailable { color: var(--amber); }

#timer {
  position: fixed; top: 16px; right: 16px; z-index: 5;
  padding: 6px 18px; border-radius: 12px;
  background: rgba(0,0,0,.55);
  font: 600 56px/1.2 ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  cursor: grab; user-select: none; touch-action: none;
}
#timer:active { cursor: grabbing; }
#timer[hidden] { display: none; }
