/* The test room: the practice test in the home page's world. Dark by default (graphite, signal
   blue, dot-matrix numerals); the light theme uses the same layout with the light tokens.
   Loaded by templates/test.html only, after its own <style> block. */

.test-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.test-nav .nav-inner {
  max-width: none;
  padding-left: clamp(12px, 2vw, 32px);
  padding-right: clamp(12px, 2vw, 32px);
}
.test-nav .burger-btn,
.test-nav .back-btn,
.test-nav .theme-btn,
.test-nav #translateBtn {
  border-color: var(--border-strong);
  border-radius: 10px;
}
.test-nav .nav-test-title {
  max-width: 260px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.test-nav .voice-picker-btn {
  border-color: var(--border-strong);
  background: var(--bg-card);
  box-shadow: none;
}

/* Bold tabular numerals for the timer and the question counter. */
.timer,
#navCounter {
  font-family: inherit;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.timer {
  min-width: 84px;
  padding: 5px 12px;
  border-color: var(--border-strong);
  border-radius: 10px;
  color: var(--accent);
  font-size: 1.12rem;
  text-align: center;
}
.timer.warning {
  color: var(--wrong);
  border-color: var(--wrong);
}

.progress-bar {
  background: var(--border);
}

#testContainer {
  width: min(1680px, calc(100% - 48px));
  max-width: none;
  /* Fill the screen so the support links sit at the bottom, just above the bottom bar,
     instead of floating in the middle of the page. */
  min-height: calc(100svh - 63px - 52px - 76px);
  padding-left: 0;
  padding-right: 0;
  padding-bottom: 20px !important;
}
body:has(#testContainer) .site-trust-links {
  padding: 14px 16px 90px;
  font-size: 0.76rem;
}
#questionCounter {
  color: var(--text-soft) !important;
  font-weight: 700;
}
.qmap-btn {
  border-color: var(--border-strong);
}

/* The scene and the statements share the screen: the photo takes as much width as the screen's
   height allows at its own 5:3 ratio, the statements take the rest. */
.test-image-wrap {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-soft);
}
#questionImg {
  border-radius: 0;
}
#questionText {
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}
#answersContainer .answer-option {
  gap: 14px;
  padding: 15px 18px;
  border-width: 1px;
  border-color: var(--border-strong);
  border-radius: 14px;
  background: var(--bg-card);
}
/* Hover only where a pointer can hover: on touch screens it would stick to a tapped answer. */
@media (hover: hover) {
  #answersContainer .answer-option:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
    background: var(--bg-card);
  }
}
#answersContainer .answer-option.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent-ring);
}
#answersContainer .answer-checkbox {
  border-width: 1.5px;
  border-color: var(--border-strong);
  border-radius: 7px;
}
.word-help-hint {
  margin-bottom: 14px;
}

/* Bottom bar: back, the counter and the way forward, with the keys that do the same. */
.nav-buttons {
  padding: 14px clamp(14px, 2vw, 32px);
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.nav-buttons .btn-ghost,
.nav-buttons .btn-primary {
  min-width: 132px;
  justify-content: center;
}
.nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
#navCounter {
  color: var(--text) !important;
  font-size: 1.15rem !important;
}
.test-keys-hint {
  color: var(--text-muted);
  font-size: 0.74rem;
  white-space: nowrap;
}
.test-keys-hint kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.72rem;
}

@media (min-width: 1201px) {
  .test-layout {
    grid-template-columns: minmax(0, min(64%, calc((100svh - 236px) * 5 / 3))) minmax(360px, 1fr);
    gap: clamp(20px, 2vw, 34px);
  }
  #questionText {
    font-size: clamp(1.22rem, 0.85rem + 0.62vw, 1.7rem) !important;
    line-height: 1.3 !important;
  }
  #answersContainer .answer-option-label {
    font-size: clamp(0.95rem, 0.82rem + 0.28vw, 1.1rem);
    line-height: 1.45;
  }
  #answersContainer .answer-option {
    margin-bottom: 12px;
  }
}

@media (max-width: 768px) {
  #testContainer {
    width: auto;
    min-height: 0;
  }
  .test-keys-hint {
    display: none;
  }
  .timer {
    min-width: 0;
    font-size: 0.95rem;
  }
}
@media (hover: none) {
  .test-keys-hint {
    display: none;
  }
}
