:root {
  --bg: #05061a;
  --panel: rgba(20, 24, 70, .7);
  --ink: #eef3ff;
  --ink-2: #9aa6d8;
  --cyan: #4fe3ff;
  --pink: #ff5c8a;
  --gold: #ffd166;
  --green: #5dff9d;
  --purple: #c77dff;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #000;
  color: var(--ink);
  font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', 'Meiryo', sans-serif;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

.game {
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 100%, #12164a, var(--bg) 70%);
  padding-top: max(6px, env(safe-area-inset-top));
  touch-action: none;
}

/* 上の数字 */
.hud { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr auto; gap: 6px; padding: 0 10px 6px; align-items: center; }
.hud > div { background: var(--panel); border: 1px solid rgba(79, 227, 255, .18); border-radius: 10px; padding: 3px 8px; line-height: 1.25; min-height: 38px; }
.hud small { display: block; font-size: 10px; color: var(--ink-2); letter-spacing: .08em; }
.hud b { font-size: 16px; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 8px rgba(79, 227, 255, .6); }
.pips { display: flex; gap: 3px; padding-top: 3px; flex-wrap: wrap; }
.pips i { width: 9px; height: 9px; border-radius: 2px; background: var(--pink); box-shadow: 0 0 6px var(--pink); }
.pips i.off { background: #2a2f60; box-shadow: none; }
.pow { display: flex; gap: 4px; font-size: 11px; font-weight: 800; padding-top: 1px; }
.pow span { padding: 0 5px; border-radius: 6px; background: #1a2050; }
.pow .p { color: var(--cyan); } .pow .r { color: #ff9f43; } .pow .c { color: var(--purple); } .pow .o { color: var(--green); } .pow .s { color: var(--gold); }
.icon { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(79, 227, 255, .3); background: var(--panel); font-weight: 800; }

/* ゲームの画面 */
.field { position: relative; flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; }
#screen { display: block; border-radius: 4px; }
.bar { position: absolute; right: 4px; top: 8px; bottom: 8px; width: 4px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, var(--cyan), var(--purple), var(--pink)); }

/* 題名・クリアなどの画面 */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 20px; text-align: center; background: rgba(3, 4, 20, .72);
}
.screen h1 { margin: 0; line-height: 1; font-family: 'Arial Black', 'Hiragino Sans', sans-serif; font-weight: 900; letter-spacing: .08em; }
.t1 { display: block; font-size: 58px; color: var(--cyan); text-shadow: 0 0 18px rgba(79, 227, 255, .9), 0 0 40px rgba(79, 227, 255, .5); }
.t2 { display: block; font-size: 46px; color: #fff; text-shadow: 0 0 16px rgba(255, 92, 138, .9), 0 0 40px rgba(255, 92, 138, .5); margin-top: 4px; }
.screen h2 { margin: 0; font-size: 24px; font-family: 'Arial Black', 'Hiragino Sans', sans-serif; letter-spacing: .06em; }
.screen p { margin: 0; }
.sub { color: var(--ink-2); font-size: 13px; margin-bottom: 6px !important; }
.note { color: var(--ink-2); font-size: 12px; }
.glow { color: var(--cyan); text-shadow: 0 0 14px rgba(79, 227, 255, .8); }
.big-title { font-size: 32px !important; }
.over-title { color: var(--pink); font-size: 34px !important; text-shadow: 0 0 16px rgba(255, 92, 138, .9); }
.rainbow { background: linear-gradient(90deg, #ff5c8a, #ffd166, #5dff9d, #4fe3ff, #c77dff); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 10px rgba(255, 255, 255, .4)); }
.score-line { font-size: 15px; color: var(--ink-2); }
.score-line b { font-size: 30px; color: var(--gold); text-shadow: 0 0 12px rgba(255, 209, 102, .7); margin-left: 6px; font-variant-numeric: tabular-nums; }
.new { color: var(--pink); font-weight: 800; }

.btn { width: min(100%, 280px); min-height: 50px; border-radius: 14px; border: 1px solid transparent; font-weight: 800; font-size: 17px; }
.btn.primary { background: linear-gradient(90deg, #1fb6ff, #7b5cff); color: #fff; box-shadow: 0 0 22px rgba(79, 227, 255, .45); }
.btn.ghost { background: rgba(10, 14, 40, .6); border-color: var(--cyan); color: var(--cyan); }
.btn.text { background: none; color: var(--ink-2); font-weight: 400; font-size: 14px; min-height: 36px; width: auto; text-decoration: underline; }
.toggles { display: flex; gap: 14px; }

.diffs { display: grid; gap: 10px; width: min(100%, 300px); }
.diff {
  border-radius: 14px; padding: 10px 12px; border: 1.5px solid; background: rgba(10, 14, 40, .7); text-align: center;
}
.diff b { display: block; font-family: 'Arial Black', sans-serif; font-size: 20px; letter-spacing: .06em; }
.diff small { display: block; font-size: 12px; color: var(--ink-2); }
.diff em { font-style: normal; font-size: 11px; color: var(--gold); }
.diff.easy { border-color: var(--green); box-shadow: 0 0 14px rgba(93, 255, 157, .3); } .diff.easy b { color: var(--green); }
.diff.normal { border-color: #ffa44f; box-shadow: 0 0 14px rgba(255, 164, 79, .3); } .diff.normal b { color: #ffa44f; }
.diff.hard { border-color: var(--pink); box-shadow: 0 0 14px rgba(255, 92, 138, .35); } .diff.hard b { color: var(--pink); }

.howto { text-align: left; margin: 0; padding-left: 1.1em; font-size: 13px; line-height: 1.75; max-width: 400px; }
.howto li { margin-bottom: 4px; }
.howto b { color: var(--cyan); }
.it { display: inline-block; min-width: 20px; text-align: center; border-radius: 99px; border: 1.5px solid; margin: 0 4px 0 8px; font-weight: 800; font-size: 11px; line-height: 18px; }
.it.p { color: var(--cyan); } .it.r { color: #ff9f43; } .it.c { color: var(--purple); } .it.o { color: var(--green); } .it.s { color: var(--gold); }

/* 丸いリモコン。iPhone の画面の下のふち（ホームに戻る線）から十分はなす */
.control {
  flex: 0 0 auto;
  height: 150px;
  margin-bottom: calc(env(safe-area-inset-bottom) + 22px);
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
}
.stick {
  position: relative; width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 227, 255, .08), rgba(79, 227, 255, .02) 60%, rgba(79, 227, 255, .12));
  border: 2px solid rgba(79, 227, 255, .45);
  box-shadow: 0 0 18px rgba(79, 227, 255, .25), inset 0 0 18px rgba(79, 227, 255, .15);
}
.stick::before, .stick::after {
  content: ''; position: absolute; left: 50%; top: 50%; background: rgba(79, 227, 255, .18); transform: translate(-50%, -50%);
}
.stick::before { width: 2px; height: 80%; }
.stick::after { width: 80%; height: 2px; }
.stick i {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 35% 30%, #ffffff, #8be9ff 35%, #1f7ad6 100%);
  box-shadow: 0 0 20px rgba(79, 227, 255, .8);
}
.stick.on { border-color: rgba(79, 227, 255, .9); }

/* パソコン（マウスで使う画面）では、リモコンを小さく */
@media (hover: hover) and (pointer: fine) {
  .control { height: 110px; margin-bottom: 12px; }
  .stick { transform: scale(.75); }
}
