/* Final UI overrides for the v35 choice-card and HUD pass. */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #efd26f;
  outline-offset: 2px;
}

.choice-panel > p { color: #e6c967; font-weight: 800; }
.choice-panel > h2 {
  color: #fff7dc;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 28px;
}

.upgrade-grid,
.upgrade-grid.four-options { grid-auto-rows: minmax(198px, 1fr); }

.upgrade-option {
  isolation: isolate;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100%;
  padding: 16px 16px 15px;
  border-width: 1px;
  background-color: rgba(16, 23, 18, .98);
}

.upgrade-option::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 4px;
  background: #aab9a8;
}

.upgrade-option[data-quality="strong"]::before { background: #4f9de8; }
.upgrade-option[data-quality="premium"]::before,
.upgrade-option[data-kind="evolution"]::before { background: #c77de5; }
.upgrade-option[data-quality="mythic"]::before { background: #e7b93d; }
.upgrade-option[data-kind="element"]::before { background: #78aef1; }
.upgrade-option[data-kind="relic"]::before { background: #68c6b1; }
.upgrade-option[data-kind="task"]::before { background: #75c891; }

.upgrade-option .card-quality {
  position: absolute;
  top: 18px;
  left: 70px;
  right: 70px;
  margin: 0;
  line-height: 1.25;
}

.upgrade-option strong {
  margin-bottom: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 18px;
}

.upgrade-option .card-detail {
  align-self: start;
  color: #d7dfd2;
  font-size: 12px;
  line-height: 1.55;
}

.upgrade-reroll::before { content: "↻ "; }
#enter-game::before,
#lobby-start::before,
#room-start::before { content: "▶ "; }
#multiplayer-game::before,
#lobby-multiplayer::before { content: "◉ "; }
#menu-settings::before,
#pause-settings::before { content: "⚙ "; }
#exit-game::before,
#pause-exit::before,
#room-leave::before { content: "↩ "; }
#room-create-open::before,
#room-create::before { content: "+ "; }
#room-ready::before { content: "✓ "; }
#lobby-leaderboards::before { content: "榜 "; }

.health-panel {
  padding: 12px 14px 10px;
  border: 1px solid rgba(233, 225, 189, .22);
  border-radius: 6px;
  background: rgba(8, 14, 10, .76);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .32);
}

#life-value { top: 12px; right: 14px; }
.health-heading { padding-right: 48px; }
.health-heading strong::before { content: "♥ "; color: #e76b60; }
#level-label::before { content: "✦ "; color: #c6df79; }

@media (max-width: 600px) {
  #level-up {
    align-items: start;
    padding: max(12px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
  }
  .choice-panel > p { margin: 0 0 2px; font-size: 10px; }
  .choice-panel > h2 { margin: 0 0 4px; font-size: 20px; line-height: 1.2; }
  .level-up-timer { min-height: 16px; margin: 0 0 6px; font-size: 11px; }
  .upgrade-grid,
  .upgrade-grid.four-options {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-rows: 146px !important;
    gap: 8px;
  }
  .upgrade-option,
  .upgrade-grid:not(.four-options) > .upgrade-option:last-child:nth-child(odd) {
    grid-column: auto !important;
    width: 100%;
    height: 146px !important;
    min-height: 146px !important;
    max-height: 146px !important;
    padding: 11px 62px 11px 58px;
  }
  .upgrade-option .card-icon {
    position: absolute;
    top: 13px;
    left: 10px;
    width: 38px;
    height: 38px;
    margin: 0;
    font-size: 16px !important;
  }
  .upgrade-option .card-quality { position: static; margin: 0 0 7px; font-size: 9px; }
  .upgrade-option strong { margin-bottom: 6px; font-size: 15px; line-height: 1.2; }
  .upgrade-option .card-detail {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.42;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
  .skill-star { top: 11px; right: 9px; width: 46px; height: 46px; }
  .skill-star::before { font-size: 44px; line-height: 46px; }
  .skill-star small { right: -2px; bottom: -9px; }
  .upgrade-reroll { min-height: 36px; margin-top: 8px; padding-block: 7px; }
  #life-value { top: 9px; right: 10px; }
  .health-heading { padding-right: 42px; }
}

@media (max-width: 360px) {
  .upgrade-grid,
  .upgrade-grid.four-options { grid-auto-rows: 140px !important; }
  .upgrade-option,
  .upgrade-grid:not(.four-options) > .upgrade-option:last-child:nth-child(odd) {
    height: 140px !important;
    min-height: 140px !important;
    max-height: 140px !important;
  }
}
