/* Fairway Live — components. Big targets, high contrast, still by default. */

/* The [hidden] attribute must always win, even over components that set their
   own display (.btn, .pill, .notice, flex/grid rows). Without this, toggling
   `el.hidden = true` on such elements does nothing. */
[hidden] { display: none !important; }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-3);
}

/* --- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-4);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--card-hi);
  background: var(--pine);
  cursor: pointer;
  width: 100%;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: var(--fescue); }
.btn.ghost { background: transparent; color: var(--pine); border: 2px solid var(--sand); }
.btn.live { background: var(--flag); }
.btn.big { min-height: 76px; font-size: 24px; letter-spacing: 0.01em; }

/* --- Inputs ---------------------------------------------------------------- */
label { display: block; font-weight: 600; margin: 0 0 var(--space-1); color: var(--graphite); }
.field { margin-bottom: var(--space-3); }
input[type="text"], input[type="number"], select {
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--space-3);
  font-size: 18px;
  font-family: var(--font-body);
  color: var(--graphite);
  background: var(--card-hi);
  border: 2px solid var(--sand);
  border-radius: var(--radius);
}
input:focus, select:focus { border-color: var(--fescue); outline: none; }
.code-input { font-family: var(--font-mono); letter-spacing: 0.35em; text-transform: uppercase; font-size: 24px; text-align: center; }

/* --- Cards / header -------------------------------------------------------- */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--sand);
  margin-bottom: var(--space-3);
}
.masthead h1 { font-size: 28px; color: var(--pine); letter-spacing: 0.02em; }
.masthead .clock { font-family: var(--font-mono); color: var(--graphite-2); font-size: 15px; }

.card {
  background: var(--card-hi);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-4);
}

.hint { color: var(--graphite-2); font-size: 15px; margin: var(--space-2) 0; }

/* Prominent code display (join code / host code). */
.codebox {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 2px solid var(--sand); border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
}
.codebox-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--graphite-2); }
.codebox-val { font-size: 30px; font-weight: 500; letter-spacing: 0.2em; color: var(--pine); }
.err { color: var(--flag); font-weight: 600; min-height: 1.2em; margin: var(--space-2) 0; }

/* --- The Grounds (scorecard directory) ------------------------------------- */
.scorecard { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-1);
  border-bottom: 1px solid var(--sand);   /* sand hairline rule, like a real card */
  min-height: var(--tap);
  cursor: pointer;
}
.row.off { cursor: default; opacity: 0.72; }
.row .flagcol { width: 30px; display: flex; justify-content: center; }
.row .slot { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--pine); }
.row .title { grid-column: 2; color: var(--graphite-2); font-size: 15px; }
.row .status { justify-self: end; text-align: right; }
.row .hole { grid-column: 3; justify-self: end; font-family: var(--font-mono); font-size: 14px; color: var(--graphite-2); }
.badge-live { color: var(--flag); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 6px; }
.badge-off { color: var(--fescue); font-size: 14px; font-weight: 600; }
/* Marks a row from a session other than the one currently being played. */
.sess-tag {
  font-family: var(--font-body); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--graphite-2); background: var(--sand);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.watching { font-family: var(--font-mono); font-size: 14px; color: var(--graphite-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--flag); display: inline-block; }

/* --- Flagstick (the one piece of motion) ----------------------------------- */
.flag-svg { width: 22px; height: 28px; display: block; }
.flag-svg .cloth { transform-origin: left center; animation: flutter 2s ease-in-out infinite; }
@keyframes flutter {
  0%, 100% { transform: skewY(0deg) scaleX(1); }
  50%      { transform: skewY(-6deg) scaleX(0.94); }
}
@media (prefers-reduced-motion: reduce) {
  .flag-svg .cloth { animation: none; }
}

