
/* Amorvia styles.css v9.4 (stabilized) */

/* Top bar card */
#topBar {
  display:flex; align-items:center; justify-content:space-between;
  gap:1rem; margin-bottom:1rem;
  padding:.5rem .75rem;
  border:1px solid #ddd;
  border-radius:.5rem;
  background:#fafafa;
}
#topBar h1 { margin:0; font-size:1.5rem; line-height:1.2; }
#topBar .row { display:flex; gap:.5rem; align-items:center; }

/* Scenario block under title */
#titleAndList {
  position:relative; z-index:3; margin-bottom:1rem; padding:.5rem .75rem;
  border:1px solid #ddd; border-radius:.5rem; background:#fff;
}
#titleAndList .row { margin-bottom:.5rem; }
#titleAndList .list { display:flex; flex-wrap:wrap; gap:.5rem; }

/* Tag / chip styling */
#titleAndList .list a,
#titleAndList .list button,
#titleAndList .list .tag,
#titleAndList .list .chip {
  display:inline-flex; align-items:center; gap:.25rem;
  padding:.3rem .65rem; border:1px solid rgba(0,0,0,.15);
  border-radius:999px; font-size:.85rem; line-height:1.2;
  text-decoration:none; background:rgba(255,255,255,.9);
  color:inherit; cursor:pointer;
}
#titleAndList .list a:hover,
#titleAndList .list button:hover { filter:brightness(0.97); }
#titleAndList .list a:focus-visible,
#titleAndList .list button:focus-visible { outline:2px solid #6ea8fe; outline-offset:2px; }

/* Stage layering */
.canvas { position: relative; }
.canvas .bg { position: absolute; inset: 0; z-index: 1; }
.canvas .character { position: absolute; bottom: 10px; z-index: 2; }

/* Dialog/HUD emphasis */
.panel.dialog .row h2 { font-size:1.25rem; }
#actBadge.badge { font-weight:600; }

/* High contrast */
:root[data-contrast="1"] body { background:#fff !important; color:#000 !important; }
:root[data-contrast="1"] a { color:#00f !important; text-decoration: underline; }
:root[data-contrast="1"] button, :root[data-contrast="1"] [role="button"] {
  background:#fff !important; color:#000 !important; border:2px solid #000 !important;
}
:root[data-contrast="1"] *:focus { outline:3px solid #ffbf00 !important; outline-offset:3px; }

/* Responsive */
@media (max-width: 900px) {
  #topBar { flex-direction:column; align-items:flex-start; gap:.5rem; }
}
/* Avoid clipping the HUD */
.card.stage,
.card.stage .panel.dialog,
#dialog {
  overflow: visible !important;
}

/* Make the dialog a column so HUD can sit below the text */
.card.stage .panel.dialog {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding-bottom: .75rem;              /* room at the bottom */
}

/* Act badge pop animation */
#actBadge.act-change {
  animation: act-badge-pop 240ms ease-out;
}

@keyframes act-badge-pop {
  0% {
    opacity: 0;
    transform: translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Act badge – Pill Dark Style (v9.8) */
#actBadge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 999px;
  background: rgba(8, 12, 24, 0.7);
  color: #fdfdfd;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  font-size: 0.8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}
/* HUD 9.8.6 – Act badge micro-polish */
.act-badge,
.scenario-act-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.92),
    rgba(30, 64, 175, 0.9)
  );
  color: #e5e7eb;
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.35),
    0 12px 26px rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(10px);
}
.act-badge .act-index,
.scenario-act-label .act-index {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  font-weight: 700;
}

/* Ensure HUD renders above any overlapping siblings */
#hud {
  position: relative;
  z-index: 2;
  margin-top: .25rem;
}

/* If a fixed height is set anywhere, release it */
.card.stage .panel.dialog,
#dialog {
  max-height: none !important;
  height: auto !important;
}

/* Amorvia UI v9.8.1 – card & layout polish */

.card {
  border-radius: 14px;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.02);
  background: transparent; /* umjesto #111827 */
}

/* glavna scena / stage kartica */
.card.stage {
  padding: 16px 18px 18px;
}

/* HUD karta (ako koristi .card.hud ili #hud unutar card) */
.card.hud,
#hudCard {
  border-radius: 12px;
  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.25);
}

/* Amorvia UI v9.8.1 – dialog readability */

.panel.dialog {
  line-height: 1.55;
  font-size: 0.97rem;
  max-width: 46rem;
  margin: 0 auto;
}

/* vanjski #dialog nek ostane full-width unutar kartice */
#dialog {
  line-height: 1.55;
  font-size: 0.97rem;
  max-width: none;
}

/* razmak između pojedinih “balona” teksta */
.dialog .line,
.dialog .utterance {
  margin-bottom: 0.65rem;
}

/* govornik malo jasniji, ali ne agresivan */
.speaker,
.speaker-label {
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.78rem;
  opacity: 0.75;
}

