/* WFSC 2026 — Jury App. Layout/spacing only, no new colors (see tokens.css). */

/* Fills the viewport below the cobrand header so the judging view can spread its two
   columns sideways and scroll only inside them, instead of scrolling the whole page. */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

.app {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 12px 18px 10px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app > section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- Error banner ---------- */
.error-banner {
  background: rgba(255, 77, 109, 0.15);
  border-bottom: 1px solid var(--danger);
  color: var(--danger);
  padding: 12px 20px;
  font-weight: 700;
  text-align: center;
}

/* ---------- Centered message views ---------- */
.view-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 24px;
}

.big-message {
  max-width: 560px;
  text-align: center;
  padding: 40px 32px;
}

.big-message h1 {
  font-size: 2rem;
  margin-bottom: 0.4em;
}

.big-message p {
  font-size: 1.1rem;
  margin: 0;
}

/* ---------- Run context bar ---------- */
.run-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 10px 16px;
  flex-wrap: wrap;
}

.run-rider-name {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.run-meta {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.run-total {
  text-align: right;
}

.run-total-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.run-total-value {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-style: italic;
  font-size: 2rem;
  color: var(--ink);
  padding-right: 0.05em;
}

.run-context-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ready-btn {
  min-height: 48px;
  padding: 10px 22px;
  font-family: var(--font-condensed);
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-color: var(--danger);
  color: var(--danger);
  white-space: nowrap;
}

.ready-btn.is-ready {
  border-color: var(--ok);
  background: rgba(76, 212, 76, 0.15);
  color: var(--ok);
}

/* ---------- Left/right judging columns (everything spreads sideways, not stacked) ---------- */
.judging-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
}

.judging-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

@media (max-width: 820px) {
  .judging-columns {
    grid-template-columns: 1fr;
  }
}

/* ---------- Trick logger ---------- */
.trick-logger, .computed-card, .criteria-card {
  padding: 12px 16px;
}

.trick-logger h2, .computed-card h2, .criteria-card h2 {
  margin-bottom: 8px;
}

.trick-form {
  display: grid;
  grid-template-columns: 1fr 110px auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.trick-form input[type="text"],
.trick-form input[type="number"] {
  min-height: 44px;
  width: 100%;
}

.trick-bail-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
  min-height: 44px;
}

.trick-bail-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--g-magenta);
}

.trick-add-btn {
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .trick-form {
    grid-template-columns: 1fr 1fr;
  }
  .trick-add-btn { grid-column: 1 / -1; }
}

.trick-list-wrap {
  min-height: 32px;
  margin-bottom: 8px;
}

.trick-list-wrap p {
  margin: 0;
}

.trick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.trick-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.trick-list li.is-bail {
  border-color: var(--danger);
}

.trick-entry-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.trick-entry-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trick-entry-points {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-style: italic;
  font-size: 1.1rem;
}

.trick-entry-remove {
  min-height: 40px;
  padding: 6px 14px;
  flex-shrink: 0;
}

.trick-reset-btn {
  width: 100%;
  min-height: 44px;
}

/* ---------- Computed card ---------- */
.computed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.computed-row:last-child { border-bottom: none; }

.computed-label {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.computed-value {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-style: italic;
  font-size: 1.4rem;
}

/* ---------- Criteria list ---------- */
/* Every criterion is a single horizontal row (label + control + value) instead of a
   label row stacked on top of a control row — this is what makes 9 criteria per bundle
   fit without the page needing to scroll vertically. */
.criteria-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.criterion {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}

.criterion:last-child { border-bottom: none; }

.criterion-label {
  font-weight: 600;
  font-size: 0.88rem;
  flex: 1 1 140px;
  min-width: 100px;
}

.criterion-value {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-style: italic;
  font-size: 1.1rem;
  min-width: 2.3em;
  text-align: right;
  flex-shrink: 0;
}

/* Slider */
.criterion-range {
  flex: 2 1 120px;
  -webkit-appearance: none;
  appearance: none;
  height: 32px;
  background: transparent;
  padding: 0;
  border: none;
}

.criterion-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.criterion-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border-radius: 50%;
  background-image: var(--pulse);
  border: 2px solid var(--ink);
  cursor: pointer;
}

.criterion-range::-moz-range-track {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.criterion-range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-image: var(--pulse);
  border: 2px solid var(--ink);
  cursor: pointer;
}

/* Counter */
.criterion-counter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.counter-btn {
  min-width: 44px;
  min-height: 44px;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.counter-value {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-style: italic;
  font-size: 1.4rem;
  min-width: 2em;
  text-align: center;
}

/* Bonus / computed display */
.criterion-static {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
}

/* ---------- Save indicator ---------- */
.save-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ok);
  color: #0A0D10;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

.save-indicator.show {
  opacity: 1;
  transform: translateY(0);
}
