/* Relic Quest — the public site. Same palette and type as the game. */
:root {
  --bg: #07070c; --panel: rgba(18, 16, 26, .78); --line: rgba(212, 167, 58, .28); --line-hi: rgba(212, 167, 58, .7);
  --gold: #d4a73a; --gold-hi: #ffe08a; --ink: #ece1c4; --ink-dim: #b8ab8c; --muted: #8a8a96; --violet: #c9a2ff;
  --display: "Cinzel", "Palatino Linotype", Georgia, serif; --decor: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --body: "EB Garamond", "Book Antiqua", "Palatino Linotype", Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 19px; line-height: 1.55; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--gold-hi); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .03em; margin: 0; }
h2 { font-size: clamp(1.9rem, 4.6vw, 3.2rem); line-height: 1.12; color: #fff3d6; text-wrap: balance; }
h2 span { display: block; color: var(--gold-hi); font-family: var(--decor); font-size: .78em; text-shadow: 0 0 30px rgba(255, 210, 120, .35); }
section { position: relative; z-index: 2; padding: clamp(64px, 11vw, 140px) clamp(16px, 5vw, 64px); max-width: 1240px; margin: 0 auto; }
.kicker { font-family: var(--display); font-size: .82rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; display: flex; align-items: center; gap: 12px; }
.kicker::before { content: ""; width: 40px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.lead { color: var(--ink-dim); font-size: 1.15rem; max-width: 640px; margin: 14px 0 0; }

/* ---- the sky behind everything ---- */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.sky video { position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover; opacity: .85; transform: translate3d(0, var(--par, 0), 0) scale(1.04); }
.sky-fade { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%, transparent 0, rgba(7, 7, 12, .25) 50%, rgba(7, 7, 12, .78) 100%); }
.embers { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.cursor-glow { position: fixed; z-index: 1; width: 520px; height: 520px; left: 0; top: 0; margin: -260px 0 0 -260px; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 110, .1), rgba(201, 162, 255, .05) 40%, transparent 70%); transform: translate3d(var(--mx, -999px), var(--my, -999px), 0); transition: opacity .4s; mix-blend-mode: screen; }
@media (hover: none) { .cursor-glow { display: none; } }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; }
.progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, #8a6a20, var(--gold-hi), #fff); box-shadow: 0 0 12px var(--gold); }

/* ---- nav ---- */
nav.top { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; gap: 18px; padding: 12px clamp(16px, 4vw, 40px); transition: background .4s, backdrop-filter .4s, padding .4s; }
nav.top.solid { background: rgba(7, 7, 12, .72); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid rgba(212, 167, 58, .18); padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--decor); font-weight: 900; letter-spacing: .06em; }
.brand img { border-radius: 50%; box-shadow: 0 0 14px rgba(255, 200, 100, .35); }
.links { display: flex; gap: 4px; margin-left: auto; }
.links a { color: var(--ink-dim); text-decoration: none; font-family: var(--display); font-size: .84rem; letter-spacing: .12em; text-transform: uppercase; padding: 8px 12px; border-radius: 999px; position: relative; transition: color .25s; }
.links a::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: 3px; height: 1px; background: var(--gold-hi); transition: left .3s var(--ease), right .3s var(--ease); }
.links a:hover, .links a.on { color: var(--gold-hi); }
.links a:hover::after, .links a.on::after { left: 14px; right: 14px; }
@media (max-width: 860px) { .links { display: none; } nav.top .btn { margin-left: auto; } }

