/* X9 OUT — player-facing tactical theme. Dark olive base, lime accent.
 * Mobile-first, system font stack, no framework. Override Drupal's default
 * Stark theme on the player routes only. */

:root {
  --x9-bg:        #0a0e0a;
  --x9-bg-card:   #11160e;
  --x9-fg:        #e6edd8;
  --x9-fg-dim:    #9ca78a;
  --x9-accent:    #a3e635;
  --x9-accent-dim:#5c6e3e;
  --x9-warn:      #fbbf24;
  --x9-danger:    #ef4444;
  --x9-ok:        #22c55e;
  --x9-border:    #2a3520;
  --x9-radius:    8px;
  --x9-mono:      "Courier New", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Reset Drupal's body styles on these pages */
html, body { background: var(--x9-bg); color: var(--x9-fg); margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--x9-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================== */
/* Shell                                                          */
/* ============================================================== */
.x9-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.x9-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--x9-border);
  font-family: var(--x9-mono);
  gap: 1rem;
}

.x9-topbar__right {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.x9-brand {
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  color: var(--x9-fg);
  text-decoration: none;
}
.x9-brand .x9-mode {
  color: var(--x9-accent);
  margin-left: 0.25rem;
}

.x9-main {
  flex: 1;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.x9-h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}

.x9-muted { color: var(--x9-fg-dim); }

/* ============================================================== */
/* Tags / chips                                                   */
/* ============================================================== */
.x9-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--x9-accent-dim);
  border-radius: 999px;
  font-family: var(--x9-mono);
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--x9-accent);
}
.x9-tag--code  { background: rgba(163, 230, 53, 0.08); }
.x9-tag--live  { color: var(--x9-warn); border-color: var(--x9-warn); }
.x9-tag--hint  { background: var(--x9-warn); color: var(--x9-bg); border-color: var(--x9-warn); }
.x9-tag--done  { background: var(--x9-ok); color: var(--x9-bg); border-color: var(--x9-ok); }

