@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("/fonts/Alegreya.woff2") format("woff2");
}

@font-face {
  font-family: "Alegreya";
  font-style: italic;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/Alegreya-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/AlegreyaSans-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/AlegreyaSans-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "Alegreya Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/AlegreyaSans-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "Alegreya Sans SC";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/AlegreyaSansSC-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "Alegreya Sans SC";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/AlegreyaSansSC-Bold.woff2") format("woff2");
}

body.cairn {
  --bg: #14161b;
  --leather: #2a211b;
  --leather-2: #33281f;
  --parch: #ecdfc5;
  --parch-2: #c9bb9f;
  --parch-3: #8f846f;
  --amber: #e6a645;
  --amber-hi: #f3c272;
  --danger: #d4644a;
  --line: rgba(236, 223, 197, 0.11);
  --line-2: rgba(236, 223, 197, 0.2);
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
  --sans: "Alegreya Sans", "Gill Sans", "Segoe UI", system-ui, sans-serif;
  --sc: "Alegreya Sans SC", "Alegreya Sans", system-ui, sans-serif;
  color-scheme: dark;
  color: var(--parch);
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(230, 166, 69, 0.09), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(80, 110, 160, 0.08), transparent 60%),
    var(--bg);
}

.cairn .site-header,
.cairn .site-footer {
  border-color: var(--line);
}

.cairn .site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(20, 22, 27, 0.86);
  backdrop-filter: blur(10px);
}

.cairn .site-name {
  font-family: var(--serif);
  font-weight: 700;
}

.cairn nav a,
.cairn nav button,
.cairn .site-footer a {
  color: var(--parch-2);
}

.cairn nav a[aria-current="page"] {
  color: var(--parch);
  text-decoration-color: var(--amber);
}

.main-binder {
  padding: 0;
}

:where(.main-binder) button,
:where(.main-binder) input {
  font: inherit;
  color: inherit;
}

.main-binder h1,
.main-binder h2,
.main-binder h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.15;
}

.main-binder :focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

.btn-primary {
  background: linear-gradient(#efb357, #d8942f);
  color: #24170a;
  border-color: #b97b22;
  box-shadow: 0 1px 0 rgba(255, 230, 180, 0.5) inset, 0 6px 18px -8px rgba(230, 166, 69, 0.6);
}

.btn-primary:hover {
  background: linear-gradient(#f5c06a, #e09d38);
}

.btn-ghost {
  background: transparent;
  color: var(--parch);
  border-color: var(--line-2);
}

.btn-ghost:hover {
  border-color: var(--parch-2);
}

.btn-danger {
  background: #9c3b27;
  color: #fde9df;
  border-color: #c4553c;
}

.btn-danger:hover {
  background: #b0442d;
}

.btn-wide {
  width: 100%;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 28px 80px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.main-binder .page-head h1,
.main-binder .signin h1 {
  font-size: 40px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  font: 500 14px var(--sc);
  letter-spacing: 0.06em;
  color: var(--parch-3);
}

.sub {
  margin: 6px 0 0;
  color: var(--parch-2);
}

.head-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.back {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--parch-3);
  text-decoration: none;
}

.back:hover {
  color: var(--parch);
}

.sheet {
  position: relative;
  padding: 26px 26px 30px 74px;
  border-radius: 6px 14px 14px 6px;
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 220, 170, 0.06), transparent 60%),
    linear-gradient(135deg, var(--leather-2), var(--leather));
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 9px 9px 9px 52px;
  border: 1px dashed rgba(230, 166, 69, 0.22);
  border-radius: 4px 10px 10px 4px;
  pointer-events: none;
}

