/* Contract stationery and the dark frame shared by the game tools. */
:root {
  --bg: #e5d7bb;
  --surface: #f1e5cd;
  --ink: #302621;
  --muted: #685849;
  --line: #b9a487;
  --accent: #853e37;
  --green: #853e37;
  --soft: #e8d6b6;
  --soft-ink: #73352f;
  --dark: #292025;
  --radius: 5px;
  --shadow: 0 7px 20px #21171b1a;
  --stock: #e6d6b8;
  --gold: #d6ad74;
  --rule: 3px double var(--line);
}
:root[data-theme='dark'] {
  --bg: #1c191c;
  --surface: #30292a;
  --ink: #f2e3c7;
  --muted: #c4ad92;
  --line: #66544a;
  --accent: #d79881;
  --green: #daa28d;
  --soft: #453533;
  --soft-ink: #f3c4ac;
  --stock: #262224;
}
body {
  background: var(--bg);
  color: var(--ink);
}
.pad {
  background:
    repeating-linear-gradient(2deg, transparent 0 4px, #a9885307 5px, transparent 6px), var(--stock);
  background-size: 100% 9px;
}
.panel {
  color: var(--ink);
}
.rail,
[data-theme='dark'] .rail {
  background: #211c20;
  border-color: #78604e;
  color: #eddab8;
}
.rail .logo {
  background: none;
  color: #dbb277;
  box-shadow: none;
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 0;
}
.rail .nb {
  color: #d4c1a9;
  border-radius: 3px;
}
.rail .nb.on,
.rail .nb.on:hover {
  background: #743e38;
  border-color: #95695b;
  color: #fff2dc;
  box-shadow: inset 3px 0 #e3bc82;
}
.rail .nb.on:before {
  display: none;
}
.app-header {
  border-bottom: var(--rule);
  min-height: 55px;
  margin-bottom: 20px;
}
.context-name b,
.brand > span {
  font-family: Georgia, serif;
}
h1,
.studio-intro h1,
.page-intro h1,
.panel > .intro h1 {
  font-family: Oswald, sans-serif;
  font-weight: 600;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--ink);
}
h2,
.card h2,
.paper h2,
.lab-hero h2,
.journal-record summary b,
.release h2 {
  font-family: Georgia, serif;
  letter-spacing: -0.025em;
  color: var(--ink);
}
#app
  :is(
    .card,
    .paper,
    .release,
    .lab-section,
    .lab-phase,
    .lab-empty,
    .mode-picker,
    .board-options,
    .theme-button,
    .lang-button,
    .seg,
    .hc,
    .lab-item,
    .cat-choice,
    .lab-stage,
    .mode-option,
    .ban-rule-card
  ) {
  border-radius: 4px;
}
#app :is(.card, .paper, .lab-empty, .release, .lab-phase) {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
#app .section-heading,
.lab-section-title,
.lab-result-header,
.lab-phase-heading {
  border-bottom: var(--rule);
  padding-bottom: 10px;
}
#app :is(.spin, .pb:not(.o), .game-export-button),
#app .nb.on {
  background: #783c34;
  color: #fff1d9;
  border: 1px solid #935a48;
  box-shadow:
    inset 0 0 0 2px #783c34,
    inset 0 0 0 3px #be9270;
  border-radius: 4px;
}
#app :is(.spin, .pb:not(.o), .game-export-button):hover:not(:disabled) {
  background: #623029;
  color: #fff7e8;
}
#app
  :is(
    .mode-option.selected,
    .lab-stages .on,
    .ban-type-picker .on,
    .lab-presets .on,
    .seg .on,
    .hc:has(input:checked),
    .cat-choice:has(input:checked)
  ) {
  background: var(--soft);
  border-color: var(--accent);
  color: var(--soft-ink);
}
#app
  :is(
    .journal-tools input,
    .lab-field select,
    .search-input,
    .lab-budget,
    .lab-item,
    .condition-number,
    .overlay-pos,
    .ban-slot-map > div
  ) {
  border-radius: 3px;
}
#app :is(.lab-item, .ban-slot-map > div, .lab-item-actions button, .journal-record) {
  border-color: var(--line);
}
#app
  :is(
    .eyebrow,
    .lab-section-title > span,
    .lab-phase-heading > span,
    .hero-count,
    .release-version,
    .journal-record summary strong
  ) {
  color: var(--soft-ink);
}
.page-intro,
.studio-intro {
  border-bottom: var(--rule);
  padding-bottom: 18px;
}
.studio-intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(105deg, #302326, #5a3732);
  border: 1px solid #82644e;
  border-radius: 3px;
  padding: 22px clamp(20px, 4vw, 55px);
  min-height: 150px;
}
.studio-intro h1 {
  color: #faecd1;
}
.studio-intro p {
  color: #e4d3b9;
  max-width: 65%;
}
.studio-art {
  display: block;
  position: absolute;
  inset: 0 0 0 auto;
  width: 32%;
  height: 100%;
  background: repeating-radial-gradient(
    circle at 60% 55%,
    transparent 0 24px,
    #cda16e60 25px 26px,
    transparent 27px 44px
  );
  z-index: -1;
}
.studio-art img:first-child {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  transform: none;
  object-fit: cover;
  object-position: 50% 30%;
  mask-image: linear-gradient(90deg, transparent, #000 40%);
}
.mach {
  background: #282125;
  color: #eddec5;
  border-color: #826c58;
  border-radius: 4px;
}
.mach .board-toolbar,
.mach .board-options {
  border-color: #705c50;
}
.mach .hero-reel {
  background: linear-gradient(148deg, #603f3d, #282027);
  border-color: #8a715c;
  border-radius: 3px;
}
.mach .conditions {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
}
.mach .conditions .condition-reel + .condition-reel {
  border-top: var(--rule);
}
.mach .condition-result h3 {
  font:
    bold 22px/1.2 Georgia,
    serif;
  color: var(--ink);
}
.mach .condition-result p,
.mach .condition-empty,
.mach .condition-top .reel-title,
.mach .condition-top .lk {
  color: var(--muted);
}
.mach .condition-number {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--soft-ink);
  border-radius: 0;
}
.mach .hero-reel > .reel-title,
.mach .hero-display p,
.mach .hero-display .hero-context,
.mach .filter-summary,
.mach .filter-summary button {
  color: #e0c6a3;
}
.mach .hero-display h3 {
  font:
    italic bold 42px/1.1 Georgia,
    serif;
  color: #ffedd0;
}
.mach .hero-context span,
.mach .hero-reel > .lk {
  background: #382b29;
  color: #f1dcbf;
  border-color: #856952;
}
.contract-portrait {
  display: none;
}
#app .paper {
  border-top: 4px double var(--line);
}
#app .contract-state {
  background: var(--soft);
  color: var(--soft-ink);
}
#app .lab-order-title h2,
.journal-record summary b,
.lab-item-name h3 {
  font-family: Georgia, serif;
}
.build-shopping {
  border-left: 5px solid var(--accent) !important;
}
.ban-rule-text {
  border-block: var(--rule);
  padding-block: 15px;
}
#overlay-example {
  background: #292226;
  color: #f4e5c7;
  border-color: #9e7d59;
}
.completion-card,
[data-theme='dark'] .completion-card {
  --paper: #efe0be;
  --paper-ink: #30241f;
  --paper-muted: #584537;
  --paper-line: #a18a70;
  --stamp: #59412c;
  --ink: var(--paper-ink);
  --muted: var(--paper-muted);
  background: var(--paper);
  color: var(--paper-ink);
  border: 5px double #9b765b;
}
.completion-card.failure,
[data-theme='dark'] .completion-card.failure {
  --paper: #e4cfb5;
  --stamp: #812f2d;
}
@media (min-width: 1000px) {
  html:not(.desktop-compact) .d {
    grid-template-columns: 164px minmax(0, 1fr);
  }
  html:not(.desktop-compact) .rail {
    width: 164px;
    padding-inline: 12px;
  }
  .rail .brand {
    display: flex;
    align-items: center;
    padding: 0 0 18px;
    gap: 8px;
  }
  .rail .brand > span {
    display: block;
    font-size: 16px;
    line-height: 1;
    letter-spacing: -0.025em;
    color: #ecdaba;
  }
  .rail .nb {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 46px;
    padding: 10px 14px;
    font-size: 13px;
  }
  .pad {
    padding-inline: clamp(24px, 3vw, 50px);
  }
  .roulette-layout {
    grid-template-columns: minmax(0, 1.95fr) minmax(255px, 0.85fr);
    gap: 16px;
  }
}
@media (min-width: 720px) {
  html:not(.desktop-compact) .mach .reel-stage:has(.hero-display) {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr);
    align-items: stretch;
    padding: 15px;
    gap: 0;
  }
  html:not(.desktop-compact) .hero-reel:has(.hero-display) {
    display: block;
    position: relative;
    height: auto;
    min-height: 315px;
    align-self: stretch;
    isolation: isolate;
    border: 1px solid #9a7b5d;
  }
  html:not(.desktop-compact) .hero-reel:has(.hero-display) > .reel-title {
    position: absolute;
    top: 8px;
    left: 3px;
    z-index: 2;
    text-shadow: 0 1px 4px #111;
  }
  html:not(.desktop-compact) .hero-reel:has(.hero-display) > .lk {
    position: absolute;
    top: 12px;
    right: 10px;
    margin: 0;
    padding: 5px;
    min-height: 28px;
  }
  html:not(.desktop-compact) .hero-reel:has(.hero-display) > .lk span {
    display: none;
  }
  html:not(.desktop-compact) .hero-reel:has(.hero-display) .strip {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
  }
  html:not(.desktop-compact) .mach .hero-display {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    align-items: flex-end;
    min-height: 100%;
    padding: 18px;
  }
  html:not(.desktop-compact) .mach .hero-display:after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(0deg, #171318f5, transparent 70%);
  }
  html:not(.desktop-compact) .mach .contract-portrait {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
    position: absolute;
    inset: 0;
    z-index: -2;
  }
  html:not(.desktop-compact) .mach .hero-display:not(.missing-portrait) .hero-avatar {
    display: none;
  }
  html:not(.desktop-compact) .mach .hero-display h3 {
    font-size: clamp(27px, 3vw, 42px);
  }
  .mach .hero-display .hero-context {
    gap: 4px;
  }
  .mach .conditions {
    padding: 0 14px;
  }
}
@media (max-width: 719px) {
  .studio-intro {
    min-height: 108px;
    padding: 15px;
  }
  .studio-intro p {
    max-width: 70%;
    font-size: 12px;
  }
  html:not(.desktop-compact) .mach .hero-display {
    overflow: hidden;
    position: relative;
    min-height: 120px;
    padding-inline-end: 40%;
  }
  html:not(.desktop-compact) .mach .contract-portrait {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    width: 45%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
    mask-image: linear-gradient(90deg, transparent, #000 28%);
  }
  html:not(.desktop-compact) .mach .hero-display:not(.missing-portrait) .hero-avatar {
    display: none;
  }
  .mach .hero-display h3 {
    font-size: 26px;
  }
}

html:not(.desktop-compact) .playing-contract .studio-intro {
  display: block;
  min-height: 0;
  padding: 0 0 14px;
  margin: 0 0 18px;
  background: none;
  border: 0;
  border-bottom: var(--rule);
}
.playing-contract .studio-art,
.playing-contract .studio-intro p {
  display: none;
}
.playing-contract .studio-intro h1 {
  color: var(--ink);
}
html:not(.desktop-compact) .playing-contract .paper .contract-build,
html:not(.desktop-compact) .playing-contract .paper [data-tab='ban'],
html:not(.desktop-compact) .playing-contract .paper .friend-challenge {
  display: flex;
  width: 100%;
  margin: 8px 0;
  justify-content: center;
}
#app .playing-contract .paper [data-tab='ban'],
#app .playing-contract .paper .friend-challenge {
  background: transparent;
  color: var(--soft-ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
html:not(.desktop-compact) .playing-contract .hero-display > div > p {
  display: none;
}
html:not(.desktop-compact) .mach .hero-display.missing-portrait {
  flex-wrap: wrap;
}
html:not(.desktop-compact) .playing-contract .mach {
  background: transparent;
  border: 0;
  box-shadow: none;
}
html:not(.desktop-compact) .playing-contract .mach .reel-stage {
  padding: 0;
}
#app .build-shopping .pb {
  min-height: 40px;
}

.folio-heading {
  display: none;
}
@media (min-width: 720px) {
  html:not(.desktop-compact) .mach .hero-reel:has(.hero-display)::after {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 12px;
    border: 1px solid #ead8b49c;
    pointer-events: none;
  }
  html:not(.desktop-compact) .mach .hero-reel:has(.hero-display) > .lk {
    z-index: 3;
  }
  html:not(.desktop-compact) .mach .hero-display {
    padding: 26px;
  }
  html:not(.desktop-compact) .mach .reel-stage:has(.hero-display) .conditions {
    position: relative;
    border-radius: 0 3px 3px 0;
    border-left: 0;
    padding-inline: clamp(18px, 2vw, 32px);
    overflow: visible;
    background: var(--surface);
  }
  html:not(.desktop-compact) .mach .reel-stage:has(.hero-display) .conditions::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 -7px;
    width: 8px;
    background: radial-gradient(circle at 0 6px, transparent 4.8px, var(--surface) 5.5px) 0 0/8px
      12px;
    pointer-events: none;
  }
  html:not(.desktop-compact) .mach .reel-stage:has(.hero-display) .folio-heading {
    display: block;
    margin-top: 18px;
    padding-bottom: 10px;
    border-bottom: var(--rule);
    font:
      600 12px Oswald,
      sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
  }
  html:not(.desktop-compact) .playing-contract .mach .hero-reel > .reel-title {
    left: 14px;
    top: 12px;
  }
}
#app .paper .preview-actions ~ .share-actions {
  margin-top: 14px;
}
#app .lab-settings #build-import {
  display: flex;
  margin-top: 12px;
  justify-content: center;
}
#app .lab-settings #rb {
  margin-top: 14px;
}
#app #p-history .card > :is(h2, h3, p, .journal-stats) + :is(h2, h3, p, .journal-stats) {
  margin-block-start: 12px;
}
#app #journal-list {
  margin-block-start: 16px;
}
#app #journal-list > h3 {
  margin: 18px 0 12px;
}
#app #p-history .card > h2 {
  line-height: 1.25;
}
#app .journal-actions,
#app .backup-actions,
#app .ban-result-footer {
  gap: 12px;
  flex-wrap: wrap;
}
#app .section-heading + :is(.overlay-controls, .hero-tools, .cat-grid),
#app .lab-result-header + .lab-totals {
  margin-top: 14px;
}
#app #p-custom details > summary {
  padding: 10px 0;
}

