/* Card synergies: a main PvZH Vault page (same chrome and type as the home app, not the guide pages). */

:root {
  color-scheme: dark;
  --bg: #12181b;
  --surface: #1b2226;
  --surface-2: #20282d;
  --surface-3: #283238;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --body: #d3dadf;
  --muted: #a0aab2;
  --dim: #828e96;
  --accent: #00b4d8;
  --gold: #ffd15c;
  --plant: #8fd96f;
  --zombie: #c3a2ff;
  --stage: #171d20;
  --sans: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --wrap: 1180px;
  --r: 10px;
  --r-sm: 7px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.sy-main { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--sans); }
.sy-main img { max-width: 100%; }
.sy-main a { color: var(--accent); }
.sy-main :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sy-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sy-skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: #04161c; padding: 8px 12px; border-radius: var(--r-sm); font-weight: 700; text-decoration: none; }
.sy-skip:focus { top: 10px; }

/* ---------- Top bar, wordmark, title (match the home app) ---------- */

.sy-topbar { border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.sy-topbar-inner { max-width: var(--wrap); margin: 0 auto; padding: 10px 24px; min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 6px 20px; }
.sy-updated { font-size: 14px; color: var(--muted); }
.sy-updated a { color: var(--text); font-weight: 600; text-decoration: none; }
.sy-back { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; color: var(--accent) !important; font-weight: 600; font-size: 15px; text-decoration: none; border-radius: 8px; }
.sy-back:hover { background: rgba(0, 180, 216, 0.08); }
.sy-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.sy-brand { max-width: var(--wrap); margin: 0 auto; padding: 28px 24px 8px; text-align: center; }
.sy-brand-row { display: inline-flex; align-items: center; gap: 18px; color: var(--text); }
.sy-brand img { width: 72px; height: 72px; }
.sy-brand span { font-size: 76px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }

.sy-title { grid-area: title; text-align: center; margin: 18px 0 4px; }
.sy-title h1 { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.2; color: var(--accent); }
.sy-effect {
  background: linear-gradient(to right, #00d2ff, #4a90e2, #00d2ff); background-size: 200% auto;
  color: transparent; -webkit-background-clip: text; background-clip: text; font-weight: 800;
}
.sy-effect:hover { animation: sy-shimmer 2.5s linear infinite; }
@keyframes sy-shimmer { to { background-position: 200% center; } }
.sy-title p { margin: 5px 0 0; font-size: 16.8px; color: var(--muted); }

/* ---------- Layout ---------- */

.sy-app {
  max-width: 1200px; margin: 0 auto; padding: 0 28px 8px;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "title title" "controls controls" "stage panel"; gap: 16px 28px; align-items: start;
}

/* ---------- Controls ---------- */

.sy-controls { grid-area: controls; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; }
.sy-search { position: relative; flex: 0 1 340px; }
.sy-search input {
  width: 100%; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 10px 13px 10px 38px; color: var(--text); font: 15px var(--sans);
}
.sy-search input::placeholder { color: var(--dim); }
.sy-search input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.sy-search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--dim); pointer-events: none; }
.sy-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; margin: 0; padding: 6px; list-style: none; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.sy-opt { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 15px; color: var(--text); }
.sy-opt small { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12.5px; }
.sy-opt .sy-tier-badge { width: 22px; min-width: 22px; height: 22px; font-size: 12px; padding: 0; border-radius: 6px; }
.sy-opt img { width: 28px; height: 28px; object-fit: contain; }
.sy-opt.is-active, .sy-opt:hover { background: var(--surface-3); }
.sy-opt-empty { padding: 8px; color: var(--muted); font-size: 14.5px; }
.sy-chip, .sy-btn {
  display: inline-flex; align-items: center; gap: 6px; font: 600 14px/1.2 var(--sans); padding: 10px 14px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.06); color: var(--text); border: 1px solid var(--line-2); cursor: pointer; text-decoration: none;
}
.sy-chip:hover, .sy-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text); }
.sy-main a.sy-btn { color: var(--text); }
.sy-event { border-color: rgba(255, 209, 92, 0.4); }
.sy-event span { color: var(--gold); font-weight: 600; }

/* ---------- Stage ---------- */

