/* Set Binder. Gold on these screens is #E8C478. The rest of the app is unchanged. */
.binder-root {
  --bg: #0a0e1a;
  --bg2: #0f1526;
  --card: #141c2e;
  --ink: #060810;
  --gold: #E8C478;
  --goldhi: #F6E2B0;
  --golddeep: #B8913F;
  --text: #f0f4ff;
  --muted: #8892aa;
  color: var(--text);
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  overflow-x: hidden;
  max-width: 100%;
}
html:has(body.binder-screen) {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
}
body.binder-screen {
  background: #060810;
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body.binder-screen .ticker-section,
body.binder-screen #betaBanner,
body.binder-screen .sidebar,
body.binder-screen .topbar,
body.binder-screen .pwa-install-banner,
body.binder-screen .feedback-fab,
body.binder-screen .pwa-update-toast {
  display: none !important;
}
body.binder-screen .app-shell {
  display: block !important;
  height: auto;
  min-height: 100vh;
  overflow: visible;
}
body.binder-screen .main-content {
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0 !important;
  height: auto;
  overflow: visible;
}
body.binder-screen #page-portfolio {
  max-width: none;
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at 50% 30%, #0f1526, #0a0e1a 55%, #060810);
  min-height: 100vh;
}
body.binder-screen.binder-sets #page-portfolio > *:not(#binderRoot),
#page-portfolio.binder-sets > *:not(#binderRoot) { display: none !important; }

.binder-wrap { position: relative; max-width: 1240px; margin: 0 auto; padding: 22px 28px 18px; }
.binder-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.binder-logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--text);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.binder-logo span { color: var(--gold); }
.binder-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 196, 120, 0.22);
  border-radius: 10px;
  padding: 3px;
}
.binder-tabs button {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 7px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
}
.binder-tabs button[aria-selected="true"] { background: var(--gold); color: var(--ink); }

.binder-sethead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 18px 0 14px;
  gap: 16px;
  flex-wrap: wrap;
}
.binder-sethead h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 30px;
  margin: 0;
  line-height: 1.05;
  color: var(--text);
}
.binder-sethead h1 small {
  display: block;
  margin-top: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.04em;
}
.binder-stats { display: flex; gap: 22px; align-items: flex-end; }
.binder-stat b { display: block; font-size: 20px; color: var(--gold); font-weight: 700; }
.binder-stat span { font-size: 11px; color: var(--muted); }
.binder-bar {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  width: 220px;
  overflow: hidden;
  margin-top: 6px;
}
.binder-bar i {
  display: block;
  height: 100%;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}
