/* クエルリベン Phase1 — 世界樹参照: 暗紺パネル+淡金縁+明朝 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: #05070d; overflow: hidden; }
body {
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "BIZ UDMincho", serif;
  color: #d8d2c0;
  user-select: none;
}
#game { position: relative; width: 100vw; height: 100vh; }
#view3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hidden { display: none !important; }

.panel {
  background: rgba(14, 18, 34, 0.86);
  border: 2px solid #a89660;
  box-shadow: inset 0 0 0 1px rgba(90, 82, 58, 0.55), 0 2px 14px rgba(0, 0, 0, 0.55);
  border-radius: 3px;
}

#minimap {
  position: absolute; top: 18px; right: 18px;
  background: rgba(8, 11, 22, 0.78);
  border: 2px solid #a89660;
  border-radius: 3px;
}
#floorLabel {
  position: absolute; top: 18px; left: 18px;
  padding: 6px 16px 7px;
  font-size: 15px; letter-spacing: 0.18em;
  background: rgba(8, 11, 22, 0.78);
  border: 2px solid #a89660; border-radius: 3px;
}
#dungeonMsg {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%);
  min-width: 46%; max-width: 74%;
  padding: 14px 22px; font-size: 16px; line-height: 1.9; letter-spacing: 0.06em;
}

/* ---- 戦闘 ---- */
#battle { position: absolute; inset: 0; }
#battleBg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#enemyWrap {
  position: absolute; left: 50%; bottom: 17%;
  transform: translateX(-50%);
}
#enemyImg {
  height: 56vh; display: block;
  filter: drop-shadow(0 14px 18px rgba(3, 6, 14, 0.65));
  animation: sway 4.2s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(-0.5deg) translateY(0); }
  50% { transform: rotate(0.5deg) translateY(-7px); }
}
#enemyWrap.hit #enemyImg { animation: hitshake 0.32s linear; filter: drop-shadow(0 14px 18px rgba(3,6,14,.65)) brightness(2.1) saturate(0.4); }
@keyframes hitshake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-11px); }
  55% { transform: translateX(9px); }
  80% { transform: translateX(-5px); }
}
#enemyWrap.stunned #enemyImg { filter: drop-shadow(0 14px 18px rgba(3,6,14,.65)) brightness(0.75) hue-rotate(35deg); }

#enemyInfo {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 7px 20px 8px; font-size: 15px; letter-spacing: 0.1em;
}
#riftInfo { margin-left: 18px; color: #b9c6e2; }
#riftInfo em { font-style: normal; color: #e8a06a; }
#riftGauge { letter-spacing: 0.2em; margin-left: 4px; color: #e8a06a; }

#battleLog {
  position: absolute; left: 50%; bottom: 214px; transform: translateX(-50%);
  width: 50%; min-height: 58px;
  padding: 12px 20px; font-size: 16px; line-height: 1.85; letter-spacing: 0.05em;
}
#cmdMenu {
  position: absolute; left: 30px; bottom: 30px;
  width: 280px; list-style: none; padding: 12px 0;
}
#cmdMenu li {
  padding: 8px 20px 8px 42px; font-size: 16px; letter-spacing: 0.1em;
  position: relative; cursor: pointer; color: #b8b2a0;
}
#cmdMenu li.sel { color: #f2ead2; background: rgba(70, 78, 108, 0.5); }
#cmdMenu li.sel::before {
  content: ""; position: absolute; left: 18px; top: 50%;
  width: 9px; height: 9px; transform: translateY(-50%) rotate(45deg);
  background: #d2c496;
}
#cmdMenu li.disabled { opacity: 0.38; }

#statusPanel {
  position: absolute; right: 30px; bottom: 30px;
  width: 340px; padding: 14px 18px;
  display: flex; gap: 14px; align-items: center;
}
#portrait { height: 72px; border: 1px solid #6d6348; border-radius: 2px; background: #10131f; }
#statusBody { flex: 1; }
#pcName { font-size: 16px; letter-spacing: 0.22em; margin-bottom: 6px; }
.gaugeWrap { height: 11px; background: #2b2622; border: 1px solid #57503c; }
#hpGauge { height: 100%; width: 100%; background: linear-gradient(#d0764e, #b05a36); transition: width 0.35s; }
#hpText { font-size: 13px; color: #b8b2a0; margin-top: 3px; letter-spacing: 0.1em; }
#dreamRow { font-size: 14px; margin-top: 6px; letter-spacing: 0.14em; color: #9fb2d8; }
#dreamPips { letter-spacing: 0.25em; color: #7fa3e0; }

.dmgFloat {
  position: absolute; font-size: 34px; font-weight: bold; color: #f4ede0;
  text-shadow: 0 2px 6px #000, 0 0 14px rgba(240, 160, 90, 0.5);
  pointer-events: none; animation: dmgUp 0.9s ease-out forwards;
}
.dmgFloat.heal { color: #a8e0b0; }
@keyframes dmgUp {
  0% { opacity: 0; transform: translateY(6px) scale(0.8); }
  18% { opacity: 1; transform: translateY(-4px) scale(1.06); }
  100% { opacity: 0; transform: translateY(-46px) scale(1); }
}

#fader {
  position: absolute; inset: 0; background: #04060c;
  opacity: 0; pointer-events: none; transition: opacity 0.45s;
}
#fader.on { opacity: 1; pointer-events: all; }
#fader.flash { transition: opacity 0.08s; }
