html {
  font-size: 16px;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  background: #101114;
  color: #f5f7fb;
  margin-bottom: 60px;
}

a {
  color: #78d8ff;
}

.navbar {
  background: #151820;
}

.footer {
  background: #101114;
}

.duel-shell,
.test-layout,
.content-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.duel-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 2rem;
  align-items: start;
}

.duel-intro h1,
.test-layout h1,
.content-page h1 {
  font-weight: 800;
}

.eyebrow {
  color: #5ee2a0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.lead {
  color: #cfd6e6;
}

.privacy-panel,
.camera-consent {
  background: #1b2029;
  border: 1px solid #2c3441;
  border-radius: 8px;
  padding: 1.25rem;
}

.privacy-panel h2,
.camera-consent h2 {
  font-size: 1.25rem;
}

.camera-stage {
  align-items: center;
  aspect-ratio: 4 / 3;
  background: #050608;
  border: 1px solid #2c3441;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.test-layout {
  display: grid;
  gap: 1.25rem;
}

.test-layout h1 {
  font-size: 1.75rem;
  overflow-wrap: anywhere;
}

.camera-stage {
  width: 100%;
  max-width: 640px;
  justify-self: center;
}

.camera-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: scaleX(-1);
}

.camera-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.camera-indicator {
  color: #5ee2a0;
  font-weight: 700;
}

.camera-indicator::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: currentColor;
  margin-right: 0.5rem;
}

#camera-message {
  margin: 0;
  min-height: 3rem;
}

.camera-privacy {
  color: #aab4c8;
  font-size: 0.875rem;
  margin: 0;
}

.calibration-panel {
  display: grid;
  gap: 0.75rem;
  border-top: 1px solid #2c3441;
  border-bottom: 1px solid #2c3441;
  padding: 1.25rem 0;
}

.readiness-panel {
  display: grid;
  gap: 0.75rem;
  border-top: 1px solid #2c3441;
  padding-top: 1.25rem;
}

#readiness-status {
  color: #78d8ff;
  font-size: 0.875rem;
}

.readiness-panel[data-state="READY"] #readiness-status {
  color: #5ee2a0;
}

.readiness-panel[data-state="MULTIPLE_FACES"] #readiness-status,
.readiness-panel[data-state="EYES_NOT_VISIBLE"] #readiness-status {
  color: #ffb4b4;
}

#readiness-message {
  margin: 0;
  min-height: 3rem;
}

.calibration-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.calibration-heading h2 {
  font-size: 1.25rem;
  margin: 0;
}

#calibration-status {
  color: #5ee2a0;
}

#calibration-message {
  margin: 0;
  min-height: 3rem;
}

#calibration-progress {
  width: 100%;
  height: 0.75rem;
  accent-color: #5ee2a0;
}

.calibration-thresholds {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 0;
}

.calibration-thresholds dt {
  color: #aab4c8;
  font-size: 0.8rem;
}

.calibration-thresholds dd {
  font-variant-numeric: tabular-nums;
  margin: 0;
}

#face-message {
  color: #ffb4b4;
  margin: 0;
}

[hidden] {
  display: none !important;
}

.camera-placeholder {
  color: #8c96aa;
  padding: 1rem;
  text-align: center;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.status-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.status-grid > div {
  background: #1b2029;
  border: 1px solid #2c3441;
  border-radius: 8px;
  padding: 1rem;
}

.status-grid dt {
  color: #aab4c8;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.status-grid dd {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0;
}

.content-page {
  max-width: 760px;
}

.connection-test {
  display: grid;
  gap: 1.25rem;
}

.connection-test h1 {
  font-size: 1.75rem;
  overflow-wrap: anywhere;
}

.connection-test .status-grid dd {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.room-lobby { max-width: 1480px; margin: 0 auto; padding: 1.5rem 0 3rem; width: 100%; }
.room-lobby h1 { font-size: 2rem; font-weight: 800; }
.room-lobby h2 { font-size: 1.25rem; margin: 0; overflow-wrap: anywhere; }
.room-form { display: grid; gap: 1rem; }
.room-form > button { justify-self: start; }
.room-join { border-top: 1px solid #2c3441; padding-top: 1.25rem; }
.room-code-controls { display: flex; gap: 0.75rem; align-items: start; }
.room-code-controls input { min-width: 0; flex: 1; }
.room-code-controls button { flex-shrink: 0; }
#room-code { text-transform: uppercase; }
.room-heading, .room-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.room-heading { justify-content: space-between; margin-bottom: 1rem; }
.room-actions { margin-top: 1rem; }
.room-players { list-style: none; padding: 0; margin: 1.25rem 0; }
.room-players li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #2c3441; padding: 1rem 0; }
.room-players li span:first-child { overflow-wrap: anywhere; min-width: 0; }
.room-players li span:last-child { color: #5ee2a0; flex-shrink: 0; }
#lobby-message { min-height: 3rem; margin-top: 1.25rem; color: #78d8ff; overflow-wrap: anywhere; }
.duel-videos .camera-stage { max-width: none; width: 100%; }
.opponent-stage video { transform: none; }
.simulated-opponent { display: grid; justify-items: center; gap: 0.25rem; padding: 0.75rem; text-align: center; width: 100%; }
.simulated-opponent img { width: 45%; max-width: 160px; height: auto; }
.simulated-opponent strong { font-size: 0.875rem; }
.simulated-opponent span { color: #5ee2a0; font-size: 0.875rem; }
@media (max-width: 420px) {
  .room-code-controls { flex-wrap: wrap; }
  .room-code-controls input { flex-basis: 100%; }
  .room-players li { flex-wrap: wrap; }
  .room-players li span:last-child { flex-shrink: 1; overflow-wrap: anywhere; }
}

@media (max-width: 768px) {
  .duel-shell {
    grid-template-columns: 1fr;
  }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
.status-grid dd {
  overflow-wrap: anywhere;
  min-width: 0;
}
