* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}

#app {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, var(--bg1, #3b0808) 0%, var(--bg2, #050000) 75%);
  transition: background 0.35s ease;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* 吠えたときの画面ゆれ */
#stage.roar { animation: shake 0.55s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0) scale(1); }
  10% { transform: translate(-9px, 5px) scale(1.06); }
  20% { transform: translate(8px, -7px) scale(1.07); }
  30% { transform: translate(-11px, -4px) scale(1.05); }
  45% { transform: translate(7px, 6px) scale(1.04); }
  60% { transform: translate(-5px, 3px) scale(1.03); }
  80% { transform: translate(3px, -2px) scale(1.01); }
}

/* 出てくるときのアニメ */
#stage.enter { animation: pop 0.4s ease-out both; }
@keyframes pop {
  0% { transform: scale(0.82); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* 口・目のアニメ（吠えた瞬間） */
#mouth { transform-box: fill-box; transform-origin: center; transition: transform 0.12s ease-out; }
#stage.roar #mouth { transform: scaleY(1.45) scaleX(1.12); }
#stage.roar .eye-glow { opacity: 1; }
.eye-glow { opacity: 0.55; transition: opacity 0.15s; }

#flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255,60,20,0.55), rgba(120,0,0,0.15) 60%, transparent 80%);
  opacity: 0;
}
#flash.on { animation: fl 0.5s ease-out both; }
@keyframes fl {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

#hint {
  position: absolute;
  left: 0; right: 0;
  bottom: 96px;
  text-align: center;
  color: rgba(255,255,255,0.62);
  font-size: 16px;
  letter-spacing: 2px;
  pointer-events: none;
  animation: blink 1.8s ease-in-out infinite;
  text-shadow: 0 2px 8px #000;
}
#hint.hide { display: none; }
@keyframes blink { 0%,100% { opacity: 0.25; } 50% { opacity: 0.9; } }

#bar {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 84px;
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-left: 14px;
  padding-right: 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  z-index: 5;
}

#bar button {
  width: 62px;
  height: 54px;
  flex: none;
  border: 2px solid rgba(255,255,255,0.28);
  border-radius: 14px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}
#bar button:active { background: rgba(255,255,255,0.22); transform: scale(0.94); }

#label {
  flex: 1;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 10px #000;
  pointer-events: none;
}
#name { display: block; font-size: 22px; font-weight: bold; letter-spacing: 3px; }
#count { display: block; font-size: 12px; opacity: 0.6; margin-top: 2px; }

/* スタート画面 */
#start {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #2a0505, #000 75%);
  text-align: center;
  color: #fff;
}
#start.hide { display: none; }
.s-oni { font-size: 76px; animation: sway 2.6s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-6deg) scale(1); } 50% { transform: rotate(6deg) scale(1.08); } }
.s-title {
  font-size: 34px;
  font-weight: bold;
  letter-spacing: 6px;
  margin: 14px 0 12px;
  color: #ff4d3d;
  text-shadow: 0 0 22px rgba(255,60,30,0.65);
}
.s-sub { font-size: 14px; line-height: 1.9; opacity: 0.8; }
#go {
  margin-top: 30px;
  padding: 18px 52px;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 4px;
  color: #fff;
  background: linear-gradient(#c62b1c, #7a0f06);
  border: 2px solid #ff8a6a;
  border-radius: 40px;
  box-shadow: 0 0 26px rgba(255,60,30,0.45);
  cursor: pointer;
  font-family: inherit;
}
#go:active { transform: scale(0.95); }
.s-note { margin-top: 22px; font-size: 11px; opacity: 0.45; }
