.pd-engine {
  color: #eaf4ff;
  font-family: inherit;
}

.pd-hero,
.pd-panel,
.pd-tower-panel {
  border: 1px solid rgba(116, 185, 255, .26);
  background: linear-gradient(135deg, rgba(6, 26, 53, .96), rgba(8, 52, 100, .9));
  box-shadow: 0 18px 45px rgba(2, 13, 31, .28);
  border-radius: 18px;
}

.pd-hero {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding: 22px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.pd-hero::after,
.pd-battlefield::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 78% 26%, rgba(15, 129, 255, .28), transparent 34%),
    linear-gradient(90deg, rgba(216, 183, 106, .12), transparent 35%);
}

.pd-hero span,
.pd-panel > span,
.pd-question-head span,
.pd-panel-title span {
  color: #d8b76a;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pd-hero h3,
.pd-panel h3 {
  margin: 6px 0;
  font-size: 28px;
  color: #fff;
}

.pd-hero p,
.pd-panel p,
.pd-tower-card small {
  margin: 0;
  color: rgba(234, 244, 255, .72);
  line-height: 1.7;
}

.pd-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(78px, 1fr));
  gap: 10px;
  min-width: 390px;
  position: relative;
  z-index: 1;
}

.pd-stats article,
.pd-rule-grid article,
.pd-result-grid article {
  border: 1px solid rgba(216, 183, 106, .28);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, .06);
}

.pd-stats span,
.pd-rule-grid span,
.pd-result-grid span {
  display: block;
  color: rgba(234, 244, 255, .68);
  font-size: 12px;
}

.pd-stats strong,
.pd-rule-grid strong,
.pd-result-grid strong {
  display: block;
  margin-top: 6px;
  color: #e6c46a;
  font-size: 24px;
}

.pd-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
}

.pd-panel {
  padding: 22px;
  margin-top: 16px;
}

.pd-intro {
  min-height: 420px;
  display: grid;
  align-content: center;
}

.pd-rule-grid,
.pd-result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.pd-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pd-primary,
.pd-secondary {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease, border-color .2s ease;
}

.pd-primary {
  background: linear-gradient(135deg, #d8b76a, #fff0aa);
  color: #061a35;
}

.pd-secondary {
  border: 1px solid rgba(216, 183, 106, .38);
  background: rgba(255, 255, 255, .08);
  color: #eaf4ff;
}

.pd-primary:hover,
.pd-secondary:hover,
.pd-tower-card:hover,
.pd-slot:hover,
.pd-options button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.pd-primary:disabled,
.pd-primary[disabled] {
  cursor: not-allowed;
  filter: grayscale(.8);
  opacity: .55;
}

.pd-battlefield {
  min-height: 360px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(116, 185, 255, .3);
  background:
    linear-gradient(rgba(6, 26, 53, .82), rgba(6, 26, 53, .86)),
    radial-gradient(circle at 16% 50%, rgba(0, 163, 255, .36), transparent 18%),
    radial-gradient(circle at 88% 42%, rgba(216, 183, 106, .18), transparent 22%),
    #061a35;
}

.pd-stars {
  position: absolute;
  inset: 0;
  opacity: .38;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 36px 36px;
}

.pd-path {
  position: absolute;
  left: 13%;
  right: 8%;
  top: 45%;
  height: 58px;
  transform: translateY(-50%);
  border: 1px solid rgba(216, 183, 106, .24);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(216, 183, 106, .13), rgba(14, 99, 199, .22));
  box-shadow: inset 0 0 25px rgba(14, 99, 199, .32);
}

.pd-base {
  position: absolute;
  left: 18px;
  top: 50%;
  z-index: 3;
  width: 110px;
  height: 110px;
  transform: translateY(-50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px solid #d8b76a;
  background:
    radial-gradient(circle at center, rgba(80, 210, 255, .85), rgba(14, 99, 199, .56) 48%, rgba(6, 26, 53, .92) 72%),
    conic-gradient(#d8b76a var(--hp), rgba(255, 255, 255, .12) 0);
  box-shadow: 0 0 42px rgba(21, 146, 255, .46);
}

.pd-base strong,
.pd-base span {
  grid-area: 1 / 1;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .55);
}

.pd-base span {
  margin-top: 42px;
  font-size: 12px;
}

.pd-slot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 4;
  width: 62px;
  height: 62px;
  transform: translate(-50%, -50%);
  border-radius: 16px;
  border: 1px solid rgba(216, 183, 106, .44);
  background: rgba(6, 26, 53, .72);
  color: #e6c46a;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.pd-slot.built {
  background: linear-gradient(135deg, rgba(11, 78, 162, .92), rgba(6, 26, 53, .92));
  box-shadow: 0 0 22px rgba(14, 99, 199, .45);
}

