/* boss.css — the Warden fight overlay and its row on the levels page.
   Palette follows the title page (styles.css :root): ink and forest greens,
   ivory type, brass for every edge. Nothing here introduces a new colour, so a
   Warden reads as another room of the same house. */

.warden-row {
  margin: 0 0 1rem;
}

.warden-title {
  margin: 0 0 0.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--brass-light, #e4c577);
}

.warden-intro {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  color: var(--ivory-muted, #d3ccb9);
}

.warden-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px;
}

.warden-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 0.55rem;
  align-items: center;
  padding: 6px;
  border: 2px solid var(--brass-deep, #80602d);
  border-radius: 9px;
  background: rgba(24, 53, 45, 0.6);
  color: var(--ivory, #f3ead6);
  text-align: left;
  cursor: pointer;
  font: inherit;
  touch-action: manipulation;
}

.warden-card:not(:disabled):hover,
.warden-card:focus-visible {
  border-color: var(--brass-light, #e4c577);
  box-shadow: 0 0 10px rgba(228, 197, 119, 0.45);
  outline: none;
}

.warden-card:disabled {
  opacity: 0.4;
  filter: grayscale(0.6);
  cursor: not-allowed;
}

.warden-portrait {
  grid-row: 1 / span 3;
  width: 3rem;
  height: 3rem;
  border: 1px solid var(--brass-deep, #80602d);
  border-radius: 6px;
  background: #10211b;
  image-rendering: pixelated;
}

.warden-name {
  font-weight: 700;
  font-size: 0.85rem;
}

.warden-act,
.warden-crowns,
.warden-locked {
  font-size: 0.7rem;
  color: var(--ivory-muted, #d3ccb9);
}

.warden-crowns {
  color: var(--brass-light, #e4c577);
  letter-spacing: 0.1em;
}

.boss-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #091411;
}

/* The Warden's arena fills the screen behind the panel, dimmed so the orbs and
   the rule banner stay the brightest thing on screen. */
.boss-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--boss-arena, none);
  background-size: cover;
  background-position: center;
  image-rendering: pixelated;
}

.boss-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(6, 10, 24, 0.15), rgba(4, 7, 16, 0.82)),
    linear-gradient(180deg, rgba(12, 8, 28, 0.18), rgba(4, 7, 16, 0.3));
}

.boss-overlay > * {
  position: relative;
  z-index: 1;
}

.boss-frame,
.boss-result {
  width: min(40rem, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 1rem 1.1rem 1.2rem;
  border: 2px solid var(--brass-deep, #80602d);
  border-radius: 12px;
  background: linear-gradient(160deg, #14302a, #07120f);
  color: var(--ivory, #f3ead6);
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

.boss-frame[hidden],
.boss-result[hidden] {
  display: none;
}

.boss-act {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-light, #e4c577);
}

/* The boss dragon, drawn from a 3x3 pose sheet: background-size 300% makes each
   cell one frame, and the module steps background-position 0/50/100%. */
.boss-dragon {
  width: min(11rem, 40vw);
  aspect-ratio: 1;
  margin: 0.4rem auto 0;
  border: 2px solid var(--brass-deep, #80602d);
  border-radius: 8px;
  background-color: #0b0f14;
  background-repeat: no-repeat;
  background-size: 300% 300%;
  background-position: 0% 0%;
  image-rendering: pixelated;
  box-shadow: inset 0 0 24px rgba(9, 20, 17, 0.9);
}

.boss-name {
  margin: 0.4rem 0 0.2rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.boss-phase {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  color: var(--ivory-muted, #d3ccb9);
}

.boss-seals {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.seal {
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  border: 2px solid var(--brass-deep, #80602d);
  background: rgba(9, 20, 17, 0.7);
}

.seal--broken {
  border-color: var(--brass-light, #e4c577);
  background: radial-gradient(circle, var(--brass-light, #e4c577) 0%, var(--brass, #c49a48) 70%);
}

.boss-meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.boss-meter-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ivory-muted, #d3ccb9);
  white-space: nowrap;
}

.boss-clock {
  flex: 1;
  height: 0.5rem;
  border: 1px solid var(--brass-deep, #80602d);
  border-radius: 999px;
  background: rgba(9, 20, 17, 0.8);
  overflow: hidden;
}

#boss-clock-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--brass, #c49a48), var(--brass-light, #e4c577));
  transition: width 120ms linear;
}

#boss-clock-fill[data-empty="true"] {
  background: rgba(243, 234, 214, 0.2);
}

.boss-hearts {
  display: flex;
  justify-content: center;
  gap: 0.2rem;
  margin-bottom: 0.7rem;
  color: #b3262d;
  font-size: 1rem;
}

.boss-heart--empty {
  color: rgba(243, 234, 214, 0.22);
}

.boss-prompt {
  min-height: 2.2rem;
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ivory, #f3ead6);
}

.boss-hint {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  color: var(--brass-light, #e4c577);
}

.boss-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 0.8rem;
}

.boss-option,
.seal-orb {
  min-width: 44px;
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  border-radius: 9px;
  border: 2px solid var(--brass-deep, #80602d);
  background: #10211b;
  color: var(--ivory, #f3ead6);
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.boss-option:hover,
.seal-orb:hover {
  border-color: var(--brass-light, #e4c577);
  box-shadow: 0 0 8px rgba(228, 197, 119, 0.4);
}

.boss-option:focus-visible,
.seal-orb:focus-visible {
  outline: 3px solid var(--focus-ring, #fff0bd);
  outline-offset: 1px;
}

.boss-option--primary {
  border-color: var(--brass-light, #e4c577);
  background: rgba(128, 96, 45, 0.55);
}

.seal-orb {
  border-radius: 50%;
  min-width: 3.2rem;
  min-height: 3.2rem;
}

.seal-orb--locked {
  border-color: var(--brass-light, #e4c577);
  background: radial-gradient(circle, rgba(228, 197, 119, 0.55), rgba(128, 96, 45, 0.35));
}

.boss-leave {
  border: none;
  background: none;
  color: var(--ivory-muted, #d3ccb9);
  font: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}

.boss-crowns {
  margin: 0.3rem 0 0.7rem;
  font-size: 1.6rem;
  letter-spacing: 0.14em;
  color: var(--brass-light, #e4c577);
}

.boss-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

@media (prefers-reduced-motion: reduce) {
  #boss-clock-fill { transition: none; }
}
