/* Color Sort Challenge - single screen, the rack is the whole game.
   Brand chrome (header, buttons, footer) matches Game On Family; the rack
   itself is the light-blue plastic of the toy in the videos. */

:root {
  --gof-primary-dark: #157623;
  --gof-primary: #9bca3e;
  --gof-bg-light: #dde5ed;
  --gof-bg-mint: #defff0;
  --gof-accent: #ffb920;
  --text-primary: #2f2c28;
  --text-secondary: #5e5c5e;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

  /* The rack: light-blue rods and base, like the toy. */
  --rod: #9fd8f0;
  --rod-shade: #74bfe0;
  --base: #8fd0ec;
  --base-deep: #5fb3d8;

  /* Ring colors. Picked to stay apart for most color vision; each also
     carries a different lightness so they separate in grayscale. */
  --c0: #ff4f9a; /* pink */
  --c1: #ffd23f; /* yellow */
  --c2: #4cc26a; /* green */
  --c3: #2f7de1; /* blue */
  --c4: #8a4fd8; /* purple */

  /* One ring height drives the whole rack: 10 rings per pole. */
  --ring-h: clamp(15px, 3.9vw, 21px);
}

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

body {
  font-family: 'Arimo', sans-serif;
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--gof-bg-light) 0%, var(--gof-bg-mint) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

/* ===== Shared header bar (per HEADER_SPECS) ===== */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
  margin-bottom: 0.25rem;
  padding: 4px 0;
  gap: 12px;
  position: relative;
  z-index: 1100;
}

.header-left { flex: 1; min-width: 0; max-width: 85%; }
.header-right { flex-shrink: 0; min-width: 52px; }

.game-title-wrap { position: relative; display: inline-block; }

.game-title-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
}

.game-title-heading {
  margin: 0;
  font-family: 'League Spartan', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.game-title-chevron {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.game-title-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 160px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.game-title-dropdown[aria-hidden="false"] { display: block; }

.game-nav-link {
  display: block;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid #e2e8f0;
}

.game-nav-link:last-child { border-bottom: none; }
.game-nav-link:hover { background: var(--gof-bg-mint); }

.mode-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  min-height: 28px;
  font-family: 'Arimo', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  background: white;
  color: var(--text-secondary);
  border: 1.5px solid #d1d5db;
  border-radius: 999px;
  cursor: pointer;
}

.mode-btn:hover { border-color: var(--gof-primary); background: var(--gof-bg-mint); }

.mode-btn[aria-pressed="true"] {
  background: var(--gof-bg-mint);
  color: var(--gof-primary-dark);
  border-color: var(--gof-primary-dark);
  border-width: 2px;
  padding: 2px 10px;
}

/* ===== Puzzle + difficulty pills ===== */
.puzzle-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  width: 100%;
}

.choice-row { display: flex; gap: 6px; }

.choice-btn {
  padding: 5px 13px;
  min-height: 34px;
  font-family: 'Arimo', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  background: white;
  color: var(--text-secondary);
  border: 1.5px solid #d1d5db;
  border-radius: 999px;
  cursor: pointer;
}

.choice-btn:hover { border-color: var(--gof-primary); background: var(--gof-bg-mint); }

.choice-btn[aria-pressed="true"] {
  background: var(--gof-bg-mint);
  color: var(--gof-primary-dark);
  border-color: var(--gof-primary-dark);
  border-width: 2px;
  padding: 4px 12px;
}

/* ===== Score strip ===== */
.score-strip {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 480px;
}

.score-chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  background: var(--card-bg);
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.4rem 0.4rem;
  box-shadow: var(--card-shadow);
  min-width: 0;
}

.score-chip-label {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.score-chip-value {
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.score-chip--target { border-color: var(--gof-accent); background: #fffdf3; }
.score-chip--target .score-chip-value { color: #8a5a00; }

/* ===== The rack ===== */
.rack-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  padding: 14px 10px 0;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.rack {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(4px, 1.6vw, 10px);
  /* 10 rings plus headroom for a lifted run. Fixed, so nothing below moves. */
  height: calc(var(--ring-h) * 10 + 34px);
}

.pole {
  position: relative;
  flex: 1 1 0;
  max-width: 64px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
}

/* The rod, drawn behind the rings. */
.pole::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 26%;
  max-width: 12px;
  /* --cap is set only on a short spare pole. */
  height: calc(var(--ring-h) * var(--cap, 10) + 14px);
  transform: translateX(-50%);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(90deg, var(--rod-shade), var(--rod) 45%, var(--rod-shade));
}

.ring {
  position: relative;
  width: 100%;
  height: var(--ring-h);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45), inset 0 -2px 0 rgba(0, 0, 0, 0.14);
  transition: transform 0.14s ease-out;
}

.ring[data-c="0"] { background: var(--c0); }
.ring[data-c="1"] { background: var(--c1); }
.ring[data-c="2"] { background: var(--c2); }
.ring[data-c="3"] { background: var(--c3); }
.ring[data-c="4"] { background: var(--c4); }

/* Picked up: the top run lifts off the stack. */
.pole.is-selected .ring.is-lifted { transform: translateY(-14px); }
.pole.is-selected .ring.is-lifted:last-child { outline: 3px solid var(--gof-accent); outline-offset: 1px; }

/* A finished stack: one color, full. */
.pole.is-done::after {
  content: '\2713';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--gof-primary-dark);
}

.pole.is-bad { animation: shake 0.28s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.pole:focus-visible { outline: 3px solid var(--gof-accent); outline-offset: 2px; border-radius: 6px; }

.rack-base {
  margin: 0 -10px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--base) 0%, var(--base-deep) 100%);
}

