/* =========================================================================
   fightnight.css — FIGHT NIGHT (2026-09-24, New Age Dinos).
   Loaded only by fightnight.html, after site.css and shop.css. No raw colour
   literals, no invented radius, face or heading size: every value is a role
   token, so the owner's own theme dresses this page as it dresses the rest.

   THE SHAPE. A strip that says which night it is and whether registration is
   open; the three bracket cards (each a house `.card` - this sheet draws no
   plate of its own); the player's own entries as house `.item` records; and
   the trees, one horizontal scroller per bracket so a 64-fighter tree never
   widens the PAGE on a phone - it scrolls inside its own box.

   WHAT THIS SHEET DOES NOT DO: it never sets a background and a border in
   the same rule. A plate is the house look's (terminal.css section 6b, THE
   SURFACE REGISTER): the bracket cards and the dialog's animal cards are
   `.card`, a match box and an entry row are `.item`. This file lays out.
   ========================================================================= */

.fn-head { text-align: center; }
.fn-head p { margin-inline: auto; }

.fn-status { text-align: center; min-height: 1.4em; }
.fn-status:empty { display: none; }
.fn-status.warn { color: var(--warn); }

.fn-gate { margin-bottom: 22px; }
.fn-gate[hidden],
.fn-banner[hidden],
.fn-mine[hidden],
.fn-trees[hidden] { display: none !important; }

/* ---------- the event strip ---------- */
.fn-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  margin: 0 0 22px;
  padding: 12px 0;
  border-top: 1px solid var(--edge);
  border-bottom: 1px solid var(--edge);
}
.fn-banner-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.fn-banner-event {
  font-family: var(--font-display, var(--font-ui));
  letter-spacing: .02em;
  color: var(--fg);
}
.fn-banner-state { color: var(--fg-dim); font-weight: 600; }
.fn-banner-state.is-open { color: var(--ok); }
.fn-banner-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fn-chip {
  padding: 4px 10px;
  border: 1px solid var(--edge);
  border-radius: var(--r-pill, var(--r));
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- the three brackets ---------- */
.fn-brackets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.fn-bracket { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fn-bracket.is-off { opacity: .6; }
.fn-bracket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.fn-bracket-title { margin: 0; font-size: var(--tm-h-panel); }
.fn-rule { margin: 0; color: var(--fg-dim); }
.fn-species { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.fn-species-label { color: var(--fg-mute); }
.fn-tier { margin: 0; color: var(--fg); }
.fn-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
}
.fn-mine-line { margin: 0; color: var(--ok); font-weight: 600; }
.fn-signup { align-self: flex-start; margin-top: auto; }

.fn-pill {
  padding: 3px 9px;
  border: 1px solid var(--edge);
  border-radius: var(--r-pill, var(--r));
  color: var(--fg-dim);
  white-space: nowrap;
}
.fn-pill-open,
.fn-pill-entry-active,
.fn-pill-entry-placed { color: var(--ok); border-color: var(--ok); }
.fn-pill-cancelled,
.fn-pill-entry-removed { color: var(--bad); border-color: var(--bad); }
.fn-pill-drawn { color: var(--accent); border-color: var(--accent); }

/* ---------- my entries ---------- */
.fn-mine { margin-bottom: 28px; }
.fn-mine-list { display: grid; gap: 10px; }
/* A `.item` record (shop.css stacks one as a column); this row is a row. */
.fn-entry {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 10px 14px;
}
.fn-entry-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
}

/* ---------- the trees ---------- */
.fn-trees { margin-bottom: 28px; }
.fn-trees > h2 { margin: 0 0 14px; }
.fn-tree { margin-bottom: 26px; min-width: 0; }
.fn-tree-title { margin: 0 0 10px; font-size: var(--tm-h-panel); }
.fn-podium { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 12px; }
.fn-place { display: flex; align-items: baseline; gap: 8px; }
.fn-place.is-me strong { color: var(--accent); }
.fn-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6em;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: var(--r-pill, var(--r));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.fn-place-1 .fn-medal { color: var(--accent-hi, var(--accent)); }
.fn-place-2 .fn-medal { color: var(--fg); }
.fn-place-3 .fn-medal { color: var(--warn); }

/* THE TREE SCROLLS INSIDE ITS OWN BOX. The page never scrolls sideways: a
   round is a fixed-width column and the scroller is as wide as the page. */
.fn-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 8px;
}
.fn-rounds { display: flex; gap: 16px; width: max-content; }
.fn-round { display: flex; flex-direction: column; width: 210px; flex: none; }
.fn-round-title {
  margin: 0 0 8px;
  color: var(--fg-mute);
  font-size: var(--tm-h-micro);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.fn-round-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 12px;
  flex: 1 1 auto;
}
.fn-match { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.fn-side {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  min-width: 0;
}
.fn-side + .fn-side { border-top: 1px solid var(--edge); }
.fn-side-name { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-side-dino { color: var(--fg-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-side.is-win .fn-side-name { font-weight: 700; color: var(--accent-hi, var(--accent)); }
.fn-side.is-out { opacity: .55; }
.fn-side.is-me .fn-side-name { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the sign-up dialog ---------- */
.fn-dialog { width: min(640px, calc(100vw - 32px)); }
.fn-dlg-body { display: grid; gap: 10px; }
.fn-dino-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 55vh;
  overflow-y: auto;
}
.fn-dino {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  text-align: left;
  color: var(--fg);
  cursor: pointer;
}
.fn-dino:hover:not(:disabled),
.fn-dino:focus-visible { border-color: var(--accent); }
.fn-dino.is-no { opacity: .5; cursor: not-allowed; }
.fn-dino-name { color: var(--fg); }
.fn-dino-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.fn-tag {
  padding: 1px 7px;
  border: 1px solid var(--edge);
  border-radius: var(--r-pill, var(--r));
  color: var(--fg-dim);
  font-size: .85em;
}
.fn-dino-why { color: var(--warn); font-size: .9em; }
.fn-live-why,
.fn-empty { margin: 0; }
.fn-confirm-what { margin: 0; color: var(--fg); }

@media (max-width: 560px) {
  .fn-banner { justify-content: flex-start; }
  .fn-brackets { grid-template-columns: 1fr; }
  .fn-round { width: 180px; }
  .fn-entry { align-items: flex-start; }
}
