/* © 2026 SUKIMA GAMES All rights reserved. 無断転載・再配布禁止 */
:root {
  --ink: #1f2d44;
  --sky: #3f8ff0;
  --sun: #ffd23f;
  --good: #2ec27e;
  --bad: #ff5a5f;
  --paper: rgba(255, 255, 255, .93);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfe6ff; color: var(--ink); font-family: var(--font); -webkit-user-select: none; user-select: none; touch-action: none; overscroll-behavior: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#hurt { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(255, 60, 70, 0) 40%, rgba(255, 40, 60, .9) 100%); }
button { font-family: inherit; cursor: pointer; }

/* ---- プレイ中 ---- */
#playHud { position: fixed; inset: 0; pointer-events: none; display: none; }
body[data-state="play"] #playHud { display: block; }
.hTop { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 14px; right: 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; color: #fff; text-shadow: 0 2px 0 rgba(31, 45, 68, .5); }
.side small { display: block; font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.side.foe { text-align: right; }
.side.foe .hearts { justify-content: flex-end; }
.hearts { display: flex; gap: 5px; }
.hearts i { width: 22px; height: 20px; background: rgba(255, 255, 255, .35); clip-path: path("M11 20 C-6 8 2 -4 11 4 C20 -4 28 8 11 20 Z"); }
.hearts i.on { background: #ff5a7a; }
.center { text-align: center; }
.center b { display: block; font-size: 11px; letter-spacing: .16em; }
.time { font-size: 34px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.time.low { color: #ffd23f; animation: blink .5s infinite alternate; }
@keyframes blink { to { opacity: .45; } }
.cross { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%); border-radius: 50%; border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 1.5px rgba(31, 45, 68, .35); }
.cross::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px rgba(31, 45, 68, .35); }
.cross.hit { border-color: #ff5a7a; transform: translate(-50%, -50%) scale(1.5); transition: transform .1s; }
#shield { position: fixed; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 6px rgba(120, 220, 255, .9), inset 0 0 60px rgba(120, 220, 255, .55); }
.hs { display: flex; gap: 5px; }
.side.foe .hs { justify-content: flex-end; }
.hs.blink { animation: blinkH .15s infinite alternate; }
@keyframes blinkH { to { opacity: .3; } }
.side small em { font-style: normal; font-size: 11px; background: rgba(31, 45, 68, .55); padding: 1px 7px; border-radius: 99px; margin-left: 4px; text-shadow: none; }
.foeMark { position: absolute; display: none; pointer-events: none; }
.foeMark span { display: block; font-size: 12px; font-weight: 900; color: #fff; text-shadow: 0 1px 0 rgba(31, 45, 68, .7), 0 0 4px rgba(31, 45, 68, .6); text-align: center; }
.foeMark i { display: block; margin: 0 auto; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 11px solid #ff5a7a; filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .9)); }
.foeMark.out i { border-top: 0; border-bottom: 26px solid #ff5a7a; border-left-width: 15px; border-right-width: 15px; }
.foeMark.out { animation: pulse .6s infinite alternate; }
@keyframes pulse { to { opacity: .55; } }
.gauge { position: absolute; left: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); color: #fff; text-shadow: 0 2px 0 rgba(31, 45, 68, .5); }
.gLabel { font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.pips { display: flex; gap: 6px; }
.pips i { width: 30px; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--sun) calc(var(--f) * 100%), rgba(255, 255, 255, .3) 0); box-shadow: 0 0 0 2px #fff; }
.pips.flash { animation: buzz .3s; }
.pips.flash i { box-shadow: 0 0 0 2px var(--bad); }
@keyframes buzz { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tapMark { position: absolute; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(31, 45, 68, .3); opacity: 0; pointer-events: none; }
.tapMark.go { animation: tap .4s ease-out; }
@keyframes tap { 0% { opacity: 1; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.3); } }
.banner { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%) scale(.6); opacity: 0; font-weight: 900; color: #fff; text-shadow: 0 4px 0 rgba(31, 45, 68, .5); white-space: nowrap; }
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); transition: transform .25s cubic-bezier(.2, 1.6, .4, 1), opacity .15s; }
.banner.count { font-size: 120px; }
.banner.go { font-size: 76px; color: var(--sun); }
.banner.win { font-size: 84px; color: var(--sun); }
.banner.lose { font-size: 60px; color: #ffb3bb; }
.hint { position: absolute; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 2px 0 rgba(31, 45, 68, .5); text-align: center; }

/* ---- 操作 ---- */
#touch { position: fixed; inset: 0; display: none; }
body[data-state="play"] #touch { display: block; }
#touchLook { position: absolute; inset: 0; }
.tb { position: absolute; border: 0; border-radius: 50%; color: var(--ink); font-weight: 900; background: rgba(255, 255, 255, .85); box-shadow: 0 6px 18px rgba(31, 45, 68, .22), inset 0 -4px 0 rgba(31, 45, 68, .12); touch-action: none; }
.tb.on { transform: scale(.93); background: #fff; }
.tb.fire { right: 22px; bottom: calc(26px + env(safe-area-inset-bottom)); width: 112px; height: 112px; font-size: 24px; background: var(--sun); overflow: hidden; }
.tb.fire span { position: relative; z-index: 1; }
.shotBar { position: absolute; left: 0; right: 0; bottom: 0; height: calc((1 - var(--f, 1)) * 100%); background: rgba(31, 45, 68, .2); }
.tb.pause { right: 14px; top: calc(66px + env(safe-area-inset-top)); width: 42px; height: 42px; font-size: 14px; }
@media (pointer: fine) { .tb.fire { width: 96px; height: 96px; font-size: 20px; } }
body.portrait .tb.fire { bottom: calc(40px + env(safe-area-inset-bottom)); }
body.portrait .gauge { bottom: calc(60px + env(safe-area-inset-bottom)); }
body.portrait .hint { bottom: calc(160px + env(safe-area-inset-bottom)); width: 90vw; }

/* ---- 画面 ---- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; touch-action: pan-y; }
#titleScreen { background: linear-gradient(180deg, rgba(63, 143, 240, .12), rgba(255, 255, 255, .2)); justify-content: flex-start; }
.mast { width: 100%; max-width: 980px; display: flex; justify-content: space-between; align-items: center; padding: env(safe-area-inset-top) 4px 0; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 1px 0 rgba(31, 45, 68, .4); }
.mast a { color: #fff; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: 6px; letter-spacing: .14em; font-size: 11px; }
.crown { width: 14px; height: 10px; background: var(--sun); clip-path: polygon(0 100%, 0 20%, 25% 60%, 50% 0, 75% 60%, 100% 20%, 100% 100%); }
.tCard { margin: auto 0; width: min(440px, 100%); background: var(--paper); border-radius: 24px; padding: 26px 24px 20px; box-shadow: 0 20px 60px rgba(31, 45, 68, .22); backdrop-filter: blur(6px); }
.kicker { display: inline-block; font-weight: 900; font-size: 13px; color: #fff; background: var(--ink); padding: 4px 10px; border-radius: 6px; transform: rotate(-2deg); }
.logo { margin: 12px 0 8px; font-size: 54px; line-height: .98; font-weight: 900; letter-spacing: -.02em; color: var(--sky); text-shadow: 3px 3px 0 var(--sun); }
.lead { margin: 0 0 16px; font-size: 14px; line-height: 1.7; font-weight: 600; }
.btn { border: 0; border-radius: 14px; padding: 13px; font-size: 16px; font-weight: 800; background: #e7eef8; color: var(--ink); width: 100%; }
.btn.go { background: var(--sky); color: #fff; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .15); }
.btn.big { font-size: 22px; padding: 16px; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px #d5deea; }
.btn.x { background: #111; color: #fff; }
.bestLine { margin-top: 10px; text-align: center; font-weight: 800; font-size: 13px; color: var(--sky); }
.how { margin-top: 12px; font-size: 13px; }
.how summary { cursor: pointer; font-weight: 800; color: var(--sky); }
.how dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0; }
.how dt { font-weight: 800; }
.how dd { margin: 0; }
.tips { margin: 6px 0; padding-left: 18px; line-height: 1.6; }
.opts { display: grid; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 700; }
.opts label { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.opts input[type="range"] { flex: 1; max-width: 180px; }
.tFoot { font-size: 11px; color: #fff; text-shadow: 0 1px 0 rgba(31, 45, 68, .5); text-align: center; padding: 10px 0 env(safe-area-inset-bottom); }
.tFoot a { color: #fff; }
.panel { width: min(400px, 100%); background: var(--paper); border-radius: 22px; padding: 22px; box-shadow: 0 20px 60px rgba(31, 45, 68, .25); display: grid; gap: 10px; text-align: center; }
.panel h2 { margin: 0; font-size: 26px; font-weight: 900; }
#pauseScreen, #resultScreen { background: rgba(31, 45, 68, .35); }
.rKind { font-size: 44px; font-weight: 900; letter-spacing: .04em; }
.rKind.win { color: var(--good); }
.rKind.lose { color: var(--bad); }
.rKind.draw { color: var(--sky); }
.rNew { justify-self: center; background: var(--sun); padding: 3px 12px; border-radius: 99px; font-weight: 900; font-size: 13px; transform: rotate(-3deg); }
.rStreak { font-size: 28px !important; color: var(--sky); text-shadow: 2px 2px 0 var(--sun); }
.rRank b { font-size: 20px; }
.rStats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 4px 0; text-align: left; background: #f1f5fb; padding: 12px 16px; border-radius: 14px; }
.rStats dt { font-size: 12px; font-weight: 700; opacity: .7; align-self: center; }
.rStats dd { margin: 0; font-weight: 900; text-align: right; }
.shareMsg { margin: 0; font-size: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-height: 560px) {
  .tCard { padding: 14px 18px; }
  .logo { font-size: 36px; margin: 6px 0 4px; }
  .logo br { display: none; }
  .lead { margin-bottom: 8px; font-size: 12px; }
  .btn.big { font-size: 18px; padding: 11px; }
  .banner.count { font-size: 80px; }
  .tb.fire { width: 92px; height: 92px; bottom: calc(18px + env(safe-area-inset-bottom)); }
  .panel { padding: 12px; gap: 6px; }
  .rKind { font-size: 32px; }
}
.opts label:has(input[type="checkbox"]) { justify-content: flex-start; }
#replay{position:fixed;inset:0;pointer-events:none;display:none;z-index:6;border:0 solid #f6d84a;background:repeating-linear-gradient(0deg,#ffffff0a 0 2px,transparent 2px 5px)}
#replay.on{display:block;border-width:clamp(5px,1vw,10px)}
#replay.slow{border-color:#52e0ff}
#rLabel{position:absolute;left:16px;top:16px;background:#141c20e6;color:#f6d84a;font-weight:900;font-size:clamp(15px,2.6vw,24px);letter-spacing:.08em;padding:4px 12px;animation:rBlink .5s steps(2) infinite}
#replay.slow #rLabel{color:#52e0ff}
@keyframes rBlink{50%{opacity:.55}}
#hitPop{position:absolute;left:50%;top:32%;transform:translate(-50%,-50%);font-weight:900;font-size:clamp(30px,7vw,64px);color:#ffe14d;-webkit-text-stroke:2px #141c20;opacity:0;pointer-events:none;white-space:nowrap}
#hitPop.wk{color:#52e0ff;top:66%;font-size:clamp(24px,5vw,44px)}
#hitPop.on{animation:hitIn .6s cubic-bezier(.2,1.8,.4,1) both}
@keyframes hitIn{0%{opacity:0;transform:translate(-50%,-50%) scale(1.9)}18%{opacity:1;transform:translate(-50%,-50%) scale(1)}75%{opacity:1}100%{opacity:0;transform:translate(-50%,-60%)}}
#streakTag{position:absolute;left:50%;top:64px;transform:translateX(-50%);font-weight:900;font-size:clamp(14px,2.4vw,20px);color:#fff;background:#141c20cc;padding:2px 12px;border-radius:3px;pointer-events:none}
#streakTag[hidden]{display:none}
body.fever #streakTag{background:#d23a30;animation:rBlink .4s steps(2) infinite}
body.fever #cross{filter:drop-shadow(0 0 6px #ff5a3c)}
#onlineScreen{display:grid;place-items:center;padding:16px}
#onlineScreen[hidden]{display:none}
#onlineScreen .panel{width:min(430px,100%);display:grid;gap:10px}
#onlineScreen .btn{width:100%}
#btnOnline{margin-top:8px}
.onMsg{margin:0;font-size:13px;line-height:1.6}
.roomCode{font-size:44px;font-weight:900;letter-spacing:.18em;text-align:center;color:#2f6fd8;user-select:all}
.roomInput{display:grid;gap:4px;font-size:13px;font-weight:700;text-align:left}
.roomInput input{width:100%;min-height:44px;padding:8px 12px;border:1px solid #c8d2dc;border-radius:5px;font-size:20px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;box-sizing:border-box}
body.hosting .roomInput,body.hosting #btnJoin,body.hosting #btnHost{display:none}
#ejFade{position:fixed;inset:0;background:#000;opacity:0;pointer-events:none;z-index:7}
#ejText{position:fixed;left:50%;bottom:16%;transform:translateX(-50%);z-index:8;color:#fff;font-weight:900;font-size:clamp(20px,4vw,34px);text-shadow:0 2px 10px #000;opacity:0;pointer-events:none;white-space:nowrap}
#ejText.on{opacity:1;transition:opacity .4s}
#mapName{position:absolute;left:50%;top:22%;transform:translateX(-50%);font-weight:900;font-size:clamp(20px,4vw,34px);color:#fff;background:#141c20d0;padding:4px 16px;border-left:5px solid #52e0ff;opacity:0;pointer-events:none;white-space:nowrap}
#mapName.on{animation:mapIn 2.6s ease-out both}
@keyframes mapIn{0%{opacity:0;transform:translate(-50%,10px)}12%{opacity:1;transform:translate(-50%,0)}80%{opacity:1}100%{opacity:0}}
#sensBox{position:absolute;right:calc(70px + env(safe-area-inset-right));top:calc(10px + env(safe-area-inset-top));display:flex;align-items:center;gap:4px;background:#141c20cc;color:#fff;padding:3px 6px;border-radius:5px;pointer-events:auto;z-index:2}
#sensBox small{font-size:11px;font-weight:700}
#sensBox b{min-width:26px;text-align:center;font-size:14px;font-variant-numeric:tabular-nums}
#sensBox button{width:32px;height:32px;border:0;border-radius:4px;background:#ffffff26;color:#fff;font-size:18px;font-weight:900;touch-action:none}