#app .mode-picker {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#app .mode-options {
  gap: clamp(10px, 1.5vw, 22px);
}
#app .mode-option {
  border-radius: 6px;
}

/* A brief stamped receipt uses no input layer, including in compact mode. */
.acceptance-receipt {
  position: fixed;
  top: clamp(76px, 23vh, 210px);
  left: 50%;
  z-index: 90;
  pointer-events: none;
  translate: -50% 0;
  animation: receipt-leaves 1450ms both;
}
.acceptance-seal {
  position: relative;
  width: min(250px, 80vw);
  padding: 13px 18px 14px;
  display: grid;
  justify-items: center;
  gap: 4px;
  background: repeating-linear-gradient(2deg, transparent 0 3px, #9b76400a 4px), #eddbb7;
  color: #80392f;
  outline: 1px solid #a98d65;
  outline-offset: -2px;
  box-shadow: 0 12px 28px #20151c4d;
  transform: rotate(-6deg);
  animation: receipt-press 530ms both;
}
.acceptance-seal::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 3px double currentColor;
}
.acceptance-seal small,
.acceptance-seal span {
  font:
    600 11px/1.4 Oswald,
    sans-serif;
  letter-spacing: 0.12em;
}
.acceptance-seal strong {
  font:
    700 clamp(30px, 6vw, 42px)/1.1 Georgia,
    serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-block: 1px solid currentColor;
  padding-inline: 10px;
}
@keyframes receipt-press {
  0% {
    transform: translateY(-22px) rotate(-13deg) scale(1.22);
    opacity: 0;
  }
  52% {
    transform: translateY(2px) rotate(-6deg) scale(0.96);
    opacity: 1;
  }
  72% {
    transform: translateY(-1px) rotate(-6deg) scale(1.025);
  }
  100% {
    transform: rotate(-6deg);
  }
}
@keyframes receipt-leaves {
  0%,
  76% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .acceptance-receipt,
  .acceptance-seal {
    animation: none;
  }
}

