@font-face {
  font-family: Monocraft;
  src: url("/fonts/Monocraft.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #14090c;
  --bg-2: #1d0d12;
  --ink: #f6efe8;
  --muted: #e4d2c8;
  --faint: #cbb8ae;
  --line: rgba(246, 239, 232, 0.16);
  --cherry: #e1062e;
  --cherry-deep: #9d0420;
  --pit: #f0c7a4;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --body: "Outfit", "Avenir Next", "Trebuchet MS", sans-serif;
  --space: clamp(1rem, 2vw, 1.5rem);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(225, 6, 46, 0.28), transparent 60%),
    radial-gradient(700px 380px at -10% 20%, rgba(240, 199, 164, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.5;
}
.wash {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(225, 6, 46, 0.28), transparent 60%),
    radial-gradient(700px 380px at -10% 20%, rgba(240, 199, 164, 0.08), transparent 55%),
    var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
  z-index: 5;
}
.skip:focus { top: 1rem; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--pit); outline-offset: 3px; }

.wrap { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0 0.4rem;
}
.mark {
  font-family: Monocraft, monospace;
  font-weight: 400;
  font-synthesis: none;
  font-size: 24px;
  letter-spacing: 0;
  text-decoration: none;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}
.mark i { font-style: normal; color: var(--cherry); }
.top-links { display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem 0.9rem; flex-wrap: wrap; }
.top a { text-decoration: none; color: var(--muted); }
.top a:hover { color: var(--ink); }
.addr {
  min-height: 44px;
  padding: 0.2rem 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.addr span {
  margin-right: 0.35rem;
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.addr b { font-weight: 560; }
.addr:hover { color: var(--ink); }
.ping {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 32px;
  padding: 0.15rem 0.7rem 0.15rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--faint);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.ping b { font-weight: 560; color: inherit; }
.ping.good { color: #b6e7a8; border-color: rgba(141, 206, 122, 0.5); }
.ping.mid { color: #ffd36a; border-color: rgba(255, 211, 106, 0.5); }
.ping.bad { color: #ff8b98; border-color: rgba(255, 139, 152, 0.55); }
.dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--faint);
  margin-right: 0.35rem;
}
.dot.on { background: #8dce7a; }
.ping .dot { margin: 0; }
.ping.mid .dot { background: #ffd36a; }
.ping.bad .dot { background: #ff8b98; }

.hero {
  padding: clamp(2rem, 6vw, 4.5rem) 0 0.5rem;
  max-width: 40rem;
}
.hero h1,
.hero .lede {
  font-family: Monocraft, monospace;
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: 0;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}
.hero h1 {
  font-size: 32px;
  line-height: 1.3;
}
.hero .lede {
  margin-top: 0.8rem;
  font-size: 16px;
  line-height: 1.45;
}
@media (min-width: 700px) {
  .hero h1 { font-size: 48px; }
  .hero .lede { font-size: 20px; }
}
.kicker {
  margin: 0 0 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--pit);
}
h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 560;
  font-size: clamp(3.4rem, 8vw, 7.2rem);
  line-height: 0.88;
  letter-spacing: -0.045em;
}
h1 em { font-style: italic; color: var(--cherry); }
.lede { max-width: 38rem; color: var(--muted); font-size: 1.15rem; }
.chip, .btn, .ghost {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.55rem 1rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.btn {
  background: var(--cherry);
  border-color: var(--cherry);
  color: white;
  font-weight: 560;
}
.btn:hover { background: var(--cherry-deep); }
.btn:disabled, .ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost:hover { border-color: var(--pit); }
.feature {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.feature .price {
  font-family: var(--display);
  font-size: 2.4rem;
  letter-spacing: -0.04em;
  margin: 0.2rem 0;
}
.note { color: var(--faint); }

.shop { padding-bottom: 6rem; }
.category { margin-top: 2.6rem; }
.category h2 {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 560;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
}
.row {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 1rem 1.25rem;
  align-items: center;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}
.row[id] { scroll-margin-top: 5.5rem; }
.row.from-game {
  margin-inline: -0.85rem;
  padding-inline: 0.85rem;
  border-radius: 0.45rem;
  background: rgba(225, 6, 46, 0.08);
  box-shadow: inset 0 0 0 1px var(--cherry);
}
.row.from-game .from-game-note { color: var(--pit); }
.thumb {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  background: var(--bg-2);
  border-radius: 0.35rem;
}
.monogram {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-style: italic;
  color: var(--pit);
  background:
    linear-gradient(160deg, rgba(225, 6, 46, 0.35), transparent 55%),
    var(--bg-2);
}
.row h3 { margin: 0; font-size: 1.2rem; font-weight: 560; }
.row p { margin: 0.15rem 0 0; color: var(--muted); }
.buy {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.price-tag {
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  min-width: 5.2rem;
  text-align: right;
}
.qty {
  width: 4.2rem;
  min-height: 44px;
  border-radius: 0.6rem;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0 0.5rem;
}
.banner {
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cherry);
  color: var(--muted);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-height: 44px;
  margin-top: 0.8rem;
}
.check input { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; flex: none; }
#linked { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin: 0.6rem 0 0; }
#gift-fields[hidden], #discord-card[hidden], #role-second[hidden], #unlink[hidden], #flow-copy[hidden], .flow [data-step][hidden] { display: none !important; }
.flow {
  width: min(28rem, calc(100% - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}
.flow::backdrop { background: rgba(8, 3, 5, 0.78); }
.flow-card {
  margin: 0;
  padding: 1.4rem 1.3rem 1.15rem;
  background: #1c0e14;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}
.flow-card.wlg-host { background: transparent; }
.flow-count {
  margin: 0;
  color: var(--pit);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.flow h2 {
  margin: 0.35rem 0 0.3rem;
  font-family: var(--display);
  font-size: 2.3rem;
  line-height: 1.05;
  text-wrap: balance;
}
.flow-copy { margin: 0 0 1rem; color: var(--muted); }
.flow .field { min-height: 52px; font-size: 1.1rem; }
.otp {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.4rem;
}
.otp-box {
  width: 100%;
  min-height: 48px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--bg);
  text-align: center;
  font-size: 1.25rem;
  font-weight: 560;
  text-transform: uppercase;
}
.otp-box.filled { border-color: var(--pit); }
@media (max-width: 520px) {
  .otp { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.55rem; }
  .otp-box { min-height: 52px; font-size: 1.4rem; }
}
.flow-actions { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.flow-actions .btn, .flow-actions .ghost { flex: 1; min-height: 48px; }
@media (prefers-reduced-motion: no-preference) {
  .flow[open] .flow-card { animation: flow-in 240ms ease; }
}
@keyframes flow-in {
  from { transform: translateY(12px); opacity: 0; }
}
.role-styles { display: flex; gap: 0.4rem; margin: 0.6rem 0; }
.style {
  min-height: 36px;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.style.on { color: var(--ink); border-color: var(--pit); }
.style:disabled { opacity: 0.4; cursor: not-allowed; }
.swatches { display: flex; gap: 1rem; align-items: center; }
.swatches input { width: 44px; height: 32px; padding: 0; border: 0; background: transparent; }
.role-preview { margin: 0.7rem 0; }
#role-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  background: color-mix(in srgb, currentColor 18%, transparent);
}
#discord-card { display: flex; gap: 0.7rem; align-items: center; margin: 0.7rem 0; }
#discord-card img { border-radius: 50%; }
#discord-card p { margin: 0; }
#discord-user { color: var(--faint); }

.cart {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(24rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  padding: 1rem;
  z-index: 3;
}
.cart .wlg-content {
  max-height: inherit;
  overflow: auto;
}
.cart h2 { margin: 0 0 0.6rem; font-family: var(--display); font-size: 1.7rem; }
.cart ul { list-style: none; margin: 0; padding: 0; }
.cart li { display: flex; justify-content: space-between; gap: 0.6rem; padding: 0.35rem 0; }
.cart label { display: block; margin: 0.8rem 0 0.3rem; }
.field {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
}
.cart .btn { width: 100%; margin-top: 0.8rem; }
.err { color: #ffb4b8; min-height: 1.3rem; }
.foot {
  padding: 2rem 0 6rem;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}
.foot a { color: var(--muted); }

body.desk-body {
  background: #10080b;
  background-image: none;
  overflow: hidden;
}
.gate[hidden] { display: none !important; }
.gate {
  width: min(28rem, calc(100% - 2rem));
  margin: 18vh auto 0;
  display: grid;
  gap: 0.7rem;
}
.gate h1 {
  font-size: clamp(3.2rem, 8vw, 5.5rem);
  margin-bottom: 0.4rem;
}
.console {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  background: #160a12;
}
.console[hidden] { display: none !important; }
.rail {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1rem 1rem;
  border-right: 1px solid rgba(255, 180, 190, 0.18);
  background: linear-gradient(180deg, #6e1024 0%, #3a0c16 42%, #1a1014 100%);
}
.rail .mark, .rail .nav-item, .rail .rail-link { color: #fff4ea; }
.rail-note {
  margin: 0.15rem 0 1rem;
  color: #ffd0c4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.rail-nav { display: grid; gap: 0.25rem; }
.nav-item {
  min-height: 44px;
  text-align: left;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  padding: 0.55rem 0.75rem;
  color: var(--muted);
}
.nav-item.on { color: white; border-left-color: #ffd36a; background: rgba(255, 211, 106, 0.16); }
.rail-link { margin-top: auto; color: var(--faint); text-decoration: none; min-height: 44px; display: flex; align-items: center; }
.rail-out { width: 100%; }
.stage { min-width: 0; min-height: 0; padding: 1rem; background: #241018; }
.stat {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 560;
  color: #1a1008;
}
.stat.gold { background: #ffd36a; }
.stat.green { background: #7dcea0; }
.stat.amber { background: #ffb020; }
.stat.blue { background: #8ecbff; }
.stat.red { background: #ff8b98; }
.ledger { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.sheet-head h2 {
  margin: 0 0 0.8rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 560;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}
.ledger {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.work[hidden] { display: none !important; }
.work {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 1.25rem;
  height: 100%;
  min-height: 0;
}
.orders-side { min-height: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.orders-side .pkg-list { flex: 1; }
.filter { display: grid; gap: 0.25rem; color: var(--muted); font-size: 0.92rem; }
.detail-line { margin: 0; }
.detail-line + .detail-line { margin-top: 0.25rem; }
.delivery {
  border-top: 1px solid var(--line);
  padding: 0.45rem 0;
  display: grid;
  gap: 0.2rem;
}
.pkg-list { overflow: auto; min-height: 0; border-right: 1px solid var(--line); padding-right: 0.35rem; }
.editor {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: #2c1420;
  border: 1px solid rgba(255, 211, 106, 0.28);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
}
.desk-body .field { background: #1a0c12; border-color: rgba(142, 203, 255, 0.35); }
.form-row { display: grid; grid-template-columns: 1.5fr 0.7fr 1fr 0.45fr; gap: 0.55rem; }
.editor label, .form-row label { display: grid; gap: 0.25rem; font-size: 0.92rem; color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 1rem; }
.checks label { display: flex; align-items: center; gap: 0.45rem; min-height: 44px; }
.editor label.commands { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.commands textarea { flex: 1; min-height: 9rem; resize: vertical; }
.hint { margin: 0; color: var(--faint); font-size: 0.92rem; }
.ticket .detail-line:first-child {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 0.6rem;
}
.editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; position: sticky; bottom: 0; background: #2c1420; padding-top: 0.35rem; }
.editor-actions .err { margin: 0; }
.grid-form { display: grid; gap: 0.7rem; }
.grid-form textarea { min-height: 8rem; }
.field.short { min-height: 4.2rem; }
.pkg {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 0.7rem 0.55rem;
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}
.pkg.on { background: rgba(255, 211, 106, 0.14); box-shadow: inset 3px 0 0 #ffd36a; }
.orders { width: 100%; border-collapse: collapse; }
.orders th, .orders td { text-align: left; padding: 0.55rem 0.4rem; border-top: 1px solid var(--line); vertical-align: top; }
.order-page { width: min(720px, calc(100% - 2rem)); margin: 12vh auto; }
.reveal { animation: rise 420ms ease both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 800px) {
  .top { align-items: flex-start; flex-wrap: wrap; }
  .top-links { width: 100%; justify-content: flex-start; }
  .hero, .row { grid-template-columns: 1fr; }
  .buy { justify-content: space-between; }
  .price-tag { text-align: left; }
  .thumb, .monogram { width: 3.5rem; height: 3.5rem; }
  .cart {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 1.5rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  .console { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .rail { flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-note, .rail-link { display: none; }
  .rail-nav { display: flex; }
  .rail-out { width: auto; }
  .work { grid-template-columns: 1fr; height: auto; }
  .pkg-list { max-height: 34dvh; border-right: 0; border-bottom: 1px solid var(--line); padding-right: 0; }
  .form-row { grid-template-columns: 1fr 1fr; }
}
