body {
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.87);
  background-color: #000000;
}

#app {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#ui-root {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}

.app-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px;
  box-sizing: border-box;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  overflow-y: auto;
}

.app-overlay > * {
  flex: 0 0 auto;
}

.village-view__card,
.mission-complete__card {
  max-width: 520px;
  width: 100%;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  padding: 32px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #e2e8f0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.village-view__eyebrow,
.mission-complete__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  margin: 0 0 8px;
  color: rgba(226, 232, 240, 0.75);
}

.village-view__card h1,
.mission-complete__card h1 {
  margin: 0 0 12px;
  font-size: 28px;
}

.village-view__card p,
.mission-complete__card p {
  margin: 0 0 16px;
  font-size: 15px;
  color: rgba(226, 232, 240, 0.86);
}

.village-view__mission {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 16px;
  margin-top: 12px;
}

.village-view__mission h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.village-view__mission ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.village-view__mission li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(8, 145, 178, 0.12);
  font-size: 14px;
}

.village-view__mission li span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(226, 232, 240, 0.7);
}

.village-view__actions {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.village-view__actions button,
.mission-complete__card button {
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.3);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease;
  pointer-events: auto;
}

.village-view__actions button:hover,
.mission-complete__card button:hover {
  background: #172554;
  border-color: rgba(248, 250, 252, 0.6);
}

.mission-complete__section {
  margin: 18px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 16px;
}

.mission-complete__section h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.mission-complete__section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mission-complete__section li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.14);
  font-size: 14px;
}

.mission-complete__muted {
  margin: 0;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.7);
}

.mission-complete__upgrade {
  margin: 12px 0 0;
  font-size: 13px;
  color: #bef264;
}

.village-hub {
  max-width: 980px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.village-hub__callout {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.92), rgba(8, 47, 73, 0.88));
  border: 1px solid rgba(190, 242, 100, 0.2);
}

.village-hub__callout-eyebrow,
.village-hub__npc-role {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.68);
}

.village-hub__callout h2,
.village-hub__section-heading h2,
.village-hub__mission-card h3,
.village-hub__npc-card h3 {
  margin: 0 0 8px;
}

.village-hub__callout p,
.village-hub__mission-card p,
.village-hub__npc-card p,
.village-hub__healing-copy {
  margin: 0;
}

.village-hub__section {
  padding: 18px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.village-hub__section--compact {
  flex: 1;
}

.village-hub__section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.village-hub__section-heading span {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(191, 219, 254, 0.75);
}

.village-hub__mission-grid,
.village-hub__npc-grid,
.village-hub__stockpile,
.village-hub__upgrade-grid {
  display: grid;
  gap: 12px;
}

.village-hub__mission-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.village-hub__mission-card,
.village-hub__npc-card,
.village-hub__stockpile-item,
.village-hub__upgrade-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  flex-direction: column;
}

.village-hub__upgrade-card button {
  margin-top: auto;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.village-hub__mission-card.is-locked {
  opacity: 0.7;
}

.village-hub__mission-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.village-hub__mission-topline strong {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfdbfe;
}

.village-hub__split {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.village-hub__section--compact button + button {
  margin-left: 10px;
}

.village-hub__section--compact button {
  margin-top: 16px;
}

.village-hub__stockpile {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.village-hub__upgrade-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.village-hub__stockpile-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.village-hub__upgrade-card.is-restored {
  border-color: rgba(190, 242, 100, 0.45);
  box-shadow: inset 0 0 0 1px rgba(190, 242, 100, 0.22);
}

.village-hub__upgrade-costs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 14px 0;
}

.village-hub__upgrade-costs div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.village-hub__upgrade-costs dt,
.village-hub__upgrade-costs dd {
  margin: 0;
  font-size: 13px;
}

.village-hub button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .app-overlay {
    padding: 16px;
  }

  .village-view__card,
  .mission-complete__card {
    padding: 22px;
  }

  .village-hub__callout,
  .village-hub__split {
    flex-direction: column;
  }

  .village-hub__section--compact button + button {
    margin-left: 0;
  }

  .village-hub__section--compact button {
    width: 100%;
  }
}

.ui-shell {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 16px;
  box-sizing: border-box;
}

.ui-shell__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  pointer-events: none;
}

.ui-shell__top-left,
.ui-shell__top-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.ui-shell__top-right {
  align-items: flex-end;
}

