﻿:root {
  color-scheme: light;
  --ink: #253044;
  --muted: #68758b;
  --line: #dbe5ed;
  --accent: #1c92a9;
  --accent-dark: #126b7d;
  --glow: #40e6ff;
  --paper: #fff;
  --back: #eef7f8;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, #dff4f6 0, transparent 34rem), linear-gradient(145deg, #f8fbfc, var(--back));
}
.app { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 20px; }
.app__header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 14px; }
.app__eyebrow { margin: 0 0 4px; color: var(--accent-dark); font-size: .82rem; font-weight: 700; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(1.35rem, 3vw, 2rem); }
.status { display: flex; gap: 8px; margin: 0; }
.status__item { min-width: 92px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.88); text-align: center; box-shadow: 0 5px 18px rgba(41,83,94,.06); }
.status dt { color: var(--muted); font-size: .75rem; font-weight: 700; }
.status dd { margin: 2px 0 0; color: var(--accent-dark); font-size: 1.55rem; font-weight: 800; line-height: 1; }
.status small { margin-left: 2px; font-size: .72rem; }
.play-area {
  position: relative;
  height: clamp(300px, 45vh, 440px);
  overflow: hidden;
  border: 3px solid #b9dbe0;
  border-radius: 22px;
  background: linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.92)), repeating-linear-gradient(90deg, transparent 0 79px, #d9eef0 80px);
  box-shadow: 0 18px 45px rgba(37,76,88,.12);
}
.keys { position: absolute; z-index: 2; top: 14px; left: 18px; margin: 0; color: var(--muted); font-size: clamp(.75rem,2vw,.92rem); font-weight: 700; letter-spacing: .08em; }
.falling-key { position: absolute; z-index: 4; top: 0; left: 0; width: 1.25em; color: var(--accent-dark); font-family: Arial,sans-serif; font-size: clamp(4rem,10vw,6.5rem); font-weight: 900; line-height: 1; text-align: center; text-shadow: 0 5px 0 #d4edf0; will-change: transform, opacity; }
.falling-key.is-hit { animation: target-hit .18s ease-out forwards; }
.effect-layer { position: absolute; z-index: 5; inset: 0; pointer-events: none; overflow: hidden; }
.laser { position: fixed; z-index: 20; height: 7px; border: 1px solid #159eb8; border-radius: 999px; background: var(--glow); box-shadow: 0 0 4px #159eb8, 0 0 10px var(--glow), 0 0 22px var(--glow), 0 0 34px var(--accent); transform-origin: 0 50%; pointer-events: none; animation: laser-shot .2s ease-out forwards; }
.spark { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px var(--glow); animation: spark-burst .28s ease-out forwards; }
.panel { position: absolute; z-index: 6; top: 50%; left: 50%; width: min(560px,calc(100% - 32px)); padding: clamp(24px,5vw,42px); border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.94); text-align: center; box-shadow: 0 20px 50px rgba(37,76,88,.15); transform: translate(-50%,-50%); }
.panel__label,.panel__sub { margin: 0; color: var(--muted); }
.panel__main { margin: 16px 0; font-size: clamp(1.15rem,3vw,1.6rem); font-weight: 800; }
kbd { display: inline-block; padding: .28em .65em; border: 1px solid #9eb8bf; border-bottom-width: 4px; border-radius: 8px; color: var(--accent-dark); background: #f8ffff; font: inherit; }
.countdown { position: absolute; z-index: 7; inset: 0; display: grid; place-items: center; color: var(--accent-dark); background: rgba(255,255,255,.84); font: 900 clamp(6rem,22vw,13rem)/1 Arial,sans-serif; text-shadow: 0 8px 0 #d4edf0; }
.result h2 { margin: 8px 0 20px; font-size: 1.8rem; }
.result__scores { display: flex; justify-content: center; gap: 12px; margin-bottom: 24px; }
.result__scores p { min-width: 130px; margin: 0; padding: 14px; border-radius: 12px; color: var(--muted); background: #edf8f9; font-size: .82rem; font-weight: 700; }
.result__scores strong { display: block; margin-top: 4px; color: var(--accent-dark); font-size: 2.2rem; }
.guide { margin-top: 12px; padding: 12px 14px 9px; border: 1px solid #cfe2e6; border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: 0 10px 30px rgba(37,76,88,.08); }
.guide__title { margin: 0 0 9px; color: var(--muted); font-size: .78rem; font-weight: 700; text-align: center; }
.screen-keyboard { display: grid; grid-template-columns: repeat(10,minmax(44px,1fr)); gap: 7px; max-width: 800px; margin: 0 auto; }
.keycap { position: relative; min-height: 54px; border: 1px solid #a9c0c6; border-bottom: 5px solid #819ba2; border-radius: 9px; color: #33475b; background: linear-gradient(#fff,#eaf1f3); font: 800 clamp(1rem,2.2vw,1.35rem)/1 Arial,sans-serif; box-shadow: 0 3px 6px rgba(37,76,88,.12); transition: color .08s, background .08s, box-shadow .08s, transform .08s; }
.keycap[data-bump="true"]::after { content: ""; position: absolute; left: 33%; right: 33%; bottom: 7px; height: 3px; border-radius: 2px; background: #718c94; box-shadow: 0 1px 0 #fff; }
.keycap.is-target { color: #073e4b; background: #bdf8ff; box-shadow: 0 0 0 2px #5edbec, 0 0 18px rgba(64,230,255,.85); }
.keycap.is-correct { color: #fff; background: #23cde6; transform: translateY(2px) scale(.98); box-shadow: 0 0 0 3px #fff, 0 0 30px var(--glow); }
.keycap.is-wrong { color: #fff; background: #ef5360; border-color: #b32635; box-shadow: 0 0 18px rgba(239,50,67,.85); animation: wrong-shake .24s linear; }
.hands { display: flex; justify-content: center; gap: clamp(34px,11vw,130px); margin: 10px auto 0; }
.hand { display: flex; align-items: flex-end; gap: 4px; padding: 5px 13px 0; border-bottom: 7px solid #b8c9ce; border-radius: 0 0 24px 24px; }
.finger { display: grid; place-items: start center; width: clamp(22px,4vw,34px); height: var(--finger-height); padding-top: 6px; border: 2px solid #a9bcc2; border-radius: 15px 15px 8px 8px; color: #60727a; background: linear-gradient(#edf5f6,#dce9eb); font-size: clamp(.56rem,1.4vw,.68rem); font-weight: 800; transition: .1s; }
.finger.is-target { color: #07404c; border-color: #2bcbe2; background: #9cf3ff; box-shadow: 0 0 16px rgba(64,230,255,.9); transform: translateY(-4px); }
.message { min-height: 1.5em; margin: 10px 0 0; color: var(--muted); text-align: center; font-size: .92rem; }
[hidden] { display: none !important; }
@keyframes wrong-shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-5px)} 40%{transform:translateX(5px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(3px)} }
@keyframes laser-shot { from{opacity:1;clip-path:inset(0 100% 0 0)} 45%{clip-path:inset(0 0 0 0)} to{opacity:0;clip-path:inset(0 0 0 0)} }
@keyframes target-hit { to{opacity:0;filter:blur(5px);transform:translate(var(--key-x),var(--key-y)) scale(1.65) rotate(12deg)} }
@keyframes spark-burst { from{opacity:1;transform:translate(-50%,-50%) scale(.5)} to{opacity:0;transform:translate(calc(-50% + var(--spark-x)),calc(-50% + var(--spark-y))) scale(.1)} }
@media (max-width:720px) {
  .app { width:min(100% - 20px,1100px); padding-top:16px; }
  .app__header { align-items:stretch; flex-direction:column; gap:10px; }
  .status { width:100%; }
  .status__item { flex:1; min-width:0; padding:8px 4px; }
  .play-area { height:38vh; min-height:280px; border-radius:16px; }
  .screen-keyboard { gap:3px; }
  .keycap { min-width:0; min-height:44px; padding:0; border-bottom-width:4px; }
  .hands { gap:18px; }
  .hand { gap:2px; padding-inline:4px; }
  .finger { width:clamp(18px,7vw,29px); }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; } }
