* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: "Noto Serif", "Source Serif Pro", Georgia, "Times New Roman", serif;
  color: #ece6d6; background: #0d1526;
  display: flex; flex-direction: column; min-height: 100%;
  line-height: 1.65;
}
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#world:active { cursor: grabbing; }

header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
}
.brand { letter-spacing: 0.25em; text-transform: uppercase; font-size: 0.85rem; opacity: 0.85; }
.hud { display: flex; gap: 16px; align-items: center; }
#lamps { display: flex; gap: 5px; }
#lamps i { width: 8px; height: 8px; border-radius: 50%; background: #3a4760; display: block; }
#lamps i.on { background: #ffb347; box-shadow: 0 0 8px #ffb347; }

main {
  position: fixed; inset: 52px 0 0 0; z-index: 2; pointer-events: none;
  display: flex; align-items: flex-end; justify-content: center; padding: 0 12px 16px;
}
.panel {
  pointer-events: auto;
  width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto;
  background: rgba(10, 16, 28, 0.86);
  border: 1px solid rgba(236, 230, 214, 0.16);
  border-radius: 16px; padding: 22px 22px;
  backdrop-filter: blur(8px);
  animation: rise 0.6s ease both;
}
.panel.center { align-self: center; text-align: center; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes appear { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

#hint {
  position: fixed; top: 58px; left: 0; right: 0; z-index: 2; margin: 0; padding: 0 16px;
  text-align: center; pointer-events: none; font-size: 0.98rem;
  text-shadow: 0 1px 10px #060a12, 0 0 3px #060a12; transition: opacity 0.5s;
}
#hint:empty { opacity: 0; }
#controls {
  position: fixed; left: 0; right: 0; bottom: 18px; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 14px; pointer-events: none;
}
body:not([data-mode="walk"]) #controls { display: none; }
#controls > * { pointer-events: auto; }
.pads { display: flex; align-items: center; gap: 18px; pointer-events: none !important; }
.pads > * { pointer-events: auto; }
.pad {
  width: 92px; height: 92px; border-radius: 50%; font-size: 0.85rem; line-height: 1.25;
  color: #ece6d6; background: rgba(10, 16, 28, 0.55); border: 1px solid rgba(236, 230, 214, 0.45);
  backdrop-filter: blur(4px); touch-action: none; user-select: none; -webkit-user-select: none;
}
.pad.small { width: 52px; height: 52px; font-size: 1.1rem; }
.pad.ghost { visibility: hidden; }
.pad.down { background: rgba(255, 179, 71, 0.35); border-color: #ffb347; }

.eyebrow { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: #ffb347; margin: 0 0 10px; }
h1 { font-size: 1.7rem; font-weight: 500; margin: 0 0 10px; }
h2 { font-size: 1.2rem; font-weight: 500; margin: 0 0 12px; }
p { margin: 0 0 14px; }
.muted { opacity: 0.65; font-size: 0.9rem; }
.story { font-size: 1.08rem; }
blockquote {
  margin: 0 0 16px; padding: 12px 16px;
  border-left: 3px solid #ffb347; background: rgba(255, 179, 71, 0.07);
  border-radius: 0 8px 8px 0; font-style: italic;
}
.mine {
  margin: 0 0 16px; padding: 10px 14px; border-radius: 8px;
  background: rgba(236, 230, 214, 0.06); font-size: 0.92rem; white-space: pre-wrap;
}
.mine b { display: block; font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.6; font-weight: 400; }

textarea {
  width: 100%; min-height: 130px; resize: vertical;
  font: inherit; color: inherit; line-height: 1.6;
  background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(236, 230, 214, 0.2);
  border-radius: 10px; padding: 12px 14px;
}
textarea:focus, button:focus-visible { outline: 2px solid #ffb347; outline-offset: 2px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

button { font: inherit; cursor: pointer; }
.btn {
  background: #ffb347; color: #1a1305; border: none;
  padding: 11px 24px; border-radius: 999px; font-weight: 600;
  transition: transform 0.15s, opacity 0.2s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.link { background: none; border: none; color: inherit; opacity: 0.7; text-decoration: underline; text-underline-offset: 3px; padding: 4px; }
.link:hover { opacity: 1; }

.choices { display: grid; gap: 10px; margin-top: 6px; }
.choice {
  text-align: left; background: rgba(236, 230, 214, 0.05); color: inherit;
  border: 1px solid rgba(236, 230, 214, 0.2); border-radius: 10px; padding: 12px 16px;
}
.choice:hover { border-color: #ffb347; background: rgba(255, 179, 71, 0.08); }

.beat { opacity: 0; animation: appear 0.9s ease forwards; }
.beat:nth-of-type(2) { animation-delay: 1.4s; }
.beat h3 { font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; color: #ffb347; margin: 0 0 4px; font-weight: 400; }
.late { opacity: 0; animation: appear 0.9s ease 2.8s forwards; }

.bell {
  width: 112px; height: 112px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d9a441, #7a5416);
  border: none; color: #1a1305; font-weight: 600; font-size: 1.05rem;
  box-shadow: 0 0 50px rgba(255, 179, 71, 0.35);
  margin: 10px 0 8px; text-shadow: none;
}
.bell:hover { box-shadow: 0 0 70px rgba(255, 179, 71, 0.55); }
.breath {
  width: 110px; height: 110px; border-radius: 50%; margin: 18px auto;
  border: 2px solid rgba(255, 214, 150, 0.9);
  background: radial-gradient(circle, rgba(255, 179, 71, 0.3), transparent 70%);
  animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { transform: scale(0.65); } 50% { transform: scale(1.15); } }

.entry { border-top: 1px solid rgba(236, 230, 214, 0.12); padding: 14px 0; }
.entry:first-of-type { border-top: none; }
.entry .muted { margin-bottom: 4px; }


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01s !important; animation-delay: 0s !important; }
}

.twist { border-left-color: #8fc5ff; background: rgba(143, 197, 255, 0.08); font-style: normal; }
.flaw { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; cursor: pointer; }
.flaw input { margin-top: 6px; width: 18px; height: 18px; accent-color: #ffb347; flex: none; }
.card { display: block; width: 100%; max-width: 300px; margin: 0 auto 14px; border-radius: 12px; border: 1px solid rgba(236, 230, 214, 0.2); }
.tally { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 0.9rem; margin-bottom: 12px; }
.tally i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.panel.still { background: none; border: none; backdrop-filter: none; text-shadow: 0 1px 10px #060a12, 0 0 3px #060a12; }
.panel.still h2 { font-size: 1.5rem; margin-bottom: 6px; }
textarea.copy { min-height: 110px; font-size: 0.85rem; margin-top: 10px; }
