/* ============================================================
   HUD Frame Panel - Glassmorphism containers
   ============================================================ */

.panel {
  background: rgba(13, 13, 31, 0.94);
  border: 1px solid rgba(80, 95, 110, 0.7);
  border-radius: var(--panel-radius);
  box-shadow:
    0 4px 24px var(--scrim-60),
    inset 0 0 20px rgba(0, 210, 211, 0.06);
  overflow: hidden;
  position: relative;
}

/* Glassmorphism blur only on desktop */
@media (min-width: 1024px) {
  .panel {
    background: rgba(13, 13, 31, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}


.panel-header {
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
  padding: 10px var(--panel-padding);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.04) 0%, transparent 100%);
}

/* Accent line on panel headers */
.panel-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--panel-padding);
  right: var(--panel-padding);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.25), transparent);
}

.panel-header .header-action {
  font-size: 0.65rem;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.15s;
}

.panel-header .header-action:hover {
  color: var(--cyan);
}

.panel-body {
  padding: var(--panel-padding);
}

/* Danger Zone panel */
.panel-danger {
  border-color: rgba(239, 68, 68, 0.25);
}

.panel-header-danger {
  color: var(--red);
  border-bottom-color: rgba(239, 68, 68, 0.15);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.04) 0%, transparent 100%);
}

/* --- Speed Up Confirmation (card overlay) --- */
.speedup-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  border-radius: 3px;
  background: rgba(6, 6, 15, 0.94);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  gap: 6px;
  transition: opacity 0.2s;
}
.speedup-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.speedup-line {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.speedup-time {
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 700;
}
.speedup-actions {
  display: flex;
  gap: 8px;
}
.speedup-accept {
  padding: 4px 14px;
  border-radius: 2px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.speedup-accept:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.25);
}
.speedup-accept:disabled, .speedup-accept.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(100, 116, 139, 0.3);
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-dim);
}
.speedup-dismiss {
  padding: 4px 14px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-size: 0.7rem;
  cursor: pointer;
}
.speedup-dismiss:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* --- Offline Summary Overlay --- */
.offline-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(6, 6, 15, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.offline-box {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.offline-overlay .briefing-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--cyan);
  letter-spacing: 0.12em;
  margin-bottom: 4px;
  text-shadow: 0 0 20px rgba(var(--accent-rgb), 0.4);
}
.offline-overlay .briefing-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.offline-section {
  width: 100%;
  margin-bottom: 16px;
}
.offline-section-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-align: left;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
  padding-bottom: 4px;
}
.offline-gains {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.offline-gain-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  opacity: 0;
  transform: translateX(16px);
  animation: slide-in-gain 0.35s ease-out forwards;
}
.offline-gain-row:nth-child(1) { animation-delay: 0.15s; }
.offline-gain-row:nth-child(2) { animation-delay: 0.3s; }
.offline-gain-row:nth-child(3) { animation-delay: 0.45s; }
.offline-gain-row:nth-child(4) { animation-delay: 0.6s; }
@keyframes slide-in-gain {
  to { opacity: 1; transform: translateX(0); }
}
.offline-res-img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 4px;
}
.gain-label {
  flex: 1;
  text-align: left;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.gain-amount {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.offline-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.offline-event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: left;
  opacity: 0;
  animation: slide-in-gain 0.35s ease-out forwards;
}
.offline-event-row:nth-child(1) { animation-delay: 0.7s; }
.offline-event-row:nth-child(2) { animation-delay: 0.85s; }
.offline-event-row:nth-child(3) { animation-delay: 1.0s; }
.offline-event-row:nth-child(4) { animation-delay: 1.15s; }
.offline-evt-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.offline-evt-planet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.offline-evt-planet-img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.offline-evt-planet-name {
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.offline-event-row-clickable {
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.offline-event-row-clickable:hover,
.offline-event-row-clickable:focus {
  background: rgba(34, 211, 238, 0.10);
  color: var(--text-primary, #e5e7eb);
  outline: none;
}
.offline-evt-action {
  margin-left: auto;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan, #22d3ee);
  opacity: 0.85;
  flex-shrink: 0;
}
.offline-empty {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 16px 0;
}
.offline-box .btn {
  margin-top: 20px;
  min-width: 160px;
}
.offline-event-row:nth-child(3) { animation-delay: 1.7s; }

/* ============================================================
   Hostile residents hero (alien nest alert on planet dashboard)
   ============================================================ */
.planet-hostile-hero {
  margin: 12px 0;
  background: radial-gradient(circle at 15% 0%, rgba(239, 68, 68, 0.18) 0%, rgba(13, 13, 31, 0.94) 60%);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow:
    0 4px 24px rgba(239, 68, 68, 0.15),
    inset 0 0 30px rgba(239, 68, 68, 0.08);
}
.planet-hostile-hero .panel-body {
  padding: 16px 20px;
}
.planet-hostile-hero__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  text-shadow: 0 0 16px rgba(239, 68, 68, 0.55);
  margin-bottom: 2px;
}
.planet-hostile-hero__subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.planet-hostile-hero__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 20px;
}
.hostile-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(239, 68, 68, 0.12);
  font-size: 0.78rem;
}
.hostile-stat__label {
  color: var(--text-secondary);
}
.hostile-stat__value {
  font-family: var(--font-mono);
  color: var(--red);
  font-size: 0.95rem;
  font-weight: 700;
}
@media (max-width: 640px) {
  .planet-hostile-hero__stats {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
