@font-face {
  font-family: "Pixel";
  src: url("../assets/fonts/PixelifySans.ttf") format("truetype");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Press";
  src: url("../assets/fonts/PressStart2P-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex";
  src: url("../assets/fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plex";
  src: url("../assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c0a14;
  --panel: #15121f;
  --panel-2: #1c1829;
  --line: #2c2640;
  --ink: #ece8f6;
  --dim: #7d7596;
  --cyan: #3fe0ff;
  --magenta: #ff3fd0;
  --gold: #f5c84a;
  --red: #ff4d5e;
  --green: #7dffa0;
  --snap: cubic-bezier(0.2, 1.4, 0.4, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "IBM Plex Sans", "Trebuchet MS", sans-serif;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(63, 224, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 224, 255, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  animation: grid-drift 36s linear infinite;
}

@keyframes grid-drift {
  to { background-position: 24px 24px, 24px 24px; }
}

::selection {
  background: var(--magenta);
  color: #0c0a14;
}

img {
  max-width: 100%;
  image-rendering: pixelated;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin-top: 0;
}

h2,
h3,
.mode-name,
.modal-title,
.stat .label,
table.table th,
.tab {
  font-family: "Plex", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.25;
}

h2 {
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
}

h3 {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
}

main {
  display: block;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

header.nav {
  position: relative;
  z-index: 60;
}

.nav-in {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 56px;
  flex-wrap: nowrap;
}

.brand {
  font-family: "Pixel", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  color: var(--cyan);
  text-decoration: none;
  text-shadow: 2px 2px 0 #5a1a52;
  white-space: nowrap;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.nav-links a {
  position: relative;
  font-family: "Plex", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: normal;
  color: var(--dim);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.18s var(--snap);
}

.nav-links a.active {
  color: var(--cyan);
}

.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: "Plex", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gold);
  text-decoration: none;
}

.nav-user:hover {
  text-decoration: none;
  color: var(--ink);
}

.nav-user::before {
  content: "";
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  background: var(--gold);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  font-size: 0;
  line-height: 0;
  width: 44px;
  height: 40px;
  margin: 0;
  padding: 0;
  background: var(--panel-2);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 #000;
  color: var(--ink);
  cursor: pointer;
  flex: none;
  transition: transform 0.15s var(--snap), border-color 0.15s ease;
}

.nav-toggle:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.nav-toggle::before {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  margin: 0;
  background: var(--ink);
  box-shadow: 0 -6px 0 var(--ink), 0 6px 0 var(--ink);
}

.sec {
  padding: 88px 0;
}

.sec.tight {
  padding: 48px 0;
}

.sec.alt {
  background: rgba(21, 18, 31, 0.72);
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}

.eyebrow {
  font-family: "Plex", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: normal;
  margin: 0 0 14px;
  line-height: 1.6;
}

h1.display {
  font-family: "Pixel", sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  color: var(--ink);
  text-shadow: 3px 3px 0 #5a1a52;
  margin: 0 0 20px;
}

h1.display .hl {
  color: var(--cyan);
  white-space: nowrap;
}

h1.display .hm {
  color: var(--magenta);
}

h1.display .hg {
  color: var(--gold);
}

h2.title {
  font-size: clamp(1.375rem, 2.4vw, 1.85rem);
  line-height: 1.2;
  margin: 0 0 16px;
}

h2.title .hl {
  color: var(--cyan);
}

h2.title .hm {
  color: var(--magenta);
}

h2.title .hg {
  color: var(--gold);
}

p.lead {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--dim);
  max-width: 36rem;
  margin: 0 0 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: "Press", monospace;
  font-size: 0.8rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
  background: var(--panel-2);
  border: 2px solid var(--line);
  padding: 1rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 0 0 transparent;
  transition: transform 0.18s var(--snap), box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 0 18px rgba(236, 232, 246, 0.3);
}

.btn:active {
  transform: translateY(2px) scale(0.98);
  transition-duration: 0.06s;
}

.btn.cyan {
  border-color: var(--cyan);
  background: #0f2a33;
}

.btn.cyan:hover {
  box-shadow: 0 0 18px rgba(63, 224, 255, 0.35);
}

.btn.magenta {
  border-color: var(--magenta);
  background: #3a0f34;
  color: #ffe0f7;
}

.btn.magenta:hover {
  box-shadow: 0 0 18px rgba(255, 63, 208, 0.35);
}

.btn.gold {
  border-color: var(--gold);
  background: #33280c;
}

.btn.gold:hover {
  box-shadow: 0 0 18px rgba(245, 200, 74, 0.35);
}

.btn.lg {
  padding: 1.25rem 1.8rem;
  font-size: 0.9rem;
}

.btn.sm {
  padding: 0.6rem 0.9rem;
  font-size: 0.65rem;
}

.btn.block {
  width: 100%;
  justify-content: center;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 #000;
  padding: 28px;
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 24px;
}

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

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

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

ul.ticks {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  gap: 10px;
}

ul.ticks li {
  position: relative;
  padding-left: 22px;
  font-size: 1.05rem;
  line-height: 1.4;
}

ul.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 10px;
  height: 10px;
  background: var(--cyan);
}

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

.step {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 #000;
  padding: 26px;
}

.step .step-num {
  display: block;
  font-family: "Press", monospace;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--cyan);
  margin: 0 0 14px;
}

.step h3 {
  font-size: 1.125rem;
  margin: 0 0 8px;
}

.step p {
  margin: 0;
  font-size: 1rem;
  color: var(--dim);
}

.rule-block {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 #000;
  padding: 28px;
  margin-bottom: 20px;
}

.rule-block h3 {
  font-size: 1.125rem;
  margin: 0 0 10px;
}

.rule-block p,
.rule-block ul {
  margin: 0 0 10px;
  color: rgba(236, 232, 246, 0.9);
}

.rule-block p:last-child,
.rule-block ul:last-child {
  margin-bottom: 0;
}

.rule-block ul {
  padding-left: 22px;
}

.kbd-chip,
.chip {
  display: inline-block;
  font-family: "Inter", sans-serif;
  font-size: 0.8rem;
  line-height: 1.4;
  letter-spacing: 0.04em;
  vertical-align: middle;
  color: var(--dim);
  background: var(--panel-2);
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.5rem;
}

.formula {
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  line-height: 2;
  color: var(--cyan);
  background: var(--panel-2);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 #000;
  padding: 18px;
  overflow-x: auto;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 #000;
}

table.table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

table.table th {
  font-size: 0.8rem;
  color: var(--dim);
  text-align: left;
  padding: 14px 16px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

table.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.table tbody tr:last-child td {
  border-bottom: 0;
}

td.num {
  font-family: "Press", monospace;
  font-size: 0.75rem;
  line-height: 1.8;
}

table.table tr.me {
  background: #0f2a33;
}

table.table tr.me td:first-child {
  box-shadow: inset 3px 0 0 var(--cyan);
}

.place-1,
.place-2,
.place-3 {
  font-family: "Press", monospace;
  font-size: 0.75rem;
}

.place-1 {
  color: var(--gold);
}

.place-2 {
  color: var(--ink);
}

.place-3 {
  color: #ff8a5c;
}

.stat {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 #000;
  padding: 26px 20px;
  text-align: center;
}

.stat .value {
  display: block;
  font-family: "Press", monospace;
  font-size: 1.6rem;
  line-height: 1.3;
  color: var(--cyan);
  margin: 0 0 8px;
}

.stat .label {
  display: block;
  font-size: 0.75rem;
  color: var(--dim);
}

.page-head {
  padding: 56px 0 0;
}

.page-head h1.display,
.page-head .lead {
  margin-bottom: 0;
}

.page-head .lead {
  margin-top: 16px;
}

.page-head + .sec,
.page-head + .sec.tight {
  padding-top: 28px;
}

.page-head h1.display {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.prose {
  max-width: 760px;
}

.prose h2 {
  font-size: 1.25rem;
  color: var(--cyan);
  margin: 36px 0 10px;
}

.prose h3 {
  font-size: 1.0625rem;
  margin: 24px 0 8px;
}

.prose p,
.prose li {
  font-size: 1.12rem;
  line-height: 1.6;
  color: rgba(236, 232, 246, 0.92);
  margin: 0 0 14px;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose a {
  color: var(--cyan);
}

form.form {
  display: grid;
  gap: 16px;
  max-width: 520px;
}

form.form label {
  display: grid;
  gap: 6px;
  font-family: "Inter", sans-serif;
  font-size: 0.85rem;
  color: var(--dim);
}

.field {
  width: 100%;
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--ink);
  background: #0f0c18;
  border: 2px solid var(--line);
  padding: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.field {
  min-height: 140px;
  resize: vertical;
}

.field:focus {
  outline: none;
  border-color: var(--cyan);
}

.gbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: "Plex", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  text-decoration: none;
  color: #0c0a14;
  background: #ece8f6;
  border: 2px solid #000;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.18s var(--snap), box-shadow 0.18s ease;
}

.gbtn:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 #000, 0 0 18px rgba(63, 224, 255, 0.45);
}

.g-mark {
  display: inline-block;
  flex: none;
  width: 16px;
  height: 16px;
  background: conic-gradient(#4285f4 0 25%, #34a853 0 50%, #fbbc05 0 75%, #ea4335 0 100%);
}

.auth-card {
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 #000;
  max-width: 460px;
  margin: 0 auto;
  padding: 40px;
  text-align: center;
}

.auth-card h1.display {
  margin-bottom: 28px;
}

.auth-card form.form {
  max-width: none;
  text-align: left;
  margin-top: 22px;
}

.notice {
  background: var(--panel-2);
  border: 2px solid var(--line);
  border-left: 3px solid var(--cyan);
  padding: 14px 16px;
}

.notice.hidden {
  display: none;
}

.room-code {
  display: inline-block;
  font-family: "Press", monospace;
  font-size: 2rem;
  line-height: 1.4;
  letter-spacing: 0.2em;
  color: var(--gold);
}

.seat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.seat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  background: var(--panel-2);
  border: 2px solid var(--line);
  padding: 10px 12px;
}

.seat .pip {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 10px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab {
  font-size: 0.875rem;
  line-height: 1;
  color: var(--dim);
  background: var(--panel-2);
  border: 2px solid var(--line);
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
  color: var(--ink);
}

.tab.on {
  border-color: var(--cyan);
  color: var(--cyan);
}

.hidden {
  display: none !important;
}

.center {
  text-align: center;
}

.mt {
  margin-top: 28px;
}

.err {
  text-align: center;
  padding: 96px 0 112px;
}

.err-code {
  display: block;
  font-family: "Press", monospace;
  font-size: clamp(3rem, 10vw, 6rem);
  line-height: 1.15;
  color: var(--magenta);
  margin: 0 0 18px;
}



@media (max-width: 820px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-4,
  .steps,
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foot-in {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
  }

  .foot-brand {
    grid-column: 1 / -1;
  }

  .sec {
    padding: 64px 0;
  }

  .sec.tight {
    padding: 40px 0;
  }

  .page-head + .sec,
  .page-head + .sec.tight {
    padding-top: 28px;
  }

  .nav-in {
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .brand {
    order: 1;
  }

  .nav-toggle {
    order: 2;
    display: inline-flex;
    margin-left: auto;
  }

  .nav-links,
  .nav-auth {
    display: none;
  }

  .nav-links {
    order: 3;
  }

  .nav-auth {
    order: 4;
  }

  body.nav-open .nav-links,
  body.nav-open .nav-auth {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-left: 0;
    gap: 4px;
    padding: 10px 0;
    border-top: 2px solid var(--line);
  }

  body.nav-open .nav-auth {
    padding-top: 0;
    border-top: 0;
  }

  .nav-links a {
    padding: 12px 2px;
  }

  .nav-links a::after {
    left: 2px;
    right: 2px;
    bottom: 5px;
  }

  .nav-auth .btn,
  .nav-auth .nav-user {
    justify-content: center;
  }

  .nav-auth .btn {
    width: 100%;
  }

  .auth-card {
    padding: 28px 20px;
  }
}

@media (max-width: 560px) {
  .grid-4,
  .steps,
  .stat-grid {
    gap: 16px;
  }

  .panel,
  .step,
  .stat,
  .rule-block {
    padding: 20px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .gbtn,
  .tab,
  .nav-toggle,
  .nav-links a,
  .nav-links a::after {
    transition: none;
  }

  .btn:hover,
  .btn:active,
  .gbtn:hover,
  .nav-toggle:hover {
    transform: none;
  }
}
.btn-row.center { justify-content: center; }
.prose a { overflow-wrap: anywhere; }
.stat-grid + h2.title { margin-top: 56px; margin-bottom: 20px; }
@media (max-width: 520px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
}
.hl { color: var(--cyan); } .hm { color: var(--magenta); } .hg { color: var(--gold); }


.nav-links a.active::after {
  height: 2px;
}

.nav-sign {
  font-family: "Plex", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: normal;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 6px 0;
  cursor: pointer;
}

.nav-sign:hover {
  color: var(--cyan);
  text-decoration: none;
}

.nav-auth {
  margin-left: 6px;
}

.nav-auth .nav-user + .nav-sign {
  color: var(--dim);
}

.hero {
  padding: 72px 0 120px;
  overflow: hidden;
}

.hero-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-in .display {
  margin: 0 auto 20px;
  max-width: 16em;
  font-size: clamp(2.8rem, 5.6vw, 4.2rem);
  line-height: 1.08;
}

.hero-in .lead {
  margin: 0 auto 14px;
  font-size: 1.0625rem;
  max-width: 42rem;
}

.hero-in .lead + .btn {
  margin-top: 26px;
}

.parade {
  width: 100%;
  margin-top: 72px;
  display: flex;
  justify-content: center;
}

.parade canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.feat {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 64px;
}

.feat.flip .feat-copy {
  order: 2;
}

.feat-copy p,
.feat-copy ul {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--dim);
  max-width: 32rem;
  margin: 0 0 12px;
}

.feat-copy p:last-child,
.feat-copy ul:last-child {
  margin-bottom: 0;
}

.feat-copy ul {
  padding-left: 1.15em;
}

.feat-copy li + li {
  margin-top: 0.3em;
}

.feat-art {
  display: flex;
  justify-content: center;
}

.feat-art img {
  width: auto;
  max-width: 100%;
  height: auto;
}

footer.foot {
  padding: 40px 0 36px;
}

.foot-in {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 28px;
}

.brand.sm {
  font-size: 1.1rem;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.foot-links a {
  color: var(--dim);
  font-size: 0.9rem;
}

.foot-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.foot-base {
  margin-left: auto;
  font-family: "Inter", sans-serif;
  font-size: 0.75rem;
  color: var(--dim);
}

.modes-sec {
  position: relative;
  overflow: hidden;
  min-height: calc(100svh - 190px);
  padding: 40px 0 88px;
}

.modes-sec > .wrap {
  position: relative;
  z-index: 1;
}

body[data-page="play"] .modes-sec {
  padding-bottom: 168px;
}

body[data-page="play"] .play-run {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
}

body[data-page="play"] .play-run .wrap {
  overflow: hidden;
}

body[data-page="play"] .play-run canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.modes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.modes-title {
  font-family: "Pixel", sans-serif;
  font-weight: 700;
  font-size: 2.4rem;
  line-height: 1;
  margin: 0;
  text-shadow: 3px 3px 0 #5a1a52;
}

.name-field {
  width: 220px;
  font-size: 0.95rem;
  padding: 9px 12px;
}

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

.mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 28px 20px 26px;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid transparent;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  transition: transform 0.18s var(--snap), border-color 0.15s ease;
}

.mode:hover {
  text-decoration: none;
  transform: translateY(-4px);
  border-color: var(--line);
}

.mode:active {
  transform: translateY(1px);
}

.mode-art {
  display: block;
  width: 128px;
  height: 128px;
  margin-bottom: 6px;
}

.mode-art img {
  display: block;
}

.mode-name {
  font-size: 1.15rem;
  line-height: 1.2;
}

.mode-line {
  color: var(--dim);
  font-size: 0.95rem;
}

.mode-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  font-family: "Press", monospace;
  font-size: 0.55rem;
  color: var(--dim);
}

.mode-stat b {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--gold);
}

.mode-stat b.off {
  font-size: 0.6rem;
  color: var(--dim);
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(12, 10, 20, 0.82);
}

.modal.hidden {
  display: none;
}

.modal-box {
  width: min(440px, 100%);
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 6px 6px 0 #000;
  padding: 24px;
  display: grid;
  gap: 18px;
  animation: modal-in 0.2s var(--snap);
}

.modal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 0;
}

.modal-x {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--dim);
}

.modal-x::before,
.modal-x::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  width: 18px;
  height: 4px;
  background: currentColor;
  transform: rotate(45deg);
}