/* ============================================================== */
/* Game listing                                                   */
/* ============================================================== */
.x9-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.x9-cards--rows { grid-template-columns: 1fr; }   /* one game per line — 200+ safe */
.x9-card {
  background: var(--x9-bg-card);
  border: 1px solid var(--x9-border);
  border-radius: var(--x9-radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, transform 0.15s;
}
.x9-card:hover { border-color: var(--x9-accent); }
.x9-card__title { margin: 0.5rem 0 0.25rem; font-size: 1.25rem; color: var(--x9-fg); }
.x9-card__desc { margin: 0; color: var(--x9-fg-dim); font-size: 0.95rem; }
.x9-card__meta {
  margin-top: auto;
  padding-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  color: var(--x9-fg-dim);
  font-family: var(--x9-mono);
  font-size: 0.85rem;
}

/* ============================================================== */
/* Team picker                                                    */
/* ============================================================== */
.x9-teams {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.x9-team-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 1rem;
  padding: 1rem 1.25rem;
  background: var(--x9-bg-card);
  border: 1px solid var(--x9-border);
  border-left: 4px solid var(--x9-accent-dim);
  border-radius: var(--x9-radius);
  color: var(--x9-fg);
  text-decoration: none;
  transition: border-color 0.15s;
}
.x9-team-card:hover {
  border-color: var(--x9-accent);
  border-left-color: var(--x9-accent);
  text-decoration: none;
}
.x9-team-name { font-weight: 700; font-size: 1.1rem; }
.x9-team-progress { grid-column: 1; color: var(--x9-fg-dim); font-family: var(--x9-mono); font-size: 0.85rem; }
.x9-team-points {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  font-family: var(--x9-mono);
  font-size: 1.5rem;
  color: var(--x9-accent);
}

/* ============================================================== */
/* Game play — mission card                                       */
/* ============================================================== */
.x9-team-stat { display: flex; gap: 1rem; align-items: center; font-size: 0.95rem; }
.x9-team-stat .x9-points-now { color: var(--x9-fg-dim); }
.x9-team-stat .x9-points-now strong { color: var(--x9-accent); font-family: var(--x9-mono); font-size: 1.1rem; }

.x9-mission {
  background: var(--x9-bg-card);
  border: 1px solid var(--x9-border);
  border-radius: var(--x9-radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.x9-mission__title {
  margin: 0.75rem 0 1rem;
  font-size: clamp(1.5rem, 5vw, 2rem);
  letter-spacing: -0.01em;
}
.x9-mission__body {
  color: var(--x9-fg-dim);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Hints */
.x9-hints {
  border-top: 1px dashed var(--x9-accent-dim);
  padding-top: 1.25rem;
  margin: 1.25rem 0;
}
.x9-hints__title {
  font-family: var(--x9-mono);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--x9-warn);
  margin: 0 0 0.75rem;
}
.x9-hint {
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-left: 3px solid var(--x9-warn);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
}
.x9-hint h3 { margin: 0.5rem 0 0.25rem; font-size: 1rem; color: var(--x9-fg); }
.x9-hint p { margin: 0; color: var(--x9-fg-dim); font-size: 0.95rem; }

/* Code form */
.x9-code {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.x9-code__label {
  font-family: var(--x9-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--x9-fg-dim);
}
.x9-code__row {
  display: flex;
  gap: 0.5rem;
}
.x9-code__input {
  flex: 1;
  background: var(--x9-bg);
  color: var(--x9-fg);
  border: 1px solid var(--x9-accent-dim);
  border-radius: var(--x9-radius);
  padding: 0.75rem 1rem;
  font-family: var(--x9-mono);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.x9-code__input:focus {
  border-color: var(--x9-accent);
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.2);
}
.x9-code__input::placeholder {
  color: var(--x9-fg-dim);
  letter-spacing: 0.1em;
}

/* Buttons */
.x9-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--x9-accent);
  border-radius: var(--x9-radius);
  background: transparent;
  color: var(--x9-accent);
  font-family: var(--x9-mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.x9-btn--primary {
  background: var(--x9-accent);
  color: var(--x9-bg);
}
.x9-btn--primary:hover { background: var(--x9-fg); border-color: var(--x9-fg); text-decoration: none; }
.x9-btn--ghost {
  border-color: var(--x9-border);
  color: var(--x9-fg-dim);
  font-size: 0.85rem;
}
.x9-btn--ghost:hover { color: var(--x9-accent); border-color: var(--x9-accent); text-decoration: none; }
.x9-btn:disabled { opacity: 0.5; cursor: wait; }

/* Feedback area */
.x9-feedback {
  display: block;
  margin-top: 1rem;
  min-height: 1.5rem;
  font-family: var(--x9-mono);
  font-size: 0.95rem;
}
.x9-feedback.is-correct {
  color: var(--x9-ok);
}
.x9-feedback.is-wrong {
  color: var(--x9-danger);
  animation: x9-shake 0.4s;
}
.x9-feedback.is-info {
  color: var(--x9-warn);
}
@keyframes x9-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
}

/* Finish state */
.x9-finish { text-align: center; }
.x9-finish__score {
  font-family: var(--x9-mono);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--x9-accent);
  margin: 1rem 0;
  letter-spacing: 0.05em;
}

/* Footer */
.x9-foot {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0;
  font-family: var(--x9-mono);
  font-size: 0.8rem;
}

/* ============================================================== */
/* Team picker — action row + create button                       */
/* ============================================================== */
.x9-team-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 0.5rem;
}

/* ============================================================== */
/* Join form                                                      */
/* ============================================================== */
.x9-join-form { margin-top: 1.5rem; }

/* ============================================================== */
/* Scoreboard                                                     */
/* ============================================================== */
.x9-scoreboard__table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  background: var(--x9-bg-card);
  border: 1px solid var(--x9-border);
  border-radius: var(--x9-radius);
  overflow: hidden;
  font-family: var(--x9-mono);
}
.x9-scoreboard__table thead {
  background: rgba(163, 230, 53, 0.05);
  border-bottom: 1px solid var(--x9-accent-dim);
}
.x9-scoreboard__table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--x9-fg-dim);
  font-weight: 600;
}
.x9-scoreboard__table td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--x9-border);
}
.x9-sb-rank { width: 2.5rem; color: var(--x9-fg-dim); text-align: right; }
.x9-sb-team { font-family: -apple-system, system-ui, sans-serif; font-weight: 600; color: var(--x9-fg); }
.x9-sb-level { width: 4rem; color: var(--x9-fg-dim); }
.x9-sb-points { width: 5rem; color: var(--x9-accent); font-weight: 700; text-align: right; }
.x9-sb-pen { width: 4.5rem; color: var(--x9-danger); text-align: right; }
.x9-sb-finish { width: 5.5rem; color: var(--x9-fg-dim); font-variant-numeric: tabular-nums; }
.x9-sb-status { width: 6rem; }

