:root {
  color-scheme: light;
  --bg: #ffffff;
  --navy: #182238;
  --surface: #ffffff;
  --surface-2: #f3efe6;
  --header-bg: #ffffff;
  --panel-bg: #ffffff;
  --modal-bg: #ffffff;
  --input-bg: #ffffff;
  --stage-text: #ffffff;
  --stage-muted: rgba(255, 255, 255, 0.72);
  --overlay-bg: rgba(255, 255, 255, 0.78);
  --strip-bg: rgba(255, 255, 255, 0.08);
  --strip-border: rgba(255, 255, 255, 0.92);
  --line: #182238;
  --text: #182238;
  --muted: #6c6f78;
  --orange: #f15a24;
  --blue: #3f66c8;
  --teal: #159d91;
  --yellow: #f0c14b;
  --good: #168a4f;
  --bad: #c54848;
  --display-font: "Oswald", Impact, "Arial Narrow", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0f15;
  --navy: #111827;
  --surface: #151b26;
  --surface-2: #202838;
  --header-bg: #0c0f15;
  --panel-bg: #151b26;
  --modal-bg: #151b26;
  --input-bg: #0f1420;
  --stage-text: #f7f8fb;
  --stage-muted: rgba(247, 248, 251, 0.72);
  --overlay-bg: rgba(12, 15, 21, 0.82);
  --strip-bg: rgba(255, 255, 255, 0.07);
  --strip-border: rgba(255, 255, 255, 0.42);
  --line: #f7f8fb;
  --text: #f7f8fb;
  --muted: #aab2c0;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 62px;
  padding: 0 54px;
  background: var(--header-bg);
  border-bottom: 2px solid var(--line);
}

.brand-mark {
  text-decoration: none;
}

.brand-mark img {
  display: block;
  width: min(260px, 34vw);
  max-height: 54px;
  object-fit: contain;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mode-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 2px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-family: var(--display-font);
  font-weight: 900;
  text-transform: uppercase;
}

.mode-tab.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.theme-toggle {
  min-height: 36px;
  width: 38px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--orange);
}

.header-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  line-height: 1;
}

.header-avatar:hover {
  border-color: var(--orange);
}

.account-tab {
  min-height: 36px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--display-font);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.account-tab:hover {
  border-color: var(--orange);
}

.nav-group-right {
  justify-content: flex-end;
}

.avatar-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
}

.avatar-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.avatar-icon.is-header {
  width: 42px;
  height: 42px;
}

.avatar-icon.is-online {
  width: 32px;
  height: 32px;
}

.avatar-icon.is-preview {
  width: 76px;
  height: 76px;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 0;
  width: 100%;
  min-height: calc(100vh - 62px);
  margin: 0 auto;
  padding: 0;
  align-items: stretch;
}

.wheel-stage,
.roster-panel,
.online-stage {
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.wheel-stage {
  padding: 24px 28px;
  background: var(--navy);
  color: var(--stage-text);
}

.roster-panel {
  min-height: 560px;
  padding: 24px;
  background: var(--panel-bg);
  border-left: 0;
}

.online-stage {
  grid-column: 1 / -1;
  min-height: calc(100vh - 62px);
  padding: 32px clamp(24px, 6vw, 88px);
  background: var(--navy);
  color: var(--stage-text);
}

.online-stage[hidden],
.online-entry[hidden],
.online-lobby[hidden],
.online-standings[hidden] {
  display: none;
}

.online-heading,
.online-section-head,
.online-actions,
.join-room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.online-heading {
  padding-bottom: 24px;
  border-bottom: 2px solid var(--strip-border);
}

.online-heading h1 {
  color: var(--stage-text);
}

.online-connection {
  min-width: 104px;
  padding: 9px 12px;
  border: 2px solid var(--strip-border);
  color: var(--stage-text);
  font-family: var(--display-font);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.online-connection.is-ready {
  border-color: var(--teal);
  background: var(--teal);
  color: #ffffff;
}

.online-entry,
.online-lobby {
  width: min(880px, 100%);
  margin: 42px auto 0;
}

.online-name-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--stage-muted);
  font-weight: 700;
}

