/* Tributes — player photos as pegged polaroids. Same palette as ../live/live.css so it reads as one site. */

@font-face {
  font-family: "Big Shoulders Display"; font-weight: 900; font-style: normal; font-display: swap;
  src: url("../fonts/big-shoulders-display-900.woff2") format("woff2");
}
@font-face {
  font-family: "Silkscreen"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/silkscreen-400.woff2") format("woff2");
}
@font-face {
  font-family: "Caveat"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/caveat-600.woff2") format("woff2");
}

:root {
  --bg: #151816;
  --line: #3a413b;
  --ink: #e4e8e1;
  --muted: #99a397;
  --link: #8cc45e;
  --paper: #f4f1ea;
  --paper-shade: #e2ddd2;
  --pen: #2b2f3a;
  --string: #b9a98a;
  --peg: #c49a63;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--ink); font: 16px/1.6 var(--sans); background: var(--bg); overflow: hidden; overscroll-behavior: none;
  display: flex; flex-direction: column; /* nav, title, then the lines fill the rest */
}
.site-nav { flex: none; border-bottom: 1px solid var(--line); } /* the nav ends here; the gallery (title included) starts below */
/* The gallery's title, laid over the top of the lines (not part of the nav): the site's display face and
   the live dot, on a dark fade so it reads over the photos. Clicks pass through to the prints. */
.gallery-head {
  position: absolute; z-index: 6; top: 0; left: 0; right: 0; padding: 18px 24px 56px; pointer-events: none;
  background: linear-gradient(rgba(12, 14, 12, .92), rgba(12, 14, 12, .72) 55%, rgba(12, 14, 12, 0));
}
.gallery-head h1 {
  margin: 0; display: flex; align-items: center; gap: .3em;
  font: 900 clamp(34px, 6vw, 64px)/.95 var(--display); text-transform: uppercase; letter-spacing: .01em;
}
.gallery-head .live-dot { width: .22em; height: .22em; }
.gallery-lede { margin: 6px 0 0; max-width: 62ch; color: var(--muted); font-size: clamp(14px, 1.6vw, 17px); line-height: 1.45; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--link); }
/* The stage: the rest of the page — three tilted washing lines, moved by tributes.js (drift + scroll gestures). */
.stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden; isolation: isolate; touch-action: none;
  background: radial-gradient(90% 70% at 50% 35%, #2a302a, #0c0e0c 80%);
}
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: linear-gradient(90deg, rgba(12, 14, 12, .87), transparent 10%, transparent 90%, rgba(12, 14, 12, .87));
}
.tilt {
  position: absolute; inset: -14% -12%; display: flex; flex-direction: column; justify-content: center;
  gap: clamp(24px, 4vw, 48px); transform: rotate(-6deg);
}
@media (orientation: portrait) { .tilt { inset: -2% -30%; justify-content: space-evenly; } }
.wline { position: relative; padding-top: 14px; --gap: clamp(18px, 3vw, 34px); }
.wline::before { content: ""; position: absolute; left: 0; right: 0; top: 16px; height: 2px; background: var(--string); box-shadow: 0 2px 3px rgba(0, 0, 0, .55); }
.track { display: flex; gap: var(--gap); padding-right: var(--gap); width: max-content; align-items: flex-start; will-change: transform; }
.wline.far { --pw: clamp(104px, 12vw, 150px); filter: brightness(.72) blur(.4px); }
.wline.mid { --pw: clamp(128px, 15vw, 190px); filter: brightness(.88); }
.wline.near { --pw: clamp(160px, 19vw, 240px); }
.stage-note {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; padding: 20px; text-align: center;
}
.note-title { margin: 0; font-size: clamp(20px, 3vw, 28px); font-weight: 700; }
.note-sub { margin: 0; color: var(--muted); max-width: 44ch; }
.fallback {
  position: absolute; z-index: 6; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; padding: 6px 12px;
  border-radius: 6px; background: rgba(12, 14, 12, .8); color: var(--muted); font-size: 13px; text-align: center; width: max-content; max-width: calc(100% - 32px);
}

