
:root{
  --night:#06101f;--deep:#0b1830;--royal:#123a70;--blue:#2374b9;--aether:#8edbff;
  --ivory:#fff8e9;--gold:#d9b86c;--gold2:#8d6b35;--silver:#d9e6f2;
  --line:rgba(255,255,255,.12);--glass:rgba(255,255,255,.08);
  --shadow:rgba(0,0,0,.42);
}
*{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent}
html,body{min-height:100%;overflow-x:hidden}
body{
  font-family:"Avenir Next","Apple SD Gothic Neo","Noto Sans KR",system-ui,sans-serif;
  background:
    radial-gradient(circle at 16% 4%,rgba(35,116,185,.24),transparent 30%),
    radial-gradient(circle at 90% 0%,rgba(217,184,108,.18),transparent 31%),
    linear-gradient(145deg,#030712,#0b1427 52%,#04070d);
  color:var(--ivory);line-height:1.68;
}
.cosmos{position:fixed;inset:0;z-index:-4;background-image:radial-gradient(circle,rgba(255,255,255,.45) 0 1px,transparent 1.5px);background-size:80px 80px;opacity:.22;animation:starMove 60s linear infinite}
@keyframes starMove{to{background-position:800px -600px}}
.aurora{position:fixed;inset:-20%;z-index:-3;background:conic-gradient(from 120deg,transparent,rgba(35,116,185,.18),transparent,rgba(217,184,108,.10),transparent);filter:blur(50px);animation:spin 28s linear infinite}
.sparkles{position:fixed;inset:0;z-index:-2;pointer-events:none;background:radial-gradient(circle at 30% 30%,rgba(142,219,255,.18),transparent 8%),radial-gradient(circle at 70% 70%,rgba(217,184,108,.13),transparent 10%);animation:pulse 5s ease-in-out infinite alternate}
@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{to{opacity:.45}}

.gate{position:fixed;inset:0;z-index:999;display:flex;align-items:center;justify-content:center;padding:24px;background:radial-gradient(circle at center,rgba(20,70,120,.28),transparent 42%),linear-gradient(145deg,#02050b,#0b1428);transition:.7s cubic-bezier(.22,1,.36,1)}
.gate.hide{opacity:0;pointer-events:none;filter:blur(14px);transform:scale(1.02)}
.gate-card{
  width:min(480px,100%);min-height:610px;position:relative;overflow:hidden;text-align:center;padding:34px 24px;
  display:flex;flex-direction:column;justify-content:center;align-items:center;
  background:linear-gradient(145deg,rgba(255,255,255,.94),rgba(245,239,222,.86));
  color:#10223d;border-radius:24px;border:1px solid rgba(255,255,255,.8);
  box-shadow:0 40px 120px rgba(0,0,0,.55),inset 0 0 0 10px rgba(217,184,108,.12);
}
.gate-card:before{content:"";position:absolute;inset:16px;border:1px solid rgba(141,107,53,.34);border-radius:18px}
.gate-card:after{content:"";position:absolute;width:270px;height:270px;border:1px dashed rgba(18,58,112,.32);border-radius:50%;animation:spin 38s linear infinite}
.gold-corners:before,.gold-corners:after{content:"✦";position:absolute;color:var(--gold2);font-size:28px;z-index:2}.gold-corners:before{left:28px;top:24px}.gold-corners:after{right:28px;bottom:24px}
.seal-orb{position:relative;z-index:3;width:148px;height:148px;border-radius:50%;padding:5px;background:linear-gradient(145deg,var(--gold),var(--royal));box-shadow:0 22px 50px rgba(18,58,112,.28);overflow:hidden}
.seal-orb img{width:100%;height:100%;object-fit:cover;border-radius:50%}
.overline{font-size:11px;letter-spacing:.28em;text-transform:uppercase;color:var(--gold);font-weight:900}
.gate-card .overline{position:relative;z-index:3;margin-top:24px;color:#6d5a33}
h1,h2,h3{font-family:Georgia,"Times New Roman","Noto Serif KR",serif;font-weight:500}
.gate-card h1{position:relative;z-index:3;font-size:clamp(38px,10vw,58px);line-height:1.02;letter-spacing:-.05em;margin:12px 0;color:#10223d}
.gate-copy{position:relative;z-index:3;color:#526078;font-size:14px}
.ornate-btn{position:relative;z-index:4;border:1px solid rgba(217,184,108,.46);border-radius:999px;padding:15px 24px;background:linear-gradient(110deg,#10223d,#236aa6 55%,#d9b86c);color:white;font-weight:900;letter-spacing:.12em;box-shadow:0 16px 36px rgba(18,58,112,.25);cursor:pointer}
.gate-card .ornate-btn{margin-top:30px;width:100%;max-width:280px}
.ornate-btn.small{margin-top:18px;padding:13px 18px;font-size:12px}

.topbar{position:sticky;top:0;z-index:80;display:flex;align-items:center;gap:12px;padding:14px 16px;background:rgba(3,7,18,.68);backdrop-filter:blur(20px);border-bottom:1px solid rgba(255,255,255,.08)}
.brand{display:flex;align-items:center;gap:12px;flex:1;min-width:0;border:0;background:transparent;color:white;text-align:left;cursor:pointer}
.brand-sigil{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#0d2850,#2374b9);color:var(--gold);box-shadow:0 0 24px rgba(35,116,185,.35)}
.brand b{display:block;font-size:16px}.brand small{display:block;color:#9aa7b8;font-size:10px;letter-spacing:.16em;text-transform:uppercase}
.sound{border:1px solid rgba(217,184,108,.22);background:rgba(255,255,255,.05);color:#e8d59f;border-radius:999px;padding:9px 12px;font-size:11px;font-weight:800}
.nav{position:sticky;top:73px;z-index:70;display:flex;gap:8px;overflow-x:auto;padding:10px 14px;background:rgba(3,7,18,.42);backdrop-filter:blur(16px);scrollbar-width:none}.nav::-webkit-scrollbar{display:none}
.nav button{flex:0 0 auto;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.04);color:#dfe9f7;border-radius:999px;padding:10px 13px;font-size:12px;font-weight:850;cursor:pointer}
.nav button.active{background:linear-gradient(110deg,#123a70,#2374b9);border-color:rgba(142,219,255,.28);box-shadow:0 0 24px rgba(35,116,185,.18)}

main{max-width:1280px;margin:0 auto;padding:22px 14px 60px}
.page{display:none;animation:fadeUp .45s cubic-bezier(.22,1,.36,1)}.page.active{display:block}
@keyframes fadeUp{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}

.home-hero{display:grid;gap:16px}
.hero-art{position:relative;overflow:hidden;border-radius:34px;padding:5px;background:linear-gradient(145deg,var(--gold),var(--royal));box-shadow:0 30px 100px var(--shadow)}
.hero-art:before{content:"";position:absolute;inset:15px;border:1px solid rgba(255,255,255,.35);border-radius:26px;z-index:2;pointer-events:none}
.hero-art img{width:100%;display:block;border-radius:29px;filter:saturate(1.05) contrast(1.04)}
.hero-panel,.showcase article,.library-panel,.lore-card,.student-file,.manuscript,.trial,.result-box,.id-card,.notice-grid article{
  position:relative;overflow:hidden;border:1px solid rgba(255,255,255,.10);background:linear-gradient(145deg,rgba(255,255,255,.10),rgba(255,255,255,.045));border-radius:30px;box-shadow:0 24px 80px rgba(0,0,0,.28);backdrop-filter:blur(18px)
}
.hero-panel:before,.showcase article:before,.library-panel:before,.lore-card:before,.student-file:before,.manuscript:before,.trial:before,.id-card:before,.notice-grid article:before{
  content:"";position:absolute;inset:10px;border:1px solid rgba(217,184,108,.16);border-radius:22px;pointer-events:none
}
.hero-panel{padding:24px}
.hero-panel h2{font-size:clamp(34px,8vw,64px);line-height:1.08;letter-spacing:-.055em;margin:10px 0;color:#fff}
.hero-panel p:not(.overline){color:#cbd5e4;font-size:14px;line-height:1.85}
.showcase{display:grid;gap:14px;margin-top:16px}.showcase article{padding:22px;cursor:pointer}
.showcase span{font-size:11px;letter-spacing:.24em;color:var(--gold);font-weight:900}
.showcase h3{font-size:30px;margin:8px 0;color:white}.showcase p{color:#bac6d5;font-size:13px}
.reference-band{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:16px}.reference-band img{width:100%;height:180px;object-fit:cover;border-radius:24px;border:1px solid rgba(255,255,255,.10);box-shadow:0 20px 56px rgba(0,0,0,.25)}

.page-head{margin:6px 0 18px;padding:20px 4px}.page-head h2{font-size:clamp(38px,9vw,70px);line-height:1;letter-spacing:-.06em;color:#fff;text-shadow:0 0 30px rgba(142,219,255,.15)}
.library-panel{padding:14px;margin-bottom:16px}
.tabs{display:flex;gap:8px;overflow-x:auto;padding-bottom:10px;scrollbar-width:none}.tabs::-webkit-scrollbar{display:none}
.tabs button{white-space:nowrap;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.05);color:#d7e3f0;border-radius:999px;padding:10px 13px;font-size:12px;font-weight:850}
.tabs button.active{background:linear-gradient(110deg,#123a70,#2374b9);border-color:rgba(142,219,255,.28)}
.search{display:flex;gap:8px;align-items:center;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.06);border-radius:18px;padding:0 13px;color:#d9b86c}
.search input{width:100%;border:0;outline:0;background:transparent;padding:14px 0;color:white;font-size:14px}
.lore-list{display:grid;gap:14px}.lore-card{padding:16px}
.lore-head{display:flex;gap:12px;align-items:flex-start;border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:12px;margin-bottom:12px}
.code{min-width:68px;border:1px solid rgba(142,219,255,.22);border-radius:16px;padding:9px 6px;text-align:center;color:#8edbff;background:rgba(35,116,185,.12);font-weight:900;font-size:11px}
.lore-head h3{font-size:22px;color:white;line-height:1.25}.lore-head p{font-size:11px;color:var(--gold);font-weight:900;margin-top:3px}
.copy{margin-left:auto;border:1px solid rgba(217,184,108,.22);background:rgba(255,255,255,.04);color:#e8d59f;border-radius:12px;padding:8px;font-size:11px;font-weight:900}
.keys{font-size:12px;color:#9fc8e6;margin-bottom:10px}.body{white-space:pre-wrap;color:#d3dce7;font-size:14px;line-height:1.9}
.copyfx{outline:1px solid rgba(142,219,255,.65);box-shadow:0 0 24px rgba(142,219,255,.18)}
.copyfx:after{content:"";position:absolute;inset:-30%;background:linear-gradient(110deg,transparent 25%,rgba(255,255,255,.10),rgba(255,255,255,.76),rgba(255,255,255,.12),transparent 75%);animation:glass 2s cubic-bezier(.22,1,.36,1);pointer-events:none}@keyframes glass{from{transform:translateX(-90%) rotate(5deg)}to{transform:translateX(90%) rotate(5deg)}}

.student-file{display:grid;gap:16px;padding:16px}.portrait-box{min-height:290px;border-radius:24px;display:grid;place-items:center;text-align:center;letter-spacing:.18em;color:#e8d59f;background:linear-gradient(145deg,#10223d,#236aa6);border:1px solid rgba(217,184,108,.22)}
.student-info{display:grid;gap:8px}.student-info div{display:grid;grid-template-columns:96px 1fr;gap:10px;padding:12px;border-radius:16px;background:rgba(255,255,255,.05)}.student-info b{color:var(--gold)}.student-info span{color:#e2ebf4}.manuscript{padding:20px;margin-top:16px;color:#d7e1ec;line-height:1.9}

.trial{padding:18px}.progress{display:grid;gap:8px;color:#9fb0c5;font-weight:900;font-size:12px;letter-spacing:.12em}.progress i{display:block;width:0;height:6px;border-radius:999px;background:linear-gradient(90deg,#2374b9,#8edbff,#d9b86c);transition:.35s}.question h3{font-size:26px;color:white;margin:18px 0}.options{display:grid;gap:10px}.options button,.trial-actions button{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.05);color:white;border-radius:18px;padding:14px;text-align:left;font-weight:800}.options button.selected{border-color:rgba(142,219,255,.5);background:rgba(35,116,185,.18)}.trial-actions{display:flex;gap:8px;margin-top:14px}.trial-actions button{text-align:center;flex:1}.result-box{display:none;padding:20px;margin-top:16px}.result-box.show{display:block}.emblem{width:140px;height:140px;border-radius:50%;display:grid;place-items:center;margin:0 auto 12px;color:white;font-size:56px;box-shadow:0 20px 52px rgba(0,0,0,.3)}.result-box h3{text-align:center;font-size:38px;color:white}.meta{display:grid;gap:8px;margin-top:14px}.meta div{display:grid;grid-template-columns:90px 1fr;gap:8px;padding:10px;border-radius:14px;background:rgba(255,255,255,.05)}.meta b{color:var(--gold)}
.id-card{padding:18px;max-width:720px}.id-title{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid rgba(255,255,255,.08);padding-bottom:12px;margin-bottom:12px}.id-title b{color:white}.id-title span{color:#9fb0c5;font-size:11px;letter-spacing:.16em;text-transform:uppercase}.persona-result{display:grid;gap:8px;margin-bottom:14px}.idrow{display:grid;grid-template-columns:100px 1fr;gap:10px;padding:11px;border-radius:16px;background:rgba(255,255,255,.05)}.idrow b{color:var(--gold)}
.notice-grid{display:grid;gap:14px}.notice-grid article{padding:20px}.notice-grid span{color:var(--gold);font-size:11px;letter-spacing:.18em;text-transform:uppercase;font-weight:900}.notice-grid h3{font-size:24px;color:white;margin:6px 0}.notice-grid p{font-size:14px;color:#c5d0dc}
.toast{position:fixed;left:50%;bottom:24px;z-index:1000;transform:translateX(-50%) translateY(12px);opacity:0;transition:.25s;background:rgba(5,12,25,.9);border:1px solid rgba(142,219,255,.26);border-radius:999px;color:white;padding:11px 18px;font-size:13px;font-weight:900}.toast.show{opacity:1;transform:translateX(-50%)}

@media(min-width:760px){
  main{padding:30px 20px 70px}.home-hero{grid-template-columns:1.55fr .9fr;align-items:stretch}.showcase{grid-template-columns:repeat(4,1fr)}.lore-list{grid-template-columns:repeat(2,1fr)}.student-file{grid-template-columns:310px 1fr}.notice-grid{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:700px){
  .topbar{align-items:flex-start}.brand b{font-size:14px}.nav{top:72px}.reference-band{grid-template-columns:1fr}.reference-band img{height:220px}.trial-actions{flex-direction:column}
}


/* v7 hard click safety */
.gate, .gate-card, #enterBtn{
  pointer-events:auto!important;
}
.gate-card:before,
.gate-card:after,
.gold-corners:before,
.gold-corners:after,
.cosmos,
.aurora,
.sparkles{
  pointer-events:none!important;
}
#enterBtn{
  position:relative!important;
  z-index:999999!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
}


/* v10 corrected Home split + Fortune category */
.home-split-panel{
  display:flex;
  flex-direction:column;
  gap:22px;
  padding:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  overflow:visible!important;
}

.home-split-panel:before{
  display:none!important;
}

.home-story-block,
.home-fortune-block,
.fortune-page-card{
  position:relative;
  overflow:hidden;
  border-radius:32px;
  padding:28px;
  border:1px solid rgba(217,184,108,.26);
  background:
    radial-gradient(circle at 20% 0%, rgba(75,120,255,.16), transparent 38%),
    linear-gradient(145deg, rgba(5,9,24,.96), rgba(18,25,52,.72));
  box-shadow:
    0 24px 80px rgba(0,0,0,.34),
    inset 0 0 80px rgba(255,255,255,.025),
    0 0 50px rgba(45,92,180,.13);
  backdrop-filter:blur(18px);
}

.home-story-block:before,
.home-fortune-block:before,
.fortune-page-card:before{
  content:"";
  position:absolute;
  inset:10px;
  border:1px solid rgba(217,184,108,.16);
  border-radius:24px;
  pointer-events:none;
}

.home-story-block:after,
.home-fortune-block:after,
.fortune-page-card:after{
  content:"";
  position:absolute;
  width:260px;
  height:260px;
  right:-90px;
  top:-90px;
  border:1px dashed rgba(142,219,255,.18);
  border-radius:50%;
  animation:spin 34s linear infinite;
  pointer-events:none;
}

.home-story-block h2{
  position:relative;
  z-index:1;
  font-size:clamp(30px,3.8vw,50px);
  line-height:.92;
  letter-spacing:-.075em;
  margin:12px 0 20px;
  color:#f9fbff;
  text-shadow:
    0 0 18px rgba(142,219,255,.18),
    0 0 42px rgba(35,116,185,.12);
}

.home-story-block p:not(.overline){
  position:relative;
  z-index:1;
  color:#cbd8ec;
  font-size:14px;
  line-height:2.05;
}

.home-fortune-block{
  min-height:300px;
  background:
    radial-gradient(circle at 30% 0%, rgba(98,61,168,.24), transparent 35%),
    radial-gradient(circle at 86% 20%, rgba(217,184,108,.16), transparent 34%),
    linear-gradient(145deg, rgba(4,5,18,.98), rgba(17,15,42,.84));
}

.home-fortune-block h3,
.fortune-page-card h3{
  position:relative;
  z-index:1;
  font-size:30px;
  line-height:1.1;
  margin:10px 0 10px;
  color:#fff7dd;
  text-shadow:0 0 28px rgba(217,184,108,.16);
}

.fortune-sub,
.fortune-page-card p{
  position:relative;
  z-index:1;
  color:#b9c6e3;
  font-size:13px;
  line-height:1.9;
  margin-bottom:18px;
}

.fortune-oracle-btn{
  position:relative;
  z-index:3;
  border:1px solid rgba(217,184,108,.42);
  border-radius:999px;
  padding:14px 20px;
  cursor:pointer;
  color:#fff;
  font-weight:900;
  letter-spacing:.08em;
  background:
    linear-gradient(120deg,#110821,#25105c 36%,#1b5fa5 68%,#d5b46d);
  box-shadow:
    0 0 30px rgba(98,61,168,.30),
    0 0 54px rgba(35,116,185,.18),
    inset 0 1px 0 rgba(255,255,255,.25);
  touch-action:manipulation;
}

.fortune-oracle-result{
  position:relative;
  z-index:1;
  margin-top:18px;
  min-height:132px;
  padding:20px;
  border-radius:24px;
  color:#dfe8ff;
  font-size:14px;
  line-height:1.95;
  white-space:pre-line;
  border:1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(circle at 0% 0%, rgba(142,219,255,.10), transparent 36%),
    rgba(255,255,255,.045);
}

.fortune-oracle-result strong{
  display:block;
  margin-bottom:10px;
  color:#ffe8ad;
  font-size:18px;
  font-family:Georgia,"Times New Roman","Noto Serif KR",serif;
}

.fortune-page-card{
  max-width:820px;
  margin:0 auto;
  padding:32px;
}

.tarot-crest{
  width:112px;
  height:112px;
  margin:0 auto 16px;
  display:grid;
  place-items:center;
  border-radius:50%;
  color:#ffe8ad;
  background:radial-gradient(circle,#2a175e,#090817 70%);
  border:1px solid rgba(217,184,108,.36);
  box-shadow:0 0 60px rgba(98,61,168,.28);
}

@media(max-width:900px){
  .home-story-block h2{
    font-size:42px;
  }
}


/* =========================
   Brisen Mystery Magical FX
   ========================= */

/* extra moving dust layer */
.moon-dust{
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  opacity:.55;
  background:
    radial-gradient(circle at 12% 30%, rgba(255,255,255,.55) 0 1px, transparent 1.6px),
    radial-gradient(circle at 66% 18%, rgba(142,219,255,.45) 0 1px, transparent 1.7px),
    radial-gradient(circle at 82% 72%, rgba(217,184,108,.45) 0 1px, transparent 1.8px),
    radial-gradient(circle at 30% 84%, rgba(255,255,255,.32) 0 1px, transparent 1.6px);
  background-size:180px 180px, 260px 260px, 220px 220px, 300px 300px;
  animation:moonDustDrift 48s linear infinite;
  mix-blend-mode:screen;
}

@keyframes moonDustDrift{
  from{background-position:0 0, 0 0, 0 0, 0 0; filter:blur(0);}
  50%{filter:blur(.3px);}
  to{background-position:260px -420px, -320px -260px, 220px -360px, -260px -300px; filter:blur(0);}
}

/* slow arcane circle in deep background */
.rune-ring{
  position:fixed;
  width:520px;
  height:520px;
  right:-190px;
  top:120px;
  z-index:-1;
  pointer-events:none;
  border-radius:50%;
  border:1px dashed rgba(142,219,255,.11);
  box-shadow:
    inset 0 0 80px rgba(35,116,185,.06),
    0 0 80px rgba(35,116,185,.06);
  animation:runeRingRotate 80s linear infinite;
}

.rune-ring:before,
.rune-ring:after{
  content:"";
  position:absolute;
  border-radius:50%;
  inset:48px;
  border:1px solid rgba(217,184,108,.08);
}
.rune-ring:after{
  inset:105px;
  border-style:dotted;
  border-color:rgba(255,255,255,.08);
}

@keyframes runeRingRotate{
  to{transform:rotate(360deg);}
}

/* cinematic light sweep on premium panels */
.hero-art,
.home-story-block,
.home-fortune-block,
.fortune-page-card,
.showcase article,
.lore-card,
.student-file,
.manuscript,
.trial,
.id-card,
.notice-grid article{
  isolation:isolate;
}

.hero-art:after,
.home-story-block .magic-sheen,
.home-fortune-block .magic-sheen,
.showcase article .magic-sheen,
.lore-card .magic-sheen,
.student-file .magic-sheen,
.manuscript .magic-sheen,
.trial .magic-sheen,
.id-card .magic-sheen,
.notice-grid article .magic-sheen{
  content:"";
  position:absolute;
  inset:-45%;
  z-index:1;
  pointer-events:none;
  background:linear-gradient(115deg,
    transparent 28%,
    rgba(255,255,255,.04) 39%,
    rgba(255,255,255,.30) 49%,
    rgba(142,219,255,.08) 56%,
    transparent 70%);
  transform:translateX(-75%) rotate(7deg);
  animation:luxSweep 9s cubic-bezier(.22,1,.36,1) infinite;
  opacity:.0;
}

.hero-art:after{
  opacity:.52;
  animation-duration:12s;
}

@keyframes luxSweep{
  0%,45%{transform:translateX(-90%) rotate(7deg);opacity:0;}
  58%{opacity:.75;}
  78%{opacity:.20;}
  100%{transform:translateX(90%) rotate(7deg);opacity:0;}
}

/* hover/tap magical lift */
.showcase article,
.lore-card,
.notice-grid article,
.home-fortune-block,
.home-story-block,
.id-card,
.trial{
  transition:
    transform .45s cubic-bezier(.22,1,.36,1),
    border-color .45s ease,
    box-shadow .45s ease,
    background .45s ease;
}

@media(hover:hover){
  .showcase article:hover,
  .lore-card:hover,
  .notice-grid article:hover,
  .home-fortune-block:hover,
  .home-story-block:hover,
  .id-card:hover,
  .trial:hover{
    transform:translateY(-4px);
    border-color:rgba(217,184,108,.34);
    box-shadow:
      0 30px 90px rgba(0,0,0,.36),
      0 0 46px rgba(35,116,185,.17),
      inset 0 0 70px rgba(255,255,255,.035);
  }
}

/* touch pulse class added by JS */
.magic-tap{
  animation:magicTapPulse 1.35s cubic-bezier(.22,1,.36,1);
}

@keyframes magicTapPulse{
  0%{box-shadow:0 0 0 rgba(142,219,255,0);}
  35%{
    box-shadow:
      0 0 0 1px rgba(142,219,255,.42),
      0 0 38px rgba(142,219,255,.23),
      0 0 70px rgba(217,184,108,.10);
  }
  100%{box-shadow:0 0 0 rgba(142,219,255,0);}
}

/* page transition feels more arcane */
.page.active{
  animation:pageReveal .62s cubic-bezier(.22,1,.36,1);
}

@keyframes pageReveal{
  from{
    opacity:0;
    transform:translateY(22px) scale(.985);
    filter:blur(5px);
  }
  to{
    opacity:1;
    transform:none;
    filter:blur(0);
  }
}

/* staggered card appearance */
.showcase article,
.lore-card,
.notice-grid article{
  animation:staggerRise .68s cubic-bezier(.22,1,.36,1) both;
}

.showcase article:nth-child(2),
.lore-card:nth-child(2),
.notice-grid article:nth-child(2){animation-delay:.05s}
.showcase article:nth-child(3),
.lore-card:nth-child(3),
.notice-grid article:nth-child(3){animation-delay:.10s}
.showcase article:nth-child(4),
.lore-card:nth-child(4),
.notice-grid article:nth-child(4){animation-delay:.15s}

@keyframes staggerRise{
  from{opacity:0;transform:translateY(18px);}
  to{opacity:1;transform:none;}
}

/* Fortune = darker, tarot-like, more mysterious */
.home-fortune-block,
.fortune-page-card{
  background:
    radial-gradient(circle at 20% 0%, rgba(147,82,255,.24), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(217,184,108,.18), transparent 30%),
    radial-gradient(circle at 52% 105%, rgba(35,116,185,.18), transparent 38%),
    linear-gradient(145deg, rgba(4,5,18,.98), rgba(16,11,42,.90))!important;
}

.home-fortune-block:after,
.fortune-page-card:after{
  border-color:rgba(217,184,108,.18)!important;
  box-shadow:0 0 70px rgba(147,82,255,.08);
}

.fortune-oracle-btn{
  overflow:hidden;
}

.fortune-oracle-btn:before{
  content:"";
  position:absolute;
  inset:-80%;
  background:conic-gradient(from 180deg, transparent, rgba(255,255,255,.24), transparent, rgba(217,184,108,.20), transparent);
  animation:buttonAura 7s linear infinite;
  pointer-events:none;
}

.fortune-oracle-btn{
  position:relative;
}

@keyframes buttonAura{
  to{transform:rotate(360deg);}
}

.fortune-oracle-result.revealed{
  animation:fortuneReveal 1.05s cubic-bezier(.22,1,.36,1);
}

@keyframes fortuneReveal{
  0%{
    opacity:0;
    transform:translateY(18px) rotateX(18deg);
    filter:blur(8px);
  }
  55%{
    opacity:1;
    filter:blur(0);
    box-shadow:
      0 0 42px rgba(147,82,255,.22),
      0 0 80px rgba(217,184,108,.10);
  }
  100%{
    transform:none;
    filter:blur(0);
  }
}

/* map feels alive */
.hero-art img{
  animation:mapBreath 9s ease-in-out infinite;
}

@keyframes mapBreath{
  0%,100%{filter:saturate(1.05) contrast(1.04) brightness(1);}
  50%{filter:saturate(1.12) contrast(1.07) brightness(1.04);}
}

/* mobile: keep effects lighter */
@media(max-width:700px){
  .rune-ring{
    width:360px;
    height:360px;
    right:-210px;
    top:170px;
    opacity:.65;
  }
  .moon-dust{
    opacity:.42;
  }
}


/* =========================
   Opening Grimoire FX Upgrade
   ========================= */

.gate{
  overflow:hidden;
}

.gate:before,
.gate:after{
  content:"";
  position:absolute;
  pointer-events:none;
  border-radius:50%;
}

.gate:before{
  width:820px;
  height:820px;
  background:
    radial-gradient(circle, rgba(142,219,255,.18), transparent 34%),
    conic-gradient(from 40deg, transparent, rgba(35,116,185,.20), transparent, rgba(217,184,108,.18), transparent);
  filter:blur(18px);
  animation:gateCosmicTurn 22s linear infinite;
}

.gate:after{
  width:480px;
  height:480px;
  border:1px dashed rgba(217,184,108,.20);
  box-shadow:
    0 0 80px rgba(35,116,185,.18),
    inset 0 0 80px rgba(217,184,108,.08);
  animation:gateSealRotate 30s linear infinite reverse;
}

@keyframes gateCosmicTurn{
  to{transform:rotate(360deg);}
}

@keyframes gateSealRotate{
  to{transform:rotate(360deg);}
}

.gate-card{
  transform-style:preserve-3d;
  animation:
    gateBookFloat 4.8s ease-in-out infinite,
    gateBookGlow 3.8s ease-in-out infinite alternate;
}

@keyframes gateBookFloat{
  0%,100%{transform:translateY(0) rotateX(0deg);}
  50%{transform:translateY(-10px) rotateX(1.5deg);}
}

@keyframes gateBookGlow{
  from{
    box-shadow:
      0 40px 120px rgba(0,0,0,.55),
      inset 0 0 0 10px rgba(217,184,108,.12),
      0 0 40px rgba(35,116,185,.12);
  }
  to{
    box-shadow:
      0 48px 140px rgba(0,0,0,.60),
      inset 0 0 0 10px rgba(217,184,108,.18),
      0 0 90px rgba(142,219,255,.26),
      0 0 150px rgba(217,184,108,.14);
  }
}

.gate-aura{
  position:absolute;
  inset:-45%;
  z-index:0;
  pointer-events:none;
  background:
    conic-gradient(from 0deg,
      transparent,
      rgba(142,219,255,.16),
      transparent,
      rgba(217,184,108,.20),
      transparent,
      rgba(115,82,255,.14),
      transparent);
  animation:gateAuraSpin 18s linear infinite;
  filter:blur(2px);
}

@keyframes gateAuraSpin{
  to{transform:rotate(360deg);}
}

.gate-orbit{
  position:absolute;
  z-index:1;
  pointer-events:none;
  border-radius:50%;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
}

.orbit-one{
  width:330px;
  height:330px;
  border:1px dashed rgba(35,116,185,.30);
  box-shadow:0 0 50px rgba(35,116,185,.13);
  animation:orbitTurn 16s linear infinite;
}

.orbit-two{
  width:250px;
  height:250px;
  border:1px solid rgba(217,184,108,.22);
  box-shadow:inset 0 0 38px rgba(217,184,108,.07);
  animation:orbitTurn 24s linear infinite reverse;
}

@keyframes orbitTurn{
  to{transform:translate(-50%,-50%) rotate(360deg);}
}

.gate-runes{
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
}

.gate-runes span{
  position:absolute;
  color:rgba(18,58,112,.58);
  text-shadow:
    0 0 14px rgba(142,219,255,.45),
    0 0 34px rgba(217,184,108,.22);
  font-size:22px;
  animation:runeFloat 4.6s ease-in-out infinite;
}

.gate-runes span:nth-child(1){left:15%;top:18%;animation-delay:-.2s}
.gate-runes span:nth-child(2){right:17%;top:23%;animation-delay:-1.1s}
.gate-runes span:nth-child(3){left:19%;bottom:22%;animation-delay:-2s}
.gate-runes span:nth-child(4){right:20%;bottom:18%;animation-delay:-2.8s}
.gate-runes span:nth-child(5){left:50%;top:12%;animation-delay:-1.8s}
.gate-runes span:nth-child(6){left:50%;bottom:11%;animation-delay:-3.4s}

@keyframes runeFloat{
  0%,100%{transform:translateY(0) scale(.92);opacity:.45}
  50%{transform:translateY(-10px) scale(1.08);opacity:.95}
}

.gate-pages{
  position:absolute;
  left:18px;
  top:70px;
  bottom:70px;
  width:26px;
  z-index:2;
  pointer-events:none;
}

.gate-pages i{
  position:absolute;
  left:0;
  width:100%;
  height:1px;
  background:linear-gradient(90deg, transparent, rgba(141,107,53,.42), transparent);
  animation:pageWhisper 3.6s ease-in-out infinite;
}

.gate-pages i:nth-child(1){top:22%;animation-delay:-.2s}
.gate-pages i:nth-child(2){top:48%;animation-delay:-1.1s}
.gate-pages i:nth-child(3){top:73%;animation-delay:-2s}

@keyframes pageWhisper{
  0%,100%{transform:translateX(0) scaleX(.6);opacity:.25}
  50%{transform:translateX(7px) scaleX(1);opacity:.9}
}

.seal-orb{
  animation:sealPulse 3.2s ease-in-out infinite alternate;
}

@keyframes sealPulse{
  from{
    filter:saturate(1) brightness(1);
    box-shadow:0 22px 50px rgba(18,58,112,.28);
  }
  to{
    filter:saturate(1.18) brightness(1.08);
    box-shadow:
      0 22px 50px rgba(18,58,112,.28),
      0 0 42px rgba(142,219,255,.35),
      0 0 80px rgba(217,184,108,.20);
  }
}

.gate-card h1,
.gate-copy,
.gate-card .overline,
.gate-card .ornate-btn,
.seal-orb{
  position:relative;
  z-index:5;
}

.gate-card .ornate-btn{
  overflow:hidden;
}

.gate-card .ornate-btn:before{
  content:"";
  position:absolute;
  inset:-90%;
  background:
    conic-gradient(from 0deg,
      transparent,
      rgba(255,255,255,.26),
      transparent,
      rgba(142,219,255,.22),
      transparent,
      rgba(217,184,108,.24),
      transparent);
  animation:buttonSealSpin 8s linear infinite;
  pointer-events:none;
}

.gate-card .ornate-btn:after{
  content:"";
  position:absolute;
  inset:2px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  pointer-events:none;
}

@keyframes buttonSealSpin{
  to{transform:rotate(360deg);}
}

/* Unlock animation when button is pressed */
.gate.unlocking .gate-card{
  animation:unlockBook 1.05s cubic-bezier(.22,1,.36,1) forwards;
}

.gate.unlocking .gate-aura{
  animation:unlockAura .95s cubic-bezier(.22,1,.36,1) forwards;
}

.gate.unlocking .gate-runes span{
  animation:unlockRunes .95s cubic-bezier(.22,1,.36,1) forwards;
}

.gate.unlocking .seal-orb{
  animation:unlockSeal .95s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes unlockBook{
  0%{transform:translateY(0) scale(1);filter:brightness(1)}
  45%{transform:translateY(-12px) scale(1.025);filter:brightness(1.2)}
  100%{transform:translateY(12px) scale(1.08);filter:brightness(1.35) blur(10px);opacity:0}
}

@keyframes unlockAura{
  0%{transform:scale(1) rotate(0);opacity:1}
  100%{transform:scale(1.8) rotate(160deg);opacity:0}
}

@keyframes unlockRunes{
  0%{opacity:1;filter:blur(0)}
  100%{opacity:0;transform:translateY(-34px) scale(1.8);filter:blur(6px)}
}

@keyframes unlockSeal{
  0%{transform:scale(1);opacity:1}
  50%{transform:scale(1.18);opacity:1}
  100%{transform:scale(2.2);opacity:0;filter:blur(8px)}
}

@media(max-width:700px){
  .gate-card{
    min-height:560px;
  }

  .orbit-one{
    width:290px;
    height:290px;
  }

  .orbit-two{
    width:218px;
    height:218px;
  }

  .gate-runes span{
    font-size:18px;
  }
}


/* =========================
   Unlock Magic Circle Moment
   ========================= */

.unlock-circle{
  position:absolute;
  left:50%;
  top:50%;
  width:min(72vw,520px);
  height:min(72vw,520px);
  transform:translate(-50%,-50%) scale(.35) rotate(-18deg);
  z-index:30;
  pointer-events:none;
  border-radius:50%;
  opacity:0;
  border:1px solid rgba(142,219,255,.0);
}

.unlock-circle:before,
.unlock-circle:after,
.unlock-circle span,
.unlock-circle i{
  content:"";
  position:absolute;
  border-radius:50%;
  pointer-events:none;
}

.unlock-circle:before{
  inset:0;
  border:1px solid rgba(142,219,255,.78);
  box-shadow:
    0 0 22px rgba(142,219,255,.52),
    0 0 80px rgba(35,116,185,.38),
    inset 0 0 40px rgba(142,219,255,.18);
}

.unlock-circle:after{
  inset:10%;
  border:1px dashed rgba(217,184,108,.86);
  box-shadow:
    0 0 30px rgba(217,184,108,.25),
    inset 0 0 34px rgba(217,184,108,.12);
}

.unlock-circle span{
  inset:20%;
  border:1px solid rgba(255,255,255,.42);
  background:
    conic-gradient(from 0deg,
      transparent 0 12%,
      rgba(142,219,255,.25) 13% 15%,
      transparent 16% 28%,
      rgba(217,184,108,.25) 29% 31%,
      transparent 32% 48%,
      rgba(142,219,255,.20) 49% 52%,
      transparent 53% 100%);
}

.unlock-circle i{
  inset:35%;
  border:1px dotted rgba(255,255,255,.55);
  box-shadow:
    0 0 26px rgba(255,255,255,.22),
    inset 0 0 18px rgba(142,219,255,.18);
}

.unlock-circle b{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  color:#fff6cf;
  font-size:clamp(18px,4vw,34px);
  letter-spacing:.34em;
  text-shadow:
    0 0 16px rgba(255,255,255,.9),
    0 0 34px rgba(142,219,255,.58),
    0 0 70px rgba(217,184,108,.36);
  font-weight:400;
}

.gate.unlocking .unlock-circle{
  animation:circleSummon 6s cubic-bezier(.22,1,.36,1) forwards;
}

.gate.unlocking .unlock-circle:before{
  animation:circleSpin 6s cubic-bezier(.22,1,.36,1) forwards;
}

.gate.unlocking .unlock-circle:after{
  animation:circleSpinReverse 6s cubic-bezier(.22,1,.36,1) forwards;
}

.gate.unlocking .unlock-circle span{
  animation:circleGlyphSpin 6s cubic-bezier(.22,1,.36,1) forwards;
}

.gate.unlocking .unlock-circle i{
  animation:circleCorePulse 6s cubic-bezier(.22,1,.36,1) forwards;
}

.gate.unlocking .unlock-circle b{
  animation:runeTextBurst 6s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes circleSummon{
  0%{
    opacity:0;
    transform:translate(-50%,-50%) scale(.18) rotate(-22deg);
    filter:blur(14px);
  }
  14%{
    opacity:1;
    filter:blur(0);
  }
  38%{
    transform:translate(-50%,-50%) scale(1.02) rotate(0deg);
    opacity:1;
  }
  72%{
    transform:translate(-50%,-50%) scale(1.06) rotate(10deg);
    opacity:1;
    filter:blur(0);
  }
  88%{
    transform:translate(-50%,-50%) scale(1.15) rotate(18deg);
    opacity:.95;
  }
  100%{
    transform:translate(-50%,-50%) scale(1.45) rotate(28deg);
    opacity:0;
    filter:blur(8px);
  }
}

@keyframes circleSpin{
  from{transform:rotate(0deg)}
  to{transform:rotate(260deg)}
}

@keyframes circleSpinReverse{
  from{transform:rotate(0deg)}
  to{transform:rotate(-320deg)}
}

@keyframes circleGlyphSpin{
  from{transform:rotate(0deg) scale(.88);opacity:.25}
  45%{opacity:1}
  to{transform:rotate(420deg) scale(1.08);opacity:0}
}

@keyframes circleCorePulse{
  0%{transform:scale(.5);opacity:0}
  35%{transform:scale(1);opacity:1}
  80%{transform:scale(1.18);opacity:.9}
  100%{transform:scale(2.2);opacity:0}
}

@keyframes runeTextBurst{
  0%{opacity:0;transform:scale(.6);filter:blur(8px)}
  28%{opacity:1;transform:scale(1);filter:blur(0)}
  72%{opacity:.95;transform:scale(1.08);filter:blur(0)}
  100%{opacity:0;transform:scale(1.8);filter:blur(8px)}
}

/* make book wait behind the magic circle */
.gate.unlocking .gate-card{
  animation:unlockBookAfterCircle 6.4s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes unlockBookAfterCircle{
  0%,66%{
    transform:translateY(0) scale(1);
    filter:brightness(1);
    opacity:1;
  }
  78%{
    transform:translateY(-8px) scale(1.025);
    filter:brightness(1.25);
    opacity:1;
  }
  100%{
    transform:translateY(14px) scale(1.08);
    filter:brightness(1.45) blur(10px);
    opacity:0;
  }
}

@media(max-width:700px){
  .unlock-circle{
    width:86vw;
    height:86vw;
  }
}


/* =========================
   Ultimate Arcane Circle FX
   ========================= */

.unlock-circle{
  filter:
    drop-shadow(0 0 30px rgba(142,219,255,.65))
    drop-shadow(0 0 90px rgba(35,116,185,.42))
    drop-shadow(0 0 140px rgba(217,184,108,.24));
}

.unlock-circle:before{
  border-width:2px!important;
  background:
    radial-gradient(circle at center,
      rgba(142,219,255,.10),
      transparent 62%);
}

.unlock-circle:after{
  border-width:2px!important;
  animation-duration:18s!important;
}

.unlock-circle span{
  background:
    conic-gradient(from 0deg,
      transparent 0 6%,
      rgba(142,219,255,.35) 7% 9%,
      transparent 10% 16%,
      rgba(217,184,108,.32) 17% 19%,
      transparent 20% 26%,
      rgba(255,255,255,.22) 27% 29%,
      transparent 30% 36%,
      rgba(115,82,255,.35) 37% 39%,
      transparent 40% 46%,
      rgba(142,219,255,.28) 47% 49%,
      transparent 50% 100%)!important;
  box-shadow:
    inset 0 0 40px rgba(142,219,255,.16),
    0 0 60px rgba(142,219,255,.16);
}

.unlock-circle i{
  background:
    radial-gradient(circle,
      rgba(255,255,255,.12),
      transparent 72%);
}

.unlock-circle b{
  letter-spacing:.55em!important;
  text-shadow:
    0 0 22px rgba(255,255,255,.95),
    0 0 50px rgba(142,219,255,.75),
    0 0 90px rgba(35,116,185,.55),
    0 0 150px rgba(217,184,108,.34)!important;
}

/* additional spinning glyph rings */
.unlock-circle .glyph-ring,
.unlock-circle .glyph-ring-two{
  position:absolute;
  inset:6%;
  border-radius:50%;
  pointer-events:none;
}

.unlock-circle .glyph-ring{
  border:1px dotted rgba(142,219,255,.52);
  animation:glyphRotate 14s linear infinite;
  box-shadow:
    inset 0 0 30px rgba(142,219,255,.18),
    0 0 30px rgba(142,219,255,.18);
}

.unlock-circle .glyph-ring-two{
  inset:18%;
  border:1px dashed rgba(217,184,108,.52);
  animation:glyphRotateReverse 11s linear infinite;
  box-shadow:
    inset 0 0 22px rgba(217,184,108,.16),
    0 0 22px rgba(217,184,108,.16);
}

@keyframes glyphRotate{
  to{transform:rotate(360deg);}
}

@keyframes glyphRotateReverse{
  to{transform:rotate(-360deg);}
}

/* magic burst particles */
.unlock-circle .burst{
  position:absolute;
  inset:0;
  pointer-events:none;
}

.unlock-circle .burst em{
  position:absolute;
  width:4px;
  height:4px;
  border-radius:50%;
  background:rgba(255,255,255,.95);
  box-shadow:
    0 0 12px rgba(255,255,255,.95),
    0 0 28px rgba(142,219,255,.75);
  animation:burstFloat 4.8s ease-in-out infinite;
}

.unlock-circle .burst em:nth-child(1){left:18%;top:28%;animation-delay:-.2s}
.unlock-circle .burst em:nth-child(2){left:72%;top:20%;animation-delay:-1s}
.unlock-circle .burst em:nth-child(3){left:84%;top:56%;animation-delay:-2s}
.unlock-circle .burst em:nth-child(4){left:26%;top:78%;animation-delay:-3s}
.unlock-circle .burst em:nth-child(5){left:50%;top:10%;animation-delay:-4s}
.unlock-circle .burst em:nth-child(6){left:10%;top:50%;animation-delay:-2.5s}
.unlock-circle .burst em:nth-child(7){left:90%;top:44%;animation-delay:-1.8s}
.unlock-circle .burst em:nth-child(8){left:50%;top:88%;animation-delay:-3.8s}

@keyframes burstFloat{
  0%,100%{
    transform:translateY(0) scale(.7);
    opacity:.25;
  }
  50%{
    transform:translateY(-18px) scale(1.5);
    opacity:1;
  }
}

/* keep circle visible much longer */
@keyframes circleSummon{
  0%{
    opacity:0;
    transform:translate(-50%,-50%) scale(.12) rotate(-30deg);
    filter:blur(20px);
  }
  12%{
    opacity:1;
    filter:blur(0);
  }
  30%{
    transform:translate(-50%,-50%) scale(1) rotate(0deg);
    opacity:1;
  }
  76%{
    transform:translate(-50%,-50%) scale(1.08) rotate(12deg);
    opacity:1;
    filter:blur(0);
  }
  90%{
    transform:translate(-50%,-50%) scale(1.22) rotate(24deg);
    opacity:.95;
  }
  100%{
    transform:translate(-50%,-50%) scale(1.55) rotate(40deg);
    opacity:0;
    filter:blur(12px);
  }
}



/* =========================
   REAL 6s Hyper-Visible Gate Circle
   ========================= */

.gate.circle-showtime .unlock-circle{
  z-index:9999!important;
  opacity:1!important;
  width:min(96vw,720px)!important;
  height:min(96vw,720px)!important;
  animation:circleShowtime 4s cubic-bezier(.22,1,.36,1) forwards!important;
  filter:
    drop-shadow(0 0 34px rgba(255,255,255,.72))
    drop-shadow(0 0 80px rgba(142,219,255,.78))
    drop-shadow(0 0 160px rgba(45,112,255,.58))
    drop-shadow(0 0 230px rgba(217,184,108,.42))!important;
}

.gate.circle-showtime .unlock-circle:before{
  border:3px solid rgba(142,219,255,.95)!important;
  box-shadow:
    0 0 40px rgba(142,219,255,.9),
    0 0 120px rgba(35,116,185,.7),
    inset 0 0 70px rgba(142,219,255,.38)!important;
}

.gate.circle-showtime .unlock-circle:after{
  border:3px dashed rgba(255,226,155,.95)!important;
  box-shadow:
    0 0 50px rgba(217,184,108,.7),
    inset 0 0 60px rgba(217,184,108,.28)!important;
}

.gate.circle-showtime .unlock-circle span{
  border:2px solid rgba(255,255,255,.58)!important;
  box-shadow:
    inset 0 0 70px rgba(142,219,255,.24),
    0 0 90px rgba(142,219,255,.35)!important;
}

.gate.circle-showtime .unlock-circle b{
  font-size:clamp(24px,6vw,58px)!important;
  color:#fff9d7!important;
  text-shadow:
    0 0 20px rgba(255,255,255,1),
    0 0 60px rgba(142,219,255,1),
    0 0 120px rgba(35,116,185,.95),
    0 0 220px rgba(217,184,108,.72)!important;
}

.gate.circle-showtime:before{
  animation:gateCosmicTurn 4s linear infinite!important;
  opacity:1!important;
  filter:blur(12px) brightness(1.45)!important;
}

.gate.circle-showtime:after{
  width:680px!important;
  height:680px!important;
  border-color:rgba(217,184,108,.52)!important;
  animation:gateSealRotate 4s linear infinite!important;
  box-shadow:
    0 0 120px rgba(142,219,255,.38),
    inset 0 0 110px rgba(217,184,108,.22)!important;
}

.gate.circle-showtime .gate-card{
  animation:bookWaitThenVanish 4.25s cubic-bezier(.22,1,.36,1) forwards!important;
}

@keyframes circleShowtime{
  0%{
    opacity:0;
    transform:translate(-50%,-50%) scale(.10) rotate(-40deg);
    filter:blur(22px);
  }
  12%{
    opacity:1;
    transform:translate(-50%,-50%) scale(.82) rotate(-8deg);
    filter:blur(0);
  }
  24%{
    opacity:1;
    transform:translate(-50%,-50%) scale(1) rotate(0deg);
  }
  78%{
    opacity:1;
    transform:translate(-50%,-50%) scale(1.08) rotate(42deg);
    filter:blur(0);
  }
  92%{
    opacity:1;
    transform:translate(-50%,-50%) scale(1.22) rotate(78deg);
  }
  100%{
    opacity:0;
    transform:translate(-50%,-50%) scale(1.75) rotate(120deg);
    filter:blur(16px);
  }
}

@keyframes bookWaitThenVanish{
  0%,58%{
    opacity:1;
    transform:translateY(0) scale(1);
    filter:brightness(1);
  }
  76%{
    opacity:1;
    transform:translateY(-12px) scale(1.04);
    filter:brightness(1.65);
  }
  100%{
    opacity:0;
    transform:translateY(22px) scale(1.14);
    filter:brightness(2) blur(14px);
  }
}

/* extra visible rune rays */
.unlock-circle .rayburst{
  position:absolute;
  inset:-18%;
  pointer-events:none;
  border-radius:50%;
  background:
    conic-gradient(from 0deg,
      transparent 0 4%,
      rgba(142,219,255,.34) 5% 6%,
      transparent 7% 12%,
      rgba(217,184,108,.32) 13% 14%,
      transparent 15% 22%,
      rgba(255,255,255,.22) 23% 24%,
      transparent 25% 100%);
  animation:raySpin 2.8s linear infinite;
  mix-blend-mode:screen;
  filter:blur(.5px);
}

@keyframes raySpin{
  to{transform:rotate(360deg);}
}


/* =========================
   4s Ultra Glow Rune Burst
   ========================= */

.gate.circle-showtime .unlock-circle{
  animation:circleShowtime4sUltra 4s cubic-bezier(.22,1,.36,1) forwards!important;
  filter:
    drop-shadow(0 0 44px rgba(255,255,255,.90))
    drop-shadow(0 0 110px rgba(142,219,255,.95))
    drop-shadow(0 0 210px rgba(35,116,185,.86))
    drop-shadow(0 0 320px rgba(217,184,108,.55))!important;
}

.gate.circle-showtime .unlock-circle:before{
  background:
    radial-gradient(circle at center, rgba(255,255,255,.24), transparent 10%),
    radial-gradient(circle at center, rgba(142,219,255,.20), transparent 55%)!important;
  border-color:rgba(198,238,255,1)!important;
  box-shadow:
    0 0 38px rgba(255,255,255,.95),
    0 0 95px rgba(142,219,255,.95),
    0 0 190px rgba(35,116,185,.75),
    inset 0 0 90px rgba(142,219,255,.48)!important;
}

.gate.circle-showtime .unlock-circle:after{
  border-color:rgba(255,232,170,1)!important;
  box-shadow:
    0 0 50px rgba(255,235,180,.90),
    0 0 140px rgba(217,184,108,.68),
    inset 0 0 90px rgba(217,184,108,.36)!important;
}

/* concentric luminous runes */
.unlock-circle .rune-band,
.unlock-circle .rune-band-two,
.unlock-circle .rune-band-three{
  position:absolute;
  border-radius:50%;
  pointer-events:none;
  mix-blend-mode:screen;
}

.unlock-circle .rune-band{
  inset:-4%;
  border:2px solid rgba(142,219,255,.45);
  background:conic-gradient(from 0deg,
    transparent 0 3%,
    rgba(142,219,255,.7) 4% 5%,
    transparent 6% 10%,
    rgba(255,255,255,.48) 11% 12%,
    transparent 13% 20%,
    rgba(217,184,108,.64) 21% 22%,
    transparent 23% 100%);
  animation:runeBandSpin 3.4s linear infinite;
  box-shadow:0 0 80px rgba(142,219,255,.34);
}

.unlock-circle .rune-band-two{
  inset:12%;
  border:2px dashed rgba(255,232,170,.62);
  background:conic-gradient(from 180deg,
    transparent 0 8%,
    rgba(217,184,108,.70) 9% 10%,
    transparent 11% 19%,
    rgba(142,219,255,.55) 20% 21%,
    transparent 22% 100%);
  animation:runeBandSpinReverse 2.8s linear infinite;
  box-shadow:inset 0 0 50px rgba(217,184,108,.24);
}

.unlock-circle .rune-band-three{
  inset:27%;
  border:1px dotted rgba(255,255,255,.85);
  background:radial-gradient(circle, rgba(255,255,255,.18), transparent 58%);
  animation:runeBandPulse 1.15s ease-in-out infinite alternate;
}

@keyframes runeBandSpin{
  to{transform:rotate(360deg);}
}

@keyframes runeBandSpinReverse{
  to{transform:rotate(-360deg);}
}

@keyframes runeBandPulse{
  from{opacity:.55;transform:scale(.96);}
  to{opacity:1;transform:scale(1.04);}
}

/* radiant beams */
.unlock-circle .flash-beams{
  position:absolute;
  inset:-28%;
  pointer-events:none;
  border-radius:50%;
  background:conic-gradient(from 0deg,
    rgba(255,255,255,.0) 0 2%,
    rgba(255,255,255,.68) 3% 3.6%,
    rgba(142,219,255,.0) 4.5% 10%,
    rgba(142,219,255,.48) 11% 11.8%,
    transparent 13% 20%,
    rgba(217,184,108,.50) 21% 22%,
    transparent 23% 31%,
    rgba(255,255,255,.55) 32% 32.6%,
    transparent 34% 100%);
  filter:blur(1px);
  mix-blend-mode:screen;
  animation:beamBlast 4s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes beamBlast{
  0%{opacity:0;transform:scale(.3) rotate(-20deg);}
  18%{opacity:.95;transform:scale(.95) rotate(12deg);}
  62%{opacity:.7;transform:scale(1.16) rotate(90deg);}
  100%{opacity:0;transform:scale(1.8) rotate(170deg);}
}

/* stronger particle bloom */
.unlock-circle .burst em{
  width:6px!important;
  height:6px!important;
  background:rgba(255,255,255,1)!important;
  box-shadow:
    0 0 18px rgba(255,255,255,1),
    0 0 44px rgba(142,219,255,.95),
    0 0 80px rgba(217,184,108,.55)!important;
  animation:burstFloatUltra 2.4s ease-in-out infinite!important;
}

@keyframes burstFloatUltra{
  0%,100%{
    transform:translateY(0) scale(.75);
    opacity:.35;
  }
  50%{
    transform:translateY(-28px) scale(1.9);
    opacity:1;
  }
}

/* central white-blue bloom */
.unlock-circle .core-bloom{
  position:absolute;
  inset:38%;
  border-radius:50%;
  pointer-events:none;
  background:radial-gradient(circle,
    rgba(255,255,255,.96),
    rgba(142,219,255,.62) 28%,
    rgba(217,184,108,.24) 50%,
    transparent 72%);
  filter:blur(3px);
  mix-blend-mode:screen;
  animation:coreBloom 4s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes coreBloom{
  0%{opacity:0;transform:scale(.1);}
  20%{opacity:1;transform:scale(.7);}
  65%{opacity:.9;transform:scale(1.2);}
  100%{opacity:0;transform:scale(3.4);}
}

@keyframes circleShowtime4sUltra{
  0%{
    opacity:0;
    transform:translate(-50%,-50%) scale(.08) rotate(-50deg);
    filter:blur(24px);
  }
  12%{
    opacity:1;
    transform:translate(-50%,-50%) scale(.88) rotate(-12deg);
    filter:blur(0);
  }
  24%{
    opacity:1;
    transform:translate(-50%,-50%) scale(1.03) rotate(0deg);
  }
  70%{
    opacity:1;
    transform:translate(-50%,-50%) scale(1.12) rotate(70deg);
    filter:blur(0);
  }
  88%{
    opacity:1;
    transform:translate(-50%,-50%) scale(1.28) rotate(120deg);
  }
  100%{
    opacity:0;
    transform:translate(-50%,-50%) scale(1.85) rotate(185deg);
    filter:blur(16px);
  }
}

/* the whole gate flashes at climax */
.gate.circle-showtime{
  animation:gateRoomFlash 4s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes gateRoomFlash{
  0%,18%{filter:brightness(1);}
  44%{filter:brightness(1.18);}
  72%{filter:brightness(1.28);}
  100%{filter:brightness(1);}
}


/* =========================================================
   SINGLE-APP MOBILE SAFE MODE
   Format preserved: tab-style one-page app.
   Gate magic stays; post-entry mobile effects are light.
   ========================================================= */

body.gate-locked .topbar,
body.gate-locked .nav,
body.gate-locked main{
  display:none!important;
}

.cosmos,
.aurora,
.sparkles,
.moon-dust,
.rune-ring,
.page-aura,
.wand-trails,
.unlock-rain,
.unlock-circle,
.unlock-circle *,
.map-constellation,
.magic-sheen,
.rayburst,
.flash-beams,
.core-bloom,
.rune-band,
.rune-band-two,
.rune-band-three,
.burst,
.glyph-ring,
.glyph-ring-two{
  pointer-events:none!important;
}

.nav,
.nav button,
[data-open],
button{
  touch-action:manipulation;
}

/* Keep SPA behavior on mobile: only active page is visible */
@media(max-width:760px){
  body:not(.gate-locked) .page{
    display:none!important;
  }

  body:not(.gate-locked) .page.active{
    display:block!important;
    animation:fadeUp .22s ease both!important;
  }

  /* Kill only continuous post-entry effects that caused mobile crashes */
  body:not(.gate-locked) .cosmos,
  body:not(.gate-locked) .aurora,
  body:not(.gate-locked) .sparkles,
  body:not(.gate-locked) .moon-dust,
  body:not(.gate-locked) .rune-ring,
  body:not(.gate-locked) .page-aura,
  body:not(.gate-locked) .wand-trails{
    display:none!important;
    animation:none!important;
  }

  body:not(.gate-locked) .hero-art:after,
  body:not(.gate-locked) .home-story-block:after,
  body:not(.gate-locked) .home-fortune-block:after,
  body:not(.gate-locked) .fortune-page-card:after,
  body:not(.gate-locked) .lore-card:after,
  body:not(.gate-locked) .trial:after,
  body:not(.gate-locked) .notice-grid article:after,
  body:not(.gate-locked) .magic-sheen,
  body:not(.gate-locked) .map-constellation{
    display:none!important;
    animation:none!important;
  }

  body:not(.gate-locked) .hero-panel,
  body:not(.gate-locked) .showcase article,
  body:not(.gate-locked) .library-panel,
  body:not(.gate-locked) .lore-card,
  body:not(.gate-locked) .student-file,
  body:not(.gate-locked) .manuscript,
  body:not(.gate-locked) .trial,
  body:not(.gate-locked) .result-box,
  body:not(.gate-locked) .id-card,
  body:not(.gate-locked) .notice-grid article,
  body:not(.gate-locked) .home-story-block,
  body:not(.gate-locked) .home-fortune-block,
  body:not(.gate-locked) .fortune-page-card{
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    box-shadow:0 14px 34px rgba(0,0,0,.24)!important;
  }

  body:not(.gate-locked) .hero-art img,
  body:not(.gate-locked) #fortune .tarot-crest,
  body:not(.gate-locked) #character .portrait-box:after{
    animation:none!important;
  }

  body:not(.gate-locked) .showcase article,
  body:not(.gate-locked) .lore-card,
  body:not(.gate-locked) .notice-grid article{
    animation:none!important;
    transform:none!important;
  }

  html, body{
    scroll-behavior:auto!important;
  }
}


/* Precise current-site patch: copy UX + remove rune text layout impact */
.copyable-manuscript,
.copyable-persona,
.lore-card .ct,
.lore-card .keys,
.lore-card .body,
.lore-card .copy{
  cursor:pointer;
  pointer-events:auto!important;
}

.copy-hint{
  margin:-2px 0 14px;
  color:#9fb0c5;
  font-size:12px;
  letter-spacing:.03em;
}

.copyframe{
  outline:1px solid rgba(142,219,255,.95)!important;
  box-shadow:
    0 0 0 1px rgba(142,219,255,.20),
    0 0 26px rgba(142,219,255,.28),
    inset 0 0 18px rgba(142,219,255,.08)!important;
  border-color:rgba(142,219,255,.48)!important;
  animation:copyFrameGlow 1.7s cubic-bezier(.22,1,.36,1);
}

@keyframes copyFrameGlow{
  0%{outline-color:rgba(142,219,255,0);box-shadow:0 0 0 rgba(142,219,255,0);}
  25%{
    outline-color:rgba(142,219,255,.95);
    box-shadow:
      0 0 0 1px rgba(142,219,255,.20),
      0 0 28px rgba(142,219,255,.30),
      inset 0 0 18px rgba(142,219,255,.10);
  }
  100%{outline-color:rgba(142,219,255,0);box-shadow:0 0 0 rgba(142,219,255,0);}
}

/* The rune text layer is removed by JS; keep possible empty layer harmless */
.unlock-rain,
.unlock-rain *{
  pointer-events:none!important;
  max-width:0!important;
  overflow:hidden!important;
}