/* ---- buttons ---- */
.btn { --tx: 0px; --ty: 0px; position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 14px 26px; border-radius: 999px; font-family: var(--display); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .9rem; text-decoration: none; overflow: hidden; isolation: isolate;
  transform: translate3d(var(--tx), var(--ty), 0); transition: transform .35s var(--ease), box-shadow .35s, background .35s; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn.gold { color: #1b1305; background: linear-gradient(180deg, #ffe7a3, #e2b24a 55%, #b9861f); box-shadow: 0 0 0 1px rgba(255, 230, 160, .6) inset, 0 10px 30px rgba(212, 167, 58, .35), 0 0 40px rgba(255, 200, 90, .18); }
.btn.gold::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%); transform: translateX(-120%); animation: sheen 4.5s 1.5s infinite; }
.btn.gold:hover { box-shadow: 0 0 0 1px rgba(255, 240, 190, .9) inset, 0 14px 44px rgba(212, 167, 58, .55), 0 0 70px rgba(255, 200, 90, .3); }
.btn.ghost { color: var(--ink); border: 1px solid var(--line-hi); background: rgba(10, 9, 14, .4); backdrop-filter: blur(6px); }
.btn.ghost:hover { background: rgba(212, 167, 58, .12); color: var(--gold-hi); }
.btn.big { padding: 18px 32px; font-size: 1rem; }
.btn.small { padding: 9px 18px; font-size: .78rem; }
.btn .ver { font-family: var(--body); font-style: italic; text-transform: none; letter-spacing: 0; opacity: .7; font-weight: 500; }
.btn .ver:empty { display: none; }
.btn:active { transform: translate3d(var(--tx), var(--ty), 0) scale(.97); }
@keyframes sheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* ---- hero ---- */
.hero { position: relative; z-index: 2; min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 24px; padding: 96px clamp(16px, 5vw, 64px) 64px; max-width: 1340px; margin: 0 auto; }
.hero-art { text-align: center; }
.medallion { position: relative; width: min(300px, 62vw); margin: 0 auto; aspect-ratio: 1; animation: float 7s ease-in-out infinite; }
.medallion img { position: relative; z-index: 2; width: 100%; height: 100%; border-radius: 50%; filter: drop-shadow(0 20px 50px rgba(0, 0, 0, .8)); animation: breathe 5s ease-in-out infinite; }
.medallion .ring { position: absolute; inset: -9%; border-radius: 50%; z-index: 1; }
.medallion .r1 { background: conic-gradient(from 0deg, transparent 0 20%, rgba(255, 140, 60, .55) 28%, transparent 36% 62%, rgba(110, 170, 255, .55) 70%, transparent 78%); filter: blur(14px); animation: spin 14s linear infinite; }
.medallion .r2 { inset: -3%; border: 1px dashed rgba(255, 220, 140, .3); animation: spin 60s linear infinite reverse; }
.wordmark { position: relative; width: min(520px, 90vw); margin: 4px auto 0; overflow: hidden; -webkit-mask-image: url(img/wordmark.webp); mask-image: url(img/wordmark.webp); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.wordmark img { width: 100%; height: auto; }
.wordmark .shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 245, 210, .75) 48%, transparent 60%); transform: translateX(-110%); animation: sheen 6s 1.2s infinite; mix-blend-mode: overlay; }
.tagline { font-family: var(--display); font-size: clamp(1.05rem, 2vw, 1.3rem); letter-spacing: .14em; color: var(--ink); margin: 8px 0 0; }
.tagline em { font-style: normal; color: var(--gold-hi); text-shadow: 0 0 18px rgba(255, 210, 120, .6); }
.sub { color: var(--ink-dim); max-width: 520px; margin: 14px auto 0; font-size: 1.08rem; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 26px; }
.facts { list-style: none; display: flex; justify-content: center; gap: clamp(18px, 4vw, 40px); padding: 0; margin: 34px 0 0; }
.facts li { display: flex; flex-direction: column; align-items: center; }
.facts b { font-family: var(--decor); font-size: 2rem; color: var(--gold-hi); line-height: 1; text-shadow: 0 0 20px rgba(255, 200, 100, .35); }
.facts span { font-family: var(--display); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.hero-fan { position: relative; height: min(560px, 70vh); perspective: 1200px; }
.hero-fan .fan { position: absolute; left: 50%; top: 50%; width: min(220px, 18vw); --r: 0deg; --x: 0px; --y: 0px;
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .8s var(--ease), box-shadow .4s; }
.hero-fan .f0 { --r: -24deg; --x: -150px; --y: 40px; }
.hero-fan .f1 { --r: -12deg; --x: -76px; --y: 8px; }
.hero-fan .f2 { --r: 0deg; --x: 0px; --y: -6px; z-index: 3; }
.hero-fan .f3 { --r: 12deg; --x: 76px; --y: 8px; }
.hero-fan .f4 { --r: 24deg; --x: 150px; --y: 40px; }
.hero-fan .f1, .hero-fan .f3 { z-index: 2; }
body.dealt .hero-fan .fan:hover { --y: -40px; z-index: 5; }
body:not(.dealt) .hero-fan .fan { --r: 0deg; --x: 0px; --y: 60vh; }
.hero-fan .fan:nth-child(1) { transition-delay: .05s; } .hero-fan .fan:nth-child(2) { transition-delay: .12s; } .hero-fan .fan:nth-child(3) { transition-delay: .19s; } .hero-fan .fan:nth-child(4) { transition-delay: .26s; } .hero-fan .fan:nth-child(5) { transition-delay: .33s; }
body.dealt .hero-fan .fan { transition-delay: 0s; }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; width: 26px; height: 42px; margin-left: -13px; border: 1px solid var(--line-hi); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold-hi); animation: cue 1.8s infinite; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 84px; }
  .hero-fan { height: 320px; order: 2; }
  .hero-fan .fan { width: 132px; }
  .hero-fan .f0 { --x: -96px; --y: 26px; } .hero-fan .f1 { --x: -50px; } .hero-fan .f3 { --x: 50px; } .hero-fan .f4 { --x: 96px; --y: 26px; }
  .scroll-cue { display: none; }
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes breathe { 0%, 100% { filter: drop-shadow(0 20px 50px rgba(0, 0, 0, .8)) drop-shadow(0 0 0 rgba(255, 190, 90, 0)); } 50% { filter: drop-shadow(0 20px 50px rgba(0, 0, 0, .8)) drop-shadow(0 0 34px rgba(255, 190, 90, .35)); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---- cards, as the game draws them ---- */
.gc { --rx: 0deg; --ry: 0deg; --gx: 50%; --gy: 30%; position: relative; margin: 0; aspect-ratio: 5 / 7; border-radius: 14px; overflow: hidden; background: #0b0b10; cursor: zoom-in;
  border: 1px solid rgba(212, 167, 58, .55); box-shadow: 0 18px 40px rgba(0, 0, 0, .65), 0 0 0 1px rgba(0, 0, 0, .6);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .5s var(--ease), box-shadow .4s, border-color .4s; }
.gc > img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; transition: transform .8s var(--ease); }
.gc.sky > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.gc::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 240, 200, .28), transparent 45%); opacity: 0; transition: opacity .4s; mix-blend-mode: overlay; }
.gc:hover { border-color: var(--gold-hi); box-shadow: 0 26px 60px rgba(0, 0, 0, .75), 0 0 32px rgba(255, 200, 100, .28); }
.gc:hover::after { opacity: 1; }
.gc:hover > img { transform: scale(1.06); }
.gc figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 30% 10px 12px; text-align: center; font-family: var(--display); font-weight: 700; font-size: clamp(.78rem, 1.2vw, 1rem); color: #fff3d6; line-height: 1.15;
  background: linear-gradient(180deg, transparent, rgba(6, 6, 9, .82) 55%, rgba(6, 6, 9, .95)); text-shadow: 0 1px 4px #000; }
