/**
 * color.css
 * Game-specific layout. Mobile-first; the map and controls scale up on
 * wider viewports. Design tokens come from theme.css.
 */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-4) var(--space-2);
  flex-wrap: wrap;
}

.app-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.app-header__logo-btn {
  display: flex;
  align-items: center;
  padding: 0.35rem 0.25rem;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition-fast);
}

.app-header__logo-btn:hover {
  opacity: 0.65;
}

.app-header__logo {
  height: 20px;
  width: auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  color: var(--muted);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.back-link:hover {
  color: var(--fg);
  background: var(--border-subtle);
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.7rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.stat-bar__stat strong {
  color: var(--fg);
  font-weight: 600;
}

.game {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  padding: var(--space-4) var(--space-4) var(--space-8);
}

/* ---- target display (pointer mode) ---- */

.target-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  text-align: center;
}

.target-display__label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.target-display__code {
  font-family: var(--mono-font);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ---- guess panel: big live swatch + code input (guess mode) ---- */

.guess-panel {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  width: 100%;
}

.guess-panel__swatch {
  flex-shrink: 0;
  width: 9rem;
  height: 9rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.3);
  transition: background 60ms linear;
}

.code-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

/* A light "outline" segmented control — no filled block, just the active
   format picking up the accent color so it stays out of the way of the
   big swatch + input next to it. */
.code-input__toggle {
  display: inline-flex;
  gap: 0.3rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.code-input__toggle-btn {
  padding: 0.4rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.code-input__toggle-btn.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

/* The live-color ring: --live-outline is set from JS on every keystroke
   (modeGuesser.js), so the frame around the numbers/hex always matches the
   color the typed code currently produces. Falls back to a neutral border
   before any input has happened. Fixed width (instead of hugging content)
   so switching between the RGB and Hex formats never shifts the layout —
   both sit centered inside the same-size frame. */
.code-input__fields {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 16.5rem;
  padding: 0.5rem 0.9rem;
  border: 2.5px solid var(--live-outline, var(--border));
  border-radius: 1.25rem;
  transition: border-color 80ms linear;
}

.code-input__hash {
  font-family: var(--mono-font);
  font-size: 1.8rem;
  color: var(--muted);
}

.code-input__box {
  font-family: var(--mono-font);
  font-size: 1.8rem;
  font-weight: 500;
  text-align: center;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.25rem;
  width: 4.4rem;
  background: transparent;
  color: var(--fg);
  transition: background var(--transition-fast);
  /* remove native number spinners */
  -moz-appearance: textfield;
}

.code-input__box::-webkit-outer-spin-button,
.code-input__box::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.code-input__box:focus {
  outline: none;
  background: var(--border-subtle);
}

.code-input__box:disabled {
  opacity: 0.45;
}

.code-input__box--hex {
  width: 9.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- color map: SV square + hue slider ---- */

.color-map {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 20rem;
  touch-action: none;
}

.color-map__sv {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: crosshair;
  touch-action: none;
}

.color-map__sv canvas,
.color-map__hue canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.color-map__hue {
  position: relative;
  width: 100%;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  touch-action: none;
}

.color-map--locked .color-map__sv,
.color-map--locked .color-map__hue {
  cursor: default;
}

.color-map__marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  will-change: transform;
  /* transform is set entirely from JS (translate3d + scale); only the
     scale portion benefits from a short transition since position moves
     every rAF frame via lerp already. */
  transition: box-shadow var(--transition-fast);
}

.color-map__marker--hue {
  width: 14px;
  height: 34px;
  border-radius: 4px;
}

.color-map__marker--ghost {
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px var(--accent), 0 2px 10px rgba(0, 0, 0, 0.4);
}

.is-dragging .color-map__marker:not(.color-map__marker--ghost) {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* ---- actions / feedback ---- */

.game-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  width: 100%;
}

.hint-cost {
  font-size: 0.65rem;
  opacity: 0.6;
  font-weight: 400;
}

.feedback {
  min-height: 1.4em;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- landing / home ---- */

.landing {
  position: relative;
  align-items: center;
}

.landing__share-trigger {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--fg);
  opacity: 0.55;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.landing__share-trigger:hover {
  opacity: 1;
  color: var(--accent);
}

.landing__help-trigger {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--fg);
  opacity: 0.55;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.landing__help-trigger:hover {
  opacity: 1;
  color: var(--accent);
}

.landing__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.25rem;
  width: 100%;
  max-width: 22rem;
  padding: 2rem;
  margin: 0 auto;
}

.landing__logo {
  display: flex;
  justify-content: center;
  width: 100%;
}

.landing__logo img {
  width: 100%;
  max-width: 15rem;
  height: auto;
}

.landing__levels {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.landing__level {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--border-subtle);
  transition: color var(--transition-fast);
}

.landing__level:last-child {
  border-bottom: 1px solid var(--border-subtle);
}

.landing__level:hover {
  color: var(--accent);
}

.landing__level-title {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.landing__level-sub {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  opacity: 0.5;
  letter-spacing: 0.02em;
}

.landing__credit {
  flex-shrink: 0;
  width: 100%;
  padding: 0 2rem 2rem;
  text-align: center;
}

.landing__credit a {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: #888888;
  transition: color var(--transition-fast);
}

.landing__credit a:hover {
  color: var(--fg);
}

/* ---- landing / home: section dividers (Work / Play) ---- */

.landing__section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
}

.landing__divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #888888;
}

/* A single rule trailing the label — not a line on both sides. */
.landing__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

/* ---- share-to-story modal ---- */

.share-story {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-story__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  border: none;
  cursor: pointer;
}

.share-story__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 22rem;
  padding: 1.5rem;
}

.share-story__preview {
  position: relative;
  width: min(70vw, 270px);
  aspect-ratio: 9 / 16;
  border-radius: 0.9rem;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.share-story__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.share-story__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #888888;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.share-story__share-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: opacity var(--transition-fast);
}

.share-story__share-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.share-story__share-btn:not(:disabled):hover {
  opacity: 0.85;
}

.share-story__status {
  font-size: 0.8rem;
  line-height: 1.45;
  text-align: center;
  color: #ffffff;
  opacity: 0.85;
}

.share-story__close {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #888888;
  transition: color var(--transition-fast);
}

.share-story__close:hover {
  color: #ffffff;
}

/* ---- overlays ---- */

.results-overlay,
.wallpaper-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
}