#overlay-example + #overlay-toggle {
  margin-block-start: 14px;
}

.skill-plan {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: clamp(14px, 2vw, 24px);
  border-top: 3px double var(--line);
}
.skill-plan h2 {
  font:
    bold clamp(21px, 2.4vw, 32px) Georgia,
    serif;
  margin: 0;
}
.skill-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  margin: 8px 0 16px;
  font-size: 12px;
}
.skill-legend b {
  color: var(--accent);
}
.skill-legend span {
  margin-inline-start: 12px;
  font-weight: 700;
}
.skill-scroll {
  overflow-x: auto;
  max-width: 100%;
  scrollbar-color: var(--line) var(--surface);
}
.skill-scroll table {
  min-width: 0;
  width: 790px;
  max-width: none;
  border-spacing: 0 4px;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}
.skill-scroll th:first-child {
  position: sticky;
  left: 0;
  width: 198px;
  background: var(--surface);
  text-align: left;
  z-index: 1;
}
.skill-scroll thead th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.skill-scroll tbody th div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.skill-scroll img {
  width: 29px;
  height: 29px;
  object-fit: contain;
  background: #362c30;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.skill-scroll td {
  background: var(--soft);
  text-align: center;
  padding: 4px 0;
  border-inline-start: 1px solid var(--surface);
}
.skill-mark {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 23px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 800;
}
.skill-open {
  background: #743a36;
  color: #ffe3ac;
  border-color: #ac7860;
}
.contract-followup {
  margin-block-start: 16px;
  display: grid;
  gap: 8px;
}
.contract-followup .contract-note {
  margin: 0;
}

