/* ── Search for Planet X — Game Styles ── */

.px-game-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Header ── */
.px-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.px-code {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-family: monospace;
  color: var(--primary-color);
}
.px-mode-tag {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-left: 10px;
}

/* ── Time track ── */
.px-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.9rem;
}
.px-time-label { color: var(--text-light); }
.px-time-val { font-weight: 600; }
.px-time-val small { font-weight: 400; color: var(--text-light); }

/* ── Pending alerts ── */
.px-pending {
  background: #fff8e1;
  border-left: 4px solid #f9a825;
}
.px-pending-item {
  padding: 4px 0;
  font-size: 0.9rem;
}
.px-pending-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ── Action buttons ── */
.px-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.px-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  gap: 4px;
  min-height: 90px;
}
.px-action-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  background: #f0f4ff;
}
.px-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.px-action-icon { font-size: 1.6rem; }
.px-action-name { font-weight: 600; font-size: 0.9rem; }
.px-action-cost { font-size: 0.75rem; color: var(--text-light); }
.px-action-locate {
  grid-column: 1 / -1;
  background: #fff3e0;
  border-color: #fb8c00;
  flex-direction: row;
  gap: 12px;
  justify-content: center;
  min-height: 60px;
}
.px-action-locate:hover:not(:disabled) {
  background: #ffe0b2;
  border-color: #e65100;
}
.px-action-locate .px-action-name { font-size: 1rem; }
.px-action-locate .px-action-cost { margin-left: auto; }

/* ── Research notes & history ── */
.px-note {
  font-size: 0.88rem;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.5;
}
.px-note:last-child { border-bottom: none; }
.px-note-conf { color: #1a237e; }
.px-hist-item {
  font-size: 0.85rem;
  padding: 5px 0;
  border-bottom: 1px solid #f0f0f0;
  line-height: 1.4;
}
.px-hist-item:last-child { border-bottom: none; }
.px-hist-bot { color: #6a1b9a; font-style: italic; }

/* ── Overlay ── */
.px-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.px-overlay-panel {
  background: white;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
}
.px-overlay-scroll {
  padding: 24px 20px 30px;
  overflow-y: auto;
  flex: 1;
}
.px-overlay-scroll h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}
.px-overlay-scroll h3 {
  margin: 16px 0 8px;
  font-size: 1rem;
}

/* ── Forms inside overlays ── */
.px-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}
.px-form-row label {
  min-width: 140px;
  font-size: 0.9rem;
  color: var(--text-light);
}
.px-select {
  flex: 1;
  padding: 9px 12px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
  background: white;
  cursor: pointer;
}
.px-select:focus { outline: none; border-color: var(--primary-color); }

.px-time-cost {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  margin: 8px 0;
}
.px-result-box {
  background: #f5f5f5;
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
  line-height: 1.6;
}
.px-result-correct { background: #e8f5e9; border-left: 4px solid #43a047; }
.px-result-incorrect { background: #ffebee; border-left: 4px solid #e53935; }
.px-error {
  color: #c62828;
  font-size: 0.85rem;
  margin: 6px 0;
}
.px-overlay-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* ── Topics list (research) ── */
.px-topics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
.px-topic-item {
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.px-topic-item:hover { border-color: var(--primary-color); background: #f0f4ff; }
.px-topic-done { background: #f5f5f5; cursor: default; }
.px-topic-done:hover { border-color: #e0e0e0; background: #f5f5f5; }
.px-topic-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
.px-topic-icons { color: var(--text-light); flex: 1; }
.px-tag-done {
  font-size: 0.72rem;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.px-topic-clue {
  font-size: 0.85rem;
  color: #333;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e0e0e0;
  line-height: 1.5;
}

/* ── Tables ── */
.px-theory-table,
.px-reveal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 10px 0;
}
.px-theory-table th,
.px-theory-table td,
.px-reveal-table th,
.px-reveal-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}
.px-theory-table th,
.px-reveal-table th {
  background: #f5f5f5;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-light);
}
.px-row-correct td:first-child { border-left: 3px solid #43a047; }
.px-row-incorrect td:first-child { border-left: 3px solid #e53935; }

/* ── Scores ── */
.px-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 16px 0;
}
.px-score-card {
  flex: 1;
  text-align: center;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 16px;
}
.px-score-winner {
  border-color: #f9a825;
  background: #fff8e1;
}
.px-score-name { font-size: 0.85rem; color: var(--text-light); }
.px-score-pts { font-size: 2rem; font-weight: 700; color: var(--primary-color); }
.px-score-breakdown { font-size: 0.75rem; color: var(--text-light); margin-top: 6px; }
.px-score-vs { font-size: 0.9rem; color: var(--text-light); }

/* ── Code entry ── */
.px-code-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

/* ── Generic buttons ── */
.px-btn-primary {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.px-btn-primary:hover { opacity: 0.9; }
.px-btn-secondary {
  background: white;
  color: var(--text-color);
  border: 1.5px solid #ccc;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  cursor: pointer;
}
.px-btn-secondary:hover { border-color: #999; }
.px-btn-warning {
  background: #e65100;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.px-btn-warning:hover { opacity: 0.9; }
.px-btn-locate {
  background: #fb8c00;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.px-btn-locate:hover { opacity: 0.9; }
.px-btn-sm {
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text-light);
}
.px-btn-sm:hover { border-color: #999; color: var(--text-color); }
.px-muted { color: var(--text-light); font-size: 0.87rem; line-height: 1.5; margin-bottom: 8px; }

@media (max-width: 440px) {
  .px-form-row { flex-direction: column; align-items: flex-start; }
  .px-form-row label { min-width: unset; }
  .px-select { width: 100%; }
}