.results-card,
.wallpaper-card {
  width: 100%;
  max-width: 22rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.35);
}

.results-card__title {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.results-card__swatches {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  margin-bottom: var(--space-4);
}

.results-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.results-swatch__label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.results-swatch__color {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.results-swatch__code {
  font-family: var(--mono-font);
  font-size: 0.8rem;
}

.results-card__score {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: var(--space-6);
}

.results-card__actions,
.wallpaper-card__actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

.wallpaper-card h3 {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.wallpaper-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.85rem;
  padding: var(--space-2) 0;
  cursor: pointer;
}

.wallpaper-card__actions {
  margin-top: var(--space-4);
}

/* ---- manual overlay (the "?" on the landing page) ---- */

.manual-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
}

.manual-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.manual-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 26rem;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.35);
}

.manual-card__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--muted);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.manual-card__close:hover {
  color: var(--fg);
  background: var(--border-subtle);
}

.manual-card__eyebrow {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #888888;
  margin-bottom: 0.5rem;
}

.manual-card__title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 0.4rem;
}

.manual-card__intro {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: var(--space-6);
}

.manual-section {
  margin-bottom: var(--space-6);
}

.manual-section__title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.manual-section__text {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--fg);
}

.manual-section__text strong {
  font-family: var(--mono-font);
  font-weight: 600;
}

.manual-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.75rem 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--border-subtle);
}

.manual-breakdown__code {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--mono-font);
  font-size: 1.7rem;
  font-weight: 700;
}

.manual-breakdown__chunk {
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
}

.manual-breakdown__chunk--r {
  color: #c41e24;
  background: rgba(196, 30, 36, 0.1);
}

.manual-breakdown__chunk--g {
  color: #1f8a4c;
  background: rgba(31, 138, 76, 0.1);
}

.manual-breakdown__chunk--b {
  color: #2064c4;
  background: rgba(32, 100, 196, 0.1);
}

.manual-breakdown__rows {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.manual-breakdown__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--mono-font);
  font-size: 0.8rem;
  padding-left: 0.6rem;
  border-left: 3px solid transparent;
}

.manual-breakdown__row--r {
  border-left-color: #c41e24;
}

.manual-breakdown__row--g {
  border-left-color: #1f8a4c;
}

.manual-breakdown__row--b {
  border-left-color: #2064c4;
}

.manual-breakdown__formula {
  color: var(--muted);
}

.manual-breakdown__eq {
  font-weight: 700;
  color: var(--fg);
}

.manual-card__download {
  width: 100%;
  margin-top: 0.25rem;
}

/* ---- pairings: header title ---- */

.pairings-header__title {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg);
}

/* ---- pairings: layout ---- */

.pairings {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: var(--space-2) var(--space-4) var(--space-8);
}

.pairings-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  width: 100%;
}

.pairings-random-btn {
  align-self: center;
  margin-top: -0.25rem;
}

/* ---- pairings: harmony tabs ---- */

.pairings-harmony-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  width: 100%;
  max-width: 32rem;
}

