/* ---------------------------------------------------------------------------
   Jeopardy
   Page shell, landing forms, the board, the clue modal and the scoreboard.
   The shared JAWNLogic bar brings its own /nav/navbar.css.
   --------------------------------------------------------------------------- */

:root {
  --jep-bg: #070c1c;
  --jep-bg-2: #0a1228;
  --jep-panel: #0d1730;
  --jep-panel-2: #101d3c;
  --jep-line: #1e2f56;
  --jep-line-2: #2b4070;
  --jep-ink: #eef3ff;
  --jep-dim: #94a5c7;
  --jep-faint: #66799f;
  --jep-blue: #0b1a6b;
  --jep-blue-2: #14269a;
  --jep-blue-3: #040c3c;
  --jep-gold: #c9a24a;
  --jep-gold-2: #f0cd73;
  --jep-green: #35d07f;
  --jep-red: #ff5a5f;
  --jep-radius: 14px;
  --jep-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --jep-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  /* The board's own lettering: condensed, like the set. */
  --jep-board-font: "Archivo Narrow", "Helvetica Neue Condensed", "Arial Narrow",
    "Liberation Sans Narrow", "Roboto Condensed", Impact, system-ui, sans-serif;
  --jep-seam: #01041c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--jep-bg);
}

body.jep-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 10% -10%, rgba(6, 12, 233, 0.28), transparent 62%),
    radial-gradient(900px 460px at 95% 0%, rgba(214, 159, 76, 0.12), transparent 60%),
    var(--jep-bg);
  color: var(--jep-ink);
  font-family: var(--jep-font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.jep-main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 20px 72px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.02em;
}

.jep-eyebrow {
  margin: 0 0 6px;
  color: var(--jep-gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.jep-note {
  margin: 8px 0 0;
  color: var(--jep-dim);
  font-size: 13px;
}

.jep-error {
  margin: 10px 0 0;
  color: #ffb3b5;
  font-size: 13px;
}

/* Landing ---------------------------------------------------------------- */

.jep-gate {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.jep-gate__card {
  max-width: 640px;
  padding: 32px;
  border: 1px solid var(--jep-line);
  border-radius: var(--jep-radius);
  background: var(--jep-panel);
  box-shadow: var(--jep-shadow);
}

.jep-hero {
  padding: 18px 0 30px;
  text-align: center;
}

.jep-hero h1 {
  font-size: clamp(48px, 9vw, 92px);
  font-weight: 800;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--jep-gold-2);
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), 0 18px 40px rgba(6, 12, 233, 0.45);
}

.jep-sub {
  max-width: 56ch;
  margin: 16px auto 0;
  color: var(--jep-dim);
  font-size: 17px;
}

.jep-stats {
  margin: 14px 0 0;
  color: var(--jep-faint);
  font-size: 13px;
}

.jep-stats strong {
  color: var(--jep-ink);
}

.jep-landing__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
}

.jep-card {
  padding: 24px;
  border: 1px solid var(--jep-line);
  border-radius: var(--jep-radius);
  background: linear-gradient(180deg, var(--jep-panel-2), var(--jep-panel));
  box-shadow: var(--jep-shadow);
}

.jep-card h2 {
  margin-bottom: 16px;
  font-size: 20px;
}

.jep-field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--jep-dim);
  font-size: 13px;
  font-weight: 600;
}

.jep-field input,
.jep-field select,
.jep-cat-picker input,
.jep-add input,
.jep-wager input,
.jep-wager-row input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--jep-line-2);
  border-radius: 9px;
  background: #070f22;
  color: var(--jep-ink);
  font: inherit;
  font-size: 15px;
}

.jep-field input:focus,
.jep-field select:focus,
.jep-cat-picker input:focus,
.jep-add input:focus,
.jep-wager input:focus,
.jep-wager-row input:focus {
  outline: 2px solid var(--jep-gold);
  outline-offset: 1px;
}

.jep-choice {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--jep-line);
  border-radius: 10px;
}

.jep-choice legend {
  padding: 0 6px;
  color: var(--jep-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.jep-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--jep-ink);
  font-size: 14px;
}

.jep-choice input {
  accent-color: var(--jep-gold);
}

.jep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--jep-gold-2), var(--jep-gold));
  color: #141414;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.jep-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.jep-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  filter: none;
}