.x9-sb-row--done .x9-sb-finish { color: var(--x9-accent); font-weight: 700; }

.x9-sb-row:hover { background: rgba(163, 230, 53, 0.04); }
.x9-sb-row--done .x9-sb-team { color: var(--x9-ok); }
.x9-sb-row--done .x9-sb-rank { color: var(--x9-ok); font-weight: 700; }

@media (max-width: 540px) {
  .x9-sb-level { display: none; }
  .x9-scoreboard__table th:nth-child(3) { display: none; }
}

/* ── Mission blocks (rich body: text/image/youtube/map/button) ─────────── */
.mission-blocks { display: grid; gap: 1rem; }
.mb-heading { color: var(--x9-accent); margin: 0.5rem 0 0; font-size: 1.15rem; }
.mb-text { margin: 0; white-space: pre-line; }
.mb-large { font-size: 1.15rem; }
.mb-img { max-width: 100%; border-radius: 10px; display: block; }
.mb-yt { position: relative; aspect-ratio: 16 / 9; }
.mb-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 10px; }
.mb-map-live { height: 300px; border-radius: 10px; border: 1px solid var(--x9-border); z-index: 0; }
.mb-map-label { margin: 0 0 0.4rem; font-weight: 700; }
.mb-map-links { margin: 0.4rem 0 0; font-size: 0.85rem; }
.mb-btn { display: inline-block; }

