/* タップ花火 — Day 003
   夜空と花火を主役にするため、UIはcanvas上へ控えめに重ねる */

:root {
  --bg: #05060a;
  --text: #eef1f6;
  --muted: #9aa3b2;
  --accent: #4f9cff;
  --line: rgba(154, 163, 178, .34);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
               "Yu Gothic", "Noto Sans JP", "Segoe UI", sans-serif;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.fireworks {
  position: fixed;
  inset: 0;
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
}

.fireworks__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* オーバーレイは入力を通し、操作要素だけをクリック可能にする */
.app-head {
  position: absolute;
  z-index: 2;
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: baseline;
  gap: 9px;
  transform: translateX(-50%);
  pointer-events: none;
  white-space: nowrap;
}

.app-head__title {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-shadow: 0 1px 8px var(--bg);
}

.app-head__day {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .65rem;
  letter-spacing: .08em;
  background: rgba(5, 6, 10, .38);
}

.fireworks__sound-toggle {
  position: absolute;
  z-index: 4;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  place-items: center;
  color: var(--text);
  background: rgba(5, 6, 10, .48);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: .72;
  touch-action: manipulation;
}

.fireworks__sound-toggle:hover { opacity: 1; }

.fireworks__sound-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  opacity: 1;
}

.fireworks__hint {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  color: rgba(238, 241, 246, .78);
  font-size: clamp(.88rem, 3.7vw, 1rem);
  letter-spacing: .08em;
  pointer-events: none;
  text-shadow: 0 1px 12px var(--bg);
  opacity: 1;
  transition: opacity .55s ease, transform .55s ease;
}

.fireworks__hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 8px));
}

.foot {
  position: absolute;
  z-index: 3;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  font-size: .72rem;
  letter-spacing: .04em;
  white-space: nowrap;
  pointer-events: auto;
}

.foot__link {
  display: inline-block;
  padding: 8px 10px;
  color: rgba(79, 156, 255, .78);
  text-decoration: none;
  text-shadow: 0 1px 8px var(--bg);
}

.foot__link:hover { color: var(--accent); }

.foot__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (max-width: 420px) {
  .app-head { top: max(12px, env(safe-area-inset-top)); }
  .fireworks__sound-toggle {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
  }
  .foot { bottom: max(12px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .fireworks__hint { transition-duration: .01ms; }
}
