/* ============================================================================
 * Toast Notification (Carved Stone Banner)
 * ========================================================================== */
.hud-toast {
  position: fixed;
  top: 120px;
  left: 50%;
  transform: translate(-50%, -8px);
  opacity: 0;
  pointer-events: none;
  max-width: min(460px, calc(100vw - 360px));
  text-align: center;
  background: var(--stone-base);
  border: 1px solid var(--brass-dim);
  border-bottom: 2px solid var(--stone-ledge);
  border-radius: var(--radius-outer);
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-main);
  box-shadow: 0 4px 0 var(--stone-ledge);
  transition: opacity 180ms var(--ease-ui), transform 200ms var(--ease-ui);
  z-index: 15;
}

.hud-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.has-boss-bar .hud-toast {
  top: 162px;
}

/* ============================================================================
 * Roguelike Dungeon Stairs Confirmation Plaque (Carved Stone × Forged Brass)
 * ========================================================================== */
.stairs-confirm {
  position: fixed;
  top: 126px;
  left: 50%;
  transform: translate(-50%, -6px) scale(0.985);
  opacity: 0;
  pointer-events: none;
  width: min(372px, calc(100vw - 24px));
  padding: 11px 13px 12px;
  border-radius: var(--radius-outer);
  background: var(--stone-base);
  border: 1px solid var(--brass-dim);
  border-top: 2px solid var(--soul-cyan);
  border-bottom: 2px solid var(--stone-ledge);
  box-shadow: 0 5px 0 var(--stone-ledge);
  z-index: 18;
  transition: opacity 180ms var(--ease-ui), transform 220ms var(--ease-ui);
}

.stairs-confirm.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

body.has-boss-bar .stairs-confirm {
  top: 178px;
}

.stairs-confirm-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.stairs-emblem {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-inner);
  background: var(--stone-deep);
  border: 1px solid var(--brass-dim);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.72);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--soul-cyan);
}

.stairs-confirm-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stairs-confirm-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-main);
  line-height: 1.3;
}

.stairs-confirm-sub {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brass);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stairs-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stairs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 12.5px;
  white-space: nowrap;
}

.stairs-keys {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.stairs-btn.primary-btn kbd {
  background: rgba(20, 16, 8, 0.18);
  border-color: rgba(20, 16, 8, 0.36);
  border-bottom-color: rgba(20, 16, 8, 0.56);
  color: #161108;
}

body.touch-mode .stairs-keys {
  display: none;
}

/* ============================================================================
 * Compact Bottom-Left Roguelike Dungeon Event Log
 * ========================================================================== */
.dungeon-log {
  position: fixed;
  bottom: 12px;
  left: 12px;
  width: 244px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  z-index: 11;
}

.dungeon-log:empty {
  display: none;
}

.log-entry {
  padding: 4px 9px 4px 8px;
  border-radius: var(--radius-inner);
  background: rgba(16, 19, 26, 0.90);
  border: 1px solid #242936;
  border-left: 2px solid var(--ink-dim);
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-main);
  transition: opacity 200ms var(--ease-ui);
}

.log-entry.tone-info {
  border-left-color: #7c97c4;
  color: #dfe6f2;
}

.log-entry.tone-good {
  border-left-color: var(--soul-cyan);
  color: #def7fb;
}

.log-entry.tone-warn {
  border-left-color: var(--brass);
  color: #f7ebd1;
}

.log-entry.tone-danger {
  border-left-color: var(--trap-rust);
  color: #f8dfd0;
}

.log-entry.tone-boss {
  border-left-color: var(--crimson-enrage);
  color: #f8d8de;
}

.log-entry.tier-0 { opacity: 0.46; }
.log-entry.tier-1 { opacity: 0.74; }
.log-entry.tier-2 { opacity: 1; }

.log-entry.log-enter {
  animation: log-slide-in 180ms var(--ease-ui) both;
}

@keyframes log-slide-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================================
 * Gimmick Hint Plaque (Relic Cage / Heavy Switch Puzzle Guide — Carved Stone)
 * ========================================================================== */
.gimmick-hint {
  position: fixed;
  bottom: 126px;
  left: 50%;
  transform: translate(-50%, 8px) scale(0.985);
  opacity: 0;
  pointer-events: none;
  width: min(416px, calc(100vw - 24px));
  padding: 10px 12px 11px;
  border-radius: var(--radius-outer);
  background: var(--stone-base);
  border: 1px solid var(--stone-edge);
  border-top: 2px solid var(--brass);
  border-bottom: 2px solid var(--stone-ledge);
  box-shadow: 0 5px 0 var(--stone-ledge);
  z-index: 13;
  transition: opacity 180ms var(--ease-ui), transform 220ms var(--ease-ui), border-color 180ms var(--ease-ui);
}

.gimmick-hint.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.gimmick-hint.is-satisfied {
  border-top-color: var(--vital-green);
  border-color: #2f5b41;
}

.gimmick-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gimmick-emblem {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-inner);
  background: var(--stone-deep);
  border: 1px solid var(--brass-dim);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.72);
  font-size: 18px;
  font-weight: 800;
  color: var(--brass);
  transition: color 160ms var(--ease-ui), border-color 160ms var(--ease-ui);
}