/* --- Watch screen ---------------------------------------------------------- */
.stage { position: fixed; inset: 0; background: #000; overflow: hidden; }
.stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.overlay { position: absolute; inset: 0; pointer-events: none; }
.overlay > * { pointer-events: auto; }
.chrome-tl { position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 12px; }
.chrome-tr { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 12px; display: flex; gap: 8px; align-items: center; }
.pill {
  background: rgba(13, 34, 28, 0.72);
  color: var(--card-hi);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.pill .mono { font-size: 14px; }
.iconbtn {
  width: var(--tap); height: var(--tap);
  border-radius: 50%;
  border: none;
  background: rgba(13, 34, 28, 0.72);
  color: var(--card-hi);
  font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

/* Bottom rail of other live groups. */
.rail {
  position: absolute; left: 0; right: 0;
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  display: flex; gap: 10px; overflow-x: auto;
  padding: 10px 12px; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }
.railcard {
  flex: 0 0 auto; min-width: 132px; min-height: 60px;
  scroll-snap-align: start;
  background: rgba(13, 34, 28, 0.78);
  color: var(--card-hi);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
  cursor: pointer; backdrop-filter: blur(6px);
}
.railcard.active { border-color: var(--flag); }
.railcard .rl-slot { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.railcard .rl-meta { font-family: var(--font-mono); font-size: 12px; opacity: 0.85; }

.chrome-hidden .overlay { opacity: 0; transition: opacity 0.25s ease; }
.overlay { transition: opacity 0.25s ease; }

/* --- Broadcast screen ------------------------------------------------------ */
.preview-wrap { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #000; aspect-ratio: 16 / 9; margin-bottom: var(--space-3); }
.preview-wrap video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.hole-stepper { display: flex; align-items: center; gap: var(--space-3); }
.hole-stepper button { width: var(--tap); height: var(--tap); font-size: 26px; border-radius: var(--radius); border: 2px solid var(--sand); background: var(--card-hi); font-family: var(--font-mono); cursor: pointer; }
.hole-stepper .hole-val { font-family: var(--font-mono); font-size: 30px; min-width: 2ch; text-align: center; }

.notice {
  background: var(--pine);
  color: var(--card-hi);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: 15px;
  margin-bottom: var(--space-3);
  display: block;   /* inline <strong> must flow, not become flex columns */
}
.notice.warn { background: var(--flag); }

.live-stats { display: flex; gap: var(--space-4); align-items: center; margin: var(--space-3) 0; }
.stat { text-align: center; }
.stat .n { font-family: var(--font-mono); font-size: 26px; display: block; }
.stat .l { font-size: 12px; color: var(--graphite-2); text-transform: uppercase; letter-spacing: 0.05em; }
.quality { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.quality .q-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--fescue); }
.quality.poor .q-dot { background: var(--flag); }
.quality.good .q-dot { background: #4c9a5b; }

/* Toast / connection banners. */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  background: var(--graphite); color: var(--card-hi);
  padding: 12px 18px; border-radius: 999px;
  font-size: 15px; z-index: 50; box-shadow: var(--shadow);
  max-width: 90vw; text-align: center;
}
.toast.warn { background: var(--flag); }

/* Usage meter (LiveKit free-tier burn). */
.meter { height: 12px; border-radius: 999px; background: var(--sand); overflow: hidden; }
.meter-fill { height: 100%; width: 0%; background: var(--fescue); border-radius: 999px; transition: width 0.3s ease; }
.meter-fill.warn { background: #d08a3c; }
.meter-fill.danger { background: var(--flag); }
.usage-row { display: flex; justify-content: space-between; gap: var(--space-2); padding: 4px 0; border-bottom: 1px solid var(--sand); font-size: 14px; }
.usage-row .mono { color: var(--graphite-2); }

/* --- New-version banner ---------------------------------------------------- */
.update-bar {
  position: fixed; z-index: 100;
  left: 12px; right: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  max-width: 616px; margin: 0 auto;
  background: var(--pine); color: var(--card-hi);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 24px rgba(20, 52, 43, 0.28);
  padding: var(--space-2) var(--space-3);
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
}
.update-bar .ub-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 180px; min-width: 0; }
.update-bar .ub-text strong { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.update-bar .ub-text span { font-size: 14px; opacity: 0.85; }
.update-bar .ub-actions { display: flex; gap: var(--space-2); flex: 0 0 auto; }
.update-bar .ub-btn {
  min-height: 48px; padding: 0 var(--space-3);
  border-radius: var(--radius); border: 2px solid transparent;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; cursor: pointer;
}
.update-bar .ub-later { background: transparent; color: var(--card-hi); border-color: rgba(242, 237, 225, 0.35); }
.update-bar .ub-now { background: var(--card-hi); color: var(--pine); }

.row-actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.slot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
.slot-grid .slot-btn { min-height: var(--tap); border: 2px solid var(--sand); background: var(--card-hi); border-radius: var(--radius); font-family: var(--font-display); font-weight: 600; font-size: 17px; cursor: pointer; }
.slot-grid .slot-btn.sel { background: var(--pine); color: var(--card-hi); border-color: var(--pine); }
.slot-grid .slot-btn.taken { opacity: 0.4; cursor: not-allowed; }

.center { text-align: center; }
.stack > * + * { margin-top: var(--space-3); }
.muted { color: var(--graphite-2); }

/* --- Scoreboard: the two-team total banner --------------------------------- */
.teamboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-2);
  background: var(--pine);
  color: var(--card-hi);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
}
.teamboard .tb-team { display: flex; flex-direction: column; }
.teamboard .tb-team.b { text-align: right; align-items: flex-end; }
.teamboard .tb-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: 0.01em; }
.teamboard .tb-pts { font-family: var(--font-mono); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.teamboard .tb-dash { font-family: var(--font-mono); font-size: 24px; opacity: 0.5; }
.teamboard .tb-lead .tb-pts { color: #ffd9a0; }  /* subtle highlight on the leader */
.tb-caption { text-align: center; font-size: 12px; color: var(--graphite-2); margin: -6px 0 var(--space-3); letter-spacing: 0.03em; text-transform: uppercase; }

/* Per-session breakdown under the total banner. */
.sessboard { margin-bottom: var(--space-3); }
.sess-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-1);
  border-bottom: 1px solid var(--sand);
}
.sess-row.active { background: rgba(122, 139, 92, 0.12); border-radius: var(--radius); }
.sess-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--graphite); }
.sess-now { color: var(--fescue); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.sess-score { font-size: 16px; color: var(--pine); }
.sess-worth { font-size: 13px; color: var(--graphite-2); }

/* Per-group match status on the scorecard rows. */
.row .match { grid-column: 2; }
.match-status { font-family: var(--font-mono); font-size: 14px; color: var(--graphite); }
.match-status .lead-a { color: var(--pine); font-weight: 500; }
.match-status .lead-b { color: var(--fescue); font-weight: 600; }
.match-status .as { color: var(--graphite-2); }
.match-status .final-tag { color: var(--graphite-2); }

/* Watch-screen score pill (sits under the title pill). */
.chrome-tl .pill.pairpill { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; max-width: 78vw; }
.pairpill .pair-side { display: inline-flex; gap: 6px; align-items: baseline; }
.pairpill .pair-team { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; opacity: 0.75; }
.pairpill .pair-vs { opacity: 0.6; }
.chrome-tl .pill.score { margin-top: 8px; display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chrome-tl .pill.score .mono { font-size: 14px; }
/* The match status is styled for the cream scorecard; on the dark video pill it
   needs light text or it's unreadable (especially in sunlight). */
.pill.score .match-status,
.pill.score .match-status .lead-a,
.pill.score .match-status .lead-b,
.pill.score .match-status .as,
.pill.score .match-status .final-tag { color: var(--card-hi); }
.pill.score .match-status .lead-a,
.pill.score .match-status .lead-b { font-weight: 700; }
.pill.score .match-status .as,
.pill.score .match-status .final-tag { opacity: 0.75; }
/* The event-wide total, set apart from this match's status. */
.mini-teams {
  display: inline-flex; gap: 6px; align-items: center;
  font-family: var(--font-mono); font-size: 13px;
  padding-left: 10px; margin-left: 2px;
  border-left: 1px solid rgba(242, 237, 225, 0.28);
  opacity: 0.9;
}

/* --- Broadcast: score-this-hole entry -------------------------------------- */
.score-entry { background: var(--card-hi); border: 2px solid var(--sand); border-radius: var(--radius-lg); padding: var(--space-3); }
.score-entry .se-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-2); }
.score-entry .se-title { font-family: var(--font-display); font-weight: 600; }
.score-entry .se-status { font-family: var(--font-mono); font-size: 15px; color: var(--pine); }
.score-btns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.score-btns .halve { grid-column: 1 / -1; }
.score-btn {
  min-height: var(--tap);
  border: 2px solid var(--sand);
  background: var(--card);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--graphite);
  cursor: pointer;
  padding: 0 var(--space-2);
}
.score-btn.team-a { border-color: var(--pine); }
.score-btn.team-b { border-color: var(--fescue); }
.score-btn.picked { background: var(--pine); color: var(--card-hi); border-color: var(--pine); }
.score-btn.team-b.picked { background: var(--fescue); border-color: var(--fescue); }
.score-btn.halve.picked { background: var(--graphite); color: var(--card-hi); border-color: var(--graphite); }
.se-hint { font-size: 13px; color: var(--graphite-2); margin-top: var(--space-2); }