.online-name-field input,
.join-room-row input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid var(--stage-text);
  border-radius: 0;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}

.online-name-field input:focus,
.join-room-row input:focus {
  border-color: var(--orange);
}

.online-choice {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 2px solid var(--strip-border);
}

.online-choice .primary-button,
.online-choice .secondary-button {
  width: 100%;
}

.matchmaking-panel {
  padding-bottom: 26px;
  border-bottom: 2px solid var(--strip-border);
}

.matchmaking-button {
  width: 100%;
  min-height: 64px;
  border: 3px solid var(--blue);
  border-radius: 0;
  background: var(--blue);
  color: #ffffff;
  font-family: var(--display-font);
  font-size: 1.45rem;
  font-weight: 700;
  text-transform: uppercase;
}

.matchmaking-button:hover:not(:disabled) {
  border-color: var(--orange);
}

.join-room-row input {
  display: block;
  min-height: 76px;
  text-transform: uppercase;
  font-family: var(--display-font);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  border-width: 3px;
  border-color: var(--orange);
  caret-color: var(--orange);
  pointer-events: auto;
  touch-action: manipulation;
  user-select: text;
}

.room-code-label {
  display: block;
  margin: 10px 0 8px;
  color: var(--stage-text);
  font-family: var(--display-font);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
}

.join-room-row .primary-button {
  width: 100%;
  min-height: 52px;
}

.join-room-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.room-code-help {
  margin: 8px 0 0;
  color: var(--stage-muted);
  font-size: 0.88rem;
}

.room-code-block {
  padding-bottom: 28px;
  text-align: center;
}

.room-code {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--stage-text);
  font-family: var(--display-font);
  font-size: clamp(2.8rem, 9vw, 5.6rem);
  font-weight: 700;
  line-height: 1;
}

.room-code-block p:last-child,
.online-status {
  color: var(--stage-muted);
}

.lobby-list-block {
  padding: 24px 0;
  border-top: 2px solid var(--strip-border);
  border-bottom: 2px solid var(--strip-border);
}

.online-section-head h2 {
  font-family: var(--display-font);
  text-transform: uppercase;
}

.lobby-player-list,
.standings-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.lobby-player,
.standing-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 9px 12px;
  border: 2px solid var(--strip-border);
  font-weight: 700;
}

.online-player-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.online-player-identity strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-player span,
.standing-row span {
  color: var(--stage-muted);
  font-family: var(--display-font);
  text-transform: uppercase;
}

.online-actions {
  margin-top: 24px;
}

.online-status {
  min-height: 1.5em;
  margin: 18px auto 0;
  text-align: center;
}

.online-standings {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--line);
}

.online-standings .standing-row {
  border-color: var(--line);
}

.online-standings .standing-row span {
  color: var(--muted);
}

.online-standings .standing-row.is-you {
  border-color: var(--blue);
  background: rgba(63, 102, 200, 0.1);
}

.actions,
.panel-head,
.matchup-strip,
.guess-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.top-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: center;
  gap: 18px;
}

.eyebrow,
.timer-card span,
.wheel-card span,
.guess-form label,
#feedbackText,
.results p {
  color: var(--muted);
}

.wheel-stage .eyebrow,
.wheel-stage .timer-card span,
.wheel-stage .wheel-card span,
.wheel-stage .guess-form label,
.wheel-stage #feedbackText {
  color: rgba(255, 255, 255, 0.72);
  color: var(--stage-muted);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 900;
  font-family: var(--display-font);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  max-width: none;
  font-size: clamp(1.55rem, 2.7vw, 2.45rem);
  line-height: 0.98;
  font-weight: 900;
  text-transform: uppercase;
  font-family: var(--display-font);
  white-space: nowrap;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