.jep-btn--ghost {
  border-color: var(--jep-line-2);
  background: transparent;
  color: var(--jep-ink);
}

.jep-btn--small {
  padding: 8px 14px;
  font-size: 13px;
}

.jep-btn--tiny {
  padding: 6px 10px;
  font-size: 12px;
}

.jep-link {
  border: 0;
  background: none;
  color: var(--jep-gold);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.jep-codeblock {
  overflow-x: auto;
  padding: 12px 14px;
  border: 1px solid var(--jep-line);
  border-radius: 10px;
  background: #050a18;
  color: var(--jep-gold-2);
  font-size: 13px;
}

/* Category picker --------------------------------------------------------- */

.jep-cat-picker {
  margin-bottom: 14px;
  padding: 12px;
  border: 1px dashed var(--jep-line-2);
  border-radius: 10px;
}

.jep-cat-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 220px;
  margin-top: 10px;
  overflow-y: auto;
}

.jep-cat-chip {
  padding: 6px 10px;
  border: 1px solid var(--jep-line-2);
  border-radius: 999px;
  background: #070f22;
  color: var(--jep-ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.jep-cat-chip small {
  color: var(--jep-faint);
}

.jep-cat-chip.is-active {
  border-color: var(--jep-gold);
  background: rgba(214, 159, 76, 0.16);
  color: var(--jep-gold-2);
}

.jep-cat-chip:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Game bar ---------------------------------------------------------------- */

.jep-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 0 18px;
}

.jep-bar__title {
  font-size: clamp(26px, 4vw, 40px);
}

.jep-bar__tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.jep-bar__tools .jep-code {
  padding: 8px 14px;
  border: 1px solid var(--jep-gold);
  border-radius: 10px;
  background: rgba(214, 159, 76, 0.12);
  color: var(--jep-gold-2);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.22em;
  cursor: pointer;
}

.jep-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: #16244a;
  color: var(--jep-dim);
  font-size: 12px;
  font-weight: 700;
}

.jep-tag.is-host {
  background: rgba(214, 159, 76, 0.16);
  color: var(--jep-gold-2);
}

.jep-seats {
  padding: 6px 10px;
  border: 1px solid var(--jep-line-2);
  border-radius: 999px;
  color: var(--jep-dim);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Layout ------------------------------------------------------------------ */

.jep-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.jep-stage {
  min-width: 0;
}

.jep-side {
  display: grid;
  gap: 14px;
  position: sticky;
  /* 16px of air, plus however much of the window the shared nav bar is holding
     (nav/navbar.js writes --jn-nav-offset; 0 when the bar is not pinned). Without
     the second term the rail comes to rest behind the bar and its top two rows are
     unreadable. */
  top: calc(16px + var(--jn-nav-offset, 0px));
}

/* Board ------------------------------------------------------------------- */

/* The set: one cobalt field, thin dark seams, categories on a slightly
   deeper band, values in gold. Everything is a grid child, so the rows line up
   by construction - no floats, no per-cell heights.

   Geometry comes from the show. The 6x6 grid in a 16:9 board shot is roughly
   1850 x 1015, so every column is a little wider than it is tall and the whole
   board is about 1.82:1. The height is therefore derived from the width with
   aspect-ratio instead of from the text: rows sized "as tall as their content"
   are what left the boxes short and the board looking like a strip.

   The width is also capped by the viewport height, so a very wide window makes
   the board taller rather than making every cell a letterbox - the same reason
   the real board never stretches its columns. */
.jep-board {
  --jep-ratio: 1.82;
  display: grid;
  width: min(100%, calc((100vh - 11rem) * var(--jep-ratio)));
  aspect-ratio: var(--jep-ratio);
  margin-inline: auto;
  grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr));
  /* The category band is a shade shallower than a clue row, as on the set. */
  grid-template-rows: 0.88fr repeat(5, 1fr);
  gap: 2px;
  padding: 5px;
  border-radius: 6px;
  background: var(--jep-seam);
  box-shadow:
    0 0 0 1px #1b2c7d,
    0 2px 0 #04061a,
    0 30px 70px rgba(2, 4, 20, 0.65),
    inset 0 0 90px rgba(0, 0, 0, 0.45);
}

