@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;500;600;700&display=swap');
:root{color-scheme:dark;--accent:#ff8357;--muted:#b6aa9e}*{box-sizing:border-box}body{margin:0;background:#09090c;color:#eee6db;font-family:'Noto Serif JP','Yu Mincho',serif;min-height:100vh}button,a,input{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:5px}#fire{position:fixed;inset:0;width:100%;height:100%;z-index:-2}.grain{position:fixed;inset:0;pointer-events:none;z-index:-1;background:linear-gradient(90deg,rgba(7,7,10,.4),transparent 60%),linear-gradient(0deg,#09090c 0%,transparent 45%)}header{padding:30px 5vw;display:flex;align-items:center;justify-content:space-between}.brand{text-decoration:none;color:inherit;font-size:22px;letter-spacing:.22em}.brand span{display:block;font:10px/2 sans-serif;letter-spacing:.35em;color:#baaa96}button:not(.primary){border:1px solid #ffffff28;background:#09090c70;color:#cfc4b6;padding:9px 14px;font-size:13px}main{max-width:1120px;margin:15px auto 0;padding:0 36px 24px}.eyebrow{font-size:13px;color:var(--accent);letter-spacing:.3em}h1{font-weight:500;font-size:clamp(42px,5vw,70px);letter-spacing:.16em;line-height:1.45;margin:18px 0}.intro{color:#c7b6a2;letter-spacing:.15em;font-size:15px;margin:0 0 36px}#game{position:relative;max-width:950px;background:linear-gradient(110deg,#0b0b10eb,#0b0b10a3);border-top:1px solid #b3966955;padding:25px 32px 28px;box-shadow:0 15px 70px #0005;backdrop-filter:blur(12px)}.hud{display:flex;align-items:center;justify-content:space-between;font-size:15px;letter-spacing:.12em}small{color:#948b81;font-size:12px}#phase{color:var(--accent)}#clock{font:17px monospace}.time{height:2px;background:#ffffff13;margin:18px 0 16px}.time i{display:block;width:100%;height:100%;background:var(--accent);box-shadow:0 0 15px var(--accent);transform-origin:left}#seals{display:flex;gap:7px;margin-bottom:24px}#seals i{height:4px;flex:1;background:#ffffff15}#seals i.done{background:var(--accent);box-shadow:0 0 9px var(--accent)}#seals i.current{background:#e9ddc57a}.verse{font-size:clamp(21px,2.3vw,28px);line-height:1.9;letter-spacing:.09em;min-height:106px}#reading{font-size:13px;color:#baafa2;line-height:1.9;margin-top:5px}#roman{font:16px/1.9 Consolas,monospace;letter-spacing:.05em;overflow-wrap:anywhere;color:#b5a99c;min-height:64px;margin-top:12px}#roman .typed{color:var(--accent)}#roman .cursor{color:#fff;border-bottom:2px solid var(--accent);background:#ffffff12}.primary{background:#e9ddc5;color:#1c1510;border:0;padding:16px 24px;min-width:280px;display:flex;justify-content:space-between;gap:32px;font-weight:600;font-size:16px;transition:background .2s}.primary:hover{background:#fff1d9}.primary span{opacity:.5}#startArea{display:flex;align-items:center;gap:28px;margin-top:20px}#startArea p,#notice{font-size:13px;line-height:1.9;color:#b1a799}#playArea{margin-top:15px}#inputLabel{font-size:12px;color:#c2b29c}#capture{display:block;width:100%;margin-top:9px;border:1px solid #ffffff35;padding:12px;background:#0005;color:var(--accent);font:16px monospace}#notice{margin:10px 0 0}#result{padding:16px 0 0}#result h2{font-size:36px;letter-spacing:.2em;color:var(--accent);margin:12px 0}#result p{color:#c5b7a6;font-size:15px;line-height:1.8}footer{max-width:950px;display:flex;align-items:center;justify-content:space-between;color:#a89c8d;font-size:12px;letter-spacing:.1em;padding-top:22px;gap:16px}body.playing h1{font-size:34px;display:inline-block;margin:12px 0}body.playing h1 br{display:none}body.playing .intro{margin-bottom:20px}body.casting #game{opacity:.2;transition:opacity 1s}body.casting h1,body.casting .intro,body.casting .eyebrow{opacity:.15}body.result #game{opacity:1;transition:opacity 1s}[hidden]{display:none!important}@media(max-width:650px){header{padding:22px}.brand{font-size:18px}main{padding:0 20px 24px;margin:15px auto}h1{font-size:43px}.intro{font-size:13px;margin-bottom:25px}#game{padding:20px 17px}.hud{font-size:12px;letter-spacing:0}#clock{font-size:15px}.verse{min-height:120px;font-size:21px}#startArea{display:block}.primary{width:100%;min-width:0}footer{flex-wrap:wrap;line-height:1.8}#roman{font-size:14px}#seals{gap:4px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
/* The incantation stays in front; the ritual has its own visible stage. */
#sigils{position:fixed;inset:0;width:100%;height:100%;z-index:-1;pointer-events:none}.grain{z-index:-1;opacity:.35}header{padding-top:20px;padding-bottom:16px}main{margin-top:0;max-width:1120px}h1{font-size:34px;line-height:1.4;margin:10px 0}h1 br{display:none}.intro{margin:8px 0 0;font-size:14px}.eyebrow{font-size:12px}.stage-view{height:240px;position:relative;display:flex;flex-direction:column;justify-content:flex-end;padding:0 0 22px;pointer-events:none}#stageMark{font:12px/2 monospace;letter-spacing:.25em;color:var(--accent)}#stageName{font-size:21px;letter-spacing:.2em}#stageClear{position:absolute;right:0;bottom:22px;color:var(--accent);font-size:14px;letter-spacing:.16em}#game{max-width:none;padding-top:18px;padding-bottom:20px;background:linear-gradient(100deg,#08090ff5,#08090fdb)}.verse{min-height:70px;font-size:24px}#reading{margin-top:4px}#roman{min-height:44px;margin-top:8px}#seals{margin-bottom:16px}#startArea{margin-top:10px}body.playing .intro{margin-bottom:0}footer{max-width:none}body.casting main,body.casting header{opacity:0;pointer-events:none;transition:opacity .22s}body.casting .grain{opacity:0}#release{position:fixed;z-index:10;inset:auto 7vw 9vh;text-align:center;pointer-events:none;text-shadow:0 2px 25px #000,0 2px 8px #000}#releaseMark{font:13px/2 monospace;letter-spacing:.35em;color:#d8cfc3}#releaseName{font-size:clamp(32px,6vw,72px);letter-spacing:.23em;margin:8px 0 18px;color:var(--accent);font-weight:500}#releaseQuote{font-size:clamp(15px,2vw,21px);line-height:2;letter-spacing:.15em;max-width:900px;margin:auto}body.result .stage-view{height:200px}body.result #verse{display:none}body.result #game{background:#08090fe8}body.result #result{padding-top:0}#result .primary{margin-top:20px}@media(max-width:650px){h1,body.playing h1{font-size:26px}main{padding:0 20px 20px}.stage-view{height:220px}.verse{font-size:20px;min-height:95px}#stageName{font-size:18px}#stageClear{bottom:0;font-size:12px;right:0}#release{inset:auto 7vw 8vh}.intro{font-size:12px}#game{padding:16px}header{padding:18px 20px}}

/* Hold the last silence on an unbroken white field, then reveal the result. */
body.final-cast #sigils{z-index:20}body.final-cast #release{z-index:21;opacity:var(--release-opacity,1)}
body.white-result{background:#fff;color:#25232c}body.white-result #fire,body.white-result .grain{visibility:hidden}body.white-result #sigils{z-index:-1}
body.white-result #game{background:#fff;border-color:#dedbe4;box-shadow:none;backdrop-filter:none}body.white-result #result h2,body.white-result #phase,body.white-result #stageMark,body.white-result #stageClear,body.white-result .eyebrow{color:#554167}body.white-result #result p,body.white-result .intro,body.white-result footer,body.white-result small{color:#6a6273}body.white-result .primary{background:#292331;color:#fff}body.white-result header button,body.white-result footer button{background:#fff;color:#554167;border-color:#ccc}body.white-result #game,body.white-result header,body.white-result .stage-view{animation:whiteArrival 1.8s ease both}@keyframes whiteArrival{from{opacity:0}to{opacity:1}}

/* Keep the chant legible as luminous backgrounds drift behind it. */
header,.eyebrow,h1,.intro,.stage-view,footer{text-shadow:0 2px 12px #000b}
body.white-result header,body.white-result .eyebrow,body.white-result h1,body.white-result .intro,body.white-result .stage-view,body.white-result footer{text-shadow:none}
body:not(.casting) .eyebrow,body:not(.casting) #stageMark,body:not(.casting) #stageClear,body:not(.casting) #phase,body:not(.casting) #seals i{transition:color 3s,background-color 3s,box-shadow 3s}
