:root {
  --crest-red: #cb2c30;
  --crest-red-dark: #a6242b;
  --cream: #faf6f0;
  --off-black: #1a1a1a;
  --muted: #666666;
  --light-steam: #ff9865;
  --panel-shadow: 7px 7px 0 var(--off-black);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(255, 152, 101, 0.18), transparent 28%),
    linear-gradient(180deg, #fff7ee 0%, var(--cream) 28%, #f3ebdd 100%);
  color: var(--off-black);
  font-family: "Montserrat", Arial, sans-serif;
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 100vh;
  padding: 12px;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 132px 12px 16px;
  border: 3px solid var(--off-black);
  border-bottom: 6px solid var(--crest-red);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 48%),
    var(--off-black);
  box-shadow: var(--panel-shadow);
}

.corner-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.corner-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(25, 25, 25, 0.72);
  box-shadow: none;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.corner-button:hover,
.corner-button:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(0, 0, 0, 0.9);
  transform: none;
  box-shadow: none;
}

.reset-corner-button {
  width: auto;
  min-width: 56px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fullscreen-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.round-picker {
  display: flex;
  justify-content: center;
  flex: 1 1 260px;
  min-width: 220px;
}

.round-select-wrap {
  position: relative;
  width: min(100%, 370px);
}

.round-select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255, 255, 255, 0.75);
  border-bottom: 2px solid rgba(255, 255, 255, 0.75);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.round-select {
  width: 100%;
  padding: 0.55rem 2.75rem 0.55rem 0.95rem;
  border: 2px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-family: "Graduate", Georgia, serif;
  font-size: clamp(1.15rem, 2vw, 1.75rem);
  letter-spacing: 0.03em;
  appearance: none;
  outline: none;
}

.round-select:focus-visible {
  border-color: var(--light-steam);
  box-shadow: 0 0 0 3px rgba(255, 152, 101, 0.2);
}

.round-select option {
  color: var(--off-black);
}

.shield-mark {
  display: grid;
  place-items: center;
  width: 60px;
  height: 68px;
  color: #ffffff;
  font-family: "Graduate", Georgia, serif;
  font-size: 1.8rem;
  background: linear-gradient(180deg, #dc454a 0%, var(--crest-red) 65%, var(--crest-red-dark) 100%);
  clip-path: polygon(50% 0%, 100% 16%, 100% 68%, 50% 100%, 0% 68%, 0% 16%);
  border: 3px solid #ffffff;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--crest-red);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 800;
}

.topbar h1 {
  margin: 0;
  color: #ffffff;
  font-family: "Graduate", Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.85rem);
  letter-spacing: 0.03em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-right: 34px;
}

.callout {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.callout .eyebrow {
  margin-bottom: 0;
}

.number-wrap {
  display: grid;
  place-items: center;
  min-width: 170px;
  padding: 10px 16px;
  border: 3px solid var(--off-black);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 152, 101, 0.18), transparent 24%),
    linear-gradient(180deg, #fffdf8 0%, #f6efdf 100%);
  box-shadow: 6px 6px 0 var(--crest-red);
}

.called-number {
  font-family: "Graduate", Georgia, serif;
  font-size: clamp(2rem, 3.8vw, 3.3rem);
  line-height: 0.95;
}

.button {
  padding: 0.58rem 0.8rem;
  border: 2px solid var(--off-black);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--off-black);
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--off-black);
}

.button:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--off-black);
}

.button-primary {
  background: var(--crest-red);
  color: #ffffff;
}

.button-secondary {
  background: #ffffff;
  color: var(--off-black);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: 3px 3px 0 var(--off-black);
}

.is-hidden {
  display: none;
}

.content-shell {
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
  min-height: 0;
}

.board-shell {
  min-height: 0;
}

.board-section {
  display: flex;
  height: auto;
  padding: 10px;
  border: 3px solid var(--off-black);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--panel-shadow);
  backdrop-filter: blur(6px);
}

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  width: 100%;
}

.column {
  display: grid;
  grid-template-rows: auto auto;
  border: 3px solid var(--off-black);
  background: rgba(255, 255, 255, 0.94);
  overflow: hidden;
  align-self: start;
}

.column-header {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-bottom: 3px solid var(--off-black);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 72%),
    var(--off-black);
  color: #ffffff;
  font-family: "Graduate", Georgia, serif;
  font-size: 1.55rem;
}

.column-header span {
  color: var(--crest-red);
}

.numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  align-content: start;
}

.number {
  width: 100%;
  aspect-ratio: 1 / 0.68;
  border: 2px solid var(--off-black);
  background: #fffdf9;
  color: var(--off-black);
  font-family: "Graduate", Georgia, serif;
  font-size: clamp(0.92rem, 1.3vw, 1.2rem);
  cursor: pointer;
  transition:
    transform 120ms ease,
    background-color 120ms ease,
    color 120ms ease,
    opacity 120ms ease,
    box-shadow 120ms ease;
  opacity: 0.28;
  box-shadow: none;
}

.number:hover,
.number:focus-visible {
  transform: translateY(-1px);
  opacity: 0.6;
}

.number.drawn {
  background: var(--crest-red);
  color: #ffffff;
  opacity: 1;
  box-shadow: 2px 2px 0 var(--off-black);
}

.number.drawn.is-last {
  background: linear-gradient(180deg, #e14f54 0%, var(--crest-red) 72%);
  outline: 3px solid var(--light-steam);
  outline-offset: -3px;
}

.number:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--light-steam);
  outline-offset: 2px;
}

.sponsors-section {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 14px 18px;
  border: 3px solid var(--off-black);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--panel-shadow);
}

.sponsors-image {
  display: block;
  width: 100%;
  max-height: min(31vh, 320px);
  object-fit: contain;
  object-position: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 980px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding-right: 16px;
  }

  .round-picker {
    min-width: 0;
  }

  .topbar-actions {
    justify-content: flex-start;
    margin-right: 0;
  }

  .board-section {
    height: auto;
  }

  .board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sponsors-image {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 12px;
  }

  .topbar,
  .board-section {
    box-shadow: 5px 5px 0 var(--off-black);
  }

  .topbar {
    padding-right: 16px;
  }

  .shield-mark {
    width: 54px;
    height: 62px;
    font-size: 1.55rem;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .round-select-wrap {
    width: 100%;
  }

  .callout {
    justify-items: stretch;
  }

  .number-wrap {
    min-width: 0;
    width: 100%;
  }

  .corner-controls {
    top: 8px;
    right: 8px;
  }

  .board {
    grid-template-columns: 1fr;
  }

  .content-shell {
    gap: 10px;
  }
}
