/* styles/foundation.css */
/* assets/fonts.css */
@font-face{font-family:'Golos Text';font-style:normal;font-weight:400 900;font-display:swap;src:url('/assets/golostext.ttf') format('truetype')}


/* style.css */
*{box-sizing:border-box} :root{--ink:#f4eaff;--muted:#c3afda;--gold:#e4c48b;--paper:#110a22;--app-height:100dvh;--safe-top:0px;--safe-bottom:0px;--safe-left:0px;--safe-right:0px;--scene:url('/assets/moon-castle.webp')}
html{height:100%;overflow:hidden;overscroll-behavior:none}body{margin:0;height:var(--app-height);overflow:hidden;overscroll-behavior:none;color:var(--ink);font-family:'Golos Text',Georgia,serif;background:#10091f var(--scene) center center/cover no-repeat;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:58px minmax(0,1fr) 66px;padding:max(env(safe-area-inset-top),var(--safe-top)) max(12px,env(safe-area-inset-right),var(--safe-right)) max(6px,env(safe-area-inset-bottom),var(--safe-bottom)) max(12px,env(safe-area-inset-left),var(--safe-left));isolation:isolate}body:before{content:'';position:fixed;inset:0;background:linear-gradient(180deg,#08041655,transparent 30%,#09041575);z-index:-1;pointer-events:none}body.crimson{--scene:url('/assets/crimson-castle.webp')}
button,a,input{-webkit-tap-highlight-color:transparent;touch-action:manipulation}button{font:inherit;cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.5}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid #e8c38a;outline-offset:3px}::selection{background:#884bc5;color:#fff}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.icon-library{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
header{height:58px;max-width:1100px;width:100%;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:0 8px}.brand{font:700 34px/1 'Golos Text',Georgia,serif;letter-spacing:.01em;color:#f5d9b4;text-shadow:0 2px 3px #000;display:flex;align-items:center;gap:2px;text-decoration:none}.brand img{width:44px;height:44px}.header-actions{display:flex;align-items:center;gap:14px}.essence{display:flex;align-items:center;gap:5px;color:#e4c48b;font-size:14px}.essence svg{width:16px;height:16px}.icon-button,.quiet-button{background:transparent;border:0;display:grid;place-items:center;width:42px;height:42px;border-radius:8px;color:#ddc7f4}.icon-button:hover,.quiet-button:hover{background:#442961}.quiet-button{margin-left:auto}
main{width:100%;min-width:0;min-height:0;padding:4px 0 8px;position:relative}.screen{height:100%;width:100%;min-height:0}.play{--board-size:320px;position:relative;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:84px 48px 28px minmax(0,1fr) 30px 42px;gap:6px;justify-items:center;align-items:center}
.scene-banner{height:84px;width:min(100%,max(340px,var(--board-size)));padding:10px 14px;display:flex;align-items:center;gap:12px;position:relative;background:linear-gradient(90deg,#1c0e2800,#170b2bc7 43%,#170b2bc7),var(--scene) center 30%/100% auto;border-bottom:1px solid #ba96d25c;border-radius:12px 12px 0 0}.chapter-seal{height:52px;width:52px;display:grid;place-items:center;border:1px solid #bc946d;border-radius:50%;background:#210e35c7;color:var(--gold);margin-left:12%;flex-shrink:0}.scene-banner h1{font:600 29px/1.1 'Golos Text',Georgia,serif;text-shadow:0 2px 6px #10051f;margin:0 0 4px;color:#fff0dc}.scene-banner p{margin:0;font-size:11px;color:#ddd0ef}
.stats{width:min(100%,max(300px,var(--board-size)));height:48px;display:flex;align-items:center;justify-content:space-between;padding:0 16px}.stats>div{display:flex;flex-direction:column;gap:1px;text-align:center;min-width:70px}.stats span{font-size:10px;color:#d0bddf;text-transform:uppercase;letter-spacing:.06em}.stats strong{font-size:25px;line-height:1.1;font-weight:600;font-variant-numeric:tabular-nums;color:#fff3d9;text-shadow:0 2px 3px #080413}.stats .moves strong{color:#dcadff}
.objective{height:28px;width:min(100%,max(300px,var(--board-size)));padding:0 14px;display:flex;align-items:center;gap:10px}.goal-track{flex:1;height:10px;overflow:hidden;border:1px solid #a97aab;border-radius:6px;background:#11071e;box-shadow:inset 0 2px 4px #000}.goal-track i{display:block;width:100%;height:100%;transform:scaleX(0);transform-origin:left;background:linear-gradient(#ecbeff,#b742f6 48%,#6c169c);transition:transform .18s ease-out}.objective>span{font-size:10px;color:#f1defa;max-width:65%}
.board-wrap{position:relative;width:var(--board-size);height:var(--board-size);padding:clamp(13px,2.2vw,22px);border-radius:16px;background:#130b21;box-shadow:0 12px 30px #03000ba8;align-self:center;isolation:isolate}.board-frame{position:absolute;inset:-2%;width:104%;height:104%;z-index:6;pointer-events:none;object-fit:fill}.board{width:100%;height:100%;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));gap:3px;touch-action:none;background:#080611;border:1px solid #79509a;border-radius:8px;overflow:hidden;padding:3px}.cell{border:0;min-width:0;min-height:0;padding:0;position:relative;display:grid;place-items:center;border-radius:4px;background:linear-gradient(145deg,#251335,#100b1c);box-shadow:inset 0 1px 1px #8d56af4a,inset 0 -1px 2px #020207;isolation:isolate;touch-action:none}.cell:focus-visible{outline:2px solid #f9db94;outline-offset:-2px;z-index:2}.cell.selected{outline:2px solid #f1bcff;outline-offset:-1px;background:#45215e;z-index:3}.cell.hint{outline:2px dashed #ffdb9b;outline-offset:-2px;background:#362039}.crystal{display:block;width:100%;height:auto;aspect-ratio:1;object-fit:contain;pointer-events:none;user-select:none;transform:translateY(-2px) scale(1.16);transition:transform .1s ease-out}.cell.selected .crystal{animation:selected-float 1.6s ease-in-out infinite}.cell.hint .crystal{animation:hint-pulse 1.1s ease-in-out 3}.cell.cleared .crystal{animation:collect .13s ease-out forwards}.cell:active .crystal{transform:translateY(0) scale(1.1)}.shine{position:absolute;inset:15%;pointer-events:none;overflow:hidden;clip-path:polygon(50% 0,100% 40%,70% 100%,30% 100%,0 40%)}.shine:after{content:'';position:absolute;inset:-30%;background:linear-gradient(115deg,transparent 43%,#ffffff80 50%,transparent 57%);transform:translateX(-120%)}.selected .shine:after{animation:shine-sweep 2.5s ease-out infinite}.spark{position:absolute;left:50%;top:50%;width:6px;height:6px;clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%);pointer-events:none;z-index:5}.score-pop{position:absolute;top:42%;left:50%;font-size:32px;font-weight:700;color:#fff1c8;text-shadow:0 3px 8px #170027;pointer-events:none;z-index:7;white-space:nowrap}
.status{width:min(100%,max(300px,var(--board-size)));height:30px;padding:0 5px;display:grid;place-items:center;text-align:center;font-size:11px;line-height:1.25;color:#e8d4f5;text-shadow:0 1px 3px #000}.status.error{color:#ffc2ad}.controls{display:flex;gap:12px;width:min(100%,max(300px,var(--board-size)));height:42px;padding:0 7px}.controls button{flex:1}.secondary,.primary,.small-button{border:1px solid #aa7aab;background:linear-gradient(#4b285c,#281535);box-shadow:inset 0 1px 1px #cbb0d638,0 3px 0 #0b0611,0 5px 9px #0004;border-radius:7px;color:#f1e0ff;padding:10px 15px;display:inline-flex;align-items:center;justify-content:center;gap:9px;font-size:12px}.primary{background:linear-gradient(#a259d1,#6d2b96 65%,#512171);border-color:#daafeb;color:#fff5ff;font-weight:600}.secondary svg{width:17px;height:17px;color:#d8b8eb}.secondary:active,.primary:active,.small-button:active{transform:translateY(2px);box-shadow:inset 0 1px 2px #090110}.text-button{background:none;border:0;color:#e3c2ff;font-size:12px;padding:9px;text-decoration:underline;text-underline-offset:3px}.small-button{font-size:11px;padding:8px 10px;white-space:nowrap}.subtle{font-size:11px;line-height:1.6;color:var(--muted);text-align:center}.success{color:#b3e8a6}
.end{position:absolute;inset:15px;background:#150a25f5;z-index:8;display:flex;align-items:center;justify-content:center;flex-direction:column;border-radius:10px;text-align:center;box-shadow:inset 0 1px 15px #8143a329}.end-emblem{color:#e4c48b;width:36px;height:36px}.end h2{font:600 clamp(20px,4vw,34px)/1.1 'Golos Text',Georgia,serif;margin:7px 0;color:#fff0cf}.end>strong{font-size:36px;font-variant-numeric:tabular-nums;color:#fff1dc}.end>span{font-size:11px;color:#d7c1e8;margin:3px 0 12px}.end .primary{margin-top:8px}.earned-stars{display:flex;gap:5px}.star{color:#66536f;display:inline-flex}.star.earned{color:#f2ce77}.star.earned svg{fill:#d99a40;stroke:#ffdfa5}.earned-stars svg{width:26px;height:26px}.confirm{position:absolute;bottom:58px;left:50%;transform:translateX(-50%);width:min(100%,350px);padding:18px;background:#241333;border:1px solid #bd8ed4;border-radius:12px;box-shadow:0 10px 40px #000a;z-index:12}.confirm p{font-size:14px;line-height:1.5;margin:0 0 16px}.confirm button{margin-right:5px}
.bottom-nav{width:min(100%,690px);height:60px;align-self:end;justify-self:center;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));border-top:1px solid #a57aab8a;background:linear-gradient(#22132ff0,#11091ef5);border-radius:12px 12px 0 0;box-shadow:0 -8px 30px #08020e55}.bottom-nav button{border:0;background:transparent;color:#c9b3dd;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;position:relative;border-radius:8px;font-size:10px;min-width:0}.bottom-nav svg{width:22px;height:22px}.bottom-nav button.active{color:#ffdf9a;background:linear-gradient(#7d439b48,transparent)}.bottom-nav button.active:before{content:'';height:2px;position:absolute;top:0;left:20%;right:20%;background:#d9a8fc}.bottom-nav i{position:absolute;top:7px;right:24%;width:6px;height:6px;border-radius:50%;background:#f5d276}
.panel-screen{max-width:720px;margin:auto;padding:20px 24px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#754c8e #180c28;background:linear-gradient(180deg,#1b0f2ce8,#120b21eb);border:1px solid #9c74aa55;border-radius:16px}.panel-heading{text-align:center;margin:0 0 22px}.panel-heading>svg{color:#e4c48b;width:30px;height:30px;margin-bottom:5px}.panel-heading h1{font:600 38px/1.1 'Golos Text',Georgia,serif;margin:0 0 7px;color:#ffe5bd;text-wrap:balance}.panel-heading p{font-size:12px;color:#cfb9df;margin:0}.panel-screen h2{font:600 25px/1.2 'Golos Text',Georgia,serif;margin:23px 0 12px;color:#ead1f4}.segments{display:flex;gap:4px;padding:4px;background:#100819;border:1px solid #765582;border-radius:9px;margin-bottom:18px}.segments button{flex:1;border:0;background:none;padding:10px 6px;font-size:12px;color:#cbb4dc;border-radius:5px}.segments button.active{background:linear-gradient(#6c3b86,#3c2056);color:#ffe9bc;box-shadow:inset 0 1px 1px #b587cd4d}.chapter-scene{height:120px;background:linear-gradient(90deg,#1b0e2f05,#130b22b8),url('/assets/moon-castle.webp') center 30%/cover;border-radius:10px;padding:18px;text-align:right;display:flex;flex-direction:column;justify-content:center}.chapter-scene.crimson-scene{background-image:linear-gradient(90deg,#1b0e2f05,#130b22b8),url('/assets/crimson-castle.webp')}.chapter-scene h2{font-size:28px;margin:0 0 6px;color:#fff0db;text-shadow:0 2px 4px #000}.chapter-scene p{font-size:11px;margin:0;color:#e7d1ee}.level-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px 9px;padding:24px 0 14px}.level-node{border:0;background:none;display:flex;flex-direction:column;align-items:center;gap:6px;padding:0;color:#eddaff}.level-number{display:grid;place-items:center;width:52px;height:52px;background:linear-gradient(135deg,#633b7c,#26143a);border:2px solid #ad84c0;box-shadow:inset 0 1px 4px #dca6ff50,0 4px 9px #09021180;transform:rotate(45deg);border-radius:11px;font-family:Georgia,serif;font-size:0}.level-number:after{content:attr(data-number)}.level-node .level-number{transform:none;border-radius:50%;font-size:23px}.level-node.current .level-number{border-color:#ebc77c;color:#ffe7a5;background:linear-gradient(#79469d,#3e1d58)}.level-node.locked{opacity:.45}.level-node-name{font-size:10px;line-height:1.25;min-height:26px;max-width:90px}.node-stars{display:flex;gap:1px}.node-stars svg{width:12px;height:12px}.notice{padding:12px 15px;border:1px solid #694b80;background:#2b173b;font-size:12px;line-height:1.5;color:#eddbfa;border-radius:8px;margin:12px 0}.notice strong{letter-spacing:.05em;color:#f6d69b}.person-row{display:flex;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid #6d4c7b55}.rank-number{width:23px;flex-shrink:0;color:#e8c98d;font-size:18px;text-align:center}.avatar{height:38px;width:38px;display:grid;place-items:center;border:1px solid #b98ac9;background:linear-gradient(#65427e,#2d183e);border-radius:50%;color:#efcfff;font:600 23px Georgia,serif;flex-shrink:0}.person-name{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.person-name strong{font-size:13px;overflow-wrap:anywhere}.person-name span{font-size:10px;color:#c1a8d3;overflow-wrap:anywhere}.rank-score{font-size:14px;color:#f1d296;white-space:nowrap;text-align:right}.rank-score small{display:block;font-size:10px;font-weight:400;color:#c8b2d6;margin-top:3px}.empty-state{padding:28px 18px;text-align:center;color:#ccb3e2}.empty-state svg{width:42px;height:42px;color:#a983c5;margin-bottom:8px}.empty-state p{font-size:13px;line-height:1.6;margin:0}.row-actions{display:flex;flex-direction:column;align-items:end;gap:2px}.search{display:flex;gap:8px;margin:18px 0}.search input{min-width:0;flex:1;border:1px solid #8c669f;background:#120a1e;border-radius:7px;color:#f7e8ff;padding:12px;font:inherit;font-size:13px;caret-color:#dfa5ff}.search input::placeholder{color:#b69bc7}.quest{display:flex;align-items:center;gap:14px;padding:22px 0;border-bottom:1px solid #73558066}.quest-symbol{color:#e7c28a;background:#342044;border:1px solid #9170a1;width:42px;height:48px;display:grid;place-items:center;flex-shrink:0;clip-path:polygon(50% 0,100% 20%,100% 80%,50% 100%,0 80%,0 20%)}.quest-body{flex:1;min-width:0}.quest-body h2{margin:0 0 6px;font-size:23px}.quest-body p{font-size:11px;margin:0 0 12px;color:#ccb5df;line-height:1.4}.quest-track{height:6px;border-radius:4px;background:#0e061c;overflow:hidden;margin-bottom:5px}.quest-track i{height:100%;display:block;background:linear-gradient(90deg,#883fd3,#e0a6ff)}.quest-body>span{font-size:10px;color:#d7bee9}.quest-reward{display:flex;flex-direction:column;align-items:center;gap:3px}.quest-reward strong{color:#eac988;font-size:20px}.quest-reward span{font-size:10px;color:#cbb5d8}.quest-reward button{margin-top:8px}.profile-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;border-top:1px solid #78508d;border-bottom:1px solid #78508d;padding:8px 0}.profile-summary>div{padding:14px 6px;display:flex;flex-direction:column;text-align:center;gap:5px}.profile-summary strong{font-size:22px;color:#f1d3a0}.profile-summary span{font-size:10px;color:#d0b5df}.color-stats{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));text-align:center}.color-stats img{width:100%;max-width:75px;display:block;margin:auto}.color-stats strong{font-size:12px;color:#e1cbea}.history-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:13px 0;border-bottom:1px solid #76528255;font-size:12px}.history-row small{display:block;font-size:10px;color:#bfa4cf;margin-top:4px}.toast{position:fixed;bottom:calc(80px + var(--safe-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);border:1px solid #b085c8;border-radius:9px;background:#2c1640;color:#fff0ff;font-size:13px;padding:13px 19px;box-shadow:0 8px 25px #0009;z-index:100;line-height:1.4}
@keyframes selected-float{0%,100%{transform:translateY(-3px) scale(1.19)}50%{transform:translateY(-5px) scale(1.22)}}@keyframes hint-pulse{50%{transform:translateY(-4px) scale(1.24)}}@keyframes shine-sweep{0%{transform:translateX(-120%)}45%,100%{transform:translateX(120%)}}@keyframes collect{0%{transform:translateY(-2px) scale(1.16)}35%{transform:translateY(-5px) scale(1.3)}100%{transform:translateY(-10px) scale(.1) rotate(25deg);opacity:0}}
@media(hover:hover){.cell:hover{background:#332044}.cell:hover .crystal{transform:translateY(-3px) scale(1.2)}.secondary:hover,.small-button:hover{background:linear-gradient(#613775,#392048)}.primary:hover{background:linear-gradient(#b56ae4,#8038a8)}}
@media(max-width:500px){body{padding-left:max(6px,var(--safe-left));padding-right:max(6px,var(--safe-right));background-position:32% center}.brand{font-size:30px}.brand img{width:36px;height:36px}.header-actions{gap:6px}.panel-screen{padding:18px 14px}.panel-heading h1{font-size:34px}.scene-banner{width:100%;padding:8px}.scene-banner h1{font-size:25px}.chapter-seal{width:40px;height:40px;margin-left:18%}.scene-banner p{font-size:10px}.board{gap:2px;padding:2px}.cell{border-radius:3px}.stats{padding:0 12px}.stats strong{font-size:23px}.status{font-size:10px}.bottom-nav{height:60px}.bottom-nav button{font-size:9px}.profile-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.quest{gap:10px}.quest-symbol{display:none}.quest-body h2{font-size:22px}.quest-reward .small-button{font-size:10px;padding:8px}.person-row{gap:8px}.avatar{height:32px;width:32px;font-size:19px}.level-grid{gap:16px 4px}.level-number{width:46px;height:46px}.level-node-name{font-size:9px}.level-node .level-number{font-size:20px}}
@media(max-height:720px){.play{grid-template-rows:0 42px 22px minmax(0,1fr) 27px 38px;gap:4px}.scene-banner{display:none}.stats{height:42px}.objective{height:22px}.status{height:27px}.controls{height:38px}.stats strong{font-size:21px}.panel-heading{margin-bottom:14px}.chapter-scene{height:90px}.end-emblem{display:none}.end h2{font-size:23px}.end>strong{font-size:27px}.end>span{margin:0 0 4px}}
@media(max-height:500px) and (min-width:600px){body{grid-template-rows:42px minmax(0,1fr) 52px}header{height:42px}.bottom-nav{height:48px}.bottom-nav button{flex-direction:row;gap:6px}.bottom-nav svg{width:18px;height:18px}.play{grid-template-columns:var(--board-size) minmax(200px,240px);grid-template-rows:48px 30px 1fr 42px;column-gap:24px;justify-content:center;align-content:center}.board-wrap{grid-column:1;grid-row:1/5}.stats{grid-column:2;grid-row:1;width:100%}.objective{grid-column:2;grid-row:2;width:100%}.status{grid-column:2;grid-row:3;width:100%}.controls{grid-column:2;grid-row:4;width:100%}.end h2{font-size:20px}.end>strong{font-size:22px}.end .primary{padding:8px 12px;font-size:11px}.earned-stars svg{width:18px;height:18px}.end .text-button{padding:6px}.panel-heading h1{font-size:28px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}.cell.cleared .crystal{opacity:.2}}
/* Slice the ornamental border so it never covers the outer crystal rows. */
.board-wrap{border:calc(var(--board-size)*.065) solid transparent;border-image:url('/assets/board-frame.webp') 145 stretch;padding:2px;background-clip:padding-box;border-radius:0;box-shadow:none}.board-frame{display:none}
/* Larger portrait board, thinner frame and taller lancet-shaped crystals. */
.play{grid-template-rows:60px 44px 24px minmax(0,1fr) 28px 40px;gap:4px}.scene-banner{height:60px}.stats{height:44px}.objective{height:24px}.status{height:28px}.controls{height:40px}.board-wrap{height:var(--board-height,var(--board-size));border-width:calc(var(--board-size)*.025);padding:1px}.board{padding:1px;gap:2px}.crystal{width:100%;height:100%;aspect-ratio:auto;object-fit:fill;transform:translateY(-1px) scale(1.2)}.chapter-seal{height:38px;width:38px}.scene-banner h1{font-size:25px}.sound-on{color:#f4cf83;background:#4a275a55}.sound-waves{display:none}.sound-on .sound-waves{display:initial}.sound-on .sound-slash{display:none}
@media(max-height:720px){.play{grid-template-rows:38px 20px minmax(0,1fr) 24px 36px}.scene-banner{display:none}.stats{height:38px}.objective{height:20px}.status{height:24px}.controls{height:36px}}
@media(max-height:500px) and (min-width:600px){.play{grid-template-columns:var(--board-size) minmax(200px,240px);grid-template-rows:44px 26px 1fr 40px;column-gap:24px}.stats{height:44px}.objective{height:26px}.status{height:28px}.controls{height:40px}}
@media(max-width:360px){.brand{font-size:26px}.brand img{width:30px;height:30px}.header-actions{gap:1px}.icon-button{width:38px}.essence{font-size:12px}}

.crystal{transform:translateY(-1px) scale(1.45,1.12)}
@keyframes selected-float{0%,100%{transform:translateY(-2px) scale(1.45,1.12)}50%{transform:translateY(-4px) scale(1.5,1.16)}}
@keyframes hint-pulse{50%{transform:translateY(-3px) scale(1.5,1.16)}}
@keyframes collect{0%{transform:translateY(-1px) scale(1.45,1.12)}35%{transform:translateY(-3px) scale(1.55,1.2)}100%{transform:translateY(-8px) scale(.1) rotate(25deg);opacity:0}}
@media(hover:hover){.cell:hover .crystal{transform:translateY(-2px) scale(1.5,1.16)}}
/* Quiet magic moving behind the board; all animation is transform/opacity only. */
.atmosphere{position:fixed;inset:0;overflow:hidden;pointer-events:none;z-index:-1;contain:strict}.mist{position:absolute;left:-12%;width:124%;height:32%;bottom:-7%;background:radial-gradient(ellipse at 23% 70%,#ab67ee55,transparent 57%),radial-gradient(ellipse at 75% 45%,#9666d638,transparent 55%);opacity:.2;animation:mist-drift 24s ease-in-out infinite alternate}.mist-far{bottom:22%;height:24%;animation-duration:33s;animation-delay:-14s;opacity:.13;transform:scaleX(-1)}.moon-breath{position:absolute;right:0;top:4%;width:min(42vw,500px);height:35%;background:radial-gradient(ellipse,#b792ff20,transparent 68%);animation:moon-breathe 9s ease-in-out infinite alternate}.magic-mote{position:absolute;bottom:-3%;height:var(--size);width:var(--size);border-radius:50%;background:#eed6ff;opacity:0;animation:mote-rise 20s linear infinite}.magic-mote:nth-child(3n){background:#c78bff}.crimson .magic-mote:nth-child(3n){background:#ff839f}.atmosphere.paused *{animation-play-state:paused!important}.scene-settings{display:flex;justify-content:center;margin:-7px 0 20px}.scene-settings button{font-size:11px}
@keyframes mist-drift{from{transform:translate3d(-4%,2%,0);opacity:.12}to{transform:translate3d(5%,-6%,0);opacity:.3}}
@keyframes moon-breathe{from{opacity:.22}to{opacity:.7}}
@keyframes mote-rise{0%{transform:translate3d(0,0,0);opacity:0}12%{opacity:.5}75%{opacity:.35}100%{transform:translate3d(var(--drift),-100vh,0);opacity:0}}
@media(max-width:600px){.magic-mote:nth-child(n+14){display:none}.moon-breath{width:65vw}.mist{height:27%}}
@media(prefers-reduced-motion:reduce){.atmosphere{display:none}}

/* Moon-shard wallet inherits the game's gold and violet controls. */
button.essence{background:transparent;border:1px solid #8e729d;border-radius:8px;min-height:40px;padding:6px 9px;font-variant-numeric:tabular-nums;max-width:130px}
button.essence b{overflow:hidden;text-overflow:ellipsis}button.essence:hover{background:#442961}
.wallet-section{margin-bottom:28px;padding-bottom:22px;border-bottom:1px solid #795889}
.panel-screen .wallet-section h2{margin:12px 0}.wallet-balance{display:flex;align-items:center;gap:9px;color:#efd1a0;margin:12px 0}
.wallet-balance svg{width:30px;height:30px}.wallet-balance strong{font-size:34px;font-variant-numeric:tabular-nums}.wallet-balance span{color:#d4bedf;font-size:13px}
.wallet-rules{font-size:13px;line-height:1.65;color:#dcc7e8;margin:12px 0}.wallet-history{margin-top:20px;font-size:13px}.wallet-history summary{cursor:pointer;color:#ead1f4;padding:9px 0}
.wallet-row{display:flex;justify-content:space-between;gap:15px;padding:10px 0;border-bottom:1px solid #674476}.wallet-row small{display:block;color:#cbb4dc;margin-top:3px;font-size:11px}
@media(max-width:380px){.header-actions{gap:3px}.brand{font-size:26px}.brand img{width:32px;height:32px}button.essence{padding:5px;max-width:86px}.controls button{padding-left:10px;padding-right:10px;font-size:11px}}

/* Legible special gems and short, bounded spell celebrations. */
.ice-shell,.bomb-seal{position:absolute;pointer-events:none;display:none}.frozen .ice-shell{display:block;inset:-1px;background:url("/assets/ice-shell.webp") center/100% 100% no-repeat;opacity:.88;z-index:4}.frozen .crystal{opacity:1}.frozen{cursor:not-allowed}.bomb .bomb-seal{display:grid;place-items:center;right:1px;bottom:1px;width:19px;height:19px;border-radius:50%;background:#34102d;border:1px solid #ffe5b1;color:#ffdf8d;z-index:5}.bomb-seal svg{width:14px;height:14px;stroke-width:2}.bomb .crystal{outline:1px solid #ffcf8580;outline-offset:-8px}.blast-ring,.ice-break{position:absolute;inset:0;border:3px solid #ffcd79;border-radius:50%;pointer-events:none;z-index:9}.ice-break{border:0;border-radius:0;background:url("/assets/ice-shell.webp") center/100% 100% no-repeat}.combo-banner{position:absolute;z-index:10;top:8%;left:50%;transform:translateX(-50%);padding:6px 16px;white-space:nowrap;font:700 clamp(22px,5vw,37px)/1.1 'Golos Text',Georgia,serif;color:#ffe5a4;background:#291030ed;border:1px solid #ba8b67;border-radius:8px;text-shadow:0 2px 4px #160920;pointer-events:none}.combo-banner[data-power=great]{color:#fff3d8;background:#51224cf0}
.witch-visit{position:fixed;left:max(0px,calc(50% - 620px));top:24%;width:230px;height:330px;z-index:25;pointer-events:none;contain:layout style}.witch-visit img{height:100%;width:100%;object-fit:contain;object-position:bottom left}.witch-visit p{position:absolute;left:45%;top:3%;width:180px;padding:10px 13px;background:#24132ef2;color:#f4dcad;border:1px solid #bc93b9;border-radius:12px;font:600 18px/1.2 'Golos Text',Georgia,serif;box-shadow:0 7px 15px #08031566;margin:0}
.mechanics-help{margin:20px 0 28px}.mechanics-help p{display:flex;gap:12px;align-items:flex-start;color:#dcc7e8;font-size:13px;line-height:1.6}.mechanics-help svg{color:#b8e5ff;margin-top:4px}.mechanics-help strong{color:#f4e5fa}
.magic-mote:nth-child(3n){background:var(--mote-color,#c78bff)}
@media(max-width:900px){.witch-visit{left:4px;top:calc(60px + var(--safe-top));height:165px;width:105px}.witch-visit p{left:78%;top:10%;width:170px;font-size:16px;padding:8px 10px}}
@media(max-height:720px){.witch-visit{top:calc(60px + var(--safe-top));height:95px;width:70px}.witch-visit p{font-size:14px;top:2%;width:185px}}
@media(max-width:380px){.bomb .bomb-seal{width:15px;height:15px}.bomb-seal svg{width:11px;height:11px}}

/* Story campaign: each chapter owns its art and two illustrated guardians. */
.chapter-story{font-size:14px;line-height:1.7;color:#dfcaeb;margin:18px 0 20px}.chapter-bosses{display:grid;grid-template-columns:1fr 1fr;gap:16px}.boss-card{position:relative;padding:0;overflow:hidden;aspect-ratio:4/5;background:#20102d;border:1px solid #9e78af;border-radius:10px;text-align:left}.boss-card img{height:100%;width:100%;object-fit:cover;object-position:center top;transition:transform .3s ease-out}.boss-card:hover img{transform:scale(1.035)}.boss-caption{position:absolute;inset:auto 0 0;padding:36px 14px 13px;background:linear-gradient(transparent,#11091deb 37%,#11091dfc);display:flex;flex-direction:column;gap:3px;color:#f5ddbd}.boss-caption strong{font:600 28px/1.1 'Golos Text',Georgia,serif}.boss-caption span{font-size:12px;color:#f0d9fa}.boss-caption small{font-size:11px;color:#d3bde1;margin-top:3px}.boss-level .level-number{border-color:#e9b668;background:#4b254c}.chapter-seal img{width:100%;height:100%;object-fit:cover;object-position:center 20%;border-radius:50%}.scene-banner>div:nth-child(2){min-width:0;flex:1}.story-open{padding:3px 0;border:0;background:none;color:#f0d1a3;font-size:10px;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}.objective{gap:8px}.goal-track{min-width:20px}
.story-dialog{padding:0;width:min(660px,calc(100% - 24px));max-height:calc(100dvh - 36px);overflow:auto;overscroll-behavior:contain;background:#1a0f29;border:1px solid #b18bc3;border-radius:14px;color:#f4eaff;box-shadow:0 20px 60px #030008b3}.story-dialog[open]{display:grid;grid-template-columns:38% 1fr}.story-dialog::backdrop{background:#06030dcc}.story-dialog>img{width:100%;height:100%;min-height:340px;object-fit:cover;object-position:center top}.story-content{padding:24px}.story-content h2{font:600 36px/1.05 'Golos Text',Georgia,serif;margin:0 0 7px;color:#ffe3ba}.story-role{font-size:12px;color:#ddbee9;margin:0 0 18px}.story-content>p:not(.story-role){font-size:14px;line-height:1.65}.story-content blockquote{font:italic 600 20px/1.35 'Golos Text',Georgia,serif;color:#e4c6ef;margin:16px 0}.story-goal{color:#e9c78f}.story-content .primary{width:100%;margin-top:6px}
@media(max-width:600px){.scene-banner{padding:6px 10px;gap:8px}.scene-banner h1{font-size:18px;line-height:1;margin:0}.scene-banner p{font-size:10px;margin-top:3px}.chapter-seal{margin-left:4%;width:34px;height:34px}.chapter-bosses{gap:10px}.boss-caption{padding:28px 10px 10px}.boss-caption strong{font-size:24px}.boss-caption span{font-size:11px}.chapter-story{font-size:13px}.story-dialog[open]{grid-template-columns:1fr}.story-dialog>img{height:clamp(100px,24vh,210px);min-height:0;object-position:center 20%}.story-content{padding:18px}.story-content h2{font-size:30px}.story-role{margin-bottom:10px}.story-content>p:not(.story-role){font-size:13px;line-height:1.5}.story-content blockquote{font-size:18px;margin:10px 0}}
@media(max-height:500px) and (min-width:600px){.story-dialog>img{min-height:260px}.story-content{padding:15px}.story-content h2{font-size:28px}.story-role{margin-bottom:8px}.story-content blockquote{font-size:18px}}

.currency-icon{object-fit:contain;flex-shrink:0;vertical-align:middle;pointer-events:none}.essence .currency-icon{width:28px;height:28px}.wallet-balance .currency-icon{width:44px;height:44px}.quest-reward strong{display:flex;align-items:center;gap:2px}.quest-reward .currency-icon{width:28px;height:28px}#hint-currency{width:20px;height:20px;margin-left:-4px}


/* portal.css */
/* The existing amethyst world extends into an illustrated entry and adventure map. */
.brand{border:0;background:none;padding:0}.bottom-nav{grid-template-columns:repeat(5,minmax(0,1fr))}.header-actions{gap:6px}.header-actions .essence{padding:3px 6px;gap:1px;max-width:112px}.crystal-wallet{color:#dec6ff}.currency-icon{object-fit:contain}
.loading-screen{position:fixed;inset:0;z-index:200;background:#110a22;display:flex;align-items:center;flex-direction:column;overflow:hidden}.loading-screen>img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;object-position:center;opacity:.92}.loading-screen:after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,#10091f22 50%,#10091fdd);pointer-events:none}.loading-title{position:relative;z-index:1;margin-top:max(4vh,40px);font:600 clamp(42px,9vw,80px)/1 'Golos Text',Georgia,serif;color:#f8dfb6;text-align:center;text-shadow:0 3px 12px #10071b}.loading-title span{display:block;font-size:18px;margin-top:10px;color:#ead6f7}.loading-caption{position:absolute;z-index:1;bottom:max(7vh,40px);width:min(75%,340px);text-align:center}.loading-caption p{font-size:13px;color:#eee0fa}.loading-caption progress{display:block;width:100%;height:6px;accent-color:#bd89ec;border:0;border-radius:5px;overflow:hidden}.loading-caption button{margin:14px auto 0}
.home-screen{position:relative;max-width:1100px;margin:auto;overflow:hidden;isolation:isolate;border-radius:12px}.home-art{position:absolute;inset:0;width:68%;height:100%;object-fit:cover;object-position:50% 30%;z-index:-2}.home-screen:before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,transparent 25%,#170d25dc 65%,#170d25)}.home-title{position:absolute;left:62%;right:3%;top:12%;text-align:center}.home-title h1{font:600 clamp(44px,6vw,74px)/1 'Golos Text',Georgia,serif;color:#ffe2b2;margin:0;text-shadow:0 3px 14px #18061f}.home-title p{font:400 18px/1.4 'Golos Text',Georgia,serif;color:#e5caef;margin:12px 0}.home-content{position:absolute;left:62%;right:4%;bottom:10%;display:flex;flex-direction:column;align-items:stretch;gap:12px;text-align:center}.home-chapter{font:600 24px/1.15 'Golos Text',Georgia,serif;color:#eddbf7;margin:0 0 3px}.play-cta{min-height:68px;display:grid;grid-template-columns:24px 1fr;gap:4px 8px;background:linear-gradient(#ad72da,#6b3497);border:1px solid #e9c3ff;box-shadow:0 5px 18px #08010d80,inset 0 1px 1px #f0d2ff80}.play-cta svg{grid-row:1/3;justify-self:center;color:#ffe2ac}.play-cta>span{font:600 28px/1 'Golos Text',Georgia,serif}.play-cta small{font-size:11px;font-weight:400;color:#f0dcff}.home-map-link{border:0;background:none;padding:9px 0;color:#eed4a6;display:flex;justify-content:center;align-items:center;gap:10px;font-size:12px}.home-map-link svg{width:18px;height:18px}.home-links{display:flex;border-block:1px solid #9c78b34d;padding:12px 0}.home-links button{position:relative;flex:1;display:flex;align-items:center;flex-direction:column;gap:7px;border:0;background:none;font-size:11px;color:#e1cdec;min-height:48px}.home-links svg{color:#d5ae7d}.home-links i{position:absolute;right:24%;top:2px;width:6px;height:6px;border-radius:50%;background:#edc779}.tutorial-link{align-self:center;font-size:11px;color:#dac4e7;padding:4px}
/* A route connects ten real server-backed levels in each chapter. */
#screen-levels{max-width:760px}#chapter-tabs{position:sticky;top:-20px;z-index:6;background:#1c102d}#chapter-bosses{margin-bottom:18px}.level-grid.adventure-map{display:block;position:relative;height:1040px;padding:0;margin-top:12px;overflow:hidden;border-radius:12px;background:linear-gradient(#100a1e55,#0e081ac9),var(--map-scene) center/cover no-repeat;isolation:isolate}.map-route{position:absolute;inset:0;width:100%;height:1040px;stroke:#d0ab78;stroke-width:2;stroke-dasharray:5 6;opacity:.9;z-index:-1}.map-route .map-route-shadow{stroke:#170b27;stroke-width:12;stroke-dasharray:none}.adventure-map .level-node{position:absolute;width:112px;transform:translate(-50%,-34px);gap:4px}.adventure-map .level-number{position:relative;width:58px;height:58px;font-size:23px;border:2px solid #b58ac9;background:#2c183f;box-shadow:0 5px 12px #07020ea0;overflow:hidden;isolation:isolate}.adventure-map .locked{opacity:.85}.adventure-map .locked .level-number{border-color:#766086;background:#24192f;color:#bfa8ce}.adventure-map .completed .level-number{border-color:#e1bc74;background:#654332}.adventure-map .next-level .level-number{border-color:#ffe2a0;box-shadow:0 4px 18px #e2a84345,0 0 0 5px #20102a}.adventure-map .level-node-name{max-width:112px;min-height:0;padding:3px 6px;background:#170c26e8;border-radius:4px;font-size:11px;line-height:1.2;color:#f4e7ff}.map-boss{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-1;opacity:.6}.adventure-map .boss-level .level-number{width:72px;height:72px;border-color:#ddae68;text-shadow:0 2px 3px #000;font-size:25px}.adventure-map .node-stars svg{width:14px;height:14px}.profile-links{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 28px}
/* Trophies are earned from chapter completion, achievement rewards are explicit. */
.trophy-shelf{display:flex;justify-content:center;flex-wrap:wrap;gap:14px 5px;padding:0 0 24px;border-bottom:1px solid #80608e66}.trophy{flex:1;min-width:90px;max-width:124px;display:flex;flex-direction:column;align-items:center;text-align:center}.trophy img{width:90px;height:90px;object-fit:contain;opacity:.3}.trophy.unlocked img{opacity:1}.trophy strong{font:600 17px/1.15 'Golos Text',Georgia,serif;color:#decaed}.trophy.unlocked strong{color:#f2d49b}.trophy span{font-size:10px;color:#c4a9d7;margin-top:5px}.achievement{display:flex;align-items:center;gap:14px;padding:20px 0;border-bottom:1px solid #76528766}.achievement-copy{flex:1;min-width:0}.achievement h3{font:600 25px/1.1 'Golos Text',Georgia,serif;color:#f0d7af;margin:0 0 7px}.achievement p{font-size:12px;line-height:1.5;margin:0 0 12px;color:#d4bedf}.achievement progress{display:block;width:100%;height:6px;accent-color:#c894ef;border:0;border-radius:4px;overflow:hidden}.achievement-copy>span{display:block;font-size:10px;color:#cab0de;margin-top:6px}.achievement-reward{min-width:78px;display:flex;flex-direction:column;align-items:stretch;gap:5px}.achievement-reward>div{display:flex;align-items:center;justify-content:center;gap:2px;font-size:12px;color:#f5daab}.achievement-reward>div:nth-child(2){color:#e0bdf6}.achievement-reward .currency-icon{width:23px;height:23px}.achievement-reward button{margin-top:5px}
/* Equal sectors: animation only reveals the server-selected prize. */
.fortune-screen{text-align:center}.fortune-stage{position:relative;width:min(100%,350px);aspect-ratio:1;margin:20px auto 22px;padding:8px}.fortune-wheel{position:relative;width:100%;height:100%;border-radius:50%;border:7px solid #c2a275;box-shadow:0 10px 25px #08040d99,inset 0 0 0 3px #5b3c62;background:conic-gradient(#392243 0deg 45deg,#65426d 45deg 90deg,#392243 90deg 135deg,#65426d 135deg 180deg,#392243 180deg 225deg,#4d366f 225deg 270deg,#392243 270deg 315deg,#65426d 315deg 360deg)}.wheel-pointer{position:absolute;z-index:3;left:50%;top:-3px;transform:translateX(-50%);width:24px;height:32px;background:#ffe2a2;clip-path:polygon(0 0,100% 0,50% 100%)}.wheel-hub{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);height:24%;width:24%;border:2px solid #d9ba86;background:radial-gradient(#56336d,#20112f);border-radius:50%;display:grid;place-items:center;box-shadow:0 4px 14px #08020c99;pointer-events:none}.wheel-hub img{width:80%;height:80%;object-fit:contain}.wheel-prize{position:absolute;left:50%;top:50%;width:0;height:0;transform:rotate(var(--angle))}.wheel-prize>span{position:absolute;display:flex;align-items:center;flex-direction:column;justify-content:center;width:58px;height:60px;left:-29px;bottom:65px;transform:rotate(calc(0deg - var(--angle)));color:#ffdfab;font-size:18px;font-variant-numeric:tabular-nums}.wheel-prize .currency-icon{width:30px;height:30px}.fortune-result{font:600 25px/1.2 'Golos Text',Georgia,serif;min-height:30px;color:#ffe3b4;margin:0 0 14px}.fortune-spin{min-width:230px;min-height:46px}.fortune-timer{font-size:12px;color:#d9bfe9;font-variant-numeric:tabular-nums;min-height:18px}.fortune-odds{text-align:left;margin:26px auto 10px;max-width:420px;font-size:12px;line-height:1.6;color:#cdb6df}.fortune-odds summary{cursor:pointer;color:#ead2f8;padding:10px 0}.fortune-odds ul{list-style:none;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:8px}.fortune-odds li{display:flex;align-items:center;gap:5px;font-size:11px}.fortune-odds img{width:22px;height:22px}
/* A small real practice board; skipping never blocks entry. */
.tutorial-dialog{width:min(92vw,390px);max-height:calc(100dvh - 30px);overflow:auto;margin:auto;padding:20px 24px 25px;border:1px solid #ad80bb;border-radius:16px;background:#1c102c;color:#f3e4fd;text-align:center;box-shadow:0 18px 60px #0009}.tutorial-dialog::backdrop{background:#090414c9}.tutorial-top{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#c9aedc}.tutorial-top .text-button{font-size:11px}.tutorial-dialog h2{font:600 31px/1.1 'Golos Text',Georgia,serif;color:#f4d5a6;margin:20px 0 12px}.tutorial-dialog p{font-size:13px;line-height:1.6;margin:0;color:#dfcce9}.tutorial-demo{height:160px;max-width:260px;margin:16px auto 0;display:flex;align-items:center;justify-content:center;gap:20px}.tutorial-demo.step-0{height:174px;width:174px;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:4px}.demo-gem{border:1px solid #644477;border-radius:5px;background:#11091e;padding:0;display:grid;place-items:center}.demo-gem img{width:100%;height:100%;object-fit:contain;pointer-events:none}.demo-gem.demo-hint{border:2px dashed #eac58b}.demo-gem.demo-selected{background:#70408e}.demo-gem.demo-match{background:#3f5b32;border-color:#c4e0a5}.tutorial-dialog #tutorial-feedback{font-size:11px;color:#f2d39c;min-height:34px;margin:8px 0}.tutorial-dialog>.primary{width:100%;min-height:42px}.demo-goal{display:flex;flex-direction:column;gap:8px;width:100%;align-items:center;color:#dbc5eb;font-size:12px}.demo-goal strong{font-size:40px;color:#ffdeb1}.demo-progress{height:7px;width:80%;background:linear-gradient(90deg,#c18fe7 45%,#39214d 45%);border-radius:5px;margin-top:8px}.demo-special{position:relative;width:86px;height:90px}.demo-special>img{width:86px;height:86px;object-fit:contain}.demo-special .demo-ice{position:absolute;inset:0}.demo-special svg{position:absolute;right:5px;bottom:6px;background:#34102d;border:1px solid #dcb478;color:#ffe0a3;border-radius:50%;width:26px;height:26px;padding:3px}.demo-special span{display:block;white-space:nowrap;font-size:10px;color:#d3b7e4}.demo-currency{display:flex;flex-direction:column;align-items:center;gap:10px;color:#efd3a3;font-size:13px}.demo-currency .currency-icon{width:74px;height:74px}
@media(max-width:600px){
 body{padding-left:max(env(safe-area-inset-left),var(--safe-left));padding-right:max(env(safe-area-inset-right),var(--safe-right));grid-template-rows:52px minmax(0,1fr) 60px}header{height:52px;padding:0 8px}.brand{font-size:25px}.brand img{width:25px;height:30px}.header-actions{gap:3px}.header-actions .essence{font-size:12px;max-width:75px;min-height:34px;padding:1px 3px}.essence .currency-icon{width:22px;height:24px}.header-actions .icon-button{width:32px;height:34px}#fullscreen{display:none}.header-actions .icon-button svg{width:20px;height:20px}main{padding:0 0 4px}.bottom-nav{height:56px;border-radius:0}.bottom-nav button{font-size:10px}.home-screen{border-radius:0}.home-art{width:100%;object-position:50% 28%}.home-screen:before{background:linear-gradient(180deg,#170d2533,transparent 32%,#170d2533 49%,#170d25f2 72%,#170d25)}.home-title{left:8%;right:8%;top:2%}.home-title h1{font-size:48px}.home-title p{font-size:16px;margin-top:7px}.home-content{left:7%;right:7%;bottom:3%;gap:8px}.home-chapter{font-size:22px}.play-cta{min-height:61px}.home-links{padding:8px 0}.home-map-link{padding:5px 0}.tutorial-link{padding:2px}.board-wrap{border-width:2px;padding:0}.board{border-radius:0;padding:1px;gap:2px}.panel-screen{width:calc(100% - 12px);border-radius:12px;padding:18px 14px}#chapter-tabs{top:-18px}.scene-banner{border-radius:0}.controls{padding:0 6px}.stats{padding:0 15px}.objective{padding:0 10px;gap:6px}.objective>span{font-size:9px}.story-open{font-size:9px}.wallet-balance{gap:6px}.fortune-stage{width:min(100%,320px)}.wheel-prize>span{bottom:57px;width:52px;left:-26px;font-size:16px}.wheel-prize .currency-icon{width:27px;height:27px}.trophy{min-width:82px}.trophy img{width:78px;height:78px}.trophy strong{font-size:16px}
}
@media(max-width:360px){.brand{font-size:23px}.brand img{display:none}.header-actions .essence{max-width:73px}.home-content{left:6%;right:6%}.home-title h1{font-size:42px}.wheel-prize>span{bottom:44px;font-size:15px}.fortune-result{font-size:23px}.fortune-screen .panel-heading h1{font-size:31px}.achievement h3{font-size:23px}.trophy-shelf{gap:14px 2px}}
@media(max-height:650px) and (max-width:600px){.home-title{top:3%}.home-title h1{font-size:36px}.home-title p{display:none}.home-content{gap:4px;bottom:2%}.home-chapter{font-size:19px}.play-cta{min-height:52px}.play-cta>span{font-size:24px}.home-links{padding:5px 0}.home-links button{min-height:39px;gap:4px;font-size:10px}.home-links svg{width:19px;height:19px}.home-map-link{font-size:11px}.tutorial-link{font-size:10px}.home-art{object-position:50% 22%}.home-screen:before{background:linear-gradient(180deg,#170d2500 25%,#170d2555 45%,#170d25f5 72%)}.tutorial-dialog{padding:12px 20px 16px}.tutorial-demo.step-0{height:135px;width:135px;margin-top:5px}.tutorial-demo{height:115px;margin-top:5px}.tutorial-dialog h2{font-size:27px;margin-top:12px}.tutorial-dialog p{font-size:12px}.tutorial-dialog #tutorial-feedback{min-height:20px;margin:5px 0}}
@media(max-height:500px) and (min-width:600px){.home-content{bottom:7%;left:56%;right:4%;gap:4px}.home-title{top:4%;left:56%}.home-title h1{font-size:34px}.home-title p,.home-chapter,.tutorial-link{display:none}.home-links{padding:4px 0}.home-links button{min-height:36px;flex-direction:row;gap:4px}.play-cta{min-height:52px}.home-art{width:65%;object-position:50% 25%}.home-map-link{padding:6px 0}.loading-title{margin-top:16px;font-size:40px}.loading-caption{bottom:20px}.loading-screen>img{object-fit:cover;object-position:50% 34%}}

body[data-tab=home]{background-image:none;background-color:#160d25}
.map-actions{margin:10px 0;display:flex;align-items:start;gap:8px;flex-wrap:wrap}.chapter-lore{flex:1;min-width:160px;font-size:12px;color:#dec8ec}.chapter-lore summary{cursor:pointer;padding:10px 0;line-height:1.5}.chapter-lore[open]{flex-basis:100%}.map-actions>.text-button{font-size:11px;white-space:nowrap}.chapter-lore .chapter-story{margin-top:8px}.demo-gem{touch-action:none}
.achievement progress::-webkit-progress-bar,.loading-caption progress::-webkit-progress-bar{background:#382247}.achievement progress::-webkit-progress-value,.loading-caption progress::-webkit-progress-value{background:#c28be7}.achievement progress::-moz-progress-bar,.loading-caption progress::-moz-progress-bar{background:#c28be7}
@media(max-width:600px){#screen-levels .panel-heading{margin-bottom:14px}#screen-levels .panel-heading>svg{display:none}#screen-levels .panel-heading h1{font-size:29px}#screen-levels .chapter-scene{height:92px}#screen-levels .chapter-scene h2{font-size:25px}.map-actions{margin:8px 0}.trophy-shelf{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));justify-items:center}.trophy{min-width:0;width:100%}.trophy img{height:74px;width:74px}}

/* Quiet controls and a concise profile. */
.home-utility{display:flex;justify-content:center;gap:22px}.header-actions button.essence{border:0;border-radius:0;background:transparent;box-shadow:none;gap:3px;padding:0 3px;min-width:42px;max-width:100px;align-items:center;line-height:1;font-size:13px}.header-actions button.essence:hover{background:transparent}.header-actions .essence .currency-icon{display:block;width:24px;height:28px}.header-actions .essence b{display:block;font-weight:600;font-variant-numeric:tabular-nums;line-height:1.2}.compact-profile{max-width:600px}.compact-profile .panel-heading{margin-bottom:16px}.compact-profile .panel-heading>svg{margin-bottom:3px}.compact-profile .panel-heading h1{font-size:34px;overflow-wrap:anywhere}.profile-actions{display:flex;gap:10px;margin:14px 0}.profile-actions>button{flex:1;min-height:40px}.profile-wallet{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:23px 0 8px}.profile-wallet .wallet-balance{justify-content:center;margin:0;gap:7px}.profile-wallet .wallet-balance>div{display:flex;flex-direction:column;gap:4px;min-width:0}.profile-wallet .wallet-balance strong{font-size:28px;overflow-wrap:anywhere;line-height:1.1}.profile-wallet .wallet-balance span{font-size:11px}.profile-disclosure{border-bottom:1px solid #78538d66;margin:0;padding:4px 0 10px}.profile-disclosure summary{font-size:12px;color:#dac1e9;cursor:pointer;padding:12px 0}.compact-profile>h2{margin:22px 0 10px;font-size:27px}.compact-profile .profile-summary{padding:2px 0}.compact-profile .profile-summary>div{padding:14px 5px}.compact-profile>.text-button{display:block;margin:12px auto 0}.compact-profile #profile-extra{margin:8px 0 18px}.settings-dialog{width:min(92vw,380px);max-height:calc(100dvh - 30px);overflow:auto;margin:auto;padding:22px 24px;border:1px solid #9e76b2;border-radius:14px;background:#1b102a;color:#f1e2fa;box-shadow:0 18px 60px #0009}.settings-dialog::backdrop{background:#090414c9}.settings-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:20px}.settings-heading h2{font:600 32px/1.1 'Golos Text',Georgia,serif;color:#f1d2a3;margin:0}.settings-heading .text-button{font-size:11px;padding:8px 0}.sound-switch{display:flex;align-items:center;justify-content:space-between;font-size:14px;cursor:pointer;min-height:32px}.sound-switch input{accent-color:#b680d8;width:22px;height:22px}.settings-note{font-size:11px;line-height:1.5;color:#c6add8;margin:5px 0 18px}.volume-setting{display:grid;grid-template-columns:1fr auto;align-items:center;margin:18px 0 10px;font-size:14px}.volume-setting output{color:#edcfa1;font-size:12px;font-variant-numeric:tabular-nums}.volume-setting input{grid-column:1/-1;appearance:none;-webkit-appearance:none;background:transparent;width:100%;height:38px;margin:4px 0;cursor:pointer;accent-color:#c293e3}.volume-setting input::-webkit-slider-runnable-track{height:6px;background:#634475;border-radius:4px}.volume-setting input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:20px;height:20px;background:#eed2ad;border:2px solid #ac7fc1;border-radius:50%;margin-top:-7px;box-shadow:0 2px 4px #09020d80}.volume-setting input::-moz-range-track{height:6px;background:#634475;border-radius:4px}.volume-setting input::-moz-range-thumb{width:17px;height:17px;background:#eed2ad;border:2px solid #ac7fc1;border-radius:50%}.settings-motion{margin:12px 0}.settings-motion button{width:100%;font-size:11px;min-height:38px}.settings-done{width:100%;min-height:42px;margin-top:4px}
@media(max-width:360px){.header-actions button.essence{font-size:12px;max-width:78px;min-width:40px;padding:0 2px}.header-actions .essence .currency-icon{width:22px;height:26px}.profile-wallet .currency-icon{width:36px;height:36px}.profile-wallet .wallet-balance strong{font-size:25px}.compact-profile .panel-heading h1{font-size:30px}.settings-dialog{padding:18px 20px}.home-utility{gap:18px}}

/* Hand-painted regional cartography and twelve individual trophy designs. */
.level-grid.adventure-map{background:linear-gradient(#130b1912,#130b1922),var(--map-scene) center/cover no-repeat;border-radius:5px;box-shadow:inset 0 0 0 1px #b89a6c55}.map-route{stroke:#e9d09b;stroke-dasharray:3 5;stroke-width:2.5}.map-route .map-route-shadow{stroke:#241429b0;stroke-width:8;stroke-dasharray:none}.adventure-map .level-number{width:48px;height:48px;font-size:21px;background:#3c2746;border-color:#d4b57c;box-shadow:0 4px 8px #100616aa}.adventure-map .locked .level-number{background:#362e37e8;border-color:#a3957a;color:#e0d4b9}.adventure-map .level-node{transform:translate(-50%,-25px)}.adventure-map .level-node-name{background:#1e1526db;color:#f2e5d2;font-size:10px}.adventure-map .boss-level .level-number{width:62px;height:62px}.adventure-map .next-level .level-number{background:#65436a;border-color:#ffe4ac;box-shadow:0 3px 10px #160a1ca0,0 0 0 3px #b9965555}.trophy-art{display:block;width:96px;height:96px;background-image:url('/assets/trophy-atlas.webp');background-size:400% 300%;background-repeat:no-repeat;opacity:.35}.trophy.unlocked .trophy-art{opacity:1}.trophy-shelf{gap:18px 8px}.trophy strong{font-size:16px}.trophy span:not(.trophy-art){font-size:10px}
@media(max-width:600px){.trophy-art{width:84px;height:84px}.trophy-shelf{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px 6px}.adventure-map .level-number{width:46px;height:46px}.adventure-map .boss-level .level-number{width:58px;height:58px}}

.sound-switch input{appearance:none;-webkit-appearance:none;position:relative;width:40px;height:24px;border:1px solid #9e77b1;border-radius:14px;background:#392449;cursor:pointer}.sound-switch input:before{content:'';position:absolute;width:16px;height:16px;left:3px;top:3px;background:#e2c8ee;border-radius:50%;transition:transform .12s ease-out}.sound-switch input:checked{background:#8855aa}.sound-switch input:checked:before{transform:translateX(16px);background:#ffe4b5}


/* reign.css */
/* Silver filigree, illustrated realms and a character-led home. Gem artwork is unchanged. */
:root{--reign-silver:#d2b3eb;--reign-line:#865fa6;--reign-gold:#f2ce8c}::selection{background:#79549a;color:#fff}input,textarea{caret-color:#efc9ff}*{scrollbar-color:#76558e #1a1027;scrollbar-width:thin}button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid #ffe0a2;outline-offset:3px}button:disabled{cursor:default}header{border-bottom:1px solid #75508f;background:#130c22e8}.bottom-nav{background:linear-gradient(#231432,#100b1b);border:1px solid #88629c;border-radius:24px 24px 10px 10px;box-shadow:0 -7px 22px #08031180}.bottom-nav button{position:relative;color:#d6bfeb}.bottom-nav button.active{background:radial-gradient(ellipse at bottom,#7139a577,transparent 72%);color:#fff0ff}.bottom-nav button.active:after{content:'';position:absolute;bottom:2px;left:25%;right:25%;height:2px;background:#d298ff}.bottom-nav svg{color:#c898eb;filter:drop-shadow(0 2px 3px #09020c)}.bottom-nav button.active svg{color:#ebc7ff}.panel-screen{background:linear-gradient(#1b102cde,#120b21ed);border-color:#72518b}.panel-heading h1,.ornate-heading{font-family:'Golos Text',Georgia,serif;color:#f5e5ff}.ornate-heading{position:relative;text-align:center;font-size:32px;line-height:1.2;font-weight:600;margin:25px 0 16px;padding:12px 22px;border:18px solid transparent;border-image:url('/assets/gothic-panel-frame.webp') 130 130 130 130 / 25px / 0 stretch;background:#1a0e2cbf;background-clip:padding-box}.panel-heading h1{margin-top:0}.home-screen{width:100%;max-width:1100px;border-radius:4px}.home-art{width:65%;object-position:center 30%;height:100%}.home-screen:before{background:linear-gradient(90deg,#130b2000 22%,#130b2055 52%,#130b20 70%)}.home-player{position:absolute;top:18px;left:22px;display:grid;grid-template-columns:48px minmax(0,120px);gap:2px 10px;align-items:center;text-align:left;background:#170e26c9;border:0;padding:6px 12px 6px 6px;border-radius:30px;color:#f4e1ff;max-width:230px}.home-player img{grid-row:1/3;width:48px;height:48px;object-fit:cover;object-position:50% 22%;border-radius:50%;border:2px solid #c69cd9}.home-player span{font:600 20px 'Golos Text',Georgia,serif;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.home-player small{font-size:11px;color:#d6b5ef}.home-content{left:57%;right:3%;bottom:7%;gap:12px}.home-title{position:static;text-align:center;margin:0 0 14px}.home-title h1{font-size:clamp(42px,5vw,68px);text-transform:uppercase;letter-spacing:-.035em;color:#f4dcff;text-shadow:0 3px 5px #0c0617,0 1px 0 #fff}.home-title p{font-size:18px;margin:5px 0;color:#ddbee9}.play-cta{position:relative;min-height:84px;border:18px solid transparent;border-image:url('/assets/gothic-panel-frame.webp') 130 / 28px / 0 stretch;border-radius:0;background:radial-gradient(ellipse at bottom,#9f46d8,#3b155c 85%);background-clip:padding-box;padding:4px 18px;box-shadow:0 9px 24px #080312a0;grid-template-columns:24px 1fr}.play-cta>span{font-size:34px}.play-cta small{color:#f4dfff;font-size:11px}.play-cta:hover{filter:brightness(1.14)}.home-map-link{font-size:12px;padding:5px;color:#eed0a6}.home-shortcuts{position:absolute;top:115px;display:flex;flex-direction:column;gap:23px}.home-shortcuts.left{left:16px}.home-shortcuts.right{right:45%}.home-shortcuts button{position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;background:transparent;border:0;color:#faeaff;font:600 16px/1.1 'Golos Text',Georgia,serif;width:78px;text-shadow:0 2px 3px #0b0314;padding:0}.home-shortcuts button>svg{width:52px;height:52px;padding:12px;border-radius:50%;border:2px solid #a67dc0;background:radial-gradient(circle at 40% 20%,#56346e,#1a1029 80%);color:#e1b6ff;box-shadow:0 4px 9px #08020da6}.home-shortcuts button:hover>svg{border-color:#f2d6ff}.home-shortcuts i{position:absolute;top:0;right:10px;width:9px;height:9px;background:#edb85b;border-radius:50%;border:1px solid #3a1422}.home-chapters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:10px}.realm-card{position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:end;min-height:160px;border:1px solid #9774ba;border-radius:14px 14px 7px 7px;padding:24px 3px 10px;background:#1a0c29;color:#fbe9ff;box-shadow:0 5px 8px #08031180}.realm-card:after{content:'';position:absolute;inset:3px;border:1px solid #d2b4ed66;border-radius:10px 10px 4px 4px;pointer-events:none}.realm-card img{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover}.realm-card:before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(transparent 10%,#12091bd9 67%,#130a20)}.realm-card strong{font:600 18px/1.05 'Golos Text',Georgia,serif;min-height:40px;text-wrap:balance;text-shadow:0 2px 3px #08030e}.realm-number{position:absolute;top:4px;background:#190e2ee6;padding:0 12px;border-bottom:1px solid currentColor;font:600 21px 'Golos Text',Georgia,serif}.realm-progress{display:flex;align-items:center;gap:2px;font-size:12px;color:#f0d49e;margin-top:8px}.realm-progress svg{width:17px;height:17px}.realm-0{border-color:#cb806e}.realm-1{border-color:#82b6eb}.realm-3{border-color:#caa479}.realm-card:hover{filter:brightness(1.15)}
/* Portrait and meaningful progress, with earned trophy art and actual chapter guardians. */
.compact-profile{max-width:760px}.compact-profile>.ornate-heading:first-child{margin-top:0}.profile-identity{display:grid;grid-template-columns:112px minmax(0,1fr);align-items:center;gap:18px;padding:12px 0 18px;background:linear-gradient(90deg,transparent,#46316926)}.profile-portrait{width:112px;height:136px;object-fit:cover;object-position:50% 22%;border-radius:55% 55% 45% 45%;border:3px double #c49be1;box-shadow:0 6px 15px #0a0316a0}.profile-identity h2{font:600 34px/1.1 'Golos Text',Georgia,serif;margin:0;overflow-wrap:anywhere;color:#f4e5ff}.profile-identity p{font-size:11px;color:#cbb1df;margin:5px 0 12px}.profile-identity strong{font-weight:500;font-size:13px}.profile-identity progress{display:block;width:100%;height:10px;margin:10px 0;accent-color:#c881f4}.profile-identity #profile-code{font-size:11px;color:#d5bcdf}.profile-identity progress::-webkit-progress-bar,.profile-award progress::-webkit-progress-bar{background:#362043;border-radius:5px}.profile-identity progress::-webkit-progress-value,.profile-award progress::-webkit-progress-value{background:linear-gradient(#d080ff,#8727cf);border-radius:5px}.compact-profile .profile-summary{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.compact-profile .profile-summary>div{background:linear-gradient(#35213c88,#21132e);border:1px solid #634479;border-radius:8px;padding:18px 2px}.compact-profile .profile-summary strong{font-size:25px;color:#f6d4a0}.compact-profile .profile-summary span{font-size:11px;color:#e3cfee}.profile-achievements{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.profile-award{background:linear-gradient(#29163088,#180e27);border:1px solid #6e487e;border-radius:10px;padding:8px 5px;color:#e6d3f2;display:flex;flex-direction:column;align-items:center;min-width:0}.profile-award .trophy-art{width:88px;height:88px;max-width:100%;opacity:.55}.profile-award.earned .trophy-art{opacity:1}.profile-award strong{font:600 18px/1.05 'Golos Text',Georgia,serif;min-height:38px}.profile-award progress{width:100%;height:6px;margin:10px 0 6px}.profile-award small{font-size:10px;color:#d9bce8}.profile-guardians{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:20px}.guardian{position:relative;isolation:isolate;overflow:hidden;aspect-ratio:.7;display:flex;flex-direction:column;justify-content:end;align-items:center;gap:4px;border:1px solid #8c659c;border-radius:12px 12px 5px 5px;background:#1b1027;padding:10px 3px;color:#f1dfff}.guardian img{position:absolute;inset:0;z-index:-2;width:100%;height:100%;object-fit:cover}.guardian:before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(transparent 40%,#180b27ef 90%)}.guardian span{font:600 18px 'Golos Text',Georgia,serif}.guardian small{font-size:10px;color:#dfb9ee}.guardian.defeated{border-color:#ebc37f}.guardian.defeated small{color:#f5d49e}.profile-wallet{border:0!important;background:none!important}.profile-wallet .wallet-balance{background:none;border:0;box-shadow:none}
/* Battle panels echo the reference while keeping every pixel of gem artwork. */
.scene-banner{position:relative;isolation:isolate;background:linear-gradient(105deg,#35132ed9,#170d2bda);border-block:1px solid #8c5799;border-radius:7px}.scene-banner.has-boss:before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(90deg,#1b0b1cf5 5%,#1b0b1caa 45%,#1b0b1c22),var(--boss-art) 80% 25%/cover}.scene-banner.has-boss .chapter-seal{border-color:#e69a77}.scene-banner h1{color:#f4d6ee}.stats{border:1px solid #80578f;border-radius:10px;background:linear-gradient(#2a1638dd,#140b23dd);margin:0 3px}.stats .moves{background:linear-gradient(#462350,#21112e);border-inline:1px solid #8d5ca4}.board-wrap{border-color:#a479be;box-shadow:0 6px 22px #090414ad}.controls .secondary{border-color:#8b669f;background:linear-gradient(#392044,#20132e);color:#eddbf7}.goal-track{background:#381a3c}.goal-track i{background:linear-gradient(90deg,#a72dd2,#ed9aff)}body[data-realm="0"] .goal-track i{background:linear-gradient(90deg,#b72c48,#ff9775)}.wheel-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:20px auto;max-width:470px}.wheel-tabs button{display:flex;flex-direction:column;gap:5px;align-items:center;min-height:64px;border:1px solid #72558e;border-radius:10px;background:#21132f;color:#dbc5e9;padding:10px 3px}.wheel-tabs button[aria-pressed=true]{background:linear-gradient(#59316d,#321b46);border-color:#d0a1e4;color:#fff0ff}.wheel-tabs strong{font:600 21px 'Golos Text',Georgia,serif}.wheel-tabs span{font-size:11px}.fortune-screen[data-wheel=gold] .fortune-wheel{border-color:#f3ce85;background:conic-gradient(#6e4422 0deg 45deg,#3b294a 45deg 90deg,#6e4422 90deg 135deg,#3b294a 135deg 180deg,#6e4422 180deg 225deg,#3b294a 225deg 270deg,#6e4422 270deg 315deg,#3b294a 315deg)}.fortune-screen[data-wheel=crystals] .fortune-wheel{border-color:#c998f5;background:conic-gradient(#613078 0deg 45deg,#29234e 45deg 90deg,#613078 90deg 135deg,#29234e 135deg 180deg,#613078 180deg 225deg,#29234e 225deg 270deg,#613078 270deg 315deg,#29234e 315deg)}.event-list article{padding:20px 0;border-bottom:1px solid #79558c}.event-list time,.event-list small{color:#d1b4e0;font-size:12px}.event-list h2{font:600 30px 'Golos Text',Georgia,serif;color:#f1d3a2;margin:8px 0}.event-list p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;color:#e7d5f0;font-size:14px}
@media(max-width:600px){header{background:#140d22}.home-art{width:100%;object-fit:cover;object-position:50% 27%}.home-screen:before{background:linear-gradient(180deg,transparent 25%,#160c2511 43%,#160c25bf 68%,#160c25 98%)}.home-player{top:6px;left:8px;padding:3px 9px 3px 3px;grid-template-columns:36px minmax(0,110px);gap:0 7px}.home-player img{width:36px;height:36px}.home-player span{font-size:17px}.home-player small{font-size:10px}.home-shortcuts{top:74px;gap:16px}.home-shortcuts.left{left:7px}.home-shortcuts.right{right:7px}.home-shortcuts button{width:65px;font-size:14px}.home-shortcuts button>svg{height:45px;width:45px;padding:10px}.home-content{left:4%;right:4%;bottom:2%;gap:6px}.home-title{margin:0 0 3px}.home-title h1{font-size:clamp(40px,12vw,57px)}.home-title p{font-size:15px;margin:1px 0 0}.play-cta{min-height:72px;padding:0 12px;border-width:14px;border-image-width:24px}.play-cta>span{font-size:30px}.play-cta small{font-size:10px}.home-chapters{margin-top:7px;gap:5px}.realm-card{min-height:128px;padding:20px 3px 9px;border-radius:12px 12px 5px 5px}.realm-card strong{font-size:16px;min-height:35px}.realm-number{font-size:18px}.realm-progress{font-size:10px;margin-top:5px}.realm-progress svg{width:14px;height:14px}.home-map-link{font-size:10px;padding:4px 0;min-height:30px}.home-map-link svg{width:15px;height:15px}.bottom-nav{border-radius:20px 20px 0 0}.compact-profile{width:calc(100% - 8px);padding:12px 10px}.ornate-heading{font-size:29px;padding:6px 10px;border-width:12px}.compact-profile>.ornate-heading{margin:18px 0 12px;font-size:28px}.profile-identity{grid-template-columns:86px minmax(0,1fr);gap:12px;padding:8px 0 14px}.profile-portrait{width:86px;height:112px}.profile-identity h2{font-size:29px}.profile-identity strong{font-size:11px}.profile-identity p{margin-bottom:7px}.profile-identity #profile-code{font-size:10px}.profile-achievements{gap:5px}.profile-award{padding:5px 3px}.profile-award .trophy-art{width:68px;height:68px}.profile-award strong{font-size:15px;min-height:34px}.profile-award small{font-size:9px}.profile-guardians{gap:5px}.guardian span{font-size:15px}.guardian small{font-size:9px}.guardian{padding:6px 2px}.compact-profile .profile-summary strong{font-size:21px}.compact-profile .profile-summary span{font-size:10px}.board-wrap{border-width:2px}.wheel-tabs strong{font-size:19px}.wheel-tabs span{font-size:10px}}
@media(max-height:700px) and (max-width:600px){.home-content{bottom:1%;gap:3px}.home-title h1{font-size:38px}.home-title p{display:none}.home-shortcuts{top:63px;gap:12px}.home-shortcuts button>svg{width:39px;height:39px;padding:8px}.home-shortcuts button{font-size:12px;gap:3px}.realm-card{min-height:105px}.realm-card strong{font-size:14px;min-height:29px}.play-cta{min-height:62px}.home-chapters{margin-top:3px}.home-map-link{min-height:24px;padding:1px}.home-art{object-position:50% 25%}}
@media(max-height:560px) and (max-width:600px){.home-shortcuts{top:51px;gap:8px}.home-shortcuts button{font-size:11px;width:55px}.home-shortcuts button>svg{width:33px;height:33px;padding:7px}.home-title h1{font-size:30px}.home-title{margin:0}.home-content{left:3%;right:3%;gap:2px}.play-cta{min-height:55px;border-width:10px;border-image-width:20px}.play-cta>span{font-size:25px}.play-cta small{font-size:9px}.realm-card{min-height:85px;padding-bottom:6px}.realm-card strong{font-size:13px;min-height:26px}.realm-number{font-size:15px}.realm-progress{margin-top:3px}.home-map-link{display:none}.home-player{top:3px}.home-art{object-position:center 22%}}
@media(min-width:601px) and (max-height:560px){.home-content{left:55%;right:2%;bottom:3%;gap:4px}.home-title{margin:0}.home-title h1{font-size:34px}.home-title p{display:none}.home-shortcuts{top:25px;gap:16px}.home-shortcuts.left{left:15px}.home-shortcuts.right{right:47%}.home-shortcuts button{width:60px;font-size:12px}.home-shortcuts button>svg{width:36px;height:36px;padding:8px}.home-player{display:none}.play-cta{min-height:56px;border-width:10px}.play-cta>span{font-size:25px}.home-chapters{margin-top:3px}.realm-card{min-height:100px}.realm-card strong{font-size:14px}.home-map-link{padding:0}.home-art{object-position:center 27%}}
@media(prefers-reduced-motion:no-preference){.home-content{animation:reign-arrive .65s cubic-bezier(.16,1,.3,1) both}@keyframes reign-arrive{from{transform:translateY(12px);filter:brightness(.85)}to{transform:translateY(0);filter:brightness(1)}}}


/* royal-home.css */
/* Reference composition: illustrated HUD, sculpted icons, logo and jewel button. */
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.royal-icon{display:block;flex:none;background-image:url('/assets/royal-menu-icons.webp');background-size:400% 300%;background-repeat:no-repeat;width:52px;height:52px;filter:drop-shadow(0 3px 4px #08030bc0)}
.royal-icon-0{background-position:0 0}.royal-icon-1{background-position:33.333333% 0}.royal-icon-2{background-position:66.666667% 0}.royal-icon-3{background-position:100% 0}.royal-icon-4{background-position:0 50%}.royal-icon-5{background-position:33.333333% 50%}.royal-icon-6{background-position:66.666667% 50%}.royal-icon-7{background-position:100% 50%}.royal-icon-8{background-position:0 100%}.royal-icon-9{background-position:33.333333% 100%}.royal-icon-10{background-position:66.666667% 100%}.royal-icon-11{background-position:100% 100%}
.royal-account,.home-stars{display:none}body[data-tab=home]{grid-template-rows:68px minmax(0,1fr) 96px;background:#0c0818}body[data-tab=home]>header{position:relative;z-index:2;width:min(100%,600px);max-width:600px;height:68px;margin:auto;padding:0 10px;background:linear-gradient(#100b20ec,#1c112dc0);border:0;gap:4px}body[data-tab=home] .brand,body[data-tab=home] #sound-toggle,body[data-tab=home] #fullscreen{display:none}body[data-tab=home] .header-actions{gap:13px;flex:1;justify-content:flex-end}body[data-tab=home] .royal-account{display:grid;grid-template-columns:54px 1fr;grid-template-rows:1fr 13px;gap:1px 7px;align-items:center;text-align:left;min-width:125px;max-width:175px;padding:0 0 5px;border:0;background:none;color:#f5e8ff;font:600 23px/1 'Golos Text',Georgia,serif;border-radius:0}body[data-tab=home] .royal-account img{grid-row:1/3;width:54px;height:62px;object-fit:cover;border:2px solid #c7a5d8;border-radius:50%;box-shadow:0 3px 8px #06020aa6}body[data-tab=home] .royal-account progress{width:100%;height:8px;border:1px solid #c09bd1;overflow:hidden;border-radius:6px;background:#1d102f}body[data-tab=home] .royal-account progress::-webkit-progress-bar{background:#211032}body[data-tab=home] .royal-account progress::-webkit-progress-value{background:linear-gradient(#d882ff,#7e12c3)}body[data-tab=home] .royal-account progress::-moz-progress-bar{background:#a840e6}body[data-tab=home] .home-stars{display:flex;align-items:center;gap:2px;background:none;border:0;color:#f7deac;font:600 18px/1 'Golos Text',Georgia,serif;padding:0}body[data-tab=home] .home-stars .royal-icon{width:34px;height:38px}body[data-tab=home] .header-actions .essence{font:600 21px/1 'Golos Text',Georgia,serif;max-width:100px;gap:2px}body[data-tab=home] .header-actions .essence .currency-icon{width:32px;height:37px}
body[data-tab=home] main{padding:0;min-height:0}.home-screen{container-type:size;width:min(100%,600px);max-width:600px;height:100%;border-radius:0;margin:auto;overflow:hidden}.home-art{inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 35%;z-index:-2}.home-screen:before{background:linear-gradient(180deg,#0d071b00 45%,#0e08210a 70%,#0c081855 100%)}.home-shortcuts{top:9%;gap:clamp(9px,2.3cqh,23px);z-index:3}.home-shortcuts.left{left:1%}.home-shortcuts.right{right:1%}.home-shortcuts button{width:84px;min-height:72px;padding:0;font:600 20px/1.02 'Golos Text',Georgia,serif;gap:0;text-shadow:0 2px 4px #08020f,1px 0 2px #08020f,-1px 0 2px #08020f;color:#f9ebff;background:none;border:0}.home-shortcuts .royal-icon{width:68px;height:68px}.home-shortcuts button:hover .royal-icon{filter:brightness(1.16) drop-shadow(0 3px 4px #08030bb0)}.home-shortcuts i{right:13px;top:3px;width:11px;height:11px;background:#ec4b53;border:1px solid #f2b2a2;border-radius:50%}.home-shortcuts button>span:last-of-type{max-width:100%;text-wrap:balance}
.home-content{left:1%;right:1%;top:44%;bottom:7%;display:grid;grid-template-rows:minmax(0,1.04fr) minmax(0,.62fr) minmax(0,1.18fr);gap:1.5cqh;align-items:stretch;text-align:center;animation:none}.home-title{position:relative;margin:0;padding:0;min-height:0;line-height:0;display:flex;align-items:center;justify-content:center}.royal-logo{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 4px 5px #090310b0)}.royal-play{display:block;justify-self:center;width:91%;height:100%;min-height:0;padding:0;background:none;border:0;box-shadow:none;border-radius:24px;line-height:0;transition:filter .15s ease,transform .15s ease}.royal-play img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}.royal-play:hover{filter:brightness(1.15)}.royal-play:active{transform:scale(.975)}.royal-play:disabled{filter:saturate(.5);opacity:.6}
.home-chapters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px;margin:0;padding:0 2px;min-height:0}.realm-card{position:relative;isolation:isolate;min-height:0;height:100%;border:0;border-radius:0;box-shadow:none;overflow:visible;background:none;padding:18% 9% 13%;display:flex;align-items:center;justify-content:flex-end}.realm-card img{inset:7% 9%;width:82%;height:85%;object-fit:cover;object-position:center;border-radius:8px;z-index:-2}.realm-card:before{inset:7% 9% 9%;background:linear-gradient(transparent 15%,#10081920 30%,#100819ec 68%,#100819);z-index:-1;border-radius:8px}.realm-card:after{display:none}.realm-frame{position:absolute;inset:0;z-index:2;pointer-events:none;background-image:url('/assets/royal-chapter-frames.webp');background-size:400% 100%;background-repeat:no-repeat}.realm-0 .realm-frame{background-position:0 0}.realm-1 .realm-frame{background-position:33.333333% 0}.realm-2 .realm-frame{background-position:66.666667% 0}.realm-3 .realm-frame{background-position:100% 0}.realm-number{z-index:3;top:4%;padding:0 8px;background:#160b24c9;border:0;font:600 clamp(18px,5cqw,27px)/1 'Golos Text',Georgia,serif;color:#f6dbff}.realm-card strong{font:600 clamp(13px,4.2cqw,22px)/.98 'Golos Text',Georgia,serif;min-height:0;color:#fff0ff;text-shadow:0 2px 3px #08020d;overflow-wrap:normal}.realm-progress{margin-top:8px;font:600 17px/1 'Golos Text',Georgia,serif;color:#f4db9c;min-height:18px}.realm-progress svg{width:18px;height:18px}.realm-card:hover{filter:brightness(1.14)}
.bottom-nav{align-items:stretch;padding:2px 6px 4px;background:linear-gradient(105deg,#211332,#100b1dd9 45%,#251337);border:2px solid #a47fb4;border-radius:32px 32px 12px 12px;box-shadow:inset 0 1px 0 #e8c0f055,0 -3px 14px #09011188}.bottom-nav button{font:600 15px/1 'Golos Text',Georgia,serif;min-height:0;gap:0;padding:0 2px 3px;justify-content:center;border-radius:22px;color:#f1defb}.bottom-nav .royal-icon{width:45px;height:39px}.bottom-nav button.active{background:radial-gradient(ellipse at 50% 80%,#7b2fc477,#35104722 65%,transparent)}.bottom-nav button.active:after{left:16%;right:16%;bottom:0;height:2px;background:#dfa0ff;box-shadow:0 -2px 6px #d78aff77}.bottom-nav button.active .royal-icon{filter:brightness(1.15) drop-shadow(0 3px 5px #6c18c677)}body[data-tab=home] .bottom-nav{width:min(100%,600px);max-width:600px;height:94px;margin:auto;z-index:4}body[data-tab=home] .bottom-nav .royal-icon{width:65px;height:62px}body[data-tab=home] .bottom-nav button{font-size:20px}
@media(max-width:600px){body[data-tab=home]{grid-template-rows:62px minmax(0,1fr) 83px}body[data-tab=home]>header{height:62px;padding:0 6px}.home-shortcuts button{width:72px;min-height:62px;font-size:17px}.home-shortcuts .royal-icon{width:57px;height:57px}.home-content{top:43%;bottom:7%;gap:1.3cqh}.home-shortcuts{top:7%;gap:2.2cqh}.realm-card{padding:18% 8% 13%}.realm-progress{font-size:15px;margin-top:6px}.realm-progress svg{width:17px;height:17px}body[data-tab=home] .royal-account{min-width:112px;max-width:140px;grid-template-columns:45px minmax(45px,1fr);font-size:20px;gap:1px 6px}body[data-tab=home] .royal-account img{width:45px;height:53px}body[data-tab=home] .header-actions{gap:5px}body[data-tab=home] .header-actions .essence{font-size:19px;min-width:35px;max-width:80px}body[data-tab=home] .header-actions .essence .currency-icon{width:27px;height:32px}body[data-tab=home] .home-stars{font-size:19px}body[data-tab=home] .home-stars .royal-icon{width:31px;height:34px}body[data-tab=home] .bottom-nav{height:81px;border-radius:30px 30px 0 0;padding:0 4px 4px}body[data-tab=home] .bottom-nav .royal-icon{height:53px;width:55px}body[data-tab=home] .bottom-nav button{font-size:17px}.bottom-nav{height:56px;border-radius:24px 24px 0 0;padding:0 3px 2px}.bottom-nav button{font-size:12px}.bottom-nav .royal-icon{height:34px;width:38px}}
@media(max-width:360px){body[data-tab=home] .header-actions{gap:2px}body[data-tab=home] .royal-account{min-width:100px;max-width:111px;font-size:18px;grid-template-columns:40px 1fr}body[data-tab=home] .royal-account img{width:40px;height:48px}body[data-tab=home] .header-actions .essence,body[data-tab=home] .home-stars{font-size:16px}body[data-tab=home] .header-actions .essence .currency-icon{width:23px;height:28px}.home-shortcuts button{width:61px;font-size:15px;min-height:56px}.home-shortcuts .royal-icon{width:48px;height:48px}.realm-card strong{font-size:14px}.realm-progress{font-size:13px;margin-top:4px}.realm-number{font-size:19px}body[data-tab=home] .bottom-nav button{font-size:15px}}
@media(max-height:650px) and (max-width:600px){body[data-tab=home]{grid-template-rows:52px minmax(0,1fr) 66px}body[data-tab=home]>header{height:52px}.home-content{top:42%;bottom:3%;gap:.5cqh}.home-shortcuts{top:5%;gap:1cqh}.home-shortcuts button{min-height:45px;font-size:13px;width:61px}.home-shortcuts .royal-icon{width:41px;height:41px}.home-shortcuts.left{left:1%}.home-shortcuts.right{right:1%}.realm-progress{font-size:12px;min-height:13px;margin-top:3px}.realm-progress svg{width:14px;height:14px}.realm-card strong{font-size:13px;line-height:1}.realm-number{font-size:17px}body[data-tab=home] .royal-account{grid-template-columns:36px 1fr;font-size:17px;min-width:100px}body[data-tab=home] .royal-account img{height:43px;width:36px}body[data-tab=home] .bottom-nav{height:64px}body[data-tab=home] .bottom-nav .royal-icon{width:44px;height:42px}body[data-tab=home] .bottom-nav button{font-size:14px}}
@media(max-height:500px) and (min-width:601px){body[data-tab=home]{grid-template-rows:44px minmax(0,1fr) 56px}body[data-tab=home]>header{height:44px;width:100%;max-width:900px}body[data-tab=home] .royal-account{grid-template-columns:30px 1fr;min-width:110px;font-size:16px}body[data-tab=home] .royal-account img{width:30px;height:36px}.home-screen{width:100%;max-width:900px}.home-art{object-position:50% 24%}.home-content{left:45%;right:2%;top:1%;bottom:3%;gap:1%;grid-template-rows:.7fr .6fr 1.15fr}.home-shortcuts{top:8%;gap:9px}.home-shortcuts.left{left:1%}.home-shortcuts.right{right:57%}.home-shortcuts button{font-size:12px;min-height:42px;width:64px}.home-shortcuts .royal-icon{width:37px;height:37px}.realm-card strong{font-size:14px}.realm-progress{font-size:12px;min-height:12px;margin-top:3px}.realm-number{font-size:16px}body[data-tab=home] .bottom-nav{width:100%;max-width:690px;height:54px}body[data-tab=home] .bottom-nav .royal-icon{width:36px;height:32px}body[data-tab=home] .bottom-nav button{font-size:13px}}
@media(prefers-reduced-motion:reduce){.royal-play{transition:none}}
/* Keep old home offsets out of the new composition; lift text above the carved rails. */
.home-title{inset:auto;min-width:0;width:100%}.home-art{object-position:50% 0}.home-content{top:41%;bottom:6%;grid-template-rows:minmax(0,1fr) minmax(0,.85fr) minmax(0,1.18fr)}.royal-play{width:83%;border-radius:0}.royal-play:focus-visible{outline-offset:3px;outline:2px solid #f3d59a}.realm-card{padding-bottom:24%}.realm-card strong,.realm-progress{position:relative;z-index:3}.realm-card strong{font-size:clamp(13px,3.7cqw,34px);line-height:1.04}.realm-progress{flex-shrink:0}.home-screen,body[data-tab=home]>header,body[data-tab=home] .bottom-nav{width:min(100%,calc(100dvh * .6));max-width:1000px}.home-shortcuts button{width:clamp(72px,19cqw,150px);font-size:clamp(17px,4.4cqw,36px)}.home-shortcuts .royal-icon{width:clamp(57px,15cqw,120px);height:clamp(57px,15cqw,120px)}
@media(max-width:600px){.home-screen,body[data-tab=home]>header,body[data-tab=home] .bottom-nav{width:100%}.realm-card strong{font-size:14px}.home-shortcuts button{width:72px;font-size:17px}.home-shortcuts .royal-icon{width:57px;height:57px}}
@media(max-width:360px){.home-shortcuts button{width:61px;font-size:15px}.home-shortcuts .royal-icon{width:48px;height:48px}.realm-card strong{font-size:12px}}
@media(max-height:650px) and (max-width:600px){.home-content{top:42%;bottom:3%;grid-template-rows:minmax(0,1fr) minmax(0,.85fr) minmax(0,1.35fr)}.realm-card{padding:10% 8% 17%}.realm-card strong{font-size:12px}.realm-progress{font-size:11px;margin-top:2px;min-height:12px}.realm-progress svg{width:12px;height:12px}.home-shortcuts button{font-size:13px;width:61px;min-height:45px}.home-shortcuts .royal-icon{width:41px;height:41px}.home-shortcuts{gap:1cqh}}
@media(min-width:601px) and (min-height:800px) and (orientation:portrait){body[data-tab=home]{grid-template-rows:94px minmax(0,1fr) 132px}body[data-tab=home]>header{height:94px;padding:0 14px}body[data-tab=home] .royal-account{font-size:32px;grid-template-columns:78px 1fr;max-width:245px;min-width:220px}body[data-tab=home] .royal-account img{width:78px;height:86px}body[data-tab=home] .header-actions .essence,body[data-tab=home] .home-stars{font-size:30px;max-width:180px}body[data-tab=home] .header-actions .essence .currency-icon{width:44px;height:50px}body[data-tab=home] .home-stars .royal-icon{width:48px;height:50px}body[data-tab=home] .header-actions{gap:24px}body[data-tab=home] .bottom-nav{height:130px}body[data-tab=home] .bottom-nav .royal-icon{width:88px;height:90px}body[data-tab=home] .bottom-nav button{font-size:27px}.realm-number{font-size:36px}.realm-progress{font-size:28px;margin-top:12px}.realm-progress svg{height:28px;width:28px}}
@media(max-height:500px) and (min-width:601px){.home-screen,body[data-tab=home]>header,body[data-tab=home] .bottom-nav{width:100%}.home-content{top:1%;bottom:3%;grid-template-rows:.7fr .7fr 1.2fr}.home-shortcuts button{font-size:12px;min-height:42px;width:64px}.home-shortcuts .royal-icon{width:37px;height:37px}.realm-card{padding:12% 8% 17%}.realm-card strong{font-size:12px}.realm-progress{font-size:10px;margin-top:2px;min-height:11px}.realm-progress svg{width:11px;height:11px}}
/* Review corrections: focus follows the jewel silhouette and navigation uses real carved metal. */
.royal-play:focus-visible{outline:none;filter:drop-shadow(0 0 2px #fff4cf) drop-shadow(0 0 5px #f3ce7d)}
.bottom-nav{position:relative;isolation:isolate;border:0;box-shadow:none;background:linear-gradient(105deg,#211332,#100b1ded 45%,#251337)}.bottom-nav:before{content:'';position:absolute;inset:0;pointer-events:none;background:url('/assets/royal-nav-frame.webp') center/100% 100% no-repeat;z-index:2}.bottom-nav button{z-index:1;padding-bottom:10px}.bottom-nav button.active:after{display:none}.bottom-nav button.active .royal-icon{transform:translateY(-2px) scale(1.08);filter:brightness(1.2) drop-shadow(0 1px 5px #ce85ff)}body[data-tab=home] .bottom-nav button{padding-bottom:10px}
@media(max-width:600px){body[data-tab=home] .bottom-nav .royal-icon{height:49px;width:55px}.bottom-nav .royal-icon{height:30px;width:35px}}
@media(max-height:650px) and (max-width:600px){body[data-tab=home] .bottom-nav .royal-icon{height:38px;width:42px}body[data-tab=home] .bottom-nav button{font-size:13px;padding-bottom:9px}}
@media(max-height:500px) and (min-width:601px){.home-art{width:46%;object-position:50% 15%}.home-screen:before{background:linear-gradient(90deg,transparent 28%,#0c0818d9 45%,#0c0818 60%)}body[data-tab=home] .bottom-nav .royal-icon{height:29px;width:34px}body[data-tab=home] .bottom-nav button{padding-bottom:7px}}
/* Nine-sliced perimeter preserves corner proportions and a clear icon/text interior. */
.bottom-nav,.bottom-nav:before{box-sizing:border-box}.bottom-nav,body[data-tab=home] .bottom-nav{padding:9px 22px 10px}.bottom-nav:before{background:none;border:14px solid transparent;border-image:url('/assets/royal-nav-frame.webp') 110 190 110 190 / 14px 20px / 0 stretch;z-index:0}.bottom-nav button,body[data-tab=home] .bottom-nav button{padding:0;flex-direction:column;gap:0;justify-content:center;min-width:0}.bottom-nav button{font-size:12px}.bottom-nav .royal-icon{width:32px;height:26px}body[data-tab=home] .bottom-nav .royal-icon{width:56px;height:50px}body[data-tab=home] .bottom-nav button{font-size:18px}
@media(max-width:600px){body[data-tab=home] .bottom-nav .royal-icon{width:50px;height:45px}body[data-tab=home] .bottom-nav button{font-size:16px}.bottom-nav button{font-size:11px}.bottom-nav .royal-icon{height:25px;width:30px}}
@media(max-width:360px){.bottom-nav,body[data-tab=home] .bottom-nav{padding-left:17px;padding-right:17px}body[data-tab=home] .bottom-nav button{font-size:14px}}
@media(max-height:650px) and (max-width:600px){body[data-tab=home] .bottom-nav .royal-icon{width:36px;height:29px}body[data-tab=home] .bottom-nav button{font-size:12px}}
@media(min-width:601px) and (min-height:800px) and (orientation:portrait){body[data-tab=home] .bottom-nav .royal-icon{width:84px;height:80px}body[data-tab=home] .bottom-nav button{font-size:24px}}
@media(max-height:500px) and (min-width:601px){body[data-tab=home] .bottom-nav .royal-icon{width:27px;height:20px}body[data-tab=home] .bottom-nav button{font-size:11px}}


/* royal-world.css */
/* One royal shell: geometry depends on the viewport, never the selected tab. */
:root{--font-body:'Golos Text',Georgia,serif;--font-display:'Golos Text',Georgia,serif;--shell-width:min(100%,calc(100dvh * .6));--header-height:68px;--nav-height:94px;--nav-icon-width:56px;--nav-icon-height:50px;--nav-type:16px;--ease-out:cubic-bezier(.23,1,.32,1);--ink:#f6eafa;--muted:#d6bedf;--gold:#efcf98}
body[data-tab]{grid-template-rows:var(--header-height) minmax(0,1fr) var(--nav-height);font-family:var(--font-body);background-color:#10091b}
body[data-tab]>header{width:var(--shell-width);max-width:1000px;height:var(--header-height);padding:0 8px;background:linear-gradient(#10091be6,#180d26c9);margin:auto}
body[data-tab] main{padding:0;min-height:0}
body[data-tab] .bottom-nav{width:var(--shell-width);max-width:1000px;height:var(--nav-height);margin:0 auto;padding:9px 20px 10px;align-self:end}
body[data-tab] .bottom-nav button{font:500 var(--nav-type)/1.2 var(--font-body);padding:0;gap:0}
body[data-tab] .bottom-nav .royal-icon{width:var(--nav-icon-width);height:var(--nav-icon-height);flex-shrink:0}
.bottom-nav button.active:before{display:none}
body[data-tab] .brand{width:125px;min-width:95px;height:100%;flex-shrink:1}
body[data-tab] .brand img{display:block;width:100%;height:auto;max-height:56px;object-fit:contain}
body[data-tab]:not([data-tab=home]) .header-actions{gap:5px}
body[data-tab]:not([data-tab=home]) .header-actions .essence{font:500 16px var(--font-body);padding:0;min-width:34px;max-width:100px;gap:0}
body[data-tab]:not([data-tab=home]) .header-actions .currency-icon{width:28px;height:32px}
body[data-tab] #sound-toggle,body[data-tab] #fullscreen{display:none}
.header-settings{display:grid;place-items:center;background:none;border:0;padding:0;width:42px;height:44px;flex-shrink:0}
.header-settings .royal-icon{width:40px;height:40px}body[data-tab=home] .header-settings{display:none}
/* Cyrillic display lettering, with quiet, legible text and stable tabular counters. */
body :is(h1,h2,h3){font-family:var(--font-display);font-weight:400;letter-spacing:0;text-wrap:balance}
body :is(button,input,select,textarea,output){font-family:var(--font-body)}
body :is(progress,strong,output,.fortune-timer,.wallet-row){font-variant-numeric:tabular-nums}
body :is(.panel-heading h1,.ornate-heading){font-family:var(--font-display);font-weight:400}
.home-shortcuts button,.realm-card strong,.realm-number,.realm-progress{font-family:var(--font-body);font-weight:600}
/* Each shortcut has the same icon row and reserved two-line caption row. */
.home-shortcuts.left,.home-shortcuts.right{top:7%;gap:10px;display:grid;grid-auto-rows:92px;width:82px}
.home-shortcuts.left{left:2%}.home-shortcuts.right{right:2%}
.home-shortcuts button{width:100%;height:92px;min-height:0;display:grid;grid-template-rows:62px 30px;justify-items:center;align-items:center;gap:0;padding:0;font-size:13px;line-height:1.12}
.home-shortcuts button .royal-icon{width:62px;height:62px;margin:auto}
.home-shortcuts button>span:last-of-type{align-self:start;display:block;max-width:100%;line-height:1.12}
.home-shortcuts i{top:5px;right:8px}
/* Carved chapter headings and a shared night-castle surface for every room. */
body[data-tab] .panel-screen{width:var(--shell-width);max-width:1000px;border:0;border-radius:0;padding:20px 20px 28px;background:linear-gradient(#140b22e8,#120a20f7 65%),url('/assets/moon-castle.webp') center top/cover;scrollbar-color:#a179b4 #1a1028}
.panel-heading{position:relative;margin:0 0 22px;padding-top:6px}
.panel-heading>svg{display:none}
.panel-heading>.royal-icon{display:block;width:64px;height:64px;margin:0 auto 2px}
body .panel-heading h1,body .ornate-heading{font-size:clamp(24px,5vw,32px);line-height:1.3;color:#f8e7fc;padding:10px 12px;border:12px solid transparent;border-image:url('/assets/gothic-panel-frame.webp') 72 120 / 18px 30px / 0 stretch;background:linear-gradient(90deg,transparent,#291139b3,transparent);margin:0}
.panel-heading p{font-size:12px;line-height:1.6;color:var(--muted);margin:10px 0 0}
body .panel-screen>h2{margin-top:28px;margin-bottom:14px;font-size:23px}
body .panel-screen>.ornate-heading{margin:6px 0 22px}
body .panel-screen>h2.ornate-heading{margin:26px 0 14px;font-size:23px}
.notice{background:#281537aa;border:0;border-block:1px solid #775188;border-radius:0;color:#e7d2f3;font-size:12px;line-height:1.6;padding:12px 14px}
.segments{gap:5px;background:#130b20;padding:4px;border:1px solid #725284;border-radius:8px}
.segments button{background:none;border:0;border-radius:5px;padding:11px 7px;color:#d9c1e7;font-size:12px}
.segments button.active{background:linear-gradient(#64367d,#30183f);color:#fff0fc;box-shadow:inset 0 1px #dcade8}
.search{margin:18px 0;gap:8px}.search input{min-width:0;background:#10091d;border:1px solid #9973ad;border-radius:7px;color:#f5e6fa;padding:12px 10px;font-size:13px;caret-color:#e5abff}
input::placeholder{color:#c5a9d4;opacity:1}
.primary,.secondary,.small-button{font-size:12px;min-height:42px;border-color:#af85c3;background:linear-gradient(#482559,#20112e);color:#f8e9ff;border-radius:7px;box-shadow:inset 0 1px #f1c6ff35,0 4px 8px #05010866}
.primary{background:linear-gradient(#8043a4,#532477 65%,#311342);border-color:#d8a8ed}
.text-button{color:#ebcbff;font-size:12px;min-height:36px}
.small-button{min-height:36px}
button:focus-visible,summary:focus-visible,input:focus-visible{outline:2px solid #f4d297;outline-offset:3px}
::selection{background:#8d49b4;color:#fff5ff}*{scrollbar-width:thin;scrollbar-color:#9365ac #170d25}
.person-row,.history-row,.wallet-row{border-color:#6b477f;font-size:12px;line-height:1.5}
.person-row{padding:14px 8px;background:linear-gradient(90deg,#28133699,transparent);border-radius:5px}
.person-row strong{font-family:var(--font-body);font-size:14px}.person-row small{color:var(--muted)}
.empty-state{border:0;border-radius:0;background:none;color:#dbc4e9;padding:28px 12px;font-size:13px;line-height:1.7;text-align:center}
.empty-state:before{content:'';display:block;width:82px;height:82px;margin:0 auto 16px;background:url('/assets/royal-menu-icons.webp') 66.666667% 0/400% 300% no-repeat;opacity:.8}
.quest,.achievement{background:linear-gradient(115deg,#341a4380,#190e29e6);border:1px solid #825c95;border-radius:10px;box-shadow:inset 0 1px #dcabe32b;padding:16px 12px}
.quest h2,.quest h3,.achievement h3{font-family:var(--font-display);font-size:21px;font-weight:400;line-height:1.3}
.quest p,.achievement p{color:var(--muted);line-height:1.6;font-size:12px}
.subtle{font-size:11px;line-height:1.7;color:#cdb3dd}
.quest-list{gap:14px}.quest-reward{color:#f3d29d}
.achievement-list,.event-list{padding-bottom:8px}
.trophy strong{font-family:var(--font-body);font-size:14px;line-height:1.3}.trophy span{color:#d2b7e3}
.compact-profile .profile-identity{border-bottom:1px solid #825c95;padding:6px 0 20px}
.profile-identity h2{font-family:var(--font-display);font-size:27px;line-height:1.2}
.profile-identity p,.profile-identity #profile-code{font-size:11px;color:#d8c0e6}
.profile-actions{gap:8px}.profile-actions .secondary{flex:1;gap:4px;padding:4px 8px}
.compact-profile .profile-summary>div{border:0;border-block:1px solid #79518e;border-radius:0;padding:12px 2px;background:linear-gradient(#30153e77,#150b24)}
.compact-profile .profile-summary strong{font-size:23px;color:#f4dfb7}
.compact-profile .profile-summary span{font-size:11px;line-height:1.4;color:#e2cdec}
.profile-award{border-radius:7px;border-color:#8f64a1;background:linear-gradient(#341a4188,#180d25);padding:7px 4px}
.profile-award strong{font-family:var(--font-body);font-size:12px;line-height:1.3;min-height:34px}
.profile-award small{font-size:10px}.guardian span{font-family:var(--font-body);font-size:13px}
.profile-disclosure{border-color:#6d497f;color:#e3c9ef;font-size:12px}.profile-disclosure summary{padding-block:12px}
.wheel-tabs{margin:18px 0;gap:6px}.wheel-tabs button{border-radius:8px;min-height:78px;padding:8px 3px}.wheel-tabs strong{font:400 18px/1.3 var(--font-display)}.wheel-tabs span{font-size:11px;line-height:1.4}
.fortune-result{font-family:var(--font-display);font-size:23px;font-weight:400}.fortune-odds{color:#dac2e9}
.event-list h2{font-family:var(--font-display);font-size:26px}.event-list p{font-family:var(--font-body);font-size:13px}
body .scene-banner h1{font-family:var(--font-display);font-size:20px}.scene-banner p{font-size:10px;line-height:1.4}
.scene-banner .chapter-seal{border:0;background:none}.chapter-seal>.royal-icon{width:48px;height:48px}
.controls .utility-icon{width:30px;height:30px}.controls .secondary{padding:4px 10px;gap:5px}
body dialog{font-family:var(--font-body);background:linear-gradient(145deg,#2f183d,#130b22);border:1px solid #b98ccc;border-radius:14px;box-shadow:0 16px 44px #050109b0;color:#f4e5fb}
body dialog h2{font-family:var(--font-display);font-weight:400;font-size:27px;line-height:1.3;color:#f5ddec}
body dialog p{font-family:var(--font-body);line-height:1.65}
.settings-heading{gap:12px}.settings-heading h2{display:flex;gap:7px;align-items:center;font-size:23px}.settings-heading .royal-icon{width:42px;height:42px}
.volume-setting label{display:flex;align-items:center;gap:7px}.volume-setting .utility-icon{height:36px;width:36px}
input[type=range]{accent-color:#c17ce6}dialog::backdrop{background:#080310cf}
/* Additional painted medallions, generated in the same material as home. */
.utility-icon{display:inline-block;flex-shrink:0;width:32px;height:32px;background-image:url('/assets/royal-utility-icons.webp');background-size:400% 300%;background-repeat:no-repeat;vertical-align:middle;pointer-events:none}
.utility-0{background-position:0 0}.utility-1{background-position:33.333333% 0}.utility-2{background-position:66.666667% 0}.utility-3{background-position:100% 0}.utility-4{background-position:0 50%}.utility-5{background-position:33.333333% 50%}.utility-6{background-position:66.666667% 50%}.utility-7{background-position:100% 50%}.utility-8{background-position:0 100%}.utility-9{background-position:33.333333% 100%}.utility-10{background-position:66.666667% 100%}.utility-11{background-position:100% 100%}
.royal-small{width:32px;height:32px;vertical-align:middle}.realm-progress .utility-icon,.realm-progress .royal-icon{width:20px;height:20px}.star .royal-icon{width:24px;height:24px}.star:not(.earned) .royal-icon{opacity:.3}
/* Entry: the supplied emblem and the two guardians, with a finite crystal shower. */
.loading-screen{background:#10091d;isolation:isolate}
.loading-screen>.loading-art{width:min(100%,760px);left:50%;transform:translateX(-50%);object-fit:cover;object-position:center 40%;opacity:1}
.loading-screen:after{z-index:0;background:linear-gradient(#10091d55,#10091d00 35%,#10091d44 60%,#10091df2 92%)}
.loading-title{position:absolute;top:max(4%,env(safe-area-inset-top));margin:0;width:min(94%,620px);height:auto;z-index:2;line-height:0}
.loading-title img{width:100%;height:auto;display:block}
.loading-caption{z-index:2;bottom:max(8%,env(safe-area-inset-bottom));width:min(80%,340px)}
.loading-caption p{font-size:14px;line-height:1.5;text-shadow:0 2px 6px #080310}
.loading-caption progress{height:8px;border:1px solid #ac77bf;background:#251034;box-shadow:0 3px 8px #05020a}
.loading-caption progress::-webkit-progress-value{background:linear-gradient(90deg,#7924b1,#e9abff)}
.entry-rain{position:absolute;inset:0;pointer-events:none;z-index:1;overflow:hidden}
.entry-gem{position:absolute;top:-90px;width:36px;height:48px;object-fit:contain;opacity:0;animation:entry-crystal-fall 2200ms linear 1 both}
@keyframes entry-crystal-fall{0%{transform:translate3d(0,0,0) rotate(-16deg);opacity:0}12%{opacity:.75}80%{opacity:.65}100%{transform:translate3d(18px,calc(100dvh + 120px),0) rotate(42deg);opacity:0}}
.entry-rain.is-paused .entry-gem{animation-play-state:paused}
/* Glints use the actual sprite alpha, so light never turns into a rectangular cell overlay. */
.cell .idle-glint{position:absolute;inset:0;pointer-events:none;z-index:3;mask:var(--gem-mask) center/100% 100% no-repeat;-webkit-mask:var(--gem-mask) center/100% 100% no-repeat;overflow:hidden}
.idle-glint:after{content:'';position:absolute;inset:-20% -70%;background:linear-gradient(115deg,transparent 42%,#f1e6ff00 46%,#fff9fcaa 50%,#f1e6ff00 54%,transparent 58%);transform:translateX(-70%);animation:gem-glint 800ms linear 1}
@keyframes gem-glint{to{transform:translateX(70%)}}
@media(hover:hover) and (pointer:fine){.primary:hover,.secondary:hover,.small-button:hover{filter:brightness(1.14)}}
@media(max-width:600px){:root{--shell-width:100%;--header-height:62px;--nav-height:82px;--nav-icon-width:50px;--nav-icon-height:44px;--nav-type:13px}body[data-tab] .panel-screen{padding:16px 14px 24px}.panel-heading>.royal-icon{width:52px;height:52px}.home-shortcuts.left,.home-shortcuts.right{width:74px;grid-auto-rows:82px;gap:8px}.home-shortcuts button{height:82px;grid-template-rows:56px 26px;font-size:12px}.home-shortcuts button .royal-icon{width:56px;height:56px}.compact-profile .profile-summary{gap:4px}.profile-award .trophy-art{width:64px;height:64px}}
@media(max-width:360px){:root{--nav-type:11px;--nav-icon-width:43px;--nav-icon-height:39px}body[data-tab] .bottom-nav{padding-inline:16px}body[data-tab] .brand{width:100px;min-width:90px}body[data-tab]:not([data-tab=home]) .header-actions .essence{font-size:13px}.header-settings{width:35px}.header-settings .royal-icon{width:35px;height:35px}.home-shortcuts.left,.home-shortcuts.right{width:66px}.home-shortcuts button{font-size:11px}.wheel-tabs strong{font-size:16px}.profile-award strong{font-size:11px}.profile-identity h2{font-size:22px}.search input{font-size:12px}}
@media(max-height:650px) and (max-width:600px){:root{--header-height:52px;--nav-height:66px;--nav-icon-width:36px;--nav-icon-height:29px;--nav-type:11px}.home-shortcuts.left,.home-shortcuts.right{top:4%;width:63px;grid-auto-rows:58px;gap:3px}.home-shortcuts button{height:58px;grid-template-rows:37px 21px;font-size:10px}.home-shortcuts button .royal-icon{width:37px;height:37px}.panel-heading>.royal-icon{width:42px;height:42px}.panel-heading{margin-bottom:16px}}
@media(min-width:601px) and (min-height:800px) and (orientation:portrait){:root{--header-height:94px;--nav-height:132px;--nav-icon-width:84px;--nav-icon-height:80px;--nav-type:22px}.home-shortcuts.left,.home-shortcuts.right{width:140px;grid-auto-rows:158px;gap:20px}.home-shortcuts button{height:158px;grid-template-rows:110px 48px;font-size:22px}.home-shortcuts button .royal-icon{width:110px;height:110px}body[data-tab] .brand{width:220px}body[data-tab] .brand img{max-height:85px}body[data-tab] .panel-screen{padding:28px 36px}.panel-heading h1{font-size:36px}}
@media(max-height:500px) and (min-width:601px){:root{--shell-width:min(100%,900px);--header-height:44px;--nav-height:56px;--nav-icon-width:27px;--nav-icon-height:20px;--nav-type:11px}.home-shortcuts.left,.home-shortcuts.right{top:8%;width:64px;grid-auto-rows:62px;gap:8px}.home-shortcuts.right{right:57%}.home-shortcuts button{height:62px;grid-template-rows:37px 25px;font-size:10px}.home-shortcuts button .royal-icon{width:37px;height:37px}.loading-screen>.loading-art{width:55%;left:0;transform:none;object-position:center 36%}.loading-title{width:42%;right:2%;top:14%}.loading-caption{left:58%;width:36%;bottom:18%}.panel-heading>.royal-icon{width:44px;height:44px}}
@media(prefers-reduced-motion:reduce){.entry-gem{animation:none;display:none}.idle-glint{display:none}.loading-screen{scroll-behavior:auto}}

.empty-state>svg{display:none}.node-stars .star .royal-icon{width:15px;height:15px}.level-number .utility-icon{width:26px;height:26px}.end-emblem{display:none}
.quest-list{display:grid;gap:14px}
.compact-profile .profile-summary strong{font-size:19px;white-space:nowrap}
.wheel-tabs strong{font-family:var(--font-body);font-weight:600;font-size:14px;max-width:100%;overflow-wrap:anywhere}
.fortune-result{font-size:20px;line-height:1.4}
.primary,.profile-actions .secondary{position:relative;isolation:isolate;border:0;padding:10px 16px;border-radius:0}
.primary:before,.profile-actions .secondary:before{content:'';position:absolute;inset:-2px;border:10px solid transparent;border-image:url('/assets/royal-nav-frame.webp') 110 190 / 10px 16px / 0 stretch;pointer-events:none;z-index:-1}
.profile-actions .secondary{padding:6px 10px;min-height:46px}
.scene-banner .quiet-button .royal-icon{width:36px;height:36px}
@media(max-width:360px){.wheel-tabs strong{font-size:12px}.compact-profile .profile-summary strong{font-size:16px}}
/* Fortune keeps its eight equal sectors; the carved rim and pointer are stationary. */
.fortune-stage:after{content:'';position:absolute;inset:-2%;background:url('/assets/royal-wheel-rim.webp') center/contain no-repeat;pointer-events:none;z-index:2}
.wheel-pointer{top:-2px;width:44px;height:62px;clip-path:none;background:url('/assets/royal-wheel-pointer.webp') center/contain no-repeat;z-index:4;pointer-events:none}
.wheel-prize>span{bottom:59px}
@media(max-width:600px){.wheel-prize>span{bottom:50px}}
@media(max-width:360px){.wheel-prize>span{bottom:42px}}
@media(max-height:500px) and (min-width:601px){.controls{display:grid;grid-template-columns:minmax(0,1fr) 76px;gap:8px;padding:0;height:40px}.controls .secondary{height:40px;min-height:40px;padding:3px 6px;gap:4px;font-size:11px;line-height:1.25}.controls .utility-icon{height:24px;width:24px}.controls #hint-label{min-width:0}.controls #restart{gap:2px}.controls #restart .utility-icon{width:20px;height:20px}}


/* arcana.css */
/* Minimal Cyrillic lettering: carved light on dark metal, quiet body text. */
:root{--font-body:'Golos Text',sans-serif;--font-display:'Golos Text',sans-serif}
body[data-tab],body :is(button,input,select,textarea,output,h1,h2,h3,p,span,strong,small,b,label,summary,blockquote){font-family:'Golos Text',sans-serif}
body :is(h1,h2,h3){font-weight:600;letter-spacing:-.025em;text-shadow:0 2px 3px #05020c,0 -1px 0 #fff8,0 0 10px #d395ff28}
body :is(.panel-heading h1,.ornate-heading){font-family:'Golos Text',sans-serif;font-weight:600}
body[data-tab] .bottom-nav button{font-family:'Golos Text',sans-serif;font-weight:500;letter-spacing:-.02em}
.home-shortcuts button,.realm-card strong,.realm-number,.realm-progress{font-family:'Golos Text',sans-serif;text-shadow:0 2px 3px #08020f,0 0 6px #d8b7ef40}
.realm-card strong{font-size:clamp(12px,3.5cqw,28px);font-weight:500;line-height:1.12}
.profile-identity h2,.profile-award strong,.guardian span,.wheel-tabs strong,.fortune-result,.event-list h2,body .scene-banner h1,body dialog h2{font-family:'Golos Text',sans-serif;font-weight:600}
.profile-identity h2{font-size:25px}.profile-name-row{display:flex;align-items:center;gap:7px;min-width:0}.profile-name-row h2{min-width:0;flex:1;overflow-wrap:anywhere}.edit-name{width:36px;height:36px;flex-shrink:0;background:#30203f;border:1px solid #b789c7;border-radius:50%;font-size:19px;color:#f2d4ff}
.edit-name svg{height:18px;width:18px}.profile-inventory-link{display:flex;width:100%;align-items:center;justify-content:center;gap:7px;margin:12px 0}
.item-art{display:inline-block;flex-shrink:0;width:76px;height:76px;background:url('/assets/inventory-items.webp') 0 0/200% 200% no-repeat;vertical-align:middle;pointer-events:none}.item-0{background-position:0 0}.item-1{background-position:100% 0}.item-2{background-position:0 100%}.item-3{background-position:100% 100%}
.profile-inventory-link .item-art{width:42px;height:42px}
.inventory-item{display:grid;grid-template-columns:80px minmax(0,1fr);gap:8px 10px;padding:16px 0;border-bottom:1px solid #754b8a}
.inventory-item h2{font-size:19px;margin:2px 0 7px}.inventory-item p{font-size:12px;line-height:1.5;color:#d6c1e3;margin:0 0 8px}.item-count{font-size:12px;color:#f3d39d}.item-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:12px}.item-actions .currency-icon{width:22px;height:22px}
.inventory-dialog{width:min(94vw,470px);max-height:calc(100dvh - 30px);padding:18px;overflow:auto}.inventory-dialog h2{margin:0;font-size:23px}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.inventory-dialog .inventory-item{padding:12px 0}.inventory-dialog .inventory-item h2{font-size:18px}
.nickname-dialog{width:min(92vw,380px);margin:auto;padding:24px}.nickname-dialog h2{margin:0 0 18px;font-size:25px}.nickname-dialog label{display:block;font-size:13px;margin-bottom:8px}.nickname-dialog input{width:100%;background:#110a20;border:1px solid #bd94d1;border-radius:6px;color:#fff;padding:12px;font-size:16px}.nickname-dialog p{font-size:12px;color:#d8bedf}.form-actions{display:flex;justify-content:end;gap:12px;margin-top:16px}#nickname-error{color:#ffb9c5;min-height:20px}
.controls{display:grid;grid-template-columns:minmax(0,1fr) 58px 58px;gap:8px;padding:0 8px;width:min(100%,max(320px,var(--board-size)))}
.controls #restart{font-size:0;padding:3px}.controls #restart .utility-icon{width:30px;height:30px}
.inventory-open{position:relative;display:grid;place-items:center;padding:0!important}.inventory-open .item-art{width:38px;height:38px}.inventory-open b{position:absolute;right:2px;bottom:1px;font-size:10px;background:#291136;border:1px solid #a271b2;border-radius:8px;padding:0 3px}
.booster-target{position:absolute;inset:0;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0 8px;background:#160d24;z-index:4}.controls{position:relative}.controls.targeting>button{visibility:hidden}.booster-target button{min-height:36px;padding:4px 12px}.booster-preview{outline:2px solid #ffe2ac!important;outline-offset:-2px;background:#58365f!important}.booster-preview .crystal{filter:brightness(1.15)}
/* The fortune view is a bounded grid. Details live in a native dialog. */
body[data-tab] #screen-fortune{overflow:hidden;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto auto auto;gap:6px;padding:10px 14px 12px;text-align:center;container-type:size}
#screen-fortune .panel-heading{margin:0;padding:0}#screen-fortune .panel-heading h1{font-size:24px;padding:4px 8px;border-width:8px}#screen-fortune .panel-heading p{margin:3px 0 0;font-size:11px;line-height:1.3}
#screen-fortune .wheel-tabs{margin:0;max-width:none;gap:7px}#screen-fortune .wheel-tabs button{min-height:52px;padding:5px 3px;gap:3px}#screen-fortune .wheel-tabs strong{font-size:13px}#screen-fortune .wheel-tabs span{font-size:10px}
#screen-fortune .fortune-stage{align-self:center;justify-self:center;width:min(100%,350px,calc(100cqh - 230px));min-width:0;margin:4px 0;padding:7px;aspect-ratio:1}
#screen-fortune .fortune-result{font-size:16px;line-height:1.3;margin:0;min-height:21px}#screen-fortune .fortune-spin{justify-self:center;min-width:220px;min-height:40px;padding:6px 14px}
#screen-fortune .fortune-timer{font-size:11px;line-height:1.3;min-height:14px;margin:0}#screen-fortune .odds-button{font-size:11px;min-height:26px;padding:3px}
.wheel-odds-dialog{width:min(92vw,430px);max-height:85dvh;overflow:auto;padding:22px}.wheel-odds-dialog h2{font-size:22px;margin:0}.wheel-odds-dialog p{font-size:13px}.wheel-odds-dialog ul{list-style:none;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:12px;font-size:12px}.wheel-odds-dialog li{display:flex;align-items:center;gap:5px}.wheel-odds-dialog img{width:22px;height:22px}
#screen-fortune .wheel-prize>span{width:48px;height:43px;left:-24px;bottom:calc(var(--wheel-radius,140px) * .39);font-size:14px;line-height:1.2}#screen-fortune .wheel-prize .currency-icon{width:24px;height:24px}
#screen-fortune .wheel-pointer{width:36px;height:52px;top:0}.fortune-stage:after{inset:-2%}
#screen-fortune[data-wheel=free]{background:linear-gradient(#091729de,#0d1229ee),url('/assets/ice-kingdom.webp') center/cover}
#screen-fortune[data-wheel=free] .fortune-stage:after{background-image:url('/assets/wheel-moon.webp')}
#screen-fortune[data-wheel=free] .fortune-wheel{border-color:#c7edff;background:repeating-conic-gradient(#133950 0deg 45deg,#39627c 45deg 90deg)}
#screen-fortune[data-wheel=free] .wheel-pointer{filter:hue-rotate(65deg) saturate(.65)}
#screen-fortune[data-wheel=free] .wheel-hub{background:#112f4a;border-color:#bce4f7}
#screen-fortune[data-wheel=gold]{background:linear-gradient(#271409dc,#180d13ee),url('/assets/crimson-castle.webp') center/cover}
#screen-fortune[data-wheel=gold] .fortune-stage:after{background-image:url('/assets/wheel-dragon.webp')}
#screen-fortune[data-wheel=gold] .fortune-wheel{border-color:#e9b565;background:repeating-conic-gradient(#532016 0deg 45deg,#9d6229 45deg 90deg)}
#screen-fortune[data-wheel=gold] .wheel-pointer{filter:hue-rotate(105deg) saturate(.9)}
#screen-fortune[data-wheel=gold] .wheel-hub{background:#381408;border-color:#e9ad59}
#screen-fortune[data-wheel=crystals]{background:linear-gradient(#160d30dc,#100b25ef),url('/assets/moon-castle.webp') center/cover}
#screen-fortune[data-wheel=crystals] .fortune-wheel{border-color:#d8b2ff;background:repeating-conic-gradient(#32154d 0deg 45deg,#5a317b 45deg 90deg)}
@media(max-width:360px){#screen-fortune .panel-heading h1{font-size:20px}#screen-fortune .wheel-tabs strong{font-size:11px}#screen-fortune .fortune-stage{width:min(100%,calc(100cqh - 208px))}#screen-fortune .fortune-result{font-size:13px}#screen-fortune .wheel-prize>span{font-size:10px;width:32px;height:31px;left:-16px}#screen-fortune .wheel-prize .currency-icon{width:17px;height:17px}#screen-fortune .wheel-pointer{width:26px;height:37px}.home-shortcuts button{font-size:11px}.realm-card strong{font-size:11px}}
@media(max-height:650px) and (max-width:600px){body[data-tab] #screen-fortune{gap:3px;padding:5px 12px 6px}#screen-fortune .panel-heading h1{font-size:20px;padding:1px;border-width:6px}#screen-fortune .panel-heading p{display:none}#screen-fortune .wheel-tabs button{min-height:42px}#screen-fortune .fortune-stage{width:min(100%,calc(100cqh - 175px))}#screen-fortune .fortune-spin{min-height:34px}#screen-fortune .fortune-result{font-size:12px;min-height:16px}#screen-fortune .fortune-timer{font-size:10px}#screen-fortune .odds-button{min-height:23px}.realm-card strong{font-size:11px}.controls{grid-template-columns:minmax(0,1fr) 44px 44px;gap:6px}}
@media(max-height:500px) and (min-width:601px){body[data-tab] #screen-fortune{grid-template-columns:minmax(0,1fr) minmax(280px,1fr);grid-template-rows:auto auto 1fr auto auto auto;column-gap:18px;padding:7px 20px}.fortune-screen .panel-heading{grid-column:2;grid-row:1}.fortune-screen .wheel-tabs{grid-column:2;grid-row:2}#screen-fortune .fortune-stage{grid-column:1;grid-row:1/7;width:min(100%,calc(100cqh - 16px))}#screen-fortune .fortune-result{grid-column:2;grid-row:3;align-self:center}#screen-fortune .fortune-spin{grid-column:2;grid-row:4}#screen-fortune .fortune-timer{grid-column:2;grid-row:5}#screen-fortune .odds-button{grid-column:2;grid-row:6}#screen-fortune .panel-heading p{display:none}#screen-fortune .panel-heading h1{font-size:20px;padding:1px;border-width:6px}#screen-fortune .wheel-tabs button{min-height:44px}.controls{grid-template-columns:minmax(0,1fr) 38px 38px;gap:5px;padding:0}.controls .secondary{padding:2px 4px;font-size:10px}.controls #restart{font-size:0}.controls .utility-icon{width:20px;height:20px}.inventory-open .item-art{width:30px;height:30px}}
@media(prefers-reduced-motion:reduce){.booster-preview .crystal{filter:none}}
/* Keep numerals inside the thick elemental rims at every wheel diameter. */
#screen-fortune .wheel-prize>span{bottom:calc(var(--wheel-radius,140px) * .32)}
#screen-fortune .wheel-pointer{width:12%;height:20%;top:1%}
#screen-fortune[data-wheel=free] .wheel-pointer{filter:hue-rotate(-65deg) saturate(.65)}
#screen-fortune[data-wheel=gold] .wheel-pointer{filter:hue-rotate(80deg) saturate(.9)}
body :is(h1,h2,h3){text-shadow:0 2px 3px #05020c,0 -1px 0 #ffffff45,0 0 9px #d395ff20}
body :is(.panel-heading h1,.ornate-heading),.profile-identity h2{font-weight:500}
.realm-card{container-type:inline-size}
.realm-card strong{font-size:clamp(11px,15cqw,24px);max-width:100%;overflow-wrap:anywhere;line-height:1.08}
body[data-tab=home] .header-actions .essence{max-width:none;font-size:16px;flex:0 1 auto;min-width:0}
body[data-tab=home] .header-actions .essence b{overflow:visible;text-overflow:clip;white-space:nowrap}
body[data-tab=home] .header-actions{min-width:0;gap:5px}
@media(max-width:600px){body[data-tab=home] .royal-account{max-width:118px;min-width:96px;font-size:18px;grid-template-columns:40px minmax(40px,1fr)}body[data-tab=home] .royal-account img{width:40px;height:48px}body[data-tab=home] .home-stars{font-size:16px}}
@media(max-width:360px){body[data-tab=home] .header-actions .essence{font-size:14px}body[data-tab=home] .royal-account{max-width:105px}.realm-card strong{font-size:11px}}


/* enchantment.css */
/* Shared action geometry, carved violet metal and quiet gold accents. */
body :is(.primary,.secondary,.small-button){display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:42px;line-height:1.2;font-weight:500;border-radius:9px;padding:9px 15px;text-align:center;text-shadow:0 2px 2px #0a0414;vertical-align:middle}
body .primary{border:1px solid #dfbbf2;background:linear-gradient(165deg,#793c9c,#44215c 54%,#301640);box-shadow:inset 0 1px 0 #f5d8ff66,inset 0 -2px 0 #1c0d2a;color:#fff5ff}
body .secondary,body .small-button{border:1px solid #a180b5;background:linear-gradient(165deg,#392a4b,#21162f);box-shadow:inset 0 1px 0 #d9b8ef24;color:#f3e5fa}
body .text-button{line-height:1.3;min-height:34px;padding:7px 10px;border-radius:7px;display:inline-flex;align-items:center;justify-content:center;gap:5px;text-align:center}
body :is(.primary,.secondary,.small-button):disabled{opacity:.5;box-shadow:none}
.profile-actions{display:grid;grid-template-columns:1fr 1fr;align-items:stretch;gap:10px}.dialog-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
body .controls .secondary{min-height:36px;padding:5px 9px}.item-actions :is(.primary,.secondary){width:100%;margin:0}.nickname-dialog form>button{width:100%}
@media(hover:hover){body :is(.primary,.secondary,.small-button):enabled:hover{border-color:#f2d9ff;filter:brightness(1.1)}}
body :is(.primary,.secondary,.small-button):enabled:active{transform:translateY(1px)}

/* One portrait can overhang the boss frame without covering objectives. */
body .scene-banner.has-boss{margin-top:18px;overflow:visible;min-height:78px;height:78px;padding-left:10px;gap:10px}
body .scene-banner.has-boss .chapter-seal{position:relative;overflow:visible;isolation:isolate;width:90px;height:66px;flex:0 0 90px;margin:0;background:transparent;border:0;border-radius:0}
body .scene-banner.has-boss .chapter-seal img{position:absolute;width:104px;height:112px;max-width:none;left:-6px;bottom:-6px;object-fit:cover;object-position:50% 18%;border:0;border-radius:40% 40% 8px 8px;mask-image:linear-gradient(#000 83%,transparent);filter:drop-shadow(0 0 5px #ad6cd766)}
body .scene-banner.has-boss>div:nth-child(2){min-width:0;flex:1}body .scene-banner.has-boss h1{font-size:24px;overflow-wrap:anywhere}body .scene-banner.has-boss .quiet-button{flex-shrink:0}

/* Result composition: guardian on the left, equal-width actions below. */
.board-wrap{container-type:size}.end{inset:8px;display:grid;grid-template-columns:35% minmax(0,1fr);grid-template-rows:1fr auto auto auto auto auto;gap:5px 10px;padding:16px 14px;border:1px solid #a87ac7;overflow:hidden;background:linear-gradient(130deg,#29153bee,#100a20fa);align-content:center}
.end-character{grid-column:1;grid-row:1/5;position:relative;align-self:stretch;min-height:0;overflow:hidden;border-radius:45% 45% 8px 8px;background:#1c102a}
.end-character img{position:absolute;width:100%;height:100%;inset:0;object-fit:cover;object-position:50% 20%;mask-image:linear-gradient(#000 70%,transparent)}
.end-character span{position:absolute;bottom:8px;left:0;right:0;color:#f4d99e;font-size:12px;font-weight:600;text-shadow:0 2px 4px #000}
.end h2{grid-column:2;align-self:end;margin:0;font-size:clamp(16px,5cqw,25px);line-height:1.15}.end .earned-stars{grid-column:2;justify-content:center;margin:0}.end>strong{grid-column:2;font-size:clamp(22px,7cqw,34px)}.end>span{grid-column:2;margin:0;font-size:11px}
body .end #again,body .end #end-map{grid-column:1/-1;width:100%;margin:0;min-height:42px;font-size:14px;padding:9px 10px}
.end #again{margin-top:5px!important}.end.victory{border-color:#ddaeed}.board-entering{overflow:hidden}.board-entering .cell{pointer-events:none}
.spell-layer{position:absolute;inset:8px;z-index:6;pointer-events:none;overflow:hidden;border-radius:8px}.spell-core,.spell-particle{position:absolute;pointer-events:none}.spell-row{left:0;width:100%;height:54px;filter:drop-shadow(0 0 8px #6adfff)}.spell-row svg{width:100%;height:100%;fill:none;stroke:#edffff;stroke-width:4;filter:drop-shadow(0 0 3px #23bfff)}
.spell-nova{width:110px;height:110px;border-radius:50%;border:5px solid #ffd596;background:radial-gradient(circle,#fff5d6 4%,#ff993b88 34%,#ff482d00 65%);box-shadow:0 0 25px #fa6c26,inset 0 0 20px #ffac31}
.spell-eclipse{width:120px;height:120px;border-radius:50%;background:radial-gradient(circle,#10051c 50%,#efc3ff 53%,#a332f599 62%,transparent 70%);box-shadow:0 0 32px #b561ec88}
.spell-particle{width:7px;height:14px;border-radius:2px;background:#e9faff;box-shadow:0 0 9px #6fcfff}.spell-particle.nova{background:#ffe3a6;box-shadow:0 0 10px #ff773d}.spell-particle.eclipse{background:#edbaff;box-shadow:0 0 10px #c471ff}

.avatar-edit{position:relative;align-self:center;padding:0;border:0;background:none;width:105px;height:126px;cursor:pointer}.avatar-edit .profile-portrait{width:100%;height:100%;object-fit:cover;object-position:50% 20%}.avatar-edit>span{position:absolute;bottom:5px;left:8px;right:8px;padding:4px 2px;border:1px solid #ac82bf;background:#251336ef;border-radius:6px;font-size:10px;color:#f5e6ff}.avatar-edit.premium .profile-portrait{border-color:#e6bd71}
#player-subtitle{font-size:13px;color:#ccb1dc;overflow-wrap:anywhere;margin:4px 0 9px}.avatar-dialog{width:min(94vw,560px);max-height:88dvh;overflow:auto;padding:20px}.avatar-dialog h2{margin:0;font-size:24px}.avatar-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.avatar-option{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;padding:6px 5px 8px;min-width:0;background:#21162f;border:1px solid #85609c;border-radius:10px;color:#e9d6f3;overflow:hidden}
.avatar-option img{width:100%;height:100px;object-fit:cover;object-position:50% 18%;border-radius:7px}.avatar-option strong{font-size:12px}.avatar-option>span{font-size:11px;height:26px;display:flex;align-items:center;justify-content:center;gap:3px}.avatar-option .currency-icon{width:18px;height:23px}.avatar-option small{position:absolute;top:11px;left:8px;font-size:8px;background:#291910d9;color:#ffe3ac;padding:3px 5px;border-radius:4px;letter-spacing:.03em}.avatar-option.premium{border-color:#b28b4f}.avatar-option[aria-pressed=true]{outline:2px solid #f2d1ff;outline-offset:1px;background:#412450}#avatar-purchase{position:sticky;bottom:-20px;padding:12px 0;background:#1a1028;border-top:1px solid #9772ae}#avatar-purchase p{font-size:13px;line-height:1.5}#avatar-error{font-size:13px;color:#ffb8c7}.person-row .avatar{overflow:hidden}.person-row .avatar img{width:100%;height:100%;object-fit:cover;object-position:50% 20%}.person-name small{display:block;font-size:11px;color:#d5b9e1}

/* Twelve equal sectors; art stays underneath legible prize labels. */
#screen-fortune .panel-heading{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;text-align:center;gap:3px}
#screen-fortune .panel-heading h1{width:100%;margin:0;text-align:center;line-height:1.2}#screen-fortune .panel-heading p{width:100%;text-align:center;margin:0}
#screen-fortune .fortune-wheel{--sector-a:#32154d;--sector-b:#5a317b;background:repeating-conic-gradient(var(--sector-a) 0deg 30deg,var(--sector-b) 30deg 60deg)}
#screen-fortune[data-wheel=free] .fortune-wheel{--sector-a:#12374c;--sector-b:#31596d;background:repeating-conic-gradient(var(--sector-a) 0deg 30deg,var(--sector-b) 30deg 60deg)}
#screen-fortune[data-wheel=gold] .fortune-wheel{--sector-a:#482117;--sector-b:#80512c;background:repeating-conic-gradient(var(--sector-a) 0deg 30deg,var(--sector-b) 30deg 60deg)}
#screen-fortune[data-wheel=crystals] .fortune-wheel{background:repeating-conic-gradient(var(--sector-a) 0deg 30deg,var(--sector-b) 30deg 60deg)}
#screen-fortune .wheel-hub{width:25%;height:25%;border-radius:50%;overflow:hidden;background:radial-gradient(circle,#a677b344,#1a1025aa),url('/assets/astral-observatory.webp') center/cover;border:2px solid #d4a9ec;box-shadow:0 0 0 4px #22112dc9,inset 0 0 12px #07030e;z-index:3}
#screen-fortune[data-wheel=free] .wheel-hub{background:linear-gradient(#133a5b44,#133a5b66),url('/assets/ice-kingdom.webp') center/cover;border-color:#d1efff}
#screen-fortune[data-wheel=gold] .wheel-hub{background:linear-gradient(#50160522,#33150455),url('/assets/dragon-dungeon.webp') 55% center/cover;border-color:#e9ba73}
#screen-fortune .wheel-hub img{width:54%;height:65%;object-fit:contain;filter:drop-shadow(0 2px 3px #080310)}
#screen-fortune .wheel-prize>span{width:36px;left:-18px;height:38px;bottom:calc(var(--wheel-radius,140px)*.39);font-size:11px;gap:0}
#screen-fortune .wheel-prize :is(.currency-icon,.item-art){width:22px;height:24px}.wheel-odds-dialog .item-art{width:26px;height:26px}.wheel-odds-dialog li{min-width:0}.wheel-odds-dialog ul{gap:10px;font-size:11px}
@media(max-width:360px){.avatar-edit{width:84px;height:108px}.avatar-dialog{padding:14px}.avatar-list{gap:8px}.avatar-option img{height:84px}.avatar-option strong{font-size:10px}.end{padding:10px;gap:4px 7px}body .end #again,body .end #end-map{min-height:35px;font-size:12px;padding:6px}.end-character span{font-size:10px}#screen-fortune .wheel-prize>span{width:24px;left:-12px;font-size:9px;height:28px}#screen-fortune .wheel-prize :is(.currency-icon,.item-art){width:16px;height:18px}}
@media(max-height:650px) and (max-width:600px){body .scene-banner.has-boss{margin-top:12px;height:62px;min-height:62px}body .scene-banner.has-boss .chapter-seal{height:52px;width:72px;flex-basis:72px}body .scene-banner.has-boss .chapter-seal img{width:82px;height:86px;bottom:-5px}body .scene-banner.has-boss h1{font-size:20px}}
@media(max-height:500px) and (min-width:601px){body .scene-banner.has-boss{margin-top:18px}body .end #again,body .end #end-map{min-height:32px;font-size:11px;padding:5px}.end{padding:10px;gap:3px 8px}.end h2{font-size:16px}.end>strong{font-size:23px}.end-character span{font-size:10px}}
@container(max-height:250px){.end{grid-template-columns:30% minmax(0,1fr);grid-template-rows:auto auto auto auto;gap:3px 8px;padding:8px}.end-character{grid-row:1/5}.end h2{font-size:14px;align-self:center}.end .earned-stars{display:none}.end>strong{font-size:20px}.end>span{display:none}body .end #again,body .end #end-map{grid-column:2;min-height:30px;font-size:11px;padding:5px}.end #again{margin-top:0!important}}
@media(prefers-reduced-motion:reduce){body :is(.primary,.secondary,.small-button):enabled:active{transform:none}}

body .profile-identity{grid-template-columns:110px minmax(0,1fr);gap:12px}
body .profile-identity>div{min-width:0}body .profile-identity h2{font-size:clamp(19px,5vw,25px)}
@media(max-width:360px){body .profile-identity{grid-template-columns:84px minmax(0,1fr);gap:10px}body .profile-identity h2{font-size:18px}}

/* Reserve the overhang inside the play area, clear of the global header. */
body .play:has(.has-boss){grid-template-rows:112px 44px 24px minmax(0,1fr) 28px 40px}
body .scene-banner.has-boss{display:flex;align-self:end;margin-top:34px;height:78px;min-height:78px}
@media(max-height:720px) and (max-width:600px){body .play:has(.has-boss){grid-template-rows:80px 38px 20px minmax(0,1fr) 24px 36px}body .scene-banner.has-boss{display:flex;margin-top:24px;height:56px;min-height:56px}body .scene-banner.has-boss .chapter-seal{height:48px;width:68px;flex-basis:68px}body .scene-banner.has-boss .chapter-seal img{height:78px;width:78px;bottom:-4px}body .scene-banner.has-boss h1{font-size:18px}body .scene-banner.has-boss p{font-size:9px}}
@media(max-height:500px) and (min-width:601px){body .play:has(.has-boss){grid-template-rows:82px 38px 22px minmax(0,1fr) 36px}body .play:has(.has-boss) .board-wrap{grid-row:1/6}body .scene-banner.has-boss{grid-column:2;grid-row:1;margin-top:24px;height:58px;min-height:58px;width:100%}body .scene-banner.has-boss .chapter-seal{width:60px;height:42px;flex-basis:60px}body .scene-banner.has-boss .chapter-seal img{width:74px;height:80px;bottom:-6px}body .scene-banner.has-boss h1{font-size:18px}body .scene-banner.has-boss p{font-size:9px}body .play:has(.has-boss) .stats{grid-row:2;height:38px}body .play:has(.has-boss) .objective{grid-row:3}body .play:has(.has-boss) .status{grid-row:4}body .play:has(.has-boss) .controls{grid-row:5}}

/* Compressed boards retain one crystal per row instead of intrinsic square tracks. */
.cell{grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr)}
.cell .crystal{height:100%;max-height:100%;min-height:0;aspect-ratio:auto}
@media(max-height:550px) and (max-width:600px){body .play:has(.has-boss){grid-template-rows:64px 30px 18px minmax(0,1fr) 34px;gap:3px}body .scene-banner.has-boss{margin-top:20px;height:44px;min-height:44px;padding:3px 8px}body .scene-banner.has-boss .chapter-seal{height:40px;width:60px;flex-basis:60px}body .scene-banner.has-boss .chapter-seal img{width:64px;height:64px;bottom:-4px}body .play:has(.has-boss) .status{display:none}body .play:has(.has-boss) .stats{height:30px}body .play:has(.has-boss) .stats strong{font-size:18px}body .play:has(.has-boss) .stats span{font-size:8px}body .play:has(.has-boss) .objective{height:18px}body .play:has(.has-boss) .controls{height:34px}}

@media(max-height:550px) and (max-width:600px){.cell .crystal{object-fit:contain;transform:translateY(-1px) scale(1.12)}}


/* styles/features.css */
/* sigils.css */
/* Four engraved titles share the same lettering scale and frame geometry. */
:root{--sigil-letter-width:min(calc(100vw - 80px),360px);--sigil-heading-height:64px}
body[data-tab] :is(#screen-fortune,#screen-levels,#screen-achievements,#screen-profile,#screen-tournaments) .sigil-heading{position:relative;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;height:var(--sigil-heading-height);min-height:var(--sigil-heading-height);max-height:var(--sigil-heading-height);margin:0;padding:0 14px;border:8px solid transparent;border-image:url('/assets/gothic-panel-frame.webp') 72 120 / 18px 30px / 0 stretch;background:linear-gradient(90deg,#160c2480,#291139b3,#160c2480);line-height:1;text-align:center;font-size:24px;font-weight:500}
body[data-tab] :is(#screen-levels,#screen-achievements) .panel-heading>.royal-icon{display:none}
body[data-tab] :is(#screen-levels,#screen-achievements) .panel-heading{padding:0;margin:0 0 16px}
body[data-tab] #screen-profile>.sigil-heading{margin-bottom:20px}
.sigil-lettering{display:none;width:var(--sigil-letter-width);height:calc(var(--sigil-letter-width)/8);aspect-ratio:8;max-width:100%;flex-shrink:0;background:url('/assets/sigil-titles.webp') center 0/100% 400% no-repeat}
[data-title-art=levels] .sigil-lettering{background-position:center 33.333333%}[data-title-art=achievements] .sigil-lettering{background-position:center 66.666667%}[data-title-art=profile] .sigil-lettering{background-position:center 100%}
.sigil-art-ready .sigil-lettering{display:block}.sigil-art-ready .sigil-fallback{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
body[data-tab] #screen-fortune{padding-inline:14px}#screen-fortune .panel-heading{gap:4px}
#screen-fortune .fortune-stage{width:min(100%,350px,calc(100cqh - 250px))}

/* Sculpted surfaces cover the whole inner wheel, not just the central medallion. */
#screen-fortune[data-wheel=free]{--wheel-surface:url('/assets/wheel-surface-free.webp');--wheel-shade:#071d2c66}
#screen-fortune[data-wheel=gold]{--wheel-surface:url('/assets/wheel-surface-gold.webp');--wheel-shade:#25100266}
#screen-fortune[data-wheel=crystals]{--wheel-surface:url('/assets/wheel-surface-crystals.webp');--wheel-shade:#18072555}
#screen-fortune[data-wheel] .fortune-wheel{background-image:repeating-conic-gradient(from 0deg,#f8eaff42 0deg .7deg,transparent .7deg 30deg),repeating-conic-gradient(transparent 0deg 30deg,var(--wheel-shade) 30deg 60deg),var(--wheel-surface);background-position:center;background-size:100% 100%;background-repeat:no-repeat}
#screen-fortune[data-wheel] .wheel-hub{background-image:var(--wheel-surface);background-size:400% 400%;background-position:center;width:25%;height:25%;border:2px solid #d9bde9;box-shadow:0 2px 8px #08030d99;overflow:hidden}
#screen-fortune .wheel-hub img{display:none}
#screen-fortune .wheel-prize>span{color:#fff5df;text-shadow:0 1px 2px #000,0 0 3px #000}
#screen-fortune .wheel-prize b{background:#0d0818db;border-radius:3px;padding:0 3px;font-variant-numeric:tabular-nums}

/* The board keeps one aspect ratio: scarce height reduces both axes together. */
body .board-wrap{width:var(--board-size)!important;height:var(--board-height)!important;max-width:100%;aspect-ratio:auto}
body .cell .crystal{object-fit:contain;transform:translateY(-1px) scale(1.35)}
body .play:has(.has-boss){grid-template-rows:88px 40px 22px minmax(0,1fr) 22px 38px}
body .scene-banner.has-boss{height:60px;min-height:60px;margin-top:28px}
body .scene-banner.has-boss .chapter-seal{height:50px;width:82px;flex-basis:82px}
body .scene-banner.has-boss .chapter-seal img{width:88px;height:94px;bottom:-8px}
body .play:has(.has-boss) .stats{height:40px}body .play:has(.has-boss) .objective{height:22px}body .play:has(.has-boss) .status{height:22px}body .play:has(.has-boss) .controls{height:38px}
body .play[data-compact-board=true]{grid-template-columns:104px minmax(0,1fr);grid-template-rows:72px 20px minmax(0,1fr) 36px;gap:4px}
body .play[data-compact-board=true] .scene-banner{display:flex;grid-column:1;grid-row:1;position:relative;width:100%;height:52px;min-height:52px;margin:20px 0 0;padding:0;align-self:end;justify-content:center;border:0;background:none}
body .play[data-compact-board=true] .scene-banner:before{display:none}
body .play[data-compact-board=true] .chapter-seal{margin:0;flex:0 0 64px;width:64px;height:45px;align-self:start}
body .play[data-compact-board=true] .chapter-seal img{width:68px;height:74px;left:-2px;bottom:-8px}
body .play[data-compact-board=true] .scene-banner>div:nth-child(2){position:absolute;bottom:0;left:2px;right:2px;max-width:100%;z-index:2;background:#160b27df;border-radius:4px;padding:2px}
body .play[data-compact-board=true] .scene-banner h1{font-size:11px;line-height:1.15;margin:0;text-align:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
body .play[data-compact-board=true] .scene-banner :is(p,.quiet-button){display:none}
body .play[data-compact-board=true] .stats{grid-column:2;grid-row:1;width:100%;height:48px;min-width:0;padding:0 4px;align-self:center;margin:0}
body .play[data-compact-board=true] .stats>div{min-width:0;flex:1;padding:4px 2px}body .play[data-compact-board=true] .stats strong{font-size:21px}body .play[data-compact-board=true] .stats span{font-size:8px}
body .play[data-compact-board=true] .objective{grid-column:1/-1;grid-row:2;height:20px;width:100%}
body .play[data-compact-board=true] .board-wrap{grid-column:1/-1;grid-row:3}
body .play[data-compact-board=true] .status{display:none}
body .play[data-compact-board=true] .controls{grid-column:1/-1;grid-row:4;width:100%;height:36px}

/* Trophies are real buttons; a focused reward dialog exposes their condition and payout. */
button.trophy{border:1px solid transparent;border-radius:9px;background:none;color:inherit;padding:8px 4px;cursor:pointer}
button.trophy:focus-visible{outline:2px solid #f1d29f;outline-offset:2px}
@media(hover:hover){button.trophy:hover{background:#38204466;border-color:#8961a1}}
.trophy-dialog{width:min(92vw,390px);max-height:88dvh;overflow:auto;padding:20px;text-align:center}
.trophy-close{display:flex;justify-content:flex-end}.trophy-dialog .trophy-art{width:136px;height:136px;margin:0 auto;opacity:1}.trophy-dialog h2{font-size:24px;margin:10px 0}.trophy-dialog p{font-size:13px;line-height:1.5;color:#dfc9eb}.trophy-dialog progress{display:block;width:100%;height:8px;accent-color:#c28ce9;margin-top:16px}#trophy-progress-label{font-size:12px;margin:7px 0 16px}.trophy-rewards{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:14px 0;border-block:1px solid #6d4e80}.trophy-rewards>div{display:flex;align-items:center;justify-content:center;gap:5px;flex-wrap:wrap}.trophy-rewards strong{font-size:22px;color:#f1d19a}.trophy-rewards span{flex-basis:100%;font-size:11px;color:#d7bfe2}.trophy-rewards .currency-icon{width:30px;height:36px}#trophy-claim{width:100%}
@media(max-height:650px) and (max-width:600px){:root{--sigil-heading-height:48px}#screen-fortune .fortune-stage{width:min(100%,calc(100cqh - 200px))}}
@media(max-height:500px) and (min-width:601px){:root{--sigil-heading-height:48px;--sigil-letter-width:min(340px,calc((100vw - 190px)/2))}#screen-fortune .fortune-stage{width:min(100%,calc(100cqh - 16px))}body .play:has(.has-boss){grid-template-rows:82px 38px 22px minmax(0,1fr) 36px}body .scene-banner.has-boss{height:58px;min-height:58px;margin-top:24px}body .scene-banner.has-boss .chapter-seal{width:60px;height:42px;flex-basis:60px}body .scene-banner.has-boss .chapter-seal img{width:74px;height:80px;bottom:-6px}body .play:has(.has-boss) .stats{height:38px}body .play:has(.has-boss) .controls{height:36px}}


/* journey.css */
/* Carved chapter seals, crystal waypoints and alchemical rewards. */
body[data-tab] :is(#screen-inventory,#screen-ranking) .sigil-heading{position:relative;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;height:var(--sigil-heading-height);min-height:var(--sigil-heading-height);margin:0;padding:0 14px;border:8px solid transparent;border-image:url('/assets/gothic-panel-frame.webp') 72 120 / 18px 30px / 0 stretch;background:linear-gradient(90deg,#160c2480,#291139b3,#160c2480);font-size:24px;text-align:center}
body[data-tab] #screen-profile>h2.journey-heading{margin:28px 0 14px}
.journey-lettering{display:none;width:var(--sigil-letter-width);height:calc(var(--sigil-letter-width)/8);max-width:100%;flex-shrink:0;background:url('/assets/journey-titles.webp') center 0/100% 400% no-repeat}
[data-journey-title=awards] .journey-lettering{background-position:center 33.333333%}[data-journey-title=guardians] .journey-lettering{background-position:center 66.666667%}[data-journey-title=inventory] .journey-lettering{background-position:center 100%}
[data-journey-title=ranking] .journey-lettering{background-image:url('/assets/hall-title.webp');background-size:100% 100%}
.journey-art-ready .journey-lettering{display:block}.journey-art-ready .journey-fallback{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
:is(#screen-ranking,#screen-inventory) .panel-heading>.royal-icon{display:none}
#screen-fortune[data-wheel=crystals]{--wheel-surface:url('/assets/wheel-amethyst-core.webp')}
#chapter-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;padding:8px 0;background:#160d21f5}
#chapter-tabs button{position:relative;display:grid;justify-items:center;gap:2px;min-width:0;padding:5px 2px 7px;border:1px solid #7b637d;border-radius:4px;background:linear-gradient(145deg,#402238,#190e25);color:#ecd8ee;font-size:12px;font-weight:500;text-shadow:0 2px 3px #080310;box-shadow:inset 0 1px #d4a5ce44}
#chapter-tabs button[data-chapter='1']{background:linear-gradient(145deg,#203c58,#101826)}#chapter-tabs button[data-chapter='2']{background:linear-gradient(145deg,#3d215b,#1d112a)}#chapter-tabs button[data-chapter='3']{background:linear-gradient(145deg,#58452e,#24182c)}
#chapter-tabs button[aria-pressed=true]{border-color:#f2d3a2;box-shadow:inset 0 0 0 1px #f2d3a255,0 3px 8px #080310;color:#fff6e7}
#chapter-tabs small{position:absolute;top:6px;right:7px;color:#e5c89e;font-size:10px}
.chapter-tab-crystal{display:block;width:29px;height:39px;background:url('/assets/map-crystals.webp') 0 0/400% 100% no-repeat}
[data-chapter='1'] .chapter-tab-crystal{background-position:33.333333% 0}[data-chapter='2'] .chapter-tab-crystal{background-position:66.666667% 0}[data-chapter='3'] .chapter-tab-crystal{background-position:100% 0}
.level-grid.adventure-map,.adventure-map .map-route{height:1520px}
.adventure-map{--map-crystal-position:0%}.adventure-map[data-chapter='1']{--map-crystal-position:33.333333%}.adventure-map[data-chapter='2']{--map-crystal-position:66.666667%}.adventure-map[data-chapter='3']{--map-crystal-position:100%}
body .adventure-map .level-node{transform:translate(-50%,-42px);gap:2px;width:112px}
body .adventure-map .level-node .level-number{width:66px;height:88px;border:0;border-radius:0;overflow:visible;box-shadow:none;background:url('/assets/map-crystals.webp') var(--map-crystal-position) 0/400% 100% no-repeat;color:#fff5e5;text-shadow:0 2px 3px #000,0 -1px 2px #000;font-size:23px;font-weight:700;isolation:auto}
body .adventure-map .next-level .level-number{filter:drop-shadow(0 2px 5px #ffdc8f)}
body .adventure-map .locked .level-number{filter:grayscale(.85) brightness(.72)}
body .adventure-map .map-boss{inset:auto -20px 0 auto;width:35px;height:43px;object-fit:cover;opacity:1;z-index:2;border:1px solid #dfbd83;border-radius:5px}
body .adventure-map .level-node-name{font-size:11px;line-height:1.2;padding:4px 6px}
body .adventure-map .node-stars{height:18px}
.item-4,.item-5{background-image:url('/assets/alchemy-items.webp');background-size:200% 200%}.item-4{background-position:0 0}.item-5{background-position:100% 0}
.gem-crown{display:none;position:absolute;width:43%;height:43%;left:29%;top:-8%;z-index:5;background:url('/assets/gem-crown.webp') center/contain no-repeat;pointer-events:none;filter:drop-shadow(0 1px 1px #150513)}.crowned .gem-crown{display:block}
body .cell .bomb-seal{display:none;inset:0;width:100%;height:100%;border:0;border-radius:0;background:url('/assets/bomb-core.webp') center/100% 100% no-repeat;box-shadow:none;transform:none;z-index:3;pointer-events:none;opacity:.92;mask-size:135% 135%;mask-position:center;mask-repeat:no-repeat}
body .cell.bomb .bomb-seal{display:block}.cell.bomb .crystal{filter:brightness(.8) saturate(1.2)}
.cell[data-gem='1'] .bomb-seal{mask-image:url('/assets/gothic-gem-1.webp')}.cell[data-gem='2'] .bomb-seal{mask-image:url('/assets/gothic-gem-2.webp')}.cell[data-gem='3'] .bomb-seal{mask-image:url('/assets/gothic-gem-3.webp')}.cell[data-gem='4'] .bomb-seal{mask-image:url('/assets/gothic-gem-4.webp')}.cell[data-gem='5'] .bomb-seal{mask-image:url('/assets/gothic-gem-5.webp')}.cell[data-gem='6'] .bomb-seal{mask-image:url('/assets/gothic-gem-6.webp')}
.potion-status{position:absolute;top:6px;right:6px;z-index:6;display:flex;gap:3px;pointer-events:none}.potion-status .item-art{width:24px;height:30px;filter:drop-shadow(0 2px 3px #000)}
body .end{isolation:isolate;grid-template-columns:1fr;grid-template-rows:1fr auto auto auto auto auto;align-items:center;gap:5px;padding:14px;background:#120b20e8;overflow:hidden}
body .end .end-character{position:absolute;inset:0;z-index:-2;display:block;overflow:visible;border-radius:0;background:none;min-height:0}
body .end .end-character img{width:100%;height:100%;object-fit:contain;object-position:center top;mask-image:none;opacity:1}
body .end::after{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(0deg,#10091dfc 0%,#10091de6 40%,#10091d33 70%,transparent)}
body .end .end-character span{top:8px;bottom:auto;font-size:12px;text-shadow:0 2px 3px #000}
body .end :is(h2,.earned-stars,strong,span){grid-column:1}body .end h2{align-self:end;text-shadow:0 2px 4px #000}body .end>strong{font-size:clamp(22px,7cqw,34px)}
.end-bonus{display:block;color:#ffe2a8;font-size:11px;line-height:1.3;grid-column:1}
.spell-layer{overflow:visible;pointer-events:none}
.impact-flare{position:absolute;width:170px;height:170px;border-radius:50%;background:radial-gradient(circle,#fff4ba 0%,#ffb02c99 14%,#e43e142e 42%,transparent 67%);pointer-events:none}
.impact-wave{position:absolute;width:110px;height:110px;border:3px solid #ffd695;border-radius:50%;box-shadow:0 0 16px #fb761caa,inset 0 0 14px #fb761c88}
.impact-shard{position:absolute;width:24px;height:31px;background:center/contain no-repeat;clip-path:polygon(7% 0,100% 36%,55% 100%);pointer-events:none}
.impact-spark{position:absolute;width:3px;height:18px;background:#fff0c5;border-radius:50%;box-shadow:0 0 5px #ffa91c}
.impact-flame{position:absolute;width:25px;height:65px;border-radius:70% 30% 50% 50%;background:radial-gradient(ellipse at bottom,#fff1a1,#ff9b14 32%,#f43e18b0 56%,transparent 75%)}
.impact-bolt{position:absolute;left:0;width:100%;height:90px;overflow:visible}.impact-bolt path{fill:none;stroke:#d3faff;stroke-width:3;stroke-linejoin:round;filter:drop-shadow(0 0 5px #50cfff)}.impact-bolt .bolt-halo{stroke:#328fe3;stroke-width:10;opacity:.65}
.impact-bolt svg{display:block;width:100%;height:90px}
.spell-layer[data-spell=row] .impact-wave{border-color:#a6efff;box-shadow:0 0 18px #3d9fff88,inset 0 0 12px #71e6ff66}
.spell-layer[data-spell=row] .impact-flare{background:radial-gradient(ellipse,#e8fcff 0%,#58c7ff66 22%,transparent 65%);width:100%;height:80px}
.spell-layer[data-spell=row] .impact-spark{background:#ecfbff;box-shadow:0 0 7px #64dcff}
.spell-layer[data-spell=nova] .impact-wave{border-width:7px;border-color:#ffb94d;box-shadow:0 0 20px #f86b26,inset 0 0 16px #ed301e99}
.spell-layer[data-spell=eclipse] .impact-wave{border-color:#e0b4ff;border-width:2px;box-shadow:0 0 18px #ac60edaa,inset 0 0 16px #6734a199}
.spell-layer[data-spell=eclipse] .impact-spark{background:#ebc8ff;box-shadow:0 0 8px #aa71f5}
.impact-orb{position:absolute;width:130px;height:130px;border-radius:50%;background:radial-gradient(circle,#0c0613 35%,#8f42b9 45%,#f5d0ff 49%,#60209b66 53%,transparent 65%)}
.combo-visitor{position:absolute;right:-8px;top:-42px;z-index:24;width:138px;height:210px;pointer-events:none;contain:layout style}
.combo-portrait{position:absolute;inset:0;background:url('/assets/combo-characters.webp') 0 0/400% 100% no-repeat}
.combo-visitor[data-character='1'] .combo-portrait{background-position:33.333333% 0}.combo-visitor[data-character='2'] .combo-portrait{background-position:66.666667% 0}.combo-visitor[data-character='3'] .combo-portrait{background-position:100% 0}
.combo-visitor p{position:absolute;right:10px;bottom:0;width:170px;margin:0;padding:8px 10px;background:#170e25ee;color:#fff0de;border-bottom:1px solid var(--companion-color,#e8b75c);box-shadow:0 4px 10px #08041099;text-align:center;font-size:11px;line-height:1.4;text-shadow:0 2px 2px #000}.combo-visitor strong{display:block;font-size:12px;color:var(--companion-color,#e8b75c)}
.combo-mote{position:absolute;width:4px;height:14px;border-radius:50%;background:#ffe6ae;box-shadow:0 0 5px #c984ed;pointer-events:none;z-index:20}
@media(max-width:360px){#chapter-tabs{gap:4px}#chapter-tabs button{font-size:11px}.combo-visitor{width:112px;height:172px;top:-24px}.combo-visitor p{width:140px;font-size:10px}.end-bonus{font-size:10px}}
@media(prefers-reduced-motion:reduce){.combo-visitor{display:none}}
/* Small fields retain a single readable results column over the full portrait. */
body .end #again,body .end #end-map{grid-column:1/-1}
@container(max-height:250px){body .end{padding:7px;gap:3px;grid-template-rows:minmax(0,1fr) auto auto auto auto auto}body .end h2{font-size:13px;line-height:1.15}body .end>strong{font-size:20px}body .end .end-character span{display:none}body .end .end-bonus{font-size:9px;line-height:1.2}body .end #again,body .end #end-map{min-height:30px;padding:5px;font-size:10px}}


/* aurora.css */
/* Aurora: larger worn crowns, persistent timers, luminous feedback. */
.gem-crown{width:120%;height:105%;left:-10%;top:-35%;transform:rotate(-9deg);filter:drop-shadow(0 3px 2px #210b16aa)}
.cell[data-gem='2'] .gem-crown,.cell[data-gem='5'] .gem-crown{top:-30%;transform:rotate(7deg)}
.combo-visitor{width:174px;height:260px;top:-40px;right:-8px}
.combo-visitor p{width:188px}
.inventory-exit{position:sticky;top:0;z-index:5;display:flex;justify-content:space-between;gap:12px;padding:10px 0;background:#1b102cf5}
.inventory-dialog .dialog-heading{position:sticky;top:-20px;z-index:5;background:#21122f;padding:10px 0}
#inventory-dialog{max-height:85dvh;overflow:auto}
.cell.booster-preview{outline:none!important;background:transparent!important;box-shadow:none!important}
.cell.booster-preview .crystal{filter:brightness(1.4) drop-shadow(0 0 7px #9feeff);animation:spell-target-breathe 1.3s ease-in-out infinite alternate}
@keyframes spell-target-breathe{from{opacity:.65}to{opacity:1}}
header{position:relative}
header .potion-status{position:absolute;top:100%;left:50%;right:auto;transform:translateX(-50%);display:flex;justify-content:center;gap:6px;z-index:40;white-space:nowrap}
.potion-status:empty{display:none}
.potion-status>span{display:flex;align-items:center;gap:3px;padding:2px 7px 2px 3px;border-radius:12px;background:#20102ff0;border:1px solid #bb9dd3;color:#ffebbc;font-size:11px;font-variant-numeric:tabular-nums;box-shadow:0 3px 7px #08020c66}
header .potion-status .item-art{width:20px;height:24px}
body:has(.potion-status>span) .scene-banner{margin-top:27px}
body .level-grid.adventure-map,body .adventure-map .map-route{height:4400px}
body .level-grid.adventure-map{background-image:linear-gradient(#1b103314,#1b103314),var(--map-scene);background-size:auto 1467px;background-position:center top;background-repeat:repeat-y}
.scene-banner.has-boss{border-color:#e0ab61;box-shadow:inset 0 0 24px #b254292b,0 3px 10px #16081566}
.scene-banner.has-boss #level-name{color:#ffe0a1;font-weight:700}
.boss-battle-label{display:block;color:#ffce80;font-size:11px;font-weight:800;letter-spacing:.06em}
.scene-banner:not(.has-boss) .boss-battle-label{display:none}
body[data-tab=home]>header{background:linear-gradient(#170d2455,#170d2410);border-bottom:0;z-index:5}
body[data-tab=home] .home-screen{overflow:visible}
body[data-tab=home] .home-art{top:calc(-1 * var(--home-header,64px));height:calc(100% + var(--home-header,64px));object-position:50% 0}
.home-aura{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:1}
.home-aura i{position:absolute;bottom:18%;width:4px;height:4px;border-radius:50%;background:#ffdfb5;box-shadow:0 0 8px #f3b9ff;animation:home-firefly 12s ease-in-out infinite;opacity:0}
.home-aura::before{content:'';position:absolute;inset:0;background:radial-gradient(ellipse at 52% 26%,#ddaeff21,transparent 44%);animation:home-radiance 7s ease-in-out infinite alternate}
@keyframes home-firefly{0%,100%{opacity:0;transform:translate(0,0)}20%,65%{opacity:.75}90%{opacity:0;transform:translate(18px,-260px)}}
@keyframes home-radiance{from{opacity:.3}to{opacity:1}}
body[data-tab=home] .home-content,body[data-tab=home] .home-shortcuts{z-index:3}
body.motion-paused .home-aura *,body.motion-paused .home-aura::before{animation-play-state:paused}
body.motion-disabled .home-aura{display:none}
.impact-bolt .bolt-branch{stroke-width:1.2;opacity:.85}
.impact-bolt .bolt-core{stroke:white;stroke-width:1.6;filter:none}
.spell-layer[data-spell=nova] .impact-flare{width:280px;height:280px;background:radial-gradient(circle,#fffce5 0%,#fff2a9 8%,#ffbb43d9 22%,#ff4c1680 43%,#8d271738 60%,transparent 72%)}
.impact-smoke{position:absolute;width:120px;height:120px;border-radius:50%;background:radial-gradient(ellipse,#70505f99,#34243a66 40%,transparent 70%)}
.impact-pressure{position:absolute;width:100px;height:100px;border:2px solid #fff5cf;border-radius:50%;box-shadow:0 0 20px #ffbc76}
@media(max-width:360px){.combo-visitor{width:145px;height:223px}.combo-visitor p{width:158px;font-size:10px}.potion-status>span{font-size:10px}}
@media(prefers-reduced-motion:reduce){.home-aura{display:none}.cell.booster-preview .crystal{animation:none;opacity:1}.combo-visitor{display:none}}


/* ember.css */
/* Loading and heat inherit the queen's amethyst / sculpted silver world. */
.loading-screen{background:#0c081c}
.loading-screen>.loading-art{width:min(100%,620px);object-fit:cover;object-position:50% 48%}
.loading-screen:after{background:linear-gradient(180deg,#09061600 55%,#090616bb 100%)}
.loading-title{top:max(3%,env(safe-area-inset-top));width:min(88%,480px)}
.loading-caption{bottom:max(5%,env(safe-area-inset-bottom));width:min(82%,360px)}
.loading-caption p{margin:0 0 12px;color:#fff0ff}
.loading-caption progress{height:9px;border-color:#c3a4dc}
.loading-tip{display:block;margin-top:14px;color:#e4d0ee;font-size:12px;line-height:1.5;text-wrap:balance}
.heat-meter{width:100%;min-height:32px;align-self:center;padding:0 3px;box-sizing:border-box;grid-column:1/-1}
.heat-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;font-size:11px;line-height:19px;color:#e8d6f5}
.heat-heading strong{font-weight:600}.heat-heading span{font-variant-numeric:tabular-nums;color:#d7bddf;font-size:10px}
.heat-track{height:7px;overflow:hidden;background:#21112e;border:1px solid #80608f;border-radius:4px}
#heat-fill{display:block;width:100%;height:100%;background:linear-gradient(90deg,#8652bd,#edbfff);transform:scaleX(0);transform-origin:left}
.is-hot .heat-track{border-color:#f1ca86}.is-hot #heat-fill{background:linear-gradient(90deg,#cf762e,#ffe9a9)}
.is-hot .heat-heading strong{color:#ffe1a4}
.bomb-marker{display:none;position:absolute;right:0;bottom:0;width:20px;height:20px;padding:2px;background:#31110bea;border:1px solid #ffcc7a;border-radius:50%;color:#ffdfa5;stroke:currentColor;fill:none;stroke-width:1.8;z-index:7;pointer-events:none}
.cell.bomb .bomb-marker{display:block}
body #screen-play{grid-template-rows:auto auto auto 32px minmax(0,1fr) auto auto}
body #screen-play[data-compact-board=true]{grid-template-rows:72px 20px 32px minmax(0,1fr) 36px}
body #screen-play[data-compact-board=true] .heat-meter{grid-row:3;grid-column:1/-1}
body #screen-play[data-compact-board=true] .board-wrap{grid-row:4}
body #screen-play[data-compact-board=true] .controls{grid-row:5}
@media(max-height:500px) and (min-width:601px){body #screen-play{grid-template-rows:0 44px 26px 32px minmax(0,1fr) 40px}body #screen-play .scene-banner{display:none}body #screen-play .board-wrap{grid-row:1/7;grid-column:1}body #screen-play .stats{grid-row:2}body #screen-play .objective{grid-row:3}body #screen-play .heat-meter{grid-row:4;grid-column:2}body #screen-play .status{grid-row:5}body #screen-play .controls{grid-row:6}}
@media(max-height:500px) and (min-width:601px){.loading-screen>.loading-art{width:52%;left:0;transform:none;object-position:50% 40%}.loading-title{top:12%;right:3%;width:42%}.loading-caption{left:57%;width:37%;bottom:15%}.heat-meter{grid-column:2;grid-row:auto;width:100%}}


/* watch.css */
/* Keep decorative hero artwork out of the shortcut hit targets. */
body[data-tab=home] .home-shortcuts{z-index:5}
body[data-tab=home] .home-content{pointer-events:none}
body[data-tab=home] .home-content button{pointer-events:auto}
body[data-tab=home] .home-title,body[data-tab=home] .home-art,body[data-tab=home] .home-aura{pointer-events:none}
/* Seven chapters retain a readable card width instead of shrinking to seven columns. */
.home-chapters{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:calc((100% - 6px)/4);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;scrollbar-width:thin;padding-bottom:6px;pointer-events:auto}
.home-chapters .realm-card{scroll-snap-align:start}
.realm-4 .realm-frame{background-position:33.333333% 0;filter:hue-rotate(20deg)}
.realm-5 .realm-frame{background-position:100% 0}.realm-6 .realm-frame{background-position:66.666667% 0}
#chapter-tabs{display:grid;grid-template-columns:repeat(7,minmax(60px,1fr));overflow-x:auto;flex-shrink:0;gap:5px;padding-bottom:6px}
#chapter-tabs button{min-width:60px;padding:5px 3px}
#chapter-tabs button:nth-child(5) .chapter-tab-crystal{background-position:33.333333% 0}
#chapter-tabs button:nth-child(6) .chapter-tab-crystal{background-position:0 0}
#chapter-tabs button:nth-child(7) .chapter-tab-crystal{background-position:100% 0}
body .level-grid.adventure-map{background:#d9d0ba;background-image:none;background-repeat:no-repeat}
.atlas-terrain{position:absolute;inset:0;z-index:-2;pointer-events:none;display:grid;grid-template-rows:1fr 1fr;overflow:hidden}
.atlas-terrain img{display:block;width:100%;height:100%;min-height:0;object-fit:cover;object-position:center}
.atlas-terrain:after{content:'';position:absolute;left:0;right:0;top:calc(50% - 24px);height:48px;background:linear-gradient(transparent,#d8d0ba88,transparent)}
body .adventure-map .map-route{opacity:.72}
body .adventure-map[data-chapter='4']{--map-crystal-position:33.333333%}
body .adventure-map[data-chapter='5']{--map-crystal-position:0%}
body .adventure-map[data-chapter='6']{--map-crystal-position:100%}
/* A single centered axis for wheel, pointer, result and action. */
body[data-tab] #screen-fortune{--fortune-accent:#c4edff;gap:8px;padding:14px 18px;grid-template-rows:auto 62px minmax(0,1fr) 40px 48px 18px 30px;justify-items:center}
body[data-tab] #screen-fortune[data-wheel=gold]{--fortune-accent:#f2d092}
body[data-tab] #screen-fortune[data-wheel=crystals]{--fortune-accent:#e4bdff}
#screen-fortune .panel-heading{width:100%;max-width:600px}
#screen-fortune .panel-heading p{font-size:12px;margin:6px 0 0;color:#e5d7ef}
#screen-fortune .wheel-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;max-width:480px;gap:6px;align-items:stretch}
#screen-fortune .wheel-tabs button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:0;height:62px;padding:7px 3px;border:1px solid #786487;border-radius:9px;background:#130e20ba;color:#dacee6}
#screen-fortune .wheel-tabs button[aria-pressed=true]{border-color:var(--fortune-accent);background:#382448;color:#fff6e9;box-shadow:inset 0 -3px 0 var(--fortune-accent)}
#screen-fortune .wheel-tabs strong{font-size:13px;line-height:1.15}
#screen-fortune .wheel-tabs span{font-size:11px;line-height:1.2;white-space:nowrap}
#screen-fortune .fortune-stage{width:min(100%,460px,calc(100cqh - 326px));max-height:100%;margin:0;padding:8px;align-self:center;justify-self:center;container-type:inline-size}
#screen-fortune .fortune-stage:after{inset:-1%;pointer-events:none}
#screen-fortune .wheel-prize>span{width:11cqw;height:11cqw;left:-5.5cqw;bottom:calc(var(--wheel-radius,140px) * .34);font-size:clamp(7px,2.9cqw,14px);display:flex;align-items:center;justify-content:center;gap:1px}
#screen-fortune .wheel-prize .currency-icon{width:6cqw;height:6cqw}
#screen-fortune .wheel-prize .item-art{width:6cqw;height:6cqw}
#screen-fortune .fortune-result{display:flex;align-items:center;justify-content:center;align-self:stretch;max-width:100%;font-size:16px;line-height:1.2;min-height:0;margin:0;text-wrap:balance;color:#fff0d8}
#screen-fortune .fortune-spin{width:min(100%,360px);min-width:0;min-height:48px;margin:0;border:1px solid var(--fortune-accent);border-radius:9px;background:linear-gradient(#69418a,#382148);color:#fff5e6;font-size:16px;font-weight:600;box-shadow:0 4px 10px #08031077}
#screen-fortune .fortune-spin:disabled{opacity:.55}
#screen-fortune .fortune-timer{font-size:11px;line-height:18px;min-height:18px;margin:0;color:#d9c8e6}
#screen-fortune .odds-button{min-height:30px;margin:0;padding:4px 12px;font-size:12px;text-decoration:underline;text-underline-offset:4px}
@media(max-height:650px) and (max-width:600px){body[data-tab] #screen-fortune{gap:3px;padding:4px 10px;grid-template-rows:38px 38px minmax(0,1fr) 24px 34px 12px 22px}#screen-fortune .wheel-tabs button{height:38px;min-height:38px;padding:3px;font-size:11px;gap:2px}#screen-fortune .wheel-tabs strong{font-size:11px}#screen-fortune .wheel-tabs span{font-size:9px}#screen-fortune .fortune-stage{width:min(100%,calc(100cqh - 186px))}#screen-fortune .fortune-result{font-size:12px}#screen-fortune .fortune-spin{min-height:34px;font-size:13px}#screen-fortune .fortune-timer{font-size:9px;line-height:12px;min-height:12px}#screen-fortune .odds-button{min-height:22px;font-size:10px;padding:2px}}
@media(max-height:500px) and (min-width:601px){body[data-tab] #screen-fortune{grid-template-columns:minmax(0,1fr) minmax(280px,1fr);grid-template-rows:auto 48px minmax(0,1fr) 40px 16px 26px;gap:5px 22px;padding:8px 20px}#screen-fortune .fortune-stage{grid-column:1;grid-row:1/7;width:min(100%,calc(100cqh - 24px))}#screen-fortune .wheel-tabs button{height:48px}#screen-fortune .fortune-spin{min-height:40px}#screen-fortune .fortune-result{font-size:14px}#screen-fortune .fortune-timer{min-height:16px;line-height:16px}#screen-fortune .odds-button{min-height:26px}}

@media(max-height:650px) and (max-width:600px){body[data-tab] #screen-fortune .sigil-heading{height:38px;min-height:38px;max-height:38px}}


/* ritual.css */
/* The entire ornamented gem shares one animation transform. Ice belongs to the cell. */
.gem-piece{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}
body .cell .gem-piece .crystal{width:100%;height:100%;transform:translateY(-1px) scale(1.35);animation:none;transition:none}
.cell.selected .gem-piece{animation:piece-float 1.6s ease-in-out infinite}
.cell.hint .gem-piece{animation:piece-hint 1.1s ease-in-out 3}
.cell.cleared .gem-piece{animation:piece-collect .13s ease-out forwards}
@keyframes piece-float{50%{transform:translateY(-3px) scale(1.035)}}
@keyframes piece-hint{50%{transform:translateY(-3px) scale(1.06)}}
@keyframes piece-collect{35%{transform:translateY(-3px) scale(1.07)}100%{transform:translateY(-8px) scale(.08) rotate(25deg);opacity:0}}
@media(prefers-reduced-motion:reduce){.cell.cleared .gem-piece{opacity:.2}}
body .adventure-map .atlas-terrain{grid-template-rows:repeat(5,minmax(0,1fr))}
.inventory-tabs{display:flex;gap:8px;margin:18px 0}.inventory-tabs button{flex:1;min-height:44px;background:#20142f;border:1px solid #735284;color:#d8c4e8;border-radius:9px;font:inherit}
.inventory-tabs button[aria-pressed=true]{background:#4a2b61;border-color:#dab1ec;color:#fff0ff}
#inventory-scrolls[hidden],#inventory-boosters[hidden]{display:none}
#scroll-summary{padding:18px 0;border-bottom:1px solid #755184;margin-bottom:8px}
#scroll-summary h2{font-size:24px;color:#f3d9a7;margin:8px 0}#scroll-summary p{color:#cdb8da;font-size:13px}
.eyebrow{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:#cfb7e1}
.scroll-card{display:grid;grid-template-columns:70px minmax(0,1fr) auto;gap:12px;align-items:center;padding:20px 0;border-bottom:1px solid #71507b66}
.scroll-emblem{width:68px;height:68px}.scroll-1{filter:hue-rotate(35deg)}.scroll-2{filter:sepia(.65)}
.scroll-copy h3{font-size:19px;margin:0 0 8px;color:#f2dfd1}.scroll-copy p{font-size:13px;margin:0 0 6px;color:#e1cbea}.scroll-copy span{font-size:12px;color:#bda7cd}
.scroll-card button{min-width:88px;min-height:44px;display:flex;gap:6px;align-items:center;justify-content:center;padding:10px}.scroll-card button:disabled{opacity:.55;cursor:default}
#login-series{margin:22px 0 30px;padding:22px;border:1px solid #8c659f;background:linear-gradient(135deg,#342044,#1a102a);border-radius:14px}
.series-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.series-heading h2{font-size:24px;line-height:1.2;margin:8px 0}.series-reward{display:flex;align-items:center;gap:4px;font-size:28px;color:#f3d9a7}.series-reward img{width:38px;height:38px}
#login-series p{font-size:13px;line-height:1.6;color:#dbc8e7}.series-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));padding:0;list-style:none;gap:5px;margin:20px 0}
.series-days li{display:flex;flex-direction:column;align-items:center;gap:8px;color:#bca6cf}.series-days li>span{display:grid;place-items:center;width:100%;aspect-ratio:1;max-width:54px;border:1px solid #78568b;border-radius:9px;background:#190f28;font-size:20px}.series-days .complete>span{border-color:#d6b57f;background:#634b35;color:#fff0c6}.series-days .today>span{outline:2px solid #f6deb0;outline-offset:2px}.series-days small{font-size:10px;white-space:nowrap}.series-days img{width:28px;height:28px}.series-status{font-weight:600;color:#f3dbb2!important}
@media(max-width:420px){#login-series{padding:15px}.series-heading h2{font-size:21px}.scroll-card{grid-template-columns:50px minmax(0,1fr);gap:10px}.scroll-emblem{width:48px;height:48px}.scroll-card button{grid-column:2;justify-self:start;min-width:116px}.scroll-copy h3{font-size:18px}.series-days{gap:4px}.series-days li>span{font-size:16px}}

body .atlas-terrain:after{display:none}

/* One coordinate system for the landscape and its four repainted joins.
   Narrow screens crop horizontally; section boundaries never crop vertically. */
body .level-grid.adventure-map{width:100%;max-width:586.666667px;margin-inline:auto}
body .adventure-map .atlas-terrain{display:block;width:586.666667px;left:50%;right:auto;transform:translateX(-50%);overflow:visible}
body .atlas-terrain>img{position:absolute;left:0;width:100%;height:880px;object-fit:fill}
.atlas-join{position:absolute;left:0;width:100%;height:366.666667px;display:block;background-size:200% 200%;background-repeat:no-repeat;mask-image:linear-gradient(transparent,#000 8%,#000 92%,transparent);pointer-events:none}

.atlas-join.single-join{background-size:100% 100%}

.profile-scroll-bonus{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:18px 0;padding:16px;border-block:1px solid #805c93;background:#291b3b99}.profile-scroll-bonus .royal-icon{width:48px;height:48px}.profile-scroll-bonus>div{flex:1;min-width:190px}.profile-scroll-bonus strong{display:block;color:#f5d69e;font-size:24px}.profile-scroll-bonus div span{display:block;font-size:12px;color:#d4c0e3;margin-top:5px}.scroll-3{filter:hue-rotate(65deg)}.scroll-4{filter:hue-rotate(270deg)}.scroll-5{filter:hue-rotate(180deg)}.scroll-6{filter:sepia(.7) saturate(1.4)}


/* tournament.css */
.profile-league-link{width:100%;margin-top:14px}
.league-hero{padding:24px;border:1px solid #a37cba;border-radius:14px;background:radial-gradient(ellipse at top,#61427780,transparent 70%),#20132e;text-align:center;margin:20px 0}
.league-hero h2{font-size:32px;color:#f3d6a2;margin:10px 0}.league-hero>p{font-size:13px;color:#d6c4e3}.league-track{display:flex;justify-content:center;gap:12px;margin:18px 0}.league-track span{width:32px;height:32px;display:grid;place-items:center;border:1px solid #776185;border-radius:50%;color:#b8a5c5}.league-track .current{background:#cda66c;color:#22132e;border-color:#ffe5b2;box-shadow:0 0 0 4px #d4ab7033}
.tourney-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;border-top:1px solid #9a78ad66;padding-top:18px;margin-top:20px}.tourney-summary strong{display:block;font-size:24px;color:#f5e7ff}.tourney-summary span{display:block;color:#cbb8d9;font-size:11px;margin-top:6px}
.tourney-arenas{display:grid;gap:10px;margin:18px 0}.tourney-arenas article{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:12px;padding:17px 12px;background:#2b193c;border:1px solid #745088;border-radius:10px}.tourney-arenas .royal-icon{width:48px;height:48px}.tourney-arenas h3{margin:0 0 7px;font-size:19px;color:#f1d6b3}.tourney-arenas p{font-size:12px;color:#cdb7df;margin:0}.tourney-arenas button{min-width:92px;min-height:44px}.tournament-resume{width:100%;min-height:50px;margin:8px 0 22px}
.tourney-rules{margin:22px 0;padding:16px;border:1px solid #785589;border-radius:9px}.tourney-rules summary{cursor:pointer;font-weight:600;color:#e7cde7}.tourney-rules p{font-size:13px;line-height:1.65;color:#d2c2df}.tourney-award{padding:18px;background:#51412b66;border:1px solid #b6935d;border-radius:10px}.tourney-award h3{font-size:19px;color:#f6d9aa}.tourney-award p{font-size:13px;line-height:1.5}.tourney-table-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:24px}
.tourney-ranking{list-style:none;margin:12px 0;padding:0}.tourney-ranking li{display:grid;grid-template-columns:36px minmax(0,1fr) auto;align-items:center;gap:12px;padding:14px 8px;border-bottom:1px solid #72528166;font-size:14px}.tourney-ranking span{overflow-wrap:anywhere}.tourney-ranking strong{color:#efd2a2}.tourney-ranking .own{background:#60427c55}.tourney-ranking .tourney-empty{display:block;color:#cbb5d9;line-height:1.6;font-size:13px}
body[data-game-mode=tournament] .heat-meter{display:none!important}body[data-game-mode=tournament] #inventory-open{opacity:.4}body[data-game-mode=tournament] .potion-status{display:none}
@media(max-width:420px){.league-hero{padding:18px 12px}.tourney-arenas article{grid-template-columns:38px minmax(0,1fr);gap:10px}.tourney-arenas .royal-icon{width:38px;height:38px}.tourney-arenas button{grid-column:2;justify-self:start}.tourney-arenas h3{font-size:18px}.tourney-summary strong{font-size:21px}}

/* Removing campaign heat also removes its grid row in every board layout. */
body[data-game-mode=tournament] #screen-play{grid-template-rows:auto auto auto minmax(0,1fr) auto auto}
body[data-game-mode=tournament] #screen-play[data-compact-board=true]{grid-template-rows:72px 20px minmax(0,1fr) 36px}
body[data-game-mode=tournament] #screen-play[data-compact-board=true] .board-wrap{grid-row:3}
body[data-game-mode=tournament] #screen-play[data-compact-board=true] .controls{grid-row:4}
@media(max-height:500px) and (min-width:601px){body[data-game-mode=tournament] #screen-play{grid-template-rows:0 44px 26px minmax(0,1fr) 40px}body[data-game-mode=tournament] #screen-play .board-wrap{grid-row:1/6}body[data-game-mode=tournament] #screen-play .status{grid-row:4}body[data-game-mode=tournament] #screen-play .controls{grid-row:5}}

body[data-game-mode=tournament] .controls{grid-template-columns:minmax(0,1fr) 110px}
body[data-game-mode=tournament] #inventory-open{display:none}
body[data-game-mode=tournament] .controls #restart{font-size:12px;padding:4px}
body[data-game-mode=tournament] #restart .utility-icon{display:none}


/* channel-reward.css */
.home-shortcuts .channel-gift-icon{width:58px;height:58px;object-fit:contain}
.channel-reward-card{max-width:680px;margin:12px auto 24px;padding:22px;background:#1e122d;border:1px solid #9978ac;border-radius:14px;color:#f6eafa}
.channel-reward-heading{display:flex;align-items:center;gap:14px;margin-bottom:16px}
.channel-reward-heading img{flex:none;object-fit:contain}
.channel-reward-card h2{margin:0 0 6px;font-size:clamp(21px,4.5vw,28px);line-height:1.2}
.channel-reward-card p{font-size:15px;line-height:1.55;margin:0 0 16px;max-width:65ch}
.channel-reward-heading p{color:#d6bedf;margin:0;font-size:13px}
.channel-reward-actions{display:flex;flex-wrap:wrap;gap:12px;margin:20px 0 14px}
.channel-reward-actions>*{flex:1 1 190px;min-height:46px;text-align:center;display:flex;align-items:center;justify-content:center;text-decoration:none;padding:10px 16px;font-size:15px;line-height:1.3}
.channel-reward-card .channel-reward-message{margin:0;color:#efcf98;font-size:14px;min-height:44px}
.channel-reward-actions :focus-visible{outline:2px solid #f4d297;outline-offset:4px}
@media(max-width:420px){.channel-reward-card{padding:16px}.channel-reward-heading{gap:10px}.channel-reward-heading img{width:48px;height:48px}.channel-reward-actions>*{flex-basis:100%}}
@media(max-height:700px) and (max-width:600px){.home-shortcuts .channel-gift-icon{width:45px;height:45px}}
@media(max-height:560px){.home-shortcuts .channel-gift-icon{width:36px;height:36px}}


/* campaign.css */
/* Nine chapters share one horizontal selector; card and target sizes stay readable. */
#chapter-tabs{grid-template-columns:repeat(9,minmax(60px,1fr))}
.realm-7 .realm-frame{background-position:33.333333% 0}
.realm-8 .realm-frame{background-position:0 0}
#chapter-tabs button:nth-child(8) .chapter-tab-crystal{background-position:33.333333% 0}
#chapter-tabs button:nth-child(9) .chapter-tab-crystal{background-position:0 0}
body .adventure-map[data-chapter='7']{--map-crystal-position:33.333333%;background:#101d39}
body .adventure-map[data-chapter='8']{--map-crystal-position:0%;background:#143f43}
body .adventure-map .atlas-terrain.expanded-terrain{width:100%;left:0;right:0;transform:none;overflow:hidden}
body .expanded-terrain>img{object-fit:cover;object-position:center;mask-image:linear-gradient(transparent,#000 80px,#000 calc(100% - 80px),transparent)}
body .expanded-terrain>img:first-child{mask-image:linear-gradient(#000,#000 calc(100% - 80px),transparent)}
body .expanded-terrain>img:last-child{mask-image:linear-gradient(transparent,#000 80px,#000)}
body[data-realm='7']{--realm-accent:#c7c5ff}
body[data-realm='8']{--realm-accent:#e8c284}


/* adventure.css */
body[data-game-mode=raid] .heat-meter{display:none!important}body[data-game-mode=raid] #inventory-open{opacity:.4}body[data-game-mode=raid] .potion-status{display:none}
body[data-game-mode=raid] #screen-play{grid-template-rows:auto auto auto minmax(0,1fr) auto auto}
body[data-game-mode=raid] #screen-play[data-compact-board=true]{grid-template-rows:72px 20px minmax(0,1fr) 36px}
body[data-game-mode=raid] #screen-play[data-compact-board=true] .board-wrap{grid-row:3}
body[data-game-mode=raid] #screen-play[data-compact-board=true] .controls{grid-row:4}
@media(max-height:500px) and (min-width:601px){body[data-game-mode=raid] #screen-play{grid-template-rows:0 44px 26px minmax(0,1fr) 40px}body[data-game-mode=raid] #screen-play .board-wrap{grid-row:1/6}body[data-game-mode=raid] #screen-play .status{grid-row:4}body[data-game-mode=raid] #screen-play .controls{grid-row:5}}
body[data-game-mode=raid] .controls{grid-template-columns:minmax(0,1fr) 110px}
body[data-game-mode=raid] #inventory-open{display:none}
body[data-game-mode=raid] .controls #restart{font-size:12px;padding:4px}
body[data-game-mode=raid] #restart .utility-icon{display:none}

.adventure-entry{width:100%;min-height:46px;margin:14px 0}.companion-roster{display:grid;gap:14px;margin-top:18px}.companion-card{display:grid;grid-template-columns:90px minmax(0,1fr);gap:16px;border-bottom:1px solid #9776ad66;padding:12px 0 18px}.companion-card img{width:90px;height:128px;object-fit:cover;object-position:top;border-radius:8px}.companion-card h2{margin:0 0 8px;font-size:21px;color:#efdab5}.companion-card p{font-size:13px;line-height:1.5;margin:0 0 12px;color:#d7c9e2}.companion-card button{min-height:42px;font-size:12px}.companion-card.locked img{filter:grayscale(.8);opacity:.6}.raid-hero{position:relative;min-height:260px;border-radius:12px;overflow:hidden;margin-top:18px;display:flex;align-items:end}.raid-hero>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}.raid-hero>div{position:relative;width:100%;padding:55px 22px 20px;background:linear-gradient(transparent,#160b21)}.raid-hero h1{font-size:32px;margin:8px 0;color:#ffe5b7}.raid-hero p{margin:0;color:#ebd9f5}.raid-health{padding:20px 0 0}.raid-health>div{display:flex;justify-content:space-between;font-size:14px}.raid-health progress{width:100%;height:16px;accent-color:#d3a566;margin-top:12px}.raid-health>p{font-size:12px;color:#cdbadb}.raid-summary{display:flex;gap:35px;border-bottom:1px solid #8a6c9c66;padding-bottom:10px}.raid-summary p{font-size:12px;color:#d8c4e4}.raid-summary strong{display:block;font-size:27px;color:#f3e7fa;margin-bottom:6px}.raid-reward{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:16px 12px;background:#4a3645;border:1px solid #b49b71;border-radius:8px;margin:14px 0}.raid-reward p{margin:0;font-size:12px}.raid-reward strong{display:block;margin-top:7px}.raid-reward button{min-height:44px}.realm-marker{position:absolute;right:1px;bottom:1px;background:#332448ed;color:#fff4ff;border:1px solid #e4c3ff;border-radius:8px;padding:1px 3px;font:600 9px/1.2 'Golos Text',sans-serif;z-index:5;pointer-events:none}.realm-marker[data-kind=clock]{background:#513b1bee;color:#fff1c2;border-color:#f2ce7f}.cell.boss-shield .ice-shell{filter:sepia(1) saturate(2);opacity:.85}.adventure-hud{display:flex;gap:6px;width:min(100%,max(340px,var(--board-size)));height:36px;align-items:stretch;grid-column:1/-1}.adventure-hud button{font:500 11px/1.2 'Golos Text',sans-serif;background:#251630;border:1px solid #aa86b0;color:#f5e6fa;border-radius:7px;padding:3px 8px;min-width:0}.encounter-info{flex:1}.encounter-info:before{content:'';display:inline-block;width:9px;height:9px;background:var(--boss-color);border-radius:50%;margin-right:5px}.companion-use{color:#f6dfa5!important}.companion-use:disabled{opacity:.65}.companion-use:not(:disabled){background:#57432c;border-color:#e2bf73}.adventure-hud[hidden]{display:none}#encounter-copy p{line-height:1.6;font-size:14px;color:#dfd0ea}
body #screen-play[data-adventure=true]{grid-template-rows:auto auto auto auto 36px minmax(0,1fr) auto auto}
body #screen-play[data-adventure=true][data-compact-board=true]{grid-template-rows:72px 20px 32px 36px minmax(0,1fr) 36px}
body #screen-play[data-adventure=true][data-compact-board=true] .adventure-hud{grid-row:4}
body #screen-play[data-adventure=true][data-compact-board=true] .board-wrap{grid-row:5}
body #screen-play[data-adventure=true][data-compact-board=true] .controls{grid-row:6}
body[data-game-mode=raid] #screen-play[data-adventure=true]{grid-template-rows:auto auto auto 36px minmax(0,1fr) auto auto}
body[data-game-mode=raid] #screen-play[data-adventure=true][data-compact-board=true]{grid-template-rows:72px 20px 36px minmax(0,1fr) 36px}
body[data-game-mode=raid] #screen-play[data-adventure=true][data-compact-board=true] .adventure-hud{grid-row:3}
body[data-game-mode=raid] #screen-play[data-adventure=true][data-compact-board=true] .board-wrap{grid-row:4}
body[data-game-mode=raid] #screen-play[data-adventure=true][data-compact-board=true] .controls{grid-row:5}
@media(min-width:800px){.companion-roster{grid-template-columns:1fr 1fr}}
@media(max-height:500px) and (min-width:601px){body #screen-play[data-adventure=true],body[data-game-mode=raid] #screen-play[data-adventure=true]{grid-template-rows:0 44px 26px minmax(0,1fr) 40px}body #screen-play[data-adventure=true] .board-wrap{grid-row:1/6}body #screen-play[data-adventure=true] .adventure-hud{grid-column:2;grid-row:4;align-self:center;width:100%;height:auto;min-height:36px;flex-wrap:wrap}body #screen-play[data-adventure=true] .status,body #screen-play[data-adventure=true] .heat-meter{display:none!important}body #screen-play[data-adventure=true] .controls{grid-row:5}}

/* Keep the field usable on short portrait screens: the encounter takes the heat row. */
body #screen-play[data-adventure=true][data-compact-board=true],body[data-game-mode=raid] #screen-play[data-adventure=true][data-compact-board=true]{grid-template-rows:52px 20px 36px minmax(0,1fr) 36px}
body #screen-play[data-adventure=true][data-compact-board=true] .heat-meter{display:none}
body #screen-play[data-adventure=true][data-compact-board=true] .scene-banner{height:48px;min-height:48px;margin:0}
body #screen-play[data-adventure=true][data-compact-board=true] .chapter-seal img{height:60px;width:55px;left:5px;bottom:-3px}
body #screen-play[data-adventure=true][data-compact-board=true] .adventure-hud{grid-row:3}
body #screen-play[data-adventure=true][data-compact-board=true] .board-wrap{grid-row:4}
body #screen-play[data-adventure=true][data-compact-board=true] .controls{grid-row:5}


/* invitations.css */
.friend-invitation{margin:18px 0 22px;padding:18px 0;border-top:1px solid #9676a955;border-bottom:1px solid #9676a955}
.friend-invitation h2{margin:0 0 9px;color:#eed8b3;font-size:23px}
.friend-invitation p{font-size:13px;line-height:1.55;color:#ddcbe7;margin:0 0 15px}
.invite-actions{display:flex;flex-wrap:wrap;gap:8px}
.invite-actions .primary{display:flex;align-items:center;justify-content:center;text-decoration:none;text-align:center;min-height:46px;padding:10px 16px;font-size:14px;flex:1 1 220px}
.invite-actions .secondary{min-height:44px;flex:1 1 220px;font-size:12px}
#invitation-manual{margin-top:14px}#invitation-manual label{display:block;margin-bottom:7px;font-size:12px}#invitation-text{display:block;width:100%;min-height:130px;padding:12px;border:1px solid #a98cbc;border-radius:8px;background:#170d22;color:#f6eafa;font:13px/1.5 'Golos Text',sans-serif;resize:vertical}
.invite-actions a:focus-visible{outline:2px solid #ffe2a8;outline-offset:3px}


/* styles/gameplay.css */
/* reforge.css */
/* Reforge 34: catalog, wearable jewelry and circular navigation / fortune disks. */
body[data-tab] :is(#screen-shop,#screen-events)>.sigil-heading{position:relative;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:100%;height:var(--sigil-heading-height);min-height:var(--sigil-heading-height);margin:0 0 20px;padding:0 14px;border:8px solid transparent;border-image:url('/assets/gothic-panel-frame.webp') 72 120 / 18px 30px / 0 stretch;background:linear-gradient(90deg,#160c2480,#291139b3,#160c2480);line-height:1;text-align:center;font-family:Georgia,serif;font-size:clamp(20px,5vw,28px);font-weight:500;color:#efdcff;text-shadow:0 2px 2px #070211,0 0 10px #a85ed95c}
.shop-wallet{display:flex;justify-content:center;gap:24px;margin:-8px 0 18px;font-variant-numeric:tabular-nums}.shop-wallet>span{display:flex;align-items:center;gap:6px}.shop-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;border-bottom:1px solid #8b69ac6b;padding-bottom:8px}.shop-tabs button{min-width:0;min-height:44px;padding:6px 3px;background:transparent;border:1px solid transparent;color:#c5b3d5;font:inherit;font-size:13px;border-radius:6px}.shop-tabs button[aria-pressed=true]{border-color:#b38bd8;background:#42265c;color:#fff2ff}.shop-description{color:#cbbbda;font-size:13px;line-height:1.6;margin:16px 0 20px}.shop-items{display:grid;gap:12px}.shop-card{display:grid;grid-template-columns:70px minmax(0,1fr) auto;gap:12px;align-items:center;padding:16px 4px;border-bottom:1px solid #88609d45}.shop-card>.item-art,.shop-card>.shop-scroll{width:66px;height:66px;flex-shrink:0}.shop-card-copy{min-width:0}.shop-card h2{font:600 17px/1.2 'Golos Text',sans-serif;margin:0 0 8px;color:#f2dffc}.shop-card p{margin:0 0 10px;font-size:12px;line-height:1.55;color:#cbbbda}.shop-card small{color:#ba9dcd;font-size:11px}.shop-card button{display:flex;align-items:center;justify-content:center;gap:3px;min-width:66px;min-height:44px;padding:7px 10px;font-size:14px}.shop-card .currency-icon{width:23px;height:25px}.shop-card button:disabled{opacity:.5}.shop-items:has(.jewelry-card){grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}.jewelry-card{display:flex;flex-direction:column;gap:10px;text-align:center;padding:12px 10px 16px;background:linear-gradient(#34204477,#170e2555);border:1px solid #8c62a349;border-radius:12px}.jewelry-card .shop-card-copy{flex:1}.jewelry-card h2{font-size:14px;line-height:1.35;margin:5px 0 0}.jewelry-card button{width:100%}.jewelry-art{display:block;background:url('/assets/jewelry-34.webp') var(--jewel-x) var(--jewel-y)/400% 400% no-repeat;width:100%;aspect-ratio:1}.jewelry-card>.jewelry-art{max-width:160px}.jewelry-card.tier-3{border-color:#b9995966}.jewelry-preview{display:flex;gap:24px;align-items:center;min-height:130px;margin:20px 0 28px;padding:20px 8px;border-block:1px solid #88609d45}.jewelry-preview>.avatar{width:90px;height:90px;flex:none}.jewelry-preview p{font-size:11px;line-height:1.5;color:#bda8cf;margin:8px 0}.jewelry-preview .text-button{font-size:11px;padding:5px 6px 5px 0}.avatar,.portrait-stack{position:relative;isolation:isolate}.person-row .avatar,.jewelry-preview .avatar{overflow:visible}.avatar>img{width:100%;height:100%;object-fit:cover;border-radius:50%}.equipped-jewelry{position:absolute;pointer-events:none;z-index:2;width:100%;height:100%;left:0;aspect-ratio:1}.equipped-head{top:-60%}.equipped-head.kind-tiara{top:-51%}.equipped-head.kind-diadem{top:-38%}.equipped-neck{top:55%;width:52%;height:52%;left:24%}.portrait-stack{display:block;width:100%;height:100%;overflow:visible}.avatar-edit .portrait-stack>.profile-portrait{position:relative;width:100%;height:100%;object-fit:cover}.avatar-edit{overflow:visible}.avatar-edit>span:last-child:not(.portrait-stack){z-index:3}.profile-jewelry-link{display:block;margin:-4px auto 16px}.person-row{min-height:82px}.jewelry-preview .avatar{margin-top:8px;margin-bottom:18px}#use-telegram-name{display:block;text-align:left;margin:0 0 18px}#shop-status{font-size:13px;color:#e8d6f5;min-height:20px}
/* Every medallion has a square box, including the original raster icons. */
body .royal-icon{aspect-ratio:1;flex-shrink:0;height:auto!important}
body .bottom-nav .royal-icon{width:30px!important;height:30px!important}body[data-tab=home] .bottom-nav .royal-icon{width:48px!important;height:48px!important}
.menu-medallion{display:grid;place-items:center;border-radius:50%;width:57px;height:57px;aspect-ratio:1;flex:none;box-sizing:border-box;border:3px solid #a99cb9;background:radial-gradient(circle at 40% 30%,#5f4481,#251536 70%);box-shadow:inset 0 0 0 2px #32253e,0 2px 4px #08030fb3,inset 0 0 9px #d9c5f64d}.menu-medallion svg{width:90%;height:90%;overflow:visible}.home-shortcuts .menu-medallion,.home-shortcuts .royal-icon{width:clamp(45px,12cqw,72px)!important;height:clamp(45px,12cqw,72px)!important}.home-shortcuts.left{gap:clamp(6px,1.1cqh,14px);top:5%;bottom:auto}.home-shortcuts.left button{font-size:clamp(13px,3.4cqw,21px);gap:1px;min-height:0}.home-shortcuts.left .menu-medallion,.home-shortcuts.left .royal-icon{width:clamp(40px,11cqw,66px)!important;height:clamp(40px,11cqw,66px)!important}
/* Tall map paintings retain their 1:3 proportions and overlap through mist. */
.level-grid.adventure-map .atlas-terrain.expanded-terrain{left:50%;transform:translateX(-50%);max-width:none}.atlas-terrain.expanded-terrain img{object-fit:contain;max-width:none;mask-image:linear-gradient(to bottom,transparent,#000 120px,#000 calc(100% - 120px),transparent)}.atlas-terrain.expanded-terrain img:first-child{mask-image:linear-gradient(to bottom,#000,#000 calc(100% - 120px),transparent)}.atlas-terrain.expanded-terrain img:last-child{mask-image:linear-gradient(to bottom,transparent,#000 120px,#000)}
/* Three distinct metal palettes, twelve sectors, an exactly circular outer ring. */
body[data-tab] #screen-fortune{display:flex;flex-direction:column;align-items:center;gap:10px;overflow-y:auto;container-type:normal;padding:12px 14px 18px;text-align:center}
body[data-tab] #screen-fortune[hidden]{display:none}#screen-fortune>*{flex-shrink:0}#screen-fortune .panel-heading,#screen-fortune .wheel-tabs{width:100%;margin:0}#screen-fortune .panel-heading p{margin:5px 0 0;font-size:12px}#screen-fortune .wheel-tabs button{min-height:48px}#screen-fortune .fortune-stage{--wheel-radius:160px;position:relative;box-sizing:border-box;width:min(100%,350px);height:auto;min-height:0;max-height:none;aspect-ratio:1;flex:none;margin:14px auto 8px;padding:14px;border:2px solid var(--metal);border-radius:50%;background:repeating-conic-gradient(from 0deg,var(--metal) 0deg 1deg,transparent 1deg 15deg),radial-gradient(circle,transparent 63%,#171322 64%,#645971 67%,#171322 70%);box-shadow:0 8px 28px #07031088,inset 0 0 0 4px #171322,inset 0 0 0 6px var(--metal)}
#screen-fortune .fortune-stage:before,#screen-fortune .fortune-stage:after{display:none;content:none}#screen-fortune[data-wheel=free]{--sector-a:#133c51;--sector-b:#235973;--metal:#c0e4ed;--jewel:#8edbff}#screen-fortune[data-wheel=gold]{--sector-a:#4a2917;--sector-b:#785124;--metal:#e6bf7a;--jewel:#ffc86b}#screen-fortune[data-wheel=crystals]{--sector-a:#322047;--sector-b:#593374;--metal:#dbc3f2;--jewel:#d4a2ff}
body #screen-fortune[data-wheel] .fortune-wheel{position:relative;inset:auto;box-sizing:border-box;width:100%;height:100%;border:2px solid var(--metal);border-radius:50%;background:repeating-conic-gradient(from 0deg,#f4e8cb77 0deg .6deg,transparent .6deg 30deg),repeating-conic-gradient(from 0deg,var(--sector-a) 0deg 30deg,var(--sector-b) 30deg 60deg);box-shadow:inset 0 0 0 4px #0a081b88,inset 0 0 30px #02010a88;overflow:hidden}
body #screen-fortune .wheel-prize{left:50%;top:50%;transform:rotate(var(--angle));width:0;height:0}body #screen-fortune .wheel-prize>span{left:-22px;bottom:calc(var(--wheel-radius,160px) * .64 - 19px);width:44px;height:38px;display:flex;flex-direction:column;justify-content:center;gap:0;transform:rotate(calc(0deg - var(--angle)));font-size:13px;line-height:1.1;color:#fff5e5;text-shadow:0 1px 3px #000}body #screen-fortune .wheel-prize b{background:transparent;padding:0}body #screen-fortune .wheel-prize .currency-icon,body #screen-fortune .wheel-prize .item-art{width:25px;height:25px;min-width:25px;min-height:25px;margin:0}body #screen-fortune[data-wheel] .wheel-pointer{position:absolute;z-index:5;left:50%;top:-9px;width:24px;height:38px;transform:translateX(-50%);background:linear-gradient(90deg,var(--metal),#fff5df,var(--metal));clip-path:polygon(50% 0,100% 25%,50% 100%,0 25%);filter:drop-shadow(0 2px 3px #000)}body #screen-fortune[data-wheel] .wheel-hub{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:23%;height:23%;border-radius:50%;border:3px solid var(--metal);background:radial-gradient(circle at 40% 30%,var(--sector-b),#120a20);box-shadow:0 3px 9px #05010bcc,inset 0 0 0 3px #150d23;display:grid;place-items:center;z-index:3;pointer-events:none}body #screen-fortune .wheel-hub img{display:block;width:72%;height:72%;object-fit:contain;filter:drop-shadow(0 0 8px var(--jewel))}#screen-fortune .fortune-result{margin:0;min-height:24px;font-size:18px;line-height:1.4}#screen-fortune .fortune-spin{min-height:44px;max-width:100%;width:320px}#screen-fortune .fortune-timer{margin:0;min-height:18px;font-size:11px}#screen-fortune .odds-button{min-height:36px;margin:0;padding:4px 10px}
@media(min-width:700px){#screen-shop{max-width:720px}.shop-items:has(.jewelry-card){grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:360px){.shop-tabs button{font-size:11px}.shop-card{grid-template-columns:48px minmax(0,1fr) 60px;gap:8px}.shop-card>.item-art,.shop-card>.shop-scroll{width:46px;height:46px}.shop-card h2{font-size:15px}.shop-card button{min-width:56px;padding:6px}.home-shortcuts.left{top:3%;gap:5px}.home-shortcuts.left button{font-size:12px}.home-shortcuts.left .menu-medallion,.home-shortcuts.left .royal-icon{width:37px!important;height:37px!important}body #screen-fortune .wheel-prize>span{font-size:11px}}
@media(max-height:650px) and (max-width:600px){body[data-tab=home] .bottom-nav .royal-icon{width:30px!important;height:30px!important}.home-shortcuts.left{top:1%;gap:2px}.home-shortcuts.left .menu-medallion,.home-shortcuts.left .royal-icon{width:33px!important;height:33px!important}.home-shortcuts.left button{font-size:11px}.home-shortcuts.right .royal-icon,.home-shortcuts.right .menu-medallion{width:38px!important;height:38px!important}body[data-tab] #screen-fortune{gap:6px}#screen-fortune .fortune-stage{width:min(100%,290px)}#screen-fortune .fortune-result{font-size:14px}}
@media(max-height:500px) and (min-width:601px){body[data-tab] #screen-fortune{display:grid;grid-template-columns:minmax(190px,1fr) minmax(260px,1fr);grid-template-rows:repeat(6,auto);gap:6px 18px;padding:12px 20px}#screen-fortune .fortune-stage{grid-column:1;grid-row:1/7;width:min(100%,270px);height:auto}#screen-fortune .panel-heading{grid-column:2;grid-row:1}#screen-fortune .wheel-tabs{grid-column:2;grid-row:2}#screen-fortune .fortune-result{grid-column:2;grid-row:3;font-size:14px}#screen-fortune .fortune-spin{grid-column:2;grid-row:4}#screen-fortune .fortune-timer{grid-column:2;grid-row:5}#screen-fortune .odds-button{grid-column:2;grid-row:6}body[data-tab=home] .bottom-nav .royal-icon{width:25px!important;height:25px!important}.home-shortcuts.left .menu-medallion,.home-shortcuts.left .royal-icon{width:29px!important;height:29px!important}.home-shortcuts.left button{font-size:10px}.home-shortcuts.left{top:1%;gap:2px}}

/* Reserve space above portraits for tall crowns. */
#screen-profile .profile-identity{margin-top:42px}.jewelry-preview{padding-top:48px}.person-row .avatar{margin-top:12px}

@media(max-height:500px) and (min-width:601px){.home-shortcuts.right .royal-icon,.home-shortcuts.right .menu-medallion{width:37px!important;height:37px!important}}


/* polish.css */
/* Illustrated medallions share the neighboring icons' silver and amethyst art. */
.home-shortcuts .illustrated-medallion{border:0;border-radius:0;box-shadow:none;background:var(--medallion-art) center/contain no-repeat;filter:drop-shadow(0 3px 4px #08030bc0)}
.shop-medallion{--medallion-art:url('/assets/menu-shop-35.webp')}.swords-medallion{--medallion-art:url('/assets/menu-tournament-35.webp')}
body[data-tab] #screen-tournaments .panel-heading{padding:0;margin:0 0 20px;gap:8px}
[data-title-art=tournaments] .sigil-lettering{background:url('/assets/title-tournament-35.webp') center/contain no-repeat;width:min(100%,360px);height:48px;aspect-ratio:auto}
.jewelry-art.jewelry-spark{background-image:url('/assets/jewelry-spark-35.webp');background-size:200% 200%}
.jewelry-spark.equipped-head.kind-crown{top:-45%}.jewelry-spark.equipped-head.kind-tiara{top:-40%}.jewelry-spark.equipped-head.kind-diadem{top:-25%}
/* Reserve headroom within the header so equipped crowns stay inside the viewport. */
body[data-tab=home] .royal-account .header-portrait{grid-row:1/3;grid-column:1;position:relative;display:block;isolation:isolate;width:82%;height:auto;aspect-ratio:1;align-self:center;justify-self:center;margin-top:14px;transform:translateY(5px);overflow:visible}
body[data-tab=home] .royal-account .header-portrait>img{display:block;width:100%;height:100%;object-fit:cover;border-radius:50%;box-sizing:border-box}
body[data-tab=home] .royal-account{overflow:visible}
body[data-tab=home] .header-portrait .equipped-neck{top:55%;width:52%;height:52%;left:24%}

/* Soft dark backing separates home shortcuts from the detailed illustration. */
body[data-tab=home] :is(.home-shortcuts,.bottom-nav) button{position:relative;isolation:isolate}
body[data-tab=home] :is(.home-shortcuts,.bottom-nav) button:before{content:"";position:absolute;inset:-5px -9px -8px;z-index:-1;border-radius:50%;background:radial-gradient(ellipse at 50% 56%,#070310a6 0%,#07031066 42%,#07031000 74%);pointer-events:none}
body[data-tab=home] .bottom-nav button:before{inset:0 -4px -4px;opacity:.65}
body[data-tab=home] .home-shortcuts button{ text-shadow:0 2px 4px #05010ee6 }
body[data-tab=home] .header-actions :is(.currency-icon,.royal-icon){filter:drop-shadow(0 3px 4px #05010eb3)}


/* combat.css */
/* Plate armor and its break fragments have a distinct material from frozen cells. */
body .cell.boss-shield .ice-shell{background-image:url('/assets/boss-shield-37.webp');background-size:contain;filter:drop-shadow(0 2px 2px #090510b3);opacity:1;inset:0}
.shield-break{position:absolute;inset:0;background:url('/assets/boss-shield-37.webp') center/contain no-repeat;pointer-events:none;z-index:9}
body #screen-play[data-quick-weapons=true] .controls{height:84px;min-height:84px;grid-template-rows:42px 36px;row-gap:6px}
.quick-weapons{grid-column:1/-1;grid-row:1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;min-width:0}
.quick-weapons[hidden]{display:none}
body .controls .quick-weapon{position:relative;display:flex;justify-content:center;align-items:center;gap:3px;height:42px;min-height:42px;min-width:0;padding:3px 4px;font-size:11px;line-height:1.1;border:1px solid #8d71a2;border-radius:7px;background:linear-gradient(#34223e,#1b1029)}
.quick-weapon .item-art{width:28px;height:28px;flex:none}
.quick-weapon .quick-count{position:absolute;top:0;left:4px;padding:1px 3px;min-width:12px;font-size:10px;font-variant-numeric:tabular-nums;color:#f7e9ff;background:#1a0d2ee6;border:1px solid #987bb2;border-radius:5px}
.quick-weapon:disabled{opacity:.45}.quick-weapon[aria-pressed=true]{border-color:#e2c1ff}.controls.targeting .quick-weapons{visibility:hidden}
body #screen-play[data-quick-weapons=true][data-compact-board=true]{grid-template-rows:72px 20px 32px minmax(0,1fr) 40px}
body #screen-play[data-quick-weapons=true][data-adventure=true][data-compact-board=true]{grid-template-rows:52px 20px 36px minmax(0,1fr) 40px}
body #screen-play[data-quick-weapons=true][data-compact-board=true] .controls{height:40px;min-height:40px;grid-template-columns:repeat(3,minmax(0,1fr)) minmax(58px,1.3fr) 34px 34px;grid-template-rows:40px;gap:4px;padding:0}
#screen-play[data-compact-board=true] .quick-weapons{display:contents}
body #screen-play[data-compact-board=true] .quick-weapon{height:40px;min-height:40px;padding:2px}
#screen-play[data-compact-board=true] .quick-weapon>span:not(.item-art){display:none}
#screen-play[data-compact-board=true] .controls #hint .utility-icon{display:none}
body #screen-play[data-compact-board=true] .controls #hint{font-size:9px;padding:2px}
#screen-play[data-compact-board=true] .controls #inventory-open .item-art,#screen-play[data-compact-board=true] .controls #restart .utility-icon{width:26px;height:26px}
@media(max-height:500px) and (min-width:601px){
 body #screen-play[data-quick-weapons=true]{grid-template-rows:0 44px 26px 32px minmax(0,1fr) 84px}
 body #screen-play[data-quick-weapons=true][data-adventure=true]{grid-template-rows:0 44px 26px minmax(0,1fr) 84px}
 body #screen-play[data-quick-weapons=true] .controls{height:84px;min-height:84px}
 body #screen-play[data-quick-weapons=true] .quick-weapon{flex-direction:column;gap:0;padding:1px;font-size:10px}
 #screen-play .quick-weapon .item-art{width:24px;height:24px}
}


/* encounters.css */
/* The molten texture alone identifies an explosive crystal. */
body .cell.bomb .bomb-marker{display:none}
body .cell.bomb .crystal{outline:0}
body .adventure-map .level-node .level-number{filter:drop-shadow(0 5px 3px #080411e6) drop-shadow(0 0 9px #080411d9)}
body .adventure-map .locked .level-number{filter:grayscale(.85) brightness(.8) drop-shadow(0 5px 3px #080411e6) drop-shadow(0 0 9px #080411d9)}
body .adventure-map .next-level .level-number{filter:drop-shadow(0 5px 4px #080411) drop-shadow(0 0 9px #080411) drop-shadow(0 0 3px #ffdc8f)}
body .adventure-map .level-node{isolation:isolate}
body .adventure-map .level-node::before{content:'';position:absolute;top:-8px;left:6px;width:100px;height:112px;background:radial-gradient(ellipse,#090413a6 20%,#09041355 48%,transparent 72%);z-index:-1;pointer-events:none}
body .end-character{background:transparent;border-radius:0;overflow:visible}
body .end .end-character img{mask-image:radial-gradient(ellipse at 50% 42%,#000 30%,#000b 55%,transparent 73%);object-position:center top;filter:drop-shadow(0 0 8px #b389c72e)}
.end-character::before{content:'';position:absolute;inset:8%;background:var(--end-portrait) center 22%/cover;filter:blur(12px);opacity:.42;mask-image:radial-gradient(ellipse,#000 20%,transparent 70%);pointer-events:none}
.story-shields{display:flex;align-items:center;gap:12px;text-align:left;padding:12px;border:1px solid #b0a1cb55;border-radius:12px;background:#120c22b8;font-size:13px;line-height:1.5;color:#e1d6ec}
.story-shields img{width:48px;height:52px;object-fit:contain;flex:none}.story-shields strong{display:block;color:#f3e9ff;margin-bottom:3px}
.scene-banner{position:relative}.boss-presence{position:absolute;inset:0;z-index:5;display:flex;align-items:center;gap:8px;padding:2px 40px 2px 10px;pointer-events:none;border-radius:inherit;background:linear-gradient(90deg,#171022f5,#2c1739f5 70%,#171022f5);overflow:hidden}
#adventure-hud{position:relative}#adventure-hud .boss-presence{right:82px;padding:0 6px;border-radius:8px}#adventure-hud .boss-presence img{width:36px}#adventure-hud .boss-presence strong{font-size:11px}#adventure-hud .boss-presence span{font-size:9px}
.boss-presence img{height:100%;width:54px;object-fit:cover;object-position:50% 20%;mask-image:radial-gradient(ellipse,#000 32%,transparent 75%);flex:none}.boss-presence p{margin:0;min-width:0;font-size:11px;color:#dbcae7;line-height:1.25}.boss-presence strong{display:block;color:#f5dcac;font-size:13px}.boss-presence span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.detonation-layer{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:9;border-radius:inherit}.detonation{position:absolute;width:var(--blast-size);height:var(--blast-size);margin:calc(var(--blast-size) / -2);pointer-events:none;border-radius:50%}
.detonation.flare{background:radial-gradient(circle,#fff8dd 0%,#ffdfa3b3 15%,#ff882d77 40%,transparent 70%)}
.detonation.wave{border:2px solid #ffe5ba;box-shadow:0 0 14px #ff963a99,inset 0 0 8px #ffca7399}
.detonation.ember{width:5px;height:9px;margin:-3px;background:#ffe4aa;box-shadow:0 0 7px #ff8138;border-radius:60% 20%}
#home-player-level{cursor:pointer;border:0;background:transparent;color:inherit;font:inherit;padding:0;text-align:left;white-space:nowrap}
body[data-tab=home] .royal-account{position:relative}body[data-tab=home] .royal-account>[data-tab=profile]{position:absolute;inset:0 auto 0 0;width:54px;border:0;background:transparent;padding:0;z-index:3}
#experience-dialog{width:min(390px,calc(100vw - 24px));padding:28px 22px 22px;text-align:center;border:1px solid #b7a1cf88;border-radius:22px;background:radial-gradient(ellipse at 50% 0,#51326599,transparent 65%),#191025;box-shadow:0 24px 70px #000a,inset 0 1px #ead5ff33}
#experience-dialog .experience-emblem{display:grid;place-items:center;width:82px;height:82px;margin:4px auto 14px;border-radius:50%;border:1px solid #cab1e488;box-shadow:0 0 0 6px #ab7acf12,inset 0 0 25px #8d5cb040;background:#291938;font:600 34px Georgia,serif;color:#f0deff}
#experience-dialog h2{font-size:24px;margin:8px 0;color:#f3e3ff}#experience-dialog p{font-size:13px;line-height:1.6;color:#cdbbdc}#experience-dialog .experience-count{display:flex;justify-content:space-between;gap:12px;margin:22px 0 9px;font-size:12px;color:#ecdcfa}#experience-dialog progress{width:100%;height:12px;accent-color:#b389db}#experience-dialog .experience-rules{text-align:left;border-top:1px solid #a486bb33;padding-top:15px;margin-top:20px}#experience-dialog .primary{width:100%;margin-top:8px}
@media(max-height:500px){#experience-dialog{padding:14px 20px}#experience-dialog .experience-emblem{width:50px;height:50px;font-size:26px;margin:0 auto 8px}#experience-dialog .experience-count{margin-top:12px}#experience-dialog .experience-rules{margin-top:10px;padding-top:8px}}

@media(max-height:500px) and (min-width:601px){body[data-tab=home] .royal-account>[data-tab=profile]{width:30px}}
@media(min-width:601px) and (min-height:800px) and (orientation:portrait){body[data-tab=home] .royal-account>[data-tab=profile]{width:78px}}


/* altar.css */
/* Recessed field, no decorative frame or selection glow. */
body{--altar-accent:#c4addd;--altar-tint:#30213d;--altar-light:#c8a8e324}
body[data-realm='0']{--altar-accent:#e2b591;--altar-tint:#33212b;--altar-light:#e9a16d24}
body[data-realm='1']{--altar-accent:#b8dbea;--altar-tint:#202e3d;--altar-light:#91d1ec24}
body[data-realm='2']{--altar-accent:#c3a4de;--altar-tint:#30203e;--altar-light:#be8fe224}
body[data-realm='3']{--altar-accent:#c4c3ef;--altar-tint:#252640;--altar-light:#b9b5f524}
body[data-realm='4']{--altar-accent:#9fcec9;--altar-tint:#1d3036;--altar-light:#80d6c424}
body[data-realm='5']{--altar-accent:#d5c7e6;--altar-tint:#2d293d;--altar-light:#d3bef324}
body[data-realm='6']{--altar-accent:#e5cfa8;--altar-tint:#302c35;--altar-light:#e6cf9924}
body[data-realm='7']{--altar-accent:#cccbf2;--altar-tint:#29283f;--altar-light:#c0baff24}
body[data-realm='8']{--altar-accent:#dfc39a;--altar-tint:#302a32;--altar-light:#e2be8624}
body .board-wrap{border:0;border-image:none;border-radius:8px;padding:0;background:transparent;box-shadow:none}
body .board{position:relative;gap:3px;padding:4px;border:1px solid #0a0712;border-radius:8px;background:radial-gradient(ellipse at 50% 0,var(--altar-tint),#100c19 70%);box-shadow:inset 0 2px 6px #0009;isolation:isolate}
body .cell{border-radius:6px;background:linear-gradient(155deg,#090713db,#1d1526d9);box-shadow:inset 0 2px 3px #030107a6,inset 0 -1px #a38bb226;isolation:isolate}
body .cell::before{content:'';position:absolute;left:12%;right:12%;bottom:3%;height:30%;background:radial-gradient(ellipse,#000b,transparent 70%);pointer-events:none;z-index:0}
body .cell .gem-piece{z-index:1;transition:none}
body .cell .gem-piece .crystal{transform:translateY(-1px) scale(1.27);filter:none}
body .cell.bomb .gem-piece .crystal{filter:brightness(.8) saturate(1.2)}
body .cell.selected{outline:none;background:linear-gradient(155deg,#090713db,#1d1526d9);box-shadow:inset 0 2px 3px #030107a6,inset 0 -1px #a38bb226;z-index:3}
body .cell.selected .gem-piece{animation:none;transform:translateY(-2px) scale(1.025)}
body .cell.selected .shine::after{animation:none}
body .cell.hint{outline:2px dashed #e9d2a9;outline-offset:-2px;background:#322538}
body .cell.booster-preview .gem-piece .crystal{filter:brightness(1.35)}
/* Background motion is unnecessary behind a board the player is reading. */
body[data-tab=play] .atmosphere *{animation-play-state:paused}
@media(max-width:360px),(max-height:500px){body .board-wrap{padding:0;border-radius:8px}body .board{gap:2px;padding:2px;border-radius:5px}body .cell{border-radius:4px}}
@media(prefers-reduced-motion:reduce){body .cell .gem-piece,body .cell::after{transition:none}body .cell.selected .gem-piece{transform:none}}
body .cell.selected:focus-visible{outline:2px solid #f9db94;outline-offset:-2px}


/* treasures.css */
.amulet-art{display:block;width:64px;height:78px;object-fit:contain;flex:none}.scroll-card>.amulet-art{width:56px;height:70px}.necklace-note{font-size:11px!important;line-height:1.4!important;color:#dbc9ec!important;margin:5px 0 0!important}
/* Lift crowns away from the face, consistently in header/profile/rankings. */
.equipped-head.kind-crown{width:88%;height:88%;left:6%;top:-67%}
.jewelry-spark.equipped-head.kind-crown{width:88%;height:88%;left:6%;top:-56%}
#inventory-dialog{border:1px solid #a78fbc88;border-radius:20px;background:radial-gradient(ellipse at 50% 0,#473054aa,transparent 55%),#191024;box-shadow:0 18px 60px #000a;overscroll-behavior:contain}
.inventory-handle{width:44px;height:4px;border-radius:4px;background:#aa92bf88;margin:-7px auto 14px}
#inventory-dialog .dialog-heading{position:sticky;top:-18px;z-index:3;background:#21142eee;padding:10px 0;margin-top:-5px;border-bottom:1px solid #a285b533}
.inventory-close{display:flex;align-items:center;justify-content:center;gap:7px;min-height:38px;padding:7px 12px;border:1px solid #b89bc877;border-radius:12px;background:linear-gradient(#513461,#291b38);color:#f0e0fa;font-size:12px;box-shadow:inset 0 1px #e6cefa22}
.inventory-close span{font-size:21px;line-height:1;color:#d8bbec}
#collection-unlocked{width:min(360px,calc(100vw - 28px));text-align:center;padding:24px;border:1px solid #c8a4d388;border-radius:20px;background:radial-gradient(ellipse at 50% 25%,#69466b66,transparent 65%),#1b1028;box-shadow:0 20px 65px #000a}
#collection-unlocked .trophy-art{width:130px;height:130px;margin:15px auto 5px;opacity:1}
#collection-unlocked h2{font-size:24px;color:#f1dcaf;margin:12px 0}#collection-unlocked h3{font-size:17px;margin:0 0 12px;color:#f3e3fa}#collection-unlocked p{font-size:13px;line-height:1.6;color:#d6c1e2}#collection-unlocked .primary{width:100%;margin:8px 0}#collection-unlocked form{margin:0}
@media(max-height:500px){#collection-unlocked{padding:14px 20px}#collection-unlocked .trophy-art{width:76px;height:76px;margin:8px auto}#collection-unlocked h2{font-size:21px;margin:6px 0}#collection-unlocked p{margin:8px 0}}


/* relics.css */
.amulet-art{width:76px;height:92px;object-fit:contain;filter:drop-shadow(0 3px 3px #05020bd9)}
.scroll-card>.amulet-art{width:65px;height:82px}
.enhancement-status{font-size:11px;color:#c9b6d9;line-height:1.55;margin-top:7px}.enhancement-status details{margin-top:5px}.enhancement-status summary{cursor:pointer;color:#e2cdef}
body .item-art.simple-weapon{background:none!important;background-image:none!important;filter:drop-shadow(0 2px 2px #08031080)}
.simple-weapon .weapon-image{display:block;width:100%;height:100%;max-width:none;object-fit:contain;pointer-events:none}
body .controls .quick-weapon{isolation:isolate;border:0!important;border-image:none!important;border-radius:0;background:none!important;box-shadow:none!important;text-shadow:0 2px 3px #000,0 0 5px #000}
body .controls .quick-weapon::before{content:'';position:absolute;inset:1px -5px;background:radial-gradient(ellipse,#07030dcc 10%,#07030d88 45%,transparent 74%);pointer-events:none;z-index:-1}
body .controls .quick-weapon::after{display:none}
body .quick-weapon .quick-count{border:0;border-radius:0;background:none;padding:0 2px;text-shadow:0 1px 3px #000,0 0 4px #000;font-size:11px;color:#fff0d7}
body .quick-weapon .item-art{width:30px;height:30px}
body .quick-weapon[aria-pressed=true] .item-art{transform:translateY(-2px)}
body .quick-weapon[aria-pressed=true]{color:#ffe3a7}
@media(max-height:500px) and (min-width:601px){body #screen-play .quick-weapon .item-art{width:25px;height:25px}}


/* styles/interface.css */
/* quality.css */
/* Shared interface rules. Keep repairs here by component; no release-specific layer. */
:root{--ui-surface:#180e28;--ui-muted:#d6bedf;--ui-line:#88609d;--ui-touch:44px;--ui-dialog-radius:14px}
.purchase-dialog{width:min(380px,calc(100vw - 32px));border-radius:var(--ui-dialog-radius);padding:24px;text-align:center;background:var(--ui-surface)}
.purchase-art{height:88px;display:flex;justify-content:center;align-items:center;margin-bottom:12px}
.purchase-art>img{width:80px;height:80px;object-fit:contain;border-radius:10px}
.purchase-art>.jewelry-art,.purchase-art>.item-art,.purchase-art>.royal-icon{width:80px!important;height:80px!important;flex:none}
.purchase-dialog h2{font-size:23px;line-height:1.25;margin:0 0 12px}
.purchase-dialog p{font-size:14px;line-height:1.55;color:var(--ui-muted)}
.purchase-price{display:flex;align-items:center;justify-content:center;gap:8px;margin:18px 0 8px;font-size:24px}
.purchase-price .currency-icon{width:30px;height:34px}.purchase-dialog .dialog-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px}
.purchase-dialog button{min-height:var(--ui-touch)}
#connection-recovery{width:100%;padding:12px;background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:10px;font-size:13px;line-height:1.5;grid-column:1/-1;z-index:12}
#connection-recovery:not([hidden]){display:flex;align-items:center;gap:12px}#connection-recovery button{min-height:44px;flex:none}
body #screen-play .objective{background:#140c22ed;border-radius:8px;height:auto;min-height:44px;padding:4px 10px;flex-wrap:wrap;gap:4px 10px}
body #screen-play .objective #goal-label{font-size:12px;font-weight:500;color:#f6eafa;max-width:none;line-height:1.3;flex:1}
body #screen-play .objective .goal-track{min-width:40px;flex:1}
body #screen-play #story-open{min-height:44px;padding:5px 8px;display:flex;align-items:center;font-size:12px;order:3}
body #screen-play .heat-meter{background:#140c22e8;border-radius:8px;padding:5px 10px}
body #screen-play .heat-heading{font-size:12px;color:#f6eafa}
body #home-player-level{position:relative;min-height:44px;min-width:60px;padding:4px 6px;margin:-8px -6px -8px;text-align:left;z-index:2}
body #home-player-level:focus-visible{outline:2px solid #f4d297;outline-offset:2px}
body .profile-jewelry-link,body #use-telegram-name,body .odds-button{min-height:44px;padding-top:10px;padding-bottom:10px}
body .header-actions .essence{min-height:44px}
body #screen-companions .companion-heading{display:grid;place-items:center;min-height:62px;padding:8px 20px;border:8px solid transparent;border-image:url('/assets/gothic-panel-frame.webp') 72 120 / 18px 30px / 0 stretch;background:linear-gradient(90deg,#160c2480,#291139b3,#160c2480);font:500 clamp(20px,5vw,28px)/1.15 Georgia,serif;color:#efdcff;text-align:center}
body #screen-companions>.text-button{min-height:44px}
body .companion-card{gap:18px;padding:20px 4px;border-bottom:1px solid #88609d45}
body .companion-card h2{font:600 18px/1.25 'Golos Text',sans-serif;color:#efcf98}
body .companion-card p{font-size:13px;line-height:1.5;color:var(--ui-muted)}
body .companion-card button{min-height:44px}
body .cell[data-sprite-missing=true] .crystal{visibility:hidden}
body .cell[data-sprite-missing=true] .gem-piece::before{content:'';position:absolute;inset:18%;background:var(--fallback-gem);clip-path:polygon(50% 0,90% 30%,75% 80%,50% 100%,25% 80%,10% 30%)}
@media(max-width:600px){
 body #screen-play[data-compact-board=true]{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;overflow-y:auto;overscroll-behavior:contain;gap:5px;padding:4px 8px 12px}
 body #screen-play[data-compact-board=true]>*{flex-shrink:0}
 body #screen-play[data-compact-board=true] .scene-banner{display:none}
 body #screen-play[data-compact-board=true] .stats{position:static;width:100%;height:44px;min-height:44px;margin:0;padding:3px 8px}
 body #screen-play[data-compact-board=true] .stats strong{font-size:23px}
 body #screen-play[data-compact-board=true] .objective{width:100%;min-height:44px;margin:0}
 body #screen-play[data-compact-board=true] .adventure-hud{width:100%;min-height:44px;height:auto;margin:0}
 body #screen-play[data-compact-board=true] .adventure-hud button{min-height:44px}
 body #screen-play[data-compact-board=true] .board-wrap{width:var(--board-size);height:var(--board-height);min-height:var(--board-height);margin:0 auto}
 body #screen-play[data-compact-board=true] .controls{width:100%;height:auto;min-height:92px;display:grid;grid-template-columns:minmax(100px,1fr) 52px 52px;grid-template-rows:44px 44px;gap:4px;padding:0}
 body #screen-play[data-compact-board=true] .quick-weapons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-column:1/-1;grid-row:1;height:44px}
 body #screen-play[data-compact-board=true] .quick-weapon{height:44px;min-height:44px}
 body #screen-play[data-compact-board=true] .quick-weapon>span:not(.item-art){display:inline}
 body #screen-play[data-compact-board=true] .controls>button{height:44px;min-height:44px;grid-row:2;grid-column:auto}
 body #screen-play[data-compact-board=true] .controls:has(.quick-weapons[hidden]){grid-template-rows:44px;min-height:44px}
 body #screen-play[data-compact-board=true] .controls:has(.quick-weapons[hidden])>button{grid-row:1}
 body #screen-play[data-compact-board=true] .status{height:auto;min-height:22px;font-size:12px;background:#140c22e8;padding:5px 8px;border-radius:6px}
 body #screen-play[data-compact-board=true] .heat-meter{width:100%;height:auto;min-height:28px}
 body #connection-recovery:not([hidden]){flex-direction:column;align-items:stretch}
}
@media(max-height:500px) and (min-width:601px){
 body .bottom-nav button{font-size:11px;line-height:1;gap:1px;padding:0 2px 5px}
 body .bottom-nav .royal-icon,body[data-tab=home] .bottom-nav .royal-icon{width:23px!important;height:23px!important}
}

@media(max-width:600px) and (max-height:600px){body #screen-play[data-compact-board=true] .stats{position:sticky;top:0;z-index:15;background:#180e28}body #screen-play[data-compact-board=true] .board-wrap{scroll-margin-top:48px}}
/* Currency shop: static treasure art, amethyst surfaces and explicit Stars prices. */
/* The phone board keeps its position; surrounding information uses compact rows. */
@media(max-width:600px){
 body[data-tab=play]{padding-left:max(env(safe-area-inset-left),var(--safe-left));padding-right:max(env(safe-area-inset-right),var(--safe-right))}
 body[data-tab=play] main{padding:0;overflow:hidden}
 body #screen-play[data-edge-board=true]{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;padding:0;overflow:hidden;overscroll-behavior:none;touch-action:none}
 body #screen-play[data-edge-board=true]>*{flex-shrink:0}
 body #screen-play[data-edge-board=true] #connection-recovery:not([hidden]){position:absolute;top:0;left:6px;right:6px;z-index:50}
 body #screen-play[data-edge-board=true] .scene-banner{display:none}
 body #screen-play[data-edge-board=true] .stats{position:static;width:calc(100% - 12px);height:36px;min-height:36px;margin:0;padding:2px 8px}
 body #screen-play[data-edge-board=true] .stats strong{font-size:22px}
 body #screen-play[data-edge-board=true] .objective{width:calc(100% - 12px);min-height:32px;height:32px;margin:0;padding:0 6px;flex-wrap:nowrap;gap:5px}
 body #screen-play[data-edge-board=true] #story-open{min-height:32px;padding:0 5px;font-size:11px}
 body #screen-play[data-edge-board=true] #goal-label{font-size:11px}
 body #screen-play[data-edge-board=true] .adventure-hud{width:calc(100% - 12px);height:44px;min-height:44px;margin:0;padding:0 4px}
 body #screen-play[data-edge-board=true] .board-wrap{width:var(--board-size);height:var(--board-height);min-height:var(--board-height);margin:0;border-radius:0}
 body #screen-play[data-edge-board=true] .board{padding:0 1px;border:0;border-radius:0}
 body #screen-play[data-edge-board=true] .controls{display:grid;grid-template-columns:minmax(0,1fr) 48px 44px 44px;grid-template-rows:48px;gap:3px;width:calc(100% - 8px);height:48px;min-height:48px;padding:0;margin:0}
 body #screen-play[data-edge-board=true] .quick-weapons{grid-column:auto;grid-row:auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));height:48px;gap:2px}
 body #screen-play[data-edge-board=true] .quick-weapon{height:48px;min-height:48px;min-width:0;padding:2px;background:none;border:0}
 body #screen-play[data-edge-board=true] .quick-weapon>span:not(.item-art){display:none}
 body #screen-play[data-edge-board=true] .quick-weapon .item-art{width:38px;height:38px}
 body #screen-play[data-edge-board=true] .controls>button{height:48px;min-height:48px;min-width:0;padding:2px;font-size:0;grid-column:auto;grid-row:auto}
 body #screen-play[data-edge-board=true] #hint-label,body #screen-play[data-edge-board=true] #hint-currency{display:none}
 body #screen-play[data-edge-board=true] .controls:has(.quick-weapons[hidden]){grid-template-columns:1fr 48px 48px}
 body #screen-play[data-edge-board=true] .status{width:calc(100% - 12px);height:32px;min-height:32px;margin:0;padding:1px 3px;font-size:11px;line-height:15px;white-space:normal;overflow:hidden}
 body #screen-play[data-edge-board=true] .heat-meter{width:calc(100% - 12px);min-height:24px;height:24px;margin:0;padding:2px 8px}
 body #screen-play[data-edge-board=true] .heat-heading{font-size:10px}
}
@media(max-width:600px) and (max-height:600px){
 body[data-tab=play]{grid-template-rows:0 minmax(0,1fr) 52px}
 body[data-tab=play]>header{display:none}
 body[data-tab=play]>main{grid-row:2}
 body[data-tab=play]>.bottom-nav{grid-row:3}
 body[data-tab=play] .bottom-nav .royal-icon{width:24px!important;height:24px!important}
 body[data-tab=play] .bottom-nav button{font-size:11px;gap:0;padding:1px}
 body #screen-play[data-edge-board=true] .heat-meter{display:none}
 body #screen-play[data-edge-board=true] .stats{height:30px;min-height:30px}
}
.telegram-star{display:inline-block;width:22px;height:22px;flex:none;color:#ffd780;vertical-align:middle}
body .shop-tabs{display:flex;overflow-x:auto;gap:4px;scrollbar-width:thin;padding-bottom:8px}
body .shop-tabs button{flex:1 0 auto;min-width:70px;padding:8px 10px}
body .shop-wallet{align-items:center;gap:14px;flex-wrap:wrap}
.stars-wallet-button{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:7px 12px;border:1px solid #ac85bd;border-radius:8px;background:#332041;color:#f7e8ff;font-size:13px}
.profile-wallet .stars-wallet-button{grid-column:1/-1;justify-self:center;margin-top:8px}
.stars-store{width:100%;padding-bottom:8px}
#screen-shop[data-currency=true] .shop-description{display:none}
#screen-shop[data-currency=true] .shop-wallet .stars-wallet-button{display:none}
#screen-shop[data-currency=true] .shop-wallet{min-height:40px;margin-bottom:12px}
.stars-store-heading{display:flex;align-items:center;gap:14px;margin:6px 0 14px;padding:14px 0;border-bottom:1px solid #88609d45}
.stars-store-heading>.telegram-star{width:38px;height:38px}
.stars-store-heading h2{margin:0;font-size:23px;color:#f4dcac;line-height:1.2}
.stars-store-heading p{margin:6px 0 0;color:#d6bedf;font-size:14px;line-height:1.4}
.stars-currency-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-bottom:10px}
.stars-currency-tabs button{min-height:44px;border:1px solid #88609d;border-radius:8px;background:#1b102a;color:#d9c4e7;padding:8px 12px}
.stars-currency-tabs button[aria-pressed=true]{background:#513066;border-color:#c09ad6;color:#fff1ff}
#stars-status{font-size:14px;line-height:1.5;min-height:21px;color:#e5d4ee;margin:10px 0 14px}
#stars-status.error{color:#ffc7b9}
.stars-packs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.stars-pack{position:relative;display:flex;flex-direction:column;align-items:center;min-width:0;padding:16px 12px 12px;border:1px solid #87649d;border-radius:12px;background:linear-gradient(155deg,#362046,#190f29 75%);text-align:center}
.stars-pack.gold{background:linear-gradient(155deg,#3e2c28,#1e1425 75%);border-color:#9b7c58}
.stars-pack.royal-pack{border-color:#e0b97c}
.stars-pack h3{font-size:14px;font-weight:500;line-height:1.35;min-height:38px;margin:0;color:#ecd8fa}
.stars-pack.gold h3{color:#f4dfb7}
.stars-pack-art{position:relative;display:block;width:96px;height:64px;margin:4px auto 8px;flex:none}
.stars-pack-art img{position:absolute;width:58px;height:58px;object-fit:contain;left:19px;top:0;filter:drop-shadow(0 4px 3px #05020885)}
.stars-pack-art img:nth-child(2){width:43px;height:43px;left:0;top:15px;transform:rotate(-18deg)}
.stars-pack-art img:nth-child(3){width:43px;height:43px;left:56px;top:19px;transform:rotate(20deg)}
.stars-quantity{font-size:30px;line-height:1.15;font-variant-numeric:tabular-nums;color:#f8e7ff}
.gold .stars-quantity{color:#ffe4a9}.stars-unit{font-size:13px;color:#d6bedf;margin:3px 0 14px}
.stars-pack button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:7px 12px;font-size:18px;font-variant-numeric:tabular-nums}
.stars-explanation{font-size:13px;line-height:1.6;color:#cdb7d9;margin:20px 0 6px}
.stars-links{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.stars-links button{min-height:44px;font-size:13px}
.stars-order{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid #88609d45;font-size:14px}
.stars-order>div{min-width:0}.stars-order strong,.stars-order small,.stars-order span{display:block}.stars-order small{font-size:11px;margin-top:6px;color:#cdb7d9;overflow-wrap:anywhere}.stars-order>span{display:flex;align-items:center;gap:6px;white-space:nowrap;color:#f4dcac}.stars-order>div>span{margin-top:4px;color:#c6dec4}
#stars-checkout,#stars-support{width:min(390px,calc(100vw - 30px));max-height:calc(var(--app-height,100dvh) - 30px);overflow:auto;padding:22px;background:#180e28;border:1px solid #a07ab8;border-radius:14px}
#stars-checkout .dialog-heading,#stars-support .dialog-heading{position:static;display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}
#stars-checkout h2,#stars-support h2{font-size:22px;line-height:1.25;margin:0}
#stars-checkout .dialog-heading button,#stars-support .dialog-heading button{min-height:44px;font-size:13px}
#stars-checkout-art .stars-pack-art{height:80px;margin:0 auto 12px;transform:scale(1.15);transform-origin:top center}
#stars-checkout-amount{font-size:29px;line-height:1.2;text-align:center;color:#f4dcac;font-weight:600}
#stars-checkout-price{display:flex;align-items:center;justify-content:center;gap:7px;font-size:15px;margin:14px 0 8px}
#stars-checkout-price strong{font-size:24px}.stars-once{font-size:14px;line-height:1.5;text-align:center;color:#d6bedf}
.stars-terms{border-block:1px solid #88609d45;padding:8px 0;margin:16px 0}
.stars-terms summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-size:14px;color:#e7c9f7}
.stars-terms p{font-size:14px;line-height:1.6;color:#d6bedf}
.stars-consent{display:flex;align-items:flex-start;gap:10px;font-size:14px;line-height:1.45;margin:18px 0;cursor:pointer}
.stars-consent input{width:22px;height:22px;min-width:22px;margin:0;accent-color:#a572c6}
#stars-pay{width:100%;min-height:48px}#stars-checkout-status,#stars-support-status{font-size:14px;line-height:1.5;color:#e8d2f4}
#stars-support p,#stars-support label{font-size:14px;line-height:1.5}#stars-support label{display:block;margin:12px 0 6px}
#stars-support select,#stars-support textarea{width:100%;font:16px/1.4 'Golos Text',sans-serif;color:#f6eafa;background:#10091d;border:1px solid #88609d;border-radius:8px;padding:10px}
#stars-support textarea{resize:vertical}#stars-support [type=submit]{width:100%;min-height:44px;margin-top:16px}
@media(min-width:900px){.stars-packs{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:360px){.stars-packs{gap:10px}.stars-pack{padding:12px 8px 10px}.stars-pack h3{font-size:13px}.stars-quantity{font-size:27px}.stars-store-heading h2{font-size:22px}}
@media(max-height:600px){
 #stars-checkout{padding:14px 18px}
 #stars-checkout .dialog-heading{margin-bottom:6px}
 #stars-checkout h2{font-size:19px}
 #stars-checkout-art .stars-pack-art{height:45px;margin:0 auto 5px;transform:scale(.7)}
 #stars-checkout-amount{font-size:25px}
 #stars-checkout-price{margin:8px 0 4px}
 #stars-checkout .stars-once{margin:4px 0}
 #stars-checkout .stars-terms{margin:8px 0;padding:0}
 #stars-checkout .stars-consent{margin:10px 0}
 #stars-checkout-status:empty{display:none}
}


/* styles/fortune-fit.css */
/* Fit the circular wheel to the space left by its controls, including Telegram insets. */
body[data-tab] #screen-fortune{overflow:hidden;overscroll-behavior:none;gap:6px;padding:8px 14px;justify-content:center}
body #screen-fortune .fortune-stage{width:var(--fortune-size,220px);height:var(--fortune-size,220px);max-width:100%;margin:10px auto 4px;flex:none;padding:clamp(6px,2vw,14px)}
body #screen-fortune .fortune-result{font-size:16px;line-height:1.25;min-height:20px}
body #screen-fortune .wheel-tabs{gap:5px}
body #screen-fortune .wheel-tabs button{padding:5px 2px;gap:3px;min-height:44px}
body #screen-fortune .wheel-tabs strong{font-size:clamp(10px,3.2vw,16px);white-space:nowrap}
body #screen-fortune .odds-button{min-height:32px;padding:3px 10px}
body #screen-fortune[data-small-wheel=true] .wheel-prize>span{width:32px;left:-16px;height:30px;bottom:calc(var(--wheel-radius) * .64 - 15px);font-size:10px}
body #screen-fortune[data-small-wheel=true] .wheel-prize .currency-icon,body #screen-fortune[data-small-wheel=true] .wheel-prize .item-art{width:18px;height:18px;min-width:18px;min-height:18px}
@media(max-height:700px){
 body #screen-fortune .panel-heading .sigil-heading{height:48px;min-height:48px;margin:0}
 body #screen-fortune .panel-heading p{margin:2px 0 0;font-size:11px}
 body[data-tab] #screen-fortune{gap:4px}
}
@media(max-height:500px) and (min-width:601px){
 body[data-tab] #screen-fortune{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,1fr);grid-template-rows:repeat(6,auto);gap:4px 14px;align-content:center;padding:8px 14px}
 body #screen-fortune .fortune-stage{grid-column:1;grid-row:1/7;justify-self:center}
}
