/* AGENT_TARGET: kingdom-festival-finale-styles — festival finale hub */

.kingdom-festival-modal {
  position: fixed;
  inset: 0;
  z-index: 10090;
  display: grid;
  place-items: center;
  padding: 18px;
}

.kingdom-festival-modal[hidden] {
  display: none;
}

.festival-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 18, 45, 0.56);
  backdrop-filter: blur(4px);
}

.festival-shell {
  position: relative;
  width: min(1120px, calc(100vw - 28px));
  max-height: min(90vh, 850px);
  overflow: auto;
  border: 3px solid #e9b75c;
  border-radius: 16px;
  background: #fff8ef;
  color: #3e2a4c;
  box-shadow: 0 22px 64px rgba(30, 20, 58, 0.36);
}

.festival-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid rgba(62, 42, 76, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #7d2a68;
  font: 900 26px/1 Arial, sans-serif;
  cursor: pointer;
}

.festival-header {
  padding: 22px 72px 14px 24px;
  border-bottom: 1px solid rgba(62, 42, 76, 0.12);
}

.festival-header span {
  display: block;
  color: #9b5b12;
  font:
    900 12px/1.2 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.festival-header h2 {
  margin: 4px 0;
  color: #3e2a4c;
  font:
    900 25px/1.08 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.festival-header p {
  margin: 0;
  color: #645172;
  font: 800 13px/1.35 "Trebuchet MS", Arial, sans-serif;
}

.festival-scene {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border-bottom: 1px solid rgba(62, 42, 76, 0.12);
}

.festival-scene img {
  display: block;
  width: 100%;
  min-height: 310px;
  object-fit: cover;
}

.festival-finale-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  width: min(330px, calc(100% - 36px));
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #3e2a4c;
  box-shadow: 0 12px 28px rgba(38, 22, 56, 0.24);
}

.festival-finale-panel strong,
.festival-finale-panel span {
  display: block;
}

.festival-finale-panel strong {
  color: #7d2a68;
  font:
    900 18px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.festival-finale-panel span {
  color: #53455f;
  font: 800 13px/1.25 "Trebuchet MS", Arial, sans-serif;
}

.festival-finale-panel button,
.festival-prep-action {
  min-height: 46px;
  border: 2px solid #d9941e;
  border-radius: 8px;
  background: #fff0b8;
  color: #3e2a4c;
  font:
    900 13px/1.1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
}

.festival-finale-panel button:disabled,
.festival-prep-action:disabled {
  opacity: 0.62;
  cursor: default;
}

.festival-prep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px;
}

.festival-prep-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 2px solid rgba(62, 42, 76, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #3e2a4c;
}

.festival-prep-card.ready {
  border-color: rgba(217, 148, 30, 0.56);
}

.festival-prep-card.gathered {
  background: #fff8df;
}

.festival-prep-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.festival-prep-icon {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  border: 2px solid rgba(125, 42, 104, 0.16);
  border-radius: 8px;
  background: #f9efff;
  color: #7d2a68;
  font: 900 12px/1 "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  text-transform: uppercase;
}

.festival-prep-top small {
  display: block;
  color: #9b5b12;
  font:
    900 11px/1.2 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.festival-prep-card h3 {
  margin: 2px 0 0;
  color: #3e2a4c;
  font:
    900 15px/1.12 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
}

.festival-prep-card p {
  margin: 0;
  min-height: 54px;
  color: #645172;
  font: 800 12px/1.28 "Trebuchet MS", Arial, sans-serif;
}

@media (max-width: 900px) {
  .festival-prep-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .kingdom-festival-modal {
    padding: 10px;
  }
  .festival-shell {
    width: calc(100vw - 16px);
    max-height: 92vh;
    border-radius: 10px;
  }
  .festival-header {
    padding: 18px 62px 12px 16px;
  }
  .festival-header h2 {
    font-size: 21px;
  }
  .festival-scene,
  .festival-scene img {
    min-height: 255px;
  }
  .festival-finale-panel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    padding: 10px;
  }
  .festival-prep-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .festival-prep-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .festival-prep-card p {
    min-height: 0;
  }
}