/* "New tribute" — a paper label that drops in at the top while the new print goes up. */
.announce {
  position: absolute; z-index: 7; bottom: max(16px, 5vh); left: 50%; width: max-content; max-width: calc(100% - 32px);
  display: grid; justify-items: center; gap: 2px; padding: 12px 22px 14px; border-radius: 3px; text-align: center;
  background: linear-gradient(var(--paper), var(--paper-shade)); color: var(--pen);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 14px 30px rgba(0, 0, 0, .6);
  opacity: 0; transform: translate(-50%, 16px) rotate(-1.5deg); pointer-events: none;
  transition: opacity .45s ease, transform .45s cubic-bezier(.2, .9, .25, 1.2);
}
.announce.show { opacity: 1; transform: translate(-50%, 0) rotate(-1.5deg); }
.announce p { margin: 0; }
.announce-kicker { font: 11px/1.4 var(--pixel); letter-spacing: .14em; text-transform: uppercase; color: #3f7a1f; }
.announce-line { font: 600 clamp(26px, 3.4vw, 38px)/1.1 var(--hand); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 .25em; }
.announce-line > span { display: inline-flex; align-items: center; gap: .2em; }
.announce-by { overflow-wrap: anywhere; }
.emerald { width: 1.1em; height: 1.1em; image-rendering: pixelated; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .3)); }
.announce-cost { font-variant-numeric: tabular-nums; }
.announce-for { font: 600 clamp(18px, 2.2vw, 24px)/1.2 var(--hand); color: #555a63; }

/* A polaroid. */
.pol {
  all: unset; box-sizing: border-box; position: relative; display: block; flex: none; cursor: zoom-in;
  width: var(--pw, 160px); padding: calc(var(--pw, 160px) * .06) calc(var(--pw, 160px) * .06) 0; border-radius: 2px;
  background: linear-gradient(var(--paper), var(--paper-shade));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 10px 22px rgba(0, 0, 0, .62), 0 2px 4px rgba(0, 0, 0, .4);
  transition: transform .2s ease;
}
.pol img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #2a2d29; }
.pol .cap {
  display: block; font: 600 calc(var(--pw, 160px) * .13)/1 var(--hand); color: var(--pen);
  padding: .55em 2% .7em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pol:focus-visible { outline: 3px solid var(--link); outline-offset: 4px; }
/* Every emerald paid for the photo — tucked in the paper's bottom-right corner, under the name. */
.pol .worth {
  position: absolute; right: 5%; bottom: 3%; display: inline-flex; align-items: center; gap: .25em;
  font: calc(var(--pw, 160px) * .065)/1 var(--pixel); color: #3f5a2c; font-variant-numeric: tabular-nums;
}
.pol .worth .emerald { display: inline-block; width: 1.35em; height: 1.35em; background: none; image-rendering: pixelated; }
/* Advancements this photo earned its photographer — tiny icons in the paper's bottom-left corner. */
.pol .advs {
  position: absolute; left: 5%; bottom: 3%; display: inline-flex; align-items: center; gap: .15em;
  font: calc(var(--pw, 160px) * .065)/1 var(--pixel); color: #3f5a2c;
}
.adv-icon { display: inline-grid; place-items: center; flex: none; width: 1.5em; height: 1.5em; }
.adv-icon:empty { border: 1px solid rgba(43, 47, 58, .35); border-radius: 2px; } /* no icon image: a plain frame */
.pol .adv-icon img, .big-advs .adv-icon img { display: block; width: 100%; height: 100%; aspect-ratio: auto; background: none; image-rendering: pixelated; }
.advs-more { margin-left: .2em; }
.pol.faded { cursor: default; }

.hang {
  position: relative; flex: none; transform-origin: 50% -6px; transform: translateY(var(--dy)) rotate(var(--rot));
  animation: sway var(--sway) ease-in-out infinite alternate; animation-delay: var(--delay);
}
.hang::before {
  content: ""; position: absolute; z-index: 2; top: -16px; left: 50%; width: 12px; height: 28px; margin-left: -6px;
  border-radius: 2px; background: linear-gradient(90deg, #a57c48, var(--peg) 45%, #a57c48); box-shadow: 0 2px 3px rgba(0, 0, 0, .45);
}
.hang .pol:hover { transform: scale(1.06) rotate(calc(var(--rot) * -1)); }
@keyframes sway { from { rotate: calc(var(--amp) * -1); } to { rotate: var(--amp); } }

/* A new Tribute (tributes.js hangNext): the line parts to make room, the print drops in from above,
   swings and settles, and its peg clips on as it lands. Lasts ARRIVAL_MS (2.6 s) in all. */
.hang.arriving {
  animation: open-gap 600ms ease-out both, sway var(--sway) ease-in-out infinite alternate;
  animation-delay: 0s, var(--delay);
}
.hang.arriving .pol { animation: drop-in 2000ms 350ms cubic-bezier(.2, .9, .25, 1) both; }
.hang.arriving::before { animation: peg-on 2350ms both; }
@keyframes open-gap { from { margin-left: calc(-1 * (var(--pw) + var(--gap))); } to { margin-left: 0; } }
@keyframes drop-in {
  0% { transform: translateY(-120vh) rotate(-28deg); }
  55% { transform: translateY(14px) rotate(7deg); }
  70% { transform: translateY(-6px) rotate(-4deg); }
  85% { transform: translateY(2px) rotate(2deg); }
  100% { transform: none; }
}
@keyframes peg-on {
  0%, 60% { opacity: 0; transform: translateY(-12px); }
  75% { opacity: 1; transform: translateY(2px); }
  100% { opacity: 1; transform: none; }
}

/* The viewer. */
.big-advs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 1% 5%; margin-top: -2%; }
.adv-badge {
  all: unset; box-sizing: border-box; cursor: help; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 4px;
  background: linear-gradient(#4f4f4f, #3a3a3a); box-shadow: inset 0 0 0 2px #1c1c1c, inset 0 0 0 3px #6d6d6d;
}
.adv-badge .adv-icon { width: 26px; height: 26px; }
.adv-badge .adv-icon:empty { border-color: rgba(255, 255, 255, .3); }
.adv-badge:hover, .adv-badge:focus-visible { box-shadow: inset 0 0 0 2px #1c1c1c, inset 0 0 0 3px #e3c26a; outline: none; }
/* Minecraft-style tooltip: dark plum box, purple edge, green title (purple for challenges). */
.adv-tip {
  position: absolute; z-index: 3; max-width: min(320px, 90vw); padding: 7px 10px 8px; border-radius: 3px; pointer-events: none;
  background: rgba(16, 0, 16, .94); box-shadow: inset 0 0 0 2px #2b0b5e, 0 6px 18px rgba(0, 0, 0, .6);
}
.adv-tip p { margin: 0; }
.adv-tip-title { font: 12px/1.5 var(--pixel); letter-spacing: .04em; color: #7cff6a; }
.adv-tip[data-frame="challenge"] .adv-tip-title { color: #d58cff; }
.adv-tip-desc { font: 14px/1.4 var(--sans); color: #d9d9d9; }
.adv-tip-desc:empty { display: none; }
.viewer { border: 0; padding: 0; background: transparent; color: var(--ink); width: min(94vw, 760px); max-width: none; max-height: 96vh; overflow: visible; }
.viewer::backdrop { background: rgba(8, 10, 8, .93); }
.viewer-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; }
.big {
  margin: 0; width: min(100%, 560px, 72vh); justify-self: center; padding: 5% 5% 0; border-radius: 3px;
  background: linear-gradient(var(--paper), var(--paper-shade)); box-shadow: 0 30px 60px rgba(0, 0, 0, .8);
  transform: rotate(var(--tilt, -1.5deg)); transition: transform .25s; touch-action: pan-y;
}
.big img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #2a2d29; }
.big-row { display: grid; gap: 6px; padding: 4% 1% 5%; }
.big-cap { font: 600 clamp(26px, 6vw, 40px)/1 var(--hand); color: var(--pen); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.big-meta { font: 10px/1.5 var(--pixel); letter-spacing: .1em; text-transform: uppercase; color: #6b6a63; font-variant-numeric: tabular-nums; }
.nav-btn {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06);
  color: var(--ink); font: 22px/1 var(--sans); cursor: pointer; display: grid; place-items: center;
}
.nav-btn:hover { background: rgba(255, 255, 255, .14); }
.nav-btn:focus-visible, .close-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.close-btn {
  position: absolute; top: -46px; right: 0; background: none; border: 1px solid var(--line); color: var(--ink);
  border-radius: 6px; padding: 6px 12px; font: 14px var(--sans); cursor: pointer;
}
.keys { text-align: center; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) {
  .viewer-row { grid-template-columns: 1fr 1fr; }
  .big { grid-column: 1 / -1; grid-row: 1; }
  .nav-btn { justify-self: center; }
  .keys { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hang { animation: none; }
  .pol, .big { transition: none; }
}
