/* Import after styles.css. Six HUD crops come from the approved master. */
.game-shell .vitals {
  display: contents !important;
  padding: 0 !important;
  background: none !important;
}
.game-shell .vitals .vital {
  z-index: 8;
  display: block;
  box-sizing: border-box;
  min-width: 0;
  padding: 0;
  background-position: center;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  color: #fff7e6;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px #061923;
}
.game-shell .vitals .hearts { background-image: url('../assets/art/hud/hearts-plaque-v1.png'); }
.game-shell .vitals .gold { background-image: url('../assets/art/hud/coin-plaque-v1.png'); }
.game-shell .vitals .vital:nth-child(3) { background-image: url('../assets/art/hud/wave-shield-v1.png'); }
/* Source crops contain sample numbers. Cover only that field for live values. */
.game-shell .vitals .vital:nth-child(-n+3)::before {
  content: '';
  position: absolute;
  left: 48%;
  top: 15%;
  width: 38%;
  height: 70%;
  border-radius: 2px;
  background: #172023;
}
.game-shell .vitals .vital:nth-child(3)::before { background: #092436; }
.game-shell .vitals .vital > span,
.game-shell .vitals .vital small { display: none; }
.game-shell .vitals .vital b {
  position: absolute;
  z-index: 1;
  left: 49%;
  top: 50%;
  width: 35%;
  transform: translateY(-50%);
  color: #fff6e9;
  font-size: calc(17px * var(--hud-scale, 1));
  font-weight: 800;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
.game-shell .vitals .vital:nth-child(3) b { font-size: calc(18px * var(--hud-scale, 1)); }
.game-shell .vitals .vital:nth-child(4) {
  position: fixed;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.game-shell #pause-button {
  z-index: 10;
  box-sizing: border-box;
  color: transparent;
  font-size: 0;
  background: url('../assets/art/hud/pause-medallion-v1.png') center / 35px 35px no-repeat;
  touch-action: manipulation;
}
.game-shell #pause-button[aria-label='계속하기']::after {
  content: '▶';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff3cb;
  font-size: 18px;
  text-shadow: 0 1px 3px #061923;
}
.game-shell #pause-button[aria-label='계속하기'] {
  border: 2px solid #d4a660;
  border-radius: 50%;
  background: radial-gradient(circle, #24475a, #0a2634 72%);
}
.game-shell .training-settings {
  z-index: 10;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  border: 0;
  background: none;
}
.game-shell .training-settings > summary {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #d5aa66;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #31586b, #0b2634 72%);
  box-shadow: inset 0 0 0 2px #694c30, 0 2px 5px #061923;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  list-style: none;
}
.game-shell .training-settings > summary::-webkit-details-marker { display: none; }
.game-shell .training-settings > summary::after {
  content: none !important;
  display: none;
}
.game-shell .training-settings > summary::before {
  content: '⚙';
  color: #f5d492;
  font-size: 24px;
  line-height: 1;
}
.game-shell .training-settings[open] .training-inner {
  position: fixed;
  z-index: 11;
  top: calc(100px * var(--hud-scale, 1));
  right: max(8px, env(safe-area-inset-right));
  width: min(320px, calc(100vw - 16px));
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.game-shell #hero-button {
  z-index: 8;
  box-sizing: border-box;
  padding: 0;
  background: url('../assets/art/hud/portrait-hp-v1.png') center / 100% 100% no-repeat;
  touch-action: manipulation;
}
.game-shell #hero-button::after {
  content: '';
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 5%;
  height: 8%;
  border-radius: 2px;
  background: #253724;
  pointer-events: none;
}
.game-shell #hero-button .ability-glyph,
.game-shell #hero-button .control-name,
.game-shell #hero-state { display: none; }
.game-shell #hero-hp {
  z-index: 9;
  min-width: 0;
  min-height: 0;
  border: 1px solid #b8a871;
  border-radius: 3px;
  accent-color: #77b946;
  pointer-events: none;
}