.jep-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  background: linear-gradient(180deg, #0a1668 0%, #071050 100%);
  box-shadow: inset 0 0 0 1px rgba(150, 170, 255, 0.16);
  color: #f2f5ff;
  font-family: var(--jep-board-font);
  font-size: clamp(10px, 1.02vw, 16px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.05em;
  min-height: 56px;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

/* The tiny air-date line under a category name. */
.jep-cat__date {
  color: rgba(205, 219, 255, 0.55);
  font-size: clamp(8px, 0.8vw, 11px);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-shadow: none;
}

.jep-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 0;
  background: linear-gradient(180deg, #0b1a72 0%, #081458 55%, #061040 100%);
  box-shadow: inset 0 0 0 1px rgba(140, 160, 255, 0.15);
  color: var(--jep-gold-2);
  font-family: var(--jep-board-font);
  font-size: clamp(18px, 2.4vw, 42px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  min-height: 44px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
  cursor: default;
  transition: background 0.12s ease, box-shadow 0.12s ease;
}

button.jep-cell {
  cursor: pointer;
}

button.jep-cell:hover,
button.jep-cell:focus-visible {
  background: linear-gradient(180deg, #14279b 0%, #0d1a70 100%);
  box-shadow:
    inset 0 0 0 1px rgba(240, 205, 115, 0.55),
    0 0 26px rgba(20, 40, 160, 0.55);
  outline: none;
}

.jep-cell.is-done {
  background: #040b30;
  box-shadow: inset 0 0 0 1px rgba(120, 140, 220, 0.07);
  color: rgba(200, 215, 255, 0.18);
}

.jep-cell.is-empty {
  background: #040b30;
  box-shadow: inset 0 0 0 1px rgba(120, 140, 220, 0.07);
}

.jep-cell.is-open {
  box-shadow:
    inset 0 0 0 2px var(--jep-gold),
    0 0 30px rgba(201, 162, 74, 0.35);
}

/* Side panels ------------------------------------------------------------- */

[hidden] {
  display: none !important;
}

.jep-panel {
  padding: 16px;
  border: 1px solid var(--jep-line);
  border-radius: var(--jep-radius);
  background: var(--jep-panel);
}

.jep-panel__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
  color: var(--jep-dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.jep-players {
  display: grid;
  gap: 8px;
}

.jep-player {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--jep-line);
  border-radius: 10px;
  background: #0a142c;
}

.jep-player__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jep-player__score {
  color: var(--jep-gold-2);
  font-family: var(--jep-board-font);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* A seat's place in the game, left of the name like a podium. */
.jep-player__rank {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(140, 160, 255, 0.1);
  color: var(--jep-dim);
  font-family: var(--jep-board-font);
  font-size: 12px;
  font-weight: 700;
}

.jep-player.is-leader {
  border-color: rgba(201, 162, 74, 0.55);
  background: linear-gradient(180deg, rgba(201, 162, 74, 0.1), #0a142c);
}

.jep-player.is-leader .jep-player__rank {
  background: var(--jep-gold);
  color: #1a1405;
}

.jep-player.is-negative .jep-player__score {
  color: var(--jep-red);
}

.jep-player__tools {
  display: flex;
  gap: 4px;
}

.jep-player__tools button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--jep-line-2);
  border-radius: 7px;
  background: #0d1730;
  color: var(--jep-dim);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.jep-player__tools button:hover {
  border-color: var(--jep-gold);
  color: var(--jep-ink);
}

.jep-add {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.jep-add input {
  flex: 1;
  min-width: 0;
}

.jep-add button {
  padding: 8px 12px;
  border: 1px solid var(--jep-line-2);
  border-radius: 9px;
  background: transparent;
  color: var(--jep-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.jep-buzzes {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jep-buzzes li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--jep-line);
  border-radius: 9px;
  background: #0a142c;
  font-size: 13px;
}

.jep-buzzes li span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--jep-gold);
  color: #111;
  font-size: 11px;
  font-weight: 800;
}

.jep-buzzes li.is-empty {
  border-style: dashed;
  color: var(--jep-dim);
  font-style: italic;
}

.jep-buzzes__tools {
  display: flex;
  gap: 4px;
  margin-left: auto;
  font-style: normal;
}

.jep-buzzes__tools button {
  padding: 3px 7px;
  border: 1px solid var(--jep-line-2);
  border-radius: 7px;
  background: #0d1730;
  color: var(--jep-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.jep-buzzes__tools button:hover {
  border-color: var(--jep-gold);
  color: var(--jep-ink);
}

.jep-tapbuzz {
  margin-top: 10px;
}

.jep-tapbuzz__row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.jep-tapbuzz__row button {
  padding: 7px 11px;
  border: 1px solid var(--jep-line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--jep-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.jep-tapbuzz__row button:hover:not(:disabled) {
  border-color: var(--jep-gold);
  color: var(--jep-gold-2);
}

.jep-tapbuzz__row button:disabled {
  opacity: 0.4;
  cursor: default;
}

.jep-buzz {
  width: 100%;
  padding: 22px;
  border: 0;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, #ff7b3d, #c31d1d);
  box-shadow: 0 12px 30px rgba(195, 29, 29, 0.35);
  color: #fff;
  font: inherit;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.jep-buzz:disabled {
  opacity: 0.5;
  cursor: default;
}

.jep-buzz--inline {
  width: auto;
  padding: 10px 22px;
  font-size: 15px;
}

.jep-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Clue modal -------------------------------------------------------------- */

.jep-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 6, 18, 0.82);
  backdrop-filter: blur(4px);
}

.jep-modal__card {
  display: flex;
  flex-direction: column;
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--jep-line-2);
  border-radius: 18px;
  background: linear-gradient(180deg, #0f1b3c, #0a1228);
  box-shadow: var(--jep-shadow);
}

.jep-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 12px;
  border-bottom: 4px solid var(--jep-blue);
}

.jep-modal__head h2 {
  color: var(--jep-gold-2);
  font-size: clamp(28px, 4vw, 44px);
}

.jep-modal__close {
  border: 0;
  background: none;
  color: var(--jep-dim);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.jep-modal__body {
  padding: 22px;
}

.jep-clue {
  margin: 0;
  color: var(--jep-ink);
  font-size: clamp(20px, 2.6vw, 34px);
  font-weight: 600;
  line-height: 1.3;
}

/* The archive's pictures and clips, lifted out of the clue text. */
.jep-media {
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--jep-line-2);
  border-radius: 12px;
  background: rgba(2, 6, 22, 0.6);
  text-align: center;
}

.jep-media img {
  display: block;
  max-width: 100%;
  max-height: 42vh;
  margin: 0 auto;
  border-radius: 8px;
  background: #000;
}

.jep-media audio {
  width: 100%;
}

.jep-media__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--jep-gold);
  border-radius: 999px;
  color: var(--jep-gold-2);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.jep-media__link:hover {
  background: rgba(201, 162, 74, 0.12);
}

.jep-media__note {
  margin: 8px 0 0;
  color: var(--jep-faint);
  font-size: 12px;
}

/* Where and when the clue first aired, in small type under the clue. */
.jep-clue__meta {
  margin: 14px 0 0;
  color: var(--jep-faint);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.jep-answer {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(53, 208, 127, 0.4);
  border-radius: 12px;
  background: rgba(53, 208, 127, 0.1);
}

.jep-answer span {
  display: block;
  margin-bottom: 4px;
  color: var(--jep-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.jep-answer p {
  margin: 0;
  color: #fff;
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 700;
}

.jep-host-answer {
  margin: 14px 0 0;
  color: var(--jep-gold);
  font-size: 13px;
  font-style: italic;
}

.jep-selfscore {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(214, 159, 76, 0.35);
  border-radius: 10px;
  background: rgba(214, 159, 76, 0.08);
  color: var(--jep-dim);
  font-size: 13px;
}

.jep-selfscore label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jep-selfscore input {
  width: 92px;
}

.jep-modal__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--jep-line);
}

.jep-buzzes-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--jep-dim);
  font-size: 12px;
}

.jep-awards,
.jep-wager__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jep-awards span,
.jep-wager__buttons span {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--jep-line);
  border-radius: 999px;
  font-size: 12px;
}

.jep-awards button,
.jep-wager__buttons button,
.jep-final__wagers button {
  padding: 4px 8px;
  border: 1px solid var(--jep-line-2);
  border-radius: 7px;
  background: #0d1730;
  color: var(--jep-ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.jep-wager {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}

.jep-wager label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--jep-dim);
  font-size: 13px;
}

.jep-wager input {
  width: 140px;
}

/* Final Jeopardy ---------------------------------------------------------- */

.jep-final {
  padding: 28px;
  border: 1px solid var(--jep-line);
  border-radius: var(--jep-radius);
  background: linear-gradient(180deg, #0f1b3c, #0a1228);
  text-align: center;
}

.jep-final__cat {
  margin: 0 0 20px;
  color: var(--jep-gold-2);
  font-size: clamp(24px, 3.4vw, 40px);
  text-transform: uppercase;
}

.jep-final .jep-clue {
  max-width: 70ch;
  margin: 0 auto;
}

.jep-final .jep-answer {
  max-width: 70ch;
  margin: 22px auto 0;
  text-align: left;
}

.jep-final .jep-btn {
  margin-top: 18px;
}

.jep-final__wagers {
  display: grid;
  gap: 8px;
  margin-top: 22px;
  text-align: left;
}

.jep-wager-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--jep-line);
  border-radius: 10px;
}

.jep-wager-row span {
  flex: 1;
}

.jep-wager-row input {
  width: 110px;
}

.jep-ranking {
  display: grid;
  gap: 8px;
  max-width: 460px;
  margin: 20px auto 0;
  padding: 0;
  list-style: none;
}

.jep-ranking li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--jep-line);
  border-radius: 10px;
  text-align: left;
}

.jep-ranking li span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--jep-gold);
  color: #111;
  font-size: 12px;
  font-weight: 800;
}

