:root {
  --pda-green: #6aff23;
  --pda-green-dim: #4ac21a;
  --pda-amber: #e2c067;
  --pda-graphite: #0c0f12;
  --pda-frame-glow: rgba(0, 0, 0, 0.55);
}

body.pda-page {
  margin: 0;
  background:
    radial-gradient(circle at 35% 18%, rgba(10, 12, 14, 0.75), #050606 55%),
    radial-gradient(circle at 80% 10%, rgba(15, 20, 22, 0.5), transparent 42%),
    linear-gradient(145deg, #0a0d0f, #050607 48%, #0d0d0d);
  color: #d4d1c6;
  font-family: "Share Tech Mono", "Consolas", "Menlo", "SFMono-Regular", monospace;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

body.pda-page .pills-container {
  position: absolute;
  top: 90px;
  right: 24px;
  z-index: 25;
  display: inline-flex;
  width: fit-content;
}

.pda-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  /* background: url("/assets/pda-background.jpg") center/cover no-repeat; */
  background-color: #050606;
}

.pda-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) brightness(0.8) contrast(1);
}

.pda-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(5, 6, 7, 0.9),
    rgba(5, 6, 7, 0.4) 35%,
    rgba(5, 6, 7, 0.9)
  );
  mix-blend-mode: multiply;
}

.pda-page .site-nav,
.pda-page .nav-logo,
.pda-page .nav-links,
.pda-page .nav-link {
  font-family:
    "Inter",
    "SF Pro Display",
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
}

.pda-page .site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
}

.pda-page {
  padding-top: 0;
}

.pda-stage,
.lore-footer {
  position: relative;
  z-index: 2;
}

@media (max-width: 960px) {
  body.pda-page .pills-container {
    top: 80px;
    right: 14px;
  }
}

@media (max-width: 640px) {
  body.pda-page .pills-container {
    top: 70px;
    right: 12px;
  }
}

.pda-stage {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 12px 80px;
  overflow-x: auto;
}

.pda-shell {
  position: relative;
  width: 1024px;
  max-width: 1024px;
  min-width: 1024px;
  aspect-ratio: 1024 / 702;
  /* background-color: #0b0c0d; */
  background-image: url("/assets/ui_pda.png");
  background-size: contain, contain;
  background-repeat: no-repeat;
  background-position: center;
  /* filter: drop-shadow(0 24px 45px rgba(0, 0, 0, 0.65)); */
  border-radius: 28px;
  overflow: hidden;
}

/* .pda-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow:
    inset 0 0 32px rgba(0, 0, 0, 0.35),
    inset 0 0 120px rgba(0, 0, 0, 0.35);
  pointer-events: none;
} */

.pda-screen {
  position: absolute;
  inset: 11% 14% 11% 9%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.pda-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 0),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 0),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 1px, transparent 0);
  background-size:
    2px 2px,
    40px 100%,
    100% 32px;
  opacity: 0.4;
  pointer-events: none;
}

.pda-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
  color: #c3c0b5;
}

.pda-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 22, 24, 0.8);
  border: 1px solid #454548;
  border-radius: 8px;
  padding: 6px 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.pda-tab {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 6px;
  color: #9ea1a6;
  border: 1px solid transparent;
  background: transparent;
}

.pda-tab.active {
  color: #f2d39b;
  border-color: #65502e;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 8px rgba(255, 193, 92, 0.35);
}

.pda-tab.disabled {
  opacity: 0.35;
}

.pda-clock {
  font-size: 13px;
  letter-spacing: 0.08em;
  background: rgba(25, 28, 30, 0.85);
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #3f4448;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.pda-clock-bottom {
  position: absolute;
  right: 18px;
  bottom: 23px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #d4cfc4;
  padding: 6px 12px;
  z-index: 2;
}

.pda-mode-tabs {
  position: absolute;
  left: 35px;
  bottom: 23px;
  display: inline-flex;
  gap: 6px;
  z-index: 2;
}

.pda-mission-btn {
  color: #d4cfc4;
  border-radius: 6px;
  padding: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  background: transparent;
  border: none;
}

.pda-journal-ico {
  height: 11px;
  margin-top: 7px;
}

.pda-mode-separator {
  font-size: 12px;
  color: #676565;
  margin-top: 5px;
}

.pda-mode-btn {
  color: #d4cfc4;
  border-radius: 6px;
  padding: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  cursor: pointer;
  background: transparent;
  border: none;
}

.pda-mode-btn.active {
  color: #f59e0b;
}

.pda-columns {
  display: grid;
  grid-template-columns: 0.4fr 0.6fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
  max-height: 470px;
}

.pda-list {
  padding: 13px 30px;
  overflow-y: auto;
  color: var(--pda-green);
  font-size: 15px;
  line-height: 1.5;
  margin-top: 30px;
}

.pda-section {
  /* margin-bottom: 10px; */
}

.pda-section-title {
  color: var(--pda-green);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.pda-section-header {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px;
  background: transparent;
  color: var(--pda-amber);
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease;
  border: none;
}

.pda-section-header:hover {
}

.pda-section-header:focus-visible {
}

.toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--pda-green);
  font-size: 12px;
  line-height: 1;
}

.pda-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  margin-left: 30px;
}

.pda-searchbar {
  display: flex;
  gap: 8px;
}

