/* Nusa Island Stage 21: vitals, damage feedback, quiet fade, danger note. Loaded after stage20.css. */

/* ---------- Vitals (stacked above the hunger / thirst bars inside .needs) ---------- */
#ui .vital { display: flex; flex-direction: column; gap: 2px; transition: opacity .7s ease-out; }
#ui .vital[hidden] { display: none; }
#ui .vital.is-away { opacity: 0; }
#ui .need--hp .need-fill { background: #E0958A; }
#ui .need--hp.is-low { color: #F0A89E; }
#ui .need--hp.is-low .need-fill { background: #E0958A; }
#ui .vital-tag {
  align-self: flex-start;
  margin-left: 20px;
  font-family: var(--f-label);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #FFC2B8;
  text-shadow: var(--hud-shadow);
  animation: need-pulse 2.2s ease-in-out infinite;
}
#ui .vital-tag[hidden] { display: none; }

/* the hint line sits centred just above the hotbar; lift it clear of the taller stack at the hotbar's left */
#ui .hud.has-vitals .hint { bottom: calc(var(--hb-top) + 70px); }

/* ---------- Damage feedback ---------- */
#ui .hurt-vig, #ui .low-vig, #ui .hurt-arc { position: fixed; pointer-events: none; z-index: 3; }
#ui .hurt-vig {
  inset: 0;
  opacity: 0;
  background: radial-gradient(ellipse closest-side at 50% 50%, rgba(120, 28, 22, 0) 50%, rgba(150, 34, 26, .55) 82%, rgba(120, 26, 20, .95) 100%);
}
#ui .low-vig {
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(ellipse closest-side at 50% 50%, rgba(54, 56, 60, 0) 45%, rgba(54, 56, 60, .4) 80%, rgba(22, 18, 16, .75) 100%),
    radial-gradient(ellipse closest-side at 50% 50%, rgba(140, 30, 24, 0) 75%, rgba(150, 32, 24, .45) 100%);
  transition: opacity .5s linear;
}
#ui .hurt-arc {
  left: 50%; top: 20px;
  width: 150px; height: 54px;
  opacity: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse closest-side at 50% 50%, rgba(176, 44, 34, .85) 0%, rgba(176, 44, 34, .4) 55%, rgba(176, 44, 34, 0) 100%);
}

/* ---------- Quiet fade (above the HUD / bag / map, below the menu) ---------- */
#ui .fade21 {
  position: fixed;
  inset: 0;
  z-index: 36;
  background: #0B0907;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition-property: opacity;
  transition-timing-function: ease-in-out;
}
#ui .fade21.is-on { opacity: 1; }
#ui .fade21-txt { padding: 0 24px; opacity: 0; transition: opacity .9s ease-out; }
#ui .fade21.is-on.has-text .fade21-txt { opacity: 1; transition-delay: .5s; }
#ui .fade21-line {
  margin: 0;
  font-family: var(--f-label);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--hud);
}
#ui .fade21-sub {
  margin: 10px 0 0;
  font-family: var(--f-body);
  font-style: italic;
  font-size: 15px;
  color: rgba(244, 239, 227, .62);
}
#ui .fade21-sub:empty { display: none; }

/* ---------- Touch torch (touch.js adds .tc-torch; touch.css is loaded earlier) ---------- */
.tc-torch { width: 48px; height: 48px; right: calc(var(--sr) + 14px); bottom: calc(var(--sb) + 158px); font-size: 11px; display: none; }
.touch-layer.has-torch .tc-torch { display: flex; }
.touch-layer.is-examining .tc-torch { display: none; }
.tc-torch.is-lit { background: rgba(227, 176, 94, .62); color: #1B0E06; text-shadow: none; box-shadow: inset 0 0 0 2px rgba(27, 14, 6, .45); }

/* ---------- Settings note ---------- */
#ui .set-note {
  margin: 6px 0 0;
  font-family: var(--f-body);
  font-size: 13px;
  line-height: 1.3;
  opacity: .72;
}

html.is-touch #ui .vital-tag { font-size: 10px; margin-left: 20px; }
@media (max-height: 500px) {
  #ui .fade21-line { font-size: 20px; }
  #ui .fade21-sub { font-size: 13px; margin-top: 6px; }
  #ui .set-note { font-size: 12px; margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  #ui .vital-tag { animation: none; }
  #ui .vital { transition: none; }
}

/* ---------- Stage 21b: the touch 'Open map' button on the held map's corner (placed by touch.js) ---------- */
.tc-mapx { width: 88px; height: 44px; left: 0; top: 0; right: auto; bottom: auto; font-size: 14px; font-weight: 700; display: none; opacity: 1; transition: opacity .05s linear; }
.tc-mapx .tc-lbl { font-size: 14px; font-weight: 700; }
.tc-mapx.is-idle { opacity: .18; transition: opacity .4s ease; }
@media (prefers-reduced-motion: reduce) { .tc-mapx, .tc-mapx.is-idle { transition: none; } }
.touch-layer.has-mapx .tc-mapx { display: flex; }