.timer-card {
  display: grid;
  place-items: center;
  min-width: 96px;
  min-height: 76px;
  padding: 10px;
  background: #ffffff;
  border: 2px solid var(--stage-text);
  border-radius: 0;
  text-align: center;
  color: var(--navy);
}

.timer-card span,
.timer-card strong {
  display: block;
}

.timer-card strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.8rem;
  line-height: 1;
  font-family: var(--display-font);
}

.draw-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 14px;
}

.wheel-card {
  display: grid;
  align-content: center;
  min-height: 132px;
  padding: 18px;
  overflow: hidden;
  background: #ffffff;
  border: 2px solid var(--stage-text);
  border-radius: 0;
  color: var(--navy);
}

.wheel-card strong {
  display: block;
  margin-top: 10px;
  min-height: 1.55em;
  font-size: clamp(1.7rem, 3.7vw, 3rem);
  line-height: 0.96;
  font-family: var(--display-font);
}

#teamWheel {
  display: grid;
  place-items: center;
  min-height: 132px;
}

.team-card-logo {
  display: block;
  width: min(280px, 78%);
  max-width: 88%;
  max-height: 124px;
  object-fit: contain;
}

.wheel-card.is-spinning strong {
  animation: pulse 180ms linear infinite;
}

@keyframes pulse {
  50% {
    transform: translateY(-3px);
    color: var(--orange);
  }
}

.matchup-strip {
  min-height: 50px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.08);
  background: var(--strip-bg);
  border: 2px solid var(--strip-border);
  border-radius: 0;
}

.matchup-strip strong {
  white-space: nowrap;
  font-size: 1.2rem;
  font-family: var(--display-font);
}

.guess-form {
  margin-top: 14px;
}

.guess-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.guess-row input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 2px solid #ffffff;
  border-color: var(--stage-text);
  border-radius: 0;
  background: var(--input-bg);
  color: var(--navy);
  color: var(--text);
  outline: none;
}

.guess-row input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.18);
}

.guess-row button,
.primary-button,
.secondary-button {
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid var(--line);
  border-radius: 0;
  color: var(--text);
  background: #ffffff;
  font-weight: 800;
  font-family: var(--display-font);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.guess-row button:hover:not(:disabled),
.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--orange);
}

.primary-button {
  flex: 1;
  border-color: var(--orange);
  background: var(--orange);
  color: #ffffff;
}

.secondary-button {
  flex: 1;
  border-color: var(--stage-text);
  background: transparent;
  color: var(--stage-text);
}

#feedbackText {
  min-height: 1.45em;
  margin: 8px 0 0;
  line-height: 1.45;
}

.panel-head {
  align-items: flex-start;
  margin-bottom: 16px;
}

.found-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.answer-slot {
  min-height: 42px;
  padding: 10px;
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.answer-slot.is-found {
  border-color: var(--good);
  background: rgba(22, 138, 79, 0.12);
  color: var(--text);
  font-weight: 800;
}

.answer-slot.is-revealed {
  border-color: var(--orange);
  background: rgba(241, 90, 36, 0.1);
  color: var(--text);
}

.results {
  margin-top: 16px;
  padding: 14px;
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: 0;
}

.results strong {
  display: block;
  margin-bottom: 6px;
}

.results p {
  margin-bottom: 10px;
  line-height: 1.45;
}

.year-picker-overlay,
.team-picker-overlay,
.rules-overlay,
.account-overlay,
.share-overlay,
.online-results-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.78);
  background: var(--overlay-bg);
  backdrop-filter: blur(10px);
}

.year-picker-overlay[hidden],
.team-picker-overlay[hidden],
.rules-overlay[hidden],
.account-overlay[hidden],
.share-overlay[hidden],
.online-results-overlay[hidden] {
  display: none;
}