.sy-stage {
  grid-area: stage; position: relative; overflow: hidden; height: clamp(480px, 66vh, 660px);
  background: var(--stage); border: 1px solid var(--line); border-radius: 14px; touch-action: manipulation;
}
.sy-app.is-plant { --sy-line: var(--plant); --sy-glow: rgba(143, 217, 111, 0.55); --sy-glow-wide: rgba(143, 217, 111, 0.28); }
.sy-app.is-zombie { --sy-line: var(--zombie); --sy-glow: rgba(195, 162, 255, 0.55); --sy-glow-wide: rgba(195, 162, 255, 0.28); }
.sy-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.sy-ring { fill: none; stroke: rgba(255, 255, 255, 0.05); stroke-width: 1; stroke-dasharray: 2 6; }
.sy-line {
  fill: none; stroke: var(--sy-line, var(--accent)); stroke-linecap: round; stroke-dasharray: 0 9;
  animation: sy-flow 1.15s linear infinite; transition: opacity 0.2s ease;
}
@keyframes sy-flow { to { stroke-dashoffset: -9; } }
.has-focus .sy-line:not(.is-active) { opacity: 0.12 !important; }
.has-focus .sy-line.is-active { opacity: 1 !important; }

.sy-nodes { position: absolute; inset: 0; }
.sy-node {
  --s: 64px;
  position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); padding: 0; margin: 0;
  background: none; border: 0; border-radius: 50%; cursor: pointer; color: var(--text); transform-origin: 50% 50%;
  transition: transform 0.56s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease; will-change: transform;
}
.no-anim .sy-node { transition: none !important; }
.sy-art { display: block; width: 100%; height: 100%; border-radius: 50%; transition: opacity 0.2s ease, transform 0.2s ease; }
.sy-art img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; -webkit-user-drag: none; }
.sy-node:not(.is-center):hover .sy-art, .sy-node.is-active:not(.is-center) .sy-art { transform: scale(1.08); }
.has-focus .sy-node:not(.is-active):not(.is-center) .sy-art { opacity: 0.4; }
.sy-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.sy-node.is-center { cursor: default; z-index: 2; }
/* The glow traces each card's own outline (wide art like Line Dancing Zombie, tall art like Nurse Garg). */
.sy-art img { transition: filter 0.45s ease; }
.sy-node.is-center .sy-art img { filter: drop-shadow(0 0 2.5px var(--sy-glow, transparent)) drop-shadow(0 0 9px var(--sy-glow-wide, transparent)); }
.sy-node.is-leaving { pointer-events: none; }