.mission-panel {
  width: 100%;
  max-width: 300px;
  background: rgba(8, 12, 18, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 16px;
  box-sizing: border-box;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #e2e8f0;
  pointer-events: auto;
}

.mission-panel__header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.mission-panel__header h2 {
  margin: 0;
  font-size: 18px;
}

.mission-panel__header p {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.78);
}

.mission-panel__status {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.mission-panel__status.is-complete {
  background: rgba(163, 230, 53, 0.18);
  color: #bef264;
}

.mission-panel__section {
  margin-top: 14px;
}

.mission-panel__section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.mission-panel__objectives,
.mission-panel__rewards,
.mission-panel__updates {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mission-panel__objectives li,
.mission-panel__rewards li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.45);
}

.mission-panel__objectives li.is-complete {
  color: #bef264;
  background: rgba(101, 163, 13, 0.15);
}

.mission-panel__updates li {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.82);
  padding-left: 10px;
  position: relative;
}

.mission-panel__updates li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: rgba(148, 163, 184, 0.7);
}

.mission-panel__empty {
  margin: 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.72);
}

.ui-shell__bottom {
  position: absolute;
  bottom: 16px;
  left: 0;
  width: 100%;
  height: 440px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
}

.turn-queue-panel {
  width: 220px;
  background: rgba(6, 9, 12, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #f1f5f9;
  pointer-events: auto;
}

.turn-queue-panel__header {
  margin-bottom: 12px;
}

.turn-queue-panel__header h2 {
  margin: 0;
  font-size: 18px;
}

.turn-queue-panel__hint {
  display: block;
  font-size: 12px;
  color: rgba(241, 245, 249, 0.7);
}

.turn-queue-panel__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.turn-queue-panel__item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  border-radius: 8px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid transparent;
}

.turn-queue-panel__item.is-active {
  border-color: #f4d35e;
  background: rgba(244, 211, 94, 0.1);
}

.queue-item__order {
  font-weight: bold;
  font-size: 14px;
  color: rgba(241, 245, 249, 0.7);
  text-align: center;
  line-height: 32px;
}

.queue-item__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-item__meta {
  display: flex;
  gap: 8px;
  align-items: center;
}