.binder-spread-wrap { position: relative; }
.binder-spread {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: linear-gradient(180deg, #121a2c, #0b1120);
  border: 1px solid rgba(232, 196, 120, 0.35);
  border-radius: 16px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  perspective: 1600px;
}
.binder-spread.is-leafing { overflow: hidden; }
.binder-spread:before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 26px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.binder-page {
  position: relative;
  transform-style: preserve-3d;
  min-width: 0;
}
.binder-page-front {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 12px;
  row-gap: 34px;
  padding: 20px 20px 24px;
  backface-visibility: hidden;
  transform: rotateY(0deg);
}
.binder-slot {
  min-width: 0;
}
.binder-page-back {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0) 22%),
    linear-gradient(180deg, #18233a, #080c18);
  border: 1px solid rgba(232, 196, 120, 0.28);
  box-shadow: inset 18px 0 28px rgba(0, 0, 0, 0.35);
  transform: rotateY(180deg);
  backface-visibility: hidden;
}
.binder-page.is-turn-next,
.binder-page.is-turn-prev {
  z-index: 3;
  animation-duration: 0.7s;
  animation-timing-function: ease;
  animation-fill-mode: forwards;
}
.binder-page.is-turn-next { animation-name: binderTurnNext; transform-origin: left center; }
.binder-page.is-turn-prev { animation-name: binderTurnPrev; transform-origin: right center; }
@keyframes binderTurnNext {
  0% { transform: rotateY(0deg); box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
  40% { box-shadow: -28px 10px 36px rgba(0, 0, 0, 0.55); }
  100% { transform: rotateY(-180deg); box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
}
@keyframes binderTurnPrev {
  0% { transform: rotateY(0deg); box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
  40% { box-shadow: 28px 10px 36px rgba(0, 0, 0, 0.55); }
  100% { transform: rotateY(180deg); box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .binder-page.is-turn-next,
  .binder-page.is-turn-prev { animation: none; }
}
.binder-pocket {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(232, 196, 120, 0.16);
  overflow: visible;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.binder-pocket:after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 38%);
  pointer-events: none;
}
.binder-pocket img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: #0b1120;
}
.binder-pocket.is-empty img { filter: grayscale(1) brightness(0.42) contrast(0.9); opacity: 0.55; }
.binder-back {
  position: absolute;
  inset: 7px;
  border-radius: 6px;
  background: #121826;
  box-shadow: inset 0 0 0 2px #E8C478, inset 0 0 0 6px #0c1018;
  z-index: 0;
  pointer-events: none;
}
.binder-back:before {
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 28%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid #E8C478;
  border-radius: 2px;
}
.binder-slab .binder-back { top: 24px; left: 7px; right: 7px; bottom: 7px; }
.binder-raw-badge {
  position: absolute;
  left: 50%;
  bottom: 6px;
  z-index: 3;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 16px;
  max-width: calc(100% - 8px);
  padding: 0 6px;
  white-space: nowrap;
  text-align: center;
  line-height: 1;
  font-size: 9px;
  font-weight: 800;
  color: #E8C478;
  border: 1px solid rgba(232, 196, 120, 0.45);
  border-radius: 999px;
  background: rgba(12, 16, 24, 0.82);
  pointer-events: none;
}
.binder-pocket.is-raw img { border-radius: 5px; }
.binder-pocket.is-raw {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #243044, #141c2e);
  box-shadow: inset 0 0 0 1px rgba(232, 196, 120, 0.28);
}
.binder-bignum {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  color: rgba(240, 244, 255, 0.72);
  text-shadow: 0 2px 8px #000;
  pointer-events: none;
}
.binder-slab {
  position: absolute;
  inset: -3px;
  border-radius: 9px;
  border: 2px solid var(--gold);
  background: #0b1120;
  padding: 22px 5px 5px;
  box-shadow: 0 0 18px rgba(232, 196, 120, 0.25);
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.binder-slab img {
  top: 22px;
  right: auto;
  bottom: auto;
  left: 5px;
  width: calc(100% - 10px);
  height: calc(100% - 27px);
  object-fit: cover;
  border-radius: 4px;
  pointer-events: none;
}
.binder-slablabel {
  position: absolute;
  top: 3px;
  left: 5px;
  right: 5px;
  height: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  background: var(--ink);
  border-top: 1.5px solid var(--gold);
  border-radius: 3px;
  padding: 0 5px;
}
.binder-slablabel b {
  color: var(--gold);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.binder-slablabel span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 14px;
  min-width: 1.5rem;
  padding: 0 4px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  border-radius: 3px;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.binder-slablabel:has(span.is-long) {
  left: 2px;
  right: 2px;
  padding: 0 2px;
}
.binder-slablabel span.is-long {
  font-size: 8px;
  padding: 0 2px;
  letter-spacing: -0.03em;
}
.binder-num {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 2;
  left: 0;
  right: 0;
  height: 14px;
  line-height: 14px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}
.binder-count {
  position: absolute;
  top: -8px;
  right: -6px;
  z-index: 4;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  font-size: 10px;
  border-radius: 8px;
  padding: 1px 5px;
}
.binder-pocket.is-tapped { outline: 2px solid var(--gold); outline-offset: 2px; z-index: 3; }
.binder-pop {
  position: absolute;
  left: 0;
  top: 0;
  width: 240px;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  background: rgba(20, 28, 46, 0.98);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  z-index: 30;
  pointer-events: auto;
}
.binder-pop .pt { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 16px; }
.binder-pop .pt span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--gold);
  margin-left: 4px;
  font-weight: 600;
}
.binder-pop .pr { font-size: 11px; color: var(--muted); margin-top: 4px; }
.binder-pop .pv { font-size: 14px; color: var(--gold); margin-top: 8px; font-weight: 700; }
.binder-pop .pn { font-size: 10px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.binder-pop button {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(232, 196, 120, 0.5);
  color: var(--gold);
  font-family: inherit;
  font-weight: 700;
  font-size: 11px;
  border-radius: 8px;
  padding: 7px;
  cursor: pointer;
}
.binder-pop button:disabled { opacity: 0.4; cursor: default; }
.binder-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(232, 196, 120, 0.45);
  background: rgba(10, 14, 26, 0.8);
  color: var(--gold);
  cursor: pointer;
  z-index: 4;
}
.binder-arrow.prev { left: -6px; }
.binder-arrow.next { right: -6px; }
.binder-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  font-size: 11px;
  color: var(--muted);
}
.binder-dots i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 3px;
}
.binder-dots i.on { background: var(--gold); }
.binder-legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--muted);
  align-items: center;
  flex-wrap: wrap;
}
.binder-sw {
  display: inline-block;
  width: 18px;
  height: 24px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 6px;
  position: relative;
  overflow: hidden;
}
.binder-sw.s { border: 2px solid var(--gold); background: #0b1120; }
.binder-sw.r {
  width: 28px;
  height: 40px;
  border: 1px solid rgba(232, 196, 120, 0.4);
  background: linear-gradient(135deg, #2a3550, #141c2e);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.binder-sw.r img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.binder-sw.r:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 46%);
}
.binder-sw.e { background: rgba(136, 146, 170, 0.25); }
.binder-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; margin-top: 22px; }
.binder-tile {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: auto;
  min-width: 0;
  text-align: left;
  background: linear-gradient(180deg, #121a2c, #0b1120);
  border: 1px solid rgba(232, 196, 120, 0.45);
  border-radius: 16px;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.binder-tile:hover,
.binder-tile:focus-visible {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px #E8C478, 0 0 28px rgba(232, 196, 120, 0.35);
  outline: none;
}
.binder-tile:focus-visible { outline: 2px solid #E8C478; outline-offset: 3px; }
.binder-tile:active { transform: translateY(1px) scale(0.985); }
.binder-tile.is-attention { animation: binderCoverPulse 1.6s ease 1; }
.binder-tile.is-locked {
  cursor: default;
  filter: grayscale(1) brightness(0.62);
}
.binder-tile.is-locked:hover,
.binder-tile.is-locked:active { transform: none; box-shadow: none; }
.binder-cover {
  position: relative;
  display: block;
  margin: 10px 10px 0;
  border-radius: 12px;
  border: 2px solid #E8C478;
  background: #0b1120;
  box-shadow: inset 0 0 0 1px rgba(232, 196, 120, 0.35), 0 12px 28px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.binder-cover.is-empty { aspect-ratio: 63 / 88; }
.binder-cover img {
  position: relative;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center center;
  display: block;
}
.binder-cover-foil {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 32%, rgba(246, 226, 176, 0.55) 50%, rgba(255, 255, 255, 0) 68%);
  transform: translateX(-130%);
  animation: binderFoil 1.15s ease 0.2s 1 both;
  pointer-events: none;
}
.binder-tile.is-locked .binder-cover-foil { animation: none; opacity: 0; }
.binder-cover-book {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 42px;
  height: 42px;
  padding: 8px;
  border-radius: 50%;
  background: rgba(6, 8, 16, 0.78);
  border: 1px solid #E8C478;
  color: #E8C478;
  box-shadow: 0 0 16px rgba(232, 196, 120, 0.45);
}
.binder-open-pill {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 20px);
  padding: 6px 10px;
  border-radius: 999px;
  background: #E8C478;
  color: #0b1120;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.binder-open-pill svg { width: 12px; height: 12px; flex: none; }
.binder-tile-copy { display: block; padding: 14px 16px 16px; }
@keyframes binderFoil {
  from { transform: translateX(-130%); }
  to { transform: translateX(130%); }
}
@keyframes binderCoverPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 196, 120, 0); }
  45% { box-shadow: 0 0 0 3px rgba(232, 196, 120, 0.7), 0 14px 36px rgba(232, 196, 120, 0.28); }
}
@media (prefers-reduced-motion: reduce) {
  .binder-tile,
  .binder-cover-foil,
  .binder-tile.is-attention { animation: none; transition: none; }
  .binder-cover-foil { opacity: 0; }
  .binder-tile:hover,
  .binder-tile:focus-visible,
  .binder-tile:active { transform: none; }
}
.binder-tile strong { display: block; font-family: 'Outfit', sans-serif; font-size: 18px; margin-bottom: 8px; }
.binder-tile b { color: var(--gold); font-size: 16px; }
.binder-note { margin-top: 10px; color: var(--muted); font-size: 12px; }
.binder-chip {
  display: inline-block;
  margin-top: 8px;
  border: 1px solid rgba(232, 196, 120, 0.45);
  color: var(--gold);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
}
.binder-draft, .binder-attr {
  margin-top: 16px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.45;
}
.binder-draft { text-align: right; opacity: 0.7; padding-right: 8px; }
.binder-secret {
  margin-top: 18px;
  color: var(--gold);
  font-size: 12px;
}
.binder-unlock {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #060810;
}
.binder-unlock canvas { display: block; width: 100%; height: 100%; }
.binder-unlock.is-reduce { animation: binderFade 0.5s ease; }
@keyframes binderFade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 700px) {
  .binder-wrap { padding: 16px 16px 20px; }
  .binder-spread { grid-template-columns: 1fr; }
  .binder-spread:before { display: none; }
  .binder-page + .binder-page { display: none; }
  .binder-page-front { column-gap: 9px; row-gap: 32px; padding: 14px 14px 22px; }
  .binder-sethead h1 { font-size: 24px; }
  .binder-stats { gap: 14px; }
  .binder-bar { width: 150px; }
  .binder-pop {
    max-width: calc(100vw - 24px);
  }
  .binder-bignum { font-size: 18px; }
  .binder-logo { font-size: 20px; }
  .binder-tabs button { padding: 6px 10px; font-size: 11px; }
  .binder-pager .binder-dots, .binder-pager .binder-range { display: none; }
  .binder-arrow { display: none; }
  .binder-legend { flex-direction: column; align-items: flex-start; gap: 8px; }
}
