/* ─────────────────────────────────────────────────────────────────────────────
   duck-race.css  —  Shared styles for duck-race-admin.html & duck-race.html
   Leans on Bootstrap; only adds the race track, ducks, podium, and status chips.
   ───────────────────────────────────────────────────────────────────────────── */

.duckrace-app { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 4rem; }
.dr-hidden { display: none !important; }
.dr-muted { color: #6c757d; }
.dr-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }

.dr-brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: #165b38 !important; text-transform: none; letter-spacing: 0;
}
.dr-brand:hover, .dr-brand:focus { color: #0f4228 !important; }
.dr-brand-text { line-height: 1; font-weight: 800; }
.dr-page-title { display: flex; align-items: center; gap: .65rem; }
.dr-logo-mark {
  position: relative; display: inline-block; width: 44px; height: 44px;
  flex: 0 0 auto; border-radius: 50%;
  background: linear-gradient(180deg, #81d4f5 0%, #36a9d8 56%, #1383af 100%);
  border: 2px solid #fff; box-shadow: 0 .35rem .9rem rgba(19, 131, 175, .28);
}
.dr-logo-mark::before {
  content: ""; position: absolute; left: 9px; top: 19px; width: 25px; height: 14px;
  border-radius: 13px 15px 11px 10px; background: #f6c743;
  box-shadow: 13px -8px 0 -5px #f6c743, -2px 5px 0 -3px #e6a936;
}
.dr-logo-mark::after {
  content: ""; position: absolute; left: 31px; top: 15px; width: 10px; height: 7px;
  border-radius: 2px 8px 8px 2px; background: #f08a24; transform: rotate(-7deg);
}
.dr-logo-eye {
  position: absolute; left: 28px; top: 14px; width: 3px; height: 3px;
  border-radius: 50%; background: #1a2230; z-index: 2;
}
.dr-logo-wave {
  position: absolute; left: 8px; right: 8px; bottom: 9px; height: 2px;
  border-radius: 999px; background: rgba(255,255,255,.82);
  box-shadow: 9px 4px 0 -1px rgba(255,255,255,.62);
}
.dr-logo-mark-sm { width: 36px; height: 36px; box-shadow: 0 .25rem .65rem rgba(19, 131, 175, .24); }
.dr-logo-mark-sm::before { left: 7px; top: 16px; width: 21px; height: 12px; box-shadow: 11px -7px 0 -5px #f6c743, -2px 5px 0 -3px #e6a936; }
.dr-logo-mark-sm::after { left: 26px; top: 13px; width: 9px; height: 6px; }
.dr-logo-mark-sm .dr-logo-eye { left: 23px; top: 12px; }
.dr-logo-mark-sm .dr-logo-wave { left: 7px; right: 7px; bottom: 7px; }

/* ── Status chips ───────────────────────────────────────────────────────────── */
.dr-status-badge {
  text-transform: uppercase; letter-spacing: .04em; font-size: .7rem;
  font-weight: 700; color: #fff; padding: .25rem .55rem; border-radius: 999px;
}
.dr-badge-DRAFT        { background: #6c757d; }
.dr-badge-OPEN         { background: #0d6efd; }
.dr-badge-LOCKED       { background: #6610f2; }
.dr-badge-STARTING     { background: #fd7e14; }
.dr-badge-RUNNING      { background: #198754; }
.dr-badge-REVEAL_READY { background: #20c997; }
.dr-badge-COMPLETED    { background: #0dcaf0; color: #03363d; }
.dr-badge-RUN_FAILED   { background: #dc3545; }
.dr-badge-CANCELLED    { background: #adb5bd; }
.dr-badge-ARCHIVED     { background: #343a40; }

/* ── Race cards (lobby) ─────────────────────────────────────────────────────── */
.dr-race-card { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.dr-race-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0,0,0,.1); }

/* ── Countdown ──────────────────────────────────────────────────────────────── */
.dr-countdown {
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: 2.4rem;
  letter-spacing: .02em; color: #198754;
}

/* ── Race track ─────────────────────────────────────────────────────────────── */
.dr-track {
  background: linear-gradient(180deg, #cdeafe 0%, #e7f6ff 60%, #dff5e1 100%);
  border: 1px solid #bcdff5; border-radius: 14px; padding: .75rem 1rem;
  overflow: hidden;
}
.dr-lane {
  position: relative; display: flex; align-items: center; height: 72px;
  border-bottom: 1px dashed rgba(255,255,255,.45);
}
.dr-lane:last-child { border-bottom: 0; }
.dr-lane-label {
  width: 52px; flex: 0 0 52px; padding-right: .5rem; font-size: .85rem; text-align: center;
}
.dr-lane-no {
  display: inline-block; min-width: 1.6rem; text-align: center; font-weight: 700;
  background: #fff; border-radius: 6px; padding: 0 .3rem; margin-right: .4rem;
  border: 1px solid #cfe3f2;
}
.dr-lane-track {
  position: relative; flex: 1 1 auto; height: 100%;
  background: linear-gradient(180deg, #b3d7ee 0%, #7fb8da 100%);
}
.dr-duck {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 88px; height: 66px; will-change: left, top;
}
.dr-duck svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dr-duck-badge {
  position: absolute; left: 24%; top: 82%; transform: translate(-50%, -50%);
  max-width: 94px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #fff; border: 1px solid #cfe3f2; border-radius: 8px;
  padding: 1px 6px; font-size: 11px; font-weight: 700; line-height: 1.4;
  color: #1a2230; pointer-events: none;
}
/* Respect reduced-motion: the scoring race snaps instead of easing (the JS also
   skips the per-frame lerp + bob). */
@media (prefers-reduced-motion: reduce) {
  .dr-duck { transition: none !important; }
}
.dr-start {
  position: absolute; top: 8px; bottom: 8px; width: 0;
  border-left: 3px dotted #6c757d; /* left set in JS, synced to START_PCT */
}
.dr-finish {
  position: absolute; right: 6px; top: 4px; bottom: 4px; width: 0;
  border-left: 3px dashed #198754;
}
.dr-finish::after {
  content: "\1F3C1"; position: absolute; top: -2px; left: 4px; font-size: 1rem;
}

/* ── Winners podium ─────────────────────────────────────────────────────────── */
.dr-winners { display: flex; flex-wrap: wrap; gap: .75rem; }
.dr-winner {
  flex: 1 1 160px; border-radius: 12px; padding: .9rem 1rem; color: #1d1d1d;
  background: #f1f3f5; border: 1px solid #e3e6ea;
}
.dr-winner .dr-rank { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.dr-winner .dr-name { font-size: 1.15rem; font-weight: 700; }
.dr-winner .dr-duck-no { font-size: .85rem; }
.dr-rank-1 { background: linear-gradient(180deg,#fff3c4,#ffe08a); border-color:#f4cf6a; }
.dr-rank-2 { background: linear-gradient(180deg,#eef1f4,#dfe4ea); border-color:#cfd6de; }
.dr-rank-3 { background: linear-gradient(180deg,#ffe6cc,#ffd2a6); border-color:#f3bd86; }

/* ── Admin detail layout ────────────────────────────────────────────────────── */
.dr-winner .dr-duck-score { margin-top: .35rem; font-weight: 700; color: #198754; }
.dr-score-wrap { overflow-x: auto; }
.dr-score-table th { white-space: nowrap; color: #6c757d; font-size: .75rem; text-transform: uppercase; }
.dr-score-table td { white-space: nowrap; }
.dr-score-table .dr-score-points { font-weight: 700; }
.dr-score-table .dr-score-winner td { background: rgba(25,135,84,.08); }

.dr-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.dr-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: .75rem; }
.dr-participant-row { display: flex; align-items: center; gap: .5rem; }
