:root {
  color-scheme: light;
  --ink: #1d2027;
  --muted: #687082;
  --paper: #fffaf0;
  --panel: #ffffff;
  --line: #d8dee8;
  --red: #d83a34;
  --yellow: #f8c14a;
  --green: #23966b;
  --blue: #2364c8;
  --pink: #d94b92;
  --shadow: 0 16px 42px rgba(23, 31, 48, 0.14);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 10%, rgba(248, 193, 74, 0.24), transparent 26rem),
    radial-gradient(circle at 92% 12%, rgba(35, 100, 200, 0.16), transparent 24rem),
    linear-gradient(145deg, #fffaf0 0%, #f4f7fb 48%, #fff7fb 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  transform: translateY(-180%);
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0.7rem 1rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(216, 222, 232, 0.8);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.topnav a,
.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0.48rem 0.78rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.pill[role="status"] {
  color: var(--ink);
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.5rem) 0 3rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 1.5rem;
  align-items: stretch;
}

.hero-panel,
.panel,
.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 3rem);
  min-height: 30rem;
}

.hero-panel::after {
  position: absolute;
  right: -3rem;
  bottom: -2rem;
  width: 20rem;
  height: 20rem;
  content: "";
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.75) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.75) 1px, transparent 1px),
    conic-gradient(from 0.2turn, var(--red), var(--yellow), var(--green), var(--blue), var(--pink), var(--red));
  background-size: 4rem 4rem, 4rem 4rem, auto;
  border: 3px solid var(--ink);
  border-radius: 50%;
  opacity: 0.24;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  max-width: 10ch;
  font-size: clamp(3rem, 9vw, 6.8rem);
}

h2 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  line-height: 1.6;
}

.lede {
  max-width: 42rem;
  color: #343b49;
  font-size: 1.12rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 0.65rem 1rem;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 3px 3px 0 rgba(29, 32, 39, 0.2);
}

.button.secondary {
  background: #fff;
  color: var(--ink);
}

.button.warning {
  background: var(--red);
}

.button.good {
  background: var(--green);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.panel {
  padding: 1rem;
}

.status-stack {
  display: grid;
  gap: 0.75rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.9rem;
}

.stat strong {
  display: block;
  font-size: 1.65rem;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1rem;
}

.two-col {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
}

.host-grid {
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
}

.host-grid aside h2 {
  font-size: clamp(1.65rem, 4vw, 2.25rem);
}

.form {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  color: #333946;
  font-weight: 800;
}

.field input,
.field select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid #b9c2d0;
  border-radius: 8px;
  background: #fff;
  padding: 0.65rem 0.75rem;
}

.bingo-card {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  gap: 2px;
}

.bingo-cell {
  display: grid;
  min-height: clamp(3.25rem, 11vw, 5.3rem);
  place-items: center;
  background: #fff;
  color: var(--ink);
  font-size: clamp(1rem, 4vw, 1.75rem);
  font-weight: 900;
  text-align: center;
}

.bingo-cell.header {
  min-height: 2.6rem;
  background: var(--red);
  color: #fff;
  font-size: 1.1rem;
}

.bingo-cell.hit {
  background: var(--yellow);
  box-shadow: inset 0 0 0 4px var(--ink);
}

.bingo-cell.free {
  background: var(--green);
  color: #fff;
  font-size: clamp(0.72rem, 2.5vw, 1rem);
  padding: 0.4rem;
}

.ball-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ball-list:focus {
  outline: none;
}

.ball {
  display: inline-grid;
  min-width: 2.55rem;
  min-height: 2.55rem;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.ball.big {
  width: min(42vw, 15rem);
  height: min(42vw, 15rem);
  margin: 1.2rem auto;
  background: var(--yellow);
  font-size: clamp(3rem, 12vw, 6.5rem);
  box-shadow: 8px 8px 0 var(--ink);
}

.accessibility-note {
  border-left: 4px solid var(--blue);
  background: #f4f8ff;
  padding: 0.75rem 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: #394154;
}

.claim {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.8rem;
}

.claim.valid {
  border-color: rgba(35, 150, 107, 0.6);
  background: #effbf6;
}

.claim.invalid {
  border-color: rgba(216, 58, 52, 0.55);
  background: #fff3f2;
}

.prize {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.8rem;
}

.prize.compact {
  grid-template-columns: 3.5rem minmax(0, 1fr);
}

.prize strong,
.prize span {
  display: block;
}

.prize-logo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem;
}

.prize-logo.placeholder {
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 900;
}

.prize-form {
  margin-bottom: 1rem;
}

.live-screen {
  min-height: calc(100vh - 8rem);
  display: grid;
  align-content: center;
  text-align: center;
}

.live-screen h1 {
  max-width: none;
  font-size: clamp(2.4rem, 7vw, 6rem);
}

.winner {
  display: grid;
  min-height: calc(100vh - 8rem);
  place-items: center;
  text-align: center;
}

.winner h1 {
  max-width: none;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  display: grid;
  gap: 0.5rem;
}

.toast {
  width: min(24rem, calc(100vw - 2rem));
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  padding: 0.85rem 1rem;
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 800;
}

.empty {
  border: 1px dashed #aeb8c8;
  border-radius: 8px;
  padding: 1rem;
  color: var(--muted);
}

@media (max-width: 820px) {
  .topbar,
  .hero,
  .two-col,
  .host-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .topnav {
    justify-content: flex-start;
  }

  .hero-panel {
    min-height: 24rem;
  }
}
