/* ==========================================================================
   Deadline FPL — /play
   Loaded only on the game pages, on top of style.css. Mobile first.
   ========================================================================== */

.play-wrap { max-width: 720px; margin-inline: auto; }
.play-number { color: var(--accent); }

/* A club as text on its own colours. Deliberately not a crest. */
.team-tag {
  display: inline-block;
  min-width: 3.1em;
  padding: 2px 7px 2px 9px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  border-left: 5px solid var(--club-a);
  box-shadow: inset 3px 0 0 var(--club-b);
  background: var(--bg-raised);
  color: var(--text);
  font-family: var(--display);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .04em;
  text-align: center;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Kneejerk board
   -------------------------------------------------------------------------- */

.play-game { margin-block: 26px 40px; min-height: 200px; }

.kj-cols, .kj-tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}
.kj-cols {
  margin-bottom: 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-faint);
}

.kj-board { list-style: none; margin: 0; padding: 0; }
.kj-row { margin-bottom: 12px; }
.kj-who { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.kj-n {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-faint);
  min-width: 1.1em;
}
.kj-who .pname { font-weight: 600; }
.kj-row.correct .pname { color: var(--accent); }

/* Each clue says the same thing three ways: colour, border style and a glyph.
   Green/solid/tick, amber/dashed/arrow + "close", grey/plain/arrow or cross. */
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 62px;
  padding: 6px 2px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-muted);
  text-align: center;
  animation: tile-in .28s ease-out both;
}
.tile:nth-child(2) { animation-delay: .06s; }
.tile:nth-child(3) { animation-delay: .12s; }
.tile:nth-child(4) { animation-delay: .18s; }
.tile:nth-child(5) { animation-delay: .24s; }
@keyframes tile-in { from { opacity: 0; transform: translateY(5px); } }

.tile-v {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.1;
  color: var(--text);
  white-space: nowrap;
}
.tile-i { display: flex; align-items: center; gap: 3px; font-size: .78rem; line-height: 1; }
.tile-icon { font-size: .86rem; }
.tile-note { font-size: .66rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

.tile.hit { background: rgba(63, 208, 124, .16); border-color: var(--accent); color: var(--accent); }
.tile.close { background: rgba(255, 179, 64, .12); border: 2px dashed var(--amber); color: var(--amber); }
.tile.miss .tile-v { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Guess entry
   -------------------------------------------------------------------------- */

.kj-status { min-height: 1.4em; margin: 4px 0 8px; color: var(--amber); font-size: .92rem; }
.kj-entry { margin-top: 6px; }
.kj-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .86rem;
  color: var(--text-muted);
}
.kj-combo { position: relative; }
.kj-input { width: 100%; font-size: 1.05rem; padding-block: 13px; }
.kj-count { margin-top: 8px; color: var(--text-faint); font-size: .86rem; }

.kj-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.kj-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.kj-opt[aria-selected="true"], .kj-opt:hover { background: var(--bg-hover); }
.kj-opt-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.kj-opt-full {
  color: var(--text-faint);
  font-size: .78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kj-none { padding: 12px 8px; color: var(--text-faint); }

/* --------------------------------------------------------------------------
   End screen
   -------------------------------------------------------------------------- */

.kj-end { margin-top: 26px; }
.kj-result, .hl-over { padding: 22px 18px; text-align: center; }
.kj-verdict {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--text);
}
.kj-answer-name { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.kj-answer-name h2 { margin: 0; font-size: clamp(1.7rem, 7vw, 2.4rem); }
.kj-answer-club { margin: 4px 0 0; color: var(--text-muted); }
.kj-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 0; }
.kj-facts dt {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.kj-facts dd { margin: 2px 0 0; font-family: var(--display); font-weight: 700; font-size: 1.5rem; color: var(--text); }

.kj-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.kj-actions .btn { min-height: 48px; padding-inline: 26px; font-size: 1.05rem; }
.kj-next { margin: 16px 0 0; color: var(--text-muted); }
.kj-next + .btn { margin-top: 12px; }
.kj-clock { font-family: var(--mono); color: var(--text); }
.kj-more { margin: 18px 0 0; text-align: center; }

.play-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-dim);
  background: var(--accent-glow);
  color: var(--text);
}
.play-cta:hover { text-decoration: none; background: rgba(63, 208, 124, .2); }
.play-cta-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.play-cta-kicker {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.play-cta-title { font-family: var(--display); font-weight: 700; font-size: 1.5rem; text-transform: uppercase; }
.play-cta-text { color: var(--text-muted); font-size: .92rem; }
.play-cta-go { font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--accent); white-space: nowrap; }

