:root {
  --paper: #E7E9EC;
  --card: #FBFCFD;
  --ink: #14161A;
  --ink-soft: #2B2F35;
  --ink-muted: #5A616B;
  --rule: #BFC5CC;
  --rule-faint: #DDE0E4;
  --accent: #1E4D8C;
  --accent-on: #FFFFFF;
  --red: #B3352C;
  --green: #2E7D46;
  --radius: 4px;
  --max-width: 480px;
  --font-display: "Bitter", Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  min-height: 100vh;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* Header: wordmark + date/context, 2px rule beneath */
.app-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}

#app-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 0;
}

.header-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-muted);
}

.header-meta.timer-urgent {
  font-weight: 600;
  color: var(--ink);
}

/* Mode toggle: plain text tabs, no pill/background chrome */
.mode-toggle {
  display: flex;
  gap: 16px;
  margin: 10px 0 16px;
}

.mode-btn {
  border: none;
  background: none;
  color: var(--ink-muted);
  padding: 4px 0;
  font-family: var(--font-ui);
  font-size: 13px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.mode-btn.active {
  color: var(--ink);
  font-weight: 500;
  border-bottom-color: var(--ink);
}


/* Roster line: label left, value right, hairline rule beneath. Used for
   tier/points, colors, conference, enrollment, and every stats readout. */
.roster-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--rule-faint);
  font-family: var(--font-ui);
  font-size: 13px;
}

.roster-group .roster-line:last-child {
  border-bottom: none;
}

.roster-label {
  color: var(--ink-muted);
}

.roster-value {
  color: var(--ink);
  font-weight: 500;
  text-align: right;
}

#question-meta {
  margin-top: 12px;
}

.prompt-label {
  color: var(--ink-muted);
  margin: 0 0 4px;
  font-size: 12px;
}

/* Single card -- both the asking and revealed states live inside this one
   element (see js/main.js), never two stacked cards. */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
}

#school-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.1;
  margin: 0 0 4px;
}

#school-city {
  color: var(--ink-muted);
  font-size: 12px;
  margin: 0 0 16px;
}

#guess-input, #tourney-email-input {
  width: 100%;
  padding: 12px;
  border-radius: 3px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
}

#tourney-email-input {
  margin-top: 8px;
}

.primary-btn, .secondary-btn {
  display: block;
  width: 100%;
  height: 40px;
  border-radius: 3px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
}

.primary-btn {
  background: var(--accent);
  color: var(--accent-on);
  border: none;
}

.secondary-btn {
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

#reveal-school-ref {
  font-size: 12px;
  color: var(--ink-muted);
  margin: 0 0 8px;
}

.reveal-result {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.reveal-result.wrong { color: var(--red); }

.your-guess {
  color: var(--ink-muted);
  font-size: 13px;
  margin: 0 0 12px;
}

.mascot-reveal {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
}

.reveal-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  background: #fff;
  border-radius: 3px;
  padding: 4px;
  flex-shrink: 0;
}

#reveal-mascot {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.0;
  margin: 0;
}

.blurb {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 12px 0 0;
}

.error-text {
  color: var(--red);
  font-size: 12px;
  margin-top: 8px;
}

#summary-score {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 12px 0;
}

#stats-summary, #summary-stats {
  margin-top: 8px;
}

/* Ladder: five segments in play order (Fieldhouse first, Cracker Box
   last), anchored to the bottom of every screen via #app's flex column +
   margin-top: auto below. This is the sole "result" indicator now --
   replaces the old per-question tick icons entirely (they encoded nothing
   differentiable at a glance on a long run). */
.ladder {
  display: flex;
  gap: 4px;
  height: 22px;
}

.ladder-segment {
  flex: 1;
  background: var(--rule-faint);
}

.ladder-segment.ladder-correct { background: var(--green); }
.ladder-segment.ladder-missed { background: var(--red); }

/* Tourney Run progress: a plain running count instead of a segmented bar,
   since an endless run has no fixed length to divide into segments. */
.big-number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 56px;
  line-height: 1.4;
  padding-top: 8px;
  color: var(--ink);
  text-align: center;
  overflow: visible;
}

.big-number-label {
  font-size: 13px;
  color: var(--ink-muted);
  text-align: center;
  margin-top: 4px;
}

#ladder-container {
  margin-top: 12px;
}
