/* Scoped styles: NOTHING outside .hv-stats */
.hv-stats{
  max-width:1040px;
  margin:0 auto;
  padding:18px 14px 24px;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:linear-gradient(180deg, rgba(244,248,255,.9), rgba(255,255,255,0));
  border-radius:16px;
}
.hv-stats *{box-sizing:border-box}
.hv-stats code{font-size:.9em}

.hv-card{
  background:#fff;
  border:1px solid #e9eef5;
  border-radius:14px;
  padding:12px 14px;
  box-shadow:0 8px 22px rgba(21, 45, 85, .06);
}

.hv-stats__titlewrap{margin-bottom:12px}
.hv-stats__title{margin:0 0 6px;font-size:30px;letter-spacing:-.3px}
.hv-stats__sub{color:#51647d;font-size:13px;line-height:1.35}

.hv-field__label{font-size:11px;color:#6b7a90;margin:0 0 6px 2px}
.hv-control,.hv-search__input{
  width:100%;
  padding:10px 10px;
  border:1px solid #dbe5f2;
  border-radius:10px;
  background:#fff;
  outline:none;
}
.hv-control:focus,.hv-search__input:focus{border-color:#b9cff1;box-shadow:0 0 0 4px rgba(47,125,209,.10)}

.hv-stats__controls{
  display:grid;
  grid-template-columns: 1.1fr .7fr .7fr 2fr;
  gap:12px;
  align-items:end;
  margin-bottom:14px;
}
.hv-field--switch{display:flex;align-items:end}
.hv-switch{display:flex;align-items:center;gap:10px;font-size:13px;color:#34455a;user-select:none;padding:10px 2px}
.hv-switch input{width:44px;height:22px}

/* Search dropdown */
.hv-search{position:relative}
.hv-search__results{
  position:absolute;left:0;right:0;top:calc(100% + 8px);
  background:#fff;border:1px solid #dbe5f2;border-radius:12px;
  box-shadow:0 14px 30px rgba(0,0,0,.10);
  overflow:hidden;z-index:20;display:none
}
.hv-search__results.is-open{display:block}
.hv-search__results button{display:block;width:100%;text-align:left;padding:10px 12px;border:0;background:transparent;cursor:pointer}
.hv-search__results button:hover{background:#f3f7fd}
.hv-search__results .empty{padding:10px 12px;color:#6b7a90;font-size:13px}

/* KPIs */
.hv-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:12px 0}
.hv-kpi{position:relative;overflow:hidden}
.hv-kpi:before{
  content:"";
  position:absolute;inset:-30% -40% auto auto;
  width:160px;height:160px;
  background:radial-gradient(circle, rgba(47,125,209,.16), transparent 60%);
  transform:rotate(14deg);
}
.hv-kpi .t{font-size:12px;color:#6b7a90;position:relative}
.hv-kpi .v{font-size:28px;font-weight:800;margin-top:6px;position:relative}

/* Record cards */
.hv-records{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:10px 0 12px}
.hv-record .t{font-size:12px;color:#6b7a90}
.hv-record .n{font-weight:800;margin-top:8px}
.hv-record .s{font-size:12px;color:#6b7a90;margin-top:3px}
.hv-link{color:inherit;text-decoration:none}
.hv-link:hover{text-decoration:underline}

/* Progress */
.hv-progress{display:flex;flex-direction:column;gap:8px;margin:12px 0}
.hv-progress .bar{height:10px;background:#edf3fb;border-radius:999px;overflow:hidden}
.hv-progress .bar span{display:block;height:100%;background:#2f7dd1;width:0%}
.hv-progress .txt{font-size:12px;color:#6b7a90;text-align:center}

/* Club panel */
.hv-clubpanel{margin:12px 0;padding:16px 16px 14px}
.hv-clubpanel .head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}
.hv-clubpanel .name{font-weight:900;font-size:18px;line-height:1.1}
.hv-clubpanel .meta{font-size:12px;color:#6b7a90;display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.hv-pill{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid #e9eef5;border-radius:999px;background:#fbfdff}
.hv-clubpanel .rows{display:flex;flex-direction:column;gap:10px}
.hv-clubpanel .row{display:grid;grid-template-columns:1fr auto 240px;gap:12px;align-items:center}
.hv-clubpanel .lbl{color:#34455a}
.hv-clubpanel .val{font-weight:900;min-width:34px;text-align:right}
.hv-clubpanel .meter{height:10px;background:#edf3fb;border-radius:999px;overflow:hidden}
.hv-clubpanel .meter span{display:block;height:100%;background:#2f7dd1;width:0%}

/* Lists */
.hv-lists{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:12px}
.hv-list .h{font-weight:900;margin-bottom:10px}
.hv-list ol{margin:0;padding:0;list-style:none}
.hv-list li{
  display:grid;
  grid-template-columns:90px 1fr auto;
  gap:10px;
  align-items:center;
  padding:8px 0;
  border-bottom:1px dashed #edf0f6
}
.hv-list li:last-child{border-bottom:0}
.hv-rank{color:#6b7a90;font-variant-numeric:tabular-nums}
.hv-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hv-list b{font-variant-numeric:tabular-nums}
.hv-own{border-top:1px solid #e9eef5;margin-top:6px;padding-top:10px}
.hv-own .hv-rank{color:#2f7dd1;font-weight:800}
.hv-own b{font-weight:900}

.hv-footer{margin-top:14px;color:#6b7a90}

@media (max-width: 900px){
  .hv-stats__controls{grid-template-columns:1fr;gap:10px}
  .hv-kpis{grid-template-columns:repeat(2,1fr)}
  .hv-records{grid-template-columns:1fr}
  .hv-lists{grid-template-columns:1fr}
  .hv-clubpanel .row{grid-template-columns:1fr auto;grid-template-rows:auto auto;gap:6px}
  .hv-clubpanel .meter{grid-column:1 / -1}
  .hv-clubpanel .meta{justify-content:flex-start}
  .hv-list li{grid-template-columns:78px 1fr auto}
}


/* Tiles grid */
.hv-tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:12px}
.hv-tile .h{font-weight:900;margin-bottom:10px}
.hv-tile ol{margin:0;padding:0;list-style:none}
.hv-tile li{
  display:grid;
  grid-template-columns:28px 1fr auto;
  gap:10px;
  align-items:center;
  padding:8px 0;
  border-bottom:1px dashed #edf0f6
}
.hv-tile li:last-child{border-bottom:0}
.hv-tile .hv-rank{color:#6b7a90;font-variant-numeric:tabular-nums}
.hv-tile .hv-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hv-tile b{font-variant-numeric:tabular-nums}
.hv-tile .hv-own{border-top:1px solid #e9eef5;margin-top:6px;padding-top:10px}
.hv-tile .hv-own .hv-rank{color:#2f7dd1;font-weight:900}
@media (max-width: 900px){
  .hv-tiles{grid-template-columns:1fr}
}


/* Club panel */
.hv-clubhead{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.hv-clubhead__name{font-weight:900;font-size:18px}
.hv-badge{display:inline-flex;align-items:center;padding:6px 10px;border:1px solid #e7edf6;border-radius:999px;font-size:12px;color:#5a6b83;background:#fbfcff;margin-left:8px}
.hv-clubhead__right{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.hv-clubstats{display:grid;grid-template-columns:1fr auto;gap:10px;margin-top:12px}
.hv-clubstats__row{display:contents}
.hv-clubstats__label{color:#5a6b83}
.hv-clubstats__value{font-weight:900;font-variant-numeric:tabular-nums}

/* Ensure hidden works even if theme overrides */
.hv-stats [hidden]{display:none !important;}

.hv-search{position:relative}
.hv-search__results{position:absolute;left:0;right:0;top:100%;background:#fff;border:1px solid #e7edf6;border-radius:10px;box-shadow:0 12px 30px rgba(0,0,0,.08);margin-top:6px;max-height:280px;overflow:auto;z-index:9999}
.hv-search__item{padding:10px 12px;cursor:pointer}
.hv-search__item:hover{background:#f3f7ff}
.hv-search__empty{padding:10px 12px;color:#6b7a90}

/* Allow search dropdown to escape the controls card */
.hv-stats__controls{overflow:visible !important;}
.hv-field--search{position:relative; z-index:20;}
.hv-search__results{z-index:99999;}

/* Search results: in-flow list to avoid being clipped by theme containers */
.hv-stats .hv-search{position:relative}
.hv-stats .hv-search__results{position:static !important;left:auto;right:auto;top:auto;margin-top:8px}

.hv-stats .hv-stats__controls{overflow:visible !important;}

/* Floating dropdown (does not break layout) */
.hv-float-results{
  background:#fff;
  border:1px solid #e7edf6;
  border-radius:10px;
  box-shadow:0 12px 30px rgba(0,0,0,.08);
}
.hv-float-results .hv-search__item,
.hv-float-results .hv-search__empty{padding:10px 12px}
.hv-float-results .hv-search__item{cursor:pointer}
.hv-float-results .hv-search__item:hover{background:#f3f7ff}

/* Club panel meters */
.hv-clubstats{display:grid;grid-template-columns:1fr;gap:10px;margin-top:12px}
.hv-clubstats__item{display:grid;grid-template-columns:1fr;gap:6px}
.hv-clubstats__top{display:flex;justify-content:space-between;gap:12px;align-items:baseline}
.hv-meter{height:8px;border-radius:999px;background:#eef3fb;overflow:hidden}
.hv-meter > span{display:block;height:100%;background:#2f7dd1;border-radius:999px}


/* Club panel – classic inline rows */
.hv-clubrows{margin-top:12px;display:flex;flex-direction:column;gap:12px}
.hv-clubrow{display:grid;grid-template-columns: 220px 60px 1fr;align-items:center;gap:16px}
.hv-clubrow__label{color:#2c3a4f;font-weight:600}
.hv-clubrow__value{font-weight:900;font-variant-numeric:tabular-nums;text-align:right}
.hv-clubrow__meter{height:10px;border-radius:999px;background:#eef3fb;overflow:hidden}
.hv-clubrow__meter>span{display:block;height:100%;background:#2f7dd1;border-radius:999px}
@media (max-width: 720px){
  .hv-clubrow{grid-template-columns: 1fr 60px 1fr}
}

/* SVG icons (bundled in plugin) */
.hv-ico{width:18px;height:18px;display:inline-block;vertical-align:middle;opacity:.9}
.hv-clubrow__label{display:flex;align-items:center;gap:10px}

/* Inline SVG icons (no extra requests) */
.hv-ico{width:18px;height:18px;display:inline-block;flex:0 0 auto;opacity:.9;background-size:18px 18px;background-repeat:no-repeat;background-position:center;filter: none;}
.hv-ico--titles{background-image:url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2523000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%204h8v3a4%204%200%200%201-8%200V4z%22/%3E%3Cpath%20d%3D%22M6%204H4v3a4%204%200%200%200%204%204%22/%3E%3Cpath%20d%3D%22M18%204h2v3a4%204%200%200%201-4%204%22/%3E%3Cpath%20d%3D%22M12%2011v4%22/%3E%3Cpath%20d%3D%22M9%2021h6%22/%3E%3Cpath%20d%3D%22M10%2015h4%22/%3E%3C/svg%3E')}
.hv-ico--top3{background-image:url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2523000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2021V10h6v11%22/%3E%3Cpath%20d%3D%22M10%2021V3h4v18%22/%3E%3Cpath%20d%3D%22M14%2021V7h6v14%22/%3E%3Cpath%20d%3D%22M3%2021h18%22/%3E%3C/svg%3E')}
.hv-ico--prom{background-image:url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2523000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2019V5%22/%3E%3Cpath%20d%3D%22M5%2012l7-7%207%207%22/%3E%3C/svg%3E')}
.hv-ico--releg{background-image:url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2523000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%205v14%22/%3E%3Cpath%20d%3D%22M19%2012l-7%207-7-7%22/%3E%3C/svg%3E')}
.hv-ico--streak{background-image:url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2523000%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%2022s7-4%207-11c0-3-1.5-5.5-4-7-1%203-3%204-3%206%200-2-1-4-3-6-2.5%201.5-4%204-4%207%200%207%207%2011%207%2011z%22/%3E%3C/svg%3E')}

/* Compact own-row: show like list items */
.hv-tile ol li.hv-own{padding-top:10px;margin-top:10px;border-top:1px solid #eef2f7}
.hv-tile ol li.hv-own .hv-rank{min-width:42px}
.hv-tile ol li.hv-own .hv-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Tile header helpers */
.hv-tile .h{display:flex;align-items:center;gap:10px}
.hv-tile .hv-sub{margin-left:8px;font-size:12px;font-weight:600;color:#6b7a90;background:#f1f5fb;border:1px solid #e7edf6;padding:2px 8px;border-radius:999px}
.hv-tile .hv-help{margin-left:auto;font-size:12px;font-weight:700;color:#7d8aa0;cursor:help;user-select:none}

/* Help tooltip under tile headers (works on mobile) */
.hv-tile .hv-help{border:0;background:transparent;padding:0 6px;font:inherit;line-height:1;cursor:pointer;color:#7d8aa0}
.hv-tile .hv-help-tip{margin:8px 0 0 0;padding:10px 12px;border:1px solid #e7edf6;background:#f8fbff;border-radius:10px;color:#4c5c74;font-size:13px;line-height:1.35}

/* Inline SVG icon wrapper */
.hv-ico{width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;color:#6b7a90}
.hv-ico svg{width:18px;height:18px;display:block}

/* Rival compare */
.hv-compare{margin-top:12px;padding-top:10px;border-top:1px solid #eef3fb;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.hv-compare__t{font-weight:600}
.hv-compare__box{display:flex;align-items:center;gap:6px;flex:1;min-width:260px}
.hv-compare__box .hv-input{flex:1}
.hv-compare__x{border:1px solid #e5e7eb;background:#fff;border-radius:10px;padding:8px 10px;cursor:pointer}
.hv-compare__x:hover{background:#f8fafc}
.hv-clubrow__meter--rival span{background:#f59e0b}
.hv-clubrow--rival{opacity:.92}

/* Rival dropdown */
.hv-compare__box{position:relative}
.hv-rival-results{position:absolute;left:0;right:46px;top:42px;z-index:9999;background:#fff;border:1px solid #e7edf6;border-radius:10px;box-shadow:0 12px 30px rgba(0,0,0,.08);max-height:240px;overflow:auto;display:none}
.hv-rival-item{display:block;width:100%;text-align:left;padding:10px 12px;background:#fff;border:0;border-bottom:1px solid #f1f5fb;cursor:pointer}
.hv-rival-item:hover{background:#f8fafc}
.hv-rival-empty{padding:10px 12px;color:#64748b}

/* Rival row: de-emphasize and improve readability */
.hv-clubpanel .row-rival .lbl{color:#64748b;font-size:12px}
.hv-clubpanel .row-rival .val{color:#334155;font-size:12px;font-weight:600}
.hv-clubpanel .row-rival{margin-top:-6px}

/* Compare UI mobile */
@media (max-width: 720px){
  .hv-compare{flex-direction:column;align-items:stretch}
  .hv-compare__box{min-width:0;width:100%}
  .hv-compare__box .hv-input{width:100%}
  .hv-compare__x{align-self:flex-end}
}

/* Mode toggle */
.hv-mode{display:flex;gap:6px;align-items:center}
.hv-mode__btn{border:1px solid #e5e7eb;background:#fff;border-radius:999px;padding:6px 10px;font-size:12px;cursor:pointer}
.hv-mode__btn.is-active{background:#0b66ff1a;border-color:#0b66ff55}

/* Club panel title line */
.hv-clubpanel .name{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px}
.hv-title__vs{opacity:.65;font-weight:600}
.hv-title__seasons{opacity:.7;font-weight:600}

/* Club header title line */
.hv-clubtitle{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px}
.hv-clubtitle__vs{opacity:.65;font-weight:600}
.hv-clubtitle__seasons{opacity:.7;font-weight:600}

/* Legend */
.hv-legend{margin-top:14px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;overflow:hidden}
.hv-legend > summary{cursor:pointer;list-style:none;padding:12px 14px;font-weight:600;display:flex;align-items:center;gap:10px}
.hv-legend > summary::-webkit-details-marker{display:none}
.hv-legend > summary:after{content:"▾";margin-left:auto;opacity:.7;transition:transform .15s ease}
.hv-legend[open] > summary:after{transform:rotate(180deg)}
.hv-legend__body{padding:12px 14px;border-top:1px solid #eef2f7}
.hv-legend__body dl{display:grid;grid-template-columns:1fr;gap:10px;margin:0}
.hv-legend__body dt{font-weight:600}
.hv-legend__body dd{margin:2px 0 0 0;opacity:.9}
.hv-legend__note{margin:12px 0 0 0;font-size:12px;opacity:.75}

/* Hide legacy per-tile tooltip bubbles (Goldene Phase / Stiller Riese) if theme/plugin still outputs them */
.hv-tile h3:has(+ .hv-tt), .hv-tile .hv-tt{display:none !important}

/* Defensive: hide any tooltip/help bubbles inside tiles (only within stats module) */
.hv-stats .hv-tile .hv-tt,
.hv-stats .hv-tile .hv-tip,
.hv-stats .hv-tile .hv-tooltip,
.hv-stats .hv-tile .hv-help { display:none !important; }

/* Defensive: remove redundant Ø marker in Goldene Phase header */
.hv-stats .hv-tile:has(.h:contains("Goldene Phase")) .h .hv-pill,
.hv-stats .hv-tile:has(.h:contains("Goldene Phase")) .h .hv-badge { display:none !important; }
