/* The Wall. Loaded after style.css, which supplies the tokens, header and footer.
   World: wanted posters pinned on a wall at night. Heat is material: a cold
   theme is plain paper, a hot one gets a foil frame, and the most wanted one
   sits under a slow red-and-blue light. */
.wall-page {
  --paper: #ece3cd;
  --p-ink: #141a30;
  --p-ink-2: #4b5069;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
.wall-page::before { display: none; }
.w-top { border-bottom: 0; padding-bottom: 6px; flex-wrap: nowrap; }
.w-top .token { gap: 8px; flex-wrap: nowrap; }
@media (max-width: 520px) {
  .w-top .brand { font-size: 1.05rem; gap: 8px; }
  .w-top .brand img { width: 30px; height: 30px; }
  .w-top .xlink, .w-top .buy { padding: 0 12px; font-size: 0.95rem; }
  .w-intro { padding-top: 4px; gap: 10px; }
  .w-intro h1 { font-size: 1.9rem; }
  .w-lede { margin-top: 4px; font-size: 0.95rem; line-height: 1.4; }
  .w-controls { gap: 8px 14px; }
  .w-controls .chains button { min-height: 44px; padding: 0 14px; }
}

.w-intro { display: flex; align-items: end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding: clamp(10px, 3vw, 36px) 0 clamp(12px, 2vw, 22px); }
.w-intro h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1; font-weight: 850; font-stretch: 72%; letter-spacing: -0.015em; }
.w-lede { margin: 8px 0 0; color: var(--muted); max-width: 52ch; }
.w-controls { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; }
.w-controls .status { margin: 0; }