.game-shell #reinforce-button,
.game-shell #area-button,
.game-shell #start-button,
.game-shell #early-button {
  z-index: 8;
  box-sizing: border-box;
  padding: 0;
  border-radius: 50%;
  color: transparent;
  font-size: 0;
  background: url('../assets/art/hud/medallion-frame-v1.png') center / 100% 100% no-repeat;
  touch-action: manipulation;
}
.game-shell #area-button { background-image: url('../assets/art/ability-medallion-area-v1.png'); }
.game-shell #start-button,
.game-shell #early-button {
  background-image: radial-gradient(circle, #143951 0 48%, transparent 53%), url('../assets/art/hud/medallion-frame-v1.png');
}
.game-shell #start-button::after,
.game-shell #early-button::after {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 100%;
  bottom: auto;
  right: auto;
  width: max-content;
  min-width: 56px;
  height: 14px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  color: #fff3cb;
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
  white-space: nowrap;
  text-shadow: -1px -1px 0 #091b28, 1px -1px 0 #091b28,
    -1px 1px 0 #091b28, 1px 1px 0 #091b28;
}
.game-shell #start-button::after { content: '첫 웨이브'; }
.game-shell #early-button::after { content: '다음 웨이브'; }
.game-shell #start-button:disabled { pointer-events: none; }
.game-shell #early-button { z-index: 7; visibility: hidden; }
.game-shell #early-button:not(:disabled) { z-index: 9; visibility: visible; }
.game-shell #pause-button:disabled,
.game-shell #hero-button:disabled,
.game-shell #reinforce-button:disabled,
.game-shell #area-button:disabled,
.game-shell #start-button:disabled { opacity: 1; }
.game-shell #reinforce-button .ability-glyph,
.game-shell #area-button .ability-glyph,
.game-shell #reinforce-button small,
.game-shell #area-button small { display: none; }
.game-shell #reinforce-button > span:not(.ability-glyph),
.game-shell #area-button > span:not(.ability-glyph) {
  display: block;
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 100%;
  right: auto;
  bottom: auto;
  width: max-content;
  min-width: 56px;
  height: 14px;
  transform: translateX(-50%);
  color: #fff3cb;
  font-size: 11px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  white-space: nowrap;
  text-shadow: -1px -1px 0 #091b28, 1px -1px 0 #091b28,
    -1px 1px 0 #091b28, 1px 1px 0 #091b28;
}

/* Cooldown darkens only the inner disc; the gilded frame stays readable. */
.game-shell #hero-button[data-cooling='true']::before,
.game-shell #reinforce-button[data-cooling='true']::before,
.game-shell #area-button[data-cooling='true']::before {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 13%;
  border-radius: 50%;
  background: conic-gradient(from -90deg,
    rgba(4, 18, 28, .88) calc(var(--cooldown-progress, 0) * 1turn),
    transparent 0);
  -webkit-mask-image: radial-gradient(circle, #000 0 99%, transparent 100%);
  mask-image: radial-gradient(circle, #000 0 99%, transparent 100%);
  pointer-events: none;
}
.game-shell #reinforce-button[data-cooling='true'] small,
.game-shell #area-button[data-cooling='true'] small,
.game-shell #hero-button[data-cooling='true'] #hero-state {
  display: grid;
  place-items: center;
  position: absolute;
  z-index: 2;
  left: 12%;
  top: 50%;
  width: 76%;
  min-height: 24px;
  transform: translateY(-50%);
  border-radius: 12px;
  background: rgba(5, 25, 35, .78);
  color: #fff8dc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 1px 2px #061923;
  white-space: normal;
}
.game-shell #hero-button[data-cooling='true'] #hero-state { font-size: 10px; }

/* A narrow selection line sits over the sea without enlarging the battlefield. */
.game-shell .deck-context {
  z-index: 7;
  box-sizing: border-box;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
.game-shell .selection-stats {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 0;
  gap: 7px;
  padding: 0 7px !important;
  overflow: visible;
  border: 1px solid #e9b75e;
  border-radius: 6px;
  background: rgba(6, 35, 48, .92);
  white-space: nowrap;
}
.game-shell .selection-heading { flex: none; max-width: 25%; }
.game-shell .selection-heading strong,
.game-shell .selection-stats dt,
.game-shell .selection-stats dd {
  font-size: calc(10px * var(--hud-scale, 1));
  line-height: 1;
}
.game-shell .selection-stats dl { min-width: 0; gap: 7px; }
.game-shell .selection-stats dl > div { gap: 3px; }
.game-shell .selection-stats > button {
  display: grid;
  place-items: center;
  position: absolute;
  top: 50%;
  right: -44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  transform: translateY(-50%);
  border: 1px solid #d5aa66;
  border-radius: 50%;
  background: #092b34;
  color: #fff3cb;
  font-size: 20px;
}
.game-shell[data-hud='fold'] .selection-stats { padding-right: 44px !important; }
.game-shell[data-hud='fold'] .selection-stats > button { right: 0; }
.game-shell[data-hud='fold'] .build-confirm-row,
.game-shell[data-hud='fold'] .built-actions { bottom: 12px; right: 272px !important; }
