/* Dormouse Device: controller tester (/tools/controller). Uses the colours from styles.css. */

.ct-kicker {
  display: inline-block; margin: 0 0 14px; padding: 4px 12px; border-radius: 999px;
  background: var(--hazel-tint); color: var(--hazel-deep); font-weight: 600; font-size: 0.95rem;
}

.ct-waiting {
  display: flex; gap: 24px; align-items: flex-start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow);
}
.ct-waiting svg { width: 72px; flex: none; animation: ct-nudge 2.4s ease-in-out infinite; }
.ct-waiting h2 { font-size: 1.75rem; }
@keyframes ct-nudge { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .ct-waiting svg { animation: none; } }
@media (max-width: 560px) { .ct-waiting { flex-direction: column; } }

.ct-bar { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.ct-label { display: block; font-weight: 600; margin-bottom: 6px; }
.ct-bar select {
  font: 500 1rem var(--font-body); color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 8px 12px; min-width: 240px;
}
.ct-name { font-size: 0.85rem; margin: 6px 0 0; word-break: break-word; }
.ct-small { padding: 10px 16px; font-size: 0.95rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ct-note { background: var(--hazel-tint); border-radius: var(--radius-sm); padding: 12px 16px; }

.ct-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .ct-grid { grid-template-columns: 1fr; } }
.ct-side { display: grid; gap: 20px; }
.ct-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.ct-h { font-size: 1.35rem; margin-bottom: 14px; }
.ct-small-print { font-size: 0.9rem; margin: 12px 0 0; }

/* controller picture */
.ct-svg { width: 100%; height: auto; }
.ct-svg text {
  font: 800 15px var(--font-head); fill: var(--ink); text-anchor: middle;
  pointer-events: none; user-select: none;
}
.ct-svg .ct-tiny { font-size: 10px; font-weight: 700; }
.ct-svg .ct-under { fill: var(--slate); }
.ct-body { fill: var(--cream); stroke: var(--ink); stroke-width: 4; }
.ct-key rect, .ct-key circle { fill: var(--paper); stroke: var(--ink); stroke-width: 3; transition: fill 60ms; }
.ct-dpad-mid { fill: var(--paper); }
.ct-stick .ct-stick-top { fill: var(--ink-soft); stroke: var(--ink); }
.ct-key.is-done rect, .ct-key.is-done > circle:first-child { fill: #E4EDE4; stroke: var(--moss); }
.ct-key.is-down rect, .ct-key.is-down circle { fill: var(--hazel); stroke: var(--ink); }
.ct-trig-bg { fill: var(--paper); stroke: var(--ink); stroke-width: 3; }
.ct-trig-fill { fill: var(--hazel); }

.ct-progress { margin: 14px 0 10px; }
.ct-buttons { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ct-buttons li {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; font-size: 0.95rem;
  background: var(--cream);
}
.ct-buttons li.is-done { background: #E4EDE4; border-color: #BFD3BF; }
.ct-buttons li.is-double { background: var(--hazel-tint); border-color: var(--hazel); }
.ct-buttons li.is-down { background: var(--hazel); border-color: var(--ink); }
.ct-bname { font-weight: 600; }
.ct-bcount { color: var(--slate); font-variant-numeric: tabular-nums; font-size: 0.85rem; white-space: nowrap; }
.ct-flag-eg { background: var(--hazel-tint); border-radius: 6px; padding: 0 6px; color: var(--ink); }

/* sticks */
.ct-sticks { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ct-sticks figure { margin: 0; text-align: center; }
.ct-sticks canvas { width: 100%; max-width: 220px; aspect-ratio: 1; background: var(--cream); border-radius: 50%; margin-inline: auto; display: block; }
.ct-sticks figcaption { font-weight: 600; margin-top: 6px; }
.ct-sticks figcaption span { font-weight: 400; color: var(--slate); font-variant-numeric: tabular-nums; white-space: pre; }
.ct-actions { margin-top: 16px; }
.ct-result:empty { display: none; }
.ct-result { margin-top: 14px; }
.ct-wait { font-weight: 600; color: var(--hazel-deep); margin: 0; }
.ct-verdicts { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.ct-verdicts li { border-left: 5px solid var(--line); padding: 6px 10px; background: var(--cream); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.ct-verdicts .ct-good { border-color: var(--moss); }
.ct-verdicts .ct-warn { border-color: var(--hazel); }
.ct-verdicts .ct-bad { border-color: #B23A2E; }

/* triggers */
.ct-trigs { display: grid; gap: 12px; }
.ct-trigs > div { display: grid; grid-template-columns: 3.5em 1fr 3.5em; gap: 12px; align-items: center; font-weight: 600; }
.ct-trigs > div > span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--slate); }
.ct-meter { position: relative; height: 18px; background: var(--cream); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.ct-meter i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--hazel); }
.ct-meter b { position: absolute; top: 0; bottom: 0; left: -2px; width: 2px; background: var(--ink); }

/* raw */
.ct-raw { margin-top: 20px; }
.ct-raw summary { cursor: pointer; font-weight: 600; }
.ct-rawlist { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px 14px; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.ct-rawlist .is-down { color: var(--hazel-deep); font-weight: 700; }

.ct-privacy { margin: 24px 0 0; font-size: 0.95rem; }

.ct-works { margin-top: 20px; }
.ct-works .facts { margin-top: 0; }

.ct-pair { margin: 0 0 1em; }
.ct-pair summary { cursor: pointer; font-weight: 600; color: var(--hazel-deep); }
.ct-pair ul { margin: 10px 0 8px; padding-left: 1.2em; }
.ct-pair li { margin-bottom: 4px; }
.ct-pair p { margin: 0; }
