/* Counter-specific layout on top of the site's existing Bootstrap shell. */
.counter-page [hidden],
.publication-modal[hidden] {
  display: none !important;
}

.counter-page {
  max-width: 1140px;
}

.counter-page .counter-heading {
  max-width: 760px;
}

.counter-page .counter-heading h1 {
  font-family: Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -.03em;
}

.counter-page .mode-badge {
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.counter-page .camera-card,
.counter-page .score-card,
.counter-page .result-card,
.counter-page .hof-card {
  border: 1px solid var(--bs-border-color);
  border-radius: .75rem;
  background: var(--bs-body-bg);
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}

.camera-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: .7rem .7rem 0 0;
  background: #111827;
}

.camera-stage video,
.camera-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-stage canvas {
  pointer-events: none;
}

.rival-stage video {
  transform: none;
}

.camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .75rem;
  padding: 1.5rem;
  color: #adb5bd;
  text-align: center;
}

.counter-placeholder-mark {
  display: grid;
  width: 84px;
  height: 84px;
  margin: 0 auto;
  place-items: center;
  border: 2px solid #6c757d;
  border-radius: 50%;
  color: #fff;
  font: 700 2rem/1 Arial, sans-serif;
}

.countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font: 700 clamp(5rem, 18vw, 10rem)/1 Arial, sans-serif;
  text-shadow: 0 .25rem 1rem rgba(0, 0, 0, .55);
  pointer-events: none;
}

.live-pill {
  position: absolute;
  top: .75rem;
  left: .75rem;
  padding: .35rem .6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #dc3545;
  font: 700 .72rem/1.2 Arial, sans-serif;
}

.rival-score-pill {
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .4rem .6rem;
  border-radius: .5rem;
  background: rgba(33, 37, 41, .84);
  color: #fff;
}

.rival-score-pill strong {
  font: 700 1.6rem/1 Arial, sans-serif;
}

.detector-status {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 46px;
  padding: .7rem .9rem;
  border-top: 1px solid var(--bs-border-color);
  color: var(--bs-secondary-color);
  font-size: .875rem;
}

.status-dot {
  flex: 0 0 auto;
  width: .6rem;
  height: .6rem;
  border-radius: 50%;
  background: #adb5bd;
}

.detector-status.ready .status-dot { background: #198754; }
.detector-status.busy .status-dot { background: #ffc107; }

.score-value {
  font: 700 clamp(4rem, 10vw, 6.5rem)/.95 Arial, sans-serif;
  letter-spacing: -.05em;
}

.timer-value {
  font: 700 2rem/1 Arial, sans-serif;
}

.hof-mark {
  min-width: 58px;
  color: var(--bs-primary);
  font: 700 2.5rem/1 Arial, sans-serif;
  text-align: center;
}

.counter-page .btn {
  font-family: Arial, sans-serif;
  font-weight: 600;
}

.counter-error {
  min-height: 1.5rem;
}

.recording-review video,
.hall-evidence-card video {
  width: 100%;
  max-height: 520px;
  border-radius: .5rem;
  background: #111827;
}

.counter-share textarea {
  width: 100%;
  resize: vertical;
}

.anonymous-name-field {
  display: block;
}

.anonymous-name-field input {
  width: 100%;
}

.publication-modal {
  position: fixed;
  z-index: 1080;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.publication-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}

.publication-modal-card {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  padding: 1.5rem;
  border-radius: .75rem;
  background: #fff;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, .3);
}

.publication-modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  border: 0;
  background: transparent;
  color: #6c757d;
  font-size: 1.75rem;
  line-height: 1;
}

.publication-consent-check {
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  margin: 1rem 0;
}

.publication-modal-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
}

body.publication-modal-open {
  overflow: hidden;
}

@media (max-width: 767.98px) {
  .counter-page {
    padding-top: 1.5rem !important;
  }

  .counter-page .counter-heading h1 {
    font-size: 2.25rem;
  }

  .score-value {
    font-size: 4.5rem;
  }

  .publication-modal-actions {
    flex-direction: column-reverse;
  }

  .publication-modal-actions .btn {
    width: 100%;
  }
}
