/*
 * main.css — layout and panel styling.
 *
 * Kept monochrome to match the black-and-white drawing style of the canvas.
 * The canvas itself never reads these styles; everything on the drawing side
 * is configured in src/config.js under SKETCH.
 */

:root {
  --ink: #111;
  --ink-soft: #6b6b6b;
  --line: #d8d8d8;
  --paper: #fff;
  --panel-bg: #fafafa;
  --panel-width: 320px;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.app {
  display: flex;
  height: 100%;
}

/* ---------------------------------------------------------------- canvas --- */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#canvas {
  display: block;
  cursor: default;
}

.stage-hint {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  pointer-events: none;
}

/* ----------------------------------------------------------------- panel --- */

.panel {
  flex: 0 0 var(--panel-width);
  width: var(--panel-width);
  border-left: 1px solid var(--line);
  background: var(--panel-bg);
  overflow-y: auto;
  padding: 20px 20px 28px;
}

.panel-header h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.panel-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.panel-section h2 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ----------------------------------------------------------------- score --- */

.score-headline {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.score-number {
  font-size: 44px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.score-verdict {
  font-size: 14px;
  color: var(--ink-soft);
}

.score-bars {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.score-bars li {
  display: grid;
  grid-template-columns: 68px 1fr 30px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.bar-label { color: var(--ink-soft); }

.bar-track {
  height: 7px;
  border-radius: 4px;
  background: #e6e6e6;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 140ms linear;
}

.bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------- controls --- */

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* Three cats fit one row each; presets stay in the default two columns. */
#cat-buttons {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 16px;
}

.button-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.button-row button { flex: 1; }

button {
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 120ms, color 120ms;
}

button:hover { background: #f0f0f0; }
button:active { background: #e4e4e4; }

button.primary {
  background: var(--ink);
  color: var(--paper);
}

button.primary:hover { background: #333; }

button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--ink-soft);
}

.field-label output {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

input[type='range'] {
  width: 100%;
  accent-color: var(--ink);
}

select {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 7px 8px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 7px;
  cursor: pointer;
}

.check input { accent-color: var(--ink); }

/* ---------------------------------------------------------------- footer --- */

.panel-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}

.panel-footer p { margin: 0 0 6px; }

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  font: inherit;
  font-size: 11px;
  text-align: center;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
}

/* Narrow screens: stack the panel under the canvas. */
@media (max-width: 820px) {
  .app { flex-direction: column; }
  .stage { flex: 0 0 55vh; }
  .panel {
    flex: 1 1 auto;
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
