:root {
  --sky: #dceef5;
  --ink: #23394a;
  --coral: #b83b31;
  --paper: #fffdf6;
  --blue: #5369b5;
  --line: #aec7d1;
  --mint: #d0e7cd;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 12px 17px;
  font-weight: 700;
  min-height: 46px;
}
button:hover {
  background: #e5ebf6;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #8299a3;
  background: #fff;
  padding: 13px;
  border-radius: 7px;
  color: var(--ink);
}
input:focus,
select:focus,
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #b83b31;
  outline-offset: 4px;
}
header,
main,
footer {
  max-width: 1320px;
  margin: auto;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 40px;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.brand {
  font-weight: 900;
  letter-spacing: 2px;
  text-decoration: none;
}
.brand span {
  font-weight: 400;
}
.edition,
.eyebrow,
.ticket-label {
  font:
    700 11px/1.5 "Courier New",
    monospace;
  letter-spacing: 1.7px;
}
#connection {
  font-size: 12px;
}
main {
  padding: 50px 40px;
}
.welcome {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 75px;
  align-items: start;
}
h1 {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: clamp(48px, 5.7vw, 80px);
  line-height: 1.02;
  letter-spacing: -4px;
  margin: 24px 0;
}
h1 em {
  font-style: normal;
  color: var(--coral);
}
.lede {
  font-size: 21px;
  line-height: 1.5;
  margin: 20px 0 0;
}
.hero-birds {
  position: relative;
  margin-top: -16px;
}
#hero {
  width: 100%;
  height: auto;
  display: block;
}
.stamp {
  position: absolute;
  right: 0;
  top: 30px;
  background: #f7d46e;
  border: 1px solid var(--ink);
  border-radius: 50%;
  padding: 20px 15px;
  text-align: center;
  font-size: 12px;
  transform: rotate(12deg);
}
.stamp strong {
  font-size: 24px;
}
.facts {
  display: flex;
  gap: 24px;
  font-weight: 700;
  font-size: 13px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.entry {
  background: var(--paper);
  padding: 30px 32px;
  border: 1px solid var(--ink);
  border-radius: 14px;
  box-shadow: 7px 7px 0 #b9d3df;
  position: relative;
}
.ticket-label {
  display: block;
  border-bottom: 1px dashed #9cb0b8;
  padding-bottom: 16px;
  color: #5a6d78;
}
h2 {
  font-size: 27px;
  letter-spacing: -1px;
  margin: 18px 0;
}
label,
legend {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 9px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 21px 0;
}
legend {
  padding: 0;
}
.colors {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatch {
  padding: 0;
  width: 32px;
  min-height: 32px;
  border-radius: 50%;
  border: 3px solid var(--paper);
}
.swatch[aria-pressed="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.primary {
  background: var(--coral);
  color: white;
  border-color: var(--coral);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}
.primary:hover {
  background: #942f27;
  color: #fff;
}
.entry .primary {
  width: 100%;
  margin-top: 24px;
}
.or {
  text-align: center;
  font-size: 12px;
  margin: 20px 0;
  color: #526676;
}
.join-row {
  display: flex;
  gap: 8px;
}
.join-row input {
  text-transform: uppercase;
  letter-spacing: 3px;
}
.join-row button {
  white-space: nowrap;
}
.small {
  font-size: 12px;
  line-height: 1.6;
  color: #526676;
}
.entry .small {
  margin: 20px 0 0;
}
.error {
  color: #982c25;
  font-weight: 700;
  min-height: 1em;
}
.error:empty {
  display: none;
}
.schedule {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}
.schedule-title {
  grid-column: 1/-1;
}
.schedule-title h2 {
  margin: 7px 0 3px;
}
.schedule article {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.game-icon {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  flex-shrink: 0;
  width: 55px;
  height: 60px;
  display: grid;
  place-items: center;
  font-size: 40px;
  color: var(--coral);
}
h3 {
  font-size: 20px;
  margin: 7px 0;
}
.schedule article p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}
footer {
  padding: 25px 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}
.room-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.room-title {
  font-size: 48px;
  margin: 10px 0 20px;
  letter-spacing: -2px;
}
.room-actions {
  display: flex;
  gap: 10px;
}
.room-code {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  font-size: 12px;
}
.room-code strong {
  font: 700 24px monospace;
  letter-spacing: 4px;
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 255px;
  gap: 24px;
}
.stage {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  background: #edf5ed;
}
#arena {
  width: 100%;
  display: block;
  aspect-ratio: 8/5;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: #fffdf6ee;
}
.overlay h2 {
  font-size: clamp(26px, 4vw, 45px);
  margin: 8px 0;
}
.overlay p {
  max-width: 430px;
  line-height: 1.6;
}
.overlay .primary {
  margin-top: 12px;
}
.timer {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 9px 14px;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  font: bold 22px monospace;
}
.scoreboard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.scoreboard ol {
  padding: 0;
  list-style: none;
}
.scoreboard li {
  display: flex;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #dbe3e5;
  align-items: center;
  font-size: 13px;
}
.scoreboard li .player-name {
  flex: 1;
  overflow-wrap: anywhere;
}
.scoreboard li small {
  display: block;
  font-size: 10px;
  margin-top: 4px;
}
.scoreboard li strong {
  font: 700 18px monospace;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.below-stage {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  min-height: 50px;
}
#feedback {
  font-weight: 700;
}
.copy-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.copy-controls button {
  padding: 14px 4px;
  font-size: 13px;
}
.copy-controls button.lit {
  background: #f7d46e;
  outline: 3px solid var(--ink);
}
.move-controls {
  text-align: center;
  touch-action: none;
  user-select: none;
}
.move-controls button {
  width: 55px;
  margin: 3px;
}
.move-controls button.active {
  background: #f7d46e;
}
[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  .welcome {
    gap: 30px;
  }
  .play-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .scoreboard ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }
  .edition {
    display: none;
  }
}
@media (max-width: 650px) {
  header {
    padding: 20px;
  }
  .brand {
    font-size: 13px;
  }
  main {
    padding: 28px 20px;
  }
  .welcome {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  h1 {
    font-size: 55px;
    letter-spacing: -3px;
    margin-top: 18px;
  }
  .lede {
    font-size: 18px;
  }
  .hero-birds {
    margin-top: -20px;
    max-width: 420px;
  }
  .stamp {
    top: 40px;
    padding: 13px;
    font-size: 10px;
  }
  .stamp strong {
    font-size: 18px;
  }
  .facts {
    gap: 18px;
    font-size: 12px;
  }
  .entry {
    padding: 25px;
  }
  .schedule {
    grid-template-columns: 1fr;
    margin-top: 35px;
  }
  .room-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
  .room-title {
    font-size: 38px;
  }
  .room-actions {
    margin-bottom: 20px;
  }
  .room-code {
    flex-wrap: wrap;
  }
  .room-code span {
    flex-basis: 100%;
  }
  .overlay {
    padding: 12px;
  }
  .overlay h2 {
    font-size: 25px;
  }
  .overlay p {
    font-size: 12px;
    margin: 5px;
  }
  .overlay .primary {
    padding: 8px 12px;
    min-height: 40px;
  }
  .room-code strong {
    font-size: 20px;
  }
  .copy-controls {
    gap: 4px;
  }
  .copy-controls button {
    font-size: 10px;
  }
  .below-stage {
    flex-direction: column;
    gap: 0;
  }
  .below-stage p {
    margin: 8px 0;
  }
  footer {
    padding: 20px;
    gap: 20px;
  }
  .scoreboard {
    padding: 16px;
  }
  .move-controls {
    display: block;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  background: white;
  padding: 12px;
}
.skip-link:focus {
  top: 12px;
}
button {
  touch-action: manipulation;
}
.timer,
.scoreboard strong {
  font-variant-numeric: tabular-nums;
}
h1,
h2 {
  text-wrap: balance;
}
.scoreboard {
  align-self: start;
}
.room-title {
  overflow-wrap: anywhere;
}
