/* ═══════════════════════════════════════════════════════════════
   Planet Level UI  —  hud-planet-level modal
   ═══════════════════════════════════════════════════════════════ */

/* Modal backdrop / overlay */
#hud-planet-level {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
}
#hud-planet-level.visible {
  display: flex;
}

/* Panel */
.hplvl-panel {
  width: 560px;
  max-height: 82vh;
  background: rgba(4,12,24,0.97);
  border: 1px solid rgba(0,190,255,0.30);
  border-radius: 6px;
  box-shadow: 0 0 80px rgba(0,160,255,0.12), 0 12px 48px rgba(0,0,0,0.75);
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

/* Header */
.hplvl-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 10px;
  border-bottom: 1px solid rgba(0,190,255,0.16);
  background: rgba(0,140,210,0.07);
  flex-shrink: 0;
}
.hplvl-head-icon {
  font-size: 15px;
  color: rgba(255,190,60,0.85);
}
.hplvl-head-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(0,220,255,1);
  flex: 1;
}
.hplvl-head-planet {
  font-size: 15px;
  letter-spacing: 0.06em;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255,200,80,1);
}
.hplvl-head-close {
  background: transparent;
  border: none;
  color: rgba(0,190,255,0.55);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.hplvl-head-close:hover { color: rgba(0,220,255,1); }

/* Scrollable body */
.hplvl-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  color: rgba(200,225,255,1);
  font-size: 15px;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,190,255,0.35) rgba(0,20,40,0.60);
}
.hplvl-body::-webkit-scrollbar {
  width: 5px;
}
.hplvl-body::-webkit-scrollbar-track {
  background: rgba(0,20,40,0.60);
  border-radius: 3px;
}
.hplvl-body::-webkit-scrollbar-thumb {
  background: rgba(0,190,255,0.35);
  border-radius: 3px;
}
.hplvl-body::-webkit-scrollbar-thumb:hover {
  background: rgba(0,220,255,0.65);
}

/* Current level summary card */
.hplvl-current-card {
  display: flex;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(0,140,220,0.08);
  border: 1px solid rgba(0,200,255,0.20);
  border-radius: 4px;
  margin-bottom: 18px;
}
.hplvl-current-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 80px;
  border-right: 1px solid rgba(0,190,255,0.14);
  padding-right: 16px;
}
.hplvl-current-badge {
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(0,200,255,0.90);
}
.hplvl-current-num {
  font-size: 40px;
  font-weight: 700;
  color: rgba(0,230,255,1);
  text-shadow: 0 0 20px rgba(0,220,255,0.60), 0 0 40px rgba(0,180,255,0.30);
  line-height: 1;
}
.hplvl-current-name {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: rgba(255,200,80,1);
  text-transform: uppercase;
}
.hplvl-current-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.hplvl-cinfo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.hplvl-cinfo-k {
  color: rgba(120,200,255,1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 13px;
}
.hplvl-cinfo-v {
  font-weight: 700;
  color: rgba(200,235,255,1);
}
.hplvl-ok     { color: rgba(0,255,160,0.90) !important; }
.hplvl-locked { color: rgba(255,90,70,0.85) !important; }

/* Level track */
.hplvl-track-header {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(0,200,255,0.85);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(0,190,255,0.25);
}
.hplvl-track {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 18px;
}
.hplvl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: background 0.10s;
}
.hplvl-row--done {
  opacity: 0.40;
  background: rgba(0,200,255,0.03);
}
.hplvl-row--current {
  opacity: 1;
  background: rgba(0,180,255,0.10);
  border-color: rgba(0,200,255,0.28);
}
.hplvl-row--next {
  opacity: 0.85;
  background: rgba(255,180,40,0.06);
  border-color: rgba(255,180,40,0.20);
}
.hplvl-row--locked {
  opacity: 0.28;
}
.hplvl-row-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
  color: rgba(0,200,255,1);
  flex-shrink: 0;
}
.hplvl-row--done   .hplvl-row-icon { color: rgba(0,255,160,0.70); }
.hplvl-row--current .hplvl-row-icon { color: rgba(0,230,255,0.95); }
.hplvl-row--next   .hplvl-row-icon { color: rgba(255,190,60,0.85); }

