* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #05060f;
  --bg-deep: #020208;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-border: rgba(255, 255, 255, 0.09);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --text: #e9ecf9;
  --text-dim: #8992ad;
  --cyan: #4fd8ff;
  --violet: #9b6bff;
  --gold: #ffcf6b;
  --success: #3ddc97;
  --danger: #ff5d7a;
  --radius: 14px;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* --- cosmic background --- */

.starfield {
  position: fixed;
  inset: -10% -10%;
  z-index: -2;
  background-image: radial-gradient(1.4px 1.4px at 10% 15%, #fff, transparent 60%),
    radial-gradient(1px 1px at 25% 60%, #fff, transparent 60%),
    radial-gradient(1.8px 1.8px at 40% 30%, #cfe6ff, transparent 60%),
    radial-gradient(1px 1px at 55% 80%, #fff, transparent 60%),
    radial-gradient(1.4px 1.4px at 70% 20%, #fff, transparent 60%),
    radial-gradient(1px 1px at 82% 55%, #cfe6ff, transparent 60%),
    radial-gradient(1.6px 1.6px at 92% 75%, #fff, transparent 60%),
    radial-gradient(1px 1px at 15% 90%, #fff, transparent 60%),
    radial-gradient(1.2px 1.2px at 48% 5%, #fff, transparent 60%),
    radial-gradient(1px 1px at 65% 45%, #fff, transparent 60%);
  background-repeat: repeat;
  background-size: 340px 340px;
  animation: drift 90s linear infinite;
  opacity: 0.75;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-160px, 120px, 0);
  }
}

.nebula {
  position: fixed;
  z-index: -3;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}

.nebula-a {
  width: 60vh;
  height: 60vh;
  top: -15vh;
  right: -15vh;
  background: radial-gradient(circle, var(--violet), transparent 70%);
}

.nebula-b {
  width: 50vh;
  height: 50vh;
  bottom: -10vh;
  left: -15vh;
  background: radial-gradient(circle, var(--cyan), transparent 70%);
}

/* --- layout --- */

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 16px calc(84px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--text-dim);
}

.brand-icon {
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan);
}

.credits {
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--gold);
  text-shadow: 0 0 10px rgba(255, 207, 107, 0.5);
}

h1 {
  font-size: 19px;
  margin: 4px 0 14px;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--text-dim);
  font-weight: 600;
}

.views {
  flex: 1;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- panels --- */

.panel {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
}

.panel-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
}

.field-row {
  display: flex;
  gap: 10px;
}

.field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 12px;
  color: var(--text-dim);
}

input,
select {
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  font-size: 15px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  width: 100%;
}

input::placeholder {
  color: var(--text-dim);
}

select {
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%238992ad'%3E%3Cpath d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%238992ad' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

select option {
  background-color: #0b0e1a;
  color: #e9ecf9;
}

.compensation-panel:empty {
  display: none;
}

.compensation-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.comp-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.comp-chip {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}

.comp-chip.active {
  background: rgba(255, 207, 107, 0.1);
  border-color: rgba(255, 207, 107, 0.4);
  color: var(--text);
}

.comp-chip.active b {
  color: var(--gold);
  font-weight: 700;
}

.comp-badge {
  color: var(--gold);
  font-weight: 700;
}

.btn-primary {
  margin-top: 4px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #04050c;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(155, 107, 255, 0.6);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* --- tasks --- */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
}

.task-item .title {
  flex: 1;
  font-size: 14.5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-item .meta {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

select.duration-select {
  width: auto;
  padding: 1px 18px 1px 6px;
  font-size: 11px;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
  background-size: 9px;
  background-position: right 6px center;
}

.task-item .actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.task-item button {
  border: none;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
}

.complete-btn {
  background: rgba(61, 220, 151, 0.18);
  color: var(--success);
  border: 1px solid rgba(61, 220, 151, 0.4);
}

.cancel-btn {
  background: rgba(255, 93, 122, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 93, 122, 0.4);
}

.empty {
  color: var(--text-dim);
  font-size: 13.5px;
  text-align: center;
  padding: 20px 0;
}

/* --- ship --- */

.ship-header {
  margin-bottom: 14px;
}

.ship-name {
  font-size: 17px;
  font-weight: 700;
}

.ship-badges {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}

.badge-accent {
  color: var(--cyan);
  border-color: rgba(79, 216, 255, 0.4);
  background: rgba(79, 216, 255, 0.1);
}

.ship-art-wrap {
  padding: 10px 0 16px;
  display: flex;
  justify-content: center;
}

.ship-svg {
  width: 100%;
  max-width: 260px;
  filter: drop-shadow(0 0 18px rgba(79, 216, 255, 0.35));
}

.reactor-block {
  margin-bottom: 16px;
}

.reactor-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.reactor-over {
  color: var(--danger);
  font-weight: 700;
}

.reactor-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.reactor-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 0.2s ease;
}

.reactor-bar-fill.over {
  background: linear-gradient(90deg, var(--danger), #ff8a5b);
}

.reactor-warning {
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
}

.stat-box .stat-icon {
  font-size: 18px;
}

.stat-box .stat-value {
  font-size: 17px;
  font-weight: 700;
}

.stat-box .stat-label {
  font-size: 11px;
  color: var(--text-dim);
}

.slot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.slot-card {
  padding: 14px 10px;
  border-radius: 12px;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
}

.slot-card .slot-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 6px;
}

.slot-card .slot-icon img {
  width: 24px;
  height: 24px;
  opacity: 0.92;
}

.slot-card .slot-type {
  font-size: 12.5px;
  text-transform: capitalize;
  color: var(--text-dim);
}

.slot-card.filled {
  border-color: rgba(79, 216, 255, 0.5);
  box-shadow: 0 0 16px -6px rgba(79, 216, 255, 0.6) inset;
}

.slot-card.filled .slot-type {
  color: var(--cyan);
}

.slot-status {
  font-size: 11px;
  margin-top: 4px;
  color: var(--text-dim);
}

/* --- battle (shared visuals reused by missions) --- */

.battle-arena {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  margin-bottom: 12px;
}

.battle-arena.hidden {
  display: none;
}

.battle-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.battle-side-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.battle-vs {
  align-self: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  padding-top: 24px;
  flex-shrink: 0;
}

.hp-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hp-icon {
  font-size: 12px;
  flex-shrink: 0;
  width: 16px;
}

.hp-bar {
  flex: 1;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.hp-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.shield-fill {
  background: linear-gradient(90deg, var(--cyan), #8be9ff);
}

.hull-fill {
  background: linear-gradient(90deg, var(--gold), #ff9f6b);
}

.hp-value {
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
  min-width: 34px;
  text-align: right;
}

.weapon-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.weapon-charge {
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
}

.weapon-charge.disabled {
  opacity: 0.4;
}

.weapon-code {
  font-size: 10px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 2px;
  white-space: normal;
  overflow-wrap: break-word;
}

.charge-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.charge-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width 0.3s ease;
}

.battle-round-indicator {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.battle-round-indicator.hidden {
  display: none;
}

.battle-log {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
}

.battle-log:empty {
  display: none;
}

.battle-log-line {
  font-size: 11.5px;
  color: var(--text-dim);
}

.battle-log-line.hit-a {
  color: var(--cyan);
}

.battle-log-line.hit-b {
  color: var(--danger);
}

.battle-result {
  padding: 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  text-align: center;
}

.battle-result.win {
  border-color: rgba(61, 220, 151, 0.5);
}

.battle-result.loss {
  border-color: rgba(255, 93, 122, 0.5);
}

.battle-result:empty {
  display: none;
  padding: 0;
  border: none;
}

.battle-outcome {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.battle-outcome.win {
  color: var(--success);
}

.battle-outcome.loss {
  color: var(--danger);
}

.battle-reward {
  color: var(--gold);
  font-size: 13.5px;
}

/* --- missions --- */

.mission-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.mission-card {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--panel-border);
}

.mission-card--completed {
  border-color: rgba(61, 220, 151, 0.4);
}

.mission-card--failed {
  border-color: rgba(255, 93, 122, 0.4);
  opacity: 0.85;
}

.mission-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.mission-difficulty--medium {
  color: var(--gold);
  border-color: rgba(255, 207, 107, 0.4);
}

.mission-difficulty--hard {
  color: var(--danger);
  border-color: rgba(255, 93, 122, 0.4);
}

.mission-timer {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
}

.mission-card-title {
  font-size: 15.5px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.mission-card-lore {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0 0 14px;
  padding-left: 10px;
  border-left: 2px solid var(--panel-border);
}

.mission-card-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mission-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mission-dots {
  display: flex;
  gap: 5px;
}

.mission-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--panel-border);
}

.mission-dot.done {
  background: var(--success);
  border-color: var(--success);
}

.mission-dot.current {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.mission-progress-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  white-space: nowrap;
}

.mission-attempt-btn {
  width: 100%;
}

.mission-status-banner {
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.mission-status-banner.done {
  color: var(--success);
  background: rgba(61, 220, 151, 0.08);
  border: 1px solid rgba(61, 220, 151, 0.35);
}

.mission-status-banner.failed {
  color: var(--danger);
  background: rgba(255, 93, 122, 0.08);
  border: 1px solid rgba(255, 93, 122, 0.35);
}

.mission-arena {
  flex-direction: column;
  align-items: stretch;
}

.mission-arena .battle-vs {
  padding-top: 0;
  align-self: center;
}

.mission-enemies {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

.mission-enemy {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
}

.achievement-banner {
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 207, 107, 0.08);
  border: 1px solid rgba(255, 207, 107, 0.4);
}

.achievement-banner-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}

.achievement-banner-lore {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* --- profile --- */

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: #04050c;
  margin: 0 auto 14px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-border);
  font-size: 14px;
}

.profile-row:last-child {
  border-bottom: none;
}

.profile-row .label {
  color: var(--text-dim);
}

.profile-row .value {
  font-weight: 600;
}

.icon-credit {
  margin-top: 16px;
  font-size: 10.5px;
  color: var(--text-dim);
  opacity: 0.6;
  text-align: center;
}

.icon-credit a {
  color: inherit;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.achievement-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid rgba(255, 207, 107, 0.35);
}

.achievement-card.negative {
  border-color: rgba(255, 93, 122, 0.35);
}

.achievement-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 4px;
}

.achievement-card.negative .achievement-card-title {
  color: var(--danger);
}

.achievement-card-lore {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* --- tabbar --- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(6, 7, 16, 0.85);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--panel-border);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  padding: 6px 0;
  cursor: pointer;
}

.tab-icon {
  font-size: 19px;
}

.tab.active {
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(79, 216, 255, 0.6);
}

/* --- shop --- */

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shop-category-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  margin: 0 0 8px;
}

.shop-category-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-subgroup-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  opacity: 0.7;
  margin: 12px 0 6px;
}

.shop-subgroup-title:first-of-type {
  margin-top: 0;
}

.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
}

.shop-item-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
}

.shop-item-icon img {
  width: 20px;
  height: 20px;
  opacity: 0.92;
}

.shop-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.shop-item-name {
  font-size: 14.5px;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-item-meta {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-item-tags {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  min-height: 18px;
  flex-wrap: wrap;
}

.tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-dim);
}

.buy-btn {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #04050c;
  cursor: pointer;
}

.buy-btn:disabled {
  opacity: 0.5;
}

.buy-price {
  text-align: center;
}

.owned-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  color: #04050c;
  background: var(--success);
  border: 2px solid var(--bg, #05060f);
}

/* --- equip modal --- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 8, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  width: 100%;
  max-width: 480px;
  background: #0b0e1a;
  border: 1px solid var(--panel-border);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}

.equip-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 40vh;
  overflow-y: auto;
}

.equip-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  cursor: pointer;
  font-size: 14px;
}

.equip-option:active {
  background: rgba(79, 216, 255, 0.12);
}

.btn-secondary {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
}

/* --- misc --- */

.error {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  min-height: 16px;
  margin: 0 0 8px;
}
