:root{
  --ink:#143275;--text:#3f4f7b;--muted:#7784aa;--blue:#416df4;--violet:#8c67f2;--gold:#e5a11e;
  --line:#dce6fb;--panel:rgba(255,255,255,.92);--shadow:0 18px 50px rgba(64,88,160,.13);
  --radius-xl:30px;--radius-lg:24px;--radius-md:18px;--max:1480px;
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;min-height:100vh;font-family:Inter,"Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",system-ui,sans-serif;color:var(--text);background:linear-gradient(180deg,#f9fbff 0,#f4f7ff 55%,#f8f6ff 100%);overflow-x:hidden}button{font:inherit}.hidden{display:none!important}.bg-glow{position:fixed;border-radius:50%;filter:blur(80px);pointer-events:none;z-index:-1}.glow-a{width:520px;height:520px;left:-180px;top:-180px;background:#fff0d9}.glow-b{width:580px;height:580px;right:-170px;bottom:-230px;background:#dcd9ff}.app-shell{max-width:var(--max);margin:0 auto;padding:18px 24px 34px}.app-header{min-height:68px;border:1px solid rgba(220,230,251,.9);background:rgba(255,255,255,.86);backdrop-filter:blur(18px);border-radius:24px;display:flex;align-items:center;justify-content:space-between;padding:10px 16px 10px 20px;box-shadow:0 10px 30px rgba(61,82,150,.08);position:sticky;top:10px;z-index:20}.brand,.header-meta,.brand-word,.user-chip,.date-chip{display:flex;align-items:center}.brand{min-width:0;gap:12px}.brand-flame{width:36px;height:36px;display:grid;place-items:center;transform:rotate(45deg);border-radius:11px;background:linear-gradient(145deg,#74a0ff,#4d66ea);color:white;font-size:15px;box-shadow:0 6px 20px rgba(64,105,244,.25)}.brand-flame::first-letter{transform:rotate(-45deg)}.brand-word{gap:14px;white-space:nowrap}.brand-word strong{font-size:24px;letter-spacing:.04em;color:#18387b}.brand-word span{font-size:15px;letter-spacing:.14em;color:#5070d0}.brand-divider{height:26px;width:1px;background:#cad7f3;margin-left:4px}.brand-copy{font-size:13px;color:#6a78a4;white-space:nowrap;margin:0}.header-meta{gap:10px;min-width:0}.date-chip,.user-chip{height:42px;border:1px solid #dce6fb;background:#fff;border-radius:999px;padding:0 14px;color:#29458a;font-size:13px;box-shadow:0 6px 18px rgba(73,96,162,.06)}.date-chip::before{content:'▣';margin-right:8px;color:#436df2}.user-chip{max-width:315px;padding:0 12px 0 7px;gap:8px}.avatar{width:30px;height:30px;border-radius:50%;object-fit:cover;border:2px solid #edf2ff;background:#edf2ff}.header-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700;color:#2e4784}.view{margin-top:14px}.panel{background:var(--panel);border:1px solid rgba(220,230,251,.92);border-radius:var(--radius-lg);box-shadow:var(--shadow)}

/* Welcome */
.welcome{overflow:hidden;display:grid;grid-template-columns:minmax(0,1.45fr) minmax(360px,.8fr);min-height:610px;position:relative}.welcome-visual{position:relative;min-height:610px;background:#eaf1ff}.welcome-visual img{width:100%;height:100%;object-fit:cover;object-position:center;display:block}.welcome-visual::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent 65%,rgba(255,255,255,.2))}.welcome-copy{padding:72px 58px 58px;display:flex;flex-direction:column;justify-content:center;position:relative}.welcome-copy::before{content:'✦';position:absolute;right:50px;top:42px;font-size:32px;color:#e6b44c;opacity:.75}.eyebrow{font-weight:800;font-size:13px;letter-spacing:.08em;color:#5b72c7;margin:0 0 12px}.welcome h1{font-size:clamp(30px,3.1vw,52px);line-height:1.18;color:#10388b;margin:0 0 16px;letter-spacing:.01em}.welcome-name{overflow-wrap:anywhere}.lead{font-size:18px;line-height:1.9;color:#425888;margin:0 0 28px}.welcome-note{font-size:13px;color:#8994b8;margin-top:12px;text-align:center}.button{border:0;border-radius:999px;min-height:58px;padding:0 28px;font-weight:900;cursor:pointer;transition:transform .2s,box-shadow .2s,filter .2s}.button:hover{transform:translateY(-2px);filter:brightness(1.02)}.button-primary{color:#fff;background:linear-gradient(100deg,#4775ff,#9a69ee);box-shadow:0 12px 30px rgba(92,93,232,.28)}.welcome .button{font-size:17px;width:100%}.reveal-layer{position:absolute;inset:0;display:grid;place-items:center;background:rgba(248,250,255,.92);backdrop-filter:blur(8px);z-index:6;opacity:0;pointer-events:none;transition:.2s}.reveal-layer.on{opacity:1;pointer-events:auto}.reveal-card{text-align:center}.reveal-card .magic{font-size:64px;color:#d6a43b;animation:pulse 1s ease-in-out infinite}.reveal-card p{color:#29468c;font-weight:800}@keyframes pulse{0%,100%{transform:scale(.9);opacity:.65}50%{transform:scale(1.08);opacity:1}}

/* Result */
.hero-result{position:relative;overflow:hidden;min-height:390px;border-radius:var(--radius-xl);box-shadow:var(--shadow);border:1px solid #dce6fb;background:#eef4ff}.hero-result img{display:block;width:100%;height:auto;aspect-ratio:1399/600;object-fit:contain;background:#eaf0ff}.hero-overlay{position:absolute;top:0;right:0;bottom:0;width:45%;display:flex;align-items:center;padding:42px;background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.72) 22%,rgba(255,255,255,.92) 100%)}.hero-text{margin-left:auto;max-width:520px}.hero-kicker{font-size:18px;font-weight:800;color:#244696;margin-bottom:8px}.hero-title{font-size:clamp(32px,3vw,52px);line-height:1.08;margin:0 0 14px;color:#0d3d99;overflow-wrap:anywhere}.hero-message{font-size:17px;line-height:1.8;color:#375291;margin:0}.hero-date{display:inline-flex;margin-bottom:16px;padding:7px 12px;border-radius:999px;background:rgba(255,255,255,.7);color:#6073ab;font-size:12px;font-weight:800}.dashboard{display:grid;grid-template-columns:minmax(280px,.9fr) minmax(330px,1fr) minmax(410px,1.22fr);gap:14px;margin-top:14px;align-items:stretch}.section-card{padding:22px;min-width:0}.section-title{text-align:center;color:#163a88;font-size:21px;font-weight:900;margin:0 0 14px}.overall-card{background:linear-gradient(145deg,#fff9e8,#fff3e1 55%,#fff5fa)}.overall-name{text-align:center;font-size:15px;color:#34518c;font-weight:800;margin-bottom:3px;overflow-wrap:anywhere}.rank-wrap{text-align:center;padding:8px 0 14px}.rank-main{font-size:clamp(72px,7vw,112px);line-height:.9;color:#e59713;font-weight:900;letter-spacing:-.06em;text-shadow:0 4px 0 #fff,0 8px 18px rgba(221,145,13,.15)}.rank-score{font-size:28px;font-weight:900;color:#18377e;margin-top:8px}.overall-body{background:rgba(255,255,255,.86);border:1px solid #f2e7d4;border-radius:18px;padding:18px;font-size:15px;line-height:1.85;color:#4a5b82}.radar-wrap{display:flex;align-items:center;justify-content:center;min-height:330px}.radar-svg{width:min(100%,390px);height:auto;overflow:visible}.radar-grid{fill:none;stroke:#dce5fa;stroke-width:1}.radar-axis{stroke:#e3e9f9;stroke-width:1}.radar-area{fill:rgba(85,111,238,.18);stroke:#5874ee;stroke-width:2.5}.radar-point{fill:#5b73ec}.radar-label{font-size:11px;font-weight:800;fill:#2b4484}.radar-score{font-size:13px;font-weight:900;fill:#183879}.fortune-card{padding:18px}.fortune-list{display:grid;grid-template-columns:1fr 1fr;gap:9px}.fortune-item{min-height:84px;border-radius:16px;border:1px solid var(--line);background:#fff;padding:12px 13px;display:grid;grid-template-columns:42px minmax(0,1fr) auto;grid-template-rows:auto auto;column-gap:10px;align-items:center}.fortune-item .ico{grid-row:1/3;width:38px;height:38px;border-radius:13px;display:grid;place-items:center;font-size:19px;background:#eef3ff}.fortune-item .label{font-weight:900;color:#1b377c;font-size:14px}.fortune-item .score{font-size:23px;font-weight:900;color:#4f6fee}.fortune-item .comment{grid-column:2/4;font-size:11px;line-height:1.45;color:#65739a;margin-top:2px}.fortune-item.aomori{grid-column:1/-1;background:linear-gradient(90deg,#eff6ff,#fff9ec)}.fortune-item[data-k='love'] .score{color:#ee66a7}.fortune-item[data-k='money'] .score{color:#e5a11e}.fortune-item[data-k='health'] .score{color:#38a975}.fortune-item[data-k='social'] .score{color:#e64642}.character-row{display:grid;grid-template-columns:118px minmax(0,1fr) auto;gap:16px;align-items:center;margin-top:14px;padding:14px 18px}.character-face{width:96px;height:96px;border-radius:50%;object-fit:cover;border:5px solid #fff;box-shadow:0 8px 28px rgba(78,88,156,.16)}.character-title{font-weight:900;color:#17387f;margin-bottom:7px}.character-bubble{font-size:14px;line-height:1.8;color:#485a85;background:#fff;border:1px solid #e1e8fa;border-radius:20px;padding:15px 18px}.share-button{white-space:nowrap;padding:0 30px;min-width:190px}.special-banner{padding:12px 16px;border-radius:16px;margin-bottom:12px;text-align:center;font-weight:900}.special-banner.ex{background:linear-gradient(90deg,#fff5cf,#fffaf0);color:#a66b00;border:1px solid #efd48b}.special-banner.error{background:linear-gradient(90deg,#f0edff,#f7f4ff);color:#5f4aa9;border:1px solid #d8d0fa}

.loading-screen,.error-screen{min-height:100vh;display:grid;place-items:center;text-align:center;color:#44588b}.loading-orb{width:68px;height:68px;border-radius:50%;display:grid;place-items:center;margin:0 auto 16px;background:linear-gradient(145deg,#eef4ff,#fff3df);font-size:32px;color:#d2a23d;animation:pulse 1.4s ease-in-out infinite}.error-card{max-width:430px;margin:20px;padding:32px;background:#fff;border:1px solid #e0e7f9;border-radius:28px;box-shadow:var(--shadow)}.error-star{font-size:40px;color:#d7aa4c}.toast{position:fixed;left:50%;bottom:30px;transform:translate(-50%,16px);opacity:0;z-index:100;background:#23366f;color:#fff;border-radius:999px;padding:12px 18px;font-size:13px;font-weight:800;transition:.2s}.toast.show{opacity:1;transform:translate(-50%,0)}

@media(max-width:1199px){.brand-copy{display:none}.dashboard{grid-template-columns:1fr 1fr}.fortune-card{grid-column:1/-1}.hero-overlay{width:52%;padding:30px}.character-row{grid-template-columns:100px minmax(0,1fr)}.share-button{grid-column:1/-1;width:100%}}
@media(max-width:767px){.app-shell{padding:8px 8px 24px}.app-header{top:6px;min-height:58px;padding:8px 10px;border-radius:18px}.brand-word span,.brand-divider,.brand-copy,.date-chip{display:none}.brand-flame{width:30px;height:30px}.brand-word strong{font-size:20px}.user-chip{max-width:51vw;height:38px}.header-name{font-size:12px}.view{margin-top:8px}.welcome{display:block;min-height:0}.welcome-visual{min-height:0}.welcome-visual img{width:100%;height:auto;object-fit:contain}.welcome-copy{padding:26px 20px 30px}.welcome h1{font-size:31px}.lead{font-size:15px;line-height:1.8}.hero-result{min-height:0}.hero-result img{aspect-ratio:auto;object-fit:contain}.hero-overlay{position:static;width:auto;background:#fff;padding:22px 19px}.hero-title{font-size:31px}.hero-kicker{font-size:15px}.hero-message{font-size:15px}.dashboard{grid-template-columns:1fr;gap:8px;margin-top:8px}.overall-card{order:1}.fortune-card{order:2;grid-column:auto}.balance-card{order:3}.section-card{padding:18px}.fortune-list{grid-template-columns:1fr}.fortune-item.aomori{grid-column:auto}.radar-wrap{min-height:280px}.character-row{grid-template-columns:72px minmax(0,1fr);gap:10px;margin-top:8px;padding:14px}.character-face{width:66px;height:66px;border-width:3px}.character-bubble{font-size:13px;padding:13px}.share-button{grid-column:1/-1;min-height:54px}.rank-main{font-size:84px}.rank-score{font-size:25px}.section-title{font-size:19px}}
@media(max-width:390px){.brand-flame{display:none}.user-chip{max-width:55vw}.welcome-copy{padding-left:16px;padding-right:16px}.hero-overlay{padding-left:16px;padding-right:16px}.section-card{padding:15px}.fortune-card{padding:14px}.fortune-item{padding:10px}.character-row{grid-template-columns:1fr;text-align:center}.character-face{margin:auto}.character-bubble{text-align:left}}

/* v5.5: long Discord-name resilience + result-screen polish */
.welcome-greeting{display:block}
.welcome-name{display:block;max-width:100%;overflow-wrap:anywhere;word-break:break-word;line-height:1.14}
.welcome-name.name-medium{font-size:.92em}
.welcome-name.name-long{font-size:.72em;line-height:1.16}
.welcome-name.name-xlong{font-size:.61em;line-height:1.18}
.welcome-name.name-xxlong{font-size:.53em;line-height:1.2}

.hero-title{max-width:100%;word-break:break-word;overflow-wrap:anywhere}
.hero-title.name-medium{font-size:clamp(29px,2.55vw,44px)}
.hero-title.name-long{font-size:clamp(25px,2.15vw,37px);line-height:1.12}
.hero-title.name-xlong{font-size:clamp(22px,1.9vw,32px);line-height:1.13}
.hero-title.name-xxlong{font-size:clamp(19px,1.65vw,28px);line-height:1.15}

.overall-name{line-height:1.35;min-height:1.35em}
.overall-name.name-long{font-size:13px}
.overall-name.name-xlong,.overall-name.name-xxlong{font-size:12px}

/* The header already carries the date; avoid duplicating it inside the hero. */
.hero-date{display:none}

/* Keep the right-hand greeting visually balanced even with long names. */
.hero-overlay{width:47%;padding:40px 46px}
.hero-text{max-width:560px;width:100%}

/* Slightly richer hierarchy without adding visual clutter. */
.overall-card{position:relative;overflow:hidden}
.overall-card::before,.overall-card::after{content:'✦';position:absolute;color:#e9b84e;opacity:.32;font-size:24px;pointer-events:none}
.overall-card::before{left:20px;top:20px}.overall-card::after{right:20px;bottom:18px}
.rank-wrap{position:relative}
.rank-wrap::before,.rank-wrap::after{content:'';display:inline-block;width:54px;height:1px;background:linear-gradient(90deg,transparent,#e4b24b);vertical-align:middle;margin:0 12px 10px}
.rank-wrap::after{background:linear-gradient(90deg,#e4b24b,transparent)}

@media(max-width:1199px){
  .hero-overlay{width:54%;padding:30px 32px}
  .hero-title.name-long{font-size:30px}.hero-title.name-xlong{font-size:26px}.hero-title.name-xxlong{font-size:23px}
}
@media(max-width:767px){
  .welcome-name.name-long{font-size:.8em}.welcome-name.name-xlong{font-size:.7em}.welcome-name.name-xxlong{font-size:.62em}
  .hero-overlay{width:auto;padding:22px 19px}
  .hero-title.name-medium{font-size:29px}.hero-title.name-long{font-size:25px}.hero-title.name-xlong{font-size:22px}.hero-title.name-xxlong{font-size:20px}
  .overall-name.name-long,.overall-name.name-xlong,.overall-name.name-xxlong{font-size:12px}
}

/* v5.7 — 占いちゃん micro animation prototype */
.hero-motion{
  --mx:0px;--my:0px;--mr:0deg;
  isolation:isolate;
}
.hero-motion .hero-motion-img{
  transform-origin:50% 55%;
  will-change:transform,filter;
  animation:egnisHeroBreath 7.2s ease-in-out infinite;
}
.hero-motion .hero-sparkles{
  position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden;
  background:
    radial-gradient(circle at 18% 22%,rgba(255,255,255,.92) 0 1px,transparent 2.5px),
    radial-gradient(circle at 43% 15%,rgba(255,229,149,.9) 0 1.5px,transparent 3px),
    radial-gradient(circle at 67% 28%,rgba(255,255,255,.9) 0 1px,transparent 2.5px),
    radial-gradient(circle at 77% 61%,rgba(255,220,120,.72) 0 1.5px,transparent 3.5px),
    radial-gradient(circle at 32% 70%,rgba(255,255,255,.82) 0 1px,transparent 3px);
  background-size:100% 100%;
  opacity:.38;
  animation:egnisTwinkle 4.8s ease-in-out infinite alternate;
}
.hero-motion::before{
  content:'';position:absolute;inset:-25% -40%;z-index:3;pointer-events:none;
  background:linear-gradient(112deg,transparent 35%,rgba(255,255,255,.0) 45%,rgba(255,244,199,.24) 50%,rgba(255,255,255,.0) 55%,transparent 65%);
  transform:translateX(-55%);
  animation:egnisLightSweep 9s ease-in-out infinite;
}
.welcome-visual.hero-motion::after{z-index:4}
.hero-result.hero-motion .hero-overlay{z-index:5}
.hero-result.hero-motion .hero-motion-img{animation-duration:9s}
.reveal-layer.on .magic{filter:drop-shadow(0 0 18px rgba(232,185,72,.55))}
@keyframes egnisHeroBreath{
  0%,100%{transform:translate3d(var(--mx),var(--my),0) rotate(var(--mr)) scale(1.000);filter:saturate(1) brightness(1)}
  50%{transform:translate3d(var(--mx),calc(var(--my) - 2px),0) rotate(var(--mr)) scale(1.014);filter:saturate(1.025) brightness(1.012)}
}
@keyframes egnisTwinkle{
  0%{opacity:.20;filter:blur(.15px)}
  45%{opacity:.52;filter:blur(0)}
  100%{opacity:.30;filter:blur(.25px)}
}
@keyframes egnisLightSweep{
  0%,62%{transform:translateX(-55%);opacity:0}
  68%{opacity:.7}
  82%{transform:translateX(55%);opacity:.45}
  88%,100%{transform:translateX(55%);opacity:0}
}
@media (prefers-reduced-motion:reduce){
  .hero-motion .hero-motion-img,.hero-motion .hero-sparkles,.hero-motion::before{animation:none!important;transform:none!important}
}