.year-picker-modal,
.team-picker-modal,
.rules-modal,
.account-modal,
.share-modal,
.online-results-modal {
  width: min(430px, 100%);
  padding: 22px;
  background: var(--modal-bg);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 10px 10px 0 var(--navy);
  text-align: center;
}

.rules-overlay {
  z-index: 30;
}

.share-overlay {
  z-index: 32;
}

.account-overlay {
  z-index: 33;
  align-items: start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.online-results-overlay {
  z-index: 34;
}

.rules-modal,
.account-modal,
.share-modal,
.online-results-modal {
  position: relative;
  width: min(560px, 100%);
  text-align: left;
}

.account-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.online-results-modal h2 {
  margin-bottom: 6px;
  font-family: var(--display-font);
  font-size: clamp(2rem, 6vw, 3rem);
  text-transform: uppercase;
}

.online-results-challenge,
.online-results-status {
  color: var(--muted);
}

.online-results-list {
  display: grid;
  gap: 8px;
  margin: 22px 0;
}

.online-result-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 9px 12px;
  border: 2px solid var(--line);
}

.online-result-row.is-winner {
  border-color: var(--orange);
  background: rgba(241, 90, 36, 0.1);
}

.online-result-rank,
.online-result-score {
  font-family: var(--display-font);
  font-weight: 700;
}

.online-result-score {
  white-space: nowrap;
}

.online-results-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.online-results-actions .secondary-button {
  border-color: var(--line);
  color: var(--text);
}

.share-modal h2 {
  margin-bottom: 16px;
  font-family: var(--display-font);
  font-size: clamp(2rem, 6vw, 3rem);
  text-transform: uppercase;
}

.account-modal h2 {
  margin-bottom: 8px;
  font-family: var(--display-font);
  font-size: clamp(2rem, 6vw, 3rem);
  text-transform: uppercase;
}

.account-copy {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.4;
}

.account-form {
  display: grid;
  gap: 9px;
}

.account-form[hidden] {
  display: none;
}

.account-form label {
  color: var(--muted);
  font-weight: 800;
}

.account-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}

.account-form input:focus {
  border-color: var(--orange);
}

.account-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}

.account-secondary,
.account-signout {
  border-color: var(--line);
  color: var(--text);
}

.google-button {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--display-font);
  font-weight: 900;
  text-transform: uppercase;
}

.google-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--blue);
}

.google-button[hidden],
.account-signout[hidden] {
  display: none;
}

.account-signout {
  width: 100%;
  margin-top: 12px;
}

.account-status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
}

.profile-editor {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

.profile-editor[hidden] {
  display: none;
}

.profile-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.profile-editor-head strong,
.profile-avatar-head span {
  font-family: var(--display-font);
  text-transform: uppercase;
}

.profile-avatar-head {
  margin-top: 16px;
}

.profile-avatar-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-preview {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.profile-editor label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.profile-editor input {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}

.profile-editor input:focus {
  border-color: var(--orange);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.avatar-choice {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 132px;
  padding: 14px 10px 12px;
  border: 3px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--display-font);
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
  text-transform: none;
}

.avatar-choice:hover,
.avatar-choice.is-selected {
  border-color: var(--orange);
}

.avatar-choice.is-selected {
  background: rgba(241, 90, 36, 0.12);
}

.avatar-choice > span:last-child {
  min-height: 1.2em;
  display: grid;
  place-items: center;
}

.avatar-choice .avatar-icon {
  width: 72px;
  height: 72px;
}

.profile-save {
  width: 100%;
  margin-top: 12px;
}

.account-stats {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid var(--line);
}

.account-stats[hidden] {
  display: none;
}

.account-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-family: var(--display-font);
  text-transform: uppercase;
}

.account-stat-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.account-stat-card {
  min-width: 0;
  padding: 12px;
  border: 2px solid var(--line);
  background: var(--surface);
}

.account-stat-card h3 {
  margin: 0 0 10px;
  color: var(--orange);
  font-family: var(--display-font);
  font-size: 1.2rem;
  text-transform: uppercase;
}

.account-stat-row,
.account-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  font-size: 0.92rem;
}

