/* Mountain Marathon Round Tracking — custom styles on top of Bootstrap 5 */

:root {
  --mmrt-bottom: #0d6efd;
  --mmrt-top:    #ffc107;
  --mmrt-dark:   #12161c;
}

body { -webkit-tap-highlight-color: transparent; }

.stat-card { border-width: 0 0 4px 0; }

.qr-preview { max-width: 240px; }

/* ----------------------------------------------------------------
   Top 3 podium (dashboard + live board)
---------------------------------------------------------------- */
.podium-card {
  border-radius: .9rem;
  padding: 1rem .75rem;
  text-align: center;
  color: #1a1a1a;
  border: 2px solid transparent;
  background: #f8f9fa;
}
.podium-1 { background: linear-gradient(160deg, #fff4cc, #ffe9a3); border-color: #e0b400; }
.podium-2 { background: linear-gradient(160deg, #f3f5f7, #e2e6ea); border-color: #adb5bd; }
.podium-3 { background: linear-gradient(160deg, #fbe9dd, #f3d5c0); border-color: #cd7f32; }

.podium-rank   { font-size: 2rem; line-height: 1; }
.podium-bib    { font-size: 1.6rem; font-weight: 800; letter-spacing: .02em; }
.podium-name   { font-size: .95rem; font-weight: 600; }
.podium-rounds { font-size: 2.2rem; font-weight: 800; line-height: 1.1; margin: .25rem 0 .5rem; }
.podium-rounds span {
  display: block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .65;
}

/* On wide screens lift the winner above the other two. */
@media (min-width: 768px) {
  .podium .podium-1 { transform: translateY(-.5rem); }
  .podium .podium-1 .podium-rounds { font-size: 2.6rem; }
}

/* ----------------------------------------------------------------
   Print sheet for bib QR cards
---------------------------------------------------------------- */
@media print {
  .navbar, .btn, footer, .d-print-none, form { display: none !important; }
  body { background: #fff; }
  .qr-card { border: 1px dashed #999 !important; page-break-inside: avoid; }
  .qr-card-col { width: 33.333% !important; flex: 0 0 33.333% !important; max-width: 33.333% !important; }
}

/* ----------------------------------------------------------------
   Scanner (mobile-first, full-height dark UI)
---------------------------------------------------------------- */
.scanner-body {
  background: var(--mmrt-dark);
  color: #fff;
  min-height: 100dvh;
}

.scanner-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 1rem 2rem;
}

.scanner-top { padding: 1rem 0 0.5rem; }

/* --- checkpoint picker ------------------------------------------ */
.checkpoint-picker { padding-top: 2rem; }

.cp-btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 1rem;
  padding: 2rem 1rem;
  margin-bottom: 1.25rem;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  transition: transform .08s ease;
}
.cp-btn:active { transform: scale(.98); }
.cp-bottom { background: linear-gradient(160deg, #0d6efd, #0a4fb4); }
.cp-top    { background: linear-gradient(160deg, #ffc107, #d39e00); color: #1a1a1a; }

.cp-icon { display: block; font-size: 2.5rem; }
.cp-name { display: block; font-size: 2rem; font-weight: 800; letter-spacing: .08em; }
.cp-sub  { display: block; font-size: .9rem; opacity: .85; }

/* --- camera ------------------------------------------------------ */
.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: .75rem 0;
}

.camera-wrap {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  background: #000;
  aspect-ratio: 1 / 1;
}
.camera-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.camera-frame {
  position: absolute;
  inset: 15%;
  border: 3px solid rgba(255, 255, 255, .85);
  border-radius: .75rem;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35);
  pointer-events: none;
}
.camera-hint {
  position: absolute;
  left: 0; right: 0; bottom: .5rem;
  text-align: center;
  font-size: .8rem;
  color: rgba(255, 255, 255, .85);
  padding: 0 1rem;
}

/* --- result banner ----------------------------------------------- */
.result-panel { min-height: 92px; margin: 1rem 0; }

.result-card {
  border-radius: .9rem;
  padding: 1rem;
  color: #fff;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: .4; } to { transform: scale(1); opacity: 1; } }

.result-ok    { background: #198754; }
.result-round { background: #146c43; box-shadow: 0 0 0 3px #ffc107 inset; }
.result-warn  { background: #b8860b; }
.result-err   { background: #dc3545; }

.result-bib   { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.result-name  { font-size: 1.05rem; opacity: .95; }
.result-msg   { margin-top: .4rem; font-size: .95rem; }
.result-meta  { font-size: .8rem; opacity: .85; margin-top: .35rem; }

.controls { margin-bottom: 1.25rem; }

/* --- recent list -------------------------------------------------- */
.recent {
  background: rgba(255, 255, 255, .05);
  border-radius: .9rem;
  padding: .85rem 1rem;
}
.recent-title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .55);
  margin-bottom: .5rem;
}
.recent li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  font-size: .9rem;
}
.recent li:last-child { border-bottom: 0; }
.recent .ok  { color: #6ee7a8; }
.recent .err { color: #ff8b98; }
