:root{--ink:#302f27;--muted:#8c897c;--gold:#aa8145;--line:#e5e0d4;--paper:#f8f6ef;--green:#465847}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:Segoe UI,Arial,sans-serif}button,input{font:inherit}button{cursor:pointer}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:3px solid #bb914d;outline-offset:3px}button:disabled{cursor:wait;opacity:.45}header{height:90px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 5vw}.brand{display:flex;gap:13px;align-items:center;color:var(--ink);text-decoration:none;letter-spacing:4px;font-size:21px;font-weight:600}.lotus{font-size:43px;color:var(--gold);font-weight:400}.brand small{display:block;font-size:9px;letter-spacing:2.4px;color:var(--muted);margin-top:6px}.header-right{display:flex;gap:24px;align-items:center;font-size:12px}.header-right button{background:none;border:0;color:#66695d}.live{color:#65765a;font-size:11px}main{max-width:1540px;margin:auto;padding:0 5vw}.intro{display:flex;align-items:center;justify-content:space-between;padding:39px 0 30px}.eyebrow{font-size:10px;letter-spacing:2.3px;color:var(--gold);font-weight:600}h1{font-family:Georgia,'Times New Roman',serif;font-size:40px;line-height:1.2;font-weight:400;margin:12px 0}h1 em{font-weight:400;color:var(--green)}.intro p{font-size:12px;color:var(--muted);margin:15px 0 0}.quote{font-family:Georgia,serif;font-size:20px;color:#858675;border-left:1px solid #dbd5c5;padding:18px 0 18px 27px}.quote span{display:block;font-family:Segoe UI,sans-serif;font-size:8px;letter-spacing:2px;margin-top:15px;color:#a6a18d}.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:24px}.world-panel{border:1px solid #dcd4c2;background:#fffdf7;border-radius:9px;overflow:hidden;align-self:start;box-shadow:0 8px 24px #49301409}.world-title{height:42px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;font-size:9px;letter-spacing:1.6px}.world-title>span:last-child{letter-spacing:.2px;color:var(--muted);font-size:10px}.world-title i{display:inline-block;width:5px;height:5px;background:#74835d;border-radius:50%;margin-right:6px}.world{position:relative;aspect-ratio:1.5;background:#3f2b21;overflow:hidden}canvas{display:block;width:100%;height:100%;touch-action:none}.scene-badge{position:absolute;top:17px;left:20px;display:flex;align-items:center;gap:9px;color:#f5e3b4;font-size:25px;pointer-events:none;text-shadow:0 2px 6px #000}.scene-badge span{font-size:14px;font-family:Georgia,serif}.scene-badge small{display:block;font:9px Segoe UI,sans-serif;margin-top:4px;opacity:.7}.world-tip{position:absolute;bottom:12px;left:0;right:0;text-align:center;color:#fff2ce;font-size:8px;letter-spacing:1.5px;text-shadow:0 1px 4px black;pointer-events:none}.world-tip span{padding:0 12px}.player-bar{min-height:66px;display:flex;align-items:center;padding:8px 17px;gap:10px}.player-avatar{width:37px;height:43px;background:#f0e8d5;border-radius:50%;overflow:hidden}.player-avatar img{width:100%;height:100%;object-fit:contain}.player-bar strong{display:block;font-size:12px}.player-bar small{display:block;font-size:9px;color:var(--muted);margin-top:5px}.player-bar button{font-size:10px;color:#9e814b;border:0;background:none;margin-left:8px}.wallet{margin-left:auto;color:#9c7c3e;font-size:16px}.wallet b{font-size:13px;margin-left:4px}.wallet small{display:inline;font-size:9px}.ritual-panel{padding:25px 22px 0;border:1px solid var(--line);border-radius:9px;background:#fffdf8}h2{font:29px/1.25 Georgia,'Times New Roman',serif;font-weight:400;margin:10px 0}.ritual-panel h2{font-size:25px}.ritual-panel>p{font-size:11px;color:var(--muted);line-height:1.6}.actions{display:grid;gap:10px;margin-top:22px}.actions button{display:flex;align-items:center;text-align:left;padding:13px 10px;background:#fffdf8;border:1px solid var(--line);border-radius:6px;gap:12px;transition:.2s}.actions button:hover{background:#f3eddc;border-color:#b7a478;transform:translateY(-1px)}.action-icon{background:#f4efdf;width:37px;height:39px;display:grid;place-items:center;border-radius:5px;color:#a68244;font-size:25px}.actions strong{display:block;font-weight:600;font-size:12px}.actions small{display:block;font-size:9px;margin-top:6px;color:var(--muted)}.actions b{margin-left:auto;font-size:9px;font-weight:400;color:#b4ad9a}.ritual-panel .gentle-note{font-size:9px;border-top:1px solid var(--line);padding:17px 0;margin-top:23px;color:#9b947d}.journal{padding:18px 3px}.section-title{display:flex;justify-content:space-between;align-items:center}.section-title h3{font:18px Georgia,serif;margin:0}.section-title>span{color:var(--gold);font-size:22px}.stats{display:flex;justify-content:space-between;margin-top:20px}.stats div{border-right:1px solid var(--line);width:33%;text-align:center}.stats div:last-child{border:0}.stats b{display:block;font:24px Georgia,serif;color:#9a7b47}.stats span{font-size:9px;color:var(--muted)}.journal p{font-size:10px;color:var(--muted);line-height:1.6;margin-top:20px}footer{display:flex;justify-content:space-between;padding:26px 0;font-size:9px;color:#9c998b;gap:12px}footer i{margin:0 10px;color:#bdad82}dialog{border:1px solid #d9cfb6;border-radius:14px;background:#fffdf7;color:var(--ink);padding:35px;max-width:570px;width:calc(100% - 30px);box-shadow:0 25px 100px #1c1b1570}dialog::backdrop{background:#24261dcc;backdrop-filter:blur(6px)}dialog h2{font-size:35px}dialog p{font-size:12px;color:var(--muted);line-height:1.8}dialog label,legend{font-size:12px}#name{display:block;width:100%;margin:8px 0 20px;padding:13px;border:1px solid #dcd4c1;border-radius:5px;background:white;color:var(--ink)}fieldset{border:0;padding:0;margin:0}legend{margin-bottom:10px}.characters{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.characters label{position:relative;cursor:pointer;border:1px solid var(--line);border-radius:7px;text-align:center;padding:8px 0 13px}.characters label:has(:checked){border-color:var(--gold);background:#f5edda;box-shadow:0 0 0 1px var(--gold)}.characters input{position:absolute;top:8px;left:8px;accent-color:#93753d}.character-art{display:block;height:118px;background-repeat:no-repeat;margin:auto}.characters strong{display:block;font-size:12px}.characters small{display:block;font-size:9px;color:var(--muted);margin-top:5px}.primary{width:100%;border:0;background:var(--green);color:#fff9e8;border-radius:5px;padding:15px 18px;margin-top:23px;text-align:left;font-size:12px}.primary span{float:right}.privacy{display:block;font-size:9px;text-align:center;line-height:1.7;color:#9c9788;margin-top:14px}.secondary{width:100%;background:none;border:0;color:var(--muted);padding:13px}.amounts{display:flex;gap:12px;margin:24px 0}.amounts label{flex:1;padding:16px 5px;border:1px solid var(--line);border-radius:5px;text-align:center;cursor:pointer}.amounts label:has(:checked){border-color:var(--gold);background:#f5edda}.amounts input{accent-color:#93753d;margin-right:6px}#donation-error{color:#a64e31}#bubble{position:absolute;top:43%;left:50%;transform:translateX(-50%);padding:10px 16px;background:#fffbefed;border:1px solid #d6bd84;border-radius:20px;font-size:11px;opacity:0;transition:opacity .4s;pointer-events:none;max-width:85%;text-align:center}#bubble.show{opacity:1}.activity{padding-top:15px;font-size:10px}.activity>div{display:flex;justify-content:space-between}.activity progress{width:100%;height:5px;accent-color:var(--gold);margin-top:10px}.activity button{background:none;border:0;color:#9b7850;padding:7px 0;font-size:10px}.loading{position:absolute;inset:0;display:grid;place-items:center;color:#f3dbac;background:#3f2b21;font-size:13px}.loading[hidden]{display:none}@media(min-width:1500px){.game-layout{grid-template-columns:minmax(0,1fr) 340px}}@media(max-width:1000px){main{padding:0 3vw}.game-layout{grid-template-columns:minmax(0,1fr) 270px;gap:15px}.ritual-panel{padding:20px 15px 0}.quote{display:none}header{padding:0 3vw}}@media(max-width:740px){header{height:72px}.brand{font-size:16px;letter-spacing:2px}.brand small{font-size:7px}.lotus{font-size:33px}.header-right{gap:13px}.header-right button span,.live{display:none}.intro{padding:26px 0 23px}h1{font-size:31px}.intro p{font-size:11px;line-height:1.7;max-width:310px}.game-layout{grid-template-columns:1fr}.ritual-panel{padding-top:20px}.actions{grid-template-columns:1fr 1fr;gap:8px}.actions button{gap:8px;padding:12px 8px}.actions small{font-size:8px}.actions b{display:none}.action-icon{width:29px;min-width:29px;font-size:21px}.journal{padding:12px}.stats{margin-top:12px}.journal p{margin-top:14px}.world-tip{font-size:6px}.scene-badge{top:10px;left:10px}.scene-badge span{font-size:11px}.player-bar{padding:7px 10px;gap:7px}.player-bar button{font-size:9px;margin:0}.wallet{font-size:11px}.player-bar small{font-size:8px}footer{flex-direction:column;line-height:1.7}dialog{padding:25px 20px}dialog h2{font-size:29px}.characters{gap:7px}.characters small{font-size:8px}.character-art{height:105px}.actions strong{font-size:11px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}

.music-player{border-top:1px solid var(--line);margin-top:20px;padding-top:15px;font-size:10px}.music-player>div{display:flex;justify-content:space-between;align-items:center;gap:10px}.music-player button{border:1px solid #d8cfb9;border-radius:4px;background:#f5efdf;padding:6px 9px;color:#78623d;font-size:9px}.music-player label{display:flex;align-items:center;gap:10px;margin-top:12px;color:var(--muted);font-size:9px}.music-player input{width:100%;accent-color:var(--gold)}.music-player small{display:block;font-size:8px;color:var(--muted);margin-top:5px}dialog select{display:block;width:100%;background:white;border:1px solid #dcd4c1;padding:12px;color:var(--ink);margin:8px 0 18px;border-radius:5px;font:12px Segoe UI,sans-serif}dialog blockquote{margin:16px 0 8px;padding:15px 20px;border-left:2px solid var(--gold);background:#f6efdf;font:19px/1.8 Georgia,serif;white-space:pre-line}.sutra-source{font-size:9px!important}.sutra-source a{color:#977640}.music-check{display:flex;gap:9px;align-items:center;margin-top:20px}.music-check input{accent-color:var(--green)}

/* Controls are part of the game frame, beneath the scene on every screen size. */
.game-layout{grid-template-columns:minmax(0,1fr) 230px}
.world{aspect-ratio:auto}
#game{height:auto;aspect-ratio:3/2}
.game-hud{position:relative;padding:12px 16px 10px;background:linear-gradient(180deg,#332b21,#25221b);border-top:1px solid #b99b60;color:#eee4cc}
.game-hud .actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:0}
.game-hud .actions button{justify-content:center;gap:8px;min-height:50px;padding:8px;color:#f5e9cb;background:#ffffff08;border:1px solid #ae925852;border-radius:6px}
.game-hud .actions button:hover{background:#b99b6028;border-color:#c8ac6f;transform:none}
.game-hud .actions button:disabled{opacity:.45;cursor:default}
.game-hud .actions .action-icon{width:29px;height:30px;min-width:29px;background:none;color:#d4b777;font-size:24px}
.game-hud .actions strong{font-size:12px;white-space:nowrap}
.game-hud .actions small,.game-hud .actions b{display:none}
.game-hud .music-player{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:10px 0 0;padding:0;border:0}
.game-hud .music-player>div{gap:12px;justify-content:flex-start}
.game-hud .music-player button{background:#ffffff0c;color:#e9d6a5;border-color:#ae925852;min-height:32px;padding:5px 10px}
.game-hud .music-player label{margin:0;color:#c6bba0;max-width:180px;flex:1}
.game-hud .music-player input{min-width:0;accent-color:#c8a65f}
.game-hud .music-player small{display:none}
.game-hud .activity{padding:10px 0 0}
.game-hud .activity>div{gap:15px}
.game-hud .activity button{color:#e4c58a;min-height:32px;padding:5px 0}
.game-hud .activity progress{display:block;margin-top:8px}
.hud-hint{font-size:7px;letter-spacing:1.4px;color:#b3a78b;text-align:center;margin-top:9px}
.hud-hint span{margin:0 8px}
.game-layout>aside .journal{padding:18px 12px;border:1px solid var(--line);border-radius:8px;background:#fffdf8}
@media(max-width:1000px){.game-layout{grid-template-columns:1fr}.game-layout>aside .journal{max-width:none}.journal .stats{max-width:440px}.journal p{margin-bottom:0}}
@media(max-width:740px){.game-hud{padding:9px 8px}.game-hud .actions{gap:5px}.game-hud .actions button{flex-direction:column;gap:2px;min-height:58px;padding:5px 2px}.game-hud .actions .action-icon{font-size:22px;height:24px}.game-hud .actions strong{font-size:10px}.game-hud .music-player{gap:10px}.game-hud .music-player>div>span{display:none}.game-hud .music-player label{max-width:170px;font-size:8px}.hud-hint{font-size:6px;letter-spacing:.8px;margin-top:7px}}

/* Phones (html.mobile set in index.html): landscape-only full-screen game with joystick left, round ritual buttons right. */
.joystick,.rotate-device{display:none}
html.mobile,html.mobile body{height:100%;overflow:hidden;overscroll-behavior:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
html.mobile body{background:#1f1913}
html.mobile .intro,html.mobile aside,html.mobile footer,html.mobile .world-title,html.mobile .scene-badge,html.mobile .hud-hint,html.mobile .brand,html.mobile .live{display:none}
html.mobile main{max-width:none;padding:0}
html.mobile header{position:fixed;z-index:6;top:calc(8px + env(safe-area-inset-top));right:calc(10px + env(safe-area-inset-right));height:auto;padding:0;border:0;background:none}
html.mobile .header-right{gap:8px}
html.mobile .header-right button span{display:none}
html.mobile .header-right button,html.mobile .game-hud .music-player button{width:38px;height:38px;min-height:0;padding:0;border-radius:50%;border:1px solid #c8ac6f80;background:#1d1812b3;color:#f0dca8;font-size:15px;overflow:hidden;white-space:nowrap}
html.mobile .header-right button[aria-pressed="true"],html.mobile .game-hud .music-player button[aria-pressed="true"]{background:#8a6c34d9}
html.mobile .game-layout{display:block}
html.mobile .world-panel{position:fixed;inset:0;align-self:stretch;justify-self:stretch;border:0;border-radius:0;box-shadow:none;background:#1f1913}
html.mobile .world{position:absolute;inset:0;background:radial-gradient(ellipse at center,#3f2b21 0,#1f1913 75%)}
/* Full-screen scene: game.js scales the canvas to cover the screen and pans it to follow the player. */
html.mobile #game{position:absolute;top:0;left:0;max-width:none;aspect-ratio:auto;transform-origin:0 0;will-change:transform}
html.mobile #game.framed{-webkit-mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent);mask-image:linear-gradient(90deg,transparent,#000 5%,#000 95%,transparent)}
html.mobile .world::before{content:"";position:absolute;inset:-40px;background:url("assets/chanh-dien.webp") center/cover;filter:blur(22px) brightness(.5) saturate(1.1)}
html.mobile .game-hud{position:absolute;inset:0;padding:0;background:none;border:0;pointer-events:none}
html.mobile .game-hud>*{pointer-events:auto}
/* Round skill buttons: one large primary button with three smaller ones arcing around it. */
html.mobile .game-hud .actions{position:absolute;right:calc(14px + env(safe-area-inset-right));bottom:calc(14px + env(safe-area-inset-bottom));width:178px;height:178px;display:block;margin:0}
html.mobile .game-hud .actions button{position:absolute;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:0;width:62px;height:62px;min-height:0;padding:0;border-radius:50%;border:2px solid #d8bb7a;background:radial-gradient(circle at 35% 30%,#6b5432f2,#2b2117f2 70%);box-shadow:0 3px 10px #000a,inset 0 0 0 3px #00000040;color:#fbefcf;touch-action:manipulation}
html.mobile .game-hud .actions button:active{transform:scale(.92);background:radial-gradient(circle at 35% 30%,#9a7a44,#3b2d1e 70%)}
html.mobile .game-hud .actions button:disabled{opacity:.4}
html.mobile .game-hud .actions .action-icon{width:auto;height:auto;min-width:0;font-size:22px;line-height:1;color:#f1d48f}
html.mobile .game-hud .actions strong{font-size:8.5px;font-weight:600;margin-top:3px;letter-spacing:.2px}
html.mobile .game-hud .actions [data-action="chant"]{right:0;bottom:0;width:82px;height:82px}
html.mobile .game-hud .actions [data-action="chant"] .action-icon{font-size:30px}
html.mobile .game-hud .actions [data-action="chant"] strong{font-size:10px}
html.mobile .game-hud .actions [data-action="incense"]{right:94px;bottom:2px}
html.mobile .game-hud .actions [data-action="pray"]{right:84px;bottom:80px}
html.mobile .game-hud .actions [data-action="donate"]{right:8px;bottom:94px}
/* Joystick */
html.mobile .joystick{display:block;position:absolute;z-index:4;left:calc(26px + env(safe-area-inset-left));bottom:calc(24px + env(safe-area-inset-bottom));width:128px;height:128px;border-radius:50%;background:radial-gradient(circle,#00000020 0,#0000004d 70%);border:2px solid #e8d3a066;box-shadow:inset 0 0 18px #0006;touch-action:none}
html.mobile .joystick::before{content:'';position:absolute;inset:22px;border-radius:50%;border:1px dashed #e8d3a040}
html.mobile .joystick-knob{position:absolute;left:50%;top:50%;width:56px;height:56px;margin:-28px 0 0 -28px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#f6e2ae,#b48a45 75%);box-shadow:0 3px 8px #000a;pointer-events:none}
html.mobile .joystick.active{border-color:#f0d797aa}
html.mobile .joystick:not(.active) .joystick-knob{transition:transform .15s ease-out}
/* Top bar: player info left, buttons right, ritual progress centre. */
html.mobile .player-bar{position:fixed;z-index:5;top:calc(8px + env(safe-area-inset-top));left:calc(10px + env(safe-area-inset-left));min-height:0;padding:5px 12px 5px 5px;gap:8px;border-radius:24px;background:#1d1812b3;border:1px solid #c8ac6f55;color:#f3e6c4}
html.mobile .player-avatar{width:32px;height:32px}
html.mobile .player-bar strong{font-size:11px}
html.mobile .player-bar small{font-size:8px;color:#c7b995;margin-top:2px}
html.mobile .player-bar button{font-size:9px;color:#e5c784;margin:0;padding:4px}
html.mobile .wallet{margin-left:4px;font-size:12px;color:#e8c676}
html.mobile .game-hud .music-player{position:absolute;top:calc(8px + env(safe-area-inset-top));right:calc(104px + env(safe-area-inset-right));margin:0;display:block}
html.mobile .game-hud .music-player>div>span,html.mobile .game-hud .music-player label{display:none}
html.mobile .game-hud .music-player button{font-size:12px}
html.mobile .game-hud .activity{position:absolute;top:calc(56px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(300px,46vw);padding:8px 14px;border-radius:12px;background:#1d1812cc;border:1px solid #c8ac6f55}
html.mobile .game-hud .activity[hidden]{display:none}
html.mobile .game-hud .activity button{min-height:0;padding:6px 0 0}
html.mobile #bubble{top:auto;bottom:calc(16px + env(safe-area-inset-bottom));max-width:44vw;font-size:11px}
/* Compact dialogs for short landscape screens. */
html.mobile dialog{padding:16px 20px;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px)}
html.mobile dialog h2{font-size:22px;margin:4px 0}
html.mobile dialog p{font-size:11px;line-height:1.5;margin:6px 0}
html.mobile #name{margin:4px 0 10px;padding:9px}
html.mobile .character-art{transform:scale(.68);transform-origin:center top;margin-bottom:-36px}
html.mobile .characters label{padding:4px 0 8px}
html.mobile .primary{margin-top:12px;padding:12px 16px}
html.mobile .amounts{margin:12px 0}
html.mobile dialog blockquote{font-size:15px;line-height:1.6;padding:10px 14px}
html.mobile dialog select{padding:9px;margin:4px 0 10px}
/* Portrait phones: block the game until the device is rotated. */
@media (orientation:portrait){
 html.mobile .rotate-device{position:fixed;inset:0;z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;padding:30px;text-align:center;background:#1f1913;color:#f3e3b8}
 html.mobile .rotate-device strong{font:22px Georgia,serif;font-weight:400}
 html.mobile .rotate-device span{font-size:12px;line-height:1.6;color:#bfb08b;max-width:280px}
 html.mobile .rotate-phone{width:46px;height:78px;border:3px solid #d8bb7a;border-radius:9px;position:relative;animation:rotate-hint 2.2s ease-in-out infinite}
 html.mobile .rotate-phone::after{content:'';position:absolute;left:50%;bottom:5px;width:8px;height:8px;margin-left:-4px;border-radius:50%;background:#d8bb7a}
 html.mobile dialog,html.mobile dialog::backdrop{visibility:hidden}
 html.mobile header,html.mobile .world-panel{visibility:hidden}
}
@keyframes rotate-hint{0%,25%{transform:rotate(0)}55%,80%{transform:rotate(-90deg)}100%{transform:rotate(0)}}
@media (prefers-reduced-motion:reduce){.rotate-phone{animation:none!important;transform:rotate(-90deg)}}
html.mobile .game-hud .music-player button{font-size:0}
html.mobile .game-hud .music-player #music-toggle::before{content:'▶';font-size:14px}
html.mobile .game-hud .music-player #music-toggle[aria-pressed="true"]::before{content:'Ⅱ'}
html.mobile .game-hud .actions button{width:66px;height:66px}
html.mobile .game-hud .actions button strong{font-size:8px}
html.mobile .game-hud .actions [data-action="incense"]{right:92px;bottom:0}
html.mobile .game-hud .actions [data-action="pray"]{right:82px;bottom:80px}
html.mobile .game-hud .actions [data-action="donate"]{right:6px;bottom:92px}
/* Keep messages off the statues and the player: bubble in the top bar gap, ritual progress as a slim bottom strip. */
html.mobile #bubble{top:calc(12px + env(safe-area-inset-top));bottom:auto;max-width:min(40vw,360px);font-size:10.5px;padding:7px 12px}
html.mobile .game-hud .activity{top:auto;bottom:calc(8px + env(safe-area-inset-bottom));width:min(320px,40vw);padding:6px 12px;display:grid;grid-template-columns:1fr auto;align-items:center;column-gap:10px}
html.mobile .game-hud .activity[hidden]{display:none}
html.mobile .game-hud .activity>div{grid-column:1}
html.mobile .game-hud .activity progress{grid-column:1;margin-top:4px}
html.mobile .game-hud .activity button{grid-column:2;grid-row:1/3;padding:0;min-height:0}
html.mobile #bubble{top:calc(58px + env(safe-area-inset-top));max-width:min(46vw,420px)}
html.mobile .player-bar small{display:none}
html.mobile .player-bar button{font-size:0;padding:4px 2px}
html.mobile .player-bar button::before{content:'⇄';font-size:14px}
html.mobile .wallet small{display:none}
html.mobile{background:#1f1913}
/* Short landscape screens (phone browsers with toolbars): smaller controls so the scene stays visible. */
@media (max-height:430px){
 html.mobile .joystick{width:104px;height:104px;left:calc(18px + env(safe-area-inset-left));bottom:calc(16px + env(safe-area-inset-bottom))}
 html.mobile .joystick::before{inset:18px}
 html.mobile .joystick-knob{width:44px;height:44px;margin:-22px 0 0 -22px}
 html.mobile .game-hud .actions{transform:scale(.8);transform-origin:right bottom;right:calc(10px + env(safe-area-inset-right));bottom:calc(10px + env(safe-area-inset-bottom))}
 html.mobile .player-bar{padding:3px 10px 3px 3px;gap:6px}
 html.mobile .player-avatar{width:26px;height:26px}
 html.mobile .header-right button,html.mobile .game-hud .music-player button{width:32px;height:32px}
 html.mobile .header-right{gap:6px}
 html.mobile .game-hud .music-player{right:calc(86px + env(safe-area-inset-right))}
 html.mobile #bubble{top:calc(46px + env(safe-area-inset-top))}
}
html.mobile body{position:fixed;inset:0}
html.mobile .world-panel{right:auto;bottom:auto;width:var(--app-w,100%);height:var(--app-h,100%)}

.hud-hint a{color:#e3c98d;text-decoration:underline;text-underline-offset:3px;font-size:inherit;letter-spacing:.3px}
/* Compact player card: round avatar (tap to change character), name and coins stacked; ritual progress right below. */
.player-avatar[role=button]{cursor:pointer}
html.mobile .player-bar{display:grid;grid-template-columns:auto auto;grid-template-rows:auto auto;align-items:center;column-gap:8px;row-gap:1px;padding:3px 12px 3px 3px;border-radius:26px}
html.mobile .player-bar #change{display:none}
html.mobile .player-bar>div:not(.player-avatar){grid-column:2;grid-row:1;align-self:end}
html.mobile .player-bar strong{font-size:11px;line-height:1.1;max-width:110px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.mobile .wallet{grid-column:2;grid-row:2;align-self:start;margin:0;font-size:10px;line-height:1.1}
html.mobile .wallet b{font-size:10px;margin-left:2px}
html.mobile .player-avatar{grid-row:1/3;width:40px!important;height:40px!important;min-width:40px!important;border-radius:50%;border:2px solid #d8bb7a;background-color:#f3e7c9;background-size:480px 80px!important;background-position:-250px -2px!important;box-shadow:0 2px 6px #0008}
html.mobile .player-avatar:active{transform:scale(.92)}
html.mobile .game-hud .activity{position:fixed;top:calc(60px + env(safe-area-inset-top));bottom:auto;left:calc(10px + env(safe-area-inset-left));transform:none;width:150px;padding:5px 8px 6px 12px;border-radius:14px;display:grid;grid-template-columns:1fr auto;column-gap:8px;row-gap:0;font-size:10px}
html.mobile .game-hud .activity>div{grid-column:1;grid-row:1;gap:6px}
html.mobile .game-hud .activity progress{grid-column:1;grid-row:2;height:3px;margin-top:4px}
html.mobile .game-hud .activity button{grid-column:2;grid-row:1/3;align-self:center;width:24px;height:24px;border-radius:50%;border:1px solid #c8ac6f80;font-size:0;padding:0;min-height:0}
html.mobile .game-hud .activity button::before{content:'✕';font-size:11px;color:#f0d797}
@media (max-height:430px){
 html.mobile .player-bar{padding:2px 10px 2px 2px}
 html.mobile .player-avatar{width:36px!important;height:36px!important;min-width:36px!important;background-size:432px 72px!important;background-position:-225px -2px!important}
 html.mobile .game-hud .activity{top:calc(54px + env(safe-area-inset-top))}
}
/* Welcome dialog fits a short landscape phone screen without scrolling. */
html.mobile #welcome .eyebrow,html.mobile #welcome #join-form>p,html.mobile #welcome .characters small{display:none}
html.mobile #welcome{padding:12px 18px;max-width:520px}
html.mobile #welcome h2{font-size:17px;line-height:1.2;margin:0 0 4px}
html.mobile #welcome legend{margin-bottom:4px}
html.mobile #welcome .character-art{transform:scale(.5);margin-bottom:-58px}
html.mobile #welcome .characters strong{font-size:11px}
html.mobile #welcome .primary{margin-top:8px;padding:10px 14px}
html.mobile #welcome .privacy{display:none}
/* Line icons for the ritual buttons. */
.action-icon svg{width:1em;height:1em;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;display:block}
/* Wish board */
#wish-list{list-style:none;margin:12px 0 14px;padding:0;max-height:220px;overflow:auto;display:grid;gap:8px}
#wish-list li{padding:9px 12px;border-left:2px solid var(--gold);background:#f6efdf;border-radius:0 6px 6px 0}
#wish-list li.empty{border:0;background:none;color:var(--muted);font-size:12px;padding:4px 0}
#wish-list p{margin:0;font:15px/1.5 Georgia,serif;color:var(--ink)}
#wish-list small{display:block;font-size:10px;color:var(--muted);margin-top:3px}
#wish-text{display:block;width:100%;margin:6px 0 4px;padding:10px;border:1px solid #dcd4c1;border-radius:5px;font:13px/1.5 Segoe UI,sans-serif;resize:none;color:var(--ink);background:#fff}
#wish-error{color:#a64e31;min-height:1em;margin:4px 0}
html.mobile #wish-dialog{padding:12px 18px}
html.mobile #wish-dialog .eyebrow,html.mobile #wish-dialog .privacy{display:none}
html.mobile #wish-dialog h2{font-size:18px}
html.mobile #wish-list{max-height:34vh;margin:6px 0 8px}
html.mobile #wish-list p{font-size:13px}
html.mobile #wish-dialog .primary{margin-top:6px;padding:10px 14px}
html.mobile #wish-dialog .secondary{padding:8px}
html.mobile .game-hud .music-player{right:calc(152px + env(safe-area-inset-right))}
@media (max-height:430px){html.mobile .game-hud .music-player{right:calc(124px + env(safe-area-inset-right))}}

#wardrobe-modal{max-width:1100px;width:calc(100% - 24px);height:90svh;max-height:90svh;padding:0;overflow:hidden}
.wardrobe-shell{height:44px;display:flex;align-items:center;justify-content:space-between;padding:0 15px;background:#f4efdf;border-bottom:1px solid var(--line);font-size:12px}
.wardrobe-shell button{min-width:36px;min-height:36px;border:0;background:none;color:#685c42}
#wardrobe-frame{display:block;border:0;width:100%;height:calc(100% - 44px);background:#f8f5ee}
.player-avatar.wardrobe-portrait{background-size:contain!important;background-position:center!important}
html.mobile #wardrobe-modal{width:96vw;max-width:1100px;height:94svh;max-height:94svh;padding:0}
html.mobile .game-hud #wardrobe-open{display:inline-block;white-space:nowrap}

html.mobile .player-avatar.wardrobe-portrait{background-size:contain!important;background-position:center!important}
html.mobile .game-hud .music-player #wardrobe-open::before{content:'✦';font-size:15px}
html.mobile .game-hud .music-player>div{display:flex;gap:8px}

#npc-notice{position:absolute;top:12px;left:50%;transform:translateX(-50%);max-width:70%;padding:9px 16px;border:1px solid #d6ac65;border-radius:12px;background:#302316e8;color:#ffe7b9;font:600 13px/1.5 "Segoe UI",sans-serif;z-index:4;text-align:center;pointer-events:none}#npc-notice[hidden]{display:none}.mobile #npc-notice{top:52px;max-width:65%;font-size:11px;padding:5px 10px}

.steal-button{padding:9px 16px;border:1px solid #b28b67;border-radius:12px;background:#37291ee8;color:#ffe3b5;cursor:pointer}.steal-button:disabled{opacity:.45;cursor:default}html.mobile .steal-button{position:absolute;right:176px;bottom:12px;font-size:11px;padding:10px;pointer-events:auto}