/* Amorvia UI v9.8.1 – sceneTitle subtle animation */

#sceneTitle {
  transition: opacity 140ms ease-out, transform 140ms ease-out;
}

#sceneTitle.scene-change {
  animation: scene-title-pop 200ms ease-out;
}

@keyframes scene-title-pop {
  0% {
    opacity: 0;
    transform: translateY(-3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Small screens: stack safely */
@media (max-width: 640px){
  #hud { margin-bottom: .5rem; }
}
/* Amorvia UI v9.8.2 – reading comfort & layout polish */

/* Blago zatamni pozadinu stranice da se stage odvoji od ruba */
body {
  background: #f4f5f8;
}

/* Ograniči širinu teksta i centriraj dialog na širokim ekranima */
@media (min-width: 1024px) {
  .card.stage .panel.dialog,
  #dialog {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Malo ugodniji line-height za dugačke tekstove */
#dialog p {
  line-height: 1.55;
}

/* Stage dobiva suptilan “card” efekt umjesto da pliva u praznom bijelom */
.card.stage {
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}
/* Amorvia UI v9.8.2 – choice affordance */

/* Glatke tranzicije za sve gumbe u dijalogu */
#dialog button,
#dialog [role="button"] {
  transition:
    background-color 140ms ease-out,
    transform 120ms ease-out,
    box-shadow 120ms ease-out;
}

/* Lagani hover efekt – gumb “ispliva” iz stranice */
#dialog button:hover,
#dialog [role="button"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Jasniji focus za tipkovnicu (a11y) */
#dialog button:focus-visible,
#dialog [role="button"]:focus-visible {
  outline: 2px solid #ffbf00;
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}
/* Amorvia UI v9.8.4 – micro animations & soft transitions */

/* Poštuj prefers-reduced-motion: ako korisnik ne želi animacije, sve gasimo. */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 1) Blagi fade-in za stage karticu pri učitavanju / promjeni scene */
@keyframes amor-stage-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card.stage {
  animation: amor-stage-fade-in 260ms ease-out;
}

/* 2) Tekst dijaloga lagano "dođe" nakon stage-a */
@keyframes amor-dialog-rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#dialog {
  animation: amor-dialog-rise 220ms ease-out;
}

/* 3) Suptilan life u likovima – vrlo nježan float efekt */
@keyframes amor-characters-breathe {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}

/* pokušavamo pogoditi generičke selektore za figure na sceni,
   a da ne diramo ostatak layouta */
.card.stage [class*="character"],
.card.stage .avatar,
.card.stage .sprite {
  animation: amor-characters-breathe 6s ease-in-out infinite;
}

/* 4) Mekši hover/transition za globalne linkove i sitne UI elemente */
a,
button,
[role="button"] {
  transition:
    color 140ms ease-out,
    background-color 140ms ease-out,
    border-color 140ms ease-out,
    box-shadow 140ms ease-out,
    transform 120ms ease-out;
}
/* HUD container glass + spacing */
.hud-bar,
.hud,
.hud-meters {
  backdrop-filter: blur(14px);
  background: radial-gradient(
      circle at top left,
      rgba(148, 163, 184, 0.20),
      transparent 55%
    ),
    rgba(15, 23, 42, 0.88);
  border-radius: 0.9rem;
  padding: 0.45rem 0.75rem;
  box-shadow:
    0 0 0 1px rgba(148, 163, 184, 0.35),
    0 18px 38px rgba(15, 23, 42, 0.7);
}

/* Meter chip – unified look */
.hud-meter {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.45);
}

/* Boje po tipu metra – prilagodi ako već imaš varijante */
.hud-meter--trust {
  border-color: rgba(52, 211, 153, 0.9);
}
.hud-meter--tension {
  border-color: rgba(248, 113, 113, 0.95);
}
.hud-meter--child {
  border-color: rgba(56, 189, 248, 0.95);
}
/* Choice buttons micro-interactions */
.choices-list button,
.choice-button,
.choice {
  transition:
    background-color 140ms ease-out,
    transform 120ms ease-out,
    box-shadow 120ms ease-out;
  border-radius: 0.9rem;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.45);
}

/* Hover/focus – blagi lift */
.choices-list button:hover,
.choices-list button:focus-visible,
.choice-button:hover,
.choice-button:focus-visible,
.choice:hover,
.choice:focus-visible {
  background-color: rgba(15, 23, 42, 0.96);
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(191, 219, 254, 0.9),
    0 14px 28px rgba(15, 23, 42, 0.75);
  outline: none;
}

/* HUD meters layout */
.hud-meters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

/* Respect prefers-reduced-motion – ugasi samo micro animacije na choicevima */
@media (prefers-reduced-motion: reduce) {
  .choices-list button,
  .choice-button,
  .choice {
    transition: none;
    transform: none !important;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.45);
  }
}