/* ── DEMO/DEBUG codes reveal (temporary game setting) ─────────────────── */
.x9-debug-codes {
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--x9-warn, #fbbf24);
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.08);
  color: var(--x9-warn, #fbbf24);
  font-size: 0.85rem;
}
.x9-debug-codes code { color: #fde68a; font-weight: 700; }
.x9-debug-codes__tag {
  font-family: "Courier New", monospace;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-right: 0.5rem;
}

/* ── Scoreboard level matrix ───────────────────────────────────────────── */
/* The matrix needs room — widen the shell on the scoreboard page while
   keeping it inside the viewport; overflow scrolls inside the table wrap. */
.x9-scoreboard--wide .x9-main { max-width: 98vw; }
.x9-scoreboard__table { width: 100%; }
.x9-sb-scroll { overflow-x: auto; }
/* Tight cells so many levels fit before any scroll kicks in. */
.x9-scoreboard--wide .sb-lv, .x9-scoreboard--wide .sb-lv-head { padding: 4px 6px; font-size: 0.8rem; }
.sb-lv-head { text-align: center; white-space: nowrap; cursor: help; }
.sb-lv {
  text-align: center;
  vertical-align: middle;
  padding: 0.35rem 0.5rem;
  min-width: 92px;
  font-size: 0.8rem;
  line-height: 1.35;
}
.sb-lv--done {
  background: rgba(163, 230, 53, 0.13);
  box-shadow: inset 2px 0 0 var(--x9-accent);
}
.sb-lv--done .sb-lv-pos { color: var(--x9-accent); font-weight: 700; display: block; }
.sb-lv--done .sb-lv-time { color: var(--x9-fg-dim); display: block; }
.sb-lv--done .sb-lv-pts { color: var(--x9-fg); font-weight: 700; display: block; }
.sb-lv--failed {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sb-lv--current {
  outline: 1px dashed var(--x9-accent-dim);
  outline-offset: -3px;
  color: var(--x9-accent);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sb-lv--pending { color: var(--x9-fg-dim); }

/* ── PhotoHunt ─────────────────────────────────────────────────────────── */
.sb-lv--review {
  background: rgba(251, 191, 36, 0.12);
  color: var(--x9-warn, #fbbf24);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.x9-photo-task { margin-top: 1rem; display: grid; gap: 0.75rem; }
.x9-photo-img { max-width: 100%; max-height: 340px; border-radius: 10px; display: block; }
.x9-card--done { opacity: 0.75; }
.x9-feedback.is-info { display: block; }
.x9-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.x9-gallery__item {
  margin: 0; background: var(--x9-bg-card);
  border: 1px solid var(--x9-border); border-radius: 12px; overflow: hidden;
}
.x9-gallery__item img { width: 100%; height: 200px; object-fit: cover; display: block; }
.x9-gallery__item figcaption { padding: 0.6rem 0.75rem; font-size: 0.85rem; }
.x9-gallery__pts { color: var(--x9-accent); font-weight: 700; margin-left: 0.4rem; }

/* ── Locked tasks (manual unlock / future group) + public notes ────────── */
.x9-card--locked { opacity: 0.55; }
.x9-tag--locked { color: var(--x9-fg-dim); border-color: var(--x9-fg-dim); }
.x9-public-notes {
  border-left: 2px solid var(--x9-accent-dim);
  padding-left: 0.75rem;
  font-size: 0.9rem;
}

/* ============================================================== */
/* Player profile                                                 */
/* ============================================================== */
.x9-profile { max-width: 860px; margin: 0 auto; width: 100%; box-sizing: border-box; }

.x9-profile-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--x9-bg-card);
  border: 1px solid var(--x9-border);
  border-radius: var(--x9-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.x9-profile-card__avatar { display: flex; flex-direction: column; gap: 0.6rem; align-items: center; }
.x9-avatar {
  width: 140px; height: 140px;
  border-radius: var(--x9-radius);
  object-fit: cover;
  border: 1px solid var(--x9-border);
  background: var(--x9-bg);
  display: block;
}
.x9-avatar--empty {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--x9-mono); font-size: 3.5rem; font-weight: 900;
  color: var(--x9-accent-dim);
}
.x9-avatar-form__btn { font-size: 0.75rem; padding: 0.3rem 0.7rem; cursor: pointer; }
.x9-profile-card__info { flex: 1; min-width: 240px; }
.x9-profile-fullname { color: var(--x9-warn); font-weight: 700; margin-top: 0.15rem; }
.x9-profile-rank { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin: 0.75rem 0; }
.x9-profile-points { font-family: var(--x9-mono); font-size: 1.4rem; color: var(--x9-accent); font-weight: 700; }
.x9-profile-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; margin: 0.75rem 0 0; font-size: 0.95rem; }
.x9-profile-facts dt { color: var(--x9-fg-dim); }
.x9-profile-facts dd { margin: 0; }

.x9-tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  border-bottom: 1px solid var(--x9-border);
  margin-bottom: 1.25rem;
}
.x9-tab {
  background: none; border: 1px solid transparent; border-bottom: none;
  color: var(--x9-fg-dim); font-family: var(--x9-mono); font-size: 0.9rem;
  padding: 0.5rem 0.9rem; cursor: pointer;
  border-radius: var(--x9-radius) var(--x9-radius) 0 0;
}
.x9-tab:hover { color: var(--x9-fg); }
.x9-tab.is-active {
  color: var(--x9-accent);
  border-color: var(--x9-border);
  background: var(--x9-bg-card);
  margin-bottom: -1px;
}
.x9-pane { display: none; }
.x9-pane.is-active { display: block; }

.x9-block {
  background: var(--x9-bg-card);
  border: 1px solid var(--x9-border);
  border-radius: var(--x9-radius);
  margin-bottom: 0.75rem;
}
.x9-block > summary {
  cursor: pointer; padding: 0.75rem 1rem;
  font-family: var(--x9-mono); font-weight: 700; color: var(--x9-fg);
  list-style: none; display: flex; align-items: center; gap: 0.6rem;
}
.x9-block > summary::before { content: '▸'; color: var(--x9-accent); transition: transform 0.15s; }
.x9-block[open] > summary::before { transform: rotate(90deg); }
.x9-block-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.x9-block-table th, .x9-block-table td { padding: 0.5rem 1rem; border-top: 1px solid var(--x9-border); text-align: left; }
.x9-block-table th { color: var(--x9-fg-dim); font-weight: 400; width: 40%; }
.x9-block-body { padding: 0.25rem 1rem 1rem; white-space: pre-line; color: var(--x9-fg); }
.x9-block--edit { border-color: var(--x9-accent-dim); }

.x9-profile-form { padding: 0.5rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.x9-profile-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.x9-profile-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--x9-fg-dim); }
.x9-profile-form .x9-code__input { width: 100%; box-sizing: border-box; }
.x9-profile-form button { align-self: flex-start; }

.x9-table-scroll { overflow-x: auto; }
.x9-games-table thead th { color: var(--x9-fg-dim); font-family: var(--x9-mono); font-size: 0.8rem; border-top: none; width: auto; }

.x9-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.x9-stat {
  background: var(--x9-bg-card); border: 1px solid var(--x9-border);
  border-radius: var(--x9-radius); padding: 1rem; text-align: center;
}
.x9-stat__num { display: block; font-family: var(--x9-mono); font-size: 1.6rem; font-weight: 700; color: var(--x9-accent); }
.x9-stat__label { color: var(--x9-fg-dim); font-size: 0.85rem; }

.x9-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.x9-photo-cell {
  margin: 0; background: var(--x9-bg-card);
  border: 1px solid var(--x9-border); border-radius: var(--x9-radius);
  overflow: hidden;
}
.x9-photo-cell img { width: 100%; height: 150px; object-fit: cover; display: block; }
.x9-photo-cell figcaption { padding: 0.5rem 0.75rem; font-size: 0.8rem; }

/* ---- Shared nav + breadcrumbs (play/_nav.html.twig) -------------------- */
.x9-nav { display: flex; gap: 1rem; font-family: var(--x9-mono); font-size: 0.85rem; }
.x9-nav a { color: var(--x9-fg-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.x9-nav a:hover { color: var(--x9-accent); }
.x9-nav-user { font-size: 0.85rem; white-space: nowrap; }
.x9-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  padding: 0.45rem 1.25rem; font-family: var(--x9-mono); font-size: 0.8rem;
  border-bottom: 1px solid var(--x9-border); color: var(--x9-fg-dim);
  background: rgba(163, 230, 53, 0.03);
}
.x9-crumbs a { color: var(--x9-fg-dim); }
.x9-crumbs a:hover { color: var(--x9-accent); }
.x9-crumbs__sep { color: var(--x9-accent-dim); }
.x9-crumbs__here { color: var(--x9-fg); }
@media (max-width: 640px) {
  .x9-nav { display: none; } /* small screens: brand + crumbs carry navigation */
}

/* ---- Game info panel + podium (play/teams.html.twig) ------------------- */
.x9-h2 { font-size: 1.1rem; margin: 1.75rem 0 0.75rem; letter-spacing: 0.02em; }
.x9-gameinfo {
  background: var(--x9-bg-card); border: 1px solid var(--x9-border);
  border-radius: var(--x9-radius); padding: 1rem 1.25rem 1.25rem; margin: 1rem 0;
}
.x9-gameinfo .x9-h2 { margin-top: 0; }
.x9-gameinfo__grid {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.25rem; margin: 0;
}
.x9-gameinfo__grid dt { color: var(--x9-fg-dim); font-size: 0.85rem; }
.x9-gameinfo__grid dd { margin: 0; font-size: 0.9rem; }
.x9-podium { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.x9-podium th {
  text-align: left; color: var(--x9-fg-dim); font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 0.35rem 0.75rem; border-bottom: 1px solid var(--x9-border);
}
.x9-podium td { padding: 0.45rem 0.75rem; border-bottom: 1px solid var(--x9-border); }
.x9-podium--first td { color: var(--x9-accent); font-weight: 700; }
.x9-podium__place { font-family: var(--x9-mono); }

/* ---- Scoreboard extras: durations, level points, fastest row ----------- */
.sb-lv-head__pts { display: block; color: var(--x9-fg-dim); font-weight: 400; font-size: 0.7rem; }
.sb-lv .sb-lv-dur { display: block; color: var(--x9-fg-dim); font-size: 0.72rem; }
.x9-sb-finish .sb-lv-dur, .x9-sb-points .sb-lv-dur { display: inline; font-size: 0.75rem; color: var(--x9-fg-dim); }
.x9-sb-fastest td { border-top: 2px solid var(--x9-accent-dim); background: rgba(163, 230, 53, 0.04); }
.sb-fastest-label {
  font-family: var(--x9-mono); font-size: 0.8rem; color: var(--x9-warn);
  text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap;
}
.sb-lv--fastest .sb-lv-pos { display: block; font-size: 0.78rem; color: var(--x9-fg); }
.sb-lv--current .sb-lv-dur { color: var(--x9-warn); }

/* ---- Solver attribution + first-place gold trail ----------------------- */
.sb-lv .sb-lv-by { display: block; color: var(--x9-fg-dim); font-size: 0.72rem; font-style: italic; }
.sb-lv--gold { background: rgba(251, 191, 36, 0.10); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.45); }
.sb-lv--gold .sb-lv-pos { color: var(--x9-warn); }

/* ---- Game rating form + averages --------------------------------------- */
.x9-rate-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-top: 0.75rem; }
.x9-rate-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--x9-fg-dim); }
.x9-rate-form select {
  background: var(--x9-bg); color: var(--x9-fg); border: 1px solid var(--x9-border);
  border-radius: var(--x9-radius); padding: 0.4rem 0.6rem; font-family: var(--x9-mono);
}

