/* ExploreTCGSets home and shared pages: a night sky over original mountains,
   Unbounded headlines, and a portal into each game. */
:root {
  --pk: #ffcb3d;
  --pk2: #3d7dca;
  --mtg: #d9a441;
  --lor: #e8c46e;
  --lor2: #6fa8ff;
  --op: #f2c94c;
  --op2: #2a8fd4;
  --veil: radial-gradient(120% 90% at 50% 20%, rgba(11, 10, 26, 0) 0%, rgba(11, 10, 26, 0.35) 60%, rgba(11, 10, 26, 0.85));
}
.scene { background: radial-gradient(100% 70% at 50% 0%, #2a1a5e, #0b0a1a 70%); }

.home { overflow-x: clip; max-width: var(--maxw); margin: 0 auto; padding: calc(var(--nav-h) + 24px) var(--gutter) 40px; position: relative; z-index: 1; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-family: var(--display); font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -0.01em; }
.section-head p { margin: 0; }
.home > section { margin-top: clamp(56px, 8vw, 110px); }
.home > section.home-hero { margin-top: 0; }
.game-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.nc-pokemon .game-tag, .tc-pokemon + .today-copy .game-tag, .upcoming .game-tag { background: color-mix(in srgb, var(--pk) 22%, transparent); color: #ffe39a; }
.nc-magic .game-tag, .today-slot[data-today-game="magic"] .game-tag { background: color-mix(in srgb, var(--mtg) 22%, transparent); color: #f3d79a; }
.nc-lorcana .game-tag, .today-slot[data-today-game="lorcana"] .game-tag { background: color-mix(in srgb, var(--lor2) 24%, transparent); color: #cfe0ff; }
.btn-lorcana { background: linear-gradient(135deg, #2b3a8f, #4f6fd8 45%, #8fc7ff); color: #fff; box-shadow: 0 8px 22px rgba(79, 111, 216, 0.35); }
.nc-onepiece .game-tag, .today-slot[data-today-game="onepiece"] .game-tag { background: color-mix(in srgb, var(--op2) 26%, transparent); color: #cdeaff; }
.btn-onepiece { background: linear-gradient(135deg, #0b3a66, #1f7cc4 45%, #f2c94c); color: #fff; box-shadow: 0 8px 22px rgba(31, 124, 196, 0.35); }
.btn-magic { background: var(--gild, linear-gradient(135deg, #8a6420, #f0d48a 30%, #b07d2a 50%, #f6e2a6 70%, #8a6420)); color: #1a1208; box-shadow: 0 8px 22px rgba(217, 164, 65, 0.3); }

/* ---------------------------------------------------------------- hero */
.home-hero { min-height: min(760px, calc(100vh - var(--nav-h) - 24px)); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 4vw, 60px); }
.hero-copy h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.3rem, 5.6vw, 4.6rem); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 0.35em; }
.hero-copy h1 span { display: block; background: linear-gradient(100deg, #ffd66b, #ff8fb0 45%, #8ad8ff 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy .lede { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--muted); max-width: 40ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 0; }
.hero-cta .btn { padding: 13px 22px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 34px 0 0; }
.hero-stats div { display: grid; }
.hero-stats dt { order: 2; font-size: 0.8rem; color: var(--muted); }
.hero-stats dd { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 2.4vw, 2rem); }

.hero-fan { --mx: 0; --my: 0; position: relative; left: -4%; height: clamp(360px, 46vw, 600px); perspective: 1400px; }
.hero-card { --spread: clamp(40px, 4.6vw, 70px); position: absolute; left: 50%; top: 50%; width: clamp(150px, 17vw, 236px); aspect-ratio: 63 / 88; margin: calc(clamp(150px, 17vw, 236px) * -0.7) 0 0 calc(clamp(150px, 17vw, 236px) * -0.5); border-radius: 4.6% / 3.3%; z-index: calc(10 - (var(--i) - 2.5) * (var(--i) - 2.5)); translate: calc(var(--mx, 0) * (var(--i) + 1) * -10px) calc(var(--my, 0) * 14px); transform: translate3d(calc((var(--i) - 2.5) * var(--spread)), calc(((var(--i) - 2.5) * (var(--i) - 2.5)) * 9px), 0) rotate(calc((var(--i) - 2.5) * 7deg)); transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), z-index 0s; will-change: transform; animation: hero-in 1s var(--ease) backwards; animation-delay: calc(var(--i) * 90ms); text-decoration: none; }
/* Position lives on the card, tilt on its face, so following the pointer never waits on the lift. */
.hc-face { position: relative; z-index: 1; display: block; width: 100%; height: 100%; border-radius: inherit; overflow: hidden; box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5); background: #1b1430; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); will-change: transform; animation: hero-float 6s ease-in-out infinite; animation-delay: calc(var(--i) * -1.1s); }
.hero-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* The same light and holo foil as the set grids. */
.hc-holo { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.35s; }
.hc-holo {
  background:
    radial-gradient(farthest-corner circle at var(--px, 50%) var(--py, 50%), rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.1) 30%, rgba(0, 0, 0, 0.35) 100%),
    repeating-linear-gradient(112deg, hsl(2 100% 73%) 0%, hsl(53 100% 69%) 5%, hsl(93 100% 69%) 10%, hsl(176 100% 76%) 15%, hsl(228 100% 74%) 20%, hsl(283 100% 73%) 25%, hsl(2 100% 73%) 30%) var(--px, 50%) var(--py, 50%) / 260% 260%;
  background-blend-mode: soft-light, normal;
  mix-blend-mode: color-dodge;
  filter: brightness(0.5) contrast(1.9) saturate(1.05);
}
.hero-card.is-lit .hc-holo { opacity: calc(0.28 + var(--far, 0) * 0.22); }
.hc-aura { position: absolute; inset: -14%; pointer-events: none; border-radius: 40%; background: radial-gradient(closest-side, color-mix(in srgb, var(--tc) 70%, transparent), transparent); opacity: 0.35; transition: opacity 0.4s, transform 0.4s; }
.hero-card:hover, .hero-card:focus-visible { z-index: 20; transform: translate3d(calc((var(--i) - 2.5) * var(--spread)), -30px, 60px) rotate(0deg) scale(1.08); }
.hero-card:hover .hc-aura, .hero-card.is-lit .hc-aura { opacity: 0.95; transform: scale(1.1); }
.hc-label { position: absolute; pointer-events: none; left: 50%; bottom: -34px; transform: translateX(-50%); white-space: nowrap; font-weight: 700; font-size: 0.84rem; opacity: 0; transition: opacity 0.3s; }
.hero-card:hover .hc-label { opacity: 1; }
@keyframes hero-in { from { opacity: 0; transform: translate3d(0, 80px, 0) rotate(0deg) scale(0.8); } }
@keyframes hero-float { 50% { translate: 0 -10px; } }

/* ---------------------------------------------------------------- portals */
.portal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 2vw, 24px); }
.portal { position: relative; display: block; min-height: clamp(380px, 38vw, 500px); border-radius: 28px; overflow: hidden; text-decoration: none; color: #fff; isolation: isolate; box-shadow: var(--shadow); transition: transform 0.5s var(--ease), box-shadow 0.5s; }
.portal:hover { transform: translateY(-6px); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5); }
.portal-art { position: absolute; inset: 0; z-index: -2; transition: transform 1.2s var(--ease); }
.portal-art img, .portal-art svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal:hover .portal-art { transform: scale(1.06); }
.portal::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 22%, rgba(8, 6, 20, 0.6) 48%, rgba(8, 6, 20, 0.92) 80%); }
.portal-pokemon { outline: 2px solid color-mix(in srgb, var(--pk) 55%, transparent); outline-offset: -2px; }
.portal-lorcana { outline: 2px solid color-mix(in srgb, var(--lor2) 55%, transparent); outline-offset: -2px; }
.portal-lorcana .portal-cards img { aspect-ratio: 734 / 1024; }
.portal-lorcana .kicker { color: #cfe0ff; }
.portal-lorcana strong { font-family: "Source Serif 4", Georgia, serif; font-weight: 700; letter-spacing: 0; }
.portal-lorcana .btn-primary { background: linear-gradient(135deg, #2b3a8f, #4f6fd8 45%, #8fc7ff); color: #fff; }
.portal-onepiece { outline: 2px solid color-mix(in srgb, var(--op) 55%, transparent); outline-offset: -2px; }
.portal-onepiece .kicker { color: #ffe08a; }
.portal-onepiece strong { font-family: "Unbounded", var(--display); }
.portal-onepiece .btn-primary { background: linear-gradient(135deg, #0b3a66, #1f7cc4 45%, #f2c94c); color: #fff; }
.portal-magic { outline: 2px solid color-mix(in srgb, var(--mtg) 55%, transparent); outline-offset: -2px; }
.portal-cards { position: absolute; right: 7%; top: 9%; width: 46%; height: 58%; }
.portal-cards img { position: absolute; top: 0; right: calc(var(--i) * 22%); width: 46%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 4.6% / 3.3%; box-shadow: 0 18px 30px rgba(0, 0, 0, 0.45); transform: rotate(calc((var(--i) - 1) * -9deg)) translateY(calc(var(--i) * 10px)); transition: transform 0.6s var(--ease); background: rgba(0, 0, 0, 0.3); }
.portal:hover .portal-cards img { transform: rotate(calc((var(--i) - 1) * -14deg)) translateY(calc(var(--i) * 6px - 16px)); }
.portal-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: clamp(18px, 3vw, 32px); display: grid; gap: 6px; justify-items: start; }
.portal-copy .kicker { margin: 0; }
.portal-pokemon .kicker { color: var(--pk); }
.portal-magic .kicker { color: #f0d48a; font-family: "Cinzel", serif; letter-spacing: 0.16em; }
.portal-copy strong { font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1; letter-spacing: -0.02em; }
.portal-magic strong { font-family: "Cinzel", serif; font-weight: 700; letter-spacing: 0.04em; }
.portal-copy em { font-style: normal; max-width: 46ch; color: rgba(255, 255, 255, 0.86); }
.portal-meta { font-size: 0.82rem; color: rgba(255, 255, 255, 0.7); }
.portal-copy .btn { margin-top: 8px; }
.portal-pokemon .btn-primary { background: var(--pk); color: #1b1430; }
.portal-magic .btn-primary { background: linear-gradient(135deg, #8a6420, #f0d48a 30%, #b07d2a 50%, #f6e2a6 70%, #8a6420); color: #1a1208; }

.soon-grid { list-style: none; padding: 0; margin: clamp(14px, 2vw, 24px) 0 0; display: grid; grid-template-columns: 1fr; gap: clamp(14px, 2vw, 24px); }
.portal-soon { position: relative; min-height: 230px; border-radius: 22px; overflow: hidden; border: 1px solid var(--edge); isolation: isolate; }
.soon-art { position: absolute; inset: 0; z-index: -2; filter: saturate(0.85); }
.soon-art svg { width: 100%; height: 100%; display: block; }
.portal-soon::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 6, 20, 0.1), rgba(8, 6, 20, 0.85) 80%); }
.soon-copy { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px; display: grid; gap: 4px; justify-items: start; }
.soon-copy strong { font-family: var(--display); font-size: 1.3rem; }
.soon-copy em { font-style: normal; font-size: 0.9rem; color: rgba(255, 255, 255, 0.78); }
.soon-badge { padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.25); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.soon-spin { transform-origin: 150px 105px; animation: soon-spin 40s linear infinite; }
.soon-drift { animation: soon-drift 8s ease-in-out infinite alternate; }
.soon-wave { animation: soon-wave 5s linear infinite; }
@keyframes soon-spin { to { transform: rotate(360deg); } }
@keyframes soon-drift { to { transform: translateX(-18px); } }
@keyframes soon-wave { to { transform: translateX(-30px); } }

/* ---------------------------------------------------------------- today */
.today-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 2vw, 24px); align-items: stretch; }
.today-slot { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 18px; align-items: center; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--edge); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.today-ph { display: block; aspect-ratio: 63 / 88; border-radius: 12px; background: linear-gradient(110deg, rgba(255, 255, 255, 0.05) 30%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.05) 70%) 0 0 / 300% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.today-card { position: relative; display: block; border-radius: 4.6% / 3.3%; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.today-card img { position: relative; z-index: 1; width: 100%; height: auto; border-radius: 4.6% / 3.3%; box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45); display: block; background: #1b1430; aspect-ratio: 63 / 88; object-fit: cover; }
.tc-pokemon { --tc: var(--pk); }
.tc-magic { --tc: var(--mtg); }
.tc-lorcana { --tc: var(--lor2); }
.tc-lorcana img { aspect-ratio: 734 / 1024; }
.tc-onepiece { --tc: var(--op2); }
.today-card .hc-aura { opacity: 0.55; }
.today-card.is-lit .hc-aura { opacity: 1; }
.today-copy { display: grid; gap: 6px; justify-items: start; }
.today-copy strong { font-family: var(--display); font-size: 1.25rem; line-height: 1.15; }
.today-copy em { font-style: normal; color: var(--muted); }
.today-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto auto; align-items: center; align-content: center; gap: 10px; padding: 22px; border-radius: var(--r-lg); background: linear-gradient(140deg, rgba(255, 143, 176, 0.18), rgba(138, 216, 255, 0.14)); border: 1px solid var(--edge); }
.today-actions p { margin: 0 0 4px; font-weight: 600; }
.today-actions .btn { justify-content: center; }

/* ---------------------------------------------------------------- newest */
.newest-row { list-style: none; margin: 0; padding: 4px 2px 16px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; }
.newest-row li { scroll-snap-align: start; }
.newest-card { display: grid; gap: 6px; height: 100%; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--edge); text-decoration: none; transition: transform 0.3s var(--ease), border-color 0.3s; justify-items: start; }
.newest-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.newest-art { width: 100%; height: 170px; display: grid; place-items: center; }
.newest-art img { max-width: 100%; max-height: 170px; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.4)); }
.newest-art.is-icon img { width: 96px; height: 96px; filter: invert(1) drop-shadow(0 0 18px rgba(217, 164, 65, 0.6)); opacity: 0.92; }
.newest-logo { max-height: 90px !important; }
.newest-card em { font-style: normal; color: var(--muted); font-size: 0.84rem; }
.upcoming { margin-top: 10px; padding: 16px 20px; border-radius: var(--r-md); background: var(--surface); border: 1px dashed var(--edge); }
.upcoming h3 { margin: 0 0 6px; font-size: 1rem; }
.upcoming ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.upcoming em { font-style: normal; color: var(--muted); font-size: 0.86rem; }
.upcoming a { text-decoration: none; font-weight: 600; }

/* ---------------------------------------------------------------- features */
.feature-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-grid li { display: grid; gap: 6px; padding: 20px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--edge); }
.feature-grid b { font-family: var(--display); font-size: 1rem; }
.feature-grid span { color: var(--muted); font-size: 0.95rem; }

/* ---------------------------------------------------------------- shared pages */
.plain-page .prose-body { margin: 0; }
.plain-page .prose-block { margin-bottom: 18px; }
.plain-page .prose-block h2 { margin-top: 0; }
.plain-page ul { padding-left: 1.2em; }
.plain-page li { margin: 4px 0; }
.notfound { min-height: 60vh; }
.fav-page section { margin-bottom: 34px; }

/* reveal */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.js .reveal.in, .calm .reveal { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .today-slot { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .today-slot { grid-template-columns: minmax(120px, 190px) 1fr; }
  .today-actions { grid-template-columns: 1fr; }
  .home { padding-top: calc(var(--nav-h) + 58px); }
  .home-hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-fan { height: clamp(300px, 70vw, 440px); order: -1; margin-top: -10px; }
  .hero-card { --spread: clamp(30px, 9vw, 70px); width: clamp(120px, 28vw, 190px); margin: calc(clamp(120px, 28vw, 190px) * -0.7) 0 0 calc(clamp(120px, 28vw, 190px) * -0.5); }
  .portal-grid, .soon-grid { grid-template-columns: 1fr; }
  .today-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .feature-grid { grid-template-columns: 1fr; }
  .today-slot { grid-template-columns: 120px 1fr; }
  .portal { min-height: 440px; }
  .portal-cards { width: 70%; right: 4%; height: 50%; }
  .portal-soon { min-height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-card, .hc-face, .soon-spin, .soon-drift, .soon-wave, .today-ph { animation: none !important; }
}
.calm .hero-card, .calm .hc-face, .calm .soon-spin, .calm .soon-drift, .calm .soon-wave { animation: none !important; }
