@font-face {
  font-family: "TASA Orbiter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/tasa-orbiter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "TASA Orbiter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/tasa-orbiter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/geist-mono-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/geist-mono-medium.woff2") format("woff2");
}

:root {
  --yellow: #ffdb2a;
  --ink: #0e1312;
  --ink-2: #141a19;
  --paper: #ededec;
  --mute: #8a918e;
  --line: #2a322f;
  --header-h: 52px;
  --footer-h: 36px;
  --sidebar: 320px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--paper);
  font-family: "TASA Orbiter", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--yellow);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  z-index: 20;
}

.skip-link:focus {
  top: 0.5rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-h);
  background: var(--yellow);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1rem;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.04em;
}

.mark {
  width: 18px;
  height: 18px;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-left: auto;
}

.site-nav a,
.site-nav button.linkish {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav button.linkish:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  padding: 0.55rem 0.85rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn-yellow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--yellow);
  color: var(--ink);
  border: 0;
  padding: 0.7rem 1rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--paper);
  padding: 0.7rem 1rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn-solid:hover,
.btn-yellow:hover,
.btn-ghost:hover {
  filter: brightness(1.08);
}

.btn-solid:focus-visible,
.btn-yellow:focus-visible,
.btn-ghost:focus-visible,
.site-nav a:focus-visible,
.site-nav button:focus-visible,
.choice:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.stage {
  position: relative;
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  overflow: hidden;
}

.stage-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    118deg,
    #ffdb2a 0%,
    #8dff5a 16%,
    #3ee0c8 34%,
    #4aa8ff 50%,
    #9b6bff 66%,
    #ff6ad5 82%,
    #ff7a3d 100%
  );
}

.stage-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='72' height='72'><g fill='none' stroke='white' stroke-width='1.35' stroke-linecap='round' opacity='0.42'><line x1='8' y1='14' x2='22' y2='8'/><line x1='30' y1='28' x2='44' y2='22'/><line x1='50' y1='10' x2='64' y2='18'/><line x1='12' y1='46' x2='26' y2='52'/><line x1='38' y1='50' x2='54' y2='44'/><line x1='58' y1='60' x2='68' y2='50'/></g></svg>");
  background-size: 72px 72px;
  mix-blend-mode: overlay;
  animation: drift 28s linear infinite;
}

@keyframes drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 72px -144px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-bg::after {
    animation: none;
  }
}

.stage-inner {
  position: relative;
  z-index: 1;
  padding: 1.25rem;
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  display: flex;
  align-items: stretch;
}

.panel {
  background: var(--ink);
  color: var(--paper);
  width: min(720px, 100%);
  padding: 1.35rem 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.panel-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

.panel h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.panel h1 .accent {
  color: var(--yellow);
}

.lede {
  margin: 0;
  max-width: 38ch;
  color: #c9ccc9;
  font-size: 1.05rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.fine {
  margin: 0;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
}

.site-footer {
  height: var(--footer-h);
  background: var(--yellow);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Arena */
.arena {
  display: grid;
  grid-template-columns: 1fr var(--sidebar);
  width: 100%;
  min-height: calc(100vh - var(--header-h) - var(--footer-h) - 2.5rem);
  background: var(--ink);
  border: 1px solid var(--ink);
}

.arena.sidebar-closed {
  grid-template-columns: 1fr 48px;
}

.duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.75rem;
  padding: 1.25rem;
  align-items: stretch;
  min-height: 420px;
}

.choice {
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--paper);
  cursor: pointer;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  min-height: 280px;
}

.choice:hover {
  border-color: var(--yellow);
}

.choice-kicker {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}

.choice-name {
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin: 1.4rem 0;
}

.choice-rating {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--yellow);
}

.vs {
  align-self: center;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--mute);
}

.sidebar {
  border-left: 1px solid var(--line);
  background: #0b100f;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.sidebar-head h2 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena.sidebar-closed .rank-list,
.arena.sidebar-closed .sidebar-head h2,
.arena.sidebar-closed .sidebar-head a[href] {
  display: none;
}

.arena.sidebar-closed .sidebar {
  overflow: hidden;
}

.arena.sidebar-closed .sidebar-head {
  flex-direction: column;
  justify-content: flex-start;
  padding: 0.6rem 0.35rem;
  border-bottom: 0;
  height: 100%;
}

.arena.sidebar-closed .icon-btn[data-toggle-side] {
  transform: rotate(180deg);
}

.icon-btn {
  background: none;
  border: 1px solid var(--line);
  color: var(--paper);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 14px;
}

.rank-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0 1rem;
  overflow: auto;
  flex: 1;
}

.rank-item {
  display: grid;
  grid-template-columns: 2.1rem 1fr auto;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.55rem 0.9rem;
  transform-origin: left center;
}

.rank-item.is-moved {
  color: var(--yellow);
}

.rank-pos {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--mute);
}

.rank-name {
  font-weight: 600;
  letter-spacing: -0.03em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-elo {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--yellow);
}

.lists {
  display: grid;
  gap: 0.55rem;
}

.list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line);
  padding: 0.8rem 0.9rem;
  text-decoration: none;
  color: inherit;
  background: var(--ink-2);
}

.list-row strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.list-row span {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

form.stack,
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

label {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
}

input[type="text"],
textarea {
  width: 100%;
  background: var(--ink-2);
  color: var(--paper);
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
  font: inherit;
  letter-spacing: -0.02em;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

.prose {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.prose h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  letter-spacing: -0.05em;
  line-height: 0.98;
  margin: 0 0 1rem;
}

.prose h2 {
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  margin: 2rem 0 0.6rem;
}

.prose > h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  color: #c9ccc9;
  max-width: 62ch;
}

.quote {
  border-left: 3px solid var(--yellow);
  padding: 0.2rem 0 0.2rem 1rem;
  margin: 1.2rem 0;
  font-size: 1.15rem;
  color: var(--paper);
}

.formula {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  overflow-x: auto;
}

.hidden {
  display: none !important;
}

.is-arena #about {
  display: none;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: calc(var(--footer-h) + 1rem);
  background: var(--yellow);
  color: var(--ink);
  padding: 0.65rem 0.85rem;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 30;
}

@media (max-width: 860px) {
  .arena,
  .arena.sidebar-closed {
    grid-template-columns: 1fr;
  }

  .duel {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .vs {
    justify-self: center;
  }

  .choice {
    min-height: 160px;
  }

  .sidebar {
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: 42vh;
  }

  .arena.sidebar-closed .sidebar {
    max-height: 48px;
    overflow: hidden;
  }

  .arena.sidebar-closed .sidebar-head {
    flex-direction: row;
    height: 48px;
    padding: 0 0.6rem;
    align-items: center;
  }

  .site-nav .hide-sm {
    display: none;
  }

  .panel {
    width: 100%;
  }
}
