:root {
  --ink: #141414;
  --paper: #f2efe6;
  --red: #b42318;
  --yellow: #ffc928;
  --blue: #0645ad;
  --muted: #5f5c55;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 3px;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    linear-gradient(#0001 1px, transparent 1px),
    linear-gradient(90deg, #0001 1px, transparent 1px);
  background-size: 24px 24px;
}
main {
  width: min(1180px, 94vw);
  margin: 38px auto;
  position: relative;
}
header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-bottom: 5px solid var(--ink);
  padding-bottom: 15px;
  margin-bottom: 20px;
}
.header-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}
.relay-status {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.relay-status.offline {
  color: var(--red);
}
h1 {
  font:
    900 clamp(2.5rem, 8vw, 6rem)/0.8 Arial Black,
    sans-serif;
  letter-spacing: -0.08em;
  margin: 10px 0 0;
}
.eyebrow,
h2 {
  font-weight: 900;
  letter-spacing: 0.12em;
}
h2 {
  font-size: 0.82rem;
  margin: 0 0 16px;
}
.card {
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: 7px 7px 0 var(--ink);
  padding: 20px;
}
.login {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 34px 0 70px;
}
.login form {
  display: flex;
  gap: 10px;
}
input,
button,
textarea {
  font: inherit;
  border: 2px solid var(--ink);
  padding: 12px;
  background: #fff;
}
textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.6;
}
input {
  min-width: 0;
  flex: 1;
}
button {
  background: var(--yellow);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0;
}
.landing {
  display: grid;
  gap: 72px;
  padding-bottom: 50px;
}
.landing-hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: center;
  gap: clamp(32px, 7vw, 90px);
  padding: 35px 0 10px;
}
.hero-kicker,
.section-number {
  display: block;
  color: var(--blue);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.hero-title {
  max-width: 820px;
  margin: 0;
  font:
    900 clamp(3rem, 7.5vw, 7.2rem)/0.88 Arial Black,
    sans-serif;
  letter-spacing: -0.075em;
}
.hero-lead {
  max-width: 700px;
  margin: 28px 0;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.button-link {
  display: inline-block;
  border: 2px solid var(--ink);
  padding: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--ink);
}
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  margin-top: 38px;
  font-size: 0.72rem;
  font-weight: 900;
}
.hero-facts b {
  color: var(--red);
  font-size: 1.35rem;
}
.hero-board {
  position: relative;
  transform: rotate(2deg);
  border: 4px solid var(--ink);
  padding: 20px;
  background: var(--yellow);
  box-shadow: 12px 12px 0 var(--ink);
}
.hero-board-label {
  margin-bottom: 14px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.mini-board {
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: var(--ink);
}
.mini-board span {
  display: grid;
  place-items: center;
  background: #fff;
  font:
    900 clamp(2rem, 5vw, 4.2rem)/1 Arial Black,
    sans-serif;
}
.mini-board .mini-x {
  color: var(--red);
}
.mini-board .mini-o {
  color: var(--blue);
}
.hero-board p {
  margin: 18px 0 0;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.5;
}
.landing-section {
  scroll-margin-top: 30px;
  border-top: 5px solid var(--ink);
  padding-top: 26px;
}
.landing-heading {
  max-width: 900px;
  margin: 0 0 30px;
  font:
    900 clamp(2rem, 5vw, 4.4rem)/0.95 Arial Black,
    sans-serif;
  letter-spacing: -0.055em;
}
.steps-grid,
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.steps-grid article,
.games-grid article {
  border: 3px solid var(--ink);
  padding: 22px;
  background: #fff;
}
.steps-grid article:nth-child(2),
.games-grid article:nth-child(3n + 2) {
  background: var(--yellow);
}
.steps-grid b,
.games-grid article > span {
  color: var(--red);
  font:
    900 1.8rem/1 Arial Black,
    sans-serif;
}
.games-grid article:nth-child(3n + 2) > span {
  color: var(--ink);
}
.steps-grid h3,
.games-grid h3 {
  margin: 24px 0 8px;
  font-size: 1rem;
}
.steps-grid p,
.games-grid p {
  margin: 0;
  line-height: 1.5;
}
.games-grid {
  grid-template-columns: repeat(3, 1fr);
}
.landing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--blue);
  color: #fff;
}
.landing-footer .section-number {
  color: var(--yellow);
}
.landing-footer h2 {
  margin: 0;
}
.statusbar {
  display: flex;
  justify-content: space-between;
  margin: 0 0 20px;
  font-weight: bold;
}
.layout {
  display: grid;
  grid-template-columns: minmax(400px, 1fr) 330px;
  gap: 24px;
}
.arena {
  min-height: 610px;
  display: grid;
  place-items: center;
  text-align: center;
}
.arena > div {
  width: 100%;
}
aside {
  display: grid;
  gap: 20px;
  align-content: start;
}
.list {
  display: grid;
  gap: 9px;
}
.invite-form {
  display: grid;
  gap: 9px;
}
.invite-form label {
  font-size: 0.75rem;
  font-weight: 900;
}
.invite-form input {
  width: 100%;
}
.identity-share-card input {
  width: 100%;
  font-size: 0.72rem;
}
.share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}
.conflict {
  color: var(--red);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #bbb;
  padding-top: 9px;
  font-size: 0.86rem;
}
.row button {
  padding: 6px;
  box-shadow: 2px 2px 0 var(--ink);
}
.muted {
  color: var(--muted);
}
.match-head {
  display: flex;
  justify-content: space-between;
}
.match-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.text-button {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.board {
  width: min(440px, 82vw);
  aspect-ratio: 1;
  margin: 35px auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  background: var(--ink);
}
.cell {
  border: 0;
  box-shadow: none;
  background: #fff;
  font:
    900 clamp(3rem, 8vw, 6.5rem)/1 Arial Black,
    sans-serif;
  padding: 0;
}
.cell.x {
  color: var(--red);
}
.cell.o {
  color: var(--blue);
}
.cell.win {
  background: var(--yellow);
}
#players-line {
  font-weight: bold;
  margin-top: 28px;
}
#turn {
  font-weight: 900;
  letter-spacing: 0.08em;
}
.pill {
  padding: 3px 7px;
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
}
@media (max-width: 800px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
  main {
    margin-top: 20px;
    width: min(100% - 24px, 1180px);
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .landing {
    gap: 50px;
  }
  .landing-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 20px;
  }
  .hero-board {
    width: min(420px, 92%);
    justify-self: center;
  }
  .steps-grid,
  .games-grid {
    grid-template-columns: 1fr;
  }
  .login,
  .landing-footer {
    align-items: stretch;
    flex-direction: column;
  }
  .arena {
    min-height: 520px;
  }
  .match-head,
  .row {
    align-items: stretch;
    flex-direction: column;
  }
  .match-tools,
  .row-actions {
    justify-content: flex-start;
  }
  button,
  input,
  textarea,
  select,
  .button-link {
    min-height: 44px;
  }
  header {
    align-items: start;
    gap: 12px;
    flex-direction: column;
  }
  .header-actions {
    justify-items: start;
    text-align: left;
  }
  .login form {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.notice-error {
  color: var(--red);
}

.clipboard-helper {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}
