/* Self-contained season -> player market map. */
.home-season-heatmap { position:relative; margin-top:24px; padding-top:20px; border-top:1px solid var(--ui-line); min-width:0; }
.hm-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.hm-heading h3 { margin:0; font-size:18px; }
.hm-controls { display:flex; align-items:center; gap:14px; }
.hm-periods { display:flex; gap:8px; }
.hm-periods button { background:none; border:0; border-bottom:2px solid transparent; padding:8px 6px; min-height:36px; color:var(--ui-muted); font-size:12px; cursor:pointer; }
.hm-periods button[aria-pressed=true] { border-color:var(--ui-ink); color:var(--ui-ink); font-weight:700; }
body.user-service .hm-strength { width:auto; min-width:70px; }
.hm-strength .market-select-trigger { display:flex; align-items:center; gap:5px; min-width:70px; padding:7px 10px; border:1px solid var(--ui-line); border-radius:4px; color:var(--ui-ink); background:var(--ui-surface); cursor:pointer; }
.hm-strength .market-select-menu { min-width:100px; left:auto; right:0; }
.hm-strength .market-select-menu[hidden] { display:none; }
.hm-strength .market-select-options button { display:flex; gap:6px; align-items:center; width:100%; min-height:36px; padding:8px; border:0; background:var(--ui-surface); color:var(--ui-ink); cursor:pointer; }
.hm-stage { position:relative; height:600px; width:100%; overflow:hidden; background:var(--ui-surface-subtle); }
.hm-stage > .hmi-skeleton { position:absolute; inset:0; opacity:.3; }
.hm-group { position:absolute; box-sizing:border-box; border:1px solid var(--hm-grid-line,#fff); background:var(--ui-surface-subtle); }
.hm-group-header { position:absolute; left:0; top:0; width:100%; display:flex; align-items:center; gap:4px; box-sizing:border-box; overflow:hidden; padding:1px 4px; color:var(--ui-ink); text-decoration:none; background:var(--ui-surface-subtle); }
.hm-group-header img { display:block; width:24px; max-width:100%; height:18px; max-height:100%; object-fit:contain; }
.hm-tile { position:absolute; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; box-sizing:border-box; border:1px solid var(--hm-grid-line,#fff); border-radius:0; padding:0 2px; overflow:hidden; color:var(--hm-tile-ink,#111); background:#f1f3f6; cursor:pointer; font-family:inherit; }
.hm-tile:hover,.hm-tile:focus-visible,.hm-group-header:focus-visible { z-index:3; outline:2px solid var(--hm-tile-ink,#111); outline-offset:-3px; }
.hm-tile img { display:block; width:var(--hm-face-size,36px); height:var(--hm-face-size,36px); object-fit:contain; flex:none; }
.hm-tile .hm-name { display:block; max-width:100%; font-size:var(--hm-font-size,12px); line-height:1.2; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hm-tile .hm-change { font-size:var(--hm-font-size,12px); line-height:1.2; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
.home-season-heatmap footer { display:flex; justify-content:space-between; flex-wrap:wrap; align-items:center; gap:8px; margin-top:8px; color:var(--ui-muted); font-size:11px; }
.hm-legend { display:inline-flex; align-items:center; gap:5px; }
.hm-legend i { display:block; width:72px; height:7px; background:linear-gradient(90deg,#3466c0,#f1f3f6,#c83c4f); }
.hm-tooltip { position:absolute; z-index:40; display:grid; gap:8px; width:max-content; max-width:min(320px,100%); box-sizing:border-box; padding:12px; border:1px solid var(--ui-line); border-radius:3px; background:var(--ui-surface); color:var(--ui-ink); box-shadow:0 4px 18px #0003; pointer-events:none; font-size:12px; }
.hm-tooltip[hidden] { display:none; }
.hm-tooltip-head { display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-weight:700; }
.hm-tooltip-head img { width:24px; height:20px; object-fit:contain; }
.hm-tooltip-row { display:flex; justify-content:space-between; gap:24px; font-variant-numeric:tabular-nums; }
.hm-tooltip-row span,.hm-tooltip small { color:var(--ui-muted); font-size:11px; }
.hm-tooltip-name { overflow-wrap:anywhere; }
.hm-empty { padding:20px; color:var(--ui-muted); font-size:13px; }
.hm-empty button { padding:8px; margin-left:8px; cursor:pointer; }
@media(max-width:1000px) { .hm-stage { height:680px; } }
@media(max-width:767px) {
 .home-season-heatmap { margin-top:18px; padding-top:16px; }
 .hm-heading { flex-wrap:wrap; gap:8px; }
 .hm-heading h3 { font-size:16px; }
 .hm-controls { margin-left:auto; gap:8px; }
 .hm-periods { gap:4px; }
 .hm-periods button,.hm-strength .market-select-trigger,.hm-strength .market-select-options button { min-height:44px; }
 .hm-stage { height:960px; }
 .home-season-heatmap footer { justify-content:flex-start; font-size:10px; }
 .hm-legend { margin-left:auto; }
}

/* Shared chart, compact home summary and full market explorer. */
.market-heatmap { position:relative; min-width:0; }
.hm-page-heading h1 { margin:0 0 20px; font-size:24px; }
.hm-view-tabs { display:flex; gap:24px; margin:0 0 16px; border-bottom:1px solid var(--ui-line); }
.hm-view-tabs button { padding:10px 0; min-height:44px; border:0; border-bottom:2px solid transparent; background:none; color:var(--ui-muted); font-size:14px; cursor:pointer; }
.hm-view-tabs button[aria-pressed=true] { border-color:var(--ui-ink); color:var(--ui-ink); font-weight:700; }
.hm-toolbar { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.hm-toolbar .hm-periods { margin-left:auto; }
.hm-home-basis { display:inline-flex; align-items:center; gap:5px; font-size:11px; color:var(--ui-muted); }
.hm-select .market-select-trigger { display:flex; align-items:center; gap:5px; width:100%; min-height:36px; padding:7px 10px; border:1px solid var(--ui-line); border-radius:4px; color:var(--ui-ink); background:var(--ui-surface); cursor:pointer; font-size:12px; }
body.user-service .hm-select { width:auto; min-width:76px; }
body.user-service .hm-season { width:180px; }
.hm-select .market-select-menu[hidden] { display:none; }
.hm-select .market-select-menu { min-width:160px; z-index:10; }
.hm-season .market-select-menu { min-width:220px; }
.hm-select .market-select-options button { display:flex; align-items:center; gap:6px; width:100%; min-height:36px; padding:8px; border:0; background:var(--ui-surface); color:var(--ui-ink); text-align:left; cursor:pointer; font-size:12px; }
.hm-select .market-select-menu input { box-sizing:border-box; width:100%; padding:8px; margin-bottom:6px; border:1px solid var(--ui-line); border-radius:4px; background:var(--ui-surface); color:var(--ui-ink); font-size:16px; }
.hm-stage { height:620px; }
.hm-home .hm-stage { height:280px; }
.hm-tile { text-decoration:none; }
.hm-tile:hover { color:var(--hm-tile-ink,#111); text-decoration:none; }
.hm-season-tile img { width:var(--hm-badge-size,36px); height:var(--hm-badge-size,36px); }
.hm-other { font-size:12px; font-weight:600; white-space:nowrap; }
.hm-highlights { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-bottom:14px; }
.hm-highlight { display:grid; gap:6px; min-width:0; color:var(--ui-ink); text-decoration:none; }
.hm-highlight>span { color:var(--ui-muted); font-size:11px; }
.hm-highlight>strong { display:flex; align-items:center; gap:7px; font-size:18px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.hm-highlight img { width:28px; height:24px; object-fit:contain; }
.hm-highlight:hover { text-decoration:none; }
.hm-highlight:focus-visible { outline:2px solid var(--ui-focus); outline-offset:3px; }
.market-heatmap footer { position:relative; display:flex; justify-content:space-between; flex-wrap:wrap; align-items:center; gap:8px; margin-top:8px; color:var(--ui-muted); font-size:11px; }
.hm-method { position:relative; }
.hm-method summary { list-style:none; cursor:pointer; font-size:13px; padding:4px; }
.hm-method summary::-webkit-details-marker { display:none; }
.hm-method>div { position:absolute; z-index:20; right:0; bottom:calc(100% + 6px); width:280px; max-width:calc(100vw - 40px); box-sizing:border-box; padding:12px; border:1px solid var(--ui-line); border-radius:3px; background:var(--ui-surface); color:var(--ui-muted); box-shadow:0 4px 16px #0002; font-size:12px; line-height:1.6; }
@media(max-width:767px) {
 .hm-page-heading h1 { font-size:20px; }
 .hm-toolbar { flex-wrap:wrap; gap:8px; }
 body.user-service .hm-season { width:140px; }
 .hm-toolbar .hm-periods { margin-left:auto; }
 .hm-select .market-select-trigger,.hm-select .market-select-options button { min-height:44px; }
 .hm-stage { height:580px; }
 .hm-players-view .hm-stage { height:960px; }
 .hm-home .hm-stage { height:260px; }
 .hm-highlights { gap:8px; }
 .hm-highlight>strong { gap:4px; font-size:15px; }
 .hm-highlight img { width:22px; height:20px; }
 .market-heatmap footer { font-size:10px; }
 .hm-method { margin-left:auto; }
 .hm-method summary { min-width:36px; min-height:36px; display:flex; align-items:center; justify-content:center; }
}

/* Home: one heading row, one compact metric row. */
.hm-home .hm-heading { flex-wrap:nowrap; gap:16px; margin-bottom:8px; }
.hm-home .hm-heading h3 { flex:none; white-space:nowrap; }
.hm-home .hm-heading .hm-periods { margin-left:auto; }
.hm-home .hm-more { flex:none; white-space:nowrap; }
.hm-home .hm-summary-row { gap:24px; margin-bottom:12px; }
.hm-home .hm-home-basis { flex:none; }
.hm-home .hm-highlights { flex:1; gap:24px; margin:0; }
.hm-home .hm-highlight { display:flex; align-items:center; gap:8px; min-height:32px; }
.hm-home .hm-highlight>span { flex:none; white-space:nowrap; }
.hm-home .hm-highlight>strong { gap:6px; font-size:16px; }
.hm-home .hm-highlight img { width:24px; height:20px; }
.market-heatmap .hmi-up { color:#bc4147; }
.market-heatmap .hmi-down { color:#3466c0; }
:root[data-theme="dark"] .market-heatmap .hmi-up { color:#f28b90; }
:root[data-theme="dark"] .market-heatmap .hmi-down { color:#8bb5fa; }
@media(max-width:767px) {
 .hm-home .hm-heading { gap:8px; }
 .hm-home .hm-more { display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; font-size:16px; text-decoration:none; }
 .hm-home .hm-more>span { display:none; }
 .hm-home .hm-summary-row { flex-wrap:nowrap; gap:8px; }
 .hm-home .hm-highlights { gap:6px; }
 .hm-home .hm-highlight { gap:3px; }
 .hm-home .hm-highlight>span { font-size:0; }
 .hm-home .hm-highlight>span::after { content:attr(data-compact); font-size:10px; }
 .hm-home .hm-highlight>strong { gap:3px; font-size:13px; }
 .hm-home .hm-highlight img { width:18px; height:18px; }
 .hm-home .hm-home-basis { gap:2px; font-size:10px; }
}

:root[data-theme="dark"] .market-heatmap { --hm-grid-line:#20242c; }

/* Player identity takes priority over names in dense tiles. */
.hm-tile[data-card] { gap:2px; }
.hm-tile[data-card] img { max-width:100%; max-height:100%; }

.hm-detail .hm-season-fixed { font-size:12px; color:var(--ui-muted); white-space:nowrap; }
.hm-detail .hm-season[hidden],.hm-detail .hm-season-fixed[hidden] { display:none; }

/* Readable scale, and card search that preserves the full market layout. */
.hm-legend-scale { display:grid; gap:3px; width:104px; }
.hm-legend-values { display:flex; justify-content:space-between; font-variant-numeric:tabular-nums; font-size:10px; }
.hm-legend .hm-legend-scale i { width:100%; }
.hm-player-search { display:flex; align-items:center; flex:0 1 320px; gap:8px; margin:0; min-width:120px; min-height:36px; }
.hm-player-search[hidden] { display:none; }
.hm-search-field { position:relative; flex:1; width:auto; max-width:100%; min-width:0; }
.hm-player-search input { box-sizing:border-box; width:100%; height:36px; padding:7px 36px 7px 10px; border:1px solid var(--ui-line); border-radius:4px; background:var(--ui-surface); color:var(--ui-ink); font:inherit; font-size:13px; }
.hm-player-search input::-webkit-search-cancel-button { -webkit-appearance:none; }
.hm-search-field button { position:absolute; right:0; top:0; width:36px; height:36px; padding:0; border:0; background:none; color:var(--ui-muted); font-size:20px; cursor:pointer; }
.hm-search-field button[hidden] { display:none; }
.hm-search-status { font-size:12px; color:var(--ui-muted); white-space:nowrap; font-variant-numeric:tabular-nums; }
.market-heatmap .hm-stage .hm-tile.hm-search-match { z-index:2; border:2px solid var(--hm-tile-ink,#111); box-shadow:inset 0 0 0 1px var(--ui-surface); }
.hm-searching .hm-tile:not(.hm-search-match) { opacity:.55; }
.hm-tile.hm-search-match:focus-visible { z-index:3; outline:2px solid var(--ui-focus); outline-offset:-3px; }
@media(max-width:767px) {
 .hm-search-field { flex:1; width:auto; }
 .hm-player-search { gap:8px; }
}

.hm-player-search input::placeholder { font-size:13px; }
.hm-tile[data-card] .hm-name { width:calc(100% - 8px); flex:none; font-size:var(--hm-name-size,13px); }
@media(max-width:767px) {
 .hm-detail .hm-toolbar { position:relative; }
 body.user-service .hm-detail.hm-players-view .hm-season { width:110px; min-width:110px; flex:none; }
 .hm-detail .hm-strength { flex:none; }
 .hm-player-search { flex:1; min-height:44px; }
 .hm-player-search input { height:44px; padding-right:44px; font-size:13px; }
 .hm-search-field button { width:44px; height:44px; }
}
@media(max-width:480px) {
 .hm-detail.hm-players-view .hm-toolbar .hm-periods { flex-basis:100%; justify-content:flex-end; }
 .hm-search-status { position:absolute; left:0; bottom:12px; }
}