.hplvl-row-level {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(0,200,255,0.90);
  width: 36px;
  flex-shrink: 0;
}
.hplvl-row-name {
  font-size: 15px;
  font-weight: 700;
  color: rgba(190,225,255,1);
  flex: 1;
}
.hplvl-row--current .hplvl-row-name { color: rgba(0,240,255,1); }
.hplvl-row--next    .hplvl-row-name { color: rgba(255,200,80,0.90); }

.hplvl-row-bldg {
  font-size: 13px;
  color: rgba(0,200,255,0.90);
  width: 56px;
  text-align: right;
  flex-shrink: 0;
}
.hplvl-row-unlock {
  font-size: 13px;
  color: rgba(160,215,255,0.90);
  width: 200px;
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hplvl-row--next .hplvl-row-unlock {
  color: rgba(255,200,80,1);
}

/* Badges */
.hplvl-badge {
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 2px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.hplvl-badge-current {
  background: rgba(0,180,255,0.18);
  border: 1px solid rgba(0,200,255,0.35);
  color: rgba(0,230,255,0.90);
}
.hplvl-badge-next {
  background: rgba(255,180,40,0.14);
  border: 1px solid rgba(255,180,40,0.30);
  color: rgba(255,200,80,0.90);
}
.hplvl-badge-done {
  color: rgba(0,255,160,0.90);
  background: none;
  border: none;
  font-size: 15px;
}

/* Upgrade section */
.hplvl-upgrade {
  padding: 16px;
  background: rgba(255,170,30,0.05);
  border: 1px solid rgba(255,170,30,0.22);
  border-radius: 4px;
  font-family: Arial, sans-serif;
}
.hplvl-upgrade-title {
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f5c842;
  margin-bottom: 12px;
  font-weight: 700;
}
.hplvl-reqs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.hplvl-req {
  display: grid;
  grid-template-columns: 110px 22px 1fr 1fr;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}
.hplvl-req-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 13px;
  color: #aad4f0;
}
.hplvl-req-status {
  font-size: 13px;
  text-align: center;
}
.hplvl-req-ok  .hplvl-req-status { color: rgba(0,255,160,0.90); }
.hplvl-req-fail .hplvl-req-status { color: rgba(255,80,60,0.90); }

.hplvl-req-need {
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
}
.hplvl-req-have {
  font-size: 13px;
  color: #c0c0c0;
}
.hplvl-req-ok  .hplvl-req-have { color: #70e0b0; }
.hplvl-req-fail .hplvl-req-have { color: #ff7060; }

.hplvl-unlock-preview {
  font-size: 14px;
  color: #e0c860;
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

.hplvl-upgrade-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: rgba(255,170,30,0.12);
  border: 1px solid rgba(255,180,40,0.40);
  color: rgba(255,210,80,1);
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.hplvl-upgrade-btn:hover:not(:disabled) {
  background: rgba(255,180,40,0.22);
  border-color: rgba(255,200,80,0.65);
  box-shadow: 0 0 18px rgba(255,170,30,0.28);
}
.hplvl-upgrade-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Max level message */
.hplvl-maxlvl {
  text-align: center;
  padding: 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255,210,80,1);
  text-shadow: 0 0 14px rgba(255,180,30,0.35);
  border: 1px solid rgba(255,180,40,0.20);
  border-radius: 4px;
  background: rgba(255,160,20,0.05);
}

/* Level button in HUD2 actions row */
#btn-level.h2-btn-level .h2-btn-label { color: rgba(255,180,40,0.55); }
#btn-level.h2-btn-level .h2-btn-val   {
  color: rgba(255,210,80,0.95);
  text-shadow: 0 0 12px rgba(255,180,30,0.65);
}
#btn-level.h2-btn-level .h2-btn-sub   { color: rgba(255,190,60,0.65); }
#btn-level.h2-btn-level:hover {
  background: rgba(255,180,40,0.10);
  border-color: rgba(255,200,80,0.50);
  box-shadow: 0 0 14px rgba(255,170,30,0.20);
}
