*,:before,:after{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{color:#f2e9e4;-webkit-font-smoothing:antialiased;background:#05020a;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;overflow:hidden}button{cursor:pointer;font-family:inherit}.app{background:radial-gradient(1200px 700px at 50% -10%,#3a0d10 0%,#140409 45%,#05020a 100%);flex-direction:column;width:100vw;height:100dvh;display:flex;position:relative;overflow:hidden}.devil-stage{flex-direction:column;flex:0 0 50vh;justify-content:center;align-items:center;gap:.4rem;min-height:340px;transition:filter .6s;display:flex;position:relative;overflow:hidden}.devil-stage--dark{filter:brightness(.25)saturate(.5)}.devil-video{object-fit:cover;object-position:center top;z-index:0;width:100%;height:100%;position:absolute;inset:0;-webkit-mask-image:linear-gradient(#000 86%,#0000 100%);mask-image:linear-gradient(#000 86%,#0000 100%)}.devil-portal{background:radial-gradient(circle at 50% 40%,#ff7a1a 0%,#b81616 30%,#4a0808 60%,#180203 100%);border-radius:50% 50% 46% 46%;justify-content:center;align-items:center;width:190px;height:120px;animation:3.5s ease-in-out infinite portal-flicker;display:flex;position:relative;box-shadow:0 0 60px 20px #ff3c0059,inset 0 -10px 30px #0009}@keyframes portal-flicker{0%,to{box-shadow:0 0 60px 20px #ff3c0059,inset 0 -10px 30px #0009}50%{box-shadow:0 0 80px 28px #ff5a0080,inset 0 -10px 30px #0009}}.devil-face{filter:drop-shadow(0 4px 10px #0009);font-size:4.2rem;line-height:1;transform:translateY(2px)}.devil-caption{z-index:1;letter-spacing:.03em;color:#ffd7b0;text-shadow:0 2px 8px #000000f2;background:#08030673;border-radius:8px;margin:0;padding:.15rem .7rem;font-size:1rem;position:relative}.board-area{flex:auto;min-height:0;position:relative}.board-area canvas{touch-action:none;display:block}.hud{display:contents}.hud-mini{z-index:65;pointer-events:none;align-items:center;gap:.5rem;display:flex;position:fixed;top:.6rem;left:.6rem}.hud-handle{pointer-events:auto;color:#ffb0a2;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#0c0508b8;border:1px solid #5a2027;border-radius:10px;width:38px;height:38px;font-size:1.05rem;line-height:1}.hud-handle:hover{background:#280e14eb}.mini-phase{color:#e8d7d0;white-space:nowrap;background:#0c050899;border:1px solid #5a2027cc;border-radius:999px;padding:.22rem .62rem;font-size:.76rem;font-weight:700}.mini-streak .pips{gap:.22rem}.mini-streak .pip{width:11px;height:11px}.hud-edge{z-index:64;pointer-events:auto;background:0 0;width:22px;height:100%;position:fixed;top:0;left:0}.hud-drawer{z-index:70;pointer-events:auto;background:linear-gradient(#0e0509f7,#080306f7);border-right:1px solid #5a2027;flex-direction:column;gap:.85rem;width:min(300px,84vw);padding:3.4rem .9rem 1.2rem;transition:transform .28s;display:flex;position:fixed;top:0;bottom:0;left:0;overflow-y:auto;transform:translate(-102%);box-shadow:8px 0 40px #0009}.hud-drawer--open{transform:translate(0)}.drawer-section{flex-direction:column;gap:.35rem;display:flex}.drawer-label{text-transform:uppercase;letter-spacing:.1em;color:#a8887f;font-size:.68rem}.drawer-newgame{align-self:flex-start}.hud-title{letter-spacing:.04em;color:#ff5b4a;text-shadow:0 2px 10px #000c;font-size:1.05rem;font-weight:800}.hud-sub{color:#c9b8b2;font-size:.8rem;font-weight:500}.difficulty{pointer-events:auto;flex-wrap:wrap;gap:.35rem;display:flex}.difficulty button{color:#f2e9e4;background:#1e0c10d9;border:1px solid #5a2027;border-radius:6px;padding:.28rem .6rem;font-size:.8rem}.difficulty button:hover{background:#3a141a}.difficulty .newgame{background:#7a1620;border-color:#a5333f}.difficulty .tex-on{background:#5a3aa5;border-color:#8a6ad0}.difficulty .view-on{background:#1e5c8a;border-color:#3a8ad0}.judge-side{z-index:60;background:#10060ae6;border:1px solid #5a2027;border-radius:12px;flex-direction:column;gap:.5rem;width:150px;padding:.6rem;display:flex;position:fixed;top:44%;right:.9rem;transform:translateY(-50%);box-shadow:0 12px 34px #0009}.judge-q{text-align:center;color:#ffd54a;margin-bottom:.1rem;font-size:.82rem;font-weight:700}.judge-btn{color:#fff;border:none;border-radius:9px;padding:.6rem;font-size:.95rem;font-weight:800;transition:filter .15s,transform 80ms}.judge-btn:hover{filter:brightness(1.12)}.judge-btn:active{transform:translateY(1px)}.judge-trust{background:linear-gradient(#2f7d4f,#1e5c39)}.judge-accuse{letter-spacing:.03em;background:linear-gradient(#d21f2c,#8a1119)}.phase-pill{background:#14080cd9;border:1px solid #5a2027;border-radius:999px;align-self:flex-start;padding:.25rem .7rem;font-size:.82rem;font-weight:700}.phase-judgment{color:#ffd54a;border-color:#8a6a12}.phase-investigation{color:#ff8a3d;border-color:#8a4012}.phase-darkness,.phase-devil-thinking{color:#b8b8ff}.streak{background:#14080cb8;border:1px solid #40161c;border-radius:8px;flex-direction:column;gap:.2rem;padding:.45rem .6rem;display:flex}.streak-label{color:#d7b7a8;text-transform:uppercase;letter-spacing:.08em;font-size:.72rem}.pips{gap:.3rem;display:flex}.pip{background:#2a1015;border:1px solid #5a2027;border-radius:50%;width:16px;height:16px}.pip--on{background:radial-gradient(circle at 40% 35%,#ffb020,#ff3b1e);box-shadow:0 0 10px #ff5000cc}.streak-hint{color:#b79890;font-size:.72rem}.controls-hint{color:#8a7a72;letter-spacing:.02em;align-self:flex-start;font-size:.72rem}.trays{flex-direction:column;gap:.4rem;display:flex}.tray{background:#14080cb8;border:1px solid #40161c;border-radius:8px;min-width:150px;padding:.4rem .55rem}.tray-label{color:#d7b7a8;text-transform:uppercase;letter-spacing:.06em;font-size:.68rem;display:block}.tray-pieces{flex-wrap:wrap;gap:.1rem;min-height:1.4rem;font-size:1.25rem;display:flex}.glyph-player{color:#efe6d2}.glyph-devil{color:#ff6a5a}.tray-empty{color:#6a5157;font-size:.9rem}.dim-overlay{z-index:50;pointer-events:none;position:fixed;inset:0;overflow:hidden}.blackout-video{object-fit:cover;z-index:0;width:100%;height:100%;position:absolute;inset:0}.dim-black{z-index:1;background:#000;transition:opacity .6s;position:absolute;inset:0}.dim-caption{text-align:center;z-index:2;color:#8a8aa0;letter-spacing:.2em;text-transform:uppercase;font-size:.9rem;animation:1.6s ease-in-out infinite pulse-caption;position:absolute;bottom:14%;left:0;right:0}@keyframes pulse-caption{0%,to{opacity:.3}50%{opacity:.8}}.melt-overlay{z-index:58;pointer-events:none;flex-direction:column;align-items:center;width:min(240px,42vw);animation:.25s ease-out melt-pop;display:flex;position:fixed;top:54%;left:50%;transform:translate(-50%,-50%)}@keyframes melt-pop{0%{opacity:0;transform:translate(-50%,-50%)scale(.85)}to{opacity:1;transform:translate(-50%,-50%)scale(1)}}.melt-video{aspect-ratio:1;object-fit:cover;filter:saturate(1.15)contrast(1.05);border-radius:12px;width:100%;box-shadow:0 0 44px 10px #ff28008c}.melt-label{color:#ff6a5a;letter-spacing:.22em;text-transform:uppercase;text-shadow:0 2px 8px #000;margin-top:.45rem;font-size:.78rem}.panel-dock{z-index:60;width:min(560px,92vw);position:fixed;bottom:1.4rem;left:50%;transform:translate(-50%)}.panel{text-align:center;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);background:#10060af0;border:1px solid #5a2027;border-radius:14px;padding:.9rem 1rem;box-shadow:0 18px 50px #0009}.panel-prompt{color:#ffdcc4;margin:0 0 .7rem;font-size:1rem}.panel-actions{justify-content:center;gap:.6rem;display:flex}.panel-actions.wrap{flex-wrap:wrap}.btn{color:#fff;border:none;border-radius:9px;padding:.6rem 1.1rem;font-size:.95rem;font-weight:700;transition:transform 80ms,filter .15s}.btn:hover{filter:brightness(1.12)}.btn:active{transform:translateY(1px)}.btn:disabled{opacity:.45;cursor:not-allowed}.btn-trust{background:linear-gradient(#2f7d4f,#1e5c39)}.btn-accuse{letter-spacing:.04em;background:linear-gradient(#d21f2c,#8a1119)}.btn-seize{background:linear-gradient(#c9781a,#8a4b0f);min-width:56px}.btn-ghost{background:#50282e99;border:1px solid #6a2830}.chips{flex-wrap:wrap;justify-content:center;gap:.35rem;min-height:1.6rem;margin-bottom:.7rem;display:flex}.chip{color:#ffb3b3;letter-spacing:.05em;background:#3a1319;border:1px solid #ff3b3b;border-radius:6px;padding:.2rem .55rem;font-weight:700}.chips-empty{color:#7a5157;font-style:italic}.resolved-msg{margin:0 0 .4rem;font-size:1.05rem;font-weight:700}.replay-note{color:#cbb;margin:0 0 .7rem;font-size:.82rem}.grade-CORRECT_CATCH .resolved-msg{color:#56d98a}.grade-MISSED_CHEAT .resolved-msg{color:#ff6a5a}.grade-FALSE_ALARM .resolved-msg{color:#ffd54a}.grade-WRONG_TARGET .resolved-msg{color:#ffa04a}.grade-CLEAN_ACCEPT .resolved-msg{color:#cfd8dc}.gameover-msg{color:#ff5b4a;margin:0 0 .8rem;font-size:1.3rem;font-weight:800}.boot{z-index:200;color:#f2e9e4;text-align:center;background:radial-gradient(1200px 800px at 50% 30%,#3a0d10 0%,#140409 45%,#05020a 100%);justify-content:center;align-items:safe center;padding:1rem 0;display:flex;position:fixed;inset:0;overflow-y:auto}.age-card{background:#0e0508e6;border:1px solid #6a2028;border-radius:16px;max-width:460px;margin:1rem;padding:2rem 1.8rem;box-shadow:0 20px 60px #000000b3}.age-badge{letter-spacing:.05em;color:#fff;background:linear-gradient(#d21f2c,#7a0e15);border-radius:10px;margin-bottom:.8rem;padding:.3rem .9rem;font-size:1.5rem;font-weight:900;display:inline-block;box-shadow:0 0 24px #ff280080}.age-card h1{color:#ff5b4a;letter-spacing:.04em;margin:0 0 .6rem;font-size:1.7rem}.age-card p{color:#d9c7c0;margin:0 0 .7rem;line-height:1.5}.age-confirm{font-weight:700;color:#ffd7b0!important}.age-actions{flex-direction:column;gap:.6rem;margin:1.2rem 0 .8rem;display:flex}.btn-enter{color:#fff;background:linear-gradient(#b81622,#7a0e15);border:none;border-radius:10px;padding:.8rem 1rem;font-size:1.02rem;font-weight:800;box-shadow:0 0 26px #ff280059}.btn-enter:hover{filter:brightness(1.12)}.btn-leave{color:#b79890;background:0 0;border:1px solid #5a3238;border-radius:10px;padding:.55rem 1rem;font-size:.9rem}.age-foot{font-size:.78rem;color:#7a5157!important;margin-top:.6rem!important}.boot.splash{cursor:pointer;background:#000;padding:0;overflow:hidden}.splash-video{object-fit:contain;width:100%;height:100%}.splash-skip{z-index:210;color:#fff;letter-spacing:.05em;background:#0000008c;border:1px solid #ffffff4d;border-radius:999px;padding:.5rem 1rem;font-weight:700;position:absolute;bottom:1.2rem;right:1.2rem}.splash-skip:hover{background:#000c}.boot.menu{background:#05020a}.menu-bg{object-fit:cover;object-position:center 42%;filter:brightness(.82)saturate(1.08);z-index:0;width:100%;height:100%;position:absolute;inset:0}.menu-scrim{z-index:1;background:radial-gradient(1100px 900px at 50% 40%,#05020a00,#05020a8c 80%),linear-gradient(#05020ae6 0%,#05020a4d 20%,#05020a3d 50%,#05020ad9 84%,#05020af7 100%);position:absolute;inset:0}.menu-content{z-index:2;flex-direction:column;align-items:center;justify-content:space-between;gap:.2rem;width:100%;max-width:560px;min-height:96vh;min-height:96dvh;padding:max(3vh,1rem) 1rem max(3vh,1rem);display:flex;position:relative}.menu-content .menu-title{margin-top:.4rem}.menu-content .menu-foot{margin-top:.2rem}.menu-title{letter-spacing:.06em;color:#ff4632;text-shadow:0 0 30px #ff280099,0 4px 12px #000000e6;margin:0;font-size:clamp(2.4rem,8vw,4.2rem);font-weight:900}.menu-sub{letter-spacing:.35em;color:#e6b873;text-transform:uppercase;margin:.1rem 0 0;font-size:clamp(.9rem,3vw,1.2rem)}.menu-tag{color:#d9c7c0;max-width:30ch;margin:1rem 0 1.4rem;font-size:1rem}.menu-diff{gap:.5rem;display:flex}.diff-pill{color:#d9c7c0;background:#14080cb3;border:1px solid #5a2027;border-radius:999px;padding:.5rem 1.1rem;font-weight:700}.diff-pill.diff-on{color:#fff;background:linear-gradient(#b81622,#7a0e15);border-color:#ff5b4a;box-shadow:0 0 18px #ff280066}.menu-diff-note{color:#b79890;min-height:1.2rem;margin:.7rem 0 1.4rem;font-size:.86rem}.menu-play{letter-spacing:.04em;color:#fff;background:linear-gradient(#d21f2c,#7a0e15);border:none;border-radius:12px;padding:.95rem 2.4rem;font-size:1.25rem;font-weight:900;animation:2.4s ease-in-out infinite play-pulse;box-shadow:0 0 34px #ff280080}@keyframes play-pulse{0%,to{box-shadow:0 0 34px #ff280080}50%{box-shadow:0 0 54px #ff4600bf}}.menu-play:hover{filter:brightness(1.12)}.menu-help-link{color:#cbb;background:0 0;border:none;margin-top:1.1rem;font-size:.9rem;text-decoration:underline}.menu-foot{color:#7a5157;letter-spacing:.04em;margin-top:1.4rem;font-size:.76rem}.help-overlay{z-index:5;background:#030105cc;justify-content:center;align-items:center;padding:1rem;display:flex;position:absolute;inset:0}.help-card{text-align:left;background:#10060af5;border:1px solid #5a2027;border-radius:14px;max-width:480px;padding:1.6rem}.help-card h2{color:#ff5b4a;text-align:center;margin:0 0 .8rem}.help-card ul{color:#e0d3cd;margin:0 0 1.1rem;padding-left:1.1rem;line-height:1.55}.help-card li{margin-bottom:.5rem}.help-card .btn-enter{width:100%}@media (width<=640px){.devil-stage{flex-basis:20vh;min-height:120px}.devil-portal{width:150px;height:96px}.devil-face{font-size:3.2rem}.hud-title{font-size:.9rem}.tray{min-width:120px}}.app-mp{flex-direction:column;display:flex}.board-area--full{flex:auto;min-height:0}.menu-versus{letter-spacing:.04em;color:#ffd9c8;cursor:pointer;background:linear-gradient(#46141b,#2a0b10);border:1px solid #7d2a30;border-radius:10px;margin-top:.7rem;padding:.7rem 1.5rem;font-size:1rem;font-weight:700}.menu-versus:hover{background:linear-gradient(#5c1a22,#360d14)}.room-lobby .menu-content{max-width:420px}.room-label{letter-spacing:.08em;text-transform:uppercase;color:#b9a49c;text-align:left;margin:.6rem 0;font-size:.8rem;display:block}.room-input{width:100%;font:inherit;color:#f3e7e2;background:#0a0406cc;border:1px solid #5a2027;border-radius:8px;margin-top:.35rem;padding:.6rem .75rem;display:block}.room-input:focus{border-color:#ff5b4a;outline:none}.room-code-input{text-align:center;letter-spacing:.35em;text-transform:uppercase;font-size:1.3rem}.room-or{letter-spacing:.1em;text-transform:uppercase;color:#8d7871;margin:1rem 0 .5rem;font-size:.78rem}.room-join{align-items:stretch;gap:.5rem;display:flex}.room-join .room-input{margin-top:0}.room-join .btn{white-space:nowrap}.room-waiting{text-align:center}.room-code-label{letter-spacing:.14em;text-transform:uppercase;color:#8d7871;margin:0;font-size:.75rem}.room-code{letter-spacing:.35em;color:#ffb020;text-shadow:0 0 18px #ffb02059;margin:.2rem 0 .8rem;font-size:2.6rem;font-weight:800}.room-hint{color:#cdbcb5;margin:0 0 .9rem;font-size:.9rem;line-height:1.5}.room-status{color:#e6d7d1;margin:0 0 .4rem}.room-seat{color:#9fd0a0;margin:0 0 1rem;font-size:.86rem}.room-error{color:#ffc9c0;background:#78141459;border:1px solid #a33;border-radius:8px;margin-top:.9rem;padding:.5rem .7rem;font-size:.88rem}.mp-bar{z-index:60;color:#d8c8c2;pointer-events:auto;background:linear-gradient(#080305eb,#08030500);align-items:center;gap:.75rem;padding:.4rem .7rem;font-size:.78rem;display:flex;position:fixed;top:0;left:0;right:0}.mp-room{letter-spacing:.2em;color:#ffb020;font-weight:800}.mp-score{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.mp-score strong{color:#f3e7e2}.mp-offline{opacity:.55}.mp-leave{color:#ffc9c0;cursor:pointer;background:#50101499;border:1px solid #7d2a30;border-radius:7px;margin-left:auto;padding:.3rem .7rem;font-size:.75rem}.mp-actions{z-index:62;flex-direction:column;align-items:stretch;gap:.5rem;display:flex;position:fixed;top:50%;right:.7rem;transform:translateY(-50%)}.mp-turn{letter-spacing:.1em;text-transform:uppercase;color:#9fd0a0;text-align:center;font-size:.75rem}.mp-waiting{z-index:61;color:#cdbcb5;background:#0a0406d1;border:1px solid #46212a;border-radius:999px;padding:.5rem .9rem;font-size:.85rem;position:fixed;bottom:1.1rem;left:50%;transform:translate(-50%)}.cheat-planner{border-color:#7d2a30}.cheat-planner .panel-prompt strong{color:#ff5b4a}.mp-error{z-index:80;color:#fff0ec;cursor:pointer;background:#781414eb;border:1px solid #a33;border-radius:10px;align-items:center;gap:.6rem;max-width:90vw;padding:.6rem .9rem;font-size:.88rem;display:flex;position:fixed;bottom:1.1rem;left:50%;transform:translate(-50%)}.mp-error-x{opacity:.7}@media (width<=640px){.mp-bar{gap:.45rem;font-size:.7rem}.mp-actions{top:auto;bottom:5.5rem;transform:none}.room-code{font-size:2rem}}

/* Mobile: keep judgment controls off the chess board. Anchor them in the empty
   space just under the devil's screen so the board stays fully visible/tappable.
   The devil-stage caption already carries the devil's per-phase messages. */
@media (max-width:640px){
  /* Judgment + investigation controls sit over the devil's eye, never over the
     board. top is clamped so the bar stays inside the >=120px devil-stage on
     both short and tall phones, leaving the whole board visible and tappable. */
  .judge-side{top:max(72px,calc(20vh - 52px));bottom:auto;left:50%;right:auto;transform:translateX(-50%);flex-direction:row;flex-wrap:nowrap;justify-content:center;align-items:center;width:min(94vw,430px);max-width:94vw;gap:.5rem;padding:0;background:transparent;border:none;box-shadow:none}
  .judge-side .judge-q{display:none}
  .judge-side .judge-btn{flex:1 1 0;min-width:0;padding:.58rem .5rem;font-size:1rem;box-shadow:0 6px 18px #000b}
  .investigate-side .judge-btn.btn-ghost{flex:0 0 auto;padding:.58rem .9rem}
}

/* The evil-eye still image fills the devil's screen exactly like the devil
   videos do (they still play on the devil's turn); the caption sits above it. */
.devil-eye{object-fit:cover;object-position:center;z-index:0;width:100%;height:100%;position:absolute;inset:0;-webkit-mask-image:linear-gradient(#000 86%,#0000 100%);mask-image:linear-gradient(#000 86%,#0000 100%)}

/* Splash menu: title pinned top, demon art shows in the middle, controls at bottom. */
.menu-head{display:flex;flex-direction:column;align-items:center;gap:.05rem}
.menu-actions{display:flex;flex-direction:column;align-items:center;gap:.55rem;width:100%}
.menu-actions .menu-tag{margin:.1rem 0 .35rem}
.menu-actions .menu-diff-note{margin:.25rem 0 .5rem}
.menu-actions .menu-foot{margin-top:.3rem}

/* Straight-chess toggle on the menu (animations off = plain chess vs the engine). */
.menu-anim-toggle{color:#d9c7c0;background:#14080cb3;border:1px solid #5a2027;border-radius:999px;padding:.5rem 1.1rem;font-size:.84rem;font-weight:700;letter-spacing:.01em}
.menu-anim-toggle:hover{background:#20101a}
.menu-anim-toggle.on{color:#eafff2;background:linear-gradient(#1e5c39,#123c26);border-color:#2f7d4f;box-shadow:0 0 16px #2f7d4f55}
