.app {
  max-width:var(--max);
  margin:0 auto;
  padding:8px;
  display:grid;
  gap:8px;
}

.card {
  background:linear-gradient(180deg, var(--panel), var(--panel-soft));
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
  overflow:hidden;
}

.topCard {
  padding:9px;
  display:grid;
  gap:7px;
}

.hero {
  padding:11px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.05);
  background:
    radial-gradient(260px 140px at 14% 10%, rgba(10,132,255,.08), transparent 62%),
    linear-gradient(180deg, #ffffff, #fafdff);
}

.heroSub {
  margin-top:5px;
  color:#5f6b7a;
  font-size:12px;
  line-height:1.28;
  max-width:600px;
}

.heroPills {
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  margin-top:6px;
}
.pill {
  border-radius:999px;
  padding:4px 8px;
  font-size:10px;
  font-weight:800;
  color:#334155;
  border:1px solid var(--line);
  background:#fff;
}
.pill.active {
  background:#111827;
  color:#fff;
  border-color:#111827;
}

.setupCard {
  display:grid;
  gap:6px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  padding:8px;
}

.fieldRow {
  display:grid;
  gap:5px;
}

.field {
  display:grid;
  gap:4px;
}
.label {
  font-size:10px;
  font-weight:800;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.08em;
}

.input, .staticInput, .search {
  width:100%;
  min-height:38px;
  padding:8px 9px;
  border-radius:10px;
  border:1px solid var(--line-strong);
  background:#fff;
  color:var(--text);
  outline:none;
}
.input:focus, .search:focus {
  box-shadow:0 0 0 3px rgba(10,132,255,.10);
  border-color:rgba(10,132,255,.34);
}
.staticInput {
  font-weight:800;
  background:#f8fafc;
}

.playStage {
  display:grid;
  gap:7px;
  max-width:920px;
  margin:0 auto;
}
.playTop {
  display:grid;
  gap:7px;
}
.playCard {
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}
.playCardInner {
  padding:8px;
}

.trackerSearchTop {
  display:grid;
  gap:8px;
}
.searchWrap {
  position:relative;
  width:100%;
}
.searchIcon {
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  color:#7b8794;
  pointer-events:none;
}
.search {
  padding-left:38px;
}

.trackerShell, .mapShell { position:relative; }
.trackerShell.locked .lockable, .mapShell.locked .lockable {
  opacity:.62;
  pointer-events:none;
  user-select:none;
  filter:saturate(.95);
}
.mapMeta {
  display:grid;
  gap:6px;
  margin-top:2px;
}
.mapCard {
  border-radius:12px;
  border:1px solid var(--line);
  background:
    radial-gradient(circle at 15% 20%, rgba(96,165,250,.10), transparent 14%),
    radial-gradient(circle at 82% 18%, rgba(59,130,246,.08), transparent 14%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.92));
  box-shadow:var(--shadow-sm);
  overflow:hidden;
  min-height:500px;
}
.mapWrap {
  padding:3px;
  overflow:auto;
  min-height:500px;
}
.svgMap {
  width:100%;
  min-width:620px;
  max-width:none;
  height:auto;
  min-height:480px;
  display:block;
  filter:drop-shadow(0 8px 14px rgba(15,23,42,.05));
}
.progressLine {
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size:11px;
  margin-bottom:6px;
}
.bar {
  height:8px;
  overflow:hidden;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.06);
  background:rgba(148,163,184,.12);
}
.bar > span {
  display:block;
  height:100%;
  width:0%;
  background:linear-gradient(90deg, var(--blue), #4f9cff);
  transition:width .3s ease;
}
.state { cursor:pointer; transition:transform .12s ease; }
.state:hover { transform:translateY(-1px) scale(1.01); }
.state .shape { fill:#ffffff; stroke:#bcc9d8; stroke-width:1.6; }
.state.found .shape { fill:#dbeafe; stroke:#2563eb; }

@media (min-width:760px) {
  .app { padding:14px; gap:12px; }
  .topCard {
    grid-template-columns:1fr 1fr;
    align-items:start;
    gap:12px;
  }
  h1 { font-size:40px; }
  .fieldRow {
    grid-template-columns:1fr 1fr;
  }
  .startInline {
    display:flex;
    align-items:center;
    gap:8px;
  }
  .startCopy { flex:1; }
  .readyBtn { width:auto; min-width:132px; }
  .actionRail {
    grid-template-columns:auto auto auto;
    align-items:center;
  }
  .btn.danger { grid-column:auto; }
  .statGrid {
    grid-template-columns:repeat(4,1fr);
    gap:6px;
  }
  .contentZones {
    grid-template-columns:1.18fr .82fr;
    gap:12px;
    align-items:start;
  }
  .playTop {
    grid-template-columns:minmax(260px,.62fr) minmax(0,1.38fr);
    gap:10px;
    align-items:start;
  }
  .plateGrid {
    grid-template-columns:repeat(4,1fr);
  }
  .compGrid {
    grid-template-columns:repeat(3,1fr);
  }
  .mapCard, .mapWrap { min-height:620px; }
  .svgMap { min-width:950px; min-height:600px; }
}

.topMetaRow{display:grid;gap:8px}

.sectionBody{
  padding:6px !important;
}
.playStage{
  gap:7px !important;
}
.playTop{
  gap:7px !important;
}
.playCardInner,.playBody{
  padding:7px !important;
}
.compSummary{
  padding:6px 7px !important;
}
.compPill{
  padding:6px 7px !important;
}
.infoCard{
  padding:7px 8px !important;
}
@media (min-width:760px){
  .controls{
    padding:9px !important;
  }
}

@media (min-width:760px){

/* Canonical top leaderboard + collapsible sections */
.topMetaRow{
  display:grid;
  gap:7px;
}
.leaderboardCardTop{
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}
.sectionTitleSm{
  font-size:18px;
}

/* Game-first hero */
.heroMeta{
  display:grid;
  gap:10px;
  margin-top:10px;
}
.heroStatLine{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}
.heroStatPrimary{
  font-size:18px;
  line-height:1.1;
  font-weight:900;
  letter-spacing:-.03em;
  color:var(--text);
}
.heroStatSecondary{
  font-size:13px;
  line-height:1.2;
  font-weight:800;
  color:var(--muted);
  text-transform:lowercase;
}
.heroDot{
  color:#94a3b8;
  font-weight:800;
}
.heroPillsCompact{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.heroPillsGame .pill{
  min-height:36px;
  padding:7px 12px;
  font-size:14px;
}

/* Option A polish spacing */
.setupCard{
  gap:10px;
}
@media (min-width:760px){
  .topCard{
    gap:9px;
  }
}
