:root{
  --bg:#0b1020;--panel:#121a2e;--card:#18223a;--line:#2b395b;--text:#f7f9ff;--muted:#aeb9d4;
  --accent:#7dd3fc;--accent2:#a78bfa;--good:#86efac;--bad:#fca5a5;--warn:#fde68a;
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:linear-gradient(180deg,#090e1a,#0e1426 50%,#0a0f1d);color:var(--text);min-height:100vh}
a{color:inherit;text-decoration:none}.wrap{width:min(1100px,calc(100% - 32px));margin:auto}.site-header{position:sticky;top:0;z-index:20;background:rgba(9,14,26,.88);backdrop-filter:blur(12px);border-bottom:1px solid rgba(255,255,255,.08)}.header-inner{min-height:64px;display:flex;align-items:center;justify-content:space-between;gap:20px}.brand{font-weight:900;letter-spacing:.02em}.site-header nav{display:flex;gap:18px;color:var(--muted);font-size:14px}.hero{padding:88px 0 64px}.eyebrow{font-size:12px;font-weight:800;letter-spacing:.18em;color:var(--accent);margin:0 0 10px}.hero h1{font-size:clamp(42px,9vw,86px);line-height:.98;margin:0 0 18px;letter-spacing:-.05em}.hero>p:not(.eyebrow){max-width:620px;color:var(--muted);font-size:18px;line-height:1.8}.primary-btn,.ghost-btn,.game-card button,.choice-btn,.big-action{border:0;cursor:pointer;font:inherit}.primary-btn{display:inline-flex;margin-top:18px;background:var(--accent);color:#07101d;font-weight:900;padding:14px 20px;border-radius:14px}.section{padding:50px 0}.section-heading{display:flex;align-items:end;justify-content:space-between;gap:24px;margin-bottom:22px}.section-heading h2,.info-section h2{font-size:32px;margin:0}.section-heading>p{color:var(--muted);margin:0}.game-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.game-card{background:linear-gradient(150deg,var(--card),#111a30);border:1px solid var(--line);border-radius:20px;padding:20px;min-height:210px;display:flex;flex-direction:column}.game-card .num{color:var(--accent);font-size:12px;font-weight:900;letter-spacing:.15em}.game-card h3{font-size:24px;margin:10px 0 6px}.game-card p{color:var(--muted);line-height:1.6;margin:0 0 16px;flex:1}.game-card .best{font-size:13px;color:var(--warn);margin-bottom:12px}.game-card button{width:100%;padding:12px;border-radius:12px;background:#eef3ff;color:#0a1020;font-weight:900}.hidden{display:none!important}.play-section{padding:34px 0 70px}.play-topbar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:12px}.play-topbar #restart-btn{justify-self:end}.play-title-wrap{text-align:center}.play-title-wrap span{font-size:11px;color:var(--accent);font-weight:900}.play-title-wrap h2{margin:2px 0 0;font-size:26px}.ghost-btn{background:transparent;border:1px solid var(--line);color:var(--text);padding:10px 14px;border-radius:12px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0}.stats>div{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:12px;text-align:center}.stats span{display:block;color:var(--muted);font-size:11px;font-weight:800}.stats strong{font-size:25px}.game-stage{position:relative;min-height:430px;background:radial-gradient(circle at 50% 40%,#17233c,#0c1323 70%);border:1px solid var(--line);border-radius:22px;overflow:hidden;outline:none}.game-message{text-align:center;color:var(--muted);min-height:24px}.start-screen,.end-screen{position:absolute;inset:0;display:grid;place-items:center;text-align:center;padding:24px}.start-box,.end-box{max-width:560px}.start-box h3,.end-box h3{font-size:34px;margin:0 0 10px}.start-box p,.end-box p{color:var(--muted);line-height:1.7}.big-action{padding:15px 24px;border-radius:14px;background:var(--accent);color:#06101b;font-weight:900;font-size:18px}.target{position:absolute;width:68px;height:68px;border-radius:50%;border:0;background:var(--accent);color:#07101d;font-weight:900;font-size:18px;box-shadow:0 0 0 8px rgba(125,211,252,.1);cursor:pointer}.tap-wrap,.center-game{height:430px;display:grid;place-items:center;padding:22px;text-align:center}.tap-button{width:min(240px,70vw);aspect-ratio:1;border-radius:50%;border:0;background:var(--accent2);font-size:34px;font-weight:900;color:white;cursor:pointer;box-shadow:0 0 0 12px rgba(167,139,250,.08)}.number-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;width:min(520px,92%);margin:auto;padding:28px 0}.number-grid button{min-height:62px;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--text);font-size:20px;font-weight:900;cursor:pointer}.number-grid button.done{opacity:.18}.prompt{font-size:clamp(34px,10vw,72px);font-weight:900;letter-spacing:-.04em}.subprompt{color:var(--muted);margin-top:8px}.choices{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:22px}.choice-btn{min-width:110px;min-height:54px;padding:12px 18px;border-radius:14px;background:var(--card);border:1px solid var(--line);color:var(--text);font-weight:900;font-size:18px}.memory-board{display:grid;grid-template-columns:repeat(3,86px);gap:10px;justify-content:center}.memory-tile{width:86px;height:86px;border-radius:14px;border:1px solid var(--line);background:var(--card);cursor:pointer}.memory-tile.lit{background:var(--accent);transform:scale(.96)}.fall-item{position:absolute;width:54px;height:54px;border-radius:50%;display:grid;place-items:center;font-size:26px;border:0;cursor:pointer}.fall-good{background:var(--good)}.fall-bad{background:var(--bad)}.reaction-pad{width:min(520px,86%);height:230px;border-radius:24px;border:1px solid var(--line);display:grid;place-items:center;font-size:28px;font-weight:900;cursor:pointer;user-select:none}.reaction-wait{background:#29334a}.reaction-go{background:var(--good);color:#08200f}.typing-input{width:min(520px,90%);font:inherit;font-size:24px;padding:14px 16px;border-radius:14px;border:2px solid var(--line);background:#0a1120;color:var(--text);outline:none}.typing-input:focus{border-color:var(--accent)}.higher-number{font-size:110px;font-weight:950;line-height:1}.info-section{border-top:1px solid rgba(255,255,255,.08)}.info-section p:not(.eyebrow){color:var(--muted);line-height:1.8;max-width:780px}footer{border-top:1px solid rgba(255,255,255,.08);padding:30px 0 50px;color:var(--muted);font-size:13px}
@media(max-width:700px){.site-header nav{display:none}.game-grid{grid-template-columns:1fr}.section-heading{align-items:start;flex-direction:column}.play-topbar{grid-template-columns:1fr 1fr}.play-title-wrap{grid-column:1/-1;grid-row:1;text-align:left}.play-topbar #back-btn{grid-row:2}.play-topbar #restart-btn{grid-row:2}.game-stage{min-height:390px}.tap-wrap,.center-game{height:390px}.number-grid{gap:6px;padding:20px 8px}.number-grid button{min-height:54px}.memory-board{grid-template-columns:repeat(3,72px)}.memory-tile{width:72px;height:72px}}

/* VIEWPORT SAFETY — all games */
html,body{max-width:100%;overflow-x:hidden}canvas,svg,img{max-width:100%}.game-card,.mode-card,.lobby-card,.arcade-shell,.classic-game-panel,.classic-lobby,.wb-workspace,.wb-room,.outbreak-shell,.party-stage{min-width:0}button,input,textarea,select{max-width:100%}.rules-dialog{max-height:88svh;overflow:auto}
@media(max-width:700px){
  .wrap{width:min(100% - 20px,1100px)}
  .header-inner{min-height:54px!important;gap:8px!important}.brand{font-size:14px}
  .hero{padding:34px 0 26px!important}.hero h1{font-size:clamp(34px,12vw,54px)!important;line-height:.96}.hero>p:not(.eyebrow){font-size:15px!important;line-height:1.6}.section{padding:30px 0}.section-heading{gap:10px}.section-heading h2,.info-section h2{font-size:26px}
  .play-section{padding:20px 0 38px}.play-topbar{gap:8px}.play-title-wrap h2{font-size:21px}.ghost-btn,.primary-btn{min-height:44px;padding:10px 12px}.stats{gap:6px;margin:10px 0}.stats>div{padding:8px 5px;border-radius:11px}.stats strong{font-size:20px}.stats span{font-size:9px}
  .game-stage{height:clamp(320px,58svh,470px)!important;min-height:0!important;border-radius:16px}.tap-wrap,.center-game{height:100%!important;min-height:0!important;padding:12px}.start-screen,.end-screen{padding:12px;overflow-y:auto}.start-box h3,.end-box h3{font-size:27px}.start-box p,.end-box p{font-size:14px;line-height:1.5}.big-action{font-size:16px;padding:12px 18px;min-height:46px}
  .target{width:56px;height:56px}.tap-button{width:min(190px,58vw);font-size:28px}.number-grid{width:100%;height:100%;align-content:center;padding:10px 6px!important}.number-grid button{min-height:44px!important;font-size:17px}.prompt{font-size:clamp(30px,12vw,52px)}.choices{gap:7px;margin-top:14px}.choice-btn{min-width:88px;min-height:46px;padding:9px 12px;font-size:16px}.memory-board{grid-template-columns:repeat(3,minmax(0,68px))!important;gap:7px}.memory-tile{width:68px!important;height:68px!important}.reaction-pad{height:min(190px,38svh);font-size:23px}.typing-input{font-size:18px;padding:11px 12px}.higher-number{font-size:76px}
  .arcade-page .hero{padding-bottom:20px!important}.arcade-lobby{padding:12px!important}.arcade-hud{grid-template-columns:repeat(2,minmax(0,1fr))!important}.arcade-hud>div{padding:7px 5px!important}.arcade-hud strong{font-size:17px!important}.arcade-canvas-wrap{aspect-ratio:4/3!important;min-height:0!important;height:auto!important;max-height:62svh}.arcade-controls{padding:8px!important;gap:8px!important}.mobile-pad{gap:6px!important}.mobile-pad button{min-width:44px!important;height:44px!important;padding:0 8px}.mobile-pad .shoot-btn{min-width:76px!important}.arcade-overlay{padding:10px!important;overflow-y:auto}.arcade-overlay-card{padding:16px!important;max-height:92%;overflow:auto}.arcade-overlay-card h2{font-size:26px!important}.arcade-result-score{font-size:40px!important}
  .typing-metrics{grid-template-columns:repeat(3,minmax(0,1fr))!important}.typing-metrics>div{padding:6px 4px!important}.typing-metrics strong{font-size:14px!important}.typing-arena{min-height:0!important;height:auto!important;padding:10px!important}.typing-word-card{padding:16px 10px!important}.typing-japanese{font-size:clamp(22px,8vw,30px)!important}.typing-target{font-size:clamp(24px,9vw,34px)!important;min-height:46px!important}.typing-input-wrap{margin-top:14px!important}#typing-input{font-size:18px!important;padding:12px!important}.typing-controls{padding:8px!important}
  .classic-hero{padding:28px 0 16px!important;gap:12px!important}.classic-hero h1{font-size:clamp(2rem,12vw,3.4rem)!important}.classic-lobby{padding:14px!important}.classic-lobby-card{padding:14px!important}.classic-game-panel{border-radius:18px!important}.classic-scorebar{grid-template-columns:1fr 1fr!important}.classic-scorebar>div{padding:8px 10px!important}.classic-scorebar strong{font-size:.94rem!important}.classic-center-status{grid-column:1/-1!important;grid-row:1!important}.classic-stage{min-height:0!important;padding:10px!important;overflow:visible!important}.table-zone{gap:10px!important}.rival-area,.you-area,.center-area{padding:10px!important;border-radius:15px!important}.hand{min-height:82px!important;padding:5px 2px 10px!important;overscroll-behavior-x:contain}.playing-card{width:54px!important;height:80px!important}.uno-card{width:56px!important;height:84px!important}.pile{min-height:96px!important}.board-wrap{min-height:0!important;padding:4px}.othello-board{width:min(100%,440px)!important;border-width:6px!important}.ttt-board{width:min(100%,400px)!important;gap:6px!important}.ttt-cell{border-radius:14px!important}.classic-controlbar{padding:8px 10px max(10px,env(safe-area-inset-bottom))!important;flex-wrap:wrap}.classic-message{padding:0 10px 12px!important}
  .wb-hero{padding:26px 0 14px!important}.wb-room{padding:14px!important;border-radius:18px!important}.wb-room-grid{gap:9px!important}.wb-room-card{padding:13px!important}.wb-toolbar{padding:8px!important;gap:8px!important;position:relative!important}.wb-tool-group{gap:6px!important;flex-wrap:wrap}.wb-tool-right{width:100%!important;justify-content:flex-start!important}.wb-color{width:30px!important;height:30px!important}.wb-width,.wb-mini,.wb-danger{padding:8px 10px!important}.wb-canvas-wrap{min-height:0!important;height:clamp(320px,56svh,520px)!important}#wb-canvas{width:100%!important;min-width:0!important;height:100%!important;aspect-ratio:auto!important}.wb-message{font-size:13px!important;padding:8px 10px 12px!important}
  .outbreak-hero{padding:22px 16px!important;margin-top:12px!important}.outbreak-panel{margin:16px 0 34px!important}.outbreak-toolbar{gap:8px!important}.outbreak-choice,.difficulty-btn{min-height:44px!important;padding:9px 10px!important}.coop-lobby{gap:8px!important}.coop-card,.coop-status{padding:13px!important}.outbreak-hud{grid-template-columns:repeat(3,minmax(0,1fr))!important}.outbreak-hud>div{padding:7px 8px!important}.outbreak-hud span{font-size:.54rem!important}.outbreak-hud strong{font-size:.78rem!important}.game23-frame{min-height:0!important;height:clamp(300px,54svh,500px)!important;aspect-ratio:auto!important}.boss-banner{top:4%!important;max-width:84%;padding:7px 12px!important}.mission-toast{bottom:20%!important;font-size:.78rem!important}.touch-zone{height:38%!important;bottom:10px!important}.touch-stick{width:66px!important;height:66px!important}.touch-stick:after{width:28px!important;height:28px!important;left:17px!important;top:17px!important}.touch-fire{width:70px!important;height:70px!important;right:4%!important;bottom:6%!important}.mission-strip{grid-template-columns:repeat(5,minmax(112px,1fr))!important;overflow-x:auto;overscroll-behavior-x:contain}.mission-strip>div{padding:9px!important}.mission-strip>div:last-child{grid-column:auto!important}.outbreak-note{padding:10px 12px!important}.game23-overlay{padding:10px!important;overflow-y:auto}.overlay-card{padding:18px!important;max-height:92%;overflow:auto}
  .party-hero{padding:28px 0 16px!important}.party-hud{grid-template-columns:1fr 1fr!important;gap:6px!important}.party-hud>div{padding:8px 10px!important}.party-hud strong{font-size:1.1rem!important}.party-status-row{gap:6px!important;margin:8px 0!important}.party-stage{min-height:0!important;padding:10px!important;overflow:auto!important;border-radius:16px!important}.party-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important}.party-cell{min-height:58px!important;border-radius:12px!important}.party-target{font-size:1.8rem!important}.party-center{min-height:250px!important;padding:4px}.party-center h3{font-size:clamp(1.4rem,7vw,2rem)!important}.party-buttons{gap:7px!important;margin-top:10px!important}.party-choice{min-width:88px!important;min-height:46px!important;padding:10px 12px!important}.party-big-button{padding:18px 22px!important}.party-sequence{gap:6px!important;margin:12px 0!important}.party-seq-token{width:46px!important;height:46px!important;border-radius:12px!important}.party-scoreboard{gap:7px!important;margin:10px auto!important}.party-scoreboard>div{padding:12px!important}.party-path{gap:4px!important;width:100%!important}.party-meter{margin:16px auto!important;height:28px!important}
}
@media(max-width:380px){
  .wrap{width:calc(100% - 14px)}.game-stage{height:clamp(300px,56svh,420px)!important}.memory-board{grid-template-columns:repeat(3,60px)!important}.memory-tile{width:60px!important;height:60px!important}.choice-btn{min-width:78px}.party-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.outbreak-hud{grid-template-columns:repeat(2,minmax(0,1fr))!important}.wb-room-head{align-items:flex-start!important;flex-direction:column}.classic-actions,.party-actions{width:100%}.classic-actions>*{flex:1}.room-created strong,.wb-code-wrap strong{font-size:1.45rem!important;letter-spacing:.12em!important}
}
@media(orientation:landscape) and (max-height:560px){
  .hero{padding:20px 0 14px!important}.site-header{position:relative}.game-stage{height:calc(100svh - 118px)!important;min-height:250px!important}.arcade-canvas-wrap{height:calc(100svh - 112px)!important;max-height:none!important;aspect-ratio:auto!important}.arcade-controls{padding:5px 8px!important}.arcade-help{display:none!important}.typing-arena{min-height:260px!important}.game23-frame{height:calc(100svh - 104px)!important;min-height:240px!important}.outbreak-hud{grid-template-columns:repeat(6,minmax(0,1fr))!important}.outbreak-hud>div{padding:4px 6px!important}.mission-strip>div{padding:6px 8px!important}.party-stage{min-height:260px!important}.classic-stage{padding:6px!important}
}