/* Host scoreboard mini-grid. */
.host-match { padding: var(--space-3) 0; border-bottom: 1px solid var(--sand); }
.host-match .hm-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.host-match .hm-slot { font-family: var(--font-display); font-weight: 700; color: var(--pine); }
.host-match .hm-status { font-family: var(--font-mono); font-size: 14px; }

/* Streaming on/off toggle + final. */
.hm-stream { display: flex; gap: var(--space-2); margin: var(--space-2) 0; flex-wrap: wrap; }
.hm-stream .toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 var(--space-3);
  border-radius: 999px; border: 2px solid var(--sand);
  background: var(--card); font-family: var(--font-body); font-weight: 600; font-size: 15px;
  color: var(--graphite); cursor: pointer;
}
.hm-stream .toggle .dot2 { width: 10px; height: 10px; border-radius: 50%; background: var(--fescue); }
.hm-stream .toggle.on { border-color: var(--flag); color: var(--flag); }
.hm-stream .toggle.on .dot2 { background: var(--flag); }
.hm-stream .hm-final { width: auto; min-height: 48px; padding: 0 var(--space-3); font-size: 15px; }

/* 18-hole strip. */
/* Nine columns, so each nine lands on its own row. The wider row gap is doing
   real work: the two rows are two separate points, not one long card. */
