/* Light the Lamp -- collectible player cards: the card, the pack reveal and
   the binder page. Independent of the classic and binder looks; both use it.

   Four finishes, rarest last. Each is a frame, a photo treatment and a shine:
     base      white frame, team-color nameplate
     holo      rainbow foil that moves with the tilt
     gold      metallic gold frame and plate
     diamond   ice-white faceted frame that sparkles
   The tilt (card-view.js) writes --rx/--ry for the lean and --mx/--my for
   where the light catches. */

.pc {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  --slab: 'Alfa Slab One', Georgia, serif;
  --read: Lexend, system-ui, sans-serif;
  position: relative; aspect-ratio: 5 / 7; perspective: 1100px;
  font-family: var(--read); color: #111; user-select: none; -webkit-user-select: none;
  /* Everything on the front is sized in cqi -- a share of the card's own
     width -- so a binder thumbnail is the big card shrunk, not re-laid-out. */
  container-type: inline-size;
}
/* touch-action: a finger on the big card tilts it (card-view.js) instead of
   scrolling the page, which is what stopped the tilt on a tablet. */
.pc-big { width: min(78vw, 340px, calc((100dvh - 260px) * 5 / 7)); touch-action: none; }
.pc-small { width: 100%; }
.pc-inner {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
/* The shadow sits on the faces, not .pc-inner: a filter on the 3D layer
   flattens it, and the flip then shows the front mirrored instead of the back. */
.pc-big .pc-face { box-shadow: 0 22px 40px -8px rgba(0,0,0,.55); }
.pc.flipped .pc-inner { transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + 180deg)); }
.pc-face {
  position: absolute; inset: 0; border-radius: 4.5% / 3.2%; overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}

/* ---------------------------------------------------------------- front */