.modal-x::after {
  transform: rotate(-45deg);
}

.modal-x:hover {
  color: var(--ink);
}

.mm-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: "Press", monospace;
}

.mm-state {
  font-size: 0.75rem;
  color: var(--ink);
}

.mm-clock {
  font-size: 1.1rem;
  color: var(--gold);
}

.dots::after {
  content: "";
  display: inline-block;
  width: 2em;
  text-align: left;
  animation: dots 1.2s steps(4) infinite;
}

@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

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

.slots.hidden {
  display: none;
}

.slot {
  position: relative;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--panel-2);
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  animation: slot-in 0.25s var(--snap);
}

.slot span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.slot.open {
  background: transparent;
  border: 2px dashed var(--line);
  animation: none;
}

.slot.me {
  color: var(--cyan);
}

.slot.host::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 14px;
  height: 10px;
  margin-top: -5px;
  background: var(--gold);
  clip-path: polygon(0 100%, 0 0, 25% 50%, 50% 0, 75% 50%, 100% 0, 100% 100%);
}

.join {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

#join-code {
  flex: 1;
  min-width: 0;
  font-family: "Press", monospace;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

#join-code::placeholder {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--dim);
}

#join-code.bad {
  border-color: var(--red);
  animation: shake 0.3s;
}

@keyframes shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.room-err {
  min-height: 1em;
  margin: 10px 0 0;
  font-family: "Press", monospace;
  font-size: 0.6rem;
  color: var(--red);
}