.gimmick-hint.is-satisfied .gimmick-emblem {
  color: #5fd68a;
  border-color: #3a7a52;
}

.gimmick-body {
  flex: 1;
  min-width: 0;
}

.gimmick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.gimmick-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gimmick-state {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: var(--radius-inner);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #f0b89e;
  background: #2f1b19;
  border: 1px solid #6b3530;
}

.gimmick-hint.is-satisfied .gimmick-state {
  color: #d6f7e2;
  background: #1a3826;
  border-color: #3c8256;
}

.gimmick-cond {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gimmick-req {
  color: var(--ink-muted);
}

.gimmick-cur {
  font-weight: 700;
  color: var(--brass-bright);
}

.gimmick-hint.is-satisfied .gimmick-cur {
  color: #5fd68a;
}

.gimmick-progress-track {
  position: relative;
  height: 6px;
  margin-top: 8px;
  border-radius: var(--radius-inner);
  background: var(--stone-deep);
  border: 1px solid #262b38;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.78);
  overflow: hidden;
}

.gimmick-progress-fill {
  height: 100%;
  background: var(--brass);
  transition: width 160ms var(--ease-ui), background-color 180ms var(--ease-ui);
}

.gimmick-hint.is-satisfied .gimmick-progress-fill {
  background: var(--vital-green);
}

.gimmick-tip {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px solid #242936;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-muted);
}

/* ============================================================================
 * Morph Preview Sheet (Right Peripheral Side Inspector Below Minimap)
 * ========================================================================== */
.morph-preview {
  position: fixed;
  top: 274px;
  right: 12px;
  left: auto;
  bottom: auto;
  transform: translateX(12px) scale(0.985);
  opacity: 0;
  pointer-events: none;
  background: var(--stone-base);
  border: 1px solid var(--brass-dim);
  border-top: 2px solid var(--soul-cyan);
  border-bottom: 2px solid var(--stone-ledge);
  border-radius: var(--radius-outer);
  padding: 10px 11px;
  width: 264px;
  max-height: calc(100vh - 392px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 5px 0 var(--stone-ledge);
  transition: opacity 180ms var(--ease-ui), transform 220ms var(--ease-ui), padding 160ms var(--ease-ui);
  z-index: 14;
}

.morph-preview.visible {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.morph-preview[data-variant="gold"]    { border-top-color: #f2c852; border-color: #7d6226; }
.morph-preview[data-variant="crimson"] { border-top-color: #e05246; border-color: #6b2d28; }
.morph-preview[data-variant="frost"]   { border-top-color: #56d6f5; border-color: #295e6e; }
.morph-preview[data-variant="venom"]   { border-top-color: #7ce052; border-color: #365e28; }

.morph-top {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.morph-preview .pixel-art.large {
  width: 44px;
  height: 44px;
}

.morph-meta {
  flex: 1;
  min-width: 0;
}

.slot-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--soul-cyan);
  letter-spacing: 0.04em;
}

.morph-meta strong {
  display: block;
  font-size: 13px;
  color: var(--ink-main);
  margin-top: 1px;
  line-height: 1.3;
}

.morph-meta p {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.42;
}

.morph-skill-diff {
  display: block;
  color: var(--ink-main);
  font-weight: 600;
  margin-bottom: 2px;
}

.morph-skill-diff .skill-arrow {
  color: var(--brass);
  margin: 0 3px;
}

.morph-skill-desc {
  display: block;
  color: var(--ink-muted);
}

.morph-deltas {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 5px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.delta {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-inner);
  background: var(--stone-deep);
  border: 1px solid #262b38;
}

.delta.up { color: #5fd68a; border-color: #2b543b; }
.delta.down { color: #ee7c78; border-color: #5e2a2c; }
.delta.neutral { color: var(--ink-muted); }

.delta.variant-badge {
  width: 100%;
  border-left-width: 2px;
  letter-spacing: 0.02em;
}

.delta.variant-gold    { color: #f6d574; border-color: #6d5522; border-left-color: #f2c852; background: #1a160c; }
.delta.variant-crimson { color: #f69c94; border-color: #632924; border-left-color: #e05246; background: #1c1211; }
.delta.variant-frost   { color: #9ceeff; border-color: #265969; border-left-color: #56d6f5; background: #10191e; }
.delta.variant-venom   { color: #b4f294; border-color: #325725; border-left-color: #7ce052; background: #121a10; }

.morph-cta {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #262b38;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--brass);
}

/* Combat-Aware Auto-Compact Mode (Ultra-Slim Peripheral Strip During Active Fighting) */
.morph-preview.combat-compact {
  padding: 7px 9px;
}

.morph-preview.combat-compact .morph-top {
  align-items: center;
  gap: 8px;
}

.morph-preview.combat-compact .pixel-art.large {
  width: 34px;
  height: 34px;
}

.morph-preview.combat-compact .morph-meta p {
  display: none;
}

.morph-preview.combat-compact .morph-deltas {
  margin-top: 5px;
  gap: 3px 4px;
}

.morph-preview.combat-compact .delta.neutral {
  display: none;
}

.morph-preview.combat-compact .morph-cta {
  margin-top: 6px;
  padding-top: 5px;
  font-size: 11px;
}
