:root { color-scheme:light; --ink:#183f43; --paper:#f5f3e8; --lime:#dfef94; --muted:#59716d; --line:#d3dbcb; --toolbar-height:76px; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; background:var(--paper); color:var(--ink); font-family:system-ui,-apple-system,"Hiragino Sans","Yu Gothic",sans-serif; }
button,a { -webkit-tap-highlight-color:transparent; }
button,input,select { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:default; opacity:0.62; }
button:focus-visible,a:focus-visible,input:focus-visible { outline:3px solid #cd7440; outline-offset:4px; }
a { color:inherit; }
.page { max-width:1400px; margin:auto; padding:28px 44px 24px; }
.masthead { display:flex; align-items:center; justify-content:space-between; gap:20px; padding-bottom:18px; }
.brand { font-size:21px; font-weight:850; letter-spacing:-0.8px; display:flex; align-items:center; gap:10px; text-decoration:none; white-space:nowrap; }
.ball { flex-shrink:0; display:inline-block; width:26px; height:26px; border-radius:50%; background:var(--lime); border:1px solid var(--ink); position:relative; overflow:hidden; }
.ball::after { content:""; position:absolute; width:26px; height:22px; border:2px solid var(--ink); border-radius:50%; transform:rotate(-40deg); top:8px; left:3px; }
.tag { border:1px solid #cad2be; border-radius:30px; padding:7px 12px; font-size:11px; letter-spacing:0.6px; }
.hero { display:grid; grid-template-columns:1.05fr 1.1fr; gap:44px; align-items:center; padding:30px 0 40px; }
.eyebrow { font-size:11px; font-weight:750; letter-spacing:2px; color:var(--muted); margin:0; }
h1 { font-size:clamp(40px,4.6vw,64px); line-height:1.25; letter-spacing:-2px; margin:20px 0; }
.intro { font-size:14px; line-height:1.9; color:var(--muted); margin:0 0 26px; }
.mode-label { font-size:13px; font-weight:700; margin-bottom:12px; display:flex; align-items:center; gap:9px; }
.small-number { display:inline-grid; place-items:center; min-width:25px; height:25px; background:var(--ink); color:var(--paper); border-radius:50%; font-size:10px; letter-spacing:0; }
.play-modes { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.mode-card { border:1px solid var(--ink); color:var(--ink); text-align:left; border-radius:16px; padding:20px; min-height:148px; display:flex; flex-direction:column; gap:7px; transition:transform 0.18s,box-shadow 0.18s; }
.mode-card:hover { transform:translateY(-3px); box-shadow:0 8px 0 #183f4312; }
.mode-online { background:var(--lime); box-shadow:0 4px 0 var(--ink); border-width:2px; }
.mode-cpu { background:#fffdf6; border-color:#becbbb; }
.mode-top { display:flex; justify-content:space-between; align-items:center; width:100%; margin-bottom:7px; }
.mode-tag { font-size:11px; font-weight:700; }
.mode-arrow { font-size:23px; line-height:1; }
.mode-card strong { font-size:clamp(17px,1.6vw,23px); letter-spacing:-0.6px; white-space:nowrap; }
.mode-description { font-size:11px; line-height:1.7; color:#416058; }
.small { font-size:11px; color:var(--muted); line-height:1.8; }
.availability { margin-top:18px; }
.scene { margin:0; position:relative; border-radius:24px; overflow:hidden; background:#d2dcc4; box-shadow:0 18px 38px #183f4312; }
.scene img { display:block; width:100%; height:auto; aspect-ratio:1.15; object-fit:cover; }
.scene-badge { position:absolute; top:18px; right:18px; background:var(--paper); border-radius:30px; padding:9px 13px; display:flex; align-items:center; gap:7px; font-size:11px; box-shadow:0 3px 14px #183f4322; }
.live-dot { display:inline-block; width:8px; height:8px; background:#528e65; border-radius:50%; flex-shrink:0; }
.scene figcaption { background:var(--ink); color:var(--paper); padding:19px 22px; display:flex; flex-direction:column; gap:7px; font-size:13px; }
.scene figcaption span { color:var(--lime); font-size:9px; letter-spacing:1.7px; }
.guide { border-top:1px solid var(--line); padding-top:25px; }
.guide-title { display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-bottom:24px; }
h2 { font-size:18px; margin:0; }
.steps { display:grid; grid-template-columns:repeat(3,1fr); gap:26px; }
.step { display:flex; gap:14px; }
.step-number { width:35px; height:35px; display:grid; place-items:center; border:1px solid #c2d0b8; border-radius:50%; color:#688269; font-size:12px; flex-shrink:0; }
.step strong { font-size:13px; }
.step p { font-size:12px; line-height:1.9; color:var(--muted); margin:7px 0; }
kbd { font-family:inherit; font-size:0.9em; font-weight:600; background:#e7eadc; border:1px solid #cbd4c3; border-bottom-width:2px; padding:1px 5px; border-radius:4px; white-space:nowrap; }
footer { margin-top:26px; border-top:1px solid var(--line); padding-top:17px; display:flex; justify-content:space-between; gap:20px; }
#status { margin:16px 0 0; font-size:13px; line-height:1.8; }
progress { display:block; width:100%; height:7px; accent-color:var(--ink); margin-top:14px; }
#retry { margin-top:10px; }
#game { position:fixed; inset:0; z-index:5; background:#101e20; display:flex; flex-direction:column; }
.toolbar { position:relative; flex:0 0 var(--toolbar-height); color:var(--paper); padding:0 24px; display:flex; align-items:center; gap:24px; border-bottom:1px solid #304b48; }
.game-brand .brand { font-size:16px; }
.game-brand .ball { width:23px; height:23px; }
.game-brand-detail { font-size:8px; letter-spacing:2px; color:#9bb4a4; display:block; margin:5px 0 0 33px; }
.session-summary { font-size:12px; color:#bfcec1; margin-right:auto; line-height:1.6; }
.session-ping { position:absolute; bottom:10px; left:57px; color:var(--lime); font-size:11px; line-height:14px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.toolbar:has(.session-ping:not([hidden])) .game-brand-detail { visibility:hidden; }
.toolbar-actions { display:flex; align-items:center; gap:12px; }
.online-entry { display:flex; align-items:center; justify-content:center; gap:13px; min-height:48px; min-width:280px; border:0; border-radius:11px; padding:12px 18px; background:var(--lime); color:var(--ink); font-size:15px; font-weight:800; box-shadow:0 3px 0 #8ea85b; }
.online-entry:hover { background:#ecf9b4; }
.people-icon { display:flex; } .people-icon svg { width:24px; height:24px; }
.fullscreen-button { border:1px solid #637a70; color:#dae5d4; background:transparent; border-radius:9px; min-height:44px; padding:9px 12px; font-size:11px; }
.viewport { flex:1; min-height:0; display:grid; place-items:center; }
#canvas { display:block; border:0; outline:none; width:min(100vw,calc((100dvh - var(--toolbar-height) - var(--autoplay-notice-height,0px)) * 1.6)); height:auto; aspect-ratio:1.6; background:#183f43; touch-action:none; }
body.playing { overflow:hidden; }
/* タッチ操作中の文字選択と長押しメニューを抑止する。 */
body.touch-mode, body.touch-mode *, #game, #game *, #online-dialog, #online-dialog *, #touch-selection, #touch-selection * { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
#online-dialog { position:fixed; inset:0; z-index:20; background:#101e20c4; backdrop-filter:blur(7px); display:grid; place-items:center; padding:24px; }
.online-panel { width:min(900px,100%); max-height:94dvh; overflow:auto; background:var(--paper); padding:32px 36px 22px; border-radius:24px; box-shadow:0 20px 70px #00000055; }
.online-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.online-heading h2 { font-size:30px; letter-spacing:-1px; margin-top:9px; }
.room-intro { color:var(--muted); font-size:13px; margin:12px 0 28px; }
.room-layout { display:grid; grid-template-columns:1.1fr 1fr; gap:32px; }
h3 { margin:0 0 17px; font-size:15px; display:flex; align-items:center; gap:9px; }
.character-area { border-right:1px solid var(--line); padding-right:28px; }
.online-roster { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.character-card { min-width:0; position:relative; border:1px solid #cad5c1; border-radius:13px; color:var(--ink); background:#e9edde; padding:0 8px 12px; display:flex; flex-direction:column; align-items:center; overflow:hidden; min-height:154px; }
.character-card img { width:105px; height:103px; object-fit:cover; object-position:top; }
.character-card strong { font-size:13px; margin:4px 0; overflow-wrap:anywhere; }
.character-card small { font-size:10px; color:var(--muted); }
.character-card[aria-pressed="true"] { border:2px solid var(--ink); background:#eff4da; box-shadow:0 3px 0 var(--ink); padding-top:0; }
.character-card[aria-pressed="true"]::after { content:"✓"; position:absolute; top:7px; right:8px; width:20px; height:20px; border-radius:50%; background:var(--ink); color:var(--lime); font-size:12px; display:grid; place-items:center; }
.character-selection { display:flex; align-items:center; gap:5px; font-size:12px; margin:20px 0 8px; }
.character-selection .live-dot { margin-right:3px; }
.character-note { margin:0; }
.room-tabs { display:grid; grid-template-columns:1fr 1fr; padding:4px; background:#e3e9da; border-radius:11px; gap:4px; }
.room-tabs button { border:0; background:transparent; color:var(--muted); font-size:12px; min-height:44px; border-radius:8px; }
.room-tabs button[aria-selected="true"] { color:var(--ink); font-weight:750; background:#fffef6; box-shadow:0 2px 4px #183f4312; }
.room-option { padding-top:20px; }
.room-option p { margin:0 0 18px; font-size:13px; line-height:1.9; color:var(--muted); }
.primary { display:flex; align-items:center; justify-content:space-between; width:100%; gap:15px; min-height:54px; padding:14px 19px; border:1px solid var(--ink); border-radius:11px; background:var(--ink); color:var(--lime); font-size:15px; font-weight:750; }
.primary:hover { background:#24575b; }
.secondary { border:1px solid #bccbb5; border-radius:9px; padding:11px 15px; color:var(--ink); background:transparent; min-height:44px; font-size:12px; }
.secondary:hover { background:#e6ecd7; }
.close-button { white-space:nowrap; }
.room-option label { display:block; font-size:11px; color:var(--muted); margin-bottom:9px; }
#room-code { width:100%; padding:12px 16px; font-size:25px; letter-spacing:7px; text-transform:uppercase; color:var(--ink); border:1px solid #9baf95; border-radius:9px; background:#fffef8; margin-bottom:16px; }
#online-dialog #room-code { -webkit-user-select:text; user-select:text; -webkit-touch-callout:default; }
#room-code::placeholder { color:#9cae99; }
.room-invite { border:1px dashed #9eaf8b; background:#eef1de; border-radius:14px; padding:18px; text-align:center; }
.room-invite output { display:block; font-size:34px; letter-spacing:7px; font-weight:800; line-height:1.5; margin:8px 0 12px; }
.room-invite .secondary { background:#fffdf5; width:100%; }
.room-members { margin-top:17px; border:1px solid var(--line); border-radius:11px; padding:10px 12px; display:flex; gap:9px; align-items:center; min-height:77px; }
.room-members img { object-fit:cover; object-position:top; border-radius:8px; background:#e8ecd9; }
.room-members div { flex:1; }
.room-members strong { display:block; font-size:12px; }
.room-members div span { display:block; font-size:10px; line-height:1.5; color:var(--muted); margin-top:5px; }
.ready-badge { font-size:10px; color:#2c6645; border:1px solid #adcaa5; background:#e6f1dd; border-radius:30px; padding:5px 8px; white-space:nowrap; }
.room-status { margin:16px 0; font-size:12px; color:var(--muted); line-height:1.8; min-height:42px; }
.online-panel[data-state="error"] .room-status { color:#9a3e26; background:#f4e5d8; border-radius:9px; padding:10px 13px; }
.start-match { background:var(--lime); color:var(--ink); box-shadow:0 3px 0 var(--ink); font-size:17px; min-height:60px; }
.start-match:hover { background:#eaf6af; }
.leave-button { width:100%; margin-top:15px; min-height:36px; border:0; background:transparent; text-decoration:underline; text-underline-offset:4px; color:var(--muted); font-size:11px; }
.room-footer { border-top:1px solid var(--line); margin-top:26px; padding-top:16px; display:flex; align-items:center; justify-content:space-between; gap:18px; }
.room-footer > span { font-size:11px; font-weight:700; white-space:nowrap; }
.room-footer p { color:var(--muted); font-size:10px; line-height:1.8; margin:0; }
@media (max-width:1050px) {
  .hero { gap:26px; } .page { padding:24px 28px; } .mode-card { padding:16px; } .mode-description { font-size:10px; }
  .toolbar { gap:18px; padding:0 18px; } .online-entry { min-width:240px; font-size:14px; } .online-panel { padding:28px; }
  .session-ping { left:51px; }
}
@media (max-width:760px) {
  :root { --toolbar-height:72px; }
  .page { padding:22px; } .masthead { gap:12px; padding-bottom:12px; } .tag { font-size:9px; }
  .hero { grid-template-columns:1fr; gap:26px; padding:20px 0 28px; } h1 { font-size:46px; }
  .play-modes { gap:10px; } .mode-card { min-height:140px; } .mode-card strong { font-size:17px; }
  .scene img { aspect-ratio:1.75; } .steps { grid-template-columns:1fr; gap:12px; }
  .guide-title,footer { align-items:flex-start; flex-direction:column; gap:7px; }
  .toolbar { gap:10px; padding:0 12px; } .game-brand .brand { font-size:12px; gap:6px; } .game-brand .ball { width:18px; height:18px; }
  .session-ping { left:36px; bottom:9px; font-size:10px; }
  .game-brand-detail,.session-summary,.people-icon { display:none; } .toolbar-actions { margin-left:auto; gap:7px; }
  .online-entry { min-width:0; min-height:46px; padding:11px; font-size:12px; gap:8px; } .fullscreen-button { padding:9px; font-size:10px; }
  #online-dialog { padding:14px; } .online-panel { border-radius:18px; padding:23px; } .online-heading h2 { font-size:24px; }
  .room-layout { grid-template-columns:1fr; gap:24px; } .character-area { border:0; padding:0; }
  .online-roster { grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; } .character-card { min-height:125px; padding:0 4px 9px; }
  .character-card img { width:70px; height:78px; } .character-card strong { font-size:12px; } .character-card small { font-size:8px; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .character-note { display:none; } .character-selection { margin:16px 0 0; }
  .room-intro { font-size:12px; margin-bottom:22px; } .room-footer { flex-direction:column; align-items:flex-start; gap:9px; }
}
@media (max-width:420px) { .mode-card { padding:14px; } .mode-card strong { font-size:15px; } .mode-description { font-size:9px; } .toolbar { gap:7px; padding:0 9px; } .online-entry { font-size:11px; padding:11px 9px; gap:6px; } .fullscreen-button { padding:8px; } }
@media (prefers-reduced-motion:reduce) { .mode-card { transition:none; } }
/* スマホの操作は空き領域に置き、複数指のジェスチャーをページへ伝えない。 */
#touch-controls { position:absolute; inset:0; pointer-events:none; z-index:7; user-select:none; -webkit-user-select:none; }
.mobile-guide,.touch-mode .pc-guide { display:none; } .touch-mode .mobile-guide { display:block; }
#touch-stick { position:absolute; bottom:max(20px,env(safe-area-inset-bottom)); left:max(12px,env(safe-area-inset-left)); width:168px; height:152px; border-radius:28px; background:#10282765; border:1px solid #e1f59a40; pointer-events:auto; touch-action:none; color:#e1eedb; }
#stick-base { position:absolute; width:100px; height:100px; left:50%; top:48%; margin:-50px; border-radius:50%; border:2px solid #d8ebaa65; background:#8da97635; box-shadow:inset 0 2px 15px #10282755; }
#stick-knob { width:58px; height:58px; margin:19px; border-radius:50%; background:radial-gradient(circle at 35% 30%,#f4ffd1,#aecb76); border:2px solid #f3ffc7; box-shadow:0 5px 0 #617847,0 6px 16px #00000044; transition:transform 0.12s ease-out; }
#touch-stick.pressed #stick-knob { transition:none; }
.stick-guide { position:absolute; top:10px; left:0; width:100%; text-align:center; font-size:10px; }
.stick-caption { position:absolute; bottom:8px; width:100%; text-align:center; font-size:11px; font-weight:700; }
.touch-actions { position:absolute; bottom:max(20px,env(safe-area-inset-bottom)); right:max(12px,env(safe-area-inset-right)); width:184px; display:grid; grid-template-columns:1fr 1fr; gap:9px; pointer-events:auto; }
.touch-actions button { min-height:54px; border:1px solid #e6f0c365; border-radius:18px; background:#183f43e8; color:#fff7df; font-weight:750; font-size:12px; box-shadow:0 4px 0 #071718; touch-action:none; user-select:none; -webkit-user-select:none; }
.touch-actions button.pressed { transform:translateY(3px); box-shadow:0 1px 0 #071718; background:#527963; }
.touch-actions button[aria-disabled="true"] { opacity:0.4; }
#touch-shot { background:var(--lime); color:var(--ink); position:relative; overflow:hidden; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:4px; min-height:78px; }
#touch-shot strong { font-size:15px; white-space:nowrap; } #touch-shot span { font-size:9px; } #touch-charge-bar { position:absolute; height:5px; width:var(--charge,0%); background:#609451; left:0; bottom:0; transition:width 0.06s linear; }
#touch-shot.pressed { background:#f0ffb3; }
#touch-dash { align-self:end; min-height:54px; }
.touch-tip { position:absolute; bottom:0; left:50%; transform:translateX(-50%); margin:0; padding:3px 8px; font-size:10px; white-space:nowrap; color:#dae8d1; border-radius:6px; background:#102827b0; }
#touch-controls.blocked .touch-actions,#touch-controls.blocked #touch-stick { opacity:0.3; }
.touch-mode { --toolbar-height:52px; } .touch-mode .toolbar { padding:0 max(9px,env(safe-area-inset-right)) 0 max(9px,env(safe-area-inset-left)); gap:8px; }
.touch-mode .game-brand-detail,.touch-mode .session-summary,.touch-mode .people-icon { display:none; }
.touch-mode .game-brand .brand { font-size:12px; } .touch-mode .game-brand .ball { width:18px;height:18px; }
.touch-mode .session-ping { left:max(33px,env(safe-area-inset-left)); bottom:2px; font-size:10px; }
.touch-mode .toolbar-actions { margin-left:auto;gap:6px; } .touch-mode .online-entry { min-width:0;min-height:40px;padding:8px 10px;font-size:11px;gap:6px; }
.touch-mode .fullscreen-button { min-height:40px;padding:7px 9px;font-size:10px; }
.touch-mode #fullscreen { display:none; }
#touch-selection { position:fixed;inset:0;z-index:19;background:#102827db;display:grid;place-items:center;padding:14px; }
.touch-selection-panel { width:min(550px,100%);max-height:94dvh;overflow:auto;background:var(--paper);border-radius:20px;padding:22px; }
.touch-selection-panel > p { font-size:12px;color:var(--muted); } .touch-selection-panel h3 { margin:15px 0 9px; }
.touch-roster { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px; }
.touch-roster button { min-width:0;border:1px solid #bdcdb0;border-radius:12px;background:#e8efdd;color:var(--ink);padding:0 3px 8px;display:flex;flex-direction:column;align-items:center;font-size:12px;font-weight:700;min-height:90px; }
.touch-roster button img { width:70px;height:64px;object-fit:cover;object-position:top;max-width:100%; }
.touch-roster button[aria-pressed="true"] { border:2px solid var(--ink);background:var(--lime);box-shadow:0 2px 0 var(--ink); }
#touch-match-start { margin-top:18px;min-height:52px; } .touch-selection-options { display:flex;justify-content:space-between;gap:8px;margin-top:12px; }
#touch-score { color:var(--lime);font-size:13px;font-weight:750;white-space:nowrap;margin-right:auto; }
@media (orientation:portrait) { .touch-mode { --toolbar-height:78px; } .touch-mode .toolbar { position:relative;align-items:flex-start;padding-top:6px; } .touch-mode .touch-tip { bottom:185px; } .touch-mode #touch-score { position:absolute;bottom:6px;left:0;right:0;text-align:center; } }
@media (max-height:500px) { #touch-stick { width:140px;height:132px;bottom:max(15px,env(safe-area-inset-bottom)); } .touch-actions { width:164px;gap:7px;bottom:max(15px,env(safe-area-inset-bottom)); } .touch-actions button { min-height:48px; } #touch-shot { min-height:65px; } #touch-dash { min-height:48px; } .touch-selection-panel { padding:15px 20px; } .touch-roster { gap:7px; } .touch-roster button { min-height:69px; } .touch-roster button img { height:43px;width:52px; } .touch-selection-panel h3 { margin:8px 0 5px; } .touch-selection-panel > p { margin:6px 0; } #touch-match-start { margin-top:10px; } }
@media (max-width:420px) { #touch-stick { width:145px;height:145px; } .touch-actions { width:164px; } .touch-mode .game-brand { display:none; } .touch-mode .toolbar-actions { width:100%;justify-content:space-between; } }

/* パッドで移動したフォーカスを、マウス操作後も見えるようにする。 */
.gamepad-mode button:focus,.gamepad-mode input:focus { outline:3px solid #cd7440; outline-offset:4px; }

.gamepad-code-guide { display:none; } .gamepad-mode .gamepad-code-guide { display:block; }

.online-roster, .touch-roster { perspective:600.0px; }

.autoplay-notice { flex-shrink:0; margin:0; padding:10px 24px; background:var(--lime); color:var(--ink); font-size:13px; text-align:center; }
@media (orientation:portrait) { .touch-mode:has(.session-ping:not([hidden])) { --toolbar-height:110px; } .touch-mode .session-ping { bottom:26px; left:max(9px,env(safe-area-inset-left)); } }

#touch-difficulty button { flex:1;min-width:0;padding-inline:0;white-space:nowrap; }
#touch-difficulty button[aria-pressed="true"] { background:var(--ink);color:var(--paper); }