.room-bar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.room-bar .room-code {
  font-size: 1.3rem;
  letter-spacing: 0.15em;
}

.room-count {
  font-family: "Press", monospace;
  font-size: 0.6rem;
  color: var(--dim);
}

.room-bar .btn {
  margin-left: auto;
}

.room-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-actions .btn:last-child {
  margin-left: auto;
}

.room-wait {
  font-family: "Press", monospace;
  font-size: 0.6rem;
  color: var(--dim);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
  box-shadow: none;
}

@keyframes modal-in {
  from { transform: translateY(8px); opacity: 0; }
}

@keyframes slot-in {
  from { transform: scale(0.94); opacity: 0; }
}

@media (max-width: 820px) {
  .hero {
    padding-top: 48px;
  }

  .parade {
    margin-top: 48px;
  }

  .feat {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    text-align: center;
  }

  .feat.flip .feat-copy {
    order: 0;
  }

  .feat-copy p,
  .feat-copy ul {
    margin-left: auto;
    margin-right: auto;
    text-align: left;
  }

  .modes {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .mode {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 16px;
    row-gap: 4px;
    align-items: center;
    text-align: left;
    padding: 16px;
  }

  .mode-art {
    grid-row: 1 / span 3;
    width: 80px;
    height: 80px;
    margin: 0;
  }

  .mode-art img {
    width: 80px;
    height: 80px;
  }

  .mode-stat {
    margin-top: 2px;
  }

  .foot-base {
    margin-left: 0;
    width: 100%;
  }

  body.nav-open .nav-links,
  body.nav-open .nav-auth {
    border-top: 0;
  }
}

@media (max-width: 560px) {
  .modes-head {
    flex-wrap: wrap;
  }

  .name-field {
    width: 100%;
  }

  .mode-name {
    font-size: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-box,
  .slot,
  #join-code.bad,
  .dots::after {
    animation: none;
  }

  .mode {
    transition: none;
  }
}

#ranked table.table {
  min-width: 0;
}

#rating-label:empty {
  display: none;
}

