/* scar_pin.css — the 3D zone picker in the scars rail.
 *
 * Everything is scoped under .scar-pin-* / #scar-pin-*. The mount ships with `hidden`
 * in the template and only scar_pin.js removes it, so with the feature off (or no
 * WebGL) this file contributes nothing to the rendered page.
 *
 * Colours come from the app's own custom properties with literal fallbacks, so the
 * panel does not go invisible if a variable is renamed in styles.css. */

#scar-pin-mount {
  margin: 4px 0 8px;
}

.scar-pin-holder {
  width: 100%;
  height: 170px;
  border-radius: 6px;
  overflow: hidden;
  background: #12161a;
  border: 1px solid var(--border, #2a3138);
  position: relative;
}

.scar-pin-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.scar-pin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.scar-pin-toolbar[hidden] { display: none; }

.scar-pin-btn {
  font: inherit;
  font-size: 11px;
  line-height: 1.1;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text, #dfe5ea);
  background: var(--bg-alt, #1c2228);
  border: 1px solid var(--border, #2a3138);
}
.scar-pin-btn:hover   { background: #29313a; }
.scar-pin-btn:active  { transform: translateY(1px); }
.scar-pin-btn[hidden] { display: none; }
.scar-pin-btn[disabled] { opacity: 0.45; cursor: default; }
.scar-pin-btn[disabled]:hover  { background: var(--bg-alt, #1c2228); }
.scar-pin-btn[disabled]:active { transform: none; }

/* The one line under the picture: readout, Enlarge, "?". It moves into the floating
   panel's header when the view is enlarged, so it is positioned relative for the
   popover in both homes. */
.scar-pin-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  min-width: 0;
}

.scar-pin-readout {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  min-height: 15px;
  color: var(--text, #dfe5ea);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scar-pin-help-btn {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}
.scar-pin-help-btn[aria-expanded="true"] { background: #29313a; }

.scar-pin-help {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  width: 240px;
  max-width: calc(100vw - 24px);
  padding: 8px 10px 7px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text, #dfe5ea);
  background: var(--bg-alt, #1c2228);
  border: 1px solid var(--border, #2a3138);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}
.scar-pin-help[hidden] { display: none; }
.scar-pin-help-title {
  font-weight: 600;
  margin-bottom: 2px;
}
.scar-pin-help ul {
  margin: 0 0 7px 15px;
  padding: 0;
}
.scar-pin-help li { margin: 1px 0; }
.scar-pin-help-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border, #2a3138);
}
.scar-pin-help-actions .scar-pin-link { font-size: 11px; }
.scar-pin-help-actions .scar-pin-link[hidden] { display: none; }

/* The skin's status line. Dimmer than the readout because it is never the answer to
   the question the labeler is being asked — [hidden] is honoured by the global reset,
   but say it here too so the rule survives this file being read on its own. */
.scar-pin-note {
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-dim, #8b98a5);
}
.scar-pin-note[hidden] { display: none; }

.scar-pin-link {
  font: inherit;
  font-size: 10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: underline;
  color: var(--text-muted, #8b96a1);
  flex: 0 0 auto;
}
.scar-pin-link:hover { color: var(--text, #dfe5ea); }
.scar-pin-link[hidden] { display: none; }

/* Pin colours, inside "?" — one swatch per scar type, the same hexes the pins are drawn in. */
.scar-pin-legend-title { margin-top: 7px; }
.scar-pin-legend {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px 8px;
  font-size: 10px;
}
.scar-pin-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.scar-pin-swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35);
  flex: 0 0 auto;
}

/* The model credit, inside "?" — the licence asks for it, the labeler does not. */
.scar-pin-attrib {
  margin-top: 7px;
  font-size: 9px;
  line-height: 1.3;
  color: var(--text-muted, #8b96a1);
  opacity: 0.8;
}

/* ── Enlarge: a floating panel over the frame, not a modal. The labeler is
      comparing the pin against the animal on screen, so the frame must stay visible. */
.scar-pin-panel {
  position: absolute;
  left: 8px;
  bottom: 8px;
  width: 70%;
  height: 62%;
  min-width: 260px;
  min-height: 200px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  background: #12161a;
  border: 1px solid var(--border, #2a3138);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.scar-pin-panel-head {
  cursor: move;              /* drag the floating panel by its header */
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  font-size: 11px;
  color: var(--text, #dfe5ea);
  background: var(--bg-alt, #1c2228);
  border-bottom: 1px solid var(--border, #2a3138);
}
.scar-pin-panel-head .scar-pin-bar {
  flex: 1 1 auto;
  margin: 0;
}
.scar-pin-panel-head .scar-pin-readout { font-size: 12px; }
.scar-pin-panel-head .scar-pin-help { top: calc(100% + 10px); }

.scar-pin-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}
