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

html, body {
  height: 100%;
  overflow: hidden;
  background: #151b14;
  color: #e8e4d4;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}

canvas#scene2d, canvas#scene3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
canvas#scene2d.hidden, canvas#scene3d.hidden { display: none; }

#panel {
  position: fixed;
  top: 18px;
  left: 18px;
  min-width: 230px;
  padding: 14px 18px 16px;
  background: rgba(10, 14, 10, 0.72);
  border: 1px solid rgba(232, 228, 212, 0.22);
  border-radius: 6px;
  backdrop-filter: blur(6px);
}

#panel h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  text-align: center;
  border-bottom: 1px solid rgba(232, 228, 212, 0.22);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.tabs {
  display: flex;
  margin-bottom: 10px;
  border: 1px solid rgba(232, 228, 212, 0.3);
  border-radius: 4px;
  overflow: hidden;
}
.tabs button {
  flex: 1;
  padding: 5px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}
.tabs button.active {
  background: rgba(232, 228, 212, 0.2);
}

#panel dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 13px;
}
#panel dt { color: #9aa48e; }
#panel dd { text-align: right; }
#panel dd.desc { font-size: 11px; color: #b5ae93; grid-column: 1 / 3; text-align: right; }

#flowSlider {
  width: 100%;
  margin-top: 8px;
  accent-color: #7fb6c9;
  cursor: pointer;
}

.gaugeLabel { margin-top: 12px; font-size: 11px; color: #9aa48e; }
.gauge {
  margin-top: 4px;
  height: 6px;
  background: rgba(232, 228, 212, 0.12);
  border-radius: 3px;
  overflow: hidden;
}
#gaugeFill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #6fa8bc, #a3d4e4);
  border-radius: 3px;
}

.stats {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: #9aa48e;
}
.stats b { color: #e8e4d4; font-weight: 600; margin-left: 4px; }

.btns { display: flex; gap: 8px; margin-top: 14px; }
button {
  flex: 1;
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12px;
  color: #e8e4d4;
  background: transparent;
  border: 1px solid rgba(232, 228, 212, 0.35);
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.1em;
}
button:hover { background: rgba(232, 228, 212, 0.12); }

#fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
#fx .kn {
  position: absolute;
  top: 0;
  left: 0;
  color: #f5f0dc;
  letter-spacing: 0.15em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  will-change: transform, opacity;
}

#hint {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #8a937e;
}

#soundHint {
  position: fixed;
  top: 18px;
  right: 18px;
  padding: 8px 16px;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: #e8e4d4;
  background: rgba(10, 14, 10, 0.72);
  border: 1px solid rgba(232, 228, 212, 0.25);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}
#soundHint.hidden { display: none; }