.spine {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 50px 0;
  border-radius: 6px 0 0 6px;
  background: linear-gradient(90deg, #1c1612, #2d2319 70%, #1e1813);
}

.spine i {
  width: 26px;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(#d9d3c8, #8a8478 55%, #c9c2b6);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.6);
}

.pockets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pocket {
  position: relative;
  aspect-ratio: 63 / 88;
  padding: 6px;
  border-radius: 9px;
  background: rgba(10, 8, 6, 0.35);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 8px 14px -8px rgba(0, 0, 0, 0.7);
}

.pocket::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

.qty {
  position: absolute;
  right: -9px;
  bottom: -9px;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c9473a, #8e2518 70%);
  color: #fde8d8;
  font: 700 15px/1 var(--serif);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 0 0 3px rgba(0, 0, 0, 0.12);
  transform: rotate(-8deg);
}

.pocket-remove {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 3;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 15px;
  background: rgba(20, 16, 12, 0.92);
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.15s, transform 0.15s;
}

.pocket:hover .pocket-remove,
.pocket:focus-within .pocket-remove {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pocket-remove:hover {
  background: #8e2f1e;
  border-color: #c4553c;
}

@media (hover: none) {
  .pocket-remove {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.pocket.is-new {
  animation: glow 2.4s ease-out 1;
}

@keyframes glow {
  0%,
  30% {
    box-shadow: 0 0 0 3px var(--amber), 0 0 30px rgba(230, 166, 69, 0.7);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.skel {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(100deg, rgba(236, 223, 197, 0.05) 30%, rgba(236, 223, 197, 0.12) 50%, rgba(236, 223, 197, 0.05) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.3s linear infinite;
}

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

.card,
.mini {
  --d: #b8843f;
  --ink: #f4dcb8;
}

.card {
  height: 100%;
  container-type: inline-size;
}

.card-in {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 5cqw;
  border-radius: 5cqw;
  color: #1d1712;
  background: linear-gradient(160deg, color-mix(in srgb, var(--d) 70%, #f3e6c8), color-mix(in srgb, var(--d) 85%, #000));
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.card-top {
  display: flex;
  margin-bottom: 3cqw;
}

.card-set {
  padding: 0.6cqw 3cqw;
  border-radius: 3cqw;
  background: #f4ead2;
  font: 700 7cqw/1.2 var(--sc);
  letter-spacing: 0.06em;
  box-shadow: inset 0 0 0 1cqw var(--d);
}

.card-art {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 2.5cqw;
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 5px),
    radial-gradient(80% 70% at 50% 40%, var(--ink), color-mix(in srgb, var(--d) 75%, #000));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.mono {
  font: italic 700 46cqw/1 var(--serif);
  color: color-mix(in srgb, var(--d) 60%, #000);
  opacity: 0.55;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.card-name {
  margin-top: 4cqw;
  padding: 2.4cqw 3cqw;
  border-radius: 2cqw;
  background: #f4ead2;
  font: 700 9cqw/1.1 var(--serif);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-foot {
  margin-top: 2.5cqw;
  padding: 0 1.5cqw;
  font: 500 6.4cqw/1.2 var(--sc);
  letter-spacing: 0.05em;
  color: #fbf3e2;
}

.sheet-msg {
  display: grid;
  min-height: 470px;
}

.sheet-msg > :not(.spine) {
  grid-area: 1 / 1;
}

.pockets.ghost .pocket {
  background: transparent;
  box-shadow: none;
  border: 1.5px dashed rgba(236, 223, 197, 0.12);
}

.pockets.ghost .pocket::after,
.ghost-pocket::after {
  display: none;
}

.msg {
  z-index: 1;
  align-self: center;
  justify-self: center;
  max-width: 430px;
  padding: 30px 34px;
  border-radius: 12px;
  text-align: center;
  background: rgba(28, 22, 18, 0.94);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line);
}

.main-binder .msg h2 {
  margin-bottom: 8px;
  font-size: 28px;
}

.msg p {
  margin: 0 0 20px;
  color: var(--parch-2);
}

.msg .fine {
  margin: 14px 0 0;
}

.msg .msg-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border: 1px solid rgba(212, 100, 74, 0.5);
  border-radius: 50%;
  background: rgba(212, 100, 74, 0.15);
  color: var(--danger);
  font: 700 24px var(--serif);
}

.fine {
  font-size: 14px;
  color: var(--parch-3);
}

.add {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.main-binder .step {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 21px;
}

.step span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--amber);
  color: #24170a;
  font: 700 14px var(--sans);
}

.search input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 17px;
}

.search input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(230, 166, 69, 0.18);
}

.results {
  max-height: 520px;
  margin: 12px 0 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.result {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.result:hover {
  background: rgba(255, 255, 255, 0.04);
}

.result[aria-pressed="true"] {
  background: rgba(230, 166, 69, 0.12);
  box-shadow: inset 3px 0 0 var(--amber);
}

.mini {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 42px;
  border-radius: 4px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--d) 70%, #f3e6c8), color-mix(in srgb, var(--d) 80%, #000));
  color: rgba(255, 255, 255, 0.85);
  font: italic 700 16px var(--serif);
}

.result-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.result-main b {
  font: 700 17px var(--serif);
  letter-spacing: 0.03em;
}

.result-main small {
  color: var(--parch-3);
  font-size: 13.5px;
}

.owned {
  color: var(--amber);
  font-size: 12.5px;
  font-weight: 700;
}

.no-hits {
  padding: 22px;
  color: var(--parch-3);
  text-align: center;
}

.add-pick {
  position: sticky;
  top: 88px;
  padding: 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--leather-2), var(--leather));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}

.pick-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0 10px;
  color: var(--parch-3);
  text-align: center;
}

.pick-empty p {
  margin: 0;
}

.ghost-pocket {
  width: 150px;
  background: transparent;
  box-shadow: none;
  border: 1.5px dashed rgba(236, 223, 197, 0.18);
}

.pick {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
}

.pick-card {
  aspect-ratio: 63 / 88;
  animation: drop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes drop {
  from {
    transform: translateY(-14px) rotate(-3deg);
    opacity: 0;
  }
}

.main-binder .pick-info h3 {
  font-size: 23px;
  letter-spacing: 0.03em;
}

.pick-info .meta {
  margin: 4px 0 0;
  color: var(--parch-3);
  font-size: 15px;
}

.stepper {
  display: flex;
  align-items: center;
  width: max-content;
  margin: 18px 0 14px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 10px;
}

.stepper button {
  width: 46px;
  height: 46px;
  border: 0;
  background: rgba(0, 0, 0, 0.25);
  font-size: 22px;
  cursor: pointer;
}

.stepper button:hover:not(:disabled) {
  background: rgba(230, 166, 69, 0.15);
}

.stepper button:disabled {
  opacity: 0.35;
  cursor: default;
}

.stepper output {
  min-width: 56px;
  text-align: center;
  font: 700 22px var(--serif);
}

.pick-info .btn + .btn {
  margin-top: 8px;
}

.signin {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: calc(100vh - 140px);
}

.signin-art {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 44px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(60% 50% at 50% 55%, rgba(230, 166, 69, 0.2), transparent 70%),
    linear-gradient(180deg, #1a1d26, #241c16);
}

.fan {
  position: relative;
  width: 420px;
  height: 340px;
  margin: 0 auto;
}

.fan-card {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 190px;
  aspect-ratio: 63 / 88;
  margin-left: -95px;
  transform-origin: 50% 120%;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.55));
}

.fan-card:nth-child(1) {
  transform: rotate(-14deg) translateX(-30px);
}

.fan-card:nth-child(2) {
  transform: translateY(-14px);
}

.fan-card:nth-child(3) {
  transform: rotate(14deg) translateX(30px);
}

.signin-tag {
  max-width: 26ch;
  margin: 0;
  font: italic 500 26px/1.3 var(--serif);
}

.signin-panel {
  display: grid;
  place-items: center;
  padding: 40px 28px;
}

.signin-box {
  width: 100%;
  max-width: 380px;
}

.lede {
  margin: 10px 0 26px;
  color: var(--parch-2);
}

.signin .fine {
  margin-top: 18px;
}

.main-binder dialog {
  max-width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #221b16;
  color: var(--parch);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--line-2);
}

.main-binder dialog::backdrop {
  background: rgba(8, 7, 6, 0.7);
  backdrop-filter: blur(2px);
}

.dlg {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 22px;
  padding: 24px;
}

.dlg-card {
  aspect-ratio: 63 / 88;
  transform: rotate(-3deg);
}

.main-binder .dlg h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.dlg p {
  margin: 0 0 20px;
  color: var(--parch-2);
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 50;
  padding: 12px 20px;
  border-radius: 10px;
  background: #f0e3c8;
  color: #24170a;
  font-weight: 700;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

  .add-pick {
    position: static;
  }

  .signin {
    grid-template-columns: 1fr;
  }

  .signin-art {
    display: none;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 20px 16px 80px;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .main-binder .page-head h1 {
    font-size: 32px;
  }

  .head-actions {
    justify-content: flex-end;
  }

  .sheet {
    padding: 16px 12px 18px;
    border-radius: 12px;
  }

  .sheet::before {
    inset: 6px;
  }

  .spine {
    display: none;
  }

  .pockets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
  }

  .qty {
    right: -5px;
    min-width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .pick {
    grid-template-columns: 120px 1fr;
    gap: 14px;
  }

  .dlg {
    grid-template-columns: 1fr;
  }

  .dlg-card {
    width: 96px;
  }
}