.jep-ranking li b {
  margin-left: auto;
  color: var(--jep-gold-2);
}

/* Toast ------------------------------------------------------------------- */

.jep-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  max-width: min(520px, 90vw);
  padding: 12px 18px;
  border: 1px solid var(--jep-line-2);
  border-radius: 999px;
  background: #0f1b3c;
  color: var(--jep-ink);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.jep-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.jep-toast.is-error {
  border-color: rgba(255, 90, 95, 0.6);
  color: #ffd2d3;
}

/* Creators (boards.php) --------------------------------------------------- */

.jep-hero--tight {
  padding: 10px 0 22px;
}

.jep-hero--tight h1 {
  font-size: clamp(30px, 4.4vw, 52px);
}

.jep-landing__grid--wide {
  max-width: 1180px;
  align-items: start;
}

.jep-picker-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0 12px;
}

.jep-stats__fine {
  color: var(--jep-faint);
  font-size: 12px;
}

.jep-link-inline {
  color: var(--jep-gold-2);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.jep-link-inline:hover {
  text-decoration: underline;
}

.jep-subhead {
  margin: 22px 0 10px;
  color: var(--jep-dim);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.jep-custom-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.jep-custom-row__value {
  color: var(--jep-gold-2);
  font-family: var(--jep-board-font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.jep-custom-row input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--jep-line-2);
  border-radius: 9px;
  background: #070f22;
  color: var(--jep-ink);
  font: inherit;
  font-size: 14px;
}

.jep-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--jep-line);
  border-radius: 10px;
}

