/* Extend the existing dark game panels; leave the bottom movement area free. */
#doom-guard-evolution[hidden], #doom-guard-evolution-open[hidden] { display: none !important; }
#doom-guard-evolution {
  position: fixed; top: calc(12px + var(--rd-safe-area-top, 0px)); left: 50%; transform: translateX(-50%);
  z-index: 110; box-sizing: border-box; width: min(740px, calc(100% - 32px - var(--rd-safe-area-left, 0px) - var(--rd-safe-area-right, 0px)));
  max-height: calc(100% - 172px - var(--rd-safe-area-top, 0px) - var(--rd-safe-area-bottom, 0px));
  display: flex; flex-direction: column; overflow: hidden; padding: 10px 14px;
  background: #151c20; color: #eee4cd; border: 1px solid #927447; border-radius: 8px;
  font: 13px/1.5 'Microsoft YaHei', system-ui, sans-serif; user-select: text;
}
#doom-guard-evolution header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; }
#doom-guard-evolution h2 { margin: 0; color: #edcd83; font-size: 17px; line-height: 1.4; text-wrap: balance; }
#doom-guard-evolution button, #doom-guard-evolution-open {
  min-height: 44px; padding: 7px 12px; border: 1px solid #8d784c; border-radius: 6px;
  background: #302c21; color: #f3e8ca; font: inherit; cursor: pointer; touch-action: manipulation;
}
#doom-guard-evolution button:hover, #doom-guard-evolution-open:hover { background: #45402d; }
#doom-guard-evolution :focus-visible, #doom-guard-evolution-open:focus-visible { outline: 2px solid #ffe2a0; outline-offset: -3px; }
#doom-guard-evolution-later { flex: 0 0 auto; }
.doom-evolution-pending { flex: 0 0 auto; margin: 2px 0 8px; color: #d8c899; font-size: 12px; font-variant-numeric: tabular-nums; }
.doom-evolution-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 8px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: #927447 #151c20; }
.doom-evolution-choices button { display: flex; flex-direction: column; gap: 4px; min-height: 64px; text-align: left; overflow-wrap: anywhere; }
.doom-evolution-choices strong, .doom-evolution-choices span { flex-shrink: 0; }
.doom-evolution-choices strong { color: #f6e6b9; font-size: 14px; }
.doom-evolution-choices span { color: #ded3b6; font-size: 12px; }
.doom-evolution-note { flex: 0 0 auto; margin: 8px 0 0; color: #c7bd9f; font-size: 11px; }
#doom-guard-evolution ::selection { background: #796336; color: #fff3d1; }
#doom-guard-evolution-open {
  position: fixed; z-index: 55; top: calc(58px + var(--rd-safe-area-top, 0px)); right: calc(14px + var(--rd-safe-area-right, 0px));
  font: 13px/1.4 'Microsoft YaHei', system-ui, sans-serif;
}
@media (min-width: 680px) and (max-height: 520px) {
  #doom-guard-evolution { padding: 7px 12px; }
  #doom-guard-evolution h2 { font-size: 16px; }
  .doom-evolution-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .doom-evolution-note { margin-top: 5px; }
}
