/* ============================================================================
 * Masters of the World — the filterable atlas. Uses site palette (/style.css).
 * Cards + placards carry a per-culture --accent for continuity into the 3D room.
 * ========================================================================== */
.at-wrap { max-width: 1160px; }
.mw-intro { color: var(--muted); margin: -6px 0 20px; max-width: 680px; }

/* -------------------------------------------------------------- filter bar */
.at-bar { position: sticky; top: 0; z-index: 30; background: linear-gradient(180deg, var(--bg-top) 82%, transparent);
  padding: 10px 0 12px; margin-bottom: 12px; }
.at-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.at-search { flex: 1 1 240px; min-width: 180px; font-size: 14.5px; color: var(--ink);
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 9px 16px; }
.at-search::placeholder { color: var(--muted); }
.at-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.at-sort, .at-sel select { font-size: 13px; color: var(--ink); background: var(--card);
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 12px; }
.at-reset { font-size: 13px; color: var(--muted); background: none; border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.at-reset:hover { color: var(--ink); border-color: rgba(216,178,92,.5); }

.at-frow { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.at-flabel { flex: 0 0 auto; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); width: 74px; }
.at-chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.at-chip { font-size: 12.5px; color: var(--muted); background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.at-chip:hover { color: var(--ink); }
.at-chip.on { color: #ffe9b8; border-color: rgba(216,178,92,.6); background: rgba(216,178,92,.12); }
.at-selrow { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.at-sel { display: flex; align-items: center; gap: 8px; }
.at-chip .cv { color: #ffe9b8; font-size: 11px; }
.at-chip .n { font-size: 10.5px; opacity: .6; margin-left: 3px; }

/* country sub-panel — slides open under the selected continent */
.at-countries { overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height .32s cubic-bezier(.4,0,.2,1), opacity .28s ease, margin .28s ease; }
.at-countries.open { max-height: 220px; opacity: 1; margin: 2px 0 8px; }
.at-countries .at-chiprow { padding: 8px 0 8px 12px; margin-left: 74px;
  border-left: 2px solid rgba(216,178,92,.3); }
.at-countries .at-chip { background: rgba(255,255,255,.03); }
.at-countries .at-chip.on { color: #ffe9b8; border-color: rgba(216,178,92,.7); background: rgba(216,178,92,.16); }
@media (max-width: 620px) { .at-countries .at-chiprow { margin-left: 0; } }

@media (max-width: 620px) {
  .at-flabel { width: 100%; margin-bottom: 2px; }
  .at-frow { flex-wrap: wrap; }
  .at-chiprow { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .at-chiprow::-webkit-scrollbar { display: none; }
}

/* -------------------------------------------------------------------- grid */
.at-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.at-empty { color: var(--muted); text-align: center; padding: 40px 0; }

.at-card { --accent: #d8b25c; display: grid; grid-template-columns: 62px 1fr; grid-template-rows: auto auto; gap: 3px 12px;
  text-align: left; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--card);
  color: inherit; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.at-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: rgba(255,255,255,.06); }
.at-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.at-av { grid-row: 1 / 3; width: 62px; height: 78px; border-radius: 8px; overflow: hidden;
  background: linear-gradient(150deg, #2a2620, #17130d); display: grid; place-items: center;
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.at-av img { width: 100%; height: 100%; object-fit: cover; }
.at-av .monogram { font-size: 20px; font-weight: 700; color: var(--accent); }
.at-cname { font-weight: 700; font-size: 15.5px; }
.at-cmeta { font-size: 12px; color: var(--muted); }
.at-ctrad { font-size: 12px; color: var(--accent); opacity: .95; }
.at-cstrip { grid-column: 1 / 3; display: flex; gap: 6px; margin-top: 8px; }
.at-cstrip .th { flex: 1 1 0; height: 60px; border-radius: 5px; overflow: hidden; background: #14192c; border: 1px solid var(--border); }
.at-cstrip .th img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }

/* ----------------------------------------------------------------- placard */
.at-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(4,7,15,.72); backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px); display: none; align-items: flex-end; justify-content: center; }
.at-scrim.open { display: flex; }
.at-placard { --accent: #d8b25c; position: relative; width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto;
  overscroll-behavior: contain; background: linear-gradient(180deg, #131a30, #0d1326);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-bottom: none;
  border-radius: 18px 18px 0 0; padding: 22px 20px 30px; box-shadow: 0 -12px 60px rgba(0,0,0,.5);
  animation: at-rise .22s ease; }
@keyframes at-rise { from { transform: translateY(26px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (min-width: 720px) { .at-scrim { align-items: center; padding: 30px 16px; }
  .at-placard { border-radius: 18px; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); } }
.at-placard .close { position: sticky; top: 0; float: right; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(20,26,48,.9); color: var(--ink); font-size: 20px; cursor: pointer; }
.at-p-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.at-p-portrait { flex: 0 0 auto; width: 86px; height: 108px; border-radius: 8px; overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--accent) 50%, transparent); background: #191510; display: grid; place-items: center; }
.at-p-portrait img { width: 100%; height: 100%; object-fit: cover; }
.at-p-portrait .monogram { font-size: 30px; font-weight: 700; color: var(--accent); }
.at-p-name { font-size: 22px; font-weight: 700; }
.at-p-life { color: var(--muted); font-size: 13.5px; margin: 2px 0 6px; }
.at-p-tag { display: inline-block; font-size: 12px; color: #fff; border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 999px; padding: 2px 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.at-p-why { font-size: 14.5px; color: #fff; background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 10px 12px; margin-bottom: 16px; }
.at-p-enter { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px;
  margin: 4px 0 18px; border-radius: 12px; border: none; cursor: pointer; font-size: 16px; font-weight: 700;
  color: #16120a; text-decoration: none; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); }
.at-p-enter:hover { filter: brightness(1.06); }
.at-p-workstitle { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.at-p-works { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.at-p-work { display: block; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #10162b; color: inherit; text-decoration: none; transition: transform .15s ease, border-color .15s ease; }
.at-p-work:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.at-p-work .im { height: 110px; background: #0b0f1e; } .at-p-work .im img { width: 100%; height: 100%; object-fit: cover; }
.at-p-work .wt { font-size: 12.5px; padding: 7px 9px 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.at-p-work .wy { font-size: 11.5px; color: var(--muted); padding: 0 9px 8px; }
.at-p-loading { color: var(--muted); font-size: 13.5px; padding: 12px 0; }
.at-p-source { color: var(--muted); font-size: 12px; margin-top: 6px; }