.news { margin: 0 0 16px; padding: 10px 14px; border: 1px solid #4a3a1a; border-radius: var(--radius); background: rgba(255, 176, 0, 0.07); font-weight: 600; }

/* ---------- poster ---------- */
.wall { list-style: none; margin: 0; padding: 0; }
.poster { position: relative; container-type: inline-size; aspect-ratio: 4 / 5; width: 100%; }
.paper {
  position: absolute; inset: 0; overflow: hidden; border-radius: 1.2cqw;
  padding: 7cqw 7.5cqw 5.6cqw; display: flex; flex-direction: column; align-items: center; text-align: center;
  color: var(--p-ink);
  background:
    radial-gradient(ellipse at 50% 46%, transparent 52%, rgba(120, 92, 40, 0.2) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .28 0 0 0 0 .14 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper);
  box-shadow: 0 3cqw 7cqw -2.5cqw rgba(0, 0, 0, 0.7), 0 0.5cqw 1.2cqw rgba(0, 0, 0, 0.4);
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s var(--ease), filter 0.4s;
}
/* the printed double frame */
.paper::before { content: ""; position: absolute; inset: 2.6cqw; border: 0.55cqw solid var(--p-ink); outline: 0.18cqw solid var(--p-ink); outline-offset: -1.5cqw; pointer-events: none; }
.paper > * { position: relative; }

.p-head { margin: 0; align-self: stretch; font-weight: 900; font-stretch: 125%; text-transform: uppercase; letter-spacing: 0.05em; line-height: 1; white-space: nowrap;
  font-size: calc(9cqw * var(--fit-head, 1)); padding: 2.2cqw 0 2cqw; border-bottom: 0.45cqw solid var(--p-ink); }
.poster[data-top] .p-head { background: var(--p-ink); color: var(--paper); border-bottom: 0; }
.p-name { margin: 4.2cqw 0 0; font-weight: 900; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; line-height: 0.92; text-wrap: balance;
  font-size: calc(var(--name-size, 24cqw) * var(--fit-name, 1)); }
.p-name { align-self: stretch; }
.p-name:not(.long) { white-space: nowrap; }
.p-name.long { --name-size: 12.4cqw; }
.p-stars { display: flex; gap: 1.6cqw; margin: 4cqw 0 3.2cqw; }
.p-stars svg { width: 12.2cqw; height: 12.2cqw; flex: none; stroke: var(--p-ink); stroke-width: 1.15; stroke-linejoin: round; fill: none; }
.p-stars svg.on { fill: var(--s); }
.p-stars svg.off { stroke-opacity: 0.32; }
.poster[data-kind="thin"] .p-stars svg, .poster[data-kind="empty"] .p-stars svg { stroke-dasharray: 2 2.4; stroke-opacity: 0.4; }
.p-charge { margin: 0; font-size: 6.1cqw; line-height: 1.15; font-weight: 800; text-wrap: balance; }
.p-sub { margin: 1cqw 0 0; font-size: 4.1cqw; line-height: 1.3; color: var(--p-ink-2); font-weight: 550; font-variant-numeric: tabular-nums; }
.p-coins { margin-top: auto; align-self: stretch; border-top: 0.4cqw solid var(--p-ink); padding-top: 1.8cqw; text-align: left; }
.p-coins p { margin: 0 0 0.6cqw; font-size: 3.7cqw; color: var(--p-ink-2); font-weight: 600; }
.p-coins div { display: flex; justify-content: space-between; gap: 3cqw; font-size: 4.5cqw; line-height: 1.42; font-weight: 750; font-variant-numeric: tabular-nums; }
.p-coins div span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-foot { margin: 2.2cqw 0 0; font-size: 3.6cqw; line-height: 1.35; color: var(--p-ink-2); font-weight: 550; }
.p-foot b { color: var(--p-ink); font-weight: 750; }
.poster:not(:has(.p-coins)) .p-foot { margin-top: auto; }

/* themes without stars read as faded paper */
.poster[data-kind="thin"] .paper, .poster[data-kind="empty"] .paper { filter: saturate(0.55) brightness(0.86); }
.poster[data-kind="thin"] .p-head, .poster[data-kind="empty"] .p-head { color: var(--p-ink-2); border-color: var(--p-ink-2); }

/* heat as material: a foil frame that turns with the light */
.p-foil, .p-glare, .p-light { position: absolute !important; pointer-events: none; }
.p-foil { inset: 2.6cqw; padding: 0.95cqw; opacity: var(--shine, 0);
  background: conic-gradient(from calc(var(--mx, 50) * 3.6deg + 40deg), #ffb000, #f05050, #aa50dc, #6e64f0, #35c3d6, #ffe27a, #ffb000);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.p-glare { inset: 0; mix-blend-mode: soft-light; opacity: calc(0.2 + var(--shine, 0) * 0.7);
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.85) 49%, transparent 64%) calc(var(--mx, 50) * 1%) 0 / 260% 100% no-repeat; }
/* the most wanted poster sits under a slow red-and-blue light (about 0.36 Hz, never a strobe) */
.p-light { inset: 0; mix-blend-mode: multiply; display: none; }
.poster[data-top] .p-light { display: block; }
.p-light::before, .p-light::after { content: ""; position: absolute; top: -30%; width: 95%; height: 95%; border-radius: 50%; animation: siren 2.8s ease-in-out infinite; }
.p-light::before { left: -38%; background: radial-gradient(closest-side, rgba(255, 70, 70, 0.75), transparent); }
.p-light::after { right: -38%; background: radial-gradient(closest-side, rgba(70, 110, 255, 0.8), transparent); animation-delay: -1.4s; }
@keyframes siren { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.95; } }

/* phones without a tilt sensor: the foil drifts by itself on the poster in view */
@property --mx { syntax: "<number>"; inherits: true; initial-value: 50; }
.wall.drift .slot.is-active .poster { animation: sheen 5s ease-in-out infinite alternate; }
@keyframes sheen { from { --mx: 12; } to { --mx: 88; } }

/* a star that just went up */
.poster.leveled .p-stars svg.on { animation: level 0.7s var(--ease) both; animation-delay: calc(var(--i) * 110ms); }
@keyframes level { from { transform: scale(0.5) rotate(-18deg); fill: transparent; } 60% { transform: scale(1.22); } to { transform: none; } }