.hole-strip { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); column-gap: 4px; row-gap: 14px; margin: var(--space-2) 0; }
.hcell {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  aspect-ratio: 1; min-height: 40px; border: 1px solid var(--sand); border-radius: 8px;
  background: var(--card); cursor: pointer; padding: 2px;
}
.hcell .hn { font-family: var(--font-mono); font-size: 10px; color: var(--graphite-2); line-height: 1; }
.hcell .hr { font-family: var(--font-mono); font-size: 14px; font-weight: 500; line-height: 1.1; }
.hcell.a { background: var(--pine); border-color: var(--pine); }
.hcell.a .hn, .hcell.a .hr { color: var(--card-hi); }
.hcell.b { background: var(--fescue); border-color: var(--fescue); }
.hcell.b .hn, .hcell.b .hr { color: var(--card-hi); }
.hcell.h { background: var(--sand); }
.hcell.cur { outline: 3px solid var(--flag); outline-offset: 1px; }

.hm-entry { margin-top: var(--space-2); }
.hm-entry-label { display: block; font-weight: 600; margin-bottom: var(--space-1); }

/* --- Event format picker (create screen) --------------------------------- */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 380px) { .field-row { grid-template-columns: 1fr; } }

.fmt-grid { display: grid; gap: var(--space-2); }
.fmt-opt {
  display: block; width: 100%; text-align: left;
  min-height: 56px; padding: var(--space-2) var(--space-3);
  background: var(--card); color: var(--graphite);
  border: 2px solid var(--sand); border-radius: 10px;
  font-family: inherit; font-size: 16px; font-weight: 600;
  cursor: pointer;
}
.fmt-opt[aria-pressed="true"] { border-color: var(--pine); background: #fff; color: var(--pine); }
.fmt-opt .fmt-sub { display: block; font-weight: 400; font-size: 13px; color: var(--fescue); margin-top: 2px; }

/* --- Stroke-play scorecard + leaderboard --------------------------------- */
.lb { width: 100%; border-collapse: collapse; }
.lb th, .lb td { padding: var(--space-2); border-bottom: 1px solid var(--sand); text-align: left; }
.lb th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--fescue); font-weight: 600; }
.lb td.num, .lb th.num { text-align: right; font-family: var(--font-mono, monospace); font-variant-numeric: tabular-nums; }
.lb tr.me td { background: #fff; }

.sp-player { border-bottom: 1px solid var(--sand); padding: var(--space-2) 0; }
.sp-player:last-child { border-bottom: 0; }
.sp-name { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.sp-name .n { font-weight: 700; color: var(--pine); }
.sp-name .t { font-family: var(--font-mono, monospace); font-variant-numeric: tabular-nums; }
.sp-steps { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.sp-steps button {
  min-width: 56px; min-height: 56px; font-size: 24px; font-weight: 700;
  border: 2px solid var(--sand); border-radius: 10px; background: var(--card); color: var(--graphite);
  font-family: inherit; cursor: pointer;
}
.sp-steps .val {
  flex: 1; text-align: center; font-family: var(--font-mono, monospace);
  font-size: 28px; font-variant-numeric: tabular-nums; color: var(--pine); font-weight: 700;
}
.sp-steps .val.empty { color: var(--fescue); }

/* --- Highlight clips ------------------------------------------------------ */
/* The reel sits under a group's row: one thumbnail per clip, scrolling
   left-to-right, snapping so a half-clip never sits at the edge. */
.reel {
  grid-column: 1 / -1;
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-2) 0 2px;
  margin-top: var(--space-2);
  border-top: 1px solid var(--sand);
}
.reel::-webkit-scrollbar { height: 0; }

.reel-item {
  position: relative;
  flex: 0 0 auto;
  width: 112px; height: 72px;
  scroll-snap-align: start;
  border: 1px solid var(--sand);
  border-radius: 8px;
  overflow: hidden;
  background: var(--sand);
  padding: 0; cursor: pointer;
}
.reel-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel-noposter {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 22px; color: var(--pine);
}
.reel-tag {
  position: absolute; right: 4px; bottom: 4px;
  background: rgba(20, 52, 43, 0.85); color: #fff;
  font-size: 11px; padding: 1px 5px; border-radius: 4px;
}

/* Recorder + player sheet. Full-bleed on a phone; the panel keeps the video
   from stretching on a wide screen. */
.clip-sheet {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 52, 43, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-3);
}
.clip-panel {
  width: 100%; max-width: 520px;
  background: var(--card); border-radius: 14px;
  padding: var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.clip-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); color: var(--pine); }