.jep-slots legend {
  padding: 0 6px;
  color: var(--jep-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.jep-slots input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--jep-line-2);
  border-radius: 9px;
  background: #070f22;
  color: var(--jep-ink);
  font: inherit;
  font-size: 14px;
  text-transform: uppercase;
}

.jep-board-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jep-board-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--jep-line);
  border-radius: 10px;
  background: #0a142c;
}

.jep-board-list__name {
  font-weight: 700;
}

.jep-board-list__meta {
  color: var(--jep-faint);
  font-size: 12px;
}

.jep-board-list__tools {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.jep-btn--tiny {
  padding: 5px 10px;
  font-size: 12px;
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1060px) {
  .jep-layout {
    grid-template-columns: 1fr;
  }

  .jep-side {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 860px) {
  .jep-landing__grid {
    grid-template-columns: 1fr;
  }

  .jep-hero h1 {
    font-size: clamp(40px, 14vw, 64px);
  }
}

@media (max-width: 640px) {
  .jep-main {
    padding: 16px 12px 60px;
  }

  .jep-bar {
    flex-wrap: wrap;
  }

  .jep-stage {
    overflow-x: auto;
  }

  .jep-board {
    /* On a phone the board scrolls sideways, so it keeps a fixed width and a
       taller ratio: squeezing six columns into 390px would give letterbox
       cells again, which is the whole thing being fixed here. */
    --jep-ratio: 1.45;
    width: 660px;
    min-width: 660px;
  }

  .jep-final {
    padding: 18px;
  }

  .jep-modal__card {
    max-height: calc(100vh - 24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
