/* ぽんぽん うちゅうせん — 見た目。ライト=ひるの 空いろ・ダーク=よる。あそぶ ところは どちらも うちゅう。外部フォントは使わない */
:root {
  --bg: #e6efff;
  --ink: #2b2433;
  --sub: #5c6577;
  --card: #ffffff;
  --card-sh: #b7c6e6;
  --gold: #ffc53d;
  --focus: #2f7cf6;
  --pill: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14172b;
    --ink: #f3eefc;
    --sub: #b8bfd8;
    --card: #2a2f4d;
    --card-sh: #0a0c18;
    --focus: #ffc53d;
    --pill: #2a2f4d;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Maru Gothic Pro", "BIZ UDPGothic", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
  overflow: hidden;
}
#app {
  position: fixed; inset: 0;
  display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  /* 画面の下 15% には押すものを置かない(手首が当たる) */
  padding: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 10px) 15vh calc(env(safe-area-inset-left) + 10px);
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; margin: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
svg { display: block; width: 100%; height: 100%; overflow: visible; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.logo { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; font-size: clamp(17px, 4.6vw, 24px); font-weight: 900; white-space: nowrap; }
.logo img { width: 40px; height: 40px; flex-shrink: 0; }
@media (max-width: 440px) { .logo span { display: none; } }
.cnt { display: flex; align-items: center; gap: 6px; height: 48px; padding: 0 16px 0 10px; border-radius: 24px; background: var(--pill); box-shadow: 0 4px 0 var(--card-sh); font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.cnt svg { width: 30px; height: 30px; flex-shrink: 0; }
.snd { flex-shrink: 0; width: 52px; height: 56px; border-radius: 16px; background: var(--card); box-shadow: 0 4px 0 var(--card-sh); display: grid; place-items: center; }
.snd svg { width: 32px; height: 32px; }
.spk { fill: var(--ink); }
.wave, .slash { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.snd.off .wave, .snd:not(.off) .slash { display: none; }
.snd:active { transform: translateY(3px); }

/* ---- うちゅう ---- */
.stage { position: relative; min-height: 0; border: 3px solid var(--ink); border-radius: 22px; overflow: hidden; background: #1b2a5e; touch-action: none; cursor: ew-resize; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hint {
  position: absolute; left: 50%; bottom: 7%; margin: 0; padding: 8px 16px; border-radius: 20px; transform: translateX(-50%);
  background: rgba(255, 255, 255, .92); color: #2b2433; border: 3px solid #2b2433; font-size: clamp(15px, 4.2vw, 22px); font-weight: 900; white-space: nowrap; pointer-events: none;
  animation: hintbob 1.6s ease-in-out infinite;
}
@keyframes hintbob { 50% { transform: translateX(-50%) translateY(-6px); } }

@media (orientation: landscape) and (max-height: 600px) {
  .logo img { width: 32px; height: 32px; }
  .cnt, .snd { height: 48px; }
  .hint { bottom: 4%; padding: 4px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