.gc figcaption small { display: block; font-family: var(--body); font-weight: 400; font-size: .82em; color: #e2d6ba; margin-top: 4px; }
.gc-val { position: absolute; top: 8px; left: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: .9rem; color: #fff3d6;
  background: radial-gradient(circle at 40% 30%, #3a3a46, #101016); border: 1px solid rgba(212, 167, 58, .8); box-shadow: 0 2px 6px rgba(0, 0, 0, .8); }
.gc.sky .gc-val { border-color: rgba(201, 162, 255, .7); }
.gc-type { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 40% 30%, #2a2a33, #0c0c10); border: 1px solid rgba(212, 167, 58, .75); }
.gc-type img { width: 70%; }
.gc.sky { border-color: rgba(201, 162, 255, .45); }
.js .gc.sky .sky-lines line { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease); }
.js .gc.sky.drawn .sky-lines line { stroke-dashoffset: 0; }
.gc.coin { background: radial-gradient(circle at 50% 40%, #2a2418, #0b0b10 70%); }
.gc.coin > img { width: 76%; height: auto; margin: 14% auto 0; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .7)); }
.gc.glow { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 30px rgba(255, 210, 120, .55); }

/* ---- scroll reveals ---- */
.js .reveal { opacity: 0; transform: translateY(40px); filter: blur(6px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; filter: none; }
.js .stagger > * { opacity: 0; transform: translateY(30px) scale(.97); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.js .stagger.in > * { opacity: 1; transform: none; }

/* ---- story ---- */
.story-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; margin-top: 28px; }
.prose p { margin: 0 0 16px; font-size: 1.15rem; color: #ddd1b3; }
.prose b { color: var(--gold-hi); font-weight: 600; }
.story-cards { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.story-cards .gc:nth-child(2) { transform: perspective(900px) translateY(-26px) rotateX(var(--rx)) rotateY(var(--ry)); }
@media (max-width: 800px) { .story-grid { grid-template-columns: 1fr; } }

/* ---- guide ---- */
.chapters { list-style: none; padding: 0; margin: 48px 0 0; display: flex; flex-direction: column; gap: clamp(40px, 7vw, 90px); counter-reset: ch; }
.chapter { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(20px, 5vw, 60px); align-items: center; }
.chapter:nth-child(even) .ch-text { order: 2; }
.ch-text .num { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; font-family: var(--decor); font-size: 1.3rem; color: #1b1305; background: radial-gradient(circle at 40% 30%, #ffe7a3, #c9952b); box-shadow: 0 0 24px rgba(255, 200, 90, .4); margin-bottom: 12px; }
.ch-text h3 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); color: #fff3d6; margin-bottom: 10px; }
.ch-text p { color: #d8ccae; margin: 0 0 12px; font-size: 1.1rem; }
.ch-text b { color: var(--gold-hi); font-weight: 600; }
.ch-art { position: relative; min-height: 300px; border-radius: 22px; padding: clamp(18px, 3vw, 30px); background: linear-gradient(160deg, rgba(30, 26, 40, .82), rgba(10, 9, 14, .85)); border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 240, 200, .06); overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 18px; backdrop-filter: blur(4px); }
.ch-art::before { content: ""; position: absolute; inset: -40%; background: radial-gradient(circle at 30% 30%, rgba(255, 190, 90, .1), transparent 40%), radial-gradient(circle at 75% 70%, rgba(150, 120, 255, .1), transparent 40%); animation: spin 40s linear infinite; pointer-events: none; }
.ch-art > * { position: relative; }
.targets { list-style: none; padding: 0; margin: 10px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.targets li { display: flex; flex-direction: column; align-items: center; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, .25); }
.targets b { font-family: var(--decor); color: var(--gold-hi); font-size: 1.4rem; line-height: 1; }
.targets span { font-size: .8rem; color: var(--muted); }
@media (max-width: 860px) { .chapter { grid-template-columns: 1fr; } .chapter:nth-child(even) .ch-text { order: 0; } }

/* chapter 1: essence */
.row-cards, .slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.art-essence .gc { opacity: 0; transform: translateY(-30px) rotate(-6deg); transition: all .7s var(--ease); }
.art-essence .plus { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; font-family: var(--decor); color: var(--gold-hi); }
.art-essence .plus span { opacity: 0; transform: translateY(10px); transition: all .5s var(--ease); }
.art-essence .plus .bonus { grid-column: 1 / -1; font-size: 1.1rem; color: #fff; text-shadow: 0 0 16px rgba(255, 200, 100, .8); }
.meter { position: relative; height: 34px; border-radius: 999px; background: rgba(0, 0, 0, .5); border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #6b3fd0, #c9a2ff, #ffe08a); box-shadow: 0 0 20px rgba(201, 162, 255, .7); transition: width 1.6s 1.6s var(--ease); }
.meter b, .meter em { position: relative; font-family: var(--display); font-size: .95rem; } .meter em { font-style: normal; color: var(--ink-dim); }
.chapter.in .art-essence .gc { opacity: 1; transform: none; }
.chapter.in .art-essence .gc:nth-child(2) { transition-delay: .15s; } .chapter.in .art-essence .gc:nth-child(3) { transition-delay: .3s; } .chapter.in .art-essence .gc:nth-child(4) { transition-delay: .45s; }
.chapter.in .art-essence .plus span { opacity: 1; transform: none; }
.chapter.in .art-essence .plus span:nth-child(1) { transition-delay: .6s; } .chapter.in .art-essence .plus span:nth-child(2) { transition-delay: .75s; } .chapter.in .art-essence .plus span:nth-child(3) { transition-delay: .9s; } .chapter.in .art-essence .plus span:nth-child(4) { transition-delay: 1.05s; } .chapter.in .art-essence .plus span:nth-child(5) { transition-delay: 1.3s; }
.chapter.in .meter i { width: 31%; }

/* chapter 2: the turn */
.art-turn { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.art-turn .step { display: flex; flex-direction: column; align-items: center; gap: 10px; font-family: var(--display); font-size: .85rem; letter-spacing: .08em; color: var(--ink-dim); opacity: 0; transform: scale(.85); transition: all .6s var(--ease); }
.art-turn .backs { position: relative; width: 70px; height: 96px; }
.art-turn .backs i { position: absolute; inset: 0; border-radius: 9px; border: 1px solid var(--line-hi); background: url(img/logo-192.png) center / 70% no-repeat, linear-gradient(160deg, #2a1f3a, #0e0b16); box-shadow: 0 8px 20px rgba(0, 0, 0, .6); }
.art-turn .backs i:nth-child(2) { transform: translate(14px, 8px) rotate(8deg); }
.art-turn .moves { display: flex; flex-direction: column; gap: 8px; }
.art-turn .mv { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--ink); font-family: var(--body); font-size: 1rem; letter-spacing: 0; transition: transform .3s, border-color .3s; }
.art-turn .mv:hover { transform: translateX(6px); border-color: var(--gold-hi); }
.art-turn .mv img, .art-turn .mv svg { width: 26px; height: 26px; }
.art-turn .mv svg { fill: var(--violet); }
.art-turn .end { padding: 12px 18px; border-radius: 999px; background: linear-gradient(180deg, #ffe7a3, #c9952b); color: #1b1305; font-weight: 700; box-shadow: 0 0 24px rgba(255, 200, 90, .4); }
.art-turn .arrow { width: 28px; height: 2px; background: linear-gradient(90deg, transparent, var(--gold)); position: relative; opacity: 0; transition: opacity .5s; }
.art-turn .arrow::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left-color: var(--gold); }
.chapter.in .art-turn .step, .chapter.in .art-turn .arrow { opacity: 1; transform: none; }
.chapter.in .art-turn .arrow:nth-child(2) { transition-delay: .3s; } .chapter.in .art-turn .s2 { transition-delay: .45s; } .chapter.in .art-turn .arrow:nth-child(4) { transition-delay: .75s; } .chapter.in .art-turn .s3 { transition-delay: .9s; }
.chapter.in .art-turn .s3 .end { animation: pulse 2.4s 1.6s infinite; }
@media (max-width: 560px) { .art-turn { flex-direction: column; } .art-turn .arrow { transform: rotate(90deg); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 24px rgba(255, 200, 90, .4); } 50% { box-shadow: 0 0 44px rgba(255, 200, 90, .8); } }

/* chapter 3: the hoard fills */
.art-hoard .slots .gc { opacity: .18; filter: grayscale(1); transition: all .6s var(--ease); }
.chapter.in .art-hoard .slots .gc { opacity: 1; filter: none; }
.chapter.in .art-hoard .slots .gc:nth-child(2) { transition-delay: .35s; } .chapter.in .art-hoard .slots .gc:nth-child(3) { transition-delay: .7s; } .chapter.in .art-hoard .slots .gc:nth-child(4) { transition-delay: 1.05s; }
.chapter.in .art-hoard .slots .gc:nth-child(4) { animation: fullHoard 1.4s 1.6s both; }
.art-hoard .power { text-align: center; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line-hi); background: rgba(212, 167, 58, .08); opacity: 0; transform: translateY(14px); transition: all .7s 2.1s var(--ease); }
.art-hoard .power b { color: var(--gold-hi); font-family: var(--display); }
.chapter.in .art-hoard .power { opacity: 1; transform: none; }
@keyframes fullHoard { 0% { box-shadow: 0 0 0 0 rgba(255, 210, 120, 0); } 40% { box-shadow: 0 0 0 4px var(--gold-hi), 0 0 60px rgba(255, 210, 120, .9); } 100% { box-shadow: 0 0 0 1px rgba(255, 210, 120, .6), 0 0 26px rgba(255, 210, 120, .4); } }

/* chapter 4: the wild between two hoards */
.art-wild { flex-direction: row; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 40px); }
.art-wild .mid { width: min(180px, 40%); }
.art-wild .side { width: 64px; height: 64px; padding: 12px; border-radius: 50%; border: 1px solid var(--line-hi); background: rgba(0, 0, 0, .4); transition: all .6s; }
.chapter.in .art-wild .side.l { animation: glowSwap 3s infinite; } .chapter.in .art-wild .side.r { animation: glowSwap 3s 1.5s infinite; }
@keyframes glowSwap { 0%, 45%, 100% { box-shadow: none; transform: scale(1); } 15%, 30% { box-shadow: 0 0 30px rgba(255, 210, 120, .7); transform: scale(1.12); } }

/* chapter 5: a hex meets a ward */
.art-ward { flex-direction: row; align-items: center; justify-content: space-between; }
.art-ward .caster, .art-ward .shield { width: 34%; position: relative; }
.art-ward .bolt { flex: 1; height: 4px; margin: 0 10px; border-radius: 2px; background: linear-gradient(90deg, rgba(201, 162, 255, 0), #c9a2ff, #fff); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 16px #c9a2ff; }
.art-ward .blocked { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(2) rotate(-12deg); font-family: var(--decor); font-size: 1.1rem; color: var(--gold-hi); padding: 6px 12px; border: 2px solid var(--gold-hi); border-radius: 8px; background: rgba(0, 0, 0, .6); opacity: 0; text-shadow: 0 0 10px rgba(255, 200, 100, .8); z-index: 3; }
.chapter.in .art-ward .bolt { animation: bolt 3.2s infinite; }
.chapter.in .art-ward .shield .gc { animation: shieldHit 3.2s infinite; }
.chapter.in .art-ward .blocked { animation: stamp 3.2s infinite; }
@keyframes bolt { 0% { transform: scaleX(0); opacity: 1; } 35% { transform: scaleX(1); opacity: 1; } 50%, 100% { transform: scaleX(1); opacity: 0; } }
@keyframes shieldHit { 0%, 32% { box-shadow: 0 18px 40px rgba(0, 0, 0, .65); } 38% { box-shadow: 0 0 0 3px #c9a2ff, 0 0 60px rgba(201, 162, 255, .9); transform: perspective(900px) translateX(6px); } 60%, 100% { box-shadow: 0 18px 40px rgba(0, 0, 0, .65); transform: none; } }
@keyframes stamp { 0%, 36% { opacity: 0; transform: translate(-50%, -50%) scale(2) rotate(-12deg); } 44%, 85% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-12deg); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1) rotate(-12deg); } }

/* chapter 6: coins into the purse */
.art-pay .coins { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.art-pay .gc.coin { opacity: 0; transform: translateY(-40px) rotate(-10deg); transition: all .7s var(--ease); }
.chapter.in .art-pay .gc.coin { opacity: 1; transform: none; }
.chapter.in .art-pay .gc.coin:nth-child(2) { transition-delay: .1s; } .chapter.in .art-pay .gc.coin:nth-child(3) { transition-delay: .2s; } .chapter.in .art-pay .gc.coin:nth-child(4) { transition-delay: .3s; } .chapter.in .art-pay .gc.coin:nth-child(5) { transition-delay: .4s; } .chapter.in .art-pay .gc.coin:nth-child(6) { transition-delay: .5s; }
.art-pay .gc.coin figcaption { font-size: .6rem; padding: 20% 2px 6px; }
.art-pay .gc.coin .gc-val { width: 22px; height: 22px; font-size: .7rem; top: 4px; left: 4px; }
.art-pay .purse { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--gold-hi); font-family: var(--display); letter-spacing: .14em; text-transform: uppercase; font-size: .8rem; }
.art-pay .purse svg { width: 70px; height: 70px; fill: rgba(212, 167, 58, .15); stroke: var(--gold-hi); stroke-width: 2; stroke-linejoin: round; }
.chapter.in .art-pay .purse svg { animation: purse 2.6s 1.2s infinite; }
@keyframes purse { 0%, 100% { transform: scale(1); } 10% { transform: scale(1.12, .9); } 20% { transform: scale(.96, 1.05); } 30% { transform: scale(1); } }
@media (max-width: 560px) { .art-pay .coins { grid-template-columns: repeat(3, 1fr); } }

/* chapter 7: the wheel of places */
.art-places { align-items: center; }
.art-places .wheel { position: relative; width: 260px; height: 260px; margin: 0 auto; border-radius: 50%; border: 1px dashed var(--line); animation: spin 40s linear infinite; }
.art-places .wheel span { --a: 0deg; position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; display: grid; place-items: center; color: var(--pc); background: rgba(0, 0, 0, .55); border: 1px solid currentColor; box-shadow: 0 0 18px color-mix(in srgb, var(--pc) 50%, transparent); transform: rotate(var(--a)) translateY(-130px) rotate(calc(-1 * var(--a))); }
.art-places .wheel span svg { width: 30px; height: 30px; animation: spin 40s linear infinite reverse; }
.art-places .wheel span:nth-child(1) { --a: 0deg; } .art-places .wheel span:nth-child(2) { --a: 45deg; } .art-places .wheel span:nth-child(3) { --a: 90deg; } .art-places .wheel span:nth-child(4) { --a: 135deg; }
.art-places .wheel span:nth-child(5) { --a: 180deg; } .art-places .wheel span:nth-child(6) { --a: 225deg; } .art-places .wheel span:nth-child(7) { --a: 270deg; } .art-places .wheel span:nth-child(8) { --a: 315deg; }
.art-places .hub { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--decor); color: var(--gold-hi); font-size: 1.1rem; text-shadow: 0 0 16px rgba(255, 200, 100, .6); }

/* chapter 8: patrons */
.art-patrons { flex-direction: row; align-items: flex-end; justify-content: center; gap: 0; }
.art-patrons img { width: 32%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; border: 1px solid var(--line-hi); box-shadow: 0 20px 40px rgba(0, 0, 0, .7); transition: transform .6s var(--ease); }
.art-patrons img:nth-child(1) { transform: rotate(-8deg) translate(16px, 10px); } .art-patrons img:nth-child(2) { transform: translateY(-14px); z-index: 2; } .art-patrons img:nth-child(3) { transform: rotate(8deg) translate(-16px, 10px); }
.art-patrons:hover img:nth-child(1) { transform: rotate(-14deg) translate(-6px, 14px); } .art-patrons:hover img:nth-child(3) { transform: rotate(14deg) translate(6px, 14px); } .art-patrons:hover img:nth-child(2) { transform: translateY(-26px) scale(1.04); }

/* chapter 9: the end */
.art-end { flex-direction: row; align-items: center; justify-content: center; gap: 30px; }
.art-end .pile { position: relative; width: 90px; height: 124px; }
.art-end .pile i { position: absolute; inset: 0; border-radius: 10px; border: 1px solid var(--line-hi); background: url(img/logo-192.png) center / 70% no-repeat, linear-gradient(160deg, #2a1f3a, #0e0b16); }
.art-end .pile i:nth-child(2) { transform: translate(4px, -4px); } .art-end .pile i:nth-child(3) { transform: translate(8px, -8px); }
.chapter.in .art-end .pile i:nth-child(3) { animation: drawAway 2.4s infinite; }
.art-end .pile b { position: absolute; bottom: -28px; left: 0; right: 0; text-align: center; font-family: var(--display); font-size: .78rem; color: var(--ink-dim); letter-spacing: .1em; }
.art-end .loops { display: flex; flex-direction: column; gap: 10px; }
.art-end .loops span { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); font-family: var(--display); font-size: .85rem; opacity: 0; transform: translateX(-16px); transition: all .6s var(--ease); }
.art-end .loops .last { border-color: var(--gold-hi); color: var(--gold-hi); box-shadow: 0 0 20px rgba(255, 200, 100, .35); }
.chapter.in .art-end .loops span { opacity: 1; transform: none; } .chapter.in .art-end .loops span:nth-child(2) { transition-delay: .4s; } .chapter.in .art-end .loops span:nth-child(3) { transition-delay: .8s; }
@keyframes drawAway { 0%, 20% { transform: translate(8px, -8px); opacity: 1; } 60% { transform: translate(120px, -40px) rotate(20deg); opacity: 0; } 61%, 100% { transform: translate(8px, -8px); opacity: 0; } }

.tips { margin-top: clamp(50px, 8vw, 90px); padding: clamp(22px, 4vw, 40px); border-radius: 22px; border: 1px solid var(--line-hi); background: linear-gradient(160deg, rgba(212, 167, 58, .1), rgba(10, 9, 14, .8)); }
.tips h3 { font-family: var(--decor); color: var(--gold-hi); font-size: 1.5rem; margin-bottom: 12px; }
.tips ul { margin: 0; padding-left: 20px; columns: 2 320px; column-gap: 40px; }
.tips li { margin-bottom: 10px; color: #ddd1b3; break-inside: avoid; }
.tips li::marker { color: var(--gold-hi); content: "✦  "; }

/* ---- reference: hoards ---- */
.sub-h { font-family: var(--decor); color: var(--gold-hi); font-size: 1.6rem; margin: 60px 0 6px; }
.hoards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 22px; margin-top: 36px; }
.hoard { padding: 20px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(6px); transition: transform .5s var(--ease), border-color .4s, box-shadow .4s; }
.hoard:hover { transform: translateY(-6px); border-color: var(--line-hi); box-shadow: 0 30px 70px rgba(0, 0, 0, .55), 0 0 40px rgba(212, 167, 58, .12); }
.hoard header { display: flex; align-items: center; gap: 14px; }
.h-ico { width: 46px; height: 46px; padding: 8px; border-radius: 50%; border: 1px solid var(--line-hi); background: rgba(0, 0, 0, .4); transition: transform .6s var(--ease); }
.hoard:hover .h-ico { transform: rotate(-12deg) scale(1.1); }
.hoard h3 { font-size: 1.4rem; color: #fff3d6; } .hoard header p { margin: 0; color: var(--muted); font-size: .95rem; }
.h-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.h-cards .gc figcaption { font-size: .66rem; padding: 26% 4px 8px; }
.h-cards .gc .gc-type, .h-cards .gc .gc-val { width: 22px; height: 22px; top: 5px; }
.h-cards .gc .gc-type { right: 5px; }
.h-power { margin: 0 0 12px; color: #ddd1b3; } .h-power b { color: var(--gold-hi); font-family: var(--display); margin-right: 6px; }
.ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ladder span { display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); font-family: var(--display); font-weight: 700; }
.ladder span i { font-style: normal; font-weight: 500; color: var(--muted); font-size: .75rem; }
.ladder span.full { border-color: var(--gold-hi); color: var(--gold-hi); }
.ladder em { color: var(--muted); font-size: .85rem; margin-left: 4px; }
.wilds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; margin-top: 20px; }
.wild p { margin: 10px 0 0; text-align: center; font-size: .95rem; color: var(--ink-dim); display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
.wild p img { width: 18px; height: 18px; display: inline-block; }

/* ---- reference: spells ---- */
.spells { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; margin-top: 36px; }
.spell { display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: center; padding: 16px; border-radius: 18px; background: var(--panel); border: 1px solid rgba(201, 162, 255, .2); transition: transform .5s var(--ease), border-color .4s; }
.spell:hover { transform: translateY(-4px); border-color: rgba(201, 162, 255, .6); }
.spell .gc figcaption { font-size: .7rem; }
.spell h3 { font-size: 1.2rem; color: #fff3d6; } .count { font-family: var(--body); font-weight: 400; font-size: .85rem; color: var(--muted); }
.spell p { margin: 6px 0 0; color: #d8ccae; font-size: 1rem; }
.spell .tag { font-family: var(--display); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--violet); }
.spell .tag.hex { color: #ff9f7a; }
.charms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 22px; margin-top: 24px; }
.charm { padding: 18px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.charm-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.charm-cards .gc figcaption { font-size: .62rem; padding: 26% 3px 7px; }
.charm h3 { font-size: 1.3rem; color: var(--gold-hi); } .charm p { margin: 6px 0 0; color: #d8ccae; }

/* ---- patrons ---- */
.patrons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 20px; margin-top: 36px; }
.patron { position: relative; border-radius: 20px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: transform .5s var(--ease), border-color .4s, box-shadow .4s; }
.patron:hover { transform: translateY(-8px); border-color: var(--line-hi); box-shadow: 0 30px 70px rgba(0, 0, 0, .6); }
.patron figure { position: relative; margin: 0; aspect-ratio: 4 / 4.2; overflow: hidden; }
.patron figure img:first-child { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transition: transform 1.2s var(--ease), filter .6s; filter: saturate(.9); }
.patron:hover figure img:first-child { transform: scale(1.07); filter: saturate(1.1); }
.patron figure::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(14, 12, 20, .96)); }
.patron .crest { position: absolute; z-index: 2; right: 12px; bottom: 12px; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line-hi); box-shadow: 0 4px 12px rgba(0, 0, 0, .8); transition: transform .6s var(--ease); }
.patron:hover .crest { transform: rotate(-20deg) scale(1.1); }
.patron > div { padding: 4px 18px 18px; }
.patron h3 { font-size: 1.25rem; color: #fff3d6; } .patron .title { margin: 2px 0 8px; color: var(--muted); font-style: italic; font-size: .95rem; }
.patron p { margin: 0; color: #d8ccae; font-size: 1rem; } .patron b { color: var(--gold-hi); }

/* ---- places ---- */
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 18px; margin-top: 36px; }
.place { position: relative; padding: 22px 20px 18px; border-radius: 20px; background: var(--panel); border: 1px solid color-mix(in srgb, var(--pc) 30%, transparent); overflow: hidden; transition: transform .5s var(--ease), border-color .4s; }
.place::before { content: ""; position: absolute; width: 220px; height: 220px; right: -80px; top: -80px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--pc) 35%, transparent), transparent 70%); transition: transform .8s var(--ease); }
.place:hover { transform: translateY(-6px); border-color: var(--pc); } .place:hover::before { transform: scale(1.5); }
.place svg { position: relative; width: 52px; height: 52px; color: var(--pc); filter: drop-shadow(0 0 10px var(--pc)); transition: transform .8s var(--ease); }
.place:hover svg { transform: rotate(-10deg) scale(1.12); }
.place h3 { position: relative; margin-top: 12px; font-size: 1.25rem; color: #fff3d6; }
.place .lore { position: relative; font-style: italic; color: var(--ink-dim); font-size: .98rem; margin: 6px 0 10px; }
.place ul { position: relative; margin: 0; padding-left: 18px; color: #d8ccae; font-size: .98rem; } .place li { margin-bottom: 4px; } .place li::marker { color: var(--pc); }

/* ---- download ---- */
.dl-card { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 5vw, 60px); align-items: center; padding: clamp(26px, 5vw, 56px); border-radius: 28px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, rgba(40, 30, 58, .9), rgba(10, 9, 14, .92)); border: 1px solid var(--line-hi); box-shadow: 0 40px 120px rgba(0, 0, 0, .6), 0 0 80px rgba(212, 167, 58, .12); }
.dl-card::before { content: ""; position: absolute; inset: -50%; background: conic-gradient(from 0deg, transparent, rgba(212, 167, 58, .12), transparent 30%, rgba(150, 120, 255, .12), transparent 60%); animation: spin 24s linear infinite; }
.dl-card > * { position: relative; }
.dl-main h2 { margin-bottom: 22px; }
.steps { margin: 26px 0 0; padding-left: 22px; color: #ddd1b3; } .steps li { margin-bottom: 10px; } .steps li::marker { color: var(--gold-hi); font-family: var(--display); font-weight: 700; } .steps b { color: #fff3d6; }
.fine { color: var(--muted); font-size: .95rem; margin: 14px 0 0; }
.dl-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--ink-dim); font-size: .95rem; }
.qr { width: min(240px, 60vw); border-radius: 18px; padding: 6px; background: #fff; box-shadow: 0 0 0 1px var(--line-hi), 0 20px 50px rgba(0, 0, 0, .6), 0 0 40px rgba(255, 210, 120, .2); transition: transform .5s var(--ease); }
.qr:hover { transform: scale(1.04) rotate(-1deg); }
@media (max-width: 760px) { .dl-card { grid-template-columns: 1fr; } }
body.android .dl-qr { display: none; }

footer { position: relative; z-index: 2; text-align: center; padding: 40px 16px 60px; color: var(--muted); font-size: .95rem; }
.f-mark { width: 220px; margin: 0 auto 10px; opacity: .8; }

/* ---- lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 14px; background: rgba(4, 4, 8, .82); backdrop-filter: blur(10px); cursor: zoom-out; animation: fadeIn .3s; }
.lightbox[hidden] { display: none; }
.lb-card { width: min(420px, 82vw, 62vh); animation: flipIn .7s var(--ease); }
.lb-card .gc { cursor: zoom-out; box-shadow: 0 40px 100px rgba(0, 0, 0, .8), 0 0 60px rgba(255, 200, 100, .25); }
.lb-card .gc figcaption { font-size: 1.4rem; }
.lb-name { margin: 0; font-family: var(--display); color: var(--ink-dim); font-size: .9rem; letter-spacing: .2em; text-transform: uppercase; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes flipIn { from { transform: perspective(1000px) rotateY(-80deg) scale(.7); opacity: 0; } }

/* ---- calm, for visitors who asked for less motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .reveal, .stagger > * { opacity: 1; transform: none; filter: none; }
  .sky video { display: none; }
  .embers, .cursor-glow { display: none; }
}

/* phones: the big buttons stay on one line */
@media (max-width: 480px) {
  .btn.big { padding: 15px 20px; font-size: .8rem; letter-spacing: .06em; }
  .btn.big .ver { display: none; }
  body { font-size: 18px; }
}

/* ---- a download for every system ---- */
.platforms { margin: 14px 0 0; color: var(--muted); font-style: italic; font-size: .95rem; }
.platforms a { color: var(--ink-dim); }
.platform-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35); margin: 0 0 20px; }
.platform-tabs button { font: inherit; font-family: var(--display); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); background: none; border: 0; padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: background .3s, color .3s; }
.platform-tabs button:hover { color: var(--gold-hi); }
.platform-tabs button.on { background: linear-gradient(180deg, #ffe7a3, #c9952b); color: #1b1305; box-shadow: 0 0 18px rgba(255, 200, 90, .35); }
.os-panel { animation: osIn .5s var(--ease); }
.dl-pair { display: flex; flex-wrap: wrap; gap: 12px; }
@keyframes osIn { from { opacity: 0; transform: translateY(10px); } }
