.perk-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
  margin: 10px 0 4px;
  color: rgba(181, 221, 232, 0.58);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.perk-summary__item {
  padding: 5px 8px;
  border: 1px solid rgba(130, 229, 255, 0.18);
  border-radius: 999px;
  background: rgba(8, 26, 36, 0.76);
  color: #d9f8ff;
  letter-spacing: 0.03em;
}

.perk-summary__item--offense { border-color: rgba(255, 114, 134, 0.32); }
.perk-summary__item--control { border-color: rgba(124, 196, 255, 0.34); }
.perk-summary__item--defense { border-color: rgba(128, 255, 194, 0.32); }
.perk-summary__item--economy { border-color: rgba(255, 213, 105, 0.34); }

.perk-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding:
    max(18px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  background: rgba(1, 7, 12, 0.88);
  backdrop-filter: blur(12px);
}

.perk-overlay[hidden] {
  display: none;
}

.perk-panel {
  width: min(760px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(116, 225, 255, 0.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(69, 184, 219, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(8, 24, 34, 0.98), rgba(3, 11, 17, 0.99));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58), inset 0 0 50px rgba(93, 221, 255, 0.03);
}

.perk-panel__eyebrow {
  color: #72e8ff;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.perk-panel h2 {
  margin: 7px 0 6px;
  color: #f1fcff;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.perk-panel > p {
  margin: 0 0 18px;
  color: rgba(205, 232, 239, 0.65);
  font-size: 0.86rem;
}

.perk-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.perk-choice {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(137, 222, 244, 0.2);
  border-radius: 18px;
  background: rgba(11, 32, 43, 0.88);
  color: #eafcff;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.perk-choice:hover,
.perk-choice:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(113, 231, 255, 0.58);
  background: rgba(15, 44, 58, 0.96);
  outline: none;
}

.perk-choice--offense { box-shadow: inset 0 3px 0 rgba(255, 92, 126, 0.62); }
.perk-choice--control { box-shadow: inset 0 3px 0 rgba(100, 182, 255, 0.64); }
.perk-choice--defense { box-shadow: inset 0 3px 0 rgba(102, 243, 177, 0.64); }
.perk-choice--economy { box-shadow: inset 0 3px 0 rgba(255, 205, 92, 0.66); }

.perk-choice__category {
  color: rgba(187, 229, 240, 0.58);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.perk-choice__name {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.perk-choice__description {
  flex: 1;
  color: rgba(220, 239, 244, 0.74);
  font-size: 0.78rem;
  line-height: 1.45;
}

.perk-choice__stack {
  color: #8ceaff;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.app-shell[data-upgrading="true"] .game-frame {
  filter: saturate(0.74) brightness(0.74);
}

@media (max-width: 720px) {
  .perk-summary {
    justify-content: center;
    margin-top: 7px;
  }

  .perk-summary__item {
    padding: 4px 7px;
    font-size: 0.56rem;
  }

  .perk-panel {
    max-height: 92vh;
    padding: 17px 14px;
    border-radius: 20px;
  }

  .perk-panel > p {
    margin-bottom: 12px;
  }

  .perk-choices {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .perk-choice {
    min-height: 104px;
    gap: 5px;
    padding: 12px 13px;
  }

  .perk-choice__description {
    flex: initial;
  }
}

@media (prefers-reduced-motion: reduce) {
  .perk-choice {
    transition: none;
  }
}