.pairings-harmony-tab {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.pairings-harmony-tab:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.pairings-harmony-tab.is-active {
  color: #ffffff;
  background: var(--fg);
  border-color: var(--fg);
}

.pairings-harmony-tab.is-active:hover {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ---- pairings: wheel ---- */

.pairings-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.pairings-wheel {
  position: relative;
  width: 100%;
  max-width: 18rem;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 44px -24px rgba(0, 0, 0, 0.35);
  touch-action: none;
  cursor: crosshair;
}

.pairings-wheel canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.pairings-wheel__markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pairings-wheel__marker {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  pointer-events: none;
  will-change: transform;
}

.pairings-wheel__marker-dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.pairings-wheel__marker--base {
  width: 26px;
  height: 26px;
  z-index: 2;
}

.pairings-wheel__marker--base .pairings-wheel__marker-dot {
  border-width: 2.5px;
  box-shadow: 0 0 0 3px var(--accent), 0 3px 12px rgba(0, 0, 0, 0.4);
}

.pairings-wheel__note {
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
  max-width: 24rem;
}

/* ---- pairings: history (recent colors) ---- */

.pairings-history {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.pairings-history__title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.pairings-recent {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.pairings-recent__swatch {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform var(--transition-fast);
}

.pairings-recent__swatch:hover {
  transform: scale(1.18);
}

.pairings-recent__swatch:active {
  transform: scale(0.95);
}

/* ---- pairings: bento grid ----
 * Fixed-size (not stretch-to-fill) columns, so every tile is the same
 * physical size everywhere — in the flat harmony view and across every
 * group in the "All" view — instead of one big featured tile among small
 * ones. Rows with fewer cards than a full row just leave space; nothing
 * stretches to compensate. */

.pairings-bento {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  width: 100%;
}

.bento-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
}

.bento-group__heading {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  align-self: flex-start;
}

.bento {
  display: grid;
  grid-template-columns: repeat(auto-fill, 9rem);
  justify-content: center;
  gap: 0.9rem;
  width: 100%;
}

.pairing-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.pairing-card:hover {
  box-shadow: 0 14px 32px -20px rgba(0, 0, 0, 0.35);
}

/* Base is marked with an accent ring, never a different size. */
.pairing-card--base {
  border-color: var(--accent);
  border-width: 2px;
}

.pairing-card__swatch {
  display: flex;
  align-items: flex-end;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: none;
  padding: 0;
  transition: filter var(--transition-fast);
}

.pairing-card__swatch:hover {
  filter: brightness(1.03);
}

.pairing-card__swatch-label {
  padding: 0.5rem 0.6rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pairing-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.7rem 0.7rem 0.8rem;
}

.pairing-card__name {
  font-family: var(--ui-font);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 0.15rem;
}

.pairing-code-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.22rem 0.3rem;
  margin: 0 -0.3rem;
  border-radius: var(--radius-sm);
  font-family: var(--ui-font);
  font-size: 0.63rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg);
  transition: background var(--transition-fast);
  overflow-wrap: break-word;
}

.pairing-code-row:hover {
  background: var(--border-subtle);
}

.pairing-code-row:active {
  transform: scale(0.98);
}

.pairing-card__contrast {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.pairing-badge {
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.22rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.pairing-badge--pass {
  color: #0a8a4a;
  border-color: rgba(10, 138, 74, 0.35);
  background: rgba(10, 138, 74, 0.08);
}

.pairing-badge--warn {
  color: #a9720d;
  border-color: rgba(169, 114, 13, 0.35);
  background: rgba(169, 114, 13, 0.08);
}

.pairing-badge--fail {
  color: var(--accent);
  border-color: rgba(196, 30, 36, 0.35);
  background: rgba(196, 30, 36, 0.08);
}

/* ---- pairings: contrast section (all pairwise combinations) ---- */

.pairings-contrast {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.pairings-contrast__title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.pairings-contrast__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
}

.pairings-contrast__row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.15rem;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  transition: background var(--transition-fast);
}

.pairings-contrast__row:hover {
  background: var(--border-subtle);
}

.pairings-contrast__swatches {
  display: flex;
  flex-shrink: 0;
}

.pairings-contrast__chip {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--border);
  margin-left: -0.5rem;
}

.pairings-contrast__chip:first-child {
  margin-left: 0;
}

.pairings-contrast__label {
  flex: 1;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg);
}

.pairings-contrast__ratio {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.pairings-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  width: 100%;
}

/* ---- responsive ---- */

@media (min-width: 480px) {
  .app-header__logo {
    height: 24px;
  }

  .color-map {
    max-width: 22rem;
  }

  .guess-panel__swatch {
    width: 10rem;
    height: 10rem;
  }

  .pairings-wheel {
    max-width: 20rem;
  }

  .bento {
    grid-template-columns: repeat(auto-fill, 10rem);
  }
}

@media (min-width: 768px) {
  .game {
    max-width: 30rem;
    gap: var(--space-8);
  }

  .color-map {
    max-width: 24rem;
  }

  .target-display__code {
    font-size: 2rem;
  }

  .guess-panel__swatch {
    width: 11rem;
    height: 11rem;
  }

  .code-input__fields {
    width: 18rem;
  }

  .code-input__box {
    font-size: 2.1rem;
    width: 4.8rem;
  }

  .code-input__box--hex {
    width: 10.5rem;
  }

  .pairings {
    max-width: 50rem;
    gap: var(--space-8);
  }

  .pairings-wheel {
    max-width: 23rem;
  }

  .bento {
    grid-template-columns: repeat(auto-fill, 11rem);
    gap: 1.1rem;
  }

  .pairing-card__name {
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .color-map__marker {
    transition: none;
  }
}
