:root {
  color-scheme: light;
  --ink: #1c2a39;
  --ink-soft: #36485a;
  --paper: #f4e9d8;
  --paper-light: #fffaf0;
  --paper-dark: #dfcfb5;
  --teal: #2f7e78;
  --teal-dark: #245f5b;
  --red: #c85a46;
  --gold: #d8a43a;
  --line: #bea985;
  --shadow: 0 16px 34px rgb(28 42 57 / 14%);
  font-family: "Yu Gothic UI", "Hiragino Sans", "BIZ UDPGothic", system-ui, sans-serif;
  font-synthesis: none;
  line-height: 1.65;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--paper);
}

body::before {
  background: var(--ink);
  content: "";
  display: block;
  height: 5px;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.skip-link {
  background: var(--paper-light);
  left: 1rem;
  padding: 0.65rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 100;
}

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

.site-header,
footer,
main {
  margin-inline: auto;
  max-width: 1180px;
  width: calc(100% - 2rem);
}

.site-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 74px;
}

.brand {
  align-items: center;
  display: inline-flex;
  font-weight: 800;
  gap: 0.65rem;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.brand-mark {
  display: inline-block;
  height: 35px;
  position: relative;
  width: 39px;
}

.brand-mark i,
.brand-mark b {
  border: 2px solid var(--ink);
  border-radius: 3px;
  display: block;
  height: 29px;
  position: absolute;
  width: 21px;
}

.brand-mark i {
  background: var(--paper-light);
  left: 2px;
  top: 2px;
}

.brand-mark b {
  background: var(--teal);
  bottom: 1px;
  right: 2px;
}

.site-header nav,
footer nav {
  align-items: center;
  display: flex;
  gap: 1.25rem;
}

.site-header nav a,
footer nav a {
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header nav a:hover,
footer nav a:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

main {
  min-height: calc(100vh - 190px);
}

.eyebrow {
  color: var(--teal-dark);
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0 0 0.55rem;
}

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

h1,
h2,
h3 {
  line-height: 1.35;
}

h1 {
  font-size: clamp(1.75rem, 3.3vw, 2.2rem);
  letter-spacing: 0.025em;
  margin-bottom: 0.9rem;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
}

.hero {
  align-items: center;
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(260px, 0.82fr) minmax(430px, 1.18fr);
  min-height: 480px;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem);
  position: relative;
}

.hero::after {
  border: 1px solid rgb(190 169 133 / 55%);
  border-radius: 12px;
  content: "";
  inset: 10px;
  pointer-events: none;
  position: absolute;
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-copy > p:not(.eyebrow) {
  color: var(--ink-soft);
  font-size: 1.03rem;
  max-width: 34rem;
}

.hero-actions,
.form-actions,
.detail-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

.button {
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 46px;
  padding: 0.68rem 1.05rem;
  text-decoration: none;
}

.button:hover {
  box-shadow: 4px 4px 0 var(--gold);
  translate: -2px -2px;
}

.button.primary {
  background: var(--ink);
  color: var(--paper-light);
}

.button.secondary {
  background: var(--paper-light);
}

.button.danger {
  background: var(--paper-light);
  border-color: var(--red);
  color: #8b3024;
}

.button.compact {
  min-height: 39px;
  padding: 0.45rem 0.8rem;
}

.promise-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 1.35rem 0 0;
  padding: 0;
}

.promise-row li {
  background: #e8ddcb;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
}

.handoff-board {
  background: var(--ink);
  border: 7px solid #2a3a4a;
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px var(--gold);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1.1fr 0.9fr 0.8fr 0.24fr 1.25fr;
  min-height: 310px;
  padding: 2rem 1.1rem;
  position: relative;
}

.handoff-board::before,
.handoff-board::after {
  border: 1px solid var(--gold);
  content: "";
  height: 14px;
  position: absolute;
  top: 10px;
  width: 14px;
}

.handoff-board::before {
  left: 10px;
}

.handoff-board::after {
  right: 10px;
}

.deck-tray {
  align-self: end;
  background: var(--teal-dark);
  border: 2px solid #133b39;
  border-radius: 8px 8px 12px 12px;
  display: flex;
  flex-direction: column;
  height: 225px;
  justify-content: flex-end;
  padding: 0.65rem;
  position: relative;
}

.deck-tray > span {
  color: var(--paper-light);
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  left: 0.6rem;
  letter-spacing: 0.12em;
  position: absolute;
  top: 0.45rem;
}

.deck-tray > b {
  color: var(--paper-light);
  font-size: 0.7rem;
  margin-top: 0.4rem;
  text-align: center;
}

.deck-tray i {
  background: var(--paper-light);
  border: 1px solid var(--paper-dark);
  border-radius: 4px;
  display: block;
  height: 130px;
  margin-top: -122px;
  position: relative;
}

.deck-tray i::before {
  border: 2px solid var(--gold);
  content: "";
  height: 23px;
  inset: 45% auto auto 50%;
  rotate: 45deg;
  translate: -50% -50%;
  width: 23px;
}

.tray-extra {
  height: 194px;
}

.tray-extra i::before {
  border-color: var(--teal);
  border-radius: 50%;
  rotate: 0deg;
}

.tray-side {
  height: 170px;
}

.tray-side i::before {
  border: 0;
  border-bottom: 20px solid var(--red);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  height: 0;
  rotate: 0deg;
  width: 0;
}

.handoff-rail {
  align-self: end;
  height: 110px;
  position: relative;
}

.handoff-rail::before {
  background: var(--gold);
  content: "";
  height: 5px;
  left: -1.5rem;
  position: absolute;
  top: 54%;
  width: calc(100% + 3rem);
}

.handoff-rail i {
  border: solid var(--gold);
  border-width: 5px 5px 0 0;
  height: 20px;
  position: absolute;
  right: -0.85rem;
  top: calc(54% - 8px);
  rotate: 45deg;
  width: 20px;
}

.archive-drawer {
  align-self: stretch;
  background: #253544;
  border: 3px solid #0e1822;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  position: relative;
}

.archive-drawer > span {
  background: var(--gold);
  border: 2px solid #7d5c18;
  font-family: ui-monospace, monospace;
  font-size: 0.58rem;
  font-weight: 800;
  left: 50%;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.4rem;
  position: absolute;
  top: 1.1rem;
  translate: -50% 0;
  white-space: nowrap;
}

.archive-drawer i {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 3px 3px 0 0;
  display: block;
  height: 125px;
  margin-top: -110px;
  position: relative;
}

.archive-drawer i::after {
  background: var(--teal);
  border-radius: 3px 3px 0 0;
  content: "";
  height: 16px;
  left: 50%;
  position: absolute;
  top: -10px;
  translate: -50% 0;
  width: 42px;
}

.how-strip {
  align-items: center;
  display: grid;
  gap: 0.8rem;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  margin: 2rem auto 3.5rem;
  max-width: 1000px;
}

.how-strip article {
  align-items: start;
  display: grid;
  gap: 0.15rem 0.65rem;
  grid-template-columns: auto 1fr;
}

.how-strip article > span {
  background: var(--teal);
  border-radius: 50%;
  color: white;
  display: grid;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 800;
  height: 28px;
  place-items: center;
  width: 28px;
}

.how-strip article b {
  font-size: 0.9rem;
}

.how-strip article p {
  color: var(--ink-soft);
  font-size: 0.78rem;
  grid-column: 2;
  margin: 0;
}

.how-strip > i {
  background: var(--line);
  height: 1px;
  width: 28px;
}

.latest-section,
.shelf-page,
.form-page,
.detail-page,
.text-page {
  padding-block: 1.5rem 4rem;
}

.section-heading,
.result-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-heading h2 {
  margin: 0;
}

.section-heading > a {
  color: var(--teal-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

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

.deck-card {
  min-width: 0;
}

.deck-card > a {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 5px 5px 0 #d5c3a7;
  display: block;
  height: 100%;
  overflow: hidden;
  padding: 1rem;
  position: relative;
  text-decoration: none;
}

.deck-card > a::before {
  background: var(--teal);
  content: "";
  height: 5px;
  inset: 0 0 auto;
  position: absolute;
}

.deck-card > a:hover {
  border-color: var(--ink);
  box-shadow: 8px 8px 0 var(--gold);
  translate: -2px -2px;
}

.card-topline {
  align-items: center;
  display: flex;
  font-size: 0.72rem;
  gap: 0.65rem;
  justify-content: space-between;
}

.format-chip {
  border: 1px solid currentColor;
  border-radius: 999px;
  color: var(--teal-dark);
  font-weight: 800;
  padding: 0.15rem 0.55rem;
}

.format-master-duel {
  color: #78542a;
}

.deck-card h2 {
  font-size: 1.05rem;
  margin: 1rem 0 0.45rem;
  overflow-wrap: anywhere;
}

.category-line {
  align-items: center;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.category-line b {
  color: var(--ink);
}

.category-line span::before {
  content: "・";
  margin-right: 0.45rem;
}

.mini-trays {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(3, 1fr);
}

.mini-trays span {
  background: #e8ddcb;
  border-radius: 4px;
  display: grid;
  font-family: ui-monospace, monospace;
  font-size: 0.56rem;
  gap: 0.2rem;
  grid-template-columns: 8px 1fr;
  padding: 0.4rem;
}

.mini-trays i {
  background: var(--teal);
  border-radius: 1px;
  display: block;
  grid-row: span 2;
}

.mini-trays b {
  font-size: 0.88rem;
}

.author-line {
  color: var(--ink-soft);
  font-size: 0.7rem;
  margin: 0.8rem 0 0;
}

.empty-shelf {
  background: rgb(255 250 240 / 65%);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 2.2rem;
  text-align: center;
}

.empty-shelf > div {
  height: 80px;
  margin: 0 auto 1rem;
  position: relative;
  width: 120px;
}

.empty-shelf > div i,
.fallen-cards i {
  background: var(--paper-light);
  border: 2px solid var(--line);
  border-radius: 5px;
  display: block;
  height: 62px;
  position: absolute;
  width: 42px;
}

.empty-shelf > div i:nth-child(1) {
  left: 14px;
  rotate: -9deg;
}

.empty-shelf > div i:nth-child(2) {
  left: 40px;
  top: 8px;
}

.empty-shelf > div i:nth-child(3) {
  left: 66px;
  rotate: 9deg;
}

.shelf-intro,
.form-hero,
.detail-header,
.text-page > header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.shelf-intro h1,
.form-hero h1,
.detail-header h1,
.text-page > header h1 {
  margin-bottom: 0;
}

.shelf-cabinet {
  background: var(--ink);
  border: 3px solid #101a24;
  border-radius: 6px;
  display: flex;
  gap: 5px;
  height: 75px;
  padding: 9px 10px;
  width: 150px;
}

.shelf-cabinet i {
  background: var(--paper-light);
  border-radius: 3px 3px 0 0;
  display: block;
  flex: 1;
  position: relative;
}

.shelf-cabinet i::before {
  background: var(--teal);
  content: "";
  height: 8px;
  left: 50%;
  position: absolute;
  top: -4px;
  translate: -50%;
  width: 24px;
}

.filter-panel {
  align-items: end;
  background: var(--ink);
  border-radius: 10px;
  color: var(--paper-light);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1.6fr 0.8fr 0.8fr auto;
  margin-bottom: 1.5rem;
  padding: 1rem;
}

.filter-panel label,
.deck-form label {
  display: grid;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 0.35rem;
}

input,
select,
textarea {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 5px;
  min-height: 43px;
  padding: 0.65rem 0.75rem;
  width: 100%;
}

textarea {
  line-height: 1.55;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
}

.filter-panel .button {
  background: var(--paper-light);
  color: var(--ink);
}

.clear-link {
  color: var(--paper-light);
  font-size: 0.75rem;
  grid-column: 1 / -1;
}

.result-heading {
  align-items: center;
}

.result-heading p {
  margin: 0;
}

.result-heading p b {
  color: var(--teal-dark);
  font-family: ui-monospace, monospace;
  font-size: 1.25rem;
}

.form-hero {
  background: var(--ink);
  border-radius: 12px;
  color: var(--paper-light);
  min-height: 190px;
  padding: 1.5rem clamp(1.2rem, 4vw, 2.6rem);
}

.form-hero .eyebrow {
  color: #7fb8b3;
}

.form-hero p:not(.eyebrow) {
  color: #d8dedf;
  margin: 0;
}

.form-deck-symbol {
  align-items: end;
  display: flex;
  height: 100px;
  min-width: 210px;
  position: relative;
}

.form-deck-symbol i {
  background: var(--paper-light);
  border: 2px solid var(--gold);
  border-radius: 5px;
  height: 82px;
  margin-right: -38px;
  width: 58px;
}

.form-deck-symbol i:nth-child(2) {
  height: 72px;
  translate: 45px;
}

.form-deck-symbol i:nth-child(3) {
  height: 62px;
  translate: 90px;
}

.form-deck-symbol b {
  color: var(--gold);
  font-size: 2rem;
  margin-left: auto;
}

.compact-hero {
  min-height: 135px;
}

.deck-form {
  display: grid;
  gap: 1rem;
  margin-inline: auto;
  max-width: 980px;
}

.deck-form fieldset {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 4px 4px 0 #d5c3a7;
  padding: 1.25rem;
}

.deck-form legend {
  background: var(--teal);
  border-radius: 4px;
  color: white;
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.65rem;
}

.field-pair,
.field-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.list-fields {
  align-items: start;
  display: grid;
  gap: 0.85rem;
  grid-template-columns: 1.4fr 1fr 1fr;
}

.list-fields label > span {
  align-items: center;
  display: flex;
  font-family: ui-monospace, monospace;
  justify-content: space-between;
}

.list-fields label > span b {
  color: var(--teal-dark);
  font-size: 1rem;
}

.list-fields textarea {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.82rem;
}

.field-help,
.deck-form small {
  color: var(--ink-soft);
  font-size: 0.72rem;
  margin: 0 0 0.75rem;
}

code {
  background: #e8ddcb;
  border-radius: 3px;
  font-family: ui-monospace, monospace;
  padding: 0.1rem 0.35rem;
}

.attestation {
  align-items: start;
  background: #e3efe7;
  border: 1px solid #87aa96;
  border-radius: 8px;
  display: flex !important;
  grid-template-columns: auto 1fr;
  padding: 0.9rem;
}

.attestation input {
  accent-color: var(--teal);
  min-height: auto;
  width: auto;
}

.honeypot {
  height: 1px;
  left: -10000px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.form-status {
  border-radius: 6px;
  font-weight: 700;
  min-height: 0;
}

.form-status:not(:empty) {
  background: #f5dfd8;
  border: 1px solid var(--red);
  padding: 0.75rem;
}

.detail-header {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-height: 180px;
  overflow: hidden;
  padding: 1.5rem 2rem;
}

.detail-header .card-topline {
  justify-content: flex-start;
}

.detail-header h1 {
  margin-top: 0.8rem;
  max-width: 760px;
  overflow-wrap: anywhere;
}

.detail-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  gap: 0.8rem;
  margin: 0;
}

.detail-meta span,
.detail-meta time {
  color: var(--ink-soft);
}

.detail-stack {
  align-items: flex-end;
  background: var(--ink);
  border-radius: 8px;
  display: flex;
  height: 145px;
  min-width: 230px;
  overflow: hidden;
  padding: 1rem;
  position: relative;
}

.detail-stack i {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 5px;
  height: 100px;
  margin-right: -30px;
  width: 66px;
}

.detail-stack i:nth-child(2) {
  height: 88px;
  translate: 37px;
}

.detail-stack i:nth-child(3) {
  height: 76px;
  translate: 74px;
}

.detail-stack span {
  color: var(--gold);
  font-family: ui-monospace, monospace;
  font-size: 0.58rem;
  left: 1rem;
  letter-spacing: 0.1em;
  position: absolute;
  top: 0.7rem;
}

.deck-columns {
  align-items: start;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.35fr 1fr 1fr;
}

.deck-list {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}

.deck-list > header {
  align-items: center;
  background: var(--ink);
  color: var(--paper-light);
  display: flex;
  font-family: ui-monospace, monospace;
  justify-content: space-between;
  letter-spacing: 0.08em;
  padding: 0.65rem 0.85rem;
}

.deck-list-extra > header {
  background: var(--teal-dark);
}

.deck-list-side > header {
  background: #7e3c30;
}

.deck-list ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.deck-list li {
  align-items: baseline;
  border-bottom: 1px solid #e6dac6;
  display: grid;
  font-size: 0.82rem;
  gap: 0.65rem;
  grid-template-columns: 1.4rem 1fr;
  padding: 0.45rem 0.7rem;
}

.deck-list li:last-child {
  border-bottom: 0;
}

.deck-list li b {
  color: var(--teal-dark);
  font-family: ui-monospace, monospace;
}

.no-cards {
  color: var(--ink-soft);
  font-size: 0.8rem;
  margin: 0;
  padding: 1.2rem;
  text-align: center;
}

.explanation-card {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 5px 5px 0 #d5c3a7;
  margin-top: 1rem;
  padding: 1.35rem;
}

.explanation-card > header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
}

.explanation-card > header span {
  background: var(--gold);
  font-family: ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.45rem;
}

.explanation-card p {
  margin-bottom: 0.8rem;
  white-space: pre-wrap;
}

.reaction-panel {
  align-items: center;
  background: var(--ink);
  border-radius: 12px;
  color: var(--paper-light);
  display: grid;
  gap: 1rem;
  grid-template-columns: 0.7fr 1.3fr;
  margin-top: 1.5rem;
  padding: 1.3rem;
}

.reaction-panel .eyebrow {
  color: #7fb8b3;
}

.reaction-panel h2 {
  margin: 0;
}

.reaction-buttons {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, 1fr);
}

.reaction-buttons button {
  align-items: center;
  background: var(--paper-light);
  border: 2px solid var(--gold);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 0.2rem 0.55rem;
  grid-template-columns: auto 1fr;
  padding: 0.65rem;
  text-align: left;
}

.reaction-buttons button:hover {
  translate: 0 -2px;
}

.reaction-buttons button[aria-pressed="true"] {
  background: #dfece6;
  border-color: var(--teal);
}

.reaction-buttons i {
  background: var(--teal);
  border-radius: 50%;
  color: white;
  display: grid;
  font-style: normal;
  grid-row: span 2;
  height: 34px;
  place-items: center;
  width: 34px;
}

.reaction-buttons span {
  font-size: 0.7rem;
  font-weight: 800;
}

.reaction-buttons b {
  font-family: ui-monospace, monospace;
}

.reaction-status {
  font-size: 0.75rem;
  grid-column: 2;
  margin: 0;
}

.report-panel {
  margin: 1rem 0 0 auto;
  max-width: 520px;
}

.report-panel summary {
  cursor: pointer;
  font-size: 0.75rem;
  text-align: right;
}

.report-panel form {
  background: var(--paper-light);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
  padding: 1rem;
}

.report-panel label {
  align-items: center;
  display: flex;
  font-size: 0.78rem;
  gap: 0.55rem;
}

.report-panel input {
  min-height: auto;
  width: auto;
}

.text-page {
  max-width: 850px;
}

.text-page > header {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1rem;
}

.text-page section,
.text-page aside {
  background: rgb(255 250 240 / 78%);
  border-left: 4px solid var(--teal);
  margin-block: 1rem;
  padding: 1rem 1.2rem;
}

.text-page section h2 {
  margin-bottom: 0.55rem;
}

.text-page section p:last-child,
.text-page aside p:last-child {
  margin-bottom: 0;
}

.text-page aside {
  border-left-color: var(--gold);
}

.guide-diagram {
  align-items: center;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(7, auto);
  margin-bottom: 1rem;
  overflow-x: auto;
}

.guide-diagram div {
  background: var(--ink);
  border-radius: 5px;
  color: var(--paper-light);
  display: grid;
  min-width: 95px;
  padding: 0.7rem;
  text-align: center;
}

.guide-diagram div.note {
  background: var(--teal-dark);
  min-width: 135px;
}

.guide-diagram b {
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
}

.guide-diagram span {
  font-size: 0.7rem;
}

.not-found {
  padding-block: 5rem;
  text-align: center;
}

.fallen-cards {
  height: 100px;
  margin: 0 auto 1rem;
  position: relative;
  width: 150px;
}

.fallen-cards i:nth-child(1) {
  left: 20px;
  rotate: -24deg;
  top: 20px;
}

.fallen-cards i:nth-child(2) {
  left: 57px;
  rotate: 5deg;
}

.fallen-cards i:nth-child(3) {
  left: 92px;
  rotate: 27deg;
  top: 25px;
}

footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.6rem 1.5rem;
  grid-template-columns: auto 1fr;
  margin-top: 2rem;
  min-height: 120px;
  padding-block: 1.5rem;
}

footer > span {
  font-weight: 800;
}

footer nav {
  justify-content: flex-end;
}

footer small {
  color: var(--ink-soft);
  font-size: 0.67rem;
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .handoff-board {
    min-height: 285px;
  }

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

  .filter-panel {
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .list-fields,
  .deck-columns {
    grid-template-columns: 1fr 1fr;
  }

  .main-list,
  .deck-list-main {
    grid-column: 1 / -1;
  }

  .reaction-panel {
    grid-template-columns: 1fr;
  }

  .reaction-status {
    grid-column: 1;
  }
}

@media (max-width: 650px) {
  body::before {
    height: 4px;
  }

  .site-header,
  footer,
  main {
    width: calc(100% - 1.1rem);
  }

  .site-header {
    align-items: start;
    gap: 0.5rem;
    min-height: 88px;
    padding-block: 0.75rem;
  }

  .brand {
    font-size: 0.88rem;
  }

  .brand-mark {
    scale: 0.85;
    transform-origin: left center;
    width: 34px;
  }

  .site-header nav {
    align-items: flex-end;
    flex-direction: column;
    gap: 0.1rem;
  }

  .site-header nav a {
    font-size: 0.72rem;
  }

  .hero {
    border-radius: 12px;
    gap: 1.3rem;
    min-height: 0;
    padding: 1.3rem;
  }

  .hero::after {
    inset: 6px;
  }

  .handoff-board {
    gap: 0.3rem;
    grid-template-columns: 1.1fr 0.9fr 0.8fr 0.2fr 1.1fr;
    min-height: 220px;
    padding: 1.5rem 0.5rem 0.8rem;
  }

  .deck-tray {
    height: 160px;
    padding: 0.32rem;
  }

  .tray-extra {
    height: 142px;
  }

  .tray-side {
    height: 126px;
  }

  .deck-tray i {
    height: 92px;
    margin-top: -85px;
  }

  .deck-tray i::before {
    height: 15px;
    width: 15px;
  }

  .tray-side i::before {
    border-bottom-width: 14px;
    border-left-width: 8px;
    border-right-width: 8px;
  }

  .deck-tray > span,
  .archive-drawer > span {
    font-size: 0.45rem;
  }

  .archive-drawer {
    padding: 0.45rem;
  }

  .archive-drawer i {
    height: 87px;
    margin-top: -78px;
  }

  .archive-drawer i::after {
    width: 24px;
  }

  .how-strip {
    align-items: stretch;
    grid-template-columns: 1fr;
    margin: 1.5rem 0 2.5rem;
  }

  .how-strip > i {
    height: 14px;
    margin-left: 14px;
    width: 1px;
  }

  .deck-grid,
  .field-pair,
  .field-grid.three,
  .list-fields,
  .deck-columns,
  .reaction-buttons {
    grid-template-columns: 1fr;
  }

  .main-list,
  .deck-list-main {
    grid-column: auto;
  }

  .section-heading,
  .result-heading,
  .shelf-intro,
  .form-hero,
  .detail-header,
  .text-page > header {
    align-items: stretch;
    flex-direction: column;
    gap: 1rem;
  }

  .shelf-cabinet {
    display: none;
  }

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .form-hero {
    padding: 1.2rem;
  }

  .form-deck-symbol {
    display: none;
  }

  .deck-form fieldset {
    padding: 1rem 0.75rem 0.85rem;
  }

  .detail-header {
    padding: 1.2rem;
  }

  .detail-stack {
    min-width: 0;
    width: 100%;
  }

  .reaction-panel {
    padding: 1rem;
  }

  .guide-diagram {
    grid-template-columns: 1fr;
  }

  .guide-diagram > i {
    text-align: center;
  }

  footer {
    grid-template-columns: 1fr;
  }

  footer nav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  footer small {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  footer,
  .detail-actions,
  .reaction-panel,
  .report-panel {
    display: none;
  }

  .detail-page {
    padding: 0;
    width: 100%;
  }

  .detail-header,
  .deck-list,
  .explanation-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