.room-bar .btn {
  white-space: nowrap;
}

@media (max-width: 560px) {
  .modal-box {
    padding: 20px 16px;
  }

  .room-bar {
    gap: 10px;
  }

  .room-bar .room-code {
    font-size: 1rem;
  }
}

body[data-page="home"] .sec {
  padding: 128px 0;
}

@media (max-width: 820px) {
  .hero {
    padding-bottom: 80px;
  }

  body[data-page="home"] .sec {
    padding: 88px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none;
  }
}

.ico {
  vertical-align: middle;
  image-rendering: pixelated;
}

body[data-page="home"] .hero-in .display {
  max-width: 16em;
  font-size: clamp(1.7rem, 4.2vw, 3.15rem);
  line-height: 1.12;
}

body[data-page="home"] .sec {
  padding: 120px 0;
}

.hm-sec .title {
  max-width: 24em;
}

.hm-copy p,
.hm-copy li,
.hm-kit p,
.hm-mode p,
.hm-cta p,
.hm-faq-a p {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--dim);
}

.hm-copy p {
  margin: 0 0 24px;
}

.hm-copy-wide {
  margin-bottom: 40px;
}

.hm-copy-wide .title {
  max-width: 28em;
}

.hm-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.hm-split .hm-copy {
  padding-right: 12px;
}

