@property --liquid { syntax: "<color>"; inherits: true; initial-value: #f09a28; }
@property --part { syntax: "<number>"; inherits: true; initial-value: 0; }

* { box-sizing: border-box; margin: 0; }
html {
  --ink: #f3f1ec;
  --soft: #a3a29d;
  --line: #2c2e31;
  --face: #1b1d1f;
  --mx: 0; --my: 0; --scroll: 0;
  background: #101112; color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden;
  transition: --liquid .9s ease;
}
body { overflow-x: clip; touch-action: pan-y; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; -webkit-user-drag: none; user-select: none; }
:focus-visible { outline: 2px solid var(--liquid); outline-offset: 4px; border-radius: 6px; }
svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.over, .over * { cursor: grab; }
.turning, .turning * { cursor: grabbing; user-select: none; }

/* Fond */
#glow {
  position: fixed; inset: -20%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 42% at calc(50% + var(--mx) * 3%) calc(48% + var(--my) * 3%), color-mix(in oklab, var(--liquid) 46%, transparent), transparent 72%),
    radial-gradient(60% 50% at 50% 112%, color-mix(in oklab, var(--liquid) 22%, transparent), transparent 70%);
  opacity: calc(1 - clamp(0, var(--scroll) - 2.2, 1) * .82);
}
#bubbles { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: calc(1 - clamp(0, var(--scroll) - 2, 1)); }
#bubbles i {
  position: absolute; left: var(--x); bottom: -20px; width: var(--s); height: var(--s); border-radius: 50%;
  border: 1px solid color-mix(in oklab, var(--liquid) 70%, white); opacity: 0; animation: rise var(--d) linear var(--o) infinite;
}
@keyframes rise { 8% { opacity: .5; } 85% { opacity: .3; } 100% { transform: translate(28px, -106vh); opacity: 0; } }
#stage { position: fixed; inset: 0; width: 100vw; height: 100svh; z-index: 2; pointer-events: none; }
.burst #stage { animation: jolt .6s; }
@keyframes jolt { 10% { transform: translate(-9px, 6px); } 25% { transform: translate(8px, -7px); } 40% { transform: translate(-6px, 4px); } 60% { transform: translate(4px, -3px); } 80% { transform: translate(-2px, 1px); } }
#flat { display: none; }
.flat #stage { display: none; }
.flat #flat { display: block; position: absolute; z-index: 2; left: 50%; top: 47svh; height: 58svh; transform: translate(-50%, -50%); }

