/* redesign-existing-projects: editorial split, loaded type, one warm palette.
   Chili marks the left contender. Gold is the action and the right contender. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("./fonts/newsreader-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("./fonts/newsreader-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: "Outfit";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("./fonts/outfit-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("./fonts/outfit-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;
}

:root {
  --bg: #14100e;
  --raised: #241c18;
  --ink: #f7f1e8;
  --muted: #d9c9ba;
  --faint: #cbb8a8;
  --line: #3d312b;
  --gold: #f0b429;
  --gold-ink: #1a120c;
  --chili: #e24b38;
  --cream: #fff8f2;
  --display: "Newsreader", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --move: 220ms;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--sans);
  font-weight: 420;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1100px 480px at 18% -8%, rgba(226, 75, 56, 0.2), transparent 62%),
    radial-gradient(820px 420px at 100% 110%, rgba(240, 180, 41, 0.1), transparent 58%),
    var(--bg);
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.28;
  background-image: url("./grain.png");
  background-size: 180px 180px;
}

#app,
noscript {
  position: relative;
  z-index: 2;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
}

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

::selection {
  background: var(--gold);
  color: var(--gold-ink);
}

button, input { font: inherit; color: inherit; }

button, .chip, .stub, .fighter {
  transition:
    transform var(--move) var(--ease),
    opacity 180ms var(--ease),
    background-color var(--move) var(--ease),
    color 180ms var(--ease),
    border-color var(--move) var(--ease),
    box-shadow var(--move) var(--ease);
}

.skip {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 3;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 650;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip:focus-visible { transform: none; }

.wrap {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 calc(44px + env(safe-area-inset-bottom));
}

.rise { animation: rise 480ms var(--ease) both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.top {
  margin-bottom: 22px;
  padding-bottom: 14px;
  box-shadow: inset 0 -1px 0 rgba(240, 180, 41, 0.38);
}

.mark {
  margin: 0;
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 640;
  letter-spacing: -0.015em;
  cursor: default;
}

button.mark { cursor: pointer; }

button.mark:hover { color: var(--cream); }

.lobby {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: 36px 64px;
  align-items: start;
}

.manifesto h1 {
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(2.7rem, 4.5vw, 4.35rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  text-wrap: balance;
}

.lede {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.55;
  text-wrap: pretty;
}

.board {
  background:
    linear-gradient(180deg, rgba(255, 244, 230, 0.045), transparent 32%),
    var(--raised);
  border-radius: 28px;
  padding: 20px 20px 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 240, 0.07),
    inset 0 0 0 1px rgba(255, 236, 214, 0.06),
    0 22px 48px rgba(28, 12, 6, 0.32);
}

.banner, .notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  line-height: 1.45;
}

.banner {
  background: #3a201c;
  color: var(--cream);
  box-shadow: inset 0 0 0 1px var(--chili);
}

.notice {
  background: #2a2214;
  color: var(--cream);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.add { display: flex; gap: 8px; align-items: stretch; }

.add input,
.share {
  width: 100%;
  min-width: 0;
  background: #100c0b;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  min-height: 52px;
  font-size: 16px;
  font-weight: 450;
}

.add input::placeholder { color: #c4b3a3; }

.add input:focus-visible,
.share:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-color: #8d6d38;
}

.primary, .ghost {
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 52px;
  cursor: pointer;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary {
  background: var(--gold);
  color: var(--gold-ink);
  border: 0;
  box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.45);
}

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

.primary:disabled {
  background: transparent;
  color: var(--faint);
  box-shadow: inset 0 0 0 1px var(--line);
  opacity: 1;
  cursor: not-allowed;
}

.primary:disabled:active { transform: none; }

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.ghost:hover { border-color: var(--gold); color: var(--cream); }

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

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 520;
}

.chip:hover { color: var(--ink); border-color: var(--gold); }

.list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.stub {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 14px;
  padding: 6px 2px 6px 10px;
}

.stub:hover { background: rgba(255, 248, 240, 0.04); }

.num {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.nm {
  font-family: var(--display);
  font-weight: 560;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.x {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--faint);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.x:hover { color: var(--ink); background: rgba(226, 75, 56, 0.16); }

.empty { margin: 16px 2px 0; }

.empty p {
  margin: 0 0 16px;
  max-width: 36ch;
  color: var(--muted);
  line-height: 1.5;
  text-wrap: pretty;
}

.dock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: 18px;
}

.wide { width: 100%; }

.texty {
  background: none;
  border: 0;
  color: var(--faint);
  cursor: pointer;
  min-height: 44px;
  padding: 8px 0;
  font-weight: 520;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.fine {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 0.92rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.banter {
  margin: 0 0 22px;
  max-width: 22em;
  font-family: var(--display);
  font-weight: 520;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.bye { margin: -6px 0 16px; color: var(--muted); }

.ring {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
}

.fighter {
  text-align: left;
  min-height: 240px;
  padding: 22px 22px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 236, 214, 0.08);
  border-top: 4px solid var(--chili);
  background:
    linear-gradient(180deg, rgba(255, 244, 230, 0.05), transparent 30%),
    linear-gradient(180deg, #2c221d, #1c1613);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 240, 0.06),
    0 18px 40px rgba(28, 12, 6, 0.4);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.fighter.right { border-top-color: var(--gold); }

.fighter:active { transform: translateY(1px) scale(0.995); }

.fighter.chosen {
  border-color: var(--gold);
  transform: translateY(-6px);
}

.fighter.dim { opacity: 0.38; }

.tag {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.fname {
  font-family: var(--display);
  font-size: clamp(2rem, 3.6vw, 3.15rem);
  line-height: 1.02;
  font-weight: 560;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.hint { margin-top: auto; color: var(--muted); font-size: 0.95rem; }

.vs {
  width: 68px;
  height: 68px;
  margin-inline: -18px;
  align-self: center;
  position: relative;
  z-index: 1;
  pointer-events: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #8c2c24;
  color: var(--cream);
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  box-shadow: 0 0 0 8px var(--bg);
}

.keys {
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.alive {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
}

.alive li {
  padding: 6px 10px;
  border-radius: 999px;
  background: #2a211c;
  color: var(--faint);
  font-size: 0.84rem;
  font-weight: 520;
  overflow-wrap: anywhere;
}

.alive li.on {
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.crown { padding-top: 8px; }

.stamp {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 10px;
  border: 1.5px solid var(--gold);
  border-radius: 3px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: rotate(-7deg);
}

.winner {
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(3rem, 7vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
  overflow-wrap: break-word;
  text-wrap: balance;
}

.crown .lede { margin-bottom: 22px; }

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

.share { margin: 0 0 16px; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sk {
  border-radius: 14px;
  background: linear-gradient(100deg, #2a221c 25%, #3d332c 48%, #2a221c 72%);
  background-size: 220% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.sk-input { height: 52px; }

.sk-block { height: 88px; margin-top: 16px; }

.sk-btn { height: 52px; margin-top: 18px; border-radius: 999px; }

@keyframes shimmer {
  from { background-position: 80% 0; }
  to { background-position: -80% 0; }
}

@media (hover: hover) and (pointer: fine) {
  .primary:hover:not(:disabled) { background: #f6c14a; }
  .fighter:hover { transform: translateY(-3px); border-color: var(--gold); }
}

@media (max-width: 899px) {
  .wrap { padding-top: 22px; }
  .lobby { grid-template-columns: 1fr; gap: 22px; }
  .manifesto h1 { font-size: clamp(2.55rem, 11vw, 3.4rem); }
  .board { padding: 16px 14px 12px; border-radius: 22px; }
  .ring { grid-template-columns: 1fr; }
  .fighter { min-height: 0; padding: 18px 16px; }
  .fname { font-size: clamp(1.85rem, 8vw, 2.45rem); }
  .vs { margin: -14px auto; box-shadow: 0 0 0 6px var(--bg); }
  .keys { display: none; }
  .empty .ghost,
  .actions { width: 100%; }
  .actions { flex-direction: column; }
}

@media (pointer: coarse) {
  .keys { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .sk { animation: none; }
  button, .chip, .stub, .fighter { transition: none; }
  .stamp,
  .fighter:hover,
  .fighter.chosen,
  .fighter:active,
  .primary:active,
  .ghost:active { transform: none; }
}

@media (forced-colors: active) {
  .primary, .ghost, .fighter, .chip, .board {
    border: 1px solid ButtonText;
  }
}