.kj-stats { margin-top: 30px; }
.kj-stats h3 { text-transform: uppercase; }
.kj-stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 18px; }
.kj-stat { display: flex; flex-direction: column; align-items: center; text-align: center; }
.kj-stat-v { font-family: var(--display); font-weight: 700; font-size: 1.7rem; color: var(--text); }
.kj-stat-k { font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.kj-dist-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.kj-dist-k { width: 1em; font-family: var(--mono); font-size: .78rem; color: var(--text-faint); }
.kj-dist-bar {
  min-width: 1.8em;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--bg-hover);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: .76rem;
  text-align: right;
}
.kj-dist-row.mine .kj-dist-bar { background: var(--accent-dim); color: #04140d; font-weight: 700; }

/* --------------------------------------------------------------------------
   Ads on /play. Kept well away from anything tappable, and given their
   height up front so the page does not move when one arrives.
   -------------------------------------------------------------------------- */

.play-ad, .play-ad.filled { margin-block: 56px 32px; min-height: 280px; }

/* --------------------------------------------------------------------------
   Higher or Lower
   -------------------------------------------------------------------------- */

.hl-score {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hl-score strong { color: var(--text); font-size: 1.4rem; margin-left: 4px; }

/* Side by side even on a phone, so both players and both buttons fit on one
   screen without scrolling. */
.hl-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
.hl-vs {
  display: none;
  justify-self: center;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-faint);
}
.hl-card { padding: 14px 8px; text-align: center; border-width: 2px; min-width: 0; }
.hl-who { display: flex; justify-content: center; align-items: center; gap: 8px; }
.hl-name { margin: 10px 0 0; font-size: 1.3rem; text-transform: uppercase; overflow-wrap: anywhere; }
.hl-full { margin: 0; color: var(--text-faint); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-own { display: flex; flex-direction: column; align-items: center; margin: 10px 0 0; }
.hl-own-k { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.hl-own-v { font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1.1; color: var(--text); }
.hl-mark { margin-top: 4px; font-weight: 600; }
.hl-card.right { border-color: var(--accent); }
.hl-card.right .hl-mark { color: var(--accent); }
.hl-card.wrong { border-style: dashed; border-color: #ff8080; }
.hl-card.wrong .hl-mark { color: #ff8080; }

.hl-q { margin: 18px 0 12px; text-align: center; color: var(--text-muted); }
.hl-q strong { color: var(--text); }
.hl-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hl-btn { min-height: 56px; font-size: 1.15rem; }
.hl-reveal, .hl-best { margin: 0 0 6px; color: var(--text-muted); }
.hl-reveal strong { color: var(--text); }

/* --------------------------------------------------------------------------
   Hub, legend, footer note
   -------------------------------------------------------------------------- */

.hub-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-block: 26px; }
.hub-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  color: var(--text);
  border-top: 3px solid var(--accent);
}
.hub-card:hover { text-decoration: none; background: var(--bg-hover); }
.hub-card h2 { margin: 0; }
.hub-card p { margin: 0; color: var(--text-muted); }
.hub-kicker {
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}
.hub-meta { font-family: var(--mono); font-size: .8rem; color: var(--text-faint); min-height: 1.3em; }
.hub-go { margin-top: 6px; font-family: var(--display); font-weight: 700; font-size: 1.1rem; color: var(--accent); }

.legend { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 14px 0 20px; padding: 0; list-style: none; }
.legend li { display: flex; align-items: center; gap: 12px; margin: 0; }
.legend .tile { flex: 0 0 76px; min-height: 54px; animation: none; }

.play-disclaimer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: .84rem;
}

@media (min-width: 620px) {
  .hub-grid { grid-template-columns: 1fr 1fr; }
  .hl-pair { grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
  .hl-vs { display: block; }
  .hl-card { padding: 18px; }
  .hl-name { font-size: 1.6rem; }
  .hl-own-v { font-size: 2.3rem; }
  .tile { min-height: 68px; }
  .tile-v { font-size: 1.15rem; }
  .kj-result, .hl-over { padding: 28px; }
}

@media (max-width: 380px) {
  .tile-v { font-size: .9rem; }
  .tile-note { font-size: .58rem; letter-spacing: .02em; }
  .play-cta { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { animation: none; }
}