/* En-tête */
header {
  position: fixed; inset: 0 0 auto; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 4vw, 56px) 18px;
}
header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(#101112 30%, transparent); opacity: 0; transition: opacity .3s;
}
.scrolled header::before { opacity: 1; }
.brand { font-weight: 900; font-size: 20px; letter-spacing: -.03em; }
nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); font-weight: 600; font-size: 16px; }
nav > :not(.get) { opacity: .8; transition: opacity .2s; }
nav > :not(.get):hover { opacity: 1; }
.get { font-weight: 750; background: var(--ink); color: #101112; border-radius: 999px; transition: transform .2s, background .3s; }
.get:hover { background: color-mix(in oklab, var(--liquid) 35%, white); }
.get:active { transform: scale(.96); }
.get.small { padding: 9px 18px; }
.get.big { display: inline-flex; align-items: center; gap: 12px; padding: 20px 34px; font-size: 20px; }
.get.big svg { width: 22px; }

h1, h2 { font-family: "Arial Black", "Segoe UI Black", "Roboto Black", Roboto, system-ui, sans-serif; font-weight: 900; letter-spacing: -.045em; line-height: .92; }
h2 { font-size: clamp(40px, 7vw, 104px); }

#maintenance:not([hidden]) { position: fixed; z-index: 11; inset: auto 0 0; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: #f0c85c; color: #101112; font-weight: 650; text-align: center; }

/* Scène */
main { position: relative; }
section { position: relative; min-height: 100svh; padding: 0 clamp(18px, 4vw, 56px); }
.hero { height: 100svh; overflow: clip; }
#name {
  position: absolute; z-index: 1; inset: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 0 .22em;
  padding: 0 3vw 19svh; text-align: center; text-transform: uppercase; line-height: .84; user-select: none;
  font-size: min(calc(108vw / var(--fit, 8)), 29svh);
  color: color-mix(in oklab, var(--liquid) 88%, white);
  transform: translate(calc(var(--mx) * -14px), calc(var(--my) * -8px + var(--scroll) * 24vh)) scale(calc(1 + var(--scroll) * .12));
  opacity: calc(1 - var(--scroll) * 1.5);
}
.word { display: inline-flex; overflow: clip; overflow-clip-margin: .08em; padding-top: .06em; }
.letter { display: inline-block; animation: up .62s cubic-bezier(.2, .9, .2, 1) backwards; }
@keyframes up { from { transform: translateY(112%) rotate(9deg); } }
.facts {
  position: absolute; z-index: 3; left: clamp(18px, 4vw, 56px); bottom: calc(148px + env(safe-area-inset-bottom)); display: grid; gap: 12px;
  opacity: calc(1 - var(--scroll) * 2.4);
}
#line { font-size: 18px; font-weight: 600; }
.facts dl { display: flex; gap: 28px; }
dt { font-size: 14px; color: var(--soft); }
dd { font-weight: 650; font-variant-numeric: tabular-nums; }
.facts dd span { font-size: 26px; letter-spacing: -.02em; }
.rarity { display: inline-flex; align-items: center; gap: 5px; font-size: 15px; }
.rarity i { width: 9px; height: 9px; rotate: 45deg; border: 1.4px solid currentColor; opacity: .45; }
.rarity i.on { background: currentColor; opacity: 1; }
.rarity b { margin-left: 6px; font-weight: 600; }
.rarity.legendary { color: #f0c85c; }
.turner {
  position: absolute; z-index: 3; right: clamp(18px, 4vw, 56px); bottom: calc(150px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 16px;
  font-weight: 600; font-variant-numeric: tabular-nums; opacity: calc(1 - var(--scroll) * 2.4);
}
.turner button { width: 54px; height: 54px; display: grid; place-items: center; border: 1.5px solid rgb(255 255 255 / .28); border-radius: 50%; transition: background .2s, color .2s, scale .2s; }
.turner button:hover { background: var(--ink); color: #101112; }
.turner button:active { scale: .92; }
.turner svg { width: 22px; }
#rail {
  position: absolute; z-index: 3; inset: auto 0 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 14px clamp(18px, 4vw, 56px) calc(20px + env(safe-area-inset-bottom)); opacity: calc(1 - var(--scroll) * 2.6);
  touch-action: pan-x;
}
#rail::-webkit-scrollbar { display: none; }
#rail button { flex: none; padding: 8px 11px; border-radius: 12px; opacity: .5; transition: opacity .25s, translate .35s cubic-bezier(.2, 1.6, .4, 1), background .25s; }
#rail button:first-child { margin-left: auto; } #rail button:last-child { margin-right: auto; }
#rail img { height: 78px; }
#rail button:hover { opacity: 1; translate: 0 -5px; }
#rail [aria-current="true"] { opacity: 1; translate: 0 -8px; background: rgb(255 255 255 / .1); }

/* Textes */
.copy { position: relative; z-index: 3; max-width: 560px; display: grid; gap: 22px; justify-items: start; }
.copy p, .guest p { font-size: clamp(18px, 1.6vw, 23px); color: #d9d7d1; max-width: 24em; text-wrap: pretty; }
.inside, .burst { display: flex; align-items: center; }
.burst { justify-content: flex-end; }
main .burst .copy { width: min(46vw, 560px); }
.reveal { transition: opacity .8s, translate .9s cubic-bezier(.2, .9, .2, 1); }
.ready .reveal:not(.in) { opacity: 0; translate: 0 44px; }
.press {
  position: relative; overflow: hidden; padding: 18px 30px; border-radius: 999px; background: var(--ink); color: #101112; font-weight: 750; font-size: 18px;
  touch-action: none; user-select: none; -webkit-user-select: none; transition: scale .2s, background .3s;
}
.press:hover { background: color-mix(in oklab, var(--liquid) 35%, white); }
.press:active { scale: .96; }
.press:disabled { opacity: .5; }
#shake::before { content: ""; position: absolute; inset: 0; background: var(--liquid); transform: scaleX(0); transform-origin: left; transition: transform .4s; }
#shake.on::before { transform: scaleX(1); transition: transform 1.6s linear; }
#shake.on { animation: shake .09s infinite; }
#shake span { position: relative; }
@keyframes shake { 25% { translate: -2px 1px; } 75% { translate: 2px -1px; } }
.warm #stage { filter: saturate(1.15) brightness(1.05); }
.quiet { color: var(--soft); font-weight: 600; } .quiet:hover { color: var(--ink); }

/* Étagères */
.wall, .own, .download { z-index: 4; }
.wall { padding-top: 130px; padding-bottom: 60px; background: linear-gradient(transparent, #101112 220px); }
.head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 52px; }
#filters { display: flex; flex-wrap: wrap; gap: 8px; }
#filters button { padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); color: var(--soft); font-weight: 600; font-size: 15px; transition: .2s; }
#filters button:hover { color: var(--ink); border-color: #55585c; }
#filters [aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #101112; }
.shelf { margin-bottom: 46px; perspective: 900px; }
.cans { display: grid; grid-template-columns: repeat(var(--per), minmax(0, 1fr)); align-items: end; padding: 0 1vw; }
.can {
  --rx: 0; --ry: 0; position: relative; display: grid; justify-items: center; transform-style: preserve-3d; transform-origin: 50% 100%;
  transition: transform .35s cubic-bezier(.2, 1.4, .4, 1); z-index: 1;
}
.can img { width: 72%; height: auto; filter: drop-shadow(0 5px 4px rgb(0 0 0 / .5)); transition: filter .3s, transform .7s cubic-bezier(.2, 1.2, .3, 1), opacity .5s; transition-delay: calc(var(--k) * 45ms); }
.ready .shelf:not(.in) .can img { transform: translateY(-70px) rotate(-7deg); opacity: 0; }
.can:hover { transform: rotateY(calc(var(--rx) * 22deg)) rotateX(calc(var(--ry) * -10deg)) translateY(-8px) scale(1.12); z-index: 5; }
.can:hover img { filter: drop-shadow(0 16px 14px rgb(0 0 0 / .6)) brightness(1.08); transition-delay: 0s; }
.can.hidden img { opacity: .55; }
.can.no { animation: no .4s; }
@keyframes no { 20%, 60% { translate: -5px; } 40%, 80% { translate: 5px; } }
.can.owned::after { content: ""; position: absolute; bottom: -13px; width: 7px; height: 7px; border-radius: 50%; background: #7ccb62; z-index: 3; }
.can.legendary img { animation: gold 3.4s ease-in-out infinite; }
@keyframes gold { 50% { filter: drop-shadow(0 0 12px rgb(240 200 92 / .55)); } }
.tag { position: absolute; bottom: calc(100% + 8px); padding: 5px 11px; border-radius: 8px; background: var(--ink); color: #101112; font-size: 14px; font-weight: 650; white-space: nowrap; opacity: 0; translate: 0 6px; transition: .2s; pointer-events: none; }
.can:hover .tag, .can:focus-visible .tag { opacity: 1; translate: 0; }
.cans .can:first-child .tag { left: 0; } .cans .can:last-child .tag { right: 0; }
.plank { height: 17px; margin-top: -4px; border-radius: 2px; background: linear-gradient(#4a4d53, #2d3034 14%, #222427); box-shadow: 0 18px 26px rgb(0 0 0 / .55); position: relative; }
.none { padding: 40px 0; color: var(--soft); }

/* Collection */
.own { display: grid; align-content: center; min-height: 70svh; padding-top: 80px; padding-bottom: 80px; background: #101112; }
.guest { display: grid; justify-items: center; gap: 24px; text-align: center; }
.member { display: none; }
.signed .member { display: block; } .signed .guest { display: none; }
.board { display: grid; grid-template-columns: auto 1fr auto; gap: clamp(24px, 5vw, 80px); align-items: center; }
.ring { position: relative; width: clamp(170px, 19vw, 260px); aspect-ratio: 1; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; rotate: -90deg; stroke-width: 9; color: var(--face); }
.ring .part { color: var(--liquid); stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--part)); transition: stroke-dashoffset 1.4s cubic-bezier(.2, .8, .2, 1); opacity: min(1, calc(var(--part) * 1000)); }
.ring p { text-align: center; color: var(--soft); font-weight: 600; }
.ring b { display: block; font-size: clamp(54px, 6vw, 86px); line-height: 1; letter-spacing: -.04em; color: var(--ink); }
#levels { display: grid; gap: 18px; }
.level { display: grid; grid-template-columns: 150px 1fr 64px; gap: 16px; align-items: center; }
.gauge { height: 8px; border-radius: 4px; background: var(--face); overflow: hidden; }
.gauge::before { content: ""; display: block; height: 100%; width: 100%; border-radius: 4px; background: var(--ink); transform-origin: left; transform: scaleX(var(--w)); transition: transform 1.2s; }
.gauge.legendary::before { background: #f0c85c; }
.num { text-align: right; color: var(--soft); font-variant-numeric: tabular-nums; }
.sums { display: grid; gap: 18px; } .sums dd { font-size: 22px; }
#last { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 54px; }
.recent { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: 16px; background: var(--face); text-align: left; transition: background .2s, translate .3s; }
.recent:enabled:hover { background: #25282b; translate: 0 -4px; }
.recent img { height: 84px; }
.recent .text { display: grid; min-width: 0; } .recent small { color: var(--soft); font-size: 14px; } .recent em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

/* Téléchargement */
.download { display: flex; align-items: center; justify-content: space-between; gap: 40px; min-height: 84svh; padding-top: 60px; padding-bottom: 80px; background: linear-gradient(#101112, color-mix(in oklab, var(--liquid) 26%, #101112)); }
.download h2 { margin-bottom: 40px; }
#version { margin-top: 18px; color: #d9d7d1; }
#notes { margin-top: 14px; padding: 0; list-style: none; color: #d9d7d1; }
.download ol { display: flex; flex-wrap: wrap; gap: 12px 34px; margin-top: 40px; padding: 0; list-style: none; counter-reset: n; }
.download ol li { counter-increment: n; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.download ol li::before { content: counter(n); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 14px; }
.qr { flex: none; width: 190px; } .qr svg { display: block; width: 100%; border-radius: 16px; stroke: none; }

/* Connexion */
dialog { width: min(420px, calc(100vw - 32px)); margin: auto; padding: 0; border: 0; border-radius: 24px; background: var(--face); color: var(--ink); }
dialog::backdrop { background: rgb(0 0 0 / .66); backdrop-filter: blur(6px); }
dialog[open] { animation: pop .4s cubic-bezier(.2, 1.3, .4, 1); }
@keyframes pop { from { transform: translateY(40px) scale(.94); opacity: 0; } }
#login-form { display: grid; gap: 18px; padding: 32px; }
#login-form h2 { font-size: 34px; margin-bottom: 4px; }
label { display: grid; gap: 6px; font-size: 15px; color: var(--soft); }
input { padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #101112; color: var(--ink); font-size: 17px; letter-spacing: .02em; }
#code { letter-spacing: .5em; font-size: 22px; }
input:focus { outline: 0; border-color: var(--liquid); }
#login-error { color: #f2867e; min-height: 1.5em; margin: -8px 0; }

@media (max-width: 760px) {
  nav > a:not(.get) { display: none; }
  #name { font-size: min(calc(112vw / var(--fit, 8)), 15svh); align-content: start; padding-top: 11svh; }
  .facts { bottom: calc(128px + env(safe-area-inset-bottom)); gap: 7px; }
  .facts dl { gap: 18px; } .facts dd { font-size: 14px; } .facts dd span { font-size: 20px; } dt { font-size: 13px; }
  .turner { bottom: calc(176px + env(safe-area-inset-bottom)); gap: 10px; } .turner button { width: 46px; height: 46px; } #place { display: none; }
  #rail img { height: 62px; }
  .inside, .burst { align-items: flex-end; padding-bottom: 12svh; }
  .burst { justify-content: flex-start; } main .burst .copy { width: 100%; }
  .copy { gap: 14px; }
  .head { margin-bottom: 36px; } #filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -18px; padding: 0 18px; scrollbar-width: none; touch-action: pan-x; } #filters button { flex: none; }
  .tag { font-size: 12px; }
  .board { grid-template-columns: 1fr; justify-items: center; } #levels, .sums { width: 100%; } .sums { grid-template-columns: repeat(3, auto); }
  .level { grid-template-columns: 122px 1fr 56px; gap: 10px; }
  .qr { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