.sy-badge {
  position: absolute; left: -8px; top: -4px; min-width: 30px; padding: 1px 5px; border-radius: 6px;
  background: #0e1315; border: 1px solid var(--line-2); color: var(--text); font: 700 11px/1.45 var(--sans); text-align: center; font-variant-numeric: tabular-nums;
}
.sy-badge:empty { display: none; }
.sy-label {
  position: absolute; left: 50%; top: calc(100% + 3px); width: 7.6em; transform: translateX(-50%);
  font: 600 11.5px/1.2 var(--sans); color: var(--body); text-align: center; pointer-events: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sy-node.is-center .sy-label { font: 800 10px/1.15 var(--sans); color: var(--text); width: 9em; top: calc(100% + 2px); }

.sy-empty {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(92%, 460px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; text-align: center; font-size: 15px; color: var(--body); z-index: 3;
}
.sy-empty p { margin: 0; }
.sy-try { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.sy-try .sy-chip { padding: 5px 9px; font-size: 13px; }

.sy-stage-note { grid-area: note; }
.sy-legend { margin: 8px 0 0; font-size: 13.5px; color: var(--muted); }

/* Before the data arrives: the stage stays calm, the static panel shows the default card. */
.sy-app:not(.is-ready) .sy-stage::after {
  content: "Loading card connections"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 15px;
}

/* ---------- Panel ---------- */

.sy-panel { grid-area: panel; min-width: 0; }
.sy-card-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; }
.sy-card-head img { width: 64px; height: 64px; object-fit: contain; }
.sy-card-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 26px; font-weight: 800; line-height: 1.15; margin: 0; }
.sy-card-name .sy-tier-badge { width: 34px; height: 34px; font-size: 17px; padding: 0; }
/* Grade badges use the same colors and dark square as deck grades (getVerdictGrade in app.js). */
.sy-tier-badge {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-width: 24px; height: 24px; padding: 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; background: rgba(14, 18, 21, 0.72);
  font-weight: 700; font-size: 13px; line-height: 1; color: #ffffff;
}
.sy-t-s { color: #00E5FF; } .sy-t-a { color: #4CAF50; } .sy-t-b { color: #8BC34A; }
.sy-t-c { color: #ffb300; } .sy-t-d { color: #ff8800; } .sy-t-f { color: #ff4b4b; }
.sy-muted { color: var(--dim); font-size: 13.5px; }
.sy-desc { margin: 14px 0 0; font-size: 15px; color: var(--body); border-left: 2px solid var(--line-2); padding-left: 12px; }
.sy-best { display: flex; flex-direction: column; gap: 1px; margin: 14px 0 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.sy-best-link { font-weight: 700; font-size: 16px; text-decoration: none; }
.sy-best-link:hover { text-decoration: underline; }
.sy-list-title { font-size: 16px; font-weight: 700; margin: 22px 0 8px; }
.sy-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sy-list li { margin: 0; }
.sy-row {
  width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) 72px; gap: 10px; align-items: center;
  padding: 7px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--body); text-align: left; cursor: pointer; font: inherit; text-decoration: none;
}
.sy-row img { width: 36px; height: 36px; object-fit: contain; }
.sy-row strong { display: block; font-size: 14.5px; line-height: 1.25; color: var(--text); }
.sy-row small { display: block; font-size: 12.5px; color: var(--dim); }
.sy-row:hover, .sy-row.is-active { background: rgba(255, 255, 255, 0.03); }
.sy-row:hover strong, .sy-row.is-active strong { color: var(--accent); }
.sy-bar { position: relative; height: 18px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.sy-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--sy-line, var(--accent)); opacity: 0.45; }
.sy-bar b { position: relative; display: block; text-align: right; padding-right: 6px; font-size: 12px; line-height: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.sy-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.sy-app.has-error .sy-stage::after { content: none; }

/* ---------- Strongest pairs ---------- */

.sy-pairs { max-width: 1200px; margin: 0 auto; padding: 40px 28px 16px; }
.sy-pairs h2 { margin: 0 0 16px; font-size: 24px; font-weight: 800; text-align: center; }
.sy-pair-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.sy-pair {
  display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; padding: 14px 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--text) !important; text-decoration: none; text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sy-pair:hover { border-color: var(--line-2); background: var(--surface-2); }
.sy-pair-cards { display: flex; align-items: center; gap: 2px; }
.sy-pair-cards img { width: 64px; height: 64px; object-fit: contain; }
.sy-pair-cards i { width: 22px; height: 0; border-top: 3px dotted var(--accent); opacity: 0.7; }
.sy-pair-names { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.sy-pair-names span { color: var(--dim); font-weight: 400; }
.sy-pair-count { font-size: 12.5px; color: var(--dim); }

/* ---------- Footer (matches the home app) ---------- */

.sy-footer { margin-top: 24px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.sy-footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 26px 24px 40px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 32px; color: var(--dim); font-size: 13.5px; line-height: 1.5; }
.sy-footer-inner p { margin: 0; }
.sy-footer-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.sy-footer-contact span { display: inline-flex; align-items: center; gap: 6px; }
.sy-footer-contact img { width: 16px; height: 16px; border-radius: 3px; }
.sy-footer-contact strong { color: var(--accent); font-weight: 600; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .sy-app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "controls" "stage" "panel"; }
  .sy-panel { max-width: 640px; width: 100%; justify-self: center; }
  .sy-pair-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .sy-topbar-inner { flex-direction: column; justify-content: center; padding: 8px 10px; gap: 2px; }
  .sy-updated { font-size: 12.5px; }
  .sy-back { font-size: 14px; height: 36px; }
  .sy-brand { padding: 22px 10px 4px; }
  .sy-brand-row { gap: 10px; }
  .sy-brand img { width: 42px; height: 42px; }
  .sy-brand span { font-size: 39px; }
  .sy-title { margin-top: 10px; }
  .sy-title h1 { font-size: 30px; }
  .sy-title p { font-size: 15.5px; }
  .sy-app { padding: 0 14px 4px; gap: 12px; }
  .sy-controls { gap: 8px; }
  .sy-search { flex: 1 1 100%; }
    .sy-chip { font-size: 13px; padding: 9px 10px; }
  .sy-stage { height: auto; aspect-ratio: 1 / 1.08; min-height: 360px; max-height: 560px; border-radius: 12px; }
  .sy-label { font-size: 10.5px; width: 6.6em; }
  .sy-badge { font-size: 10px; min-width: 26px; left: -10px; }
  .sy-card-name { font-size: 23px; }
  .sy-pairs { padding: 32px 14px 8px; }
  .sy-pair-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .sy-pair-cards img { width: 52px; height: 52px; }
  .sy-footer-inner { flex-direction: column; align-items: flex-start; padding: 22px 14px 32px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .sy-line { animation: none; stroke-dasharray: 0 7; }
  .sy-node, .sy-art { transition: none !important; }
  .sy-effect:hover { animation: none; }
}