.account-stat-row span,
.account-recent-row span,
.account-empty {
  color: var(--muted);
}

.account-stat-row strong,
.account-recent-row strong {
  font-family: var(--display-font);
  text-transform: uppercase;
  white-space: nowrap;
}

.account-recent {
  margin-top: 14px;
}

.account-recent-list {
  display: grid;
  gap: 6px;
}

.account-recent-row {
  padding: 8px 10px;
  border: 2px solid var(--line);
}

.account-recent-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-empty {
  margin: 0;
}

.rules-logo {
  display: block;
  width: min(320px, 78%);
  max-height: 140px;
  margin: 0 auto 14px;
  object-fit: contain;
}

.rules-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 1.6rem;
  line-height: 1;
}

.rules-list {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  padding-left: 20px;
  line-height: 1.45;
}

.rules-start {
  width: 100%;
}

#shareText {
  width: 100%;
  min-height: 178px;
  margin-bottom: 14px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--surface-2);
  color: var(--text);
  font: 0.98rem/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

#shareText:focus {
  outline: 3px solid rgba(241, 90, 36, 0.24);
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.share-secondary {
  border-color: var(--line);
  background: #ffffff;
  background: var(--surface);
  color: var(--text);
}

.share-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--muted);
}

.year-slot {
  position: relative;
  margin: 14px auto 18px;
  padding: 10px;
  background: var(--navy);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.year-slot.is-picked {
  border-color: var(--orange);
  background: var(--navy);
}

.year-slot-window {
  position: relative;
  height: 190px;
  overflow: hidden;
}

.year-slot-window::before,
.year-slot-window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  height: 56px;
  pointer-events: none;
}

.year-slot-window::before {
  top: 0;
  background: linear-gradient(var(--navy), transparent);
}

.year-slot-window::after {
  bottom: 0;
  background: linear-gradient(transparent, var(--navy));
}

.year-slot-track {
  display: grid;
  transform: translateY(0);
  transition: transform 2300ms cubic-bezier(0.1, 0.72, 0.14, 1);
}

.year-slot-track span {
  display: grid;
  place-items: center;
  height: 64px;
  color: rgba(255, 255, 255, 0.58);
  font-size: clamp(1.45rem, 7vw, 2.75rem);
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  font-family: var(--display-font);
}

.year-slot-track span.is-target {
  color: #ffffff;
  text-shadow: 0 0 26px rgba(241, 90, 36, 0.5);
}

.year-picker-modal p:last-child {
  min-height: 1.45em;
  margin-bottom: 0;
  color: var(--muted);
}

.team-logo-stage {
  display: grid;
  place-items: center;
  min-height: 240px;
  margin: 14px auto 18px;
  background:
    radial-gradient(circle at center, rgba(241, 90, 36, 0.1), transparent 58%),
    var(--surface);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.team-logo-stage::before,
.team-logo-stage::after {
  content: none;
}

.team-logo-stage img {
  width: min(170px, 52vw);
  aspect-ratio: 1;
  object-fit: contain;
  transform: scale(1);
}

.team-logo-stage.is-cycling img {
  animation: logoPop 95ms linear infinite;
}

.team-picker-modal.is-picked .team-logo-stage {
  border-color: var(--orange);
  background:
    radial-gradient(circle at center, rgba(241, 90, 36, 0.16), transparent 58%),
    var(--surface);
}

#teamPickerName {
  display: block;
  min-height: 1.3em;
  font-size: clamp(1.65rem, 6vw, 2.5rem);
  line-height: 1;
  font-family: var(--display-font);
}