body.desktop .titlebar {
  padding-inline: 18px 6px;
  background: linear-gradient(105deg, #492c30, #2b2226 48%, #241e21);
  color: #f2e3c7;
  border-bottom: 3px double #937453;
}
.titlebar-drag {
  flex: 1;
  gap: 12px;
}
.titlebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font:
    bold 19px Georgia,
    serif;
  letter-spacing: 0.015em;
  text-transform: none;
  color: inherit;
}
.titlebar-brand::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: #a35a4d;
  border: 3px double #e6c38d;
}
.titlebar-version {
  padding-inline-start: 12px;
  border-inline-start: 1px solid #95785c;
  color: #dec49d;
  font: 11px monospace;
  letter-spacing: 0.05em;
}
.titlebar-version:empty {
  display: none;
}
.titlebar-controls {
  border-inline-start: 1px solid #715c51;
  padding-inline-start: 6px;
}
.titlebar-controls .titlebar-button {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  min-width: 38px;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  color: #f2e3c7;
  font: 16px system-ui;
}
.titlebar-button:hover {
  background: #59463e;
}
.titlebar-button.close:hover {
  background: #873f38;
  color: white;
}
.titlebar-button:focus-visible {
  outline: 2px solid #dfba83;
  outline-offset: -3px;
}
.desktop-compact .titlebar-controls .compact-exit {
  position: static;
}

