/* Three views of a local prototype deck: gallery, stack, event index. */
:root {
  --deck-paper: #f4f2eb;
  --deck-ink: #252823;
  --deck-accent: #dbf575;
}
body {
  padding-bottom: 110px;
}
body.viewing-deck {
  background: var(--deck-paper);
  color: var(--deck-ink);
}
.viewing-deck .topbar {
  max-width: 1200px;
  height: 84px;
  padding-inline: 32px;
}
.viewing-deck .prototype-label {
  font-size: 12px;
}
.viewing-deck .stack-dock {
  display: none;
}
.app-nav {
  position: fixed;
  z-index: 35;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  padding: 6px;
  gap: 4px;
  background: #242722ed;
  backdrop-filter: blur(24px);
  border: 1px solid #ffffff28;
  border-radius: 28px;
  box-shadow: 0 8px 28px #20251e25;
}
.app-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #d0d4c9;
  min-height: 48px;
  padding: 0 21px;
  background: transparent;
  border-radius: 22px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}
.app-nav button.active {
  background: var(--deck-accent);
  color: var(--deck-ink);
}
.app-nav b {
  border-radius: 10px;
  padding: 2px 6px;
  background: #25282315;
  font-size: 10px;
}
.stack-dock {
  bottom: 94px;
  min-height: 56px;
}
.deck-page {
  max-width: 1136px;
  padding: 20px 32px 100px;
}
.deck-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0 34px;
}
.deck-eyebrow {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.8px;
  color: #72756d;
}
.deck-header h1 {
  font-family: var(--display);
  font-size: 88px;
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -5px;
  margin: 12px 0 13px;
}
.deck-header h1 span {
  font:
    16px Inter,
    sans-serif;
  vertical-align: top;
  display: inline-block;
  margin: 12px 0 0 5px;
}
.deck-header p {
  margin: 0;
  color: #72756d;
  font-size: 13px;
}
.deck-scan-fab {
  background: var(--deck-accent);
  color: var(--deck-ink);
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 28px;
  padding: 16px 20px;
  min-height: 56px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 3px 1px #222a1110;
}
.deck-scan-fab b {
  margin-left: 10px;
  font-size: 20px;
  font-weight: 400;
}
.deck-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-block: 1px solid #dcded4;
  margin-bottom: 30px;
}
.deck-search {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #8a8f80;
  flex: 1;
  min-width: 0;
}
.deck-search svg {
  width: 18px;
}
.deck-search input {
  outline-offset: 2px;
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  color: var(--deck-ink);
  font-size: 13px;
  padding: 8px 0;
}
.deck-tools select {
  max-width: 42%;
  font:
    500 12px Inter,
    sans-serif;
  color: var(--deck-ink);
  border: 0;
  background: transparent;
  min-height: 40px;
}
.deck-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
}
.deck-tile {
  background: transparent;
  text-align: left;
  padding: 0;
  min-width: 0;
  color: var(--deck-ink);
  display: flex;
  flex-direction: column;
}
.deck-mount {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 30px 44px;
  background: #e7e8df;
  border: 1px solid #dbdfd0;
  border-radius: 14px;
}
.deck-tile:nth-child(3n + 2) .deck-mount {
  background: #e5e7ec;
  border-color: #d9dce4;
}
.deck-tile:nth-child(3n + 3) .deck-mount {
  background: #eae2da;
  border-color: #e0d8d0;
}
.deck-art {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 3px;
  overflow: hidden;
  box-shadow:
    0 14px 18px -10px #20271e65,
    0 2px 4px #20271e24;
  transition: transform 0.22s;
}
.deck-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.deck-mount .deck-art {
  width: 100%;
  max-height: 100%;
}
.deck-number {
  position: absolute;
  bottom: 13px;
  left: 15px;
  font:
    11px ui-monospace,
    monospace;
  color: #777e6f;
}
.deck-tier {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 9px;
  font-weight: 600;
  padding: 5px 8px;
  border: 1px solid #ffffff9c;
  background: #ffffff70;
  color: #515b47;
  border-radius: 7px;
}
.deck-tier[data-tier="shiny"],
.detail-tier[data-tier="shiny"] {
  background: linear-gradient(115deg, #eed4f1, #cbf3e9, #f4e6c7);
}
.deck-tier[data-tier="gold"],
.detail-tier[data-tier="gold"] {
  background: linear-gradient(115deg, #d9b368, #fff0c7, #e6c67c);
}
.deck-tile-info {
  padding: 14px 2px 0;
  width: 100%;
}
.deck-tile-info strong {
  font-size: 16px;
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.25;
  display: block;
}
.deck-tile-info small {
  font-size: 11px;
  display: block;
  color: #73796d;
  margin-top: 6px;
  line-height: 1.4;
}
.deck-tile:hover .deck-art {
  transform: translateY(-4px) rotate(-1deg);
}
.deck-local-note {
  color: #868a7d;
  font-size: 10px;
  margin-top: 36px;
  text-align: center;
}
.deck-view-switcher {
  position: fixed;
  bottom: 94px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fffdf7e8;
  backdrop-filter: blur(16px);
  padding: 3px;
  border: 1px solid #dedfd4;
  border-radius: 22px;
  z-index: 34;
  box-shadow: 0 3px 15px #3845280d;
}
.deck-view-switcher span {
  min-width: 78px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
}
.deck-view-switcher button {
  border-radius: 50%;
  min-width: 40px;
  min-height: 40px;
  background: transparent;
  color: var(--deck-ink);
}
.deck-empty {
  min-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 30px 0;
  text-align: center;
}
.deck-empty h2 {
  font: 500 36px/1.1 var(--display);
  letter-spacing: -1.2px;
  margin: 24px 0 14px;
}
.deck-empty p {
  max-width: 320px;
  font-size: 14px;
  line-height: 1.65;
  color: #73796d;
  margin: 0 0 24px;
}
.deck-primary {
  background: var(--deck-ink);
  color: #f8faed;
  border-radius: 25px;
  padding: 15px 24px;
  min-height: 48px;
  font-size: 13px;
}
.empty-deck-art {
  position: relative;
  width: 160px;
  height: 155px;
}
.empty-deck-art span {
  position: absolute;
  width: 94px;
  height: 130px;
  border-radius: 5px;
  top: 8px;
  left: 30px;
  border: 1px solid #bfc6ab;
  background: #dce5c4;
  transform: rotate(-18deg) translateX(-18px);
  box-shadow: 0 6px 16px #192b2412;
}
.empty-deck-art span:nth-child(2) {
  transform: rotate(17deg) translateX(22px);
  background: #d8dded;
  border-color: #c0c9de;
}
.empty-deck-art span:last-child {
  display: grid;
  place-items: center;
  transform: rotate(-3deg);
  background: linear-gradient(145deg, #f2f7dc, #e6eaca, #f6f9e8);
  border-color: #c9d1b3;
}
.empty-deck-art svg {
  width: 35px;
  height: 35px;
  stroke: #747e56;
}
.deck-stack-view {
  text-align: center;
  padding-top: 12px;
}
.deck-fan {
  height: min(430px, 48vh);
  max-width: 360px;
  margin: 10px auto 20px;
  position: relative;
  touch-action: pan-y;
}
.deck-fan-card {
  position: absolute;
  inset: 0;
  background: transparent;
  padding: 0;
  display: flex;
  justify-content: center;
  transform: translate(calc(var(--depth)*18px), calc(var(--depth)*4px))
    rotate(calc(var(--depth)*7deg - 3deg));
  transform-origin: 50% 85%;
}
.deck-fan-card .deck-art {
  height: 100%;
  width: auto;
  background: #dfe5d2;
}
.deck-fan-card .deck-art img {
  width: auto;
  max-width: 100%;
}
.deck-stack-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 38px;
  font:
    11px ui-monospace,
    monospace;
  color: #78806d;
}
.deck-arrow {
  display: grid;
  place-items: center;
  background: #e5e7dd;
  border-radius: 50%;
  min-width: 44px;
  height: 44px;
  color: var(--deck-ink);
}
.deck-stack-view h2 {
  font: 500 28px var(--display);
  letter-spacing: -0.5px;
  margin: 16px 0 8px;
}
.deck-stack-view p {
  font-size: 12px;
  color: #777f6c;
}
.deck-event-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid #dadfd0;
}
.deck-event-heading h2 {
  font: 500 32px/1.08 var(--display);
  letter-spacing: -1px;
  margin: 12px 0;
}
.deck-event-heading p {
  font-size: 13px;
  line-height: 1.5;
  color: #73796d;
}
.deck-event-heading small {
  font-size: 11px;
  color: #73796d;
}
.deck-event-art {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.deck-event-art .deck-tile {
  width: 150px;
  flex-shrink: 0;
}
.deck-event-art .deck-mount {
  padding: 16px 16px 32px;
}
.deck-event-art .deck-tile-info {
  display: none;
}
.card-dialog {
  border: 0;
  border-radius: 26px;
  padding: 0;
  background: var(--deck-paper);
  color: var(--deck-ink);
  width: min(900px, 94vw);
  max-width: none;
  max-height: 92dvh;
  overflow: auto;
  box-shadow: 0 25px 120px #15221450;
}
.card-dialog::backdrop {
  background: #11180fd0;
  backdrop-filter: blur(10px);
}
.card-dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  position: sticky;
  top: 0;
  background: #f4f2ebee;
  z-index: 5;
  backdrop-filter: blur(14px);
}
.card-detail-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}
.card-art-column {
  min-width: 0;
  padding: 12px 28px 28px;
}
.detail-artwork {
  height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: #e1e5da;
  border-radius: 14px;
}
.detail-artwork .deck-art {
  height: 100%;
  max-width: 100%;
}
.detail-artwork .deck-art img {
  width: auto;
  max-width: 100%;
}
.detail-artwork.show-original .foil-surface::after,
.detail-artwork.show-original .foil-surface::before {
  display: none;
}
.card-art-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 15px;
}
.deck-text-button {
  min-height: 44px;
  background: transparent;
  font-size: 12px;
  color: #626d53;
}
.card-information {
  padding: 24px 28px 28px 4px;
}
.detail-tier {
  display: inline-block;
  font-size: 10px;
  padding: 7px 11px;
  border: 1px solid #d4d9c8;
  background: #e8ecdf;
  border-radius: 8px;
}
.card-information h2 {
  font: 500 38px/1.06 var(--display);
  letter-spacing: -1.2px;
  margin: 20px 0 16px;
  overflow-wrap: anywhere;
}
.card-information p {
  font-size: 13px;
  line-height: 1.5;
  margin: 8px 0;
  color: #646f57;
}
.card-information .detail-status {
  font-size: 10px;
  color: #8b907e;
  margin: 18px 0;
}
.detail-variants {
  border-top: 1px solid #dce0d0;
  padding-top: 16px;
}
.detail-variants h3 {
  font-size: 12px;
  font-weight: 500;
}
#variantCards {
  display: flex;
  gap: 12px;
  overflow: auto;
  padding: 4px;
}
.variant-card {
  background: transparent;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  height: 108px;
  min-width: 70px;
}
.variant-card[aria-pressed="true"] {
  border-color: #414b31;
}
.variant-card .deck-art {
  height: 100%;
}
.card-provenance {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 26px 0 14px;
  border-top: 1px solid #dce0d0;
  padding-top: 20px;
}
.card-provenance span {
  font-size: 8px;
  letter-spacing: 1.6px;
  color: #8b907e;
}
.card-provenance strong {
  font-size: 12px;
  font-weight: 500;
}
.deck-remove {
  min-height: 44px;
  padding: 8px 0;
  font-size: 11px;
  background: transparent;
  color: #996252;
}
.deck-undo {
  position: fixed;
  z-index: 90;
  bottom: 158px;
  left: 50%;
  transform: translateX(-50%);
  background: #252b22;
  color: #fff;
  border-radius: 18px;
  display: flex;
  align-items: center;
  padding: 8px 10px 8px 20px;
  gap: 12px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 8px 25px #1c281e30;
}
.deck-undo button {
  background: transparent;
  color: var(--deck-accent);
  min-height: 44px;
  padding: 8px;
}
.toast {
  z-index: 100;
  bottom: 158px;
}
@media (min-width: 1200px) {
  .deck-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 780px) {
  .viewing-deck .topbar {
    height: 76px;
    padding: 0 22px;
  }
  .deck-page {
    padding: 6px 22px 95px;
  }
  .deck-header {
    padding: 14px 0 28px;
    align-items: center;
  }
  .deck-eyebrow {
    font-size: 8px;
    letter-spacing: 1.2px;
  }
  .deck-header h1 {
    font-size: 60px;
    letter-spacing: -3.5px;
    margin: 10px 0 12px;
  }
  .deck-header h1 span {
    font-size: 11px;
    margin-top: 8px;
  }
  .deck-header p {
    font-size: 11px;
  }
  .deck-scan-fab {
    border-radius: 50%;
    width: 54px;
    height: 54px;
    padding: 0;
    justify-content: center;
    flex-shrink: 0;
  }
  .deck-scan-fab span,
  .deck-scan-fab b {
    display: none;
  }
  .deck-tools {
    gap: 6px;
    margin-bottom: 22px;
    padding: 10px 0;
  }
  .deck-search {
    gap: 7px;
  }
  .deck-search input {
    font-size: 11px;
  }
  .deck-tools select {
    max-width: 112px;
    font-size: 11px;
  }
  .deck-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 14px;
  }
  .deck-mount {
    padding: 19px 15px 34px;
    border-radius: 10px;
  }
  .deck-number {
    font-size: 8px;
    left: 10px;
    bottom: 12px;
  }
  .deck-tier {
    font-size: 7px;
    right: 8px;
    padding: 4px 6px;
  }
  .deck-tile-info {
    padding-top: 10px;
  }
  .deck-tile-info strong {
    font-size: 15px;
  }
  .deck-tile-info small {
    font-size: 10px;
  }
  .deck-fan {
    width: 72%;
    height: 350px;
    max-height: 44vh;
    margin-top: 16px;
  }
  .deck-event-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 0 24px;
  }
  .deck-event-heading h2 {
    font-size: 30px;
  }
  .deck-event-heading p {
    margin: 7px 0;
  }
  .deck-event-art .deck-tile {
    width: 138px;
  }
  .card-dialog {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-height: 95dvh;
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .card-dialog-top {
    padding: 10px 18px;
  }
  .card-detail-layout {
    grid-template-columns: 1fr;
  }
  .card-art-column {
    padding: 4px 22px 0;
  }
  .detail-artwork {
    height: 310px;
    max-height: 39dvh;
    padding: 20px 28px;
  }
  .card-information {
    padding: 18px 24px 25px;
  }
  .card-information h2 {
    font-size: 34px;
    margin: 14px 0 12px;
  }
  .card-information .detail-status {
    margin: 14px 0;
  }
  .deck-empty {
    min-height: 400px;
  }
  .deck-empty h2 {
    font-size: 30px;
  }
  .deck-empty p {
    font-size: 13px;
  }
  .stack-dock {
    bottom: 92px;
    right: 16px;
  }
  .collection-heading {
    align-items: flex-start;
    gap: 12px;
  }
  #saveAll {
    max-width: 150px;
    text-align: right;
  }
}
@media (prefers-reduced-motion: reduce) {
  .deck-art {
    transition: none;
  }
  .deck-tile:hover .deck-art {
    transform: none;
  }
}
/* Keep shelf rows aligned while preserving every poster's aspect ratio. */
.deck-mount {
  contain: size;
}
.deck-mount .deck-art {
  width: auto;
  height: 100%;
  max-width: 100%;
}