.queue-item__portrait {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(248, 250, 252, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.queue-item__name {
  font-size: 14px;
  font-weight: 600;
}

.queue-item__tags {
  font-size: 11px;
  color: rgba(241, 245, 249, 0.7);
  display: flex;
  gap: 6px;
}

.queue-item__hp {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.queue-item__hp-bar {
  width: 100%;
  height: 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.4);
  overflow: hidden;
}

.queue-item__hp-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
}

.queue-item__hp-label {
  font-size: 11px;
  color: rgba(241, 245, 249, 0.8);
}

.turn-queue-panel__controls {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.turn-queue-panel__advance {
  background: #f97316;
  border: none;
  color: #080b11;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.status-chits {
  display: flex;
  gap: 4px;
}

.status-chit {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #05070a;
}

.combat-log-panel {
  width: 220px;
  max-height: 220px;
  overflow-y: auto;
  background: rgba(8, 12, 18, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: #e2e8f0;
  pointer-events: auto;
}

.combat-log-panel h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.combat-log__empty {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.7);
  margin: 0;
}

.combat-log__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow: hidden;
}

.combat-log__item {
  font-size: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
  color: rgba(226, 232, 240, 0.9);
}

.combat-log__item--ants {
  color: #fca5a5;
}

.combat-log__item--worms {
  color: #bef264;
}

.combat-log__bullet {
  font-size: 10px;
  color: rgba(148, 163, 184, 0.6);
}

.status--poison {
  background: #a3e635;
}

.status--slow {
  background: #67e8f9;
}

.status--guard {
  background: #fcd34d;
}

.status--constricted {
  background: #a78bfa;
}

.status--acid-vulnerable {
  background: #fb7185;
}

.ability-bar {
  width: min(760px, 90%);
  max-height: 280px;
  overflow-y: auto;
  background: rgba(8, 12, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  box-sizing: border-box;
  color: #f8fafc;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  pointer-events: auto;
}

.ability-bar--inactive {
  text-align: center;
}

.ability-bar__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.ability-bar__header h2 {
  margin: 0;
  font-size: 18px;
}

.ability-bar__subhead {
  margin: 4px 0 0;
  font-size: 13px;
  color: rgba(248, 250, 252, 0.7);
}

.ability-bar__lock-hint {
  margin: 0;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.85);
}

.ability-bar__list {
  margin: 16px 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ability-card {
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(248, 250, 252, 0.15);
  border-radius: 10px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.6);
  color: inherit;
  cursor: pointer;
}

.ability-card.is-active {
  border-color: #f97316;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

.ability-card.is-locked {
  cursor: not-allowed;
  opacity: 0.6;
}

.ability-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(248, 250, 252, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.ability-card__body {
  flex: 1;
}

.ability-card__name {
  font-size: 14px;
  font-weight: 600;
}

.ability-card__meta {
  font-size: 11px;
  color: rgba(248, 250, 252, 0.7);
  display: flex;
  gap: 8px;
}

.ability-card__lock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.ability-card__lock button {
  font-size: 11px;
  background: transparent;
  border: 1px solid rgba(248, 250, 252, 0.5);
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  padding: 2px 6px;
}

.ability-bar__details {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid rgba(248, 250, 252, 0.08);
}

.ability-bar__details h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.ability-bar__description {
  margin: 0 0 8px;
  font-size: 13px;
  color: rgba(248, 250, 252, 0.85);
}

.ability-bar__effects {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.8);
}

.ability-bar__preview {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ability-preview__column {
  flex: 1;
  min-width: 160px;
  font-size: 12px;
}

.ability-preview__column strong {
  display: block;
  margin-bottom: 4px;
  color: #e2e8f0;
}

.ability-bar__actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.ability-bar__actions button {
  background: #f97316;
  border: none;
  color: #05070a;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}

.interaction-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(248, 250, 252, 0.1);
}

.interaction-panel--complete {
  color: #bef264;
}

.interaction-panel h3 {
  margin: 0;
  font-size: 16px;
}

.interaction-panel p {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.72);
}

.interaction-panel__list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.interaction-panel__button {
  min-width: 180px;
  border: 1px solid rgba(96, 165, 250, 0.25);
  background: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
}

.interaction-panel__button strong {
  font-size: 14px;
}

.interaction-panel__button span {
  font-size: 11px;
  color: rgba(191, 219, 254, 0.82);
}

@media (max-width: 1100px) {
  .ui-shell__top {
    flex-wrap: wrap;
  }

  .ui-shell__top-left,
  .ui-shell__top-right {
    width: 100%;
  }

  .ui-shell__top-right {
    align-items: stretch;
  }

  .mission-panel,
  .turn-queue-panel,
  .combat-log-panel {
    width: 100%;
    max-width: 360px;
  }
}

.movement-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(248, 250, 252, 0.1);
}

.movement-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.movement-panel__header h3 {
  margin: 0 0 4px;
}

.movement-panel__header p {
  margin: 0;
  color: rgba(248, 250, 252, 0.7);
  font-size: 13px;
}

.movement-panel__modes {
  display: flex;
  gap: 8px;
}

.movement-panel__modes button,
.movement-tile {
  border: 1px solid rgba(248, 250, 252, 0.15);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  color: inherit;
}

.movement-panel__modes button {
  padding: 8px 12px;
}

.movement-panel__modes .is-active,
.movement-tile.is-selected {
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.movement-panel__selection {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(248, 250, 252, 0.12);
}

.movement-panel__selection span,
.movement-panel__selection small {
  color: rgba(248, 250, 252, 0.75);
}

.movement-panel__tiles {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.movement-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  text-align: left;
}

.movement-tile span,
.movement-tile small {
  color: rgba(248, 250, 252, 0.72);
}

.ability-bar__warning {
  margin: 8px 0 0;
  font-size: 12px;
  color: #fbbf24;
}

.ability-targets {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(248, 250, 252, 0.08);
  font-size: 12px;
}

.ability-targets strong {
  display: block;
  margin-bottom: 6px;
  color: rgba(248, 250, 252, 0.9);
}

.ability-targets__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ability-targets__option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(248, 250, 252, 0.15);
  background: rgba(10, 15, 25, 0.6);
  cursor: pointer;
}

.ability-targets__option input {
  accent-color: #f97316;
}

.ability-targets__option.is-selected {
  border-color: #f97316;
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.3);
}

.ability-targets__empty {
  margin: 8px 0 0;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.6);
}
