html[data-fm-haunted-word]{color-scheme:dark;font-family:system-ui,-apple-system,"Segoe UI",sans-serif;background:#0b141e;color:#fff2d9}
html[data-fm-haunted-word] body{margin:0;background:linear-gradient(#08132055,#081320e8 850px),url('/games/fm-forbidden-library-20260923.jpg?v=haunted-word-2') center top/auto 950px no-repeat #0b141e;min-height:100svh}
#haunted-word,#haunted-word *{box-sizing:border-box}
#haunted-word{width:min(100%,640px);margin:auto;padding:max(8px,env(safe-area-inset-top)) 12px max(18px,env(safe-area-inset-bottom));font-size:16px;line-height:1.5}
#haunted-word [hidden]{display:none!important}
#haunted-word a{color:#ffdd95;text-underline-offset:4px}
#haunted-word button,#haunted-word input{font:inherit}
#haunted-word button,#haunted-word summary{cursor:pointer;touch-action:manipulation}
#haunted-word :is(button,a,input,summary):focus-visible{outline:3px solid #8be6dc;outline-offset:3px}
#haunted-word .hw-header{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px;background:#101d2af0;border-radius:10px;padding:5px 12px}
#haunted-word .hw-header a{display:flex;flex-direction:column;justify-content:center;min-height:44px;font-size:14px;font-weight:750;text-decoration:none}
#haunted-word .hw-brand span{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:#e3d1b6}
#haunted-word .hw-regular{text-align:right;max-width:150px}
#haunted-word .hw-setup,#haunted-word .hw-play{border:1px solid #b99a64;border-radius:16px;background:#111e2cef;box-shadow:0 16px 45px #0007;padding:18px}
#haunted-word .hw-scene{height:155px;background:url('/games/fm-forbidden-library-20260923.jpg?v=haunted-word-2') center 40%/cover;border-radius:9px;border:1px solid #b99a6477;margin-bottom:16px}
#haunted-word .hw-kicker{font-size:12px;font-weight:750;letter-spacing:.1em;text-transform:uppercase;color:#f0ce92;margin:0 0 3px}
#haunted-word h1{font-family:Georgia,"Times New Roman",serif;font-weight:700;font-size:clamp(29px,7vw,42px);line-height:1.08;margin:0;color:#fff1ce}
#haunted-word .hw-intro{margin:12px 0;font-size:16px}
#haunted-word .hw-bonus{font-size:14px;color:#e3d1b6;margin:0 0 16px}
#haunted-word form{display:grid;gap:7px}
#haunted-word label{font-weight:700;font-size:14px}
#haunted-word input{width:100%;min-height:46px;background:#fff9ee;color:#172434;border:2px solid #c2a271;border-radius:8px;padding:9px 12px;font-size:16px}
#haunted-word .hw-privacy{font-size:13px;color:#e3d1b6;margin:3px 0 8px}
#haunted-word .hw-primary,#haunted-word .hw-secondary{display:flex;align-items:center;justify-content:center;text-align:center;min-height:48px;padding:10px 15px;border:1px solid #e8c68d;border-radius:9px;font-size:16px;font-weight:750;text-decoration:none;background:#efce92;color:#211b26}
#haunted-word .hw-secondary{background:#223549;color:#fff2d9}
#haunted-word button:disabled{cursor:default;opacity:.65}
#haunted-word .hw-instructions{margin-top:12px;font-size:14px;color:#e9decc;border-top:1px solid #566476}
#haunted-word summary{min-height:44px;padding:10px 0;font-weight:700;color:#ffdd95}
#haunted-word .hw-instructions p{margin:4px 0 12px}
#haunted-word .hw-play-heading{display:flex;gap:10px;justify-content:space-between;align-items:center}
#haunted-word .hw-play h1{font-size:clamp(26px,6vw,34px)}
#haunted-word #hwDate{font-size:13px;color:#e3d1b6;white-space:nowrap}
#haunted-word .hw-stats{display:flex;justify-content:space-between;flex-wrap:wrap;gap:4px;margin:10px 0;font-size:14px;color:#fff2d9}
#haunted-word .hw-board{display:grid;gap:5px;width:clamp(185px,calc((100svh - 360px)*.83),305px);max-width:100%;margin:0 auto}
#haunted-word .hw-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
#haunted-word .hw-tile{display:flex;justify-content:center;align-items:center;aspect-ratio:1;background:#f5eedf;color:#142334;border:2px solid #ad9c7f;border-radius:5px;font-size:clamp(21px,6vw,31px);font-weight:800;line-height:1;position:relative}
#haunted-word .hw-row[data-current] .hw-tile{border-color:#ffcf78;box-shadow:0 0 0 1px #ffcf7844}
#haunted-word :is(.hw-tile,.hw-key)[data-state=correct]{background:#145d4c;color:#fff;border-color:#83dbb7}
#haunted-word :is(.hw-tile,.hw-key)[data-state=present]{background:#edc36c;color:#201b19;border-color:#ffdfa0}
#haunted-word :is(.hw-tile,.hw-key)[data-state=absent]{background:#354252;color:#fff;border-color:#7e8b9b}
#haunted-word .hw-tile[data-state]::after{position:absolute;bottom:2px;right:2px;font:700 12px/1 system-ui;content:'−'}
#haunted-word .hw-tile[data-state=correct]::after{content:'✓'}
#haunted-word .hw-tile[data-state=present]::after{content:'↔'}
#haunted-word .hw-hint{font-size:14px;line-height:1.35;min-height:38px;margin:9px 0;color:#e9decc;text-align:center}
#haunted-word .hw-keyboard{display:grid;gap:5px;margin-top:7px}
#haunted-word .hw-key-row{display:flex;justify-content:center;gap:4px}
#haunted-word .hw-key{display:flex;justify-content:center;align-items:center;flex:1 1 0;min-width:0;max-width:54px;min-height:46px;padding:0;border:1px solid #c8b794;border-radius:5px;background:#eee8dc;color:#182532;font-size:16px;font-weight:750}
#haunted-word .hw-key.wide{flex:1.65 1 0;max-width:84px;font-size:13px}
#haunted-word .hw-message{min-height:22px;margin:7px 0 0;font-size:14px;color:#ffddb2}
#haunted-word .hw-result{padding:16px;background:#243349;border:1px solid #d7b170;border-radius:12px;margin-top:12px;text-align:center}
#haunted-word .hw-result h2{font-size:24px;margin:0 0 6px}
#haunted-word #hwTickets{display:block;font-size:clamp(27px,7vw,38px);color:#ffdd95;margin:12px 0}
#haunted-word .hw-result a{margin:8px 0;min-height:44px;display:flex;align-items:center;justify-content:center}
#haunted-word .hw-footer{display:flex;flex-direction:column;gap:5px;align-items:center;text-align:center;padding-top:12px;font-size:13px;color:#dfd3c0}
#haunted-word .hw-footer a{font-size:14px;min-height:44px;display:flex;align-items:center}
#haunted-word #hwSetupStatus{font-size:14px;min-height:22px;margin:0}
#haunted-word #fmRewardGateStatus,#haunted-word #fmRewardGateFallback{position:static!important;inset:auto!important;transform:none!important;width:100%!important;max-width:100%!important;margin:8px 0;padding:9px;background:#243349;color:#fff2d9;font-size:14px;pointer-events:none}
html[data-fm-haunted-word] #fmRewardGateStatus[hidden]{display:none!important}
@media(max-width:480px){#haunted-word{padding-inline:8px}#haunted-word .hw-play{padding:10px 7px}#haunted-word .hw-header{padding-inline:8px}#haunted-word .hw-key-row{gap:3px}#haunted-word .hw-scene{height:125px}}
@media(max-height:480px) and (orientation:landscape){#haunted-word{width:min(100%,840px)}#haunted-word .hw-play{display:grid;grid-template-columns:190px minmax(0,1fr);gap:5px 15px}#haunted-word .hw-play-heading,#haunted-word .hw-stats{grid-column:1/-1}#haunted-word .hw-board{grid-column:1;grid-row:3/7;width:185px}#haunted-word .hw-keyboard,#haunted-word .hw-hint,#haunted-word .hw-message,#haunted-word .hw-result,#haunted-word .hw-play-help{grid-column:2}#haunted-word .hw-footer{padding-top:5px}}
#fm-after-dark .night-word-result{margin:20px;padding:20px;background:#142534;border:2px solid #d4b17c;border-radius:12px;color:#fff2d9}
#fm-after-dark .night-word-result[hidden]{display:none!important}
#fm-after-dark .night-word-result h3{font:700 clamp(24px,5vw,34px)/1.2 Georgia,serif;color:#fff2d9;margin:0 0 10px}
#fm-after-dark .night-word-result p{font:500 16px/1.5 system-ui;color:#f4e3c7;margin:8px 0}
#fm-after-dark .night-word-result strong{font:800 clamp(26px,6vw,42px)/1.2 system-ui;color:#ffda8c;display:block;margin:12px 0}
#fm-after-dark .night-word-result nav{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
#fm-after-dark .night-word-result a,#fm-after-dark .night-regular-word{display:inline-flex;min-height:44px;align-items:center;padding:8px 12px;font:700 14px/1.4 system-ui;color:#ffe0a5;text-underline-offset:4px}
#fm-after-dark .night-word-result nav a{background:#283a4d;border:1px solid #d4b17c;border-radius:7px}
@media(prefers-reduced-motion:reduce){#haunted-word *{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
