/* Hangman: the plum-and-lilac puppet theatre. Game state stays in the engine. */
body.arcade{--ink:#fff6e7;--dim:#eadced;--faint:#d6bdd9;--s1:#48243e;--s2:#592d50;--s3:#3c2037;--line:#805b78;--line2:#ad84a3;--gold:#dec3ee;--brand:#d9bfea;--green:#d9bfea;--red:#f4a4ba;background:#2e172a;color:var(--ink)}
body.arcade #egm-play-header{height:44px;min-height:44px;padding:0 14px;background:#3d1b34;border-color:#805570;gap:16px;flex-wrap:nowrap}
body.arcade #egm-play-header>a{color:#f6e2f3}
body.arcade #egm-play-header #egm-search{height:32px;background:#fff6e7;border-color:#b18da6;color:#481733}
body.arcade main.wrap{width:100%;max-width:1000px;padding:0 0 30px;margin:0 auto;display:block}
body.arcade .ac-layout.rail-right{display:flex;flex-direction:column;align-items:center;gap:0;margin:0}
body.arcade .ac-layout .ac-stage{--title-h:82px;--console-h:178px;width:min(100%,440px);height:min(820px,calc(100svh - 44px));min-height:0!important;margin:0 auto;border:0;border-radius:0;overflow:hidden;background:#b397bc url('../assets/play/hangman/theatre.webp') center/100% 100% no-repeat;box-shadow:0 12px 60px #160b16;scroll-margin-top:44px}
body.arcade .ac-stage::after{display:none}
.hn-title{height:var(--title-h);margin:0!important;line-height:0;position:relative;z-index:2;pointer-events:none;overflow:hidden}
.hn-title img{width:100%;height:100%;display:block;object-fit:fill}
body.arcade #hn-canvas{position:absolute;top:var(--title-h);left:0;background:transparent;touch-action:none;outline-offset:-4px}
.hn-console{height:var(--console-h);position:absolute;bottom:0;left:0;right:0;padding:40px 17px 2px;box-sizing:border-box;display:flex;flex-direction:column;gap:5px;color:#481733;background:linear-gradient(0deg,#f2d9d0d9,transparent)}
.hn-console #hn-status,.hn-console #hn-feedback{position:absolute;top:5px;left:20px;right:20px;text-align:center;color:#481733;font:600 11px/14px system-ui,sans-serif;margin:0;padding:0;background:none;min-height:0}
.hn-console:has(#hn-feedback:not(:empty)) #hn-status:not([data-notice=true]){visibility:hidden}
.hn-console #hn-mmstatus:not(:empty){position:absolute;bottom:8px;left:10px;right:10px;padding:8px;background:#fff6e7;border:2px solid #9b718e;border-radius:12px;z-index:9;color:#481733;font-size:12px}
.hn-console #hn-mmstatus:empty{display:none}
body.arcade #hn-wordform{margin:0}
body.arcade .hn-guessrow{margin:0;gap:5px;padding:3px;border-radius:18px;background:#fff4e4;border:2px solid #c6a8a0;box-shadow:0 3px 0 #a17b8b}
body.arcade .hn-guessrow input{background:transparent;border:0;font:700 13px Georgia,serif;color:#481733;padding:4px 7px;min-height:36px;box-shadow:none}
body.arcade .hn-guessrow input::placeholder,body.arcade .hn-setrow input::placeholder{color:#765168}
body.arcade .mgb{font-family:Georgia,serif;font-size:15px;font-weight:800;text-shadow:none;letter-spacing:0;text-transform:none;border:0;border-radius:24px;min-height:44px;box-shadow:0 3px 2px #542d4755;color:#481733;background:transparent url('../assets/play/hangman/button.webp') center/100% 100% no-repeat;padding:8px 16px}
body.arcade .mgb:hover{filter:brightness(1.06);transform:none}
body.arcade .mgb:disabled{opacity:.55}
body.arcade .hn-guessrow .mgb{min-height:36px;padding:4px 17px}
body.arcade .hn-console .ac-btnrow{display:flex;flex-wrap:nowrap;gap:10px;margin:0!important}
body.arcade .hn-console .ac-btnrow .mgb{flex:1;background:#71345f;border:3px ridge #bd82ac;color:#fff6e7;box-shadow:inset 0 3px 5px #e6aad670,0 3px 2px #542d4755;padding:3px 9px;min-height:43px}
body.arcade .hn-console .ac-toggles{margin:0;display:flex;gap:8px;align-items:center;justify-content:space-between}
body.arcade .hn-console .ac-toggles label{color:#481733;min-height:33px;gap:6px;font:600 12px Georgia,serif;white-space:nowrap}
body.arcade .ac-toggles input[type=checkbox]{width:21px;height:21px;accent-color:#71345f;margin:0}
body.arcade :is(button,input,select,a):focus-visible{outline:3px solid #702d72;outline-offset:2px}
body.arcade #hn-setup{inset:var(--title-h) 0 0;display:flex;align-items:flex-end;padding:0 12px 12px;background:linear-gradient(transparent 8%,#6a335400 18%,#63345188 38%);backdrop-filter:none;z-index:4}
body.arcade #hn-setup .hn-choose{width:100%;max-width:none;max-height:none;overflow:visible;margin:0;border:3px solid #e9cbdc;border-radius:24px;padding:17px 18px;background:#fff4e7 url('../assets/play/hangman/plaque.webp') center/100% 100%;box-shadow:0 6px 8px #3e1b3c77;color:#481733}
body.arcade .hn-choose h2{color:#481733;font:900 25px Georgia,serif;text-align:center}
body.arcade .hn-choose .mg-red{color:#71345f}
body.arcade .hn-sub{color:#66445b;font:500 12px/1.4 system-ui,sans-serif;margin:5px 0 10px}
body.arcade .hn-picks{grid-template-columns:65px minmax(0,1fr);gap:7px;margin:0 0 10px}
body.arcade .hn-picks label,body.arcade .hn-lab{color:#6a435d;font:700 10px system-ui,sans-serif;letter-spacing:.08em}
body.arcade .hn-sel{background:#fffcf5;color:#481733;border:1px solid #b995ad;min-height:44px;padding:5px;font:600 11px system-ui,sans-serif}
body.arcade #hn-setup .hn-lv{min-height:65px;margin:0 0 7px;padding:9px 14px;border:2px solid #c8a3d4;border-radius:18px;background:#d9bfea url('../assets/play/hangman/button.webp') center/100% 100%;color:#481733;box-shadow:0 3px 2px #a774a050}
body.arcade .hn-lv .txt b{font:900 20px Georgia,serif}
body.arcade .hn-lv .txt i{display:block;color:#5b3452;font:500 10px/1.25 system-ui,sans-serif}
body.arcade .hn-lv .pip{color:#71345f;font-size:23px}
body.arcade .hn-lab{margin:11px 0 4px}
body.arcade .hn-setrow{gap:5px;margin:0}
body.arcade .hn-setrow input{flex:1 1 100%;background:#fffcf5!important;color:#481733!important;border:1px solid #b995ad!important;padding:7px 10px!important;font-size:14px!important;border-radius:10px;min-height:44px}
body.arcade .hn-setrow .mgb{flex:1 1 0;font-size:13px;min-width:0;padding:5px}
body.arcade .hn-foot{display:block;color:#795570;font:500 10px/1.35 system-ui,sans-serif;margin-top:8px}
body.arcade .ac-stage[data-phase=setup] .hn-console{visibility:hidden}
body.arcade .ac-stage[data-phase=setup] #hn-mmstatus:not(:empty){visibility:visible;bottom:5px}
body.arcade #hn-overbox{inset:var(--title-h) 0 0;padding:0 12px 15px;align-items:flex-end;justify-content:center;background:linear-gradient(transparent 28%,#40223655);backdrop-filter:none;pointer-events:none}
body.arcade #hn-overbox .hn-end{width:100%;max-width:none;max-height:none;overflow:visible;padding:20px 18px;background:#fff4e7;border:5px ridge #e5c4dc;border-radius:24px;box-shadow:0 8px 20px #38152b88;color:#481733;text-align:center}
body.arcade .hn-end h2.win{font:900 34px Georgia,serif;color:#69377e}
body.arcade .hn-end h2.lose{font:900 34px Georgia,serif;color:#992f51}
body.arcade .hn-endword{color:#481733;font-size:24px;overflow-wrap:anywhere;letter-spacing:.07em}
body.arcade .hn-endline,body.arcade .hn-end .hn-verdict-sub,body.arcade .hn-end .hn-mono{color:#67465c}
body.arcade .hn-end .hn-verdict.good{color:#542d68;background:#e6d4ee;border-color:#ba94c9}
body.arcade .hn-end .hn-verdict.bad{color:#90244c;background:#f4d1de;border-color:#c594a7}
body.arcade .hn-end .hn-check{color:#481733;background:#eddbec;border-color:#caa8c0;font-size:10px;text-align:left}
body.arcade .hn-end .ac-btnrow{justify-content:center;gap:8px;flex-wrap:nowrap;margin-top:13px}
body.arcade .hn-end .mgb{flex:1;padding:8px;font-size:13px}
body.arcade .ac-hero{width:min(100%,760px);padding:28px 20px 8px;box-sizing:border-box;margin:0}
body.arcade .ac-rail{width:min(100%,760px);padding:14px 20px;box-sizing:border-box;display:grid;grid-template-columns:1fr 1fr;gap:12px}
body.arcade .ac-panel{background:#48243e;border-color:#805b78}
body.arcade .ac-copy{padding:20px;max-width:760px;margin:auto}
body.arcade .ac-label,body.arcade .hn-fine,body.arcade .hn-led span{color:#e2cce2}
body.arcade .hn-led::before{background:#c298d150}
body.arcade .hn-led.hit{background:#ba91cd22;border-color:#ae85bf}
body.arcade .hn-words span{background:#d3ace42e;border-color:#ad83c0}
@media(max-width:560px){
 body.arcade .ac-layout .ac-stage{--title-h:74px;width:100%}
 body.arcade .ac-rail{grid-template-columns:1fr;padding:10px 15px}
 body.arcade .ac-hero{padding:23px 18px 8px}
}
@media(max-height:740px){
 body.arcade .ac-layout .ac-stage{--title-h:62px;--console-h:174px}
 body.arcade #hn-setup .hn-choose{padding:12px 13px}
 body.arcade .hn-sub{font-size:11px;margin:4px 0 7px}
 body.arcade .hn-choose h2{font-size:21px}
 body.arcade #hn-setup .hn-lv{min-height:57px;padding:6px 11px;margin-bottom:5px}
 body.arcade .hn-foot{font-size:9px;line-height:1.25}
 body.arcade .hn-lab{margin-top:7px}
 body.arcade #hn-overbox .hn-end{padding:12px}
 body.arcade .hn-end h2.win,body.arcade .hn-end h2.lose{font-size:27px}
}
@media(prefers-reduced-motion:reduce){body.arcade *,body.arcade *::before,body.arcade *::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
/* Comparison pass 2: clearer stage scale, quiet setup paper, room for toggles. */
body.arcade .ac-layout .ac-stage{--console-h:192px;background-size:100% calc(100% + 80px);background-position:center -80px}
body.arcade #hn-setup .hn-choose{border:5px ridge #e8cddd;background:#fff4e7 url('../assets/play/hangman/paper.webp') center/260px 260px}
body.arcade .hn-console .ac-toggles{padding:0;border:0}
body.arcade .hn-console .ac-toggles label{min-height:44px}
body.arcade .hn-console .hn-guessrow input,body.arcade .hn-console .hn-guessrow .mgb{min-height:38px}
body.arcade .hn-console .ac-btnrow .mgb{min-height:44px}
@media(max-height:740px){body.arcade .ac-layout .ac-stage{--console-h:188px}}
/* Comparison pass 3: full-size primary controls and a legible compact stage. */
body.arcade .ac-layout .ac-stage{--console-h:188px}
body.arcade .hn-console{padding-top:32px}
body.arcade .hn-console .hn-guessrow input,body.arcade .hn-console .hn-guessrow .mgb{min-height:44px}
body.arcade .hn-console .hn-guessrow input{font-size:16px;padding:4px}
body.arcade .hn-console .hn-guessrow .mgb{font-size:18px;min-width:92px}
body.arcade .hn-console .ac-btnrow .mgb{font-size:20px}
body.arcade .hn-console .ac-toggles label{font-size:13px}
@media(max-height:740px){body.arcade .ac-layout .ac-stage{--console-h:188px}body.arcade .hn-console .ac-toggles label{font-size:12px}}
/* Final comparison: setup retains Join, and compact statistics keep a type floor. */
body.arcade #hn-setup-join .mgb{width:100%;margin-top:5px;color:#fff6e7;background:#71345f;border:3px ridge #bd82ac}
body.arcade .ac-stage[data-phase=playing] .hn-console #hn-mmstatus:not(:empty){top:0;bottom:auto;padding:5px;font-size:11px;line-height:14px}
body.arcade .hn-console:has(#hn-mmstatus:not(:empty)) #hn-feedback{visibility:hidden}
/* Validation/copy notices take precedence over the previous guess feedback. */
body.arcade .hn-console #hn-status[data-notice=true]{visibility:visible;z-index:10;background:#fff6e7;border-radius:5px}
body.arcade .hn-console:has(#hn-status[data-notice=true]) #hn-feedback{visibility:hidden}

body.arcade .ac-stage[data-phase=setup] #hn-status[data-notice=true]{top:auto;bottom:6px;padding:5px;border:1px solid #b18da6}