.clip-x { width: auto; min-height: 44px; padding: 0 var(--space-3); }
.clip-stage { position: relative; background: #000; border-radius: 10px; overflow: hidden; }
.clip-stage video { width: 100%; max-height: 56vh; display: block; background: #000; }
.clip-timer {
  position: absolute; top: 8px; right: 8px;
  background: var(--flag); color: #fff;
  padding: 2px 8px; border-radius: 6px; font-size: 14px;
}
#clipRecord.recording { background: var(--graphite); }

/* Delete affordance on the host's own clips. */
.reel-del {
  position: absolute; top: 4px; right: 4px;
  width: 28px; height: 28px; padding: 0;
  border: 0; border-radius: 999px;
  background: rgba(46, 46, 44, 0.85); color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer;
}

/* --- Nine-hole segments ---------------------------------------------------
   Each nine is a point, so each gets its own chip: which side holds it, and
   whether it's locked in (the nine is over) or still in play. */
.seg-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.seg {
  font-size: 12px; line-height: 1.4;
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--sand); background: var(--card); color: var(--graphite);
}
.seg b { font-family: var(--font-mono, monospace); font-weight: 500; opacity: 0.7; margin-right: 3px; }
.seg-a { border-color: var(--pine); color: var(--pine); }
.seg-b { border-color: var(--flag); color: var(--flag); }
.seg-as, .seg-none { color: var(--fescue); }
.seg-locked { background: #fff; font-weight: 600; }

/* A match someone else is already running. Not disabled — a host whose phone
   died can't hand theirs back, so taking over must always be possible. */
.slot-btn.claim-taken { border-color: var(--flag); color: var(--flag); background: var(--card); }
.slot-btn.claim-stale { border-style: dashed; color: var(--fescue); }