.p-rank { position: absolute; z-index: 2; left: -2.4cqw; top: -2.4cqw; width: 10.5cqw; height: 10.5cqw; border-radius: 50%; display: grid; place-items: center;
  background: var(--p-ink); color: var(--paper); border: 0.5cqw solid var(--paper); font-weight: 900; font-stretch: 110%; font-size: 5.6cqw; line-height: 1; font-variant-numeric: tabular-nums;
  box-shadow: 0 1cqw 2cqw -0.5cqw rgba(0, 0, 0, 0.6); }
.p-rank:empty { display: none; }
.poster[data-top] .p-rank { background: var(--hot); color: #1a1100; }
.p-pick { position: absolute; inset: 0; z-index: 3; border: 0; background: transparent; border-radius: 1.2cqw; cursor: pointer; }
.poster:focus { outline: none; }
.poster:focus-visible .paper { outline: 3px solid var(--hot); outline-offset: 5px; }
.p-pick:focus-visible { outline: 3px solid var(--hot); outline-offset: 4px; }
.pin { position: absolute; z-index: 4; left: 50%; top: -1.6cqw; width: 5cqw; height: 5cqw; margin-left: -2.5cqw; border-radius: 50%; display: none;
  background: radial-gradient(circle at 35% 30%, #ffe9a8, #ffb000 45%, #9a6500); box-shadow: 0 1.2cqw 1.6cqw -0.3cqw rgba(0, 0, 0, 0.6); }

/* loading: blank paper developing */
.skel .paper { background: linear-gradient(100deg, #1d2440 30%, #2a3358 50%, #1d2440 70%) 0 0 / 220% 100%; animation: shimmer 1.5s linear infinite; box-shadow: none; }
.skel .paper::before { border-color: #2e3556; outline-color: #2e3556; }

/* ---------- phone: a deck you swipe ---------- */
.w-layout { display: block; }
.wall { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
  margin: 0 calc(-1 * clamp(16px, 4vw, 48px)); padding: 14px max(8vw, calc(50vw - 210px)) 22px; }
.wall::-webkit-scrollbar { display: none; }
.slot { flex: none; width: 84vw; max-width: 420px; scroll-snap-align: center; scroll-snap-stop: always; }
.slot .poster { transition: transform 0.4s var(--ease), opacity 0.4s; transform: scale(0.94); opacity: 0.72; }
.slot.is-active .poster { transform: none; opacity: 1; }
.stage-slot { display: none; }
.pager { display: flex; justify-content: center; gap: 2px; margin: -6px 0 4px; }
.pager button { width: 26px; height: 32px; border: 0; background: transparent; padding: 0; display: grid; place-items: center; }
.pager button::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: #3a4266; transition: width 0.3s var(--ease), background 0.3s; }
.pager button[aria-pressed="true"]::before { width: 22px; background: var(--hot); }
.actions { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  margin: 0 calc(-1 * clamp(16px, 4vw, 48px)); padding-left: clamp(16px, 4vw, 48px); padding-right: clamp(16px, 4vw, 48px); background: var(--ink); border-top: 1px solid var(--line); }
.act { min-height: 50px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-weight: 750; transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s; }
.act:hover:not(:disabled) { border-color: #59618a; }
.act:active:not(:disabled) { transform: scale(0.98); }
.act.primary { background: var(--hot); border-color: var(--hot); color: #1a1100; }
.act:disabled { opacity: 0.5; cursor: default; }
#save { display: none; }
.dossier { display: none; }

/* coin list (sheet on phones, panel on desktop) */
.coin-list { list-style: none; margin: 0; padding: 0; }
.coin-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 4px 0; border-bottom: 1px solid rgba(42, 49, 80, 0.7); font-variant-numeric: tabular-nums; }
.coin-list a.c-name { display: grid; min-height: 46px; align-content: center; text-decoration: none; line-height: 1.2; min-width: 0; }
.coin-list a.c-name b, .coin-list a.c-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-list small { color: var(--muted); font-size: 0.8rem; }
.coin-list .c-vol { font-weight: 700; text-align: right; display: grid; line-height: 1.2; }
.coin-list a.c-trade { min-height: 40px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 0.85rem; }
.coin-note { color: var(--muted); font-size: 0.85rem; margin: 10px 0 0; }
.sheet { width: min(100%, 560px); max-width: 100%; margin: auto auto 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; background: var(--panel); color: var(--text); max-height: 82vh; }
.sheet::backdrop { background: rgba(5, 7, 15, 0.7); }
.sheet[open] { animation: rise 0.35s var(--ease); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sheet-head h2 { font-size: 1.25rem; }

/* ---------- desktop: one poster up close, the rest on the wall ---------- */
@media (min-width: 900px) {
  .w-layout { display: grid; grid-template-columns: minmax(330px, 430px) minmax(0, 1fr); grid-template-areas: "stage wall"; gap: clamp(28px, 4vw, 56px); align-items: start; padding-bottom: 40px; }
  .stage { grid-area: stage; position: sticky; top: 18px; }
  .stage-slot { display: block; width: min(100%, calc((100vh - 330px) * 0.8)); min-width: 280px; margin: 8px auto 0; }
  .wall { grid-area: wall; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 38px 30px; overflow: visible; margin: 0; padding: 14px 6px 0; }
  .slot { width: auto; max-width: none; }
  .slot .poster { --lit: 0.45; transform: rotate(var(--tilt, 0deg)); opacity: 1; animation: none !important; filter: brightness(calc(0.72 + var(--lit, 0) * 0.3)); transition: transform 0.4s var(--ease), filter 0.25s; }
  .slot:nth-child(4n + 1) { --tilt: -1.3deg; } .slot:nth-child(4n + 2) { --tilt: 0.9deg; } .slot:nth-child(4n + 3) { --tilt: -0.5deg; } .slot:nth-child(4n) { --tilt: 1.4deg; }
  .slot .poster:hover, .slot .poster:focus-within { transform: rotate(0deg) translateY(-4px) scale(1.03); filter: brightness(1.04); }
  .pin { display: block; }
  .stage-slot .p-pick { display: none; }
  .pager { display: none; }
  .actions { position: static; grid-template-columns: 1fr 1fr 1fr; margin: 22px 0 0; padding: 0; background: none; border: 0; }
  #save { display: block; }
  #coins { display: none; }
  .actions { grid-template-columns: 1.4fr 1fr; }
  .dossier { display: block; margin-top: 18px; }
  .dossier h2 { font-size: 1.05rem; margin-bottom: 4px; }
  /* small posters on the wall drop the fine print; open one to read it */
  @container (max-width: 300px) {
    .p-coins, .p-foot, .p-sub { display: none; }
    .p-charge { font-size: 7.4cqw; margin-top: auto; padding-bottom: 3cqw; }
    .p-stars svg { width: 13cqw; height: 13cqw; }
    .p-name { margin-top: 7cqw; }
  }
  /* the searchlight follows the pointer across the wall */
  .beam { position: fixed; left: 0; top: 0; width: 760px; height: 760px; margin: -380px 0 0 -380px; border-radius: 50%; pointer-events: none; z-index: 0;
    background: radial-gradient(closest-side, rgba(255, 240, 200, 0.13), rgba(255, 240, 200, 0.05) 55%, transparent); transform: translate3d(var(--bx, 70vw), var(--by, 40vh), 0); }
  main, footer, header { position: relative; z-index: 1; }
}
::view-transition-group(*) { animation-duration: 0.55s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; }

@media (prefers-reduced-motion: reduce) {
  .p-light::before, .p-light::after { opacity: 0.45; }
  .wall.drift .slot.is-active .poster { animation: none; }
  .paper { transform: none !important; }
}
