@font-face {
  font-family: "Zen Old Mincho";
  src: url("fonts/ZenOldMincho-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #05060f;
  --ink: #e9e6f5;
  --serif: "Zen Old Mincho", "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(14vh + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  color: rgba(233, 230, 245, 0.88);
  text-shadow: 0 0 12px rgba(5, 6, 15, 0.9);
  opacity: 0;
  transition: opacity 2.4s ease;
  pointer-events: none;
}
#hint.on { opacity: 1; animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

#msg {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(88vw, 30rem);
  margin: 0;
  padding: 2.2rem 1.4rem;
  transform: translate(-50%, -50%);
  text-align: center;
  white-space: pre-line;
  font-size: clamp(1.05rem, 4.6vw, 1.5rem);
  line-height: 2.1;
  letter-spacing: 0.1em;
  word-break: keep-all;
  text-wrap: balance;
  color: #fbf9ff;
  text-shadow: 0 0 14px rgba(5, 6, 15, 0.95), 0 0 34px rgba(5, 6, 15, 0.9), 0 0 2px rgba(255, 255, 255, 0.4);
  background: radial-gradient(ellipse at center, rgba(5, 6, 15, 0.82) 0%, rgba(5, 6, 15, 0.5) 45%, rgba(5, 6, 15, 0) 75%);
  opacity: 0;
  transition: opacity 3.6s ease;
  pointer-events: none;
}
#msg.on { opacity: 1; }
#msg.off { transition-duration: 1.2s; }
#msg.sleep { transition-duration: 6s; }

@media (prefers-reduced-motion: reduce) {
  #hint.on { animation: none; opacity: 0.85; }
}