.team-picker-modal p:last-child {
  min-height: 1.45em;
  margin: 10px 0 0;
  color: var(--muted);
}

@keyframes logoPop {
  50% {
    transform: scale(1.05);
  }
}

@media (max-width: 940px) {
  .game-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 0;
  }

  .roster-panel {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 6px;
    min-height: auto;
    padding: 8px 10px;
  }

  .brand-mark {
    order: -1;
    grid-column: 1 / -1;
    justify-self: center;
  }

  .brand-mark img {
    width: min(210px, 74vw);
    max-height: 46px;
  }

  .nav-group,
  .nav-group-right {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.78rem;
  }

  .nav-group {
    justify-content: flex-start;
  }

  .nav-group-right {
    justify-content: flex-end;
  }

  .mode-tab {
    min-height: 32px;
    padding: 0 11px;
  }

  .theme-toggle {
    min-height: 32px;
    width: 34px;
  }

  .header-avatar {
    width: 34px;
    height: 34px;
  }

  .account-tab {
    min-height: 32px;
    padding: 0 11px;
    font-size: 0.78rem;
  }

  .game-shell {
    width: 100%;
    min-height: auto;
    gap: 0;
  }

  .wheel-stage,
  .roster-panel,
  .online-stage {
    padding: 14px;
  }

  .online-stage {
    min-height: calc(100vh - 104px);
    padding-top: 24px;
  }

  .online-heading {
    align-items: flex-start;
  }

  .online-heading h1 {
    max-width: 230px;
  }

  .online-connection {
    min-width: 82px;
    padding: 7px 8px;
    font-size: 0.78rem;
  }

  .online-entry,
  .online-lobby {
    margin-top: 28px;
  }

  .online-choice {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .join-room-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .join-room-row .primary-button {
    width: 100%;
  }

  .room-code {
    font-size: 3.5rem;
  }

  .top-bar {
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 10px;
    align-items: stretch;
  }

  h1 {
    font-size: 1.38rem;
    line-height: 1.05;
    white-space: normal;
  }

  .timer-card {
    min-width: 82px;
    min-height: 58px;
    padding: 8px;
  }

  .timer-card strong {
    font-size: 1.55rem;
  }

  .draw-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 10px;
  }

  .wheel-card {
    min-height: 104px;
    padding: 10px;
  }

  .wheel-card strong {
    margin-top: 6px;
    font-size: 1.55rem;
    min-height: 1.2em;
  }

  #teamWheel {
    min-height: 96px;
  }

  .team-card-logo {
    width: 92%;
    max-height: 88px;
  }

  .matchup-strip {
    align-items: flex-start;
    min-height: 44px;
    padding: 10px;
    gap: 10px;
    font-size: 0.94rem;
  }

  .matchup-strip strong {
    font-size: 1.05rem;
  }

  .guess-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    gap: 8px;
  }

  .guess-row input,
  .guess-row button,
  .primary-button,
  .secondary-button {
    min-height: 44px;
    padding: 0 12px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .roster-panel {
    border-left: 2px solid var(--line);
    border-top: 0;
  }

  .panel-head {
    margin-bottom: 10px;
  }

  .found-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .answer-slot {
    min-height: 36px;
    padding: 8px;
    font-size: 0.88rem;
  }

  .year-picker-modal,
  .team-picker-modal,
  .rules-modal,
  .account-modal,
  .share-modal,
  .online-results-modal {
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 18px;
    box-shadow: 6px 6px 0 var(--navy);
  }

  .rules-logo {
    width: min(250px, 72%);
    max-height: 110px;
  }

  .team-logo-stage {
    min-height: 190px;
  }

  .team-logo-stage img {
    width: min(150px, 58vw);
  }

  .online-results-actions {
    grid-template-columns: 1fr;
  }

  .account-actions {
    grid-template-columns: 1fr;
  }

  .account-stat-grid {
    grid-template-columns: 1fr;
  }

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