/* ============================================================================
   Cattenashow — The Grimoire of First Light
   Palette canon : #1B1F3B nuit · #C0C5CE argent · #E8B923 or · #4A2E6F violet
   ========================================================================== */

:root {
  --night:      #1B1F3B;
  --night-deep: #0d0f1f;
  --silver:     #C0C5CE;
  --gold:       #E8B923;
  --gold-soft:  #f0d27a;
  --violet:     #4A2E6F;
  --parchment:  #efe3c4;
  --parchment-2:#e3d2a8;
  --ink:        #2c2415;
  --ink-soft:   #5a4a2e;

  --font-display: 'Cinzel', serif;
  --font-script:  'Cormorant Garamond', serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--silver);
  background:
    radial-gradient(1200px 800px at 50% -10%, rgba(74,46,111,.55), transparent 60%),
    radial-gradient(900px 700px at 80% 30%, rgba(74,46,111,.25), transparent 55%),
    linear-gradient(180deg, var(--night) 0%, var(--night-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ────────────────────────────── Starfield ─────────────────────────────── */

.starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.stars {
  position: absolute; inset: 0;
  background-repeat: repeat;
}
/* small distant stars */
.stars--far {
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 90px 80px, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 160px 40px, rgba(232,185,35,.6), transparent),
    radial-gradient(1px 1px at 230px 120px, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 300px 60px, rgba(255,255,255,.4), transparent);
  background-size: 340px 200px;
  animation: twinkle 6s ease-in-out infinite;
}
/* brighter mid stars */
.stars--mid {
  background-image:
    radial-gradient(1.6px 1.6px at 50px 100px, rgba(255,255,255,.9), transparent),
    radial-gradient(1.6px 1.6px at 180px 50px, rgba(232,185,35,.8), transparent),
    radial-gradient(2px 2px at 280px 140px, rgba(255,255,255,.85), transparent);
  background-size: 360px 220px;
  animation: twinkle 4.5s ease-in-out infinite reverse;
}
.chain-glow {
  position: absolute; inset: 0;
  background: radial-gradient(800px 300px at 50% 12%, rgba(232,185,35,.10), transparent 70%);
}

@keyframes twinkle { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

/* ────────────────────────────── Lumi moth ─────────────────────────────── */

.lumi {
  position: fixed; z-index: 5; top: 30%; left: -40px;
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-soft), rgba(232,185,35,.2));
  box-shadow: 0 0 12px 4px rgba(232,185,35,.6);
  pointer-events: none;
  animation: lumi-fly 38s linear infinite;
}
.lumi::before, .lumi::after {
  content: ""; position: absolute; top: 2px; width: 9px; height: 10px;
  background: rgba(240,210,122,.45); border-radius: 60% 60% 50% 50%;
}
.lumi::before { left: -6px; transform: rotate(-25deg); }
.lumi::after  { right: -6px; transform: rotate(25deg); }

@keyframes lumi-fly {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  5%   { opacity: 1; }
  25%  { transform: translate(40vw, -8vh) rotate(10deg); }
  50%  { transform: translate(70vw, 6vh) rotate(-8deg); }
  70%  { transform: translate(95vw, -4vh) rotate(6deg); opacity: 1; }
  78%  { opacity: 0; }
  100% { transform: translate(105vw, 0) rotate(0deg); opacity: 0; }
}

/* ────────────────────────────── Hero ─────────────────────────────── */

.hero {
  position: relative; z-index: 1;
  min-height: 92vh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  text-align: center;
  padding: 6vh 1.2rem 2rem;
}

.hero-art {
  position: relative;
  width: min(640px, 92vw);
  aspect-ratio: 3 / 4;
  margin: 1rem auto 0;
  border-radius: 16px;
  overflow: hidden;
  /* placeholder library scene — replace background with the GPT-Image hero art */
  background:
    radial-gradient(120% 70% at 50% 110%, rgba(232,185,35,.18), transparent 60%),
    linear-gradient(180deg, #241a3a 0%, #15101f 100%);
  border: 1px solid rgba(232,185,35,.25);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 0 80px rgba(74,46,111,.4);
}
.hero-shelves {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 30px, rgba(0,0,0,.25) 30px 33px),
    repeating-linear-gradient(0deg, transparent 0 54px, rgba(120,80,40,.18) 54px 58px);
  opacity: .5;
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 92%);
}
.hero-oracle {
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
}
.oracle-orb {
  width: 54px; height: 54px; border-radius: 50%; margin-bottom: -6px;
  background: radial-gradient(circle at 35% 30%, #fff, var(--gold) 40%, var(--violet) 90%);
  box-shadow: 0 0 30px 8px rgba(232,185,35,.55);
  animation: orb-float 5s ease-in-out infinite;
}
.oracle-figure { font-size: 5rem; filter: drop-shadow(0 0 18px rgba(74,46,111,.9)); }

@keyframes orb-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.hero-titles { margin-top: 2rem; }
.kicker {
  font-family: var(--font-display); font-weight: 700; letter-spacing: .42em;
  text-transform: uppercase; font-size: .82rem; color: var(--gold);
  padding-left: .42em;
}
.title {
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(1.9rem, 6vw, 3.4rem); line-height: 1.1;
  color: #fff; margin: .4rem 0 .6rem;
  text-shadow: 0 0 30px rgba(232,185,35,.35);
}
.tagline {
  font-family: var(--font-script); font-style: italic;
  font-size: clamp(1.1rem, 3.4vw, 1.5rem); color: var(--silver);
}

.scroll-cue {
  margin-top: 2.4rem; display: flex; flex-direction: column; align-items: center; gap: .5rem;
  color: var(--gold-soft); font-family: var(--font-script); font-size: 1.05rem; font-style: italic;
}
.chevron {
  width: 14px; height: 14px; border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold); transform: rotate(45deg);
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: rotate(45deg) translate(0,0); } 50% { transform: rotate(45deg) translate(4px,4px); } }

/* ────────────────────────────── Grimoire wrap ─────────────────────────── */

.grimoire-wrap {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto; padding: 2rem 1.1rem 3rem;
}

.edition-banner {
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  flex-wrap: wrap; margin-bottom: .6rem;
}
.edition-name {
  font-family: var(--font-display); font-weight: 700; color: var(--gold);
  letter-spacing: .12em; font-size: 1.1rem;
}
.edition-date { color: var(--silver); font-size: .9rem; opacity: .8; }

.oracle-note {
  text-align: center; max-width: 640px; margin: 0 auto 2rem;
  font-family: var(--font-script); font-style: italic; font-size: 1.2rem;
  color: var(--gold-soft);
}

/* ── The open book ── */
.grimoire {
  position: relative;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(232,185,35,.10), transparent 55%);
  border-radius: 18px;
  padding: 1rem;
}
.grimoire-spine {
  display: none;
}

.predictions {
  display: grid; gap: 1.4rem;
  grid-template-columns: 1fr;
}
.loading {
  text-align: center; font-family: var(--font-script); font-style: italic;
  color: var(--silver); padding: 3rem 0;
}

/* ────────────────────────────── Prediction card ───────────────────────── */

.card {
  position: relative;
  background:
    linear-gradient(180deg, var(--parchment) 0%, var(--parchment-2) 100%);
  color: var(--ink);
  border-radius: 14px;
  padding: 1.4rem 1.3rem 1.2rem;
  box-shadow:
    0 14px 40px rgba(0,0,0,.45),
    inset 0 0 0 1px rgba(120,80,40,.25),
    inset 0 0 60px rgba(180,140,70,.18);
  /* aged paper edge */
  border: 1px solid rgba(120,80,40,.35);
  animation: page-unfurl .7s cubic-bezier(.2,.7,.3,1) both;
}
.card:nth-child(2) { animation-delay: .12s; }
.card:nth-child(3) { animation-delay: .24s; }

@keyframes page-unfurl {
  from { opacity: 0; transform: translateY(18px) rotateX(8deg); transform-origin: top; }
  to   { opacity: 1; transform: translateY(0) rotateX(0); }
}

.card-stage {
  font-family: var(--font-display); font-size: .68rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: #9a6a1f;
  text-align: center; margin-bottom: .8rem;
}

/* Twin Constellations header */
.twin {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem;
  margin-bottom: .9rem;
}
.team { text-align: center; }
.team.away { text-align: center; }
.team-colors {
  display: flex; gap: 3px; justify-content: center; margin-bottom: .4rem;
}
.color-chip {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.25); box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.team-name {
  font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: var(--ink);
}
.team-constellation {
  font-family: var(--font-script); font-style: italic; font-size: .95rem; color: #7a5a28;
}
.twin-vs {
  font-family: var(--font-display); font-weight: 700; color: #9a6a1f;
  font-size: .85rem; letter-spacing: .1em;
}

.card-venue {
  text-align: center; font-size: .78rem; color: var(--ink-soft); margin-bottom: .7rem;
}

.prose {
  font-family: var(--font-script); font-style: italic; font-size: 1.08rem;
  color: #4a3a1c; text-align: center; line-height: 1.5;
  padding: .6rem .2rem .9rem; border-bottom: 1px solid rgba(120,80,40,.2);
  margin-bottom: .8rem;
}

/* Sigil rows */
.sigils { display: grid; gap: .5rem; }
.sigil {
  display: grid; grid-template-columns: 1.6rem 1fr auto; align-items: center; gap: .7rem;
  padding: .6rem .7rem; border-radius: 9px;
  background: rgba(255,255,255,.28);
  border: 1px solid rgba(120,80,40,.18);
  text-align: left; width: 100%;
  font-family: var(--font-body); color: var(--ink); font-size: .92rem;
}
.sigil-glyph { font-size: 1.1rem; text-align: center; line-height: 1; }
.sigil-body { display: flex; flex-direction: column; }
.sigil-label {
  font-family: var(--font-display); font-size: .62rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: #9a6a1f;
}
.sigil-value { font-weight: 600; color: var(--ink); }

/* clickable sigils → market */
button.sigil {
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  animation: sigil-ignite .5s ease both;
}
button.sigil:hover {
  background: rgba(232,185,35,.22);
  box-shadow: 0 4px 16px rgba(232,185,35,.35);
  transform: translateY(-1px);
}
button.sigil:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.sigil-cta {
  font-size: .68rem; color: #9a6a1f; opacity: .8; white-space: nowrap;
  display: flex; align-items: center; gap: .25rem;
}
.sigil-cta::after { content: "↗"; font-size: .8rem; }
.sigil--static .sigil-cta { display: none; }

@keyframes sigil-ignite { from { opacity: 0; } to { opacity: 1; } }

/* scoreline stars */
.stars-line { display: inline-flex; align-items: center; gap: 3px; }
.star { color: var(--gold); filter: drop-shadow(0 0 2px rgba(232,185,35,.5)); }
.star--dim { color: rgba(120,80,40,.3); }
.stars-sep { margin: 0 .3rem; color: var(--ink-soft); }

/* eye */
.eye-open  { color: var(--violet); font-weight: 700; }
.eye-closed{ color: var(--ink-soft); }

/* Whisker index */
.whiskers {
  margin-top: 1rem; padding-top: .9rem; border-top: 1px solid rgba(120,80,40,.2);
  display: flex; align-items: center; justify-content: center; gap: .6rem;
}
.whisker-label {
  font-family: var(--font-display); font-size: .6rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: #9a6a1f;
}
.whisker-row { display: inline-flex; gap: 4px; align-items: center; }
.whisker {
  width: 18px; height: 2.5px; border-radius: 2px;
  background: rgba(120,80,40,.25);
}
.whisker--lit { background: var(--gold); box-shadow: 0 0 6px rgba(232,185,35,.6); }
.whisker-num { font-weight: 700; color: #9a6a1f; font-size: .85rem; }
.whisker-row--tremble .whisker--lit { animation: tremble 1.6s ease-in-out infinite; }
@keyframes tremble {
  0%,100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-1px) rotate(-2deg); }
  75% { transform: translateY(1px) rotate(2deg); }
}

.omen-disclaimer {
  text-align: center; max-width: 600px; margin: 2rem auto 0;
  font-size: .8rem; color: var(--silver); opacity: .75;
}
.omen-disclaimer strong { color: var(--gold-soft); }

/* ────────────────────────────── Sections ─────────────────────────────── */

.section-title {
  font-family: var(--font-display); font-weight: 700; color: #fff;
  text-align: center; font-size: clamp(1.4rem, 4vw, 2rem);
  text-shadow: 0 0 24px rgba(232,185,35,.3);
}
.section-sub {
  text-align: center; color: var(--silver); font-family: var(--font-script);
  font-style: italic; font-size: 1.1rem; margin: .4rem auto 1.6rem; max-width: 520px;
}

.echoes, .vigil {
  position: relative; z-index: 1; padding: 3rem 1.1rem;
  max-width: 800px; margin: 0 auto;
}
.echoes-counts {
  display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap;
}
.echo-stat {
  background: rgba(255,255,255,.04); border: 1px solid rgba(232,185,35,.25);
  border-radius: 14px; padding: 1.2rem 1.8rem; text-align: center; min-width: 160px;
}
.echo-num {
  display: block; font-family: var(--font-display); font-weight: 900;
  font-size: 2.4rem; color: var(--gold);
}
.echo-label { font-size: .82rem; color: var(--silver); }
.echo-label em { color: var(--gold-soft); font-style: normal; }
.echo-recap {
  text-align: center; font-family: var(--font-script); font-style: italic;
  color: var(--gold-soft); margin-top: 1.4rem; font-size: 1.1rem;
}

/* Vigil form */
.vigil-form {
  display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; max-width: 460px; margin: 0 auto;
}
.vigil-form input {
  flex: 1 1 220px; padding: .85rem 1rem; border-radius: 10px;
  border: 1px solid rgba(232,185,35,.35); background: rgba(0,0,0,.3);
  color: #fff; font-family: var(--font-body); font-size: 1rem;
}
.vigil-form input::placeholder { color: rgba(192,197,206,.5); }
.vigil-form button {
  padding: .85rem 1.4rem; border-radius: 10px; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--night); font-family: var(--font-display); font-weight: 700;
  letter-spacing: .05em; transition: transform .12s ease, box-shadow .2s ease;
}
.vigil-form button:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,185,35,.4); }
.vigil-msg { text-align: center; margin-top: 1rem; color: var(--gold-soft); font-style: italic; min-height: 1.4em; }

/* ────────────────────────────── Codex ─────────────────────────────── */

.codex {
  position: relative; z-index: 1; margin-top: 2rem;
  background: rgba(0,0,0,.4); border-top: 1px solid rgba(232,185,35,.2);
  padding: 2.4rem 1.1rem;
}
.codex-inner { max-width: 760px; margin: 0 auto; text-align: center; }
.codex-vow {
  font-family: var(--font-script); font-style: italic; font-size: 1.3rem;
  color: var(--gold); margin-bottom: 1.2rem;
}
.codex-legal, .codex-rg, .codex-meta {
  font-size: .8rem; color: var(--silver); opacity: .8; margin-bottom: .8rem; line-height: 1.6;
}
.codex-legal strong { color: var(--gold-soft); }
.codex a { color: var(--gold-soft); }
.codex-meta { opacity: .6; font-size: .72rem; }

/* ────────────────────────────── Age gate ─────────────────────────────── */

.agegate {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5,6,14,.85); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
}
.agegate[hidden] { display: none; }
.agegate-card {
  max-width: 420px; text-align: center;
  background: linear-gradient(180deg, #221a38, #15101f);
  border: 1px solid rgba(232,185,35,.4); border-radius: 18px;
  padding: 2rem 1.6rem; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: page-unfurl .4s ease both;
}
.agegate-sigil {
  font-size: 2.4rem; margin-bottom: .6rem;
  filter: drop-shadow(0 0 14px rgba(232,185,35,.6));
}
.agegate-card h2 {
  font-family: var(--font-display); font-weight: 700; color: #fff;
  font-size: 1.25rem; margin-bottom: .8rem;
}
.agegate-card p { color: var(--silver); font-size: .92rem; margin-bottom: 1.3rem; }
.agegate-actions { display: flex; flex-direction: column; gap: .6rem; }
.btn-primary {
  padding: .9rem 1rem; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--night); font-family: var(--font-display); font-weight: 700; font-size: 1rem;
}
.btn-ghost {
  padding: .8rem 1rem; border: 1px solid rgba(192,197,206,.3); border-radius: 10px;
  cursor: pointer; background: transparent; color: var(--silver); font-family: var(--font-body);
}
.btn-primary:hover { transform: translateY(-1px); }
.agegate-rg { margin-top: 1.2rem; font-size: .74rem; color: var(--silver); opacity: .6; }

/* ────────────────────────────── Desktop: open book spread ─────────────── */

@media (min-width: 820px) {
  .hero-art { width: min(900px, 90vw); aspect-ratio: 16 / 9; }
  .predictions { grid-template-columns: 1fr 1fr; }
  /* a single card centers; 2-3 cards spread like book pages */
  .predictions:has(.card:only-child) { grid-template-columns: minmax(0, 560px); justify-content: center; }
  .grimoire-spine {
    display: block; position: absolute; top: 1rem; bottom: 1rem; left: 50%;
    width: 2px; transform: translateX(-50%);
    background: linear-gradient(180deg, transparent, rgba(232,185,35,.4), transparent);
  }
}

/* ────────────────────────────── Reduced motion ─────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .lumi { display: none; }
}