.hm-split .title {
  max-width: 16em;
  margin-bottom: 12px;
}

.hm-split .hm-copy p {
  margin: 0 0 28px;
}

.hm-split .hm-stage + .hm-copy {
  padding-right: 0;
  padding-left: 12px;
}

.hm-tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hm-tab {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 14px 16px;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.hm-tab:hover {
  background: rgba(236, 232, 246, 0.04);
}

.hm-tab.on {
  background: rgba(63, 224, 255, 0.08);
}

.hm-tab-name {
  display: block;
  font-family: "Plex", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  margin-bottom: 4px;
}

.hm-tab-line {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--dim);
}

.hm-tab.on .hm-tab-line {
  color: var(--ink);
}

.hm-stage {
  position: relative;
  min-height: 280px;
  padding: 28px;
  background: var(--panel);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hm-panel {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  object-fit: contain;
}

.hm-panel[hidden] {
  display: none !important;
}

.hm-rare {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.hm-rare img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  image-rendering: pixelated;
}

.hm-trio,
.hm-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.hm-kit,
.hm-mode {
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--bg);
  padding: 0;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.hm-kit img,
.hm-mode img {
  width: 100%;
  height: auto;
  object-fit: cover;
  image-rendering: pixelated;
  border-bottom: 2px solid var(--ink);
  background: rgba(0, 0, 0, 0.2);
}

.hm-mode img {
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin: 28px auto 0;
  border: 0;
  background: transparent;
}

.hm-kit h3,
.hm-mode h3 {
  margin: 20px 20px 8px;
}

.hm-kit p,
.hm-mode p {
  margin: 0 20px 24px;
}

.hm-mode {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

.hm-mode:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--cyan);
}