.pda-search-input {
  flex: 1 1 auto;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #4a4d52;
  background: rgba(0, 0, 0, 0.35);
  color: #e4e7ea;
}

.pda-search-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #6b6f75;
  background: #44474d;
  color: #f6f8fa;
  cursor: pointer;
}

.pda-search-results {
  padding: 6px 8px 0;
  max-height: 420px;
  overflow-y: auto;
}

.pda-search-empty {
  padding: 12px;
  color: #c8ccd2;
}

.pda-search-msg {
  font-size: 11px;
  color: #aab2ba;
  margin-top: 14px;
}

.pda-item-source {
  display: block;
  font-size: 11px;
  color: #9ca3af;
}

.pda-search-status {
  font-size: 12px;
  color: #aab2ba;
  padding: 4px 8px 0;
}

.pda-search-results-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 430px;
  overflow-y: auto;
}

.pda-search-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  color: #e8ecf1;
}

.pda-search-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin-bottom: 4px;
}

.pda-search-card-title {
  font-weight: 700;
  color: #f2f5f7;
}

.pda-search-card-id {
  font-weight: 700;
  color: #f2f5f7;
  word-break: break-word;
}

.pda-search-card-source {
  font-size: 12px;
  color: #9ca3af;
  word-break: break-word;
}

.pda-search-card-body {
  font-size: 13px;
  line-height: 1.35;
  color: #dfe4e8;
  white-space: pre-wrap;
}

.pda-search-card-footer {
  margin-top: 6px;
  font-size: 13px;
  font-style: italic;
  color: #d8d5cc;
  display: block;
}

.note-footer-right,
.pda-search-card-footer.note-footer-right {
  text-align: right;
}

.pda-items[hidden] {
  display: none !important;
}

.pda-item {
  text-align: left;
  border: none;
  background: transparent;
  color: var(--pda-green);
  padding: 6px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font-size: 13px;
  cursor: pointer;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    color 120ms ease;
}

.pda-item:hover {
}

.pda-item.active {
  color: #fff;
}

.pda-item:focus-visible {
  outline: 2px solid #6bbd5c;
  outline-offset: 2px;
}

.pda-detail {
  position: relative;
  padding: 30px 4px 20px 25px;
  color: #d4cfc4;
  overflow: hidden;
}

.pda-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size:
    100% 28px,
    32px 100%;
  opacity: 0.5;
  pointer-events: none;
}

.pda-detail-title {
  font-size: 15px;
  letter-spacing: 0.04em;
  color: #f3d8a2;
  margin-bottom: 10px;
  display: none;
}

.pda-detail-body {
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #d8d6ce;
  white-space: pre-line;
  max-height: 430px;
  overflow-y: auto;
  padding: 0 16px 10px 0;
}

.pda-detail-heading {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  color: #f2f5f7;
}

.pda-detail-text {
  white-space: pre-wrap;
}

/* Mission overlay (inline tab) */
.pda-mission-overlay {
  width: 769px;
  position: absolute;
  inset: 0;
  background: #fdfdfd;
  border-radius: 5px;
  overflow: hidden;
  display: none;
  z-index: 10;
  height: 533px;
  margin-left: 13px;
}

.pda-mission-overlay.active {
  display: block;
}

.pda-mission-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #b4d7f1;
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

.pda-mission-screen {
  width: 100%;
  height: 100%;
  background: url("/assets/mission.png");
  background-repeat: repeat-x;
}

.pda-bottom-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: center;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.65), rgba(8, 8, 8, 0.88));
  border: 1px solid #303436;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  padding: 8px 10px;
  border-radius: 8px;
  color: #a6a9ad;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bar-item {
  padding: 6px 4px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid transparent;
}

.bar-item.active {
  background: rgba(76, 118, 70, 0.28);
  border-color: rgba(110, 189, 92, 0.4);
  color: #d4f8c8;
  box-shadow: inset 0 0 0 1px rgba(180, 255, 170, 0.12);
}

.compact-footer {
  text-align: center;
  background: transparent;
  border: none;
}

.pda-detail-body::-webkit-scrollbar {
  width: 11px;
}

.pda-detail-body::-webkit-scrollbar-thumb {
  background: #3a3b47;
}

.pda-list::-webkit-scrollbar {
  width: 11px;
}

.pda-list::-webkit-scrollbar-thumb {
  background: #3a3b47;
}

.pda-search-results-grid::-webkit-scrollbar {
  width: 11px;
}

.pda-search-results-grid::-webkit-scrollbar-thumb {
  background: #3a3b47;
}

@media (max-width: 980px) {
  body.pda-page {
    padding-top: 0;
  }

  .pda-stage {
    justify-content: center;
    overflow-x: auto;
  }
  .pda-shell {
    width: 1024px;
    min-width: 1024px;
    max-width: 1024px;
  }
}

@media (max-width: 640px) {
  .pda-stage {
    padding: 24px 10px 56px;
    overflow-x: auto;
    justify-content: flex-start;
    align-items: flex-start;
    /* Enable smooth scrolling */
    -webkit-overflow-scrolling: touch;
  }
  .pda-shell {
    width: 1024px;
    min-width: 1024px;
    max-width: 1024px;
    border-radius: 18px;
    /* Start from left, allow scrolling right */
    margin: 0;
  }
}