/* ---- legacy-credential inputs: never uppercase what the user types ------ */
.x9-input--as-typed { text-transform: none !important; }

/* ---- profile tabs: readable hover (global button:hover paints bg white) - */
.x9-tab:hover {
  background: rgba(163, 230, 53, 0.10);
  border-color: transparent;
  color: var(--x9-accent);
}

/* ---- Encounter badge + import-form button polish ----------------------- */
.x9-encx-badge { margin-top: 0.5rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
/* The import button sat too tall (block padding + bottom-align gap over the
   text). Match it to the input height and center its label. */
.x9-import-form { align-items: end; }
.x9-import-form .x9-btn {
  padding: 0.5rem 1.2rem; line-height: 1.2; align-self: end;
  white-space: nowrap;
}

/* ---- Games-as-rows + pager (index, teams, browse) ---------------------- */
.x9-cards--rows .x9-card { flex-direction: column; }
.x9-card__head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.x9-card__head .x9-card__title { margin: 0; }
.x9-card__cta { align-self: flex-start; margin-top: 0.25rem; }
.x9-pager {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  margin: 1.5rem 0; font-family: var(--x9-mono);
}

/* ---- Rules / explainer panels (teams + game registration) -------------- */
.x9-rules { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.x9-rules li { margin: 0.5rem 0; font-size: 0.9rem; color: var(--x9-fg-dim); line-height: 1.55; }
.x9-rules li strong { color: var(--x9-fg); font-weight: 600; }

/* ---- Help toggle: the "?" next to the username -------------------------- */
.x9-help-toggle {
  width: 1.85rem; height: 1.85rem; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; box-sizing: border-box; text-align: center;
  border: 1px solid var(--x9-accent-dim); background: transparent;
  color: var(--x9-accent); font: 700 0.95rem/1 var(--x9-mono);
  cursor: pointer; transition: opacity 0.15s, border-color 0.15s;
}
.x9-help-toggle:hover { border-color: var(--x9-accent); }
.x9-help-toggle.is-off { color: var(--x9-fg-dim); border-color: var(--x9-border); opacity: 0.6; }

/* =========================================================================
   STYLEGUIDE COMPONENTS — reusable themed blocks. Catalogued at /styleguide.
   Add new reusable styles here (and a demo on the styleguide page).
   ========================================================================= */

/* ---- Callout: a bordered panel with a mono legend/title. Works as either
   a <fieldset class="x9-callout"><legend>… OR a <div> with .x9-callout__title.
   Variants: (default) accent · --info · --warn (dashed) · --danger. --------- */
.x9-callout {
  border: 1px solid var(--x9-accent-dim); border-radius: var(--x9-radius);
  background: rgba(163, 230, 53, 0.06);
  padding: 0.9rem 1.1rem; margin: 1.25rem 0; max-width: 760px;
}
.x9-callout > legend, .x9-callout__title {
  color: var(--x9-accent); font-family: var(--x9-mono); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.8rem;
}
.x9-callout > legend { padding: 0 0.45rem; }
.x9-callout__title { display: block; margin-bottom: 0.5rem; }
.x9-callout > :first-child { margin-top: 0; }
.x9-callout > :last-child { margin-bottom: 0; }
.x9-callout p { margin: 0.45rem 0; color: var(--x9-fg-dim); line-height: 1.55; }
.x9-callout p strong, .x9-callout strong { color: var(--x9-fg); }
.x9-callout--info { border-left: 3px solid var(--x9-accent); background: rgba(163, 230, 53, 0.035); }
.x9-callout--warn { border-style: dashed; border-color: var(--x9-warn); background: rgba(251, 191, 36, 0.07); }
.x9-callout--warn > legend, .x9-callout--warn .x9-callout__title { color: var(--x9-warn); }
.x9-callout--danger { border-color: var(--x9-danger); background: rgba(239, 68, 68, 0.07); }
.x9-callout--danger > legend, .x9-callout--danger .x9-callout__title { color: var(--x9-danger); }

/* ---- Steps: an ordered walkthrough with mono numbered bullets. ----------- */
.x9-steps { list-style: none; counter-reset: x9step; margin: 0.5rem 0; padding: 0; }
.x9-steps li {
  counter-increment: x9step; position: relative;
  padding: 0.3rem 0 0.3rem 2.5rem; margin: 0.4rem 0;
  color: var(--x9-fg-dim); line-height: 1.5;
}
.x9-steps li strong { color: var(--x9-fg); }
.x9-steps li::before {
  content: counter(x9step); position: absolute; left: 0; top: 0.1rem;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--x9-accent-dim); color: var(--x9-accent);
  font-family: var(--x9-mono); font-weight: 700; font-size: 0.85rem;
}

/* ---- Example: an inline "for instance…" note with an accent rail. -------- */
.x9-eg {
  display: block; margin: 0.35rem 0; padding: 0.15rem 0 0.15rem 0.75rem;
  border-left: 2px solid var(--x9-border); color: var(--x9-fg-dim);
  font-style: italic; font-size: 0.9rem; line-height: 1.5;
}
.x9-eg b { color: var(--x9-fg); font-style: normal; }

/* ---- Team photo (team page hero + card thumbnails). -------------------- */
.x9-team-info { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: flex-start; }
.x9-team-photo {
  width: 200px; max-width: 42vw; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--x9-radius); border: 1px solid var(--x9-border); display: block;
}
.x9-team-thumb {
  width: 2.4rem; height: 2.4rem; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--x9-border); flex: 0 0 auto;
}

/* ---- Swatch row (styleguide palette reference). ------------------------- */
.x9-swatches { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.5rem 0; }
.x9-swatch { display: flex; flex-direction: column; gap: 0.3rem; align-items: center; font-size: 0.72rem; font-family: var(--x9-mono); color: var(--x9-fg-dim); }
.x9-swatch__chip { width: 3.2rem; height: 3.2rem; border-radius: var(--x9-radius); border: 1px solid var(--x9-border); }
