/* style.css - dark card-game look. Cards are fluid: they scale with their container width. */

:root {
  --bg: #0c0e16;
  --panel: #161a27;
  --panel-2: #1e2334;
  --line: #262d45;
  --text: #e8ebf5;
  --muted: #8f98b3;
  --accent: #7c5cff;
  --accent-2: #38bdf8;
  --gold: #fbbf24;
  --good: #4ade80;
  --bad: #f87171;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 50% -200px, #1b1f3a 0%, var(--bg) 70%) fixed, var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
h2 { margin: 0 0 10px; font-size: 1.25rem; }
h3 { margin: 14px 0 8px; font-size: 1.05rem; }
p { margin: 8px 0; }
b { font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* ------------------------------------------------ header and nav */
.top { position: sticky; top: 0; z-index: 20; background: rgba(12,14,22,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: baseline; gap: 8px; font-weight: 800; font-size: 1.2rem; letter-spacing: .02em; }
.logo-mark { color: var(--gold); }
.logo small:not(.beta-badge) { color: var(--muted); font-weight: 500; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; }
.pills { display: flex; gap: 8px; }
.pill { background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-size: .95rem; white-space: nowrap; }

.screen { max-width: 960px; margin: 0 auto; padding: 4px 16px 110px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: rgba(14,16,26,.96); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }
.nav-btn { text-decoration: none; position: relative; flex: 1; max-width: 140px; background: none; border: 0; border-radius: 12px; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--muted); cursor: pointer; }
.nav-btn.active { color: var(--text); background: var(--panel-2); }
.nav-icon { font-size: 1.35rem; line-height: 1.2; }
.nav-label { font-size: .72rem; }
.nav-dot { position: absolute; top: 4px; right: 28%; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* ------------------------------------------------ generic blocks */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.btn { background: var(--panel-2); border: 1px solid #343c5c; border-radius: 12px; padding: 9px 14px; cursor: pointer; transition: transform .12s, filter .12s; }
.btn:hover:not(:disabled) { filter: brightness(1.18); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--accent), #5a8bff); border-color: transparent; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.danger { background: #5b1d27; border-color: #8a2b3a; }
.btn.big { padding: 13px 20px; font-size: 1.05rem; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.btn-row.center { justify-content: center; }
.tag { background: #1d3a2a; color: var(--good); border-radius: 99px; padding: 3px 10px; font-size: .8rem; }
.ok-line { color: var(--good); }
.special-day { color: var(--gold); }
.empty-note { text-align: center; padding: 30px 0; grid-column: 1 / -1; }

.bar { height: 9px; background: #0a0c13; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar.small { height: 6px; margin: 6px 0 2px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .4s; }
.progress-line { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.progress-line .bar { flex: 1; }
.progress-line span { white-space: nowrap; font-size: .9rem; color: var(--muted); }

textarea, input[type=search], select { background: #0e111b; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; }
textarea { resize: vertical; margin: 8px 0; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.filters input { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; padding: 3px 11px; font-size: .85rem; }
.chip.done { border-color: var(--good); color: var(--good); }
.switch { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.switch input { width: 20px; height: 20px; }

table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; }

/* ------------------------------------------------ cards */
.card { position: relative; width: 100%; aspect-ratio: 5 / 7; container-type: inline-size; border-radius: 7% / 5%; user-select: none; -webkit-user-select: none; }
.card-inner {
  font-size: calc(100cqw / 16);
  position: absolute; inset: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: .4em;
  padding: .75em;
  border-radius: inherit;
  border: .3em solid var(--rc);
  background:
    linear-gradient(165deg, color-mix(in srgb, var(--ta) 28%, #181c2b) 0%, #10131d 62%),
    #10131d;
  box-shadow: 0 .4em 1.2em rgba(0,0,0,.5), inset 0 0 1.6em rgba(0,0,0,.35);
  transition: transform .15s ease-out;
  will-change: transform;
}
.card.r-uncommon .card-inner { box-shadow: 0 .4em 1.2em rgba(0,0,0,.5), 0 0 .8em color-mix(in srgb, var(--rc) 35%, transparent); }
.card.r-rare .card-inner { box-shadow: 0 .4em 1.2em rgba(0,0,0,.5), 0 0 1.2em color-mix(in srgb, var(--rc) 55%, transparent); }
.card.r-epic .card-inner { box-shadow: 0 .4em 1.2em rgba(0,0,0,.5), 0 0 1.6em color-mix(in srgb, var(--rc) 70%, transparent); }
.card.r-legendary .card-inner {
  border-image: linear-gradient(135deg, #fff1a8, #f59e0b 30%, #fff1a8 55%, #d97706) 1;
  border-radius: 0;
  box-shadow: 0 .4em 1.2em rgba(0,0,0,.5), 0 0 2em rgba(251,191,36,.7);
}
.card.r-legendary { border-radius: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .4em; }
.card-name { font-weight: 800; font-size: calc(1.05em * var(--fit, 1)); line-height: 1.1; text-shadow: 0 1px 2px #000; overflow: hidden; white-space: nowrap; min-width: 0; }
.card-name.fit-two { white-space: normal; line-height: 1.02; max-height: 2.1em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-type { font-size: 1.15em; background: rgba(0,0,0,.4); border-radius: 50%; width: 1.7em; height: 1.7em; display: grid; place-items: center; flex: 0 0 auto; }
.card-art { position: relative; flex: 1 1 0; min-height: 0; border-radius: .6em; overflow: hidden; border: .12em solid rgba(255,255,255,.18); }
.art-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.emblem { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 5.4em; filter: drop-shadow(0 .08em .12em rgba(0,0,0,.55)); line-height: 1; }
.card-ribbon { display: flex; justify-content: space-between; align-items: center; font-size: .78em; font-weight: 700; color: var(--rc); background: rgba(0,0,0,.35); border-radius: .5em; padding: .2em .6em; text-transform: uppercase; letter-spacing: .04em; }
.card-ribbon .stars { letter-spacing: .1em; }
/* role of the card in the dirigeant game (replaces the old duel stats, 06/10) */
.card-role { display: flex; flex-direction: column; gap: .15em; background: rgba(0,0,0,.3); border-radius: .5em; padding: .3em .45em; }
.role-top { display: flex; justify-content: space-between; align-items: baseline; gap: .4em; font-size: .74em; }
.role-top b { color: #e8ecff; white-space: nowrap; }
.role-top span { color: #aab2cc; white-space: nowrap; }
.role-fx { font-size: .66em; line-height: 1.2; color: #cfd6ee; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.role-cost { font-size: .62em; color: #8a93ad; }
.role-detail { background: var(--panel-2); border-radius: 12px; padding: 8px 10px; font-size: .9rem; line-height: 1.5; margin: 8px 0; }
.card-flavor { font-size: .68em; font-style: italic; color: #b7bed6; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.card-number { font-size: .62em; color: #7d86a3; text-align: center; letter-spacing: .06em; }
.missing-note { font-size: .75em; color: #8a93ad; text-align: center; padding: .6em 0; }
.card.missing .card-inner { filter: grayscale(1) brightness(.6); }
.card.missing .emblem { filter: brightness(0) opacity(.55); }
.card.missing .card-name { opacity: .8; }

.sheen { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.4) 50%, transparent 65%); transform: translateX(-120%); }
.card.r-epic .sheen, .card.r-legendary .sheen { opacity: 1; animation: sheen 3.6s ease-in-out infinite; }
.card.r-legendary .sheen { animation-duration: 2.6s; }
@keyframes sheen { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

.foil-layer { position: absolute; inset: 0; pointer-events: none; opacity: 0; border-radius: inherit; mix-blend-mode: color-dodge; background:
  linear-gradient(115deg, transparent 15%, rgba(255,0,140,.45) 30%, rgba(0,240,255,.45) 48%, rgba(255,235,0,.45) 66%, transparent 85%);
  background-size: 220% 220%; background-position: calc(var(--mx, 50) * 1%) calc(var(--my, 50) * 1%); }
.card.foil .foil-layer { opacity: .75; }
.card.foil:not(.tilt) .foil-layer { animation: foilmove 5s ease-in-out infinite alternate; }
@keyframes foilmove { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
.card.foil .card-art::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(60deg, rgba(255,255,255,.07) 0 .25em, transparent .25em .6em); mix-blend-mode: overlay; }

.count-badge { position: absolute; top: -.4em; right: -.3em; z-index: 3; background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 9px; font-weight: 800; font-size: .85rem; border: 2px solid var(--bg); }
.corner-badge { position: absolute; top: 19%; left: 9%; z-index: 3; background: rgba(0,0,0,.75); border-radius: 8px; padding: 1px 7px; font-weight: 800; font-size: .8rem; color: var(--good); }
.card.winner { outline: 3px solid var(--good); box-shadow: 0 0 28px rgba(74,222,128,.55); }
.card.loser { opacity: .7; filter: saturate(.55); }

/* back of a card: newspaper masthead on a night-blue card (same ink / gold / red as the rest of the site) */
.card.back .card-inner { border-color: #d9a520; background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px .42em),
    radial-gradient(circle at 50% 38%, #26304f 0%, #0f1424 72%); display: grid; place-items: center; align-content: center; gap: .1em; }
.card.back .card-inner::before { content: ""; position: absolute; inset: .55em; border: .1em double rgba(251,191,36,.75); border-radius: .5em; pointer-events: none; }
.back-pattern { position: absolute; inset: 0; background: radial-gradient(circle at 50% 38%, rgba(251,191,36,.18), transparent 55%); }
.back-emblem { position: relative; width: 1.45em; height: 1.45em; border-radius: 50%; display: grid; place-items: center; font-family: Georgia, "Times New Roman", serif; font-weight: 900; font-size: 3.2em; line-height: 1; color: #ffe08a;
  background: radial-gradient(circle at 35% 30%, #2d3560, #0b0f1e 72%); border: .06em solid #fbbf24; box-shadow: 0 0 .5em rgba(251,191,36,.6), inset 0 0 .4em rgba(0,0,0,.7); text-shadow: 0 0 .3em rgba(251,191,36,.8); }
.back-brand { position: relative; font-family: Georgia, "Times New Roman", serif; font-weight: 900; font-size: 1.5em; letter-spacing: .02em; color: #fff3c4; text-shadow: 0 .06em 0 rgba(0,0,0,.6); }
.back-brand b { color: #ff7a6b; }
.back-sub { position: relative; font-size: .62em; letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.7); }

/* grid of cards */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0; }
.grid-cell { position: relative; cursor: pointer; transition: transform .15s; }
.grid-cell:hover { transform: translateY(-4px); }
.grid-cell.chosen .card { outline: 3px solid var(--accent-2); box-shadow: 0 0 22px rgba(56,189,248,.5); }
.check { position: absolute; top: 6px; left: 6px; z-index: 4; background: var(--accent-2); color: #04121a; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; }

/* ------------------------------------------------ home */
.hero { display: flex; gap: 24px; align-items: center; background: linear-gradient(135deg, #1d1f3f, var(--panel) 60%); }
.hero-info { flex: 1; min-width: 0; }
.timer-line { font-size: 1.05rem; }
/* ------------------------------------------------ booster pack (08/10): a foil wrapper like the ones sold in a tobacco shop.
   Per series: palette (--pa light, --pb mid, --pc dark) + a press photo in the window. It tilts with the pointer (see attachPackTilt in ui.h.js). */
.pack-visual { --pack-clip: polygon(0 1.1%, 3.3% 0, 6.6% 1.1%, 10% 0, 13.3% 1.1%, 16.6% 0, 20% 1.1%, 23.3% 0, 26.6% 1.1%, 30% 0, 33.3% 1.1%, 36.6% 0, 40% 1.1%, 43.3% 0, 46.6% 1.1%, 50% 0, 53.3% 1.1%, 56.6% 0, 60% 1.1%, 63.3% 0, 66.6% 1.1%, 70% 0, 73.3% 1.1%, 76.6% 0, 80% 1.1%, 83.3% 0, 86.6% 1.1%, 90% 0, 93.3% 1.1%, 96.6% 0, 100% 1.1%,
    100% 98.9%, 96.6% 100%, 93.3% 98.9%, 90% 100%, 86.6% 98.9%, 83.3% 100%, 80% 98.9%, 76.6% 100%, 73.3% 98.9%, 70% 100%, 66.6% 98.9%, 63.3% 100%, 60% 98.9%, 56.6% 100%, 53.3% 98.9%, 50% 100%, 46.6% 98.9%, 43.3% 100%, 40% 98.9%, 36.6% 100%, 33.3% 98.9%, 30% 100%, 26.6% 98.9%, 23.3% 100%, 20% 98.9%, 16.6% 100%, 13.3% 98.9%, 10% 100%, 6.6% 98.9%, 3.3% 100%, 0 98.9%); --pa: #d8c8ff; --pb: #7b55e6; --pc: #2b1a78; --mx: 50; --my: 30; position: relative; flex: 0 0 auto; width: 196px; aspect-ratio: 5 / 9; border: 0; background: none; cursor: pointer; padding: 0; perspective: 900px; }
.pack-visual.empty { filter: grayscale(.85) brightness(.65); cursor: default; }
.pack-float { position: absolute; inset: 0; animation: pack-float 6s ease-in-out infinite; filter: drop-shadow(0 16px 14px rgba(20, 12, 8, .5)) drop-shadow(0 2px 2px rgba(20, 12, 8, .4)); }
.pack-tilt { position: absolute; inset: 0; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; }
.pack-visual.is-tilting .pack-tilt { transition: transform .08s linear; }
.pack-visual.is-tilting .pack-float { animation-play-state: paused; }
.pack-visual:hover:not(:disabled) .pack-float { animation-play-state: paused; }
.pack-glow { display: none; }

.pack-body { position: absolute; inset: 0; overflow: hidden; container-type: inline-size; color: #fff;
  clip-path: var(--pack-clip);
  background:
    linear-gradient(100deg, rgba(255,255,255,.28) 0, rgba(255,255,255,0) 14%, rgba(0,0,0,0) 84%, rgba(0,0,0,.28) 100%),
    linear-gradient(172deg, var(--pa) 0%, var(--pb) 32%, var(--pc) 100%);
  box-shadow: inset 7px 0 12px -6px rgba(255,255,255,.55), inset -12px 0 18px -6px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.22); }
/* thickness: a few darker copies behind the wrapper, seen on the side when it tilts (like a pack with a stack of cards inside) */
.pack-layer { position: absolute; inset: 0; clip-path: var(--pack-clip); background: linear-gradient(180deg, var(--pb), var(--pc)); filter: brightness(.55); }
.pack-layer.l1 { transform: translateZ(-4px); } .pack-layer.l2 { transform: translateZ(-8px); filter: brightness(.45); } .pack-layer.l3 { transform: translateZ(-12px); filter: brightness(.38); } .pack-layer.l4 { transform: translateZ(-16px); filter: brightness(.3); }
/* the bulge: lit in the middle (where the cards are), pinched and dark toward the crimps and the sides */
.pack-bulge { position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background:
    radial-gradient(ellipse 62% 52% at 50% 50%, rgba(255,255,255,.26), rgba(255,255,255,0) 72%),
    linear-gradient(90deg, rgba(0,0,0,.34) 0, rgba(0,0,0,0) 20%, rgba(0,0,0,0) 78%, rgba(0,0,0,.38) 100%),
    linear-gradient(180deg, rgba(0,0,0,.5) 0, rgba(0,0,0,0) 13%, rgba(0,0,0,0) 86%, rgba(0,0,0,.5) 100%); }

/* crimped ends: fine vertical ridges with a metal sheen */
.pack-crimp { position: absolute; left: 0; right: 0; top: 0; height: 5.4%; z-index: 4;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.65) 0 1px, rgba(0,0,0,.28) 1px 3px), linear-gradient(180deg, color-mix(in srgb, var(--pa) 70%, #fff), var(--pb) 70%, var(--pc));
  box-shadow: inset 0 -3px 3px rgba(0,0,0,.4), inset 0 2px 2px rgba(255,255,255,.6); }
.pack-crimp.bottom { top: auto; bottom: 0; box-shadow: inset 0 3px 3px rgba(0,0,0,.4), inset 0 -2px 2px rgba(255,255,255,.6); }

/* brand plate */
.pack-brand { position: absolute; left: 8%; right: 8%; top: 7.2%; z-index: 3; text-align: center; font-family: Georgia, "Times New Roman", serif; font-weight: 900; font-size: 12.6cqw; line-height: 1; letter-spacing: -.01em;
  color: #fff3c4; text-shadow: 0 1px 0 #6b4a00, 0 2px 0 rgba(0,0,0,.45), 0 0 10px rgba(255, 214, 102, .55); }
.pack-brand b { color: #ff7a6b; text-shadow: 0 1px 0 #7a140d, 0 2px 0 rgba(0,0,0,.45), 0 0 10px rgba(255,100,80,.5); }
.pack-tagline { position: absolute; left: 8%; right: 8%; top: 16.2%; z-index: 3; text-align: center; font-size: 3.3cqw; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.88); border-top: 1px solid rgba(255,255,255,.55); padding-top: 1.2cqw; }

/* the window: a press photo, newspaper-printed (greyscale + halftone + palette tint), with a metal frame */
.pack-art { position: absolute; left: 7%; right: 7%; top: 21.5%; height: 43%; z-index: 2; display: flex; overflow: hidden; border-radius: 3cqw; background: #222;
  border: 1.4cqw solid transparent; border-image: linear-gradient(135deg, #fff6d0, #d9a520 30%, #fff1b8 52%, #b9820f 78%, #ffe9a0) 1;
  box-shadow: 0 0 0 .6cqw rgba(0,0,0,.45), 0 4px 10px rgba(0,0,0,.5); }
.pack-photo { flex: 1; min-width: 0; background-size: cover; background-position: center; filter: grayscale(.3) contrast(1.06) brightness(.97) saturate(1.05); }
.pack-photo + .pack-photo { border-left: .7cqw solid rgba(255,255,255,.85); }
.pack-art::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--pb); mix-blend-mode: color; opacity: .26; }
.pack-art::after { content: ""; position: absolute; inset: 0; z-index: 2; mix-blend-mode: multiply; opacity: .14;
  background: radial-gradient(circle, rgba(0,0,0,.9) 0 .35cqw, transparent .5cqw) 0 0 / 1.9cqw 1.9cqw; }
.pack-emblem { margin: auto; font-size: 30cqw; line-height: 1; text-shadow: 0 2px 0 rgba(0,0,0,.5), 0 0 22px rgba(255,214,102,.8); position: relative; z-index: 3; }
.pack-clip { position: absolute; left: 4%; right: 4%; top: 58.2%; z-index: 5; transform: rotate(-1.6deg); background: #f4eedb; color: #1c1a16; padding: 1.5cqw 3cqw 1.7cqw; text-align: center; font-family: Georgia, "Times New Roman", serif; font-weight: 800; font-size: 5.4cqw; line-height: 1.1; text-transform: uppercase; letter-spacing: .01em;
  box-shadow: 0 2px 5px rgba(0,0,0,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pack-clip::before { content: "À LA UNE"; display: block; font-family: system-ui, sans-serif; font-weight: 800; font-size: 2.9cqw; letter-spacing: .24em; color: #b3261e; }

/* series block */
.pack-kicker { position: absolute; left: 0; right: 0; top: 70.2%; z-index: 3; text-align: center; font-size: 3.7cqw; font-weight: 800; letter-spacing: .38em; padding-left: .38em; color: rgba(255,255,255,.85); text-transform: uppercase; }
.pack-series { position: absolute; left: 4%; right: 4%; top: 74.2%; z-index: 3; text-align: center; font-family: Georgia, "Times New Roman", serif; font-weight: 900; font-size: 11.4cqw; line-height: 1; text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #fff; text-shadow: 0 1px 0 var(--pc), 0 2px 0 var(--pc), 0 3px 0 rgba(0,0,0,.5), 0 0 12px rgba(255,255,255,.35); }
.pack-badge { position: absolute; left: 50%; top: 86.6%; z-index: 3; transform: translateX(-50%); padding: .9cqw 4.4cqw 1.1cqw; background: #c3261c; border: 1px solid #ff9d94; border-radius: 1.2cqw; box-shadow: 0 2px 0 #6e130d; font-size: 4cqw; font-weight: 900; letter-spacing: .2em; padding-left: 4.6cqw; text-transform: uppercase; white-space: nowrap; }
.pack-foot { position: absolute; left: 0; right: 0; top: 92%; z-index: 3; text-align: center; font-size: 3cqw; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.8); }

/* light: crinkled foil (lit relief of a noise), glare following the pointer, iridescent band */
.pack-crinkle { position: absolute; inset: 0; z-index: 6; pointer-events: none; mix-blend-mode: overlay; opacity: .62;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='400'><filter id='f' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.014 .05' numOctaves='4' seed='7' result='n'/><feDiffuseLighting in='n' lighting-color='%23fff' surfaceScale='4'><feDistantLight azimuth='235' elevation='52'/></feDiffuseLighting></filter><rect width='100%25' height='100%25' filter='url(%23f)'/></svg>") center / 100% 100%; }
.pack-irid { position: absolute; inset: 0; z-index: 7; pointer-events: none; mix-blend-mode: color-dodge; opacity: .13;
  background: linear-gradient(115deg, transparent 20%, rgba(255,80,160,.9) 36%, rgba(255,230,80,.9) 46%, rgba(80,255,200,.9) 56%, rgba(90,140,255,.9) 66%, transparent 82%);
  background-size: 300% 100%; background-position: calc(var(--mx) * 1%) 0; }
.pack-glare { position: absolute; inset: 0; z-index: 8; pointer-events: none; mix-blend-mode: soft-light;
  background: radial-gradient(circle at calc(var(--mx) * 1%) calc(var(--my) * 1%), rgba(255,255,255,.95), rgba(255,255,255,.25) 28%, transparent 55%); }
.pack-count { position: absolute; right: -10px; bottom: 16px; z-index: 9; background: #fbbf24; color: #1a1200; font-weight: 900; border-radius: 99px; padding: 2px 11px; font-size: 1.05rem; border: 2px solid #1c1a16; box-shadow: 2px 2px 0 rgba(28,26,22,.45); }
@keyframes pack-float { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-4px) rotate(.6deg); } }
@keyframes pulse { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }

.daily { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: center; }
.daily-card { width: 140px; }
.mission, .achievement { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mission:last-of-type, .achievement:last-of-type { border-bottom: 0; }
.mission-main { flex: 1; min-width: 0; }
.mission.claimed, .achievement.claimed { opacity: .5; }
.pity { display: grid; gap: 14px; grid-template-columns: 1fr; }
.pity-label { font-weight: 700; font-size: .9rem; }

/* ------------------------------------------------ pack opening overlay */
.overlay { position: fixed; inset: 0; z-index: 50; display: none; background: radial-gradient(circle at 50% 30%, #281f5a, #06070e 75%); overflow-y: auto; }
.overlay.open { display: block; }
.overlay.flash-legendary::after { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle, #fff7c0, rgba(251,191,36,.4) 40%, transparent 70%); animation: flash 1.3s ease-out forwards; }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.reveal { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 12px 40px; gap: 12px; }
.reveal-title { font-size: 1.5rem; font-weight: 800; letter-spacing: .04em; }
.reveal-hint { color: var(--muted); min-height: 1.5em; text-align: center; }
.reveal-note { color: var(--gold); text-align: center; }
.reveal-stage { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-width: 900px; --fw: clamp(96px, 28vw, 170px); }
.reveal-stage.count-1 { --fw: min(62vw, 250px); }
.reveal-stage.count-2, .reveal-stage.count-3, .reveal-stage.count-4 { --fw: clamp(100px, 30vw, 190px); }
/* 5 cards (a booster): 3 on the first row and 2 on the second on a phone, all 5 on one row on a wide screen (never 4 + 1) */
.reveal-stage.count-5 { --fw: min(170px, calc((100vw - 72px) / 3)); }
@media (min-width: 880px) { .reveal-stage.count-5 { --fw: 160px; flex-wrap: nowrap; } }
.reveal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.flip { position: relative; width: var(--fw); aspect-ratio: 5 / 7; perspective: 900px; cursor: pointer; margin-bottom: 26px; animation: dealin .5s both; }
.flip:nth-child(2) { animation-delay: .06s; } .flip:nth-child(3) { animation-delay: .12s; } .flip:nth-child(4) { animation-delay: .18s; } .flip:nth-child(5) { animation-delay: .24s; }
@keyframes dealin { from { opacity: 0; transform: translateY(40px) scale(.85); } to { opacity: 1; transform: none; } }
.flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .65s cubic-bezier(.2,.8,.2,1); }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-front { transform: rotateY(180deg); }
.flip-badges { position: absolute; left: 0; right: 0; bottom: -24px; display: flex; gap: 4px; justify-content: center; opacity: 0; transition: opacity .4s .4s; }
.flip.flipped .flip-badges { opacity: 1; }
.badge { font-size: .68rem; font-weight: 800; border-radius: 99px; padding: 2px 8px; letter-spacing: .05em; }
.badge.new { background: var(--good); color: #052512; }
.badge.holo { background: linear-gradient(90deg, #f0abfc, #67e8f9, #fde68a); color: #1b1230; }
.badge.dup { background: #2a3050; color: var(--muted); }
.burst { position: absolute; left: 50%; top: 50%; width: 10%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%) scale(0); background: radial-gradient(circle, var(--rc), transparent 70%); pointer-events: none; z-index: -1; }
.flip.burst-rare .burst, .flip.burst-epic .burst, .flip.burst-legendary .burst { animation: burst 1s ease-out; }
.flip.burst-epic .burst { animation-duration: 1.3s; }
.flip.burst-legendary .burst { animation-duration: 1.8s; }
@keyframes burst { 0% { transform: translate(-50%, -50%) scale(0); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(26); opacity: 0; } }
.flip.tease-epic:not(.flipped) .flip-back { animation: tease 1.5s ease-in-out infinite; --rc: #c084fc; }
.flip.tease-legendary:not(.flipped) .flip-back { animation: tease 1s ease-in-out infinite; --rc: #fbbf24; }
@keyframes tease { 0%, 100% { filter: drop-shadow(0 0 0 transparent); } 50% { filter: drop-shadow(0 0 14px var(--rc)); } }
.flip.flipped.burst-legendary .card, .flip.flipped.burst-epic .card { animation: pop .5s .3s both; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* ------------------------------------------------ modal and toast */
.modal { position: fixed; inset: 0; z-index: 60; display: none; background: rgba(4,5,10,.75); backdrop-filter: blur(4px); padding: 16px; overflow-y: auto; }
.modal.open { display: grid; place-items: center; }
.modal-box { position: relative; background: var(--panel); border: 1px solid #343c5c; border-radius: 20px; padding: 24px 20px 20px; width: 100%; max-width: 520px; margin: auto; }
.modal-box.wide { max-width: 780px; }
.modal-x { position: absolute; top: 10px; right: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; z-index: 5; }
.detail { display: grid; grid-template-columns: minmax(150px, 280px) 1fr; gap: 22px; align-items: start; }
.detail-card { width: 100%; }
.detail-info h3 { margin-top: 0; font-size: 1.4rem; }
.flavor-line { font-style: italic; color: #c3cae0; }
.welcome-list { padding-left: 0; list-style: none; }
.welcome-list li { margin: 8px 0; }
.toast { position: fixed; left: 50%; bottom: 88px; transform: translate(-50%, 20px); z-index: 80; background: #222a47; border: 1px solid #3c4770; border-radius: 99px; padding: 10px 20px; opacity: 0; pointer-events: none; transition: .3s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------ workshop */
.price-table { max-width: 420px; margin: 12px 0; }
.craft-list, .gift-list { max-height: 420px; overflow-y: auto; margin: 8px 0; }
.craft-row, .gift-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.gift-row.picked { background: rgba(124,92,255,.12); }
.craft-emblem { width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.4rem; background: var(--panel-2); border: 2px solid; border-radius: 10px; flex: 0 0 auto; }
.craft-name { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.craft-name small { font-size: .78rem; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid #343c5c; background: var(--panel-2); cursor: pointer; font-size: 1.1rem; }
.code-box { margin-top: 10px; }

/* ------------------------------------------------ profile */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-box { background: var(--panel-2); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; text-align: center; }
.stat-box b { font-size: 1.3rem; }
.stat-box span { font-size: .72rem; color: var(--muted); }
.pull-row { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 10px; font-size: .9rem; }
.pull-row .bar { margin: 0; }
.pull-row span:last-child { text-align: right; }

.almanac-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; text-transform: capitalize; }
.almanac-head, .almanac-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.almanac-head { text-align: center; color: var(--muted); font-size: .8rem; margin-bottom: 4px; }
.day { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .75rem; color: var(--muted); }
.day.empty { background: none; border: 0; }
.day.future { opacity: .35; }
.day.today { border-color: var(--accent-2); }
.day.got { border: 2px solid var(--rc); color: var(--text); cursor: pointer; background: color-mix(in srgb, var(--rc) 14%, var(--panel-2)); }
.day-num { position: absolute; top: 2px; left: 5px; font-size: .62rem; }
.day-emblem { font-size: 1.5rem; }

/* ------------------------------------------------ larger screens */
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 2fr repeat(5, 1fr); }
  .filters input { grid-column: auto; }
  .pity { grid-template-columns: 1fr 1fr; }
  .daily { grid-template-columns: 180px 1fr; }
  .daily-card { width: 180px; }
}
@media (min-width: 900px) {
  .card-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .top-inner { padding: 8px 12px; gap: 8px; }
  .logo { font-size: 1.05rem; }
  .logo small:not(.beta-badge) { display: none; }
  .pills { gap: 6px; }
  .pill { padding: 4px 9px; font-size: .88rem; }
  .hero { flex-direction: column; text-align: center; }
  .progress-line { flex-direction: column; align-items: stretch; }
  .detail { grid-template-columns: 1fr; }
  .detail-card { max-width: 260px; margin: 0 auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .daily { grid-template-columns: 110px 1fr; gap: 14px; }
  .daily-card { width: 110px; }
  .pull-row { grid-template-columns: 90px 1fr 34px; }
}

/* ------------------------------------------------ accessibility */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .sheen, .pack-glow, .pack-float { animation: none !important; }
}


/* ---------- full art: the illustration covers the whole card, text sits on top ---------- */
.card.fullart .card-art { position: absolute; inset: 0; border: 0; border-radius: 0; z-index: 0; }
.card.fullart .emblem { font-size: 7.6em; align-items: flex-start; padding-top: 19%; filter: drop-shadow(0 .1em .25em rgba(0,0,0,.7)) drop-shadow(0 0 .5em rgba(255,255,255,.35)); }
.card.fullart .card-inner::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.6) 0, transparent 20%, transparent 50%, rgba(5,6,12,.88) 80%, rgba(5,6,12,.95) 100%); }
.card.fullart .card-head, .card.fullart .card-ribbon, .card.fullart .card-role, .card.fullart .leader-face, .card.fullart .card-flavor, .card.fullart .card-number, .card.fullart .missing-note { position: relative; z-index: 2; }
.card.fullart .card-ribbon { margin-top: auto; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.card.fullart .card-name { font-size: calc(1.2em * var(--fit, 1)); }
.card.fullart .card-type { background: rgba(0,0,0,.55); }
.card.fullart .card-flavor { color: #d6dcf0; }
.card.fullart .sheen, .card.fullart .foil-layer { z-index: 3; }
.card.fullart .sheen { opacity: 1; animation: sheen 4.2s ease-in-out infinite; }
.card.fullart .foil-layer { opacity: .35; }
.card.fullart:not(.tilt) .foil-layer { animation: foilmove 6s ease-in-out infinite alternate; }
.card.fullart .card-inner { box-shadow: 0 .4em 1.2em rgba(0,0,0,.5), 0 0 1.6em color-mix(in srgb, var(--rc) 60%, transparent); }
.fa-badge { position: absolute; top: 12%; right: 6%; z-index: 4; font-size: .55em; font-weight: 800; letter-spacing: .12em; color: #fff; background: rgba(0,0,0,.55); border: .1em solid var(--rc); border-radius: .5em; padding: .15em .5em; }

.news-line { font-size: .9rem; background: rgba(255,255,255,.06); border-left: 3px solid var(--accent); border-radius: 6px; padding: 6px 10px; margin: 8px 0; }

.art-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.card.fullart .art-photo { filter: saturate(1.1) contrast(1.05); }
.thumb { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.craft-emblem { overflow: hidden; }
.day-emblem { overflow: hidden; }

/* ---------- leaders (06/10): cards of the dirigeant game, shown on the home screen ---------- */
.leader-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.leader-chip { width: 48px; height: 48px; display: grid; place-items: center; font-size: 1.6rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; }
.leader-chip.locked { opacity: .45; filter: grayscale(1); }
.set-select { background: var(--panel-2); color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font: inherit; max-width: 100%; }

a.btn { display: inline-block; color: inherit; text-decoration: none; }
.leader-face { display: flex; flex-direction: column; gap: .2em; font-size: .78em; padding: .3em .1em; }
.leader-face b { color: #ffd27a; }

/* ------------------------------------------------ beta badge (next to the logo, every page) */
.beta-badge { display: inline-block; align-self: center; padding: 1px 8px 2px; border-radius: 999px; transform: rotate(-4deg);
  background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2400; font-size: .62rem; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; box-shadow: 0 1px 6px rgba(245, 158, 11, .45); }

/* ------------------------------------------------ pack intro of the booster opening (08/10) */
.reveal-intro { display: flex; flex-direction: column; align-items: center; padding: 8px 0 22px; }
.reveal-intro .pack-visual { width: min(62vw, 240px); }
.reveal-intro .pack-count { display: none; }
.pack-strip { position: absolute; left: 0; right: 0; top: 0; height: 6.2%; z-index: 12; pointer-events: none; transform-origin: 0 100%;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.65) 0 1px, rgba(0,0,0,.28) 1px 3px), linear-gradient(180deg, color-mix(in srgb, var(--pa) 70%, #fff), var(--pb) 70%, var(--pc));
  clip-path: polygon(0 12%, 3.3% 0, 6.6% 12%, 10% 0, 13.3% 12%, 16.6% 0, 20% 12%, 23.3% 0, 26.6% 12%, 30% 0, 33.3% 12%, 36.6% 0, 40% 12%, 43.3% 0, 46.6% 12%, 50% 0, 53.3% 12%, 56.6% 0, 60% 12%, 63.3% 0, 66.6% 12%, 70% 0, 73.3% 12%, 76.6% 0, 80% 12%, 83.3% 0, 86.6% 12%, 90% 0, 93.3% 12%, 96.6% 0, 100% 12%, 100% 100%, 0 100%); }
.reveal-intro .pack-body .pack-crimp:not(.bottom) { visibility: hidden; }
.reveal-intro.tearing .pack-visual { pointer-events: none; }
.reveal-intro.tearing .pack-float { animation: none; }
.reveal-intro.tearing .pack-tilt { animation: pack-shake .38s linear; }
.reveal-intro.tearing .pack-strip { animation: strip-off .75s .3s cubic-bezier(.5, 0, 1, .6) forwards; }
.reveal-intro.tearing .pack-body { animation: pack-out .55s .62s ease-in forwards; }
.reveal-intro.tearing::after { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 42%, rgba(255,255,255,.95), rgba(255,214,120,.5) 35%, transparent 65%); opacity: 0; animation: tear-flash .6s .55s ease-out forwards; z-index: 70; }
@keyframes pack-shake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-3deg) translateX(-3px); } 35% { transform: rotate(3deg) translateX(3px); } 55% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
@keyframes strip-off { to { transform: translate(35%, -260%) rotate(28deg); opacity: 0; } }
@keyframes pack-out { to { transform: translateY(26px) scale(.86); opacity: 0; } }
@keyframes tear-flash { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .reveal-intro.tearing * { animation: none !important; } }
