/* Shared layout for the simulation card pages: My simulations and Explore. */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
}

.pagehead {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.pagehead h1 { font-size: 1.85rem; margin: 0; }
.pagehead .spacer { flex: 1; }
.pagehead .home { color: var(--accent); text-decoration: none; font-weight: 700; }
.pagelead { color: var(--muted); margin-bottom: 1.5rem; max-width: 62ch; }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.tab {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font: inherit;
  font-weight: 650;
  color: var(--muted);
  cursor: pointer;
}
.tab.active { border-color: var(--accent); color: var(--accent); background: #f4f7ff; }

.filters {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  align-items: flex-end;
}
.filters .field { min-width: 0; }
.filters label { margin: 0 0 0.15rem; }
.filters select, .filters input { width: auto; min-width: 150px; }

.cardgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.1rem;
}

.simcard {
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.15rem;
}
.simcard .subject {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.subject-business { color: #b45309; }
.subject-economics { color: #1d4ed8; }
.subject-geography { color: #047857; }
.subject-history { color: #9333ea; }
.subject-politics { color: #be185d; }
.subject-other { color: var(--muted); }

.cardtop { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; flex-wrap: wrap; }
.cardtop .subject { margin-bottom: 0; }
.stamp {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  white-space: nowrap;
}
.stamp.verified { background: #e2f4ea; color: var(--good); border: 1px solid #b7e2cb; }
.stamp.community { background: #eef2f8; color: var(--muted); border: 1px solid var(--border); }

.topicline { font-size: 0.86rem; color: var(--muted); font-weight: 650; margin-bottom: 0.3rem; }
.reference { font-size: 0.76rem; color: var(--muted); margin: 0 0 0.7rem; line-height: 1.35; }
.tabnote { font-size: 0.85rem; color: var(--muted); margin: 0 0 1rem; }
.fact.level { background: #e8eefc; color: var(--accent); font-weight: 700; }
.fact.marked { background: #f3ecfe; color: #6d28d9; font-weight: 650; }

.simcard h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.simcard .desc { color: var(--muted); font-size: 0.94rem; flex: 1; }
.simcard .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 0.85rem;
}
.fact {
  background: #eef2f8;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.fact.shared { background: #e2f4ea; color: var(--good); font-weight: 700; }
.fact.draft { background: #fff7e6; color: #8a6116; font-weight: 700; }

.simcard .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}
.simcard .actions .btn { padding: 0.32rem 0.75rem; font-size: 0.86rem; }

.empty {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
}
.empty h2 { color: var(--text); font-size: 1.2rem; }
.empty .btn { margin-top: 0.75rem; }

.keybox {
  background: #f4f7ff;
  border: 1px solid #cfdcfb;
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
}
.keybox h2 { font-size: 1rem; margin-bottom: 0.2rem; }
.keybox p { font-size: 0.9rem; color: var(--muted); margin: 0.2rem 0 0.6rem; }
.keyrow { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.keyrow input { flex: 1; min-width: 220px; font-size: 0.85rem; color: var(--muted); }

.notice {
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.notice.good { background: #e2f4ea; color: var(--good); }
.notice.bad { background: #fbe9e7; color: var(--bad); }

/* modal, shared with the builder's look */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(15, 26, 42, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 1rem;
}
.modal {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(10, 20, 40, 0.25);
  max-width: 520px; width: 100%;
  max-height: 85vh; overflow-y: auto;
  padding: 1.5rem;
}
.modal h2 { font-size: 1.25rem; }
.modal .closer { margin-top: 0.9rem; display: flex; gap: 0.5rem; justify-content: flex-end; }

@media (max-width: 640px) {
  .cardgrid { grid-template-columns: 1fr; }
  .filters select, .filters input { min-width: 0; width: 100%; }
  .filters .field { width: 100%; }
}