.skill-scroll th div > span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.skill-scroll tbody th div {
  height: 40px;
  box-sizing: border-box;
}
.skill-scroll tbody th:is(:hover, :focus-visible)::after {
  content: attr(data-skill-name);
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 340px;
  padding: 0 8px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.skill-actions,
.match-review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-block: 12px;
}
#contract.finished > :is(.completion-status, .friend-challenge, .review-stamp, .share-actions) {
  margin-block: 0;
}
#contract.finished > :is(.friend-challenge, .review-stamp, .share-actions) {
  margin-top: 12px;
}
#contract .contract-top h2.eyebrow {
  line-height: 1.3;
  letter-spacing: 0.055em;
  text-decoration: none;
  margin: 0;
}
#contract .contract-top h2.eyebrow::after,
#contract .contract-top h2.eyebrow::before {
  content: none;
}
.panel :is(.result-actions, .share-actions, .lab-result-tools, .journal-actions) {
  gap: 10px;
  flex-wrap: wrap;
}
.panel :is(button, label) {
  overflow-wrap: anywhere;
}

.shop-test {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-block: 12px;
}
.match-recap {
  padding-block: 16px;
  border-top: 1px solid var(--paper-line);
  color: var(--paper-ink);
}
.match-recap ul {
  padding-inline-start: 20px;
  margin-block: 10px;
}
.guide-head {
  padding: clamp(18px, 3vw, 38px) 0;
  border-bottom: var(--rule);
  margin-bottom: 22px;
}
.guide-head h1 {
  font:
    bold clamp(32px, 4vw, 60px)/1.04 Georgia,
    serif;
  letter-spacing: -0.045em;
  margin: 0;
  color: var(--ink);
}
.guide-head p,
.guide-sheet p {
  margin: 12px 0;
  color: var(--muted);
  line-height: 1.6;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 18px;
  max-width: 1140px;
}
.guide-sheet {
  min-width: 0;
  padding: clamp(16px, 2.4vw, 32px);
  border: 1px solid var(--line);
  border-top: 4px double var(--line);
  background: var(--surface);
  border-radius: 4px;
  box-shadow: var(--shadow);
}
.guide-sheet h2 {
  display: flex;
  gap: 10px;
  align-items: center;
  font:
    700 25px Georgia,
    serif;
  margin: 0 0 18px;
}
.guide-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.guide-tabs button,
.guide-wave select {
  min-height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 3px;
  padding: 5px 12px;
}
.guide-tabs button[aria-pressed='true'] {
  background: #683631;
  color: #fff0da;
  border-color: #a47a61;
}
.guide-time,
.guide-portrait {
  min-height: 155px;
  padding: 20px;
  background: #352526;
  color: #f3dfbd;
  border: 3px double #997558;
  display: grid;
  align-content: center;
  gap: 5px;
}
.guide-time strong {
  font:
    64px/1 Georgia,
    serif;
  font-variant-numeric: tabular-nums;
}
.guide-time span,
.guide-portrait span {
  color: #e6c7a9;
}
.guide-sheet small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.035em;
}
.guide-portrait {
  position: relative;
  overflow: hidden;
  padding-right: 42%;
  background: linear-gradient(120deg, #342327, #67443d);
}
.guide-portrait img {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 98%;
  width: 45%;
  object-fit: contain;
  object-position: bottom;
}
.guide-portrait strong,
.guide-portrait span {
  display: block;
}
.guide-portrait strong {
  font:
    bold 36px Georgia,
    serif;
}
.guide-range,
.guide-wave {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
  font-weight: 700;
}
.guide-range input {
  flex: 1;
  min-width: 110px;
  accent-color: var(--accent);
}
.guide-source {
  display: block;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  color: var(--muted);
}
.guide-source a {
  color: var(--ink);
}
.guide-pick {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
}
.guide-pick small {
  grid-column: 1/-1;
  color: var(--muted);
}
.guide-pick h3 {
  margin: 0;
  font:
    bold 22px Georgia,
    serif;
}
.field-match,
.field-clock,
.field-lessons {
  display: grid;
  grid-template-columns: minmax(225px, 0.8fr) minmax(300px, 1.4fr);
  gap: 18px;
}
.field-match aside {
  align-self: start;
}
.guide-content label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-weight: 700;
}
.guide-content select,
.guide-content input {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 3px;
  min-height: 38px;
  padding: 5px 10px;
  max-width: 100%;
}
.field-match .guide-portrait {
  margin: 16px 0;
}
.field-match .guide-portrait strong {
  font-size: clamp(22px, 3vw, 36px);
}
.field-answers article {
  border-top: 1px solid var(--line);
  padding-block: 12px;
}
.field-answers {
  margin-top: 16px;
}
.field-answers article p {
  margin: 6px 0 0;
  line-height: 1.45;
}
.field-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 4px;
  min-width: 0;
  width: 100%;
}
.field-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 3px;
  background: #453b39;
}
.field-item span,
.field-item small {
  display: block;
}
.field-item small {
  color: var(--muted);
  margin-top: 4px;
}
.field-item:hover,
.field-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.field-nav {
  padding-bottom: 14px;
  border-bottom: var(--rule);
}
.field-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.field-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: 9px;
}
.field-lessons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.field-lessons details {
  border-top: 1px solid var(--line);
  padding-block: 14px;
}
.field-lessons summary {
  cursor: pointer;
  font-weight: 700;
}
.field-tooltip {
  position: fixed;
  z-index: 3000;
  width: min(350px, calc(100vw - 16px));
  max-height: min(540px, 85vh);
  overflow: auto;
  background: var(--tip);
  color: #fff4de;
  border: 3px double #d3ba8b;
  border-radius: 5px;
  box-shadow: 0 12px 35px #17101777;
  line-height: 1.4;
}
.field-tooltip.weapon {
  --tip: #694018;
}
.field-tooltip.spirit {
  --tip: #493956;
}
.field-tooltip.vitality {
  --tip: #354e43;
}
.field-tooltip header {
  background: #19131a42;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff3df;
}
.field-tooltip header img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.field-tooltip h3 {
  font:
    bold 23px/1.1 Georgia,
    serif;
  color: inherit;
  margin: 0;
}
.field-tooltip header button {
  margin-left: auto;
  align-self: flex-start;
  background: transparent;
  color: inherit;
  border: 1px solid #dcc9aa88;
  border-radius: 3px;
  min-width: 28px;
}
.field-tip-body {
  padding: 4px 14px 12px;
}
.field-tip-body section {
  padding-block: 8px;
  border-top: 1px solid #ffffff38;
}
.field-tooltip h4 {
  color: #ffdfb1;
  margin: 0 0 6px;
}
.field-tip-body p {
  color: inherit;
  margin: 4px 0 8px;
}
.field-stat {
  margin-block: 3px;
}
.field-stat b {
  color: #ffe3a8;
}
.field-component {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.field-component img {
  width: 22px;
  height: 22px;
}
.field-clock {
  align-items: center;
  margin: 16px 0;
}
.field-clock input {
  width: 85px;
}
@media (max-width: 760px) {
  .field-match,
  .field-clock,
  .field-lessons {
    grid-template-columns: minmax(0, 1fr);
  }
}
.spawn-summary {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  border-block: var(--rule);
  padding: 14px 0;
  margin: 16px 0;
}
.spawn-summary small,
.spawn-summary b {
  display: block;
}
.spawn-summary b {
  font:
    bold 28px Georgia,
    serif;
}
.shop-index {
  border: 1px solid #80684e;
  background: #d7c8ae;
  border-radius: 4px;
  overflow: hidden;
}
.shop-tools,
.shop-tools > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.shop-tools {
  justify-content: space-between;
  padding: 10px;
  background: #51473e;
}
.shop-tools button {
  background: transparent;
  color: #f3e5ce;
  border: 1px solid transparent;
  padding: 7px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
}
.shop-tools button:hover,
.shop-tools button[aria-pressed='true'] {
  border-color: #dbc6a7;
  background: #746251;
}
.shop-tools input {
  min-width: 0;
  width: 155px;
}
.market-wrap {
  overflow-x: auto;
}
.market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 570px;
}
.market-banner.weapon,
.market-cell.weapon {
  --tone: #974b18;
  --wash: #ead4ac;
}
.market-banner.spirit,
.market-cell.spirit {
  --tone: #664380;
  --wash: #d6c6da;
}
.market-banner.vitality,
.market-cell.vitality {
  --tone: #486739;
  --wash: #cbd3b3;
}
.market-grid .market-banner {
  margin: 0;
  text-align: center;
  padding: 14px 4px;
  font:
    bold italic clamp(22px, 3.2vw, 46px) Georgia,
    serif;
  color: #fff1da;
  background:
    repeating-linear-gradient(130deg, transparent 0 7px, #fff1 8px, transparent 9px), var(--tone);
  border: 2px solid #c9b899;
}
.market-price {
  grid-column: 1/-1;
  color: #382b20;
  background: #d7c8ae;
  margin: 0;
  padding: 10px 12px 5px;
  font:
    bold 19px Georgia,
    serif;
  border-bottom: 1px solid #95816c;
}
.market-cell {
  background: var(--wash);
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(62px, 100%), 1fr));
  align-content: start;
  gap: 5px;
  border-right: 1px solid #a08b77;
}
.market-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-width: 0;
  border: 1px solid #9d8c79;
  border-radius: 3px;
  background: #fff9e7;
  color: #271f19;
  padding: 0;
  overflow: hidden;
  box-shadow: 1px 2px 3px #39281333;
}
.market-item img {
  display: block;
  width: 100%;
  height: 50px;
  object-fit: contain;
  background: #fffdf4;
}
.market-item span {
  padding: 4px 2px;
  font:
    bold 11px/1.15 Georgia,
    serif;
  overflow-wrap: anywhere;
}
.market-item:hover,
.market-item:focus-visible {
  outline: 2px solid var(--tone);
  outline-offset: -2px;
}