.hm-mode.is-core {
  box-shadow: 4px 4px 0 var(--cyan);
}

.hm-mode.is-core:hover {
  box-shadow: 6px 6px 0 var(--cyan);
}

.hm-faq {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 64px;
  align-items: start;
}

.hm-faq .hm-copy {
  position: sticky;
  top: 96px;
}

.hm-faq .title {
  margin-bottom: 12px;
}

.hm-faq .hm-copy p {
  margin: 0;
}

.hm-faq-item {
  border-top: 2px solid var(--line);
}

.hm-faq-item:last-child {
  border-bottom: 2px solid var(--line);
}

.hm-faq-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
  background: none;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  font-family: "Plex", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  letter-spacing: normal;
  line-height: 1.25;
}

.hm-faq-btn::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.hm-faq-item.on .hm-faq-btn::after {
  transform: rotate(-135deg);
}

.hm-faq-a {
  display: none;
  padding: 0 32px 22px 0;
}

.hm-faq-item.on .hm-faq-a {
  display: block;
}

.hm-faq-a p {
  margin: 0;
}

.hm-cta {
  text-align: center;
  padding: 80px 48px;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}

.hm-cta .title {
  max-width: none;
  margin-bottom: 16px;
}

.hm-cta p {
  margin: 0 auto 32px;
  max-width: 28em;
}

.hm-sec.is-wait {
  opacity: 0;
  transform: translateY(20px);
}

.hm-reveal {
  opacity: 0;
  transform: translateY(20px);
  animation: hm-in 0.5s ease-out forwards;
}

@keyframes hm-in {
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hm-sec.is-wait,
  .hm-reveal {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .hm-mode,
  .hm-tab {
    transition: none;
  }
}

.break-d { display: block; }

@media (max-width: 820px) {
  .break-d { display: none; }

  body[data-page="home"] .sec {
    padding: 80px 0;
  }

  .hm-split,
  .hm-faq,
  .hm-trio,
  .hm-modes {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .hm-split .hm-copy {
    padding-right: 0;
  }

  .hm-split .hm-stage + .hm-copy {
    padding-left: 0;
    order: -1;
  }

  .hm-stage {
    min-height: 220px;
    padding: 20px;
  }

  .hm-faq .hm-copy,
  .hm-faq .title {
    position: static;
  }


  .hm-cta {
    padding: 56px 20px;
  }
}

.prose .post-dek {
  font-size: 1.12rem;
  line-height: 1.65;
  color: var(--dim);
  margin: 0 0 28px;
}

.prose .post-fig {
  margin: 28px 0;
}

.prose .post-fig img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  background: var(--panel);
}

.table tr.is-me td {
  background: rgba(63, 224, 255, 0.08);
}

.stat-grid.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.name-form {
  max-width: 520px;
}

.name-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.name-row .field {
  flex: 1;
  min-width: 0;
}

.name-row .btn {
  flex: none;
}

#ac-talents {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

td.num.up {
  color: var(--cyan);
}

td.num.down {
  color: var(--magenta);
}

#delete-modal .modal-box {
  text-align: center;
}

@media (max-width: 1024px) {
  .stat-grid.six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
