:root { --ink:#173042;
  --panel:#ffffffdf;
  --accent:#f4c95d;
  --heart:#ef5a67;
  --star-miss:#c9d3da;
  --ink-veil:#17304299;
  }
* { box-sizing:border-box } body { margin:0;
  overflow:hidden;
  background:#9edfff;
  color:var(--ink);
  font-family:system-ui,sans-serif;
  }
canvas { display:block } #hud { position:fixed;
  top:max(12px,env(safe-area-inset-top));
  left:12px;
  right:12px;
  display:flex;
  justify-content:space-between;
  font-weight:800;
  text-shadow:0 1px #fff;
  pointer-events:none;
  }
#overlay { position:fixed;
  inset:0;
  display:grid;
  place-items:center;
  text-align:center;
  pointer-events:none;
  }
.fx-layer, .fx-flash { position:fixed;
  inset:0;
  pointer-events:none;
  }
.fx-flash { background:#fff;
  opacity:0;
  transition:opacity 40ms linear;
  box-shadow:inset 0 0 36px #fff;
  }
.float-text { position:absolute;
  font-weight:900;
  text-shadow:0 2px 2px #173042;
  animation:float-up .9s ease-out forwards;
  }
.clear-panel { color:#fff;
  text-shadow:0 3px 0 #173042;
  opacity:0;
  transform:scale(.6);
  }
.clear-panel.cheer { animation:clear-pop .32s cubic-bezier(.2,1.5,.5,1) forwards; }
.clear-panel h1 { font-size:clamp(3rem,14vw,7rem); margin:0; }
.clear-stars { display:flex;
  justify-content:center;
  gap:12px;
  color:var(--accent);
  font-size:clamp(2rem,10vw,5rem);
  }
.clear-stars b { opacity:0; transform:scale(.2) rotate(-120deg); }
.clear-stars svg { width:1em; height:1em; filter:drop-shadow(0 3px 0 var(--ink)); }
.clear-stars .got svg { fill:var(--accent); }
.clear-stars .miss svg { fill:var(--star-miss); }
/* 主人公が画面の中央に来るので、パネルは上へ・数字と「つぎへ」は下へ逃がす */
#overlay:has(.clear-panel) { place-items:start center; padding-top:5vh; }
.clear-count, .clear-next { display:inline-block; margin:6px 4px 0; padding:4px 16px;
  border-radius:999px; background:var(--ink-veil); font-size:clamp(1.1rem,4vw,1.6rem); }
.record-ribbon { display:inline-block; padding:4px 28px; background:var(--heart);
  clip-path:polygon(0 0,100% 0,94% 50%,100% 100%,0 100%,6% 50%); }
.cheer .clear-stars b { animation:star-pop .38s cubic-bezier(.2,1.5,.5,1) forwards; }
.cheer .clear-stars b:nth-child(2) { animation-delay:.45s; }
.cheer .clear-stars b:nth-child(3) { animation-delay:.9s; }
.clear-next { animation:blink 1.1s steps(2) infinite; }
.record-ribbon, .all-clear { margin:0 0 8px;
  font-size:clamp(1.3rem,5vw,2rem);
  }
@keyframes float-up { to { transform:translateY(-62px); opacity:0; } }
@keyframes clear-pop { to { opacity:1; transform:scale(1); } }
@keyframes star-pop { to { opacity:1; transform:scale(1) rotate(360deg); } }
.panel { background:var(--panel);
  border:4px solid var(--ink);
  border-radius:28px;
  padding:28px 36px;
  max-width:min(88vw,550px);
  box-shadow:0 8px 0 #17304233;
  }
.panel h1 { font-size:clamp(2rem,8vw,4rem);
  margin:0 0 16px } .panel p { font-size:1.2rem;
  line-height:1.8;
  margin:0;
  }
#controls { position:fixed;
  bottom:max(16px,env(safe-area-inset-bottom));
  left:0;
  right:0;
  display:flex;
  justify-content:center;
  gap:16px;
  }
.control { width:76px;
  height:64px;
  border:3px solid var(--ink);
  border-radius:18px;
  background:var(--panel);
  color:var(--ink);
  font-weight:800;
  touch-action:none;
  }
.control svg { width:24px;
  height:24px;
  display:block;
  margin:auto;
  fill:currentColor;
  } .control span { display:block;
  font-size:.7rem;
  }
.heart, .star { width:24px;
  height:24px;
  vertical-align:middle;
  fill:var(--heart);
  filter:drop-shadow(0 1px #fff);
  }
.star { fill:var(--accent) }
.hearts, .score { display:inline-flex;
  align-items:center;
  gap:3px;
  }
.mute { pointer-events:auto;
  width:38px;
  height:38px;
  border:2px solid var(--ink);
  border-radius:50%;
  background:var(--panel);
  color:var(--ink);
  }
.mute svg { width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  }
.title { border-color:#fff;
  box-shadow:0 8px 0 #17304255;
  animation:title-bob 2s ease-in-out infinite;
  }
.levels { display:flex;
  justify-content:center;
  gap:5px;
  margin:12px 0 18px;
  }
.level-card { position:relative;
  width:42px;
  height:50px;
  border:2px solid var(--ink);
  border-radius:11px;
  background:#fff3c7;
  color:var(--ink);
  }
.level-card i { position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-style:normal;
  font-weight:900;
  }
.level-card .star { width:10px;
  height:10px;
  }
.level-card.selected { transform:translateY(-9px) scale(1.12);
  background:#f4c95d;
  box-shadow:0 4px 0 #b98726;
  }
.level-card.locked { background:#cad2d6;
  color:#64747b;
  }
.lock { width:25px;
  height:25px;
  fill:currentColor;
  }
.hp { border:0;
  border-radius:99px;
  padding:8px 14px;
  background:#eaf4f6;
  color:var(--ink);
  font-weight:800;
  pointer-events:auto;
  min-width:132px;
  min-height:44px;
  }
.start { animation:blink 1.1s steps(2) infinite }
.notice { font-size:1.5rem;
  font-weight:900;
  color:#fff;
  text-shadow:0 2px 2px #173042;
  }
@keyframes blink { 50% { opacity:.35 } }
@keyframes title-bob { 50% { transform:translateY(-5px) } }