.condition-result .condition-tip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 4px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
}
.contract-advice {
  max-width: 760px;
}
.contract-advice h2 {
  margin-block: 10px;
}
.contract-advice .advice-rule {
  padding-block: 12px;
  border-block: var(--rule);
}
.tip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block-start: 18px;
}
.contract-recommendations {
  margin-bottom: 16px;
}

.match-timeline {
  max-width: 900px;
}
.timeline-clock,
.timeline-form,
.match-timeline fieldset {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.timeline-clock {
  padding: 16px;
  background: #362629;
  color: #f4e2c8;
  border: 3px double #93785d;
  justify-content: space-between;
}
.timeline-clock strong {
  font:
    bold 38px Georgia,
    serif;
  font-variant-numeric: tabular-nums;
}
.timeline-form input {
  width: 7em;
}
.match-timeline fieldset {
  margin-block: 16px;
  padding: 10px;
  border: 1px solid var(--line);
}
.match-timeline label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.match-timeline input[type='checkbox'] {
  min-height: 0;
  accent-color: var(--accent);
}
.match-timeline ol {
  padding: 0;
  margin: 0;
}
.match-timeline li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.match-timeline li time {
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  min-width: 4em;
  color: var(--accent);
}
.match-timeline li button {
  margin-inline-start: auto;
}

.purchase-comparison {
  margin-bottom: 14px;
}
.purchase-comparison summary {
  cursor: pointer;
  font:
    bold 22px Georgia,
    serif;
}
.compare-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.purchase-comparison table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  overflow-wrap: anywhere;
}
.purchase-comparison th,
.purchase-comparison td {
  text-align: left;
  vertical-align: top;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}
.purchase-comparison th img {
  width: 28px;
  height: 28px;
  display: block;
}
.purchase-comparison .compare-section {
  background: var(--soft);
}
.compare-pick {
  margin: 8px 14px;
  padding: 6px 10px;
  border: 1px solid #c4a68b;
  color: #fff3df;
  background: #34292b;
}

.hero-dossier > * + *,
.guide-content > .hero-dossier {
  margin-block-start: 1rem;
}
.hero-dossier ol {
  padding-inline-start: 1.5rem;
}
.hero-dossier .guide-portrait {
  min-height: 10rem;
}
.guide-sheet .rookie-step {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-block: 0.65rem;
  line-height: 1.45;
}
.guide-sheet .rookie-step input {
  flex: none;
  width: 1rem;
  height: 1rem;
}
.guide-sheet [data-quiz] {
  display: grid;
  gap: 0.9rem;
}
.guide-sheet [data-quiz] fieldset {
  min-width: 0;
  padding: 0.6rem 0.9rem;
}