.rack-label {
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

/* ===== Pass and play: cover between turns ===== */
.group-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem;
  text-align: center;
  background: #2f2c28;
  color: #ffffff;
  overflow-y: auto;
}

.group-cover[hidden] { display: none; }

/* While the cover is up it replaces the board and the frame grows to fit it,
   so six names never overflow. Never shorter than the board, so turns 2+
   don't jump. */
.rack-frame.is-covered { padding: 0; background: #2f2c28; }
.rack-frame.is-covered .rack,
.rack-frame.is-covered .rack-base { display: none; }
.rack-frame.is-covered .group-cover {
  position: static;
  min-height: calc(var(--ring-h) * 10 + 64px);
  padding: 1.25rem 1rem;
}

.cover-ghost { color: #e6e1da; }
.cover-ghost:hover { color: #ffffff; }

.cfg-field[hidden] { display: none; }

.cfg-count {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
}

.step-btn.step-btn--light {
  border-color: #d1d5db;
  color: var(--gof-primary-dark);
  background: white;
}

.cfg-names {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.name-input.name-input--light {
  border: 1.5px solid #d1d5db;
}


.cover-kicker {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gof-accent);
}

.cover-title {
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.15;
}

.cover-note {
  font-size: 0.88rem;
  line-height: 1.4;
  color: #e6e1da;
  max-width: 300px;
}

.step-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  background: transparent;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.step-btn:disabled { opacity: 0.35; cursor: default; }

.name-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  font-family: 'Arimo', sans-serif;
  font-size: 0.9rem;
  border: none;
  border-radius: 8px;
}

/* ===== Pass and play: replay + standings ===== */
.group-stage {
  width: 100%;
  max-width: 480px;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.group-stage[hidden] { display: none; }

/* Replay and standings take over the play area. */
.score-strip[hidden],
.play-actions[hidden],
.status-area[hidden] { display: none; }

.stage-title {
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.stage-clock {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.replay-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%;
}

.replay-grid--one { grid-template-columns: 1fr; }
.replay-grid--three { grid-template-columns: repeat(3, 1fr); }

.replay-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.4rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  min-width: 0;
}

.replay-cell.is-done { border-color: var(--gof-primary-dark); background: var(--gof-bg-mint); }
.replay-cell.is-winner { border-color: var(--gof-accent); background: #fffdf3; }
.replay-cell.is-out { opacity: 0.55; }

.replay-name {
  font-weight: 700;
  font-size: 0.85rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.replay-state {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  min-height: 1.1em;
}

.rack.rack--mini {
  --ring-h: 6px;
  height: calc(var(--ring-h) * 10 + 12px);
  gap: 3px;
  width: 100%;
}

.rack--mini .pole { cursor: default; }
.rack--mini .pole::before { width: 2px; border-radius: 1px; height: calc(var(--ring-h) * var(--cap, 10) + 6px); }
.rack--mini .ring { border-radius: 2px; border-width: 0; box-shadow: none; }

.speed-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.standings { display: flex; flex-direction: column; gap: 4px; width: 100%; }

.standing-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  background: #f5f8fa;
  font-weight: 600;
  color: var(--text-secondary);
}

.standing-row.is-winner { background: #fffdf3; border: 1px solid var(--gof-accent); color: #8a5a00; }
.standing-place { font-family: 'League Spartan', sans-serif; font-weight: 800; min-width: 2.2rem; }
.standing-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.standing-time { font-family: 'League Spartan', sans-serif; font-weight: 800; color: var(--text-primary); font-variant-numeric: tabular-nums; }

.stage-actions { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; width: 100%; max-width: 300px; }
.stage-actions .primary-btn { width: 100%; }

/* ===== Status line (fixed height so it never shifts the buttons) ===== */
.status-area {
  width: 100%;
  max-width: 480px;
  min-height: 2.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--text-secondary);
}

.status-area.is-target { color: #8a5a00; }
.status-area.is-bad { color: #b3261e; }

/* ===== Buttons ===== */
.play-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  max-width: 380px;
  justify-content: center;
}

.primary-btn,
.secondary-btn {
  font-family: 'Arimo', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.65rem 1.25rem;
  min-height: 46px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

.primary-btn {
  background: var(--gof-primary-dark);
  color: white;
  border: 2px solid var(--gof-primary-dark);
}

.primary-btn:hover { background: #11631d; }

.secondary-btn {
  background: white;
  color: var(--gof-primary-dark);
  border: 2px solid var(--gof-primary-dark);
}

.play-actions .secondary-btn { flex: 1; max-width: 180px; }

.secondary-btn:hover { background: var(--gof-bg-mint); }

.primary-btn:active,
.secondary-btn:active { transform: scale(0.97); }

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.quiet-btn {
  font-family: 'Arimo', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.quiet-btn:hover { color: var(--text-primary); }

.ghost-btn {
  font-family: 'Arimo', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  padding: 0.6rem;
  cursor: pointer;
  text-decoration: underline;
}

.ghost-btn:hover { color: var(--text-primary); }

/* ===== Settings (secondary - below the gameplay) ===== */
.settings-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 480px;
  padding: 0.6rem 0.9rem;
  font-family: 'Arimo', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: white;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  cursor: pointer;
}

.settings-summary:hover { border-color: var(--gof-primary); background: var(--gof-bg-mint); }
.settings-summary .gear { font-size: 1rem; }
.settings-summary #settingsSummaryText { flex: 1; text-align: left; }
.settings-chevron { font-size: 0.7rem; transition: transform 0.15s; }
.settings-summary[aria-expanded="true"] .settings-chevron { transform: rotate(180deg); }

.settings-panel {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.settings-panel[hidden] { display: none; }

.cfg-field { display: flex; flex-direction: column; gap: 0.4rem; }

.cfg-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cfg-hint {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* ===== Names prompt (Group in Person), the Words or Less nudge ===== */
.names-nudge {
  width: 100%;
  max-width: 480px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1.5px dashed #c4ccd6;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Arimo', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.names-nudge:hover { border-color: var(--gof-primary); color: var(--text-primary); }
.names-nudge[hidden] { display: none; }

/* ===== Quick rules ===== */
.how-to { width: 100%; max-width: 520px; }

.how-to details {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.how-to-toggle {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.how-to-toggle::-webkit-details-marker { display: none; }
.how-to-chevron { font-size: 0.7rem; color: var(--text-secondary); transition: transform 0.15s; }
.how-to details[open] .how-to-chevron { transform: rotate(180deg); }

.how-to-body {
  padding: 0 1rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.how-to-steps {
  padding-left: 1.2rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.how-to-steps li::marker { font-weight: 800; color: var(--gof-primary-dark); }
.how-to-body ul { padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.how-to-body strong { color: var(--text-primary); }

/* ===== Guide ===== */
.guide {
  width: 100%;
  max-width: 640px;
  padding: 1.25rem 1.25rem 1.5rem;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.guide h2 {
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.25;
  color: var(--text-primary);
  margin: 1.6rem 0 0.6rem;
}

.guide h2:first-child { margin-top: 0; }
.guide p { margin-bottom: 0.75rem; }

.guide-faq { display: flex; flex-direction: column; gap: 0.4rem; }

.guide-faq details {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.guide-faq summary {
  list-style: none;
  padding: 0.65rem 0.85rem;
  font-family: 'League Spartan', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
}

.guide-faq summary::-webkit-details-marker { display: none; }
.guide-faq summary::after { content: ' \25BE'; color: var(--text-secondary); font-size: 0.75rem; }
.guide-faq details[open] summary::after { content: ' \25B4'; }
.guide-faq summary:hover { background: var(--gof-bg-mint); }
.guide-faq details p { padding: 0 0.85rem 0.75rem; margin: 0; }

/* ===== Result overlay ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(29, 26, 22, 0.55);
  overflow-y: auto;
}

.overlay.hidden { display: none; }

.overlay-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: auto;
  padding: 1.5rem 1.25rem 1rem;
  text-align: center;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.overlay-emoji { font-size: 2.4rem; line-height: 1; }

.overlay-title {
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--gof-primary-dark);
  line-height: 1.2;
}

.overlay-detail {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.result-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin: 0.15rem 0;
}

.result-score-value {
  font-family: 'League Spartan', sans-serif;
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.result-score-unit {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.result-verdict {
  font-size: 0.9rem;
  font-weight: 700;
  color: #8a5a00;
  line-height: 1.35;
  min-height: 1.3rem;
}

/* ===== Challenge sheet ===== */
.overlay-card--wide { max-width: 380px; text-align: left; }
.overlay-card--wide .overlay-title { text-align: center; }

.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.challenge-preview {
  margin: 0;
  padding: 0.75rem;
  background: #f1f5f9;
  border-radius: 8px;
  font-family: 'Arimo', sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  color: var(--text-primary);
}

.challenge-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.challenge-link-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.challenge-link {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--gof-primary-dark);
  word-break: break-all;
}

.challenge-copy {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--gof-primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .ring { transition: none; }
  .pole.is-bad { animation: none; }
}