.pd-slot strong,
.pd-slot span {
  display: block;
  font-size: 12px;
}

.pd-enemy {
  position: absolute;
  right: var(--x);
  top: var(--y);
  z-index: 5;
  width: 30px;
  height: 30px;
  transform: translate(50%, -50%);
  border-radius: 45% 55% 50% 50%;
  background: linear-gradient(135deg, #ff7b55, #612016);
  box-shadow: 0 0 18px rgba(255, 112, 77, .38);
}

.pd-enemy.fast {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #8ef6ff, #1e72bb);
}

.pd-enemy.tank {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #d8b76a, #674112);
}

.pd-enemy.slowed {
  filter: saturate(.72) hue-rotate(145deg);
}

.pd-enemy i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
}

.pd-enemy i::before {
  content: "";
  display: block;
  width: var(--hp);
  height: 100%;
  border-radius: inherit;
  background: #70ffbf;
}

.pd-shot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 6;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e6c46a;
  box-shadow: 0 0 20px rgba(230, 196, 106, .82);
  animation: pd-pulse .28s ease-out forwards;
}

.pd-shot.splash {
  width: 42px;
  height: 42px;
  margin: -15px 0 0 -15px;
  background: rgba(255, 148, 76, .38);
}

.pd-shot.slow {
  background: #87ecff;
}

@keyframes pd-pulse {
  from { opacity: 1; transform: scale(.5); }
  to { opacity: 0; transform: scale(1.8); }
}

.pd-tower-panel {
  padding: 16px;
  align-self: start;
}

.pd-panel-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.pd-panel-title strong {
  color: #fff;
}

.pd-tower-list {
  display: grid;
  gap: 10px;
  max-height: 570px;
  overflow: auto;
}

.pd-tower-card {
  border: 1px solid rgba(116, 185, 255, .24);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, .06);
  color: #eaf4ff;
  text-align: left;
  cursor: pointer;
}

.pd-tower-card.active {
  border-color: #e6c46a;
  background: rgba(216, 183, 106, .14);
}

.pd-tower-card strong,
.pd-tower-card span,
.pd-tower-card small {
  display: block;
}

.pd-tower-card span {
  color: #e6c46a;
  margin: 4px 0;
  font-size: 12px;
}

.pd-question h3 {
  font-size: 21px;
}

.pd-question-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pd-question-head strong {
  color: #fff;
}

.pd-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.pd-options button {
  border: 1px solid rgba(116, 185, 255, .24);
  border-radius: 14px;
  padding: 13px;
  background: rgba(255, 255, 255, .07);
  color: #eaf4ff;
  text-align: left;
  cursor: pointer;
}

.pd-options button.selected {
  border-color: #e6c46a;
  background: rgba(216, 183, 106, .16);
}

.pd-options strong,
.pd-options span {
  display: block;
}

.pd-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
}

.pd-question.right .pd-feedback {
  color: #96ffc8;
}

.pd-question.wrong .pd-feedback {
  color: #ffd0be;
}

.pd-wave-result.passed {
  border-color: rgba(112, 255, 191, .4);
}

.pd-wave-result.failed {
  border-color: rgba(255, 112, 77, .45);
}

.pd-credit-note {
  margin-top: 18px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(216, 183, 106, .12);
  border: 1px solid rgba(216, 183, 106, .24);
}

@media (max-width: 920px) {
  .pd-hero {
    display: block;
  }

  .pd-stats,
  .pd-layout,
  .pd-rule-grid,
  .pd-result-grid,
  .pd-options {
    grid-template-columns: 1fr 1fr;
  }

  .pd-stats {
    min-width: 0;
    margin-top: 14px;
  }

  .pd-layout {
    display: flex;
    flex-direction: column;
  }

  .pd-tower-panel {
    order: -1;
  }

  .pd-tower-list {
    max-height: none;
  }
}

@media (max-width: 560px) {
  .pd-hero,
  .pd-panel,
  .pd-tower-panel {
    border-radius: 14px;
    padding: 14px;
  }

  .pd-hero h3,
  .pd-panel h3 {
    font-size: 22px;
  }

  .pd-stats,
  .pd-rule-grid,
  .pd-result-grid,
  .pd-options {
    grid-template-columns: 1fr;
  }

  .pd-battlefield {
    min-height: 300px;
  }

  .pd-base {
    width: 82px;
    height: 82px;
    left: 10px;
  }

  .pd-slot {
    width: 52px;
    height: 52px;
  }
}
