:root {
  color-scheme: dark;
  --bg: #151329;
  --card: #211e38;
  --line: #46405e;
  --text: #fff2e7;
  --muted: #cec3df;
  --accent: #ffc38a;
  --gold: #ffd9a6;
  --red: #ff9c90;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--text);
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse at 92% 0%, #393058, transparent 43rem);
}
.shell {
  width: min(100% - 2rem, 64rem);
  margin-inline: auto;
}
a {
  color: var(--accent);
}
button,
input,
select {
  font: inherit;
}
button,
input,
select {
  min-height: 48px;
  border-radius: 10px;
}
button {
  border: 1px solid var(--line);
  color: var(--text);
  background: #322747;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-weight: 700;
  touch-action: manipulation;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #2b1930;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-block: max(1rem, env(safe-area-inset-top)) 1rem;
  border-bottom: 1px solid var(--line);
  gap: 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}
.brand img {
  border-radius: 10px;
  border: 1px solid var(--line);
}
.brand small {
  display: block;
  color: var(--accent);
  letter-spacing: 0.18em;
}
#connection {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}
main {
  padding-block: 1.5rem 1rem;
  min-height: 65vh;
}
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 1rem max(1.5rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}
h1,
h2,
h3,
p {
  margin: 0 0 0.75rem;
}
h1 {
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 1;
  letter-spacing: -0.065em;
  overflow-wrap: anywhere;
}
h2 {
  font-size: 1.35rem;
  line-height: 1.2;
}
p {
  line-height: 1.55;
  color: var(--muted);
}
small,
.muted {
  color: var(--muted);
}
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 10rem;
  display: grid;
  align-content: end;
  background: linear-gradient(105deg, #2a2046, #533452);
  padding: clamp(1rem, 4vw, 1.65rem);
  border: 1px solid #786183;
  border-radius: 20px;
  margin-bottom: 1rem;
}
.hero canvas {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.64;
}
.hero p:last-child {
  margin-bottom: 0;
  color: #ebd5e7;
}
.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  color: var(--accent) !important;
  font-weight: 800;
  text-transform: uppercase;
}
.narrow {
  max-width: 33rem;
  margin-inline: auto;
}
.card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(1rem, 3vw, 1.45rem);
  overflow-wrap: anywhere;
}
.stack,
.grid,
form {
  display: grid;
  gap: 1rem;
}
.grid {
  grid-template-columns: minmax(0, 1fr);
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.between {
  justify-content: space-between;
}
.row > * {
  min-width: 0;
}
.actions {
  display: grid;
  gap: 0.6rem;
}
label {
  display: grid;
  gap: 0.4rem;
  font-weight: 650;
}
input,
select {
  width: 100%;
  min-width: 0;
  background: #19162c;
  border: 1px solid #716284;
  color: var(--text);
  padding: 0.65rem 0.75rem;
}
input[type='color'] {
  padding: 0.3rem;
}
input[type='file'] {
  font-size: 0.875rem;
}
.dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  background: var(--team);
}
progress {
  display: block;
  width: 100%;
  height: 0.7rem;
  accent-color: var(--accent);
  margin: 0.65rem 0;
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0.4rem 0.65rem;
  font-size: 0.9rem;
}
nav a[aria-current] {
  color: var(--accent);
  background: #443050;
  border-color: #a47593;
}
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}
.list li:last-child {
  border: 0;
}
.rank {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 1.5rem;
}
.timer {
  font-size: 2rem;
  color: var(--gold);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.amount {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 0.5rem;
  text-align: center;
  align-items: center;
}
.amount output {
  font-size: 1.2rem;
  font-weight: 800;
}
.error {
  color: var(--red);
}
#notice:not(:empty) {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom));
  inset-inline: 1rem;
  max-width: 30rem;
  margin: auto;
  background: #3b284e;
  color: var(--text);
  border: 1px solid #ae83a0;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  z-index: 3;
}
.photo {
  display: block;
  max-width: 100%;
  max-height: 18rem;
  border-radius: 10px;
  margin: 0.7rem 0;
}
.metrics {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem;
  margin: 0;
}
.metrics dd {
  margin: 0;
  font-weight: 750;
}
.section-gap {
  margin-top: 1rem;
}
@media (min-width: 700px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wide {
    grid-column: 1/-1;
  }
  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  main {
    padding-top: 2rem;
  }
}

/* Compact game navigation and team status. */
main:has(.team-header) {
  padding-top: 0.8rem;
}
.team-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.2rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.55rem;
}
.team-heading,
.team-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.team-heading h1 {
  font-size: clamp(1.1rem, 5vw, 1.65rem);
  margin: 0;
  letter-spacing: -0.035em;
}
.team-points {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.team-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.team-progress progress {
  flex: 1;
  min-width: 0;
  max-width: 11rem;
  height: 0.4rem;
  margin: 0;
}
.team-header a {
  justify-self: end;
  display: grid;
  place-items: center;
  padding: 0 0.3rem;
  min-height: 42px;
  font-size: 0.85rem;
}
.game-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}
.game-tabs a {
  padding-inline: 0.1rem;
  font-size: clamp(0.76rem, 3.6vw, 0.9rem);
  font-weight: 650;
}
.live-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  margin-bottom: 0.55rem;
  border-radius: 9px;
  border: 1px solid #bb865e;
  color: var(--gold);
  background: #442b40;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.live-banner .timer {
  font-size: 1rem;
  flex: none;
}
.team-header ~ .card,
.team-header ~ .grid .card,
.team-header ~ .stack .card {
  padding: 0.8rem;
}
.ranking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  min-height: 46px;
  padding: 0.4rem 0.55rem;
  text-align: left;
}
.ranking-row strong {
  white-space: nowrap;
}
.ranking-row[aria-expanded='true'] {
  border-color: var(--accent);
}
.ranking-row + form {
  padding: 0.55rem;
  gap: 0.4rem;
}
.ranking-row + form p {
  margin: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 42px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
}
.back-link::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
#casino-notice:not(:empty) {
  position: fixed;
  right: max(0.65rem, env(safe-area-inset-right));
  bottom: max(0.65rem, env(safe-area-inset-bottom));
  z-index: 4;
  max-width: min(22rem, calc(100vw - 1.3rem));
  padding: 0.45rem 0.7rem;
  border: 1px solid #c89369;
  border-radius: 9px;
  background: #493047;
  box-shadow: 0 4px 14px #0005;
  color: var(--text);
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
#notice:not(:empty):has(+ #casino-notice:not(:empty)) {
  bottom: max(3.6rem, calc(env(safe-area-inset-bottom) + 3rem));
}