.pc-front { padding: 5.5%; background: #fff; display: flex; flex-direction: column; }
.pc-photo { position: relative; flex: 1; min-height: 0; border-radius: 3%; overflow: hidden; background: #2a2f36; }
.pc-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.pc-shine { position: absolute; inset: 0; pointer-events: none; opacity: 0; }

/* The name band: full width across the bottom of the frame, the team logo at
   its left, the whole name on ONE line with the team under it. A long name
   never wraps -- card-view.js shrinks its type until it fits. */
.pc-band {
  --cond: 'Saira Condensed', 'Arial Narrow', sans-serif;
  position: relative; margin-top: 3%; padding: 2% 5% 2.4%;
  background: var(--t-dark); color: #fff; border-radius: 2px; text-align: center;
  box-shadow: inset 0 -4px 0 var(--t-accent);
  container-type: inline-size;
}
.pc-band-text { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pc-band-text > * { max-width: 100%; }

/* The team logo over the photo, top left, on a white disc. */
.pc-badge {
  position: absolute; top: 7.5%; left: 7.5%; z-index: 2;
  width: 15%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: rgba(255,255,255,.92); box-shadow: 0 2px 6px rgba(0,0,0,.3);
  display: grid; place-items: center;
}
/* The NHL's logo files carry their own margin, so the art is drawn larger
   than the disc and the margin is what gets clipped. */
.pc-badge .pc-logo { width: 118%; height: 118%; object-fit: contain; display: block; }
.pc-name {
  font-family: var(--cond); font-size: 8.5cqi; line-height: 1.08; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; letter-spacing: .01em;
}
.pc-first { font-weight: 500; }
.pc-last { font-weight: 800; }
.pc-team {
  font-family: var(--cond); font-size: 4cqi; text-transform: uppercase; letter-spacing: .1em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85;
}
.pc-team b { font-weight: 800; }

.pc-mark.beside-rc { right: 25%; }
.pc-rc {
  position: absolute; top: 5.5%; right: 7.5%; z-index: 2;
  width: 15%; aspect-ratio: 6 / 7; display: grid; place-items: center; padding-bottom: 2%;
  background: #C8202B; color: #fff; font: 400 5cqi var(--slab);
  clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%);
  box-shadow: 0 2px 0 rgba(0,0,0,.2);
}
.pc-mark {
  position: absolute; top: 8%; right: 7.5%; z-index: 2;
  padding: .25em .7em; border-radius: 999px; font-size: 3.8cqi; font-weight: 700;
  background: rgba(0,0,0,.6); color: #fff; letter-spacing: .02em;
}

.pc-back-who { flex: 1; min-width: 0; }
.pc-back-head .pc-logo { width: 54px; height: 54px; object-fit: contain; flex: none; }

/* ----------------------------------------------------------------- back */

.pc-back {
  transform: rotateY(180deg); background: #F4F6F8; color: #1A1D22;
  padding: 7% 7% 6%; display: flex; flex-direction: column; gap: 4%;
  border: 6px solid var(--t-dark); font-size: 13px;
}
.pc-back-head { display: flex; align-items: center; gap: 10px; }
.pc-back-num {
  flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: var(--t-accent); color: var(--t-ink); font: 400 22px var(--slab);
}
.pc-back-name { font: 400 20px/1.1 var(--slab); }
.pc-back-sub { color: #5E6670; font-size: 13px; }
.pc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.pc-fact { display: flex; flex-direction: column; }
.pc-fact span { font-size: 11px; color: #5E6670; }
.pc-fact b { font-size: 14px; font-weight: 600; }
.pc-stats { background: #fff; border-radius: 10px; padding: 10px 12px; }
.pc-stats-title { font-size: 12px; font-weight: 600; color: #5E6670; margin-bottom: 4px; }
.pc-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.pc-stats-row b { display: block; font: 400 22px var(--slab); font-variant-numeric: tabular-nums; }
.pc-stats-row span { font-size: 11px; color: #5E6670; }
.pc-tier-line { font-size: 12px; font-weight: 600; color: #5E6670; margin-top: auto; }
.pc-credit { font-size: 10.5px; line-height: 1.35; color: #5E6670; }
.pc-credit a { color: inherit; }

/* ------------------------------------------------------------- finishes */

/* Holographic: a rainbow frame, and a rainbow sheen over the photo that
   slides with the tilt. */
.pc-holo .pc-front {
  background: conic-gradient(from calc(var(--ry) * 6) at var(--mx) var(--my),
    #FF6FB5, #FFD86B, #B5FF8A, #7AD7FF, #B79BFF, #FF6FB5);
}
.pc-holo .pc-shine {
  opacity: .45; mix-blend-mode: color-dodge;
  background: linear-gradient(115deg, transparent 20%, #ff6fb5 35%, #ffe36e 42%, #b5ff8a 50%, #7ad7ff 58%, #b79bff 65%, transparent 80%);
  background-size: 250% 250%; background-position: var(--mx) var(--my);
}
.pc-holo .pc-mark { background: linear-gradient(90deg, #FF6FB5, #7AD7FF); color: #111; }

/* Gold: metal frame, gold plate, a white glint. */
.pc-gold .pc-front { background: linear-gradient(135deg, #8A6A12, #F6D77A 22%, #B8901F 40%, #FFF1B0 55%, #9C7614 75%, #E9C55A); }
.pc-gold .pc-band { background: linear-gradient(135deg, #E9C55A, #FFF1B0 45%, #C99A1E); color: #2A1F00; box-shadow: inset 0 -4px 0 #8A6A12; }
.pc-gold .pc-shine {
  opacity: .5; mix-blend-mode: overlay;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255,240,180,.9), transparent 45%);
}
.pc-gold .pc-mark { background: #2A1F00; color: #FFE38A; }

/* Diamond: ice-white facets and sparkles. */
.pc-diamond .pc-front {
  background:
    radial-gradient(circle at 18% 22%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 78% 12%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 88% 70%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 10% 82%, #fff 0 1.5px, transparent 2.5px),
    conic-gradient(from 45deg at 50% 50%, #E6FBFF, #9EE7FF, #FFFFFF, #BFEFFF, #E6FBFF, #8FDDF7, #FFFFFF, #E6FBFF);
}
.pc-diamond .pc-band { background: linear-gradient(135deg, #FFFFFF, #DFF7FF); color: #0B2A3A; box-shadow: inset 0 -4px 0 #7FD3F0; }
.pc-diamond .pc-shine {
  opacity: .55; mix-blend-mode: screen;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.85), transparent 30%),
    linear-gradient(120deg, transparent 40%, rgba(158,231,255,.6) 50%, transparent 60%);
  background-size: 100% 100%, 200% 200%; background-position: 0 0, var(--mx) var(--my);
}
.pc-diamond .pc-mark { background: #0B2A3A; color: #CFF4FF; }

/* ============================================================ gold & diamond cast */

/* Gold and Diamond tint the WHOLE card -- frame, photo, plate -- not just the
   frame. Three layers over the front: a color layer that pulls every hue
   toward the metal, a tint that takes the whites with it, and a glint that
   follows the tilt. isolation keeps the blending inside the card. */
.pc-gold .pc-front, .pc-diamond .pc-front { isolation: isolate; }
.pc-cast, .pc-tint, .pc-glint { position: absolute; inset: 0; z-index: 10; pointer-events: none; border-radius: inherit; }

.pc-gold .pc-cast {
  mix-blend-mode: color; opacity: .6;
  background: linear-gradient(135deg, #B8901F, #F6D77A 30%, #C99A1E 55%, #FFE9A0 75%, #A9821A);
}
.pc-gold .pc-tint {
  mix-blend-mode: multiply;
  background: linear-gradient(135deg, #E8C766, #FBE7A8 35%, #DDB54A 60%, #F6DC8E 85%, #D4A83C);
}
.pc-gold .pc-glint {
  mix-blend-mode: overlay;
  background:
    linear-gradient(115deg, transparent 32%, rgba(255,246,210,.85) 46%, transparent 60%),
    radial-gradient(circle at var(--mx) var(--my), rgba(255,236,170,.65), transparent 45%);
  background-size: 260% 260%, 100% 100%;
  background-position: var(--mx) var(--my), 0 0;
}

.pc-diamond .pc-cast {
  mix-blend-mode: color; opacity: .5;
  background: linear-gradient(135deg, #8FDDF7, #E6FBFF 35%, #9EE7FF 60%, #CFF4FF 85%);
}
.pc-diamond .pc-tint {
  mix-blend-mode: screen; opacity: .12;
  background: linear-gradient(135deg, #BFEFFF, #FFFFFF 40%, #9EE7FF 70%, #E6FBFF);
}
.pc-diamond .pc-glint {
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 16% 20%, #fff 0 0.5cqi, transparent 1.2cqi),
    radial-gradient(circle at 82% 14%, #fff 0 0.6cqi, transparent 1.4cqi),
    radial-gradient(circle at 70% 48%, #fff 0 0.4cqi, transparent 1cqi),
    radial-gradient(circle at 24% 64%, #fff 0 0.5cqi, transparent 1.2cqi),
    radial-gradient(circle at 88% 82%, #fff 0 0.6cqi, transparent 1.4cqi),
    radial-gradient(circle at 40% 90%, #fff 0 0.4cqi, transparent 1cqi),
    linear-gradient(120deg, transparent 38%, rgba(200,240,255,.4) 47%, rgba(255,255,255,.6) 50%, rgba(200,240,255,.4) 53%, transparent 62%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 260% 260%;
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, var(--mx) var(--my);
}

/* Rarity stars, on every style: tiny, on a dark chip at the bottom-left edge
   so they read on a white frame and a black one alike. */
.pc-stars {
  position: absolute; left: 2.4%; bottom: 1%; z-index: 11; pointer-events: none;
  padding: .2em .45em .25em; border-radius: 999px; background: rgba(10,12,16,.62);
  font-size: 2.6cqi; line-height: 1; letter-spacing: .04em; color: #F7C948;
  text-shadow: 0 0 .5cqi rgba(247,201,72,.6);
}
.pc-stars i { font-style: normal; color: rgba(255,255,255,.28); text-shadow: none; }

/* ============================================================ the reveal */

.rv {
  position: fixed; inset: 0; z-index: 90; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto; justify-items: center;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at 50% 45%, #2A3340, #07090C 70%);
  color: #fff; font-family: Saira, system-ui, sans-serif;
  opacity: 0; transition: opacity .25s;
}
.rv.in { opacity: 1; }
.rv-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.rv-top { text-align: center; z-index: 2; }
.rv-reason { font-size: 20px; font-weight: 600; }
.rv-whisper { margin-top: 6px; font-size: 16px; color: #F3D27A; letter-spacing: .04em; transition: opacity .3s; }
.rv.revealed .rv-whisper { opacity: 0; }
/* The stage is whatever height is left once the words above and below have
   theirs, and the pack and the card size themselves to IT (cqh), not to a
   guess at the screen. The guess -- the screen less 260px -- was short of
   what the reveal text needs, so on a smaller iPad the card ran down over
   "DIAMOND!", and on a phone the words sat on top of the card. */
.rv-stage { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; position: relative; z-index: 2;
            container-type: size; }
.rv .pc-big { width: min(78vw, 340px, 100cqh * 5 / 7, 100cqw); }
.rv-stage > * { grid-area: 1 / 1; }
.rv-bottom { display: grid; place-items: center; min-height: 150px; z-index: 4; width: 100%; }
.rv-bottom > * { grid-area: 1 / 1; }

.rv-btn {
  min-height: 56px; padding: 0 28px; border-radius: 999px; border: 0; cursor: pointer;
  background: #fff; color: #111; font: 600 19px Saira, system-ui, sans-serif;
}
.rv-btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.5); }
.rv-btn:focus-visible { outline: 3px solid #7AD7FF; outline-offset: 3px; }

/* --- the pack --- */
.rv-pack {
  position: relative; width: min(70vw, 280px, 100cqh * 5 / 7.6); aspect-ratio: 5 / 7.6; border-radius: 10px;
  background:
    linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 45%, transparent 60%),
    repeating-linear-gradient(135deg, transparent 0 22px, color-mix(in srgb, var(--p-accent) 35%, transparent) 22px 30px),
    var(--p-dark);
  box-shadow: 0 0 44px 4px rgba(255,255,255,.14), 0 34px 60px -18px rgba(0,0,0,.85), inset 0 0 0 2px rgba(255,255,255,.15);
  display: flex; flex-direction: column; transition: transform .6s cubic-bezier(.5,0,.2,1), opacity .5s;
  animation: rv-arrive .7s cubic-bezier(.2,.9,.3,1.2) both;
}
.rv-pack-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px; text-align: center; }
.rv-pack-logo { width: 88%; }
.rv-pack-logo svg { width: 100%; height: auto; display: block; }
.rv-pack-logo .wm-outer { fill: #fff; } .rv-pack-logo .wm-mid { fill: var(--p-dark); } .rv-pack-logo .wm-letters { fill: var(--p-accent); }
.rv-pack-title { font: 800 32px/1 'Saira Condensed', Saira, sans-serif; text-transform: uppercase; letter-spacing: .03em; }
.rv-pack-sub { font-size: 14px; opacity: .8; }

.rv-strip {
  position: relative; height: 54px; flex: none;
  background: color-mix(in srgb, var(--p-accent) 85%, #fff);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 97% 82%, 94% 100%, 91% 82%, 88% 100%, 85% 82%, 82% 100%, 79% 82%, 76% 100%, 73% 82%, 70% 100%, 67% 82%, 64% 100%, 61% 82%, 58% 100%, 55% 82%, 52% 100%, 49% 82%, 46% 100%, 43% 82%, 40% 100%, 37% 82%, 34% 100%, 31% 82%, 28% 100%, 25% 82%, 22% 100%, 19% 82%, 16% 100%, 13% 82%, 10% 100%, 7% 82%, 4% 100%, 0 82%);
  border-radius: 10px 10px 0 0; display: grid; place-items: center; color: var(--p-ink);
}
.rv-strip-hint { font-weight: 700; font-size: 15px; letter-spacing: .03em; position: relative; z-index: 1; }
/* The tear: a bright line that follows the finger across the top, from
   whichever side the swipe started. */
.rv-tear { position: absolute; top: 0; bottom: 0; left: 0; width: calc(var(--tear, 0) * 100%); background: rgba(255,255,255,.6); }
.rv-pack { touch-action: none; cursor: grab; }

/* The hint: a hand that swipes across the pack until the first touch. */
.rv-hand {
  position: absolute; left: 12%; top: 9%; width: 46px; height: 46px; pointer-events: none; z-index: 3;
  border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 4px 14px rgba(0,0,0,.45);
  animation: rv-swipe 1.8s 1.2s ease-in-out infinite;
}
.rv-hand::after {
  content: ""; position: absolute; inset: 30%; border-radius: 50%; background: var(--p-accent);
}
.rv.touched .rv-hand { display: none; }
@keyframes rv-swipe {
  0% { transform: translateX(0) scale(.9); opacity: 0; }
  15% { opacity: 1; transform: translateX(0) scale(1); }
  70% { transform: translateX(min(42vw, 170px)) scale(1); opacity: 1; }
  100% { transform: translateX(min(42vw, 170px)) scale(.9); opacity: 0; }
}

/* "Later": big, top corner, says what it does. */
.rv-later {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); z-index: 5;
  min-height: 56px; padding: 0 22px 0 14px; border-radius: 999px; border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.14); color: #fff; font: 600 18px Saira, system-ui, sans-serif;
}
.rv-later-x { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: #111; display: grid; place-items: center; font-size: 16px; }
.rv-later:focus-visible { outline: 3px solid #7AD7FF; outline-offset: 3px; }
/* Saving: the pack drops away toward the pile on the page below. */
.rv.saving { opacity: 0; transition: opacity .4s .1s; }
.rv.saving .rv-pack { transform: translateY(45vh) scale(.25); opacity: .3; transition: transform .45s ease-in, opacity .45s; animation: none; }

/* ------------------------------------------------- the pile of packs */
.pile {
  position: relative; display: inline-flex; align-items: center; gap: 16px;
  min-height: 84px; padding: 10px 26px 10px 14px; border-radius: 22px; border: 0; cursor: pointer;
  background: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.08), 0 10px 24px -12px rgba(0,0,0,.4);
  font: 600 19px Saira, system-ui, sans-serif; color: #1A1D22;
  animation: pile-hello .9s .3s ease-out 1;
}
.pile-stack { position: relative; width: 52px; height: 66px; flex: none; }
.pile-stack i {
  position: absolute; inset: 0; border-radius: 6px;
  background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--p-accent) 40%, transparent) 8px 11px), var(--p-dark);
  border-top: 9px solid var(--p-accent);
  transform: translate(calc(var(--i) * 5px), calc(var(--i) * -5px)) rotate(calc(var(--i) * 4deg - 4deg));
  box-shadow: 0 3px 8px rgba(0,0,0,.3);
}
.pile-count {
  position: absolute; top: -8px; left: 50px; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px;
  background: #E0262B; color: #fff; font: 700 16px Saira, system-ui, sans-serif; display: grid; place-items: center;
  box-shadow: 0 0 0 3px #fff;
}
.pile:focus-visible { outline: 3px solid #2F7DF6; outline-offset: 3px; }
/* One wiggle on arrival, so it is noticed. Then it sits still. */
@keyframes pile-hello { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-3deg) scale(1.03); } 45% { transform: rotate(3deg) scale(1.03); } 70% { transform: rotate(-1deg); } }

/* Every pack wears the same shadow -- a soft light halo so it lifts off the
   dark room, and a dark drop below. Chris did not want the shadow to give the
   card away, so it says nothing about what is inside. Rare packs still shake. */
.rv-rare .rv-pack { animation: rv-arrive .7s cubic-bezier(.2,.9,.3,1.2) both, rv-shake 1.4s .8s ease-in-out infinite; }

/* --- ripped: the strip flies, the pack drops, the card rises --- */
.rv.ripped .rv-strip { animation: rv-strip-off .6s ease-in forwards; }
.rv.ripped .rv-pack { transform: translateY(70%); opacity: 0; transition-delay: .35s; animation: none; }
.rv.ripped .rv-rip { opacity: 0; pointer-events: none; }
.rv-rip { transition: opacity .2s; }

.rv-card-holder { position: relative; opacity: 0; transform: translateY(40%) scale(.9); pointer-events: none; }
.rv.ripped .rv-card-holder { opacity: 1; transform: none; transition: transform .7s .4s cubic-bezier(.2,.9,.3,1.15), opacity .3s .4s; pointer-events: auto; }
.rv-cover {
  position: absolute; inset: 0; z-index: 2; border-radius: 4.5% / 3.2%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.15), transparent 60%),
    repeating-linear-gradient(45deg, #1F2A36 0 10px, #24313F 10px 20px);
  box-shadow: inset 0 0 0 8px #fff;
  transition: transform .45s ease-in, opacity .2s .35s;
}
.rv.revealed .rv-cover { transform: rotateY(90deg); opacity: 0; }

.rv-done { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .4s .3s; }
.rv.revealed .rv-done { opacity: 1; pointer-events: auto; }
.rv-tier-name { font: 800 40px/1 'Saira Condensed', Saira, sans-serif; text-transform: uppercase; letter-spacing: .03em; }
.rv-holo .rv-tier-name { background: linear-gradient(90deg, #FF6FB5, #FFE36E, #7AD7FF, #B79BFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rv-gold .rv-tier-name { color: #F3D27A; }
.rv-diamond .rv-tier-name { color: #CFF4FF; }
/* The rarity line under the finish: the stars, then "Rare · Light the Lamp". */
.rv-rarity { display: flex; align-items: center; gap: 10px; font: 800 22px/1 'Saira Condensed', Saira, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.85); }
.rv-stars { color: #F7C948; letter-spacing: .12em; font-size: 24px; }
.rv-stars i { font-style: normal; color: rgba(255,255,255,.22); }
/* The colors games use for these words: grey, green, blue, purple, gold. */
.rv-rarity.r-2 { color: #6BE38A; }
.rv-rarity.r-3 { color: #5AB8FF; }
.rv-rarity.r-4 { color: #C99BFF; text-shadow: 0 0 12px rgba(180,120,255,.6); }
.rv-rarity.r-5 { color: #FFD54A; text-shadow: 0 0 16px rgba(255,200,60,.85); }
.rv-rookie { background: #C8202B; padding: 2px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.rv-player { font-size: 19px; font-weight: 600; }
.rv-hint { font-size: 14px; opacity: .65; }
.rv-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

@keyframes rv-arrive { from { transform: translateY(40px) scale(.8) rotate(-6deg); opacity: 0; } }
@keyframes rv-shake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-2.5deg); } 40% { transform: rotate(2.5deg); } 60% { transform: rotate(-1.5deg); } 80% { transform: rotate(1deg); } }
@keyframes rv-strip-off { to { transform: translate(140%, -120%) rotate(28deg); opacity: 0; } }

/* ============================================================ the binder */

.bd {
  display: flex; flex-direction: column; gap: 14px; min-height: 0; height: 100%;
  padding: 18px 20px; font-family: Saira, system-ui, sans-serif; color: #1A1D22;
}
.bd-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bd-back { min-height: 48px; padding: 0 18px; border-radius: 999px; border: 0; background: #fff; font: 600 17px Saira, system-ui, sans-serif; cursor: pointer; }
.bd-title { margin: 0; font: 800 38px/1.05 'Saira Condensed', Saira, sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.bd-count { color: #5E6670; font-size: 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.bd-tiers { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.bd-tier-chip { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #E3E7EC; color: #1A1D22; white-space: nowrap; }
/* At the top they are filters: tap one to see only that finish. */
button.bd-tier-chip { border: 2px solid transparent; cursor: pointer; font-family: Saira, system-ui, sans-serif; min-height: 34px; padding: 4px 12px; font-size: 13px; }
button.bd-tier-chip[aria-pressed="true"] { border-color: #1A1D22; box-shadow: 0 2px 0 #1A1D22; }
button.bd-tier-chip:focus-visible { outline: 3px solid #2F7DF6; outline-offset: 2px; }
.bd-tier-chip.t-holo { background: linear-gradient(90deg, #FFC2E0, #C9EEFF, #E2D6FF); }
.bd-tier-chip.t-gold { background: linear-gradient(135deg, #F6D77A, #FFF1B0); }
.bd-tier-chip.t-diamond { background: #DFF7FF; }

.bd-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bd-search, .bd-select {
  min-height: 48px; border-radius: 12px; border: 2px solid #D5DBE1; background: #fff;
  padding: 0 14px; font: 500 16px Saira, system-ui, sans-serif; color: #1A1D22;
}
.bd-search { flex: 1 1 220px; min-width: 0; }
.bd-search:focus-visible, .bd-select:focus-visible, .bd-view:focus-visible, .bd-slot:focus-visible, .bd-row:focus-visible { outline: 3px solid #2F7DF6; outline-offset: 2px; }
.bd-views { display: inline-flex; background: #fff; border-radius: 12px; padding: 3px; border: 2px solid #D5DBE1; }
.bd-view { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: none; font: 600 15px Saira, system-ui, sans-serif; cursor: pointer; color: #1A1D22; }
.bd-view.on { background: #1A1D22; color: #fff; }

.bd-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 20px; }
.bd-group { display: flex; align-items: center; gap: 10px; font: 800 24px 'Saira Condensed', Saira, sans-serif; text-transform: uppercase; letter-spacing: .03em; }
.bd-group span { font: 600 13px Saira, system-ui, sans-serif; background: #fff; padding: 1px 9px; border-radius: 999px; color: #5E6670; }
/* Room at the top and between slots for a stack's edges and its count. */
.bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 26px; padding: 14px 16px 0 0; }
.bd-slot { padding: 0; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 10px; transition: transform .15s; }
.bd-slot:active { transform: scale(.97); }
/* A stack: copies peek out behind the top card, up and to the right, and a
   count sits on the corner. Two copies show one edge; three or more, two. */
.bd-slot { position: relative; }
.bd-slot > .pc { z-index: 1; }
.bd-slot.stacked::after, .bd-slot.stacked-3::before {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: 4.5% / 3.2%;
  background: var(--stack, #2A2F36); box-shadow: 0 2px 6px rgba(0,0,0,.28), inset 0 0 0 2px rgba(255,255,255,.3);
}
.bd-slot.stacked::after { transform: translate(7px, -7px) rotate(2.5deg); }
.bd-slot.stacked-3::before { transform: translate(14px, -13px) rotate(5deg); opacity: .75; }
.bd-copies {
  position: absolute; top: -10px; right: -8px; z-index: 2; min-width: 32px; height: 32px; padding: 0 8px;
  border-radius: 999px; background: #E0262B; color: #fff; font: 700 16px Saira, system-ui, sans-serif;
  display: grid; place-items: center; box-shadow: 0 0 0 3px #E4E8EE;
}
.bd-copies.in-row { position: static; box-shadow: none; flex: none; }
.bd-list { display: flex; flex-direction: column; gap: 6px; }
.bd-row {
  display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; border-radius: 12px;
  border: 0; background: #fff; text-align: left; cursor: pointer; font-family: Saira, system-ui, sans-serif; color: #1A1D22;
}
.bd-row-num { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font: 800 19px 'Saira Condensed', Saira, sans-serif; border: 3px solid; }
.bd-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bd-row-main b { font-size: 17px; font-weight: 600; }
.bd-row-main span { font-size: 13px; color: #5E6670; }
.bd-empty { padding: 40px 20px; text-align: center; color: #5E6670; font-size: 17px; display: flex; flex-direction: column; gap: 6px; }
.bd-empty b { font: 800 28px 'Saira Condensed', Saira, sans-serif; text-transform: uppercase; color: #1A1D22; }


/* Short screens: the reveal text closes up so the card keeps its size. */
@media (max-height: 820px) {
  .rv-done { gap: 4px; }
  .rv-tier-name { font-size: 34px; }
  .rv-rarity { font-size: 19px; } .rv-stars { font-size: 20px; }
  .rv-player { font-size: 17px; }
  .rv-actions { margin-top: 4px; }
  .rv-bottom { min-height: 0; }
}
/* A phone held sideways has no height to stack in: the card on the left,
   the words and buttons on the right. */
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  .rv { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; column-gap: 20px; }
  .rv-top { grid-column: 1 / -1; }
  .rv-reason { font-size: 16px; }
  .rv-stage { grid-column: 1; grid-row: 2; }
  .rv-bottom { grid-column: 2; grid-row: 2; align-self: center; }
  .rv-tier-name { font-size: 28px; }
  .rv-rarity { font-size: 16px; gap: 6px; } .rv-stars { font-size: 17px; }
  .rv-player { font-size: 16px; }
  .rv-hint { display: none; }
  .rv-btn { min-height: 48px; padding: 0 18px; font-size: 16px; }
  .rv-later { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-inner, .rv, .rv-pack, .rv-card-holder, .rv-cover, .rv-done { transition: none !important; animation: none !important; }
  .rv-rare .rv-pack, .rv-hand, .pile { animation: none; }
}

/* ============================================================ in the app */

/* The corner on the board: the pile of packs, buying, the binder. */
.cards-corner { display: flex; flex-direction: column; gap: 10px; flex: none; }
.cards-corner .pile { align-self: stretch; justify-content: flex-start; min-height: 76px; }
.cards-corner-row { display: flex; gap: 8px; flex-wrap: wrap; }
.cards-binder-link {
  min-height: 48px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  font: 600 15px Saira, system-ui, sans-serif; white-space: nowrap;
}
.cards-binder-link { background: #fff; color: #1A1D22; box-shadow: inset 0 0 0 2px #D5DBE1; }
.cards-binder-link:focus-visible { outline: 3px solid #2F7DF6; outline-offset: 2px; }

/* The binder as a screen under the header. */
.cards-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #E4E8EE; }
.cards-screen .bd { flex: 1; min-height: 0; }

/* The way in from the Locker: big, with the newest card in it (or a fanned
   stack before there is one), so it reads as the prize it is. */
.locker-binder {
  display: flex; align-items: center; gap: 20px; width: 100%;
  min-height: 170px; padding: 18px 22px; margin-bottom: 14px; border-radius: var(--r-card, 20px); border: 0; cursor: pointer;
  background: var(--dark); color: #fff; text-align: left; box-shadow: inset 0 -7px 0 var(--accent), 0 10px 24px -14px rgba(0,0,0,.5);
}
.locker-binder-art { flex: none; width: 96px; display: block; transform: rotate(-4deg); }
.locker-binder-art .pc { box-shadow: 0 8px 18px rgba(0,0,0,.45); border-radius: 6px; }
.locker-binder-icon { display: block; width: 96px; height: 96px; color: var(--accent); }
.locker-binder-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.locker-binder-title { font: 800 34px/1.05 'Saira Condensed', Saira, sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.locker-binder-sub { font-size: 16px; opacity: .85; }
.locker-binder-packs { align-self: flex-start; margin-top: 2px; padding: 2px 12px; border-radius: 999px; background: #E0262B; font-size: 14px; font-weight: 700; }
.locker-binder-go { align-self: flex-start; margin-top: 8px; padding: 8px 18px; border-radius: 999px; background: var(--accent); color: var(--ink); font-size: 16px; font-weight: 700; }
.locker-binder:focus-visible { outline: 3px solid #2F7DF6; outline-offset: 3px; }

/* The card pack on the rewards list, with its Cash in button. */
.pack-reward .cash-in { margin-top: 10px; width: 100%; min-height: 52px; font-size: 17px; }

/* ============================================================== zooming */
/* card-zoom.js. The wrapper is the card's size; the layer inside it is what
   moves and scales. touch-action: none keeps the browser's own pinch-to-zoom
   and scrolling off the card, so the fingers reach the script. */
.zoom { position: relative; display: grid; touch-action: none; }
.zoom-layer { transform-origin: 50% 50%; }  /* no will-change: it keeps the card a stretched bitmap, blurry zoomed in */
.zoom.zoomed .zoom-layer { cursor: grab; }
/* Zoomed, the card comes up over the words under it. */
.rv-stage:has(.zoom.zoomed) { z-index: 6; }
.zoom-out {
  position: absolute; left: 50%; bottom: -58px; transform: translateX(-50%);
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.95); color: #111; font: 700 16px Saira, system-ui, sans-serif;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 7; white-space: nowrap;
}
.zoom.zoomed .zoom-out { opacity: 1; pointer-events: auto; }

/* A card opened from the binder: the reveal's layout, already revealed, so
   nothing slides in but the overlay itself. */
.rv-view .rv-card-holder, .rv-view .rv-done { transition: none; }
