:root{--hud-bg:rgba(43,28,18,.92);--hud-edge:rgba(230,190,115,.35);--hud-gold:#f2c467;--hud-ink:#fff2dc;--hud-muted:#cdbb9d;--hud-gap:14px}
.quality-control[hidden]{display:none!important}
.hud-icon{width:25px;height:25px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
#game-hud button,.hud-dialog button{font-family:inherit;cursor:pointer;touch-action:manipulation;min-height:44px}
#game-hud button:focus-visible,.hud-dialog :focus-visible{outline:3px solid #ffe3a2;outline-offset:3px}
#game-hud [hidden],#game-hud #chat-widget[hidden],#game-hud #lantern-panel[hidden]{display:none!important}
#game-hud .top-bar{top:max(14px,env(safe-area-inset-top));left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));flex-wrap:nowrap;z-index:35}
.hud-location{display:flex;flex-direction:column;gap:8px;max-width:310px;pointer-events:none}
.hud-profile{display:flex;align-items:center;gap:10px;padding:8px 12px 8px 8px;border:1px solid var(--hud-edge);border-radius:36px;background:var(--hud-bg);box-shadow:0 5px 18px #0003;color:var(--hud-ink)}
.hud-profile-emblem{display:grid;place-items:center;background:#ad6580;color:#ffe1eb;width:44px;height:44px;border-radius:50%}
.hud-profile>div{min-width:0;flex:1}.hud-profile strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}.hud-profile small{display:block;margin-top:3px;font-size:11px;color:var(--hud-muted)}
.hud-level{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--hud-gold);color:#35200d;font-weight:800}
#game-hud .temple-badge{background:none;border:0;box-shadow:none;backdrop-filter:none;display:flex;align-items:flex-start;flex-direction:column;gap:4px;padding:0 12px;pointer-events:none}
#game-hud .temple-name{font-family:inherit;font-size:16px;letter-spacing:0;color:var(--hud-ink);text-shadow:0 2px 5px #000}
#game-hud .online-tag{background:none;padding:0;font-size:12px;color:#a9e2a2;text-shadow:0 1px 4px #000}
.hud-travel{position:fixed;right:max(12px,env(safe-area-inset-right));top:calc(env(safe-area-inset-top) + 74px);z-index:35;display:flex;gap:6px;pointer-events:auto}
#game-hud .hud-travel button{padding:7px 12px;background:var(--hud-bg);border:1px solid var(--hud-edge);color:var(--hud-gold);border-radius:24px;font-size:12px;box-shadow:none;transform:none;gap:6px}
.hud-travel .hud-icon{width:19px;height:19px}
#game-hud .top-actions{align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:8px}
#game-hud .merit-counter{display:flex;align-items:center;gap:8px;padding:8px 12px;min-height:44px;background:var(--hud-bg);border:1px solid var(--hud-edge);color:var(--hud-ink);border-radius:24px;box-shadow:none}
.merit-counter .hud-icon{width:20px;height:20px;color:var(--hud-gold)}
.hud-round,.hud-close{display:flex;align-items:center;justify-content:center;width:44px;height:44px;padding:10px;border:1px solid var(--hud-edge);border-radius:50%;background:var(--hud-bg);color:var(--hud-gold)}
.hud-round span,.hud-close span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#game-hud .bottom-container{inset:auto max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) auto;width:auto;display:block;z-index:35}
#game-hud .action-toolbar{display:grid;grid-template-columns:repeat(3,86px);gap:10px;background:none;padding:0;border:0;box-shadow:none;backdrop-filter:none}
#game-hud .action-btn,.hud-utilities button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;background:var(--hud-bg);border:1px solid var(--hud-edge);border-radius:24px;color:var(--hud-ink);font-size:12px;font-weight:600;padding:10px 6px;width:auto;min-width:0;height:84px;box-shadow:0 4px 14px #0002;transition:background .15s,border-color .15s;transform:none;pointer-events:auto}
#game-hud .action-btn .hud-icon,.hud-utilities .hud-icon{color:var(--hud-gold);width:28px;height:28px}
#game-hud .action-btn:hover,.hud-utilities button:hover{background:#533922;border-color:var(--hud-gold);transform:none}
#game-hud .action-btn[aria-pressed=true],#game-hud .action-btn.active-toggle{background:#795221!important;border-color:var(--hud-gold)!important;box-shadow:inset 0 0 0 1px #edbd6555!important}
.hud-utilities{position:absolute;left:max(14px,env(safe-area-inset-left));bottom:max(14px,env(safe-area-inset-bottom));display:flex;gap:8px;z-index:35;pointer-events:auto}
.hud-utilities button{width:68px;height:64px;border-radius:20px;font-size:10px;gap:3px}
#game-hud .lantern-panel{top:78px;right:14px;width:330px;max-height:calc(100dvh - 288px);padding:16px;background:linear-gradient(145deg,rgba(69,43,23,.97),rgba(34,24,17,.97));border:1px solid var(--hud-edge);color:var(--hud-ink);border-radius:25px;z-index:36;display:flex;box-shadow:0 12px 35px #0004;transition:none}
#game-hud .lantern-header{position:relative;display:block;min-height:50px;border-bottom:0;padding-right:44px}
.lantern-header .hud-close{position:absolute;right:-4px;top:0;border:0;background:#ffffff12}
#game-hud .lantern-title{font-size:18px;color:var(--hud-gold);gap:10px}
#game-hud .lantern-count-badge{display:block;margin:5px 0 0 35px;padding:0;background:none;color:var(--hud-muted);font-size:12px}
#game-hud .lantern-card{background:#ffffff08;border:0;border-left:2px solid var(--hud-gold);border-radius:15px;padding:12px}
#game-hud .lantern-wish{font-family:Georgia,serif;font-style:italic;color:var(--hud-ink);line-height:1.5;font-size:15px}
#game-hud .lantern-meta{color:var(--hud-muted);gap:8px}
#game-hud .btn-release-lantern{display:flex;align-items:center;justify-content:center;gap:10px;flex-shrink:0;min-height:50px;background:linear-gradient(115deg,#f4d587,#d5a13d);border:0;border-radius:24px;color:#37230d;font-weight:800;box-shadow:none;transform:none}
#game-hud .chat-widget{position:fixed;left:14px;bottom:92px;width:min(360px,calc(100vw - 28px));max-height:55dvh;display:flex!important;background:var(--hud-bg);border:1px solid var(--hud-edge);color:var(--hud-ink);z-index:36;box-shadow:0 10px 30px #0005}
.hud-panel-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;color:var(--hud-gold);font-size:14px}
#game-hud .chat-messages{min-height:60px;flex:1;overflow:auto}#game-hud .chat-input{font-size:16px;min-width:0}#game-hud .prayer-pill{min-height:44px}#game-hud .chat-send-btn{background:#e6b858;color:#35220f}
.hud-dialog{width:min(430px,calc(100vw - 24px));max-height:80dvh;overflow:auto;margin:auto;padding:22px;border:1px solid var(--hud-edge);border-radius:26px;background:linear-gradient(145deg,#422d1e,#241a13);color:var(--hud-ink);font-family:'Quicksand',sans-serif;box-shadow:0 20px 70px #0007}
.hud-dialog::backdrop{background:#170f0b99}.hud-dialog header{display:flex;justify-content:space-between;align-items:center;gap:12px}.hud-dialog h2{font-size:20px}.hud-dialog p{font-size:14px;line-height:1.8;color:var(--hud-muted);margin:20px 0}.hud-dialog summary{padding:14px 0;cursor:pointer;color:var(--hud-gold)}.hud-dialog details button{display:flex;align-items:center;gap:12px;width:100%;margin:8px 0;padding:12px;background:#ffffff08;border:1px solid var(--hud-edge);border-radius:14px;color:var(--hud-ink);font:inherit}
.hud-menu-quality{margin-top:18px;padding:16px 0;border-top:1px solid var(--hud-edge);border-bottom:1px solid var(--hud-edge)}.hud-menu-quality h3{margin:0 0 10px;font-size:13px;color:var(--hud-muted);font-weight:600}.hud-quality-options{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;padding:4px;border:1px solid var(--hud-edge);border-radius:14px;background:#1d140f}.hud-quality-options button{min-height:44px;padding:8px 5px;border:0;border-radius:10px;background:transparent;color:var(--hud-muted);font-family:inherit;font-size:12px;font-weight:700}.hud-quality-options button[aria-pressed=true]{background:linear-gradient(135deg,#f2d184,#c89435);color:#35200d}
#virtual-joystick-zone{z-index:20}
@media(max-width:700px){
 #game-hud .top-bar{top:max(10px,env(safe-area-inset-top));left:10px;right:10px;gap:8px}
 .hud-location{max-width:calc(100vw - 124px)}.hud-profile{padding:6px;gap:7px}.hud-profile strong{font-size:12px}.hud-profile small{font-size:10px}.hud-profile-emblem{width:34px;height:34px;flex-shrink:0}.hud-level{width:25px;height:25px;flex-shrink:0}
 #game-hud .temple-name{font-size:14px}#game-hud .top-actions{flex-wrap:wrap;width:104px;gap:6px}#game-hud .merit-counter{width:100%;justify-content:center;font-size:12px;padding:5px 8px;min-height:36px}
 #game-hud .hud-travel button{font-size:11px;padding:6px 9px}.hud-travel{gap:5px;top:calc(env(safe-area-inset-top) + 108px)}.hud-travel .hud-icon{width:17px}
 #game-hud .bottom-container{right:10px;bottom:calc(80px + env(safe-area-inset-bottom));left:auto}
 #game-hud .action-toolbar{grid-template-columns:repeat(3,60px);gap:6px}#game-hud .action-btn{height:67px;border-radius:19px;font-size:10px;padding:7px 3px;gap:5px}#game-hud .action-btn .hud-icon{width:25px;height:25px}
 .hud-utilities{left:10px;right:10px;bottom:calc(10px + env(safe-area-inset-bottom));justify-content:space-between;gap:8px}.hud-utilities button{flex:1;max-width:88px;height:56px;border-radius:18px}
 #game-hud .lantern-panel,#game-hud .chat-widget{position:fixed;top:auto;left:8px;right:8px;bottom:calc(76px + env(safe-area-inset-bottom));width:auto;max-width:none;max-height:58dvh;margin:0;border-radius:24px;padding:14px;z-index:42}
 #virtual-joystick-zone{top:170px;bottom:80px;height:auto;width:42%}
}
@media(max-height:540px){#game-hud .lantern-panel,#game-hud .chat-widget{top:70px;bottom:12px;max-height:calc(100dvh - 82px)}.hud-profile small{display:none}#game-hud .action-toolbar{grid-template-columns:repeat(3,60px);gap:6px}#game-hud .action-btn{height:60px;font-size:10px;border-radius:18px}#game-hud .bottom-container{bottom:12px}.hud-utilities button{width:55px;height:54px}.hud-utilities{right:auto}#game-hud .lantern-panel{left:auto;right:10px;width:min(330px,calc(100vw - 20px))}}
@media(prefers-reduced-motion:reduce){#game-hud *{animation:none!important;transition:none!important}}

#bell-interaction{position:absolute;z-index:45;right:0;bottom:calc(100% + 12px);white-space:nowrap;pointer-events:auto;min-height:48px;padding:12px 20px;border:1px solid #d8bd80;border-radius:24px;background:#39291df2;color:#ffe7af;font:700 14px Quicksand,sans-serif;box-shadow:0 4px 18px #0004}#bell-interaction[hidden]{display:none}#bell-interaction:disabled{opacity:.65}

#seat-interaction{position:absolute;z-index:45;right:0;bottom:calc(100% + 12px);white-space:nowrap;pointer-events:auto;min-height:48px;padding:12px 20px;border:1px solid #f3d493;border-radius:24px;background:#39291deb;color:#ffe7af;font:700 14px Quicksand,sans-serif;box-shadow:0 4px 18px #0004}#seat-interaction[hidden]{display:none}#seat-interaction:disabled{opacity:.7}html.practice-active #game-hud,html.practice-active #seat-interaction,html.practice-active .merit-float,html.fishing-active #game-hud,html.fishing-active #seat-interaction,html.fishing-active .merit-float{display:none!important}#game-hud .action-btn:disabled{opacity:.45}
#progression-toast{position:fixed;z-index:110;top:max(16px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:max-content;max-width:min(410px,calc(100vw - 28px));box-sizing:border-box;padding:12px 18px;border-radius:18px;border:1px solid #a4d9c6;background:#16352df2;box-shadow:0 0 18px #69e0bb55;color:#efffe5;font:600 13px/1.5 Quicksand,sans-serif;text-align:center;pointer-events:none;overflow-wrap:anywhere}#progression-toast[hidden]{display:none}.hud-profile small{white-space:nowrap}#game-hud .merit-counter{flex-wrap:wrap;gap:3px;font-size:11px}#game-hud .merit-counter span:last-child{font-size:9px}
.hud-xp{display:block;width:100%;height:4px;margin-top:5px;border:0;border-radius:4px;accent-color:#9bd9bc}.hud-profile small{display:block!important}.hud-xp::-webkit-progress-bar{background:#ffffff24;border-radius:4px}.hud-xp::-webkit-progress-value{background:#a6d8bc;border-radius:4px}
#progression-toast button{display:inline-block;margin:5px 0 0 8px;min-height:36px;padding:6px 10px;border:1px solid #b9dec4;border-radius:10px;background:#34594a;color:#f2ffe8;pointer-events:auto;font:inherit;cursor:pointer}
@media(max-width:700px){.hud-utilities{gap:4px}.hud-utilities button{min-width:44px;font-size:9px;padding:6px 2px}.hud-utilities button span{white-space:nowrap}}
#fps-overlay{position:fixed;top:max(8px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:999;padding:4px 12px;border-radius:10px;background:rgba(0,0,0,.7);color:#5f5;font:700 14px/1.4 monospace;pointer-events:none;white-space:nowrap;text-shadow:0 1px 2px #000}
#fps-overlay[hidden]{display:none}
.hud-menu-fps{margin-top:12px}
.hud-menu-fps h3{font-size:13px;color:var(--hud-muted);margin:0 0 8px}
.hud-fps-toggle{width:100%;padding:10px 16px;border:1px solid var(--hud-edge);border-radius:14px;background:transparent;color:var(--hud-ink);font-size:13px}
.hud-fps-toggle[aria-pressed="true"]{border-color:var(--hud-gold);color:var(--hud-gold)}

#game-hud .hud-insights-button{display:flex;align-items:center;justify-content:center;gap:8px;align-self:flex-start;min-height:44px;padding:8px 14px;border:1px solid var(--hud-edge);border-radius:22px;background:var(--hud-bg);color:var(--hud-ink);font-size:12px;line-height:1.2;pointer-events:auto;box-shadow:0 4px 14px #0002;transform:none}
.hud-insights-button .hud-icon{display:block;width:22px;height:22px;color:var(--hud-gold)}
.hud-insights-button span{display:block;white-space:nowrap}
