/* HandballNet 4.0 – clear, calm, data-first interface. */

#hbn-pro.hbn4-ready {
  --hbn-blue: #075fc7;
  --hbn-blue-dark: #064493;
  --hbn-navy: #102445;
  --hbn-gold: #eeb927;
  --hbn-green: #07855b;
  --hbn-radius: 14px;
  --hbn-radius-lg: 20px;
  letter-spacing: -0.005em;
}

#hbn-pro .hbn2-head {
  position: relative;
  z-index: 5;
}

#hbn-pro .hbn2-main-nav {
  scrollbar-width: none;
}

#hbn-pro .hbn2-main-nav::-webkit-scrollbar,
#hbn-pro .hbn2-detail-tabs::-webkit-scrollbar {
  display: none;
}

.hbn4-ssr {
  display: grid;
  gap: 16px;
}

.hbn4-ssr-head {
  padding: 26px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--hbn-blue) 20%, var(--hbn-line));
  border-radius: var(--hbn-radius-lg);
  background:
    radial-gradient(circle at 90% 0, rgba(238, 185, 39, .18), transparent 34%),
    linear-gradient(135deg, color-mix(in srgb, var(--hbn-blue) 9%, var(--hbn-surface)), var(--hbn-surface));
}

.hbn4-eyebrow,
.hbn4-stats-hero > span,
.hbn4-comparison-head > span,
.hbn4-section-head span,
.hbn4-methodology > div > span,
.hbn4-compare-builder > div > span,
.hbn4-analytics-head > div > span {
  color: var(--hbn-blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hbn4-ssr-head h1,
.hbn4-stats-hero h1,
.hbn4-comparison-head h1 {
  margin: 7px 0 8px;
  color: var(--hbn-text);
  font-size: clamp(25px, 4vw, 40px);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.hbn4-ssr-head p,
.hbn4-stats-hero p,
.hbn4-comparison-head p {
  max-width: 820px;
  margin: 0;
  color: var(--hbn-muted);
  font-size: 14px;
  line-height: 1.65;
}

.hbn4-ssr-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--hbn-line);
  border-radius: var(--hbn-radius-lg);
  background: var(--hbn-surface);
}

.hbn4-ssr-game {
  display: grid;
  grid-template-columns: minmax(100px, .5fr) minmax(250px, 2fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--hbn-line);
  color: var(--hbn-text);
  text-decoration: none;
}

.hbn4-ssr-game:last-child { border-bottom: 0; }
.hbn4-ssr-game:hover { background: color-mix(in srgb, var(--hbn-blue) 5%, var(--hbn-surface)); }
.hbn4-ssr-game span { overflow: hidden; color: var(--hbn-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.hbn4-ssr-game b { font-size: 14px; }
.hbn4-ssr-game strong { min-width: 66px; color: var(--hbn-blue); font-size: 18px; text-align: right; }

.hbn4-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 25px;
  border: 1px solid var(--hbn-line);
  border-radius: var(--hbn-radius-lg);
  background: var(--hbn-surface);
  text-align: center;
}

.hbn4-scoreboard > div { display: grid; gap: 6px; }
.hbn4-scoreboard > div b { font-size: clamp(16px, 2.4vw, 24px); }
.hbn4-scoreboard > div a { color: var(--hbn-blue); font-size: 12px; font-weight: 750; text-decoration: none; }
.hbn4-scoreboard > strong { color: var(--hbn-navy); font-size: clamp(36px, 7vw, 64px); letter-spacing: -.08em; }
.hbn4-scoreboard > strong i { padding: 0 7px; color: var(--hbn-muted); font-size: .65em; font-style: normal; }
#hbn-pro[data-theme="dark"] .hbn4-scoreboard > strong { color: #fff; }

.hbn4-metrics,
.hbn4-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hbn4-metrics > div,
.hbn4-metric {
  display: grid;
  min-width: 0;
  min-height: 96px;
  align-content: center;
  gap: 5px;
  padding: 15px;
  border: 1px solid var(--hbn-line);
  border-radius: var(--hbn-radius);
  background: var(--hbn-surface);
}

.hbn4-metric {
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .24s ease, transform .24s ease, border-color .2s ease;
}

.hbn4-metric.is-revealed,
.hbn4-metric-grid:not(:has(.is-revealed)) .hbn4-metric { opacity: 1; transform: none; }
.hbn4-metric:hover { border-color: color-mix(in srgb, var(--hbn-blue) 35%, var(--hbn-line)); }
.hbn4-metrics span,
.hbn4-metric span { overflow: hidden; color: var(--hbn-muted); font-size: 11px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.hbn4-metrics b,
.hbn4-metric b { color: var(--hbn-text); font-size: clamp(20px, 3vw, 28px); line-height: 1; letter-spacing: -.035em; }
.hbn4-metric small { overflow: hidden; color: var(--hbn-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.hbn4-method {
  margin: 0;
  padding: 11px 14px;
  border-left: 3px solid var(--hbn-blue);
  background: var(--hbn-surface-2);
  color: var(--hbn-muted);
  font-size: 12px;
  line-height: 1.6;
}

.hbn4-compare,
.hbn4-comparison-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.hbn4-compare > section,
.hbn4-comparison-grid > section {
  padding: 18px;
  border: 1px solid var(--hbn-line);
  border-radius: var(--hbn-radius-lg);
  background: var(--hbn-surface);
}

.hbn4-compare > i,
.hbn4-versus {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  align-self: center;
  justify-self: center;
  border-radius: 50%;
  background: var(--hbn-navy);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.hbn4-related {
  padding: 20px;
  border: 1px solid var(--hbn-line);
  border-radius: var(--hbn-radius-lg);
  background: var(--hbn-surface);
}

.hbn4-related h2 { margin: 0 0 12px; font-size: 18px; }
.hbn4-related > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hbn4-related a { display: grid; gap: 6px; padding: 13px; border-radius: 11px; background: var(--hbn-surface-2); color: var(--hbn-text); text-decoration: none; }
.hbn4-related a:hover b { color: var(--hbn-blue); }
.hbn4-related b { font-size: 13px; line-height: 1.45; }
.hbn4-related span { color: var(--hbn-muted); font-size: 10px; }

.hbn4-stats-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 5vw, 48px);
  border-radius: var(--hbn-radius-lg);
  background:
    radial-gradient(circle at 87% 15%, rgba(238, 185, 39, .35), transparent 25%),
    linear-gradient(135deg, #0c2e61, #0767d4 72%, #1181e4);
  color: #fff;
  box-shadow: 0 18px 45px rgba(7, 73, 151, .2);
}

.hbn4-stats-hero::after {
  position: absolute;
  right: -45px;
  bottom: -90px;
  width: 270px;
  height: 270px;
  border: 42px solid rgba(255,255,255,.08);
  border-radius: 50%;
  content: "";
}

.hbn4-stats-hero > span { color: #ffd65d; }
.hbn4-stats-hero h1,
.hbn4-stats-hero p { position: relative; z-index: 1; color: #fff; }
.hbn4-stats-hero p { max-width: 720px; color: rgba(255,255,255,.8); }
.hbn4-stats-hero > div { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.hbn4-stats-hero > div b { padding: 7px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; background: rgba(255,255,255,.1); font-size: 11px; }

.hbn4-compare-builder {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(2, minmax(150px, .8fr)) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
  padding: 18px;
  border: 1px solid var(--hbn-line);
  border-radius: var(--hbn-radius-lg);
  background: var(--hbn-surface);
}

.hbn4-compare-builder h2 { margin: 4px 0 0; font-size: 18px; line-height: 1.25; }
.hbn4-compare-builder label { display: grid; gap: 5px; color: var(--hbn-muted); font-size: 10px; font-weight: 750; }
.hbn4-compare-builder select { width: 100%; min-height: 43px; padding: 8px 34px 8px 10px; border: 1px solid var(--hbn-line); border-radius: 10px; background: var(--hbn-surface-2); color: var(--hbn-text); }
.hbn4-compare-builder > button { min-height: 43px; padding: 8px 14px; border: 0; border-radius: 10px; background: var(--hbn-blue); color: #fff !important; font-weight: 800; cursor: pointer; }
.hbn4-compare-builder > button:hover { background: var(--hbn-blue-dark); }

.hbn4-section,
.hbn4-methodology,
.hbn4-h2h-summary {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid var(--hbn-line);
  border-radius: var(--hbn-radius-lg);
  background: var(--hbn-surface);
}

.hbn4-section-head { display: flex; justify-content: space-between; gap: 15px; align-items: end; margin-bottom: 13px; }
.hbn4-section-head h2,
.hbn4-methodology h2,
.hbn4-h2h-summary h2 { margin: 3px 0 0; font-size: 20px; }
.hbn4-section-head small { color: var(--hbn-muted); }

.hbn4-top-team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hbn4-top-team {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 1px 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--hbn-line);
  border-radius: 12px;
  background: var(--hbn-surface-2);
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(7px);
  transition: .2s ease;
}
.hbn4-top-team.is-revealed { opacity: 1; transform: none; }
.hbn4-top-team:hover { border-color: var(--hbn-blue); transform: translateY(-1px); }
.hbn4-rank { display: grid; grid-row: 1 / 3; width: 28px; height: 28px; place-items: center; border-radius: 9px; background: var(--hbn-navy); color: #fff; font-size: 11px; font-weight: 850; }
.hbn4-top-team > div { min-width: 0; }
.hbn4-top-team > div b,.hbn4-top-team > div small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbn4-top-team > div b { font-size: 13px; }
.hbn4-top-team > div small { color: var(--hbn-muted); font-size: 10px; }
.hbn4-top-team > strong { grid-row: 1 / 2; color: var(--hbn-blue); font-size: 22px; }
.hbn4-top-team > em { grid-column: 3; color: var(--hbn-muted); font-size: 9px; font-style: normal; }

.hbn4-methodology { display: grid; grid-template-columns: 1.25fr repeat(3, 1fr); gap: 14px; align-items: start; }
.hbn4-methodology article { padding-left: 13px; border-left: 2px solid color-mix(in srgb, var(--hbn-blue) 30%, var(--hbn-line)); }
.hbn4-methodology article b { font-size: 12px; }
.hbn4-methodology article p { margin: 4px 0 0; color: var(--hbn-muted); font-size: 11px; line-height: 1.5; }

.hbn4-comparison-head { padding: 22px; border: 1px solid var(--hbn-line); border-radius: var(--hbn-radius-lg); background: var(--hbn-surface); text-align: center; }
.hbn4-comparison-head h1 i { color: var(--hbn-gold); font-style: normal; }
.hbn4-comparison-head p { margin-inline: auto; }
.hbn4-comparison-grid { margin-top: 14px; }
.hbn4-comparison-grid h2 { margin: 0 0 13px; font-size: 18px; text-align: center; }
.hbn4-comparison-grid .hbn4-metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.hbn4-h2h-summary > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.hbn4-h2h-summary > p { color: var(--hbn-muted); font-size: 11px; }

.hbn4-form-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.hbn4-form-line > span { margin-right: auto; color: var(--hbn-muted); font-size: 11px; font-weight: 750; }
.hbn4-form-line i { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; color: #fff; font-size: 9px; font-style: normal; font-weight: 900; }
.hbn4-form-line i.is-win { background: var(--hbn-green); }
.hbn4-form-line i.is-draw { background: #cc8c08; }
.hbn4-form-line i.is-loss { background: #c33b4d; }

.hbn4-analytics-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.hbn4-analytics-head h3 { margin: 3px 0 0; font-size: 20px; }
.hbn4-window-tabs { display: flex; gap: 5px; padding: 4px; border-radius: 11px; background: var(--hbn-surface-2); }
.hbn4-window-tabs button { padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--hbn-muted); font-size: 11px; font-weight: 800; cursor: pointer; }
.hbn4-window-tabs button.is-active { background: var(--hbn-blue); color: #fff !important; }
.hbn4-split-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 15px; }
.hbn4-split-grid > section { padding: 14px; border: 1px solid var(--hbn-line); border-radius: 14px; background: var(--hbn-surface-2); }
.hbn4-split-grid h4 { margin: 0 0 10px; }
.hbn4-split-grid .hbn4-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.hbn4-split-grid .hbn4-metric { min-height: 83px; background: var(--hbn-surface); }

.hbn4-top-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.hbn4-top-form a { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 8px; align-items: center; padding: 12px; border: 1px solid var(--hbn-line); border-radius: 12px; background: var(--hbn-surface); color: var(--hbn-text); text-decoration: none; }
.hbn4-top-form a span { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: var(--hbn-navy); color:#fff; font-size:10px; }
.hbn4-top-form a b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hbn4-top-form a strong { color:var(--hbn-blue); font-size:20px; }
.hbn4-top-form a small { grid-column:3; color:var(--hbn-muted); font-size:9px; }

.hbn4-empty { padding: 28px; border: 1px dashed var(--hbn-line); border-radius: var(--hbn-radius-lg); background: var(--hbn-surface); text-align: center; }
.hbn4-empty b { display:block; margin-bottom:5px; font-size:17px; }
.hbn4-empty p { margin:0; color:var(--hbn-muted); }

.hbn4-toast { position:fixed; z-index:99999; right:20px; bottom:20px; max-width:min(360px,calc(100vw - 32px)); padding:11px 15px; border-radius:12px; background:#14213d; color:#fff; box-shadow:0 12px 35px rgba(0,0,0,.25); font-size:12px; font-weight:700; opacity:0; pointer-events:none; transform:translateY(15px); transition:.22s ease; }
.hbn4-toast.is-visible { opacity:1; transform:none; }
.hbn4-toast.is-success { background:#08734e; }
.hbn4-toast.is-warning { background:#9b6000; }
#hbn-pro.is-offline .hbn2-connection i { background:#e49b11; }

@media (max-width: 1180px) {
  .hbn4-metric-grid,.hbn4-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .hbn4-compare-builder { grid-template-columns:1fr 1fr; }
  .hbn4-compare-builder > div { grid-column:1 / -1; }
  .hbn4-methodology { grid-template-columns:1fr 1fr; }
}

@media (max-width: 900px) {
  .hbn4-metric-grid,.hbn4-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .hbn4-related > div { grid-template-columns:1fr; }
  .hbn4-compare,.hbn4-comparison-grid { grid-template-columns:1fr; }
  .hbn4-compare > i,.hbn4-versus { margin:-4px auto; }
  .hbn4-methodology { grid-template-columns:1fr; }
  .hbn4-methodology article { padding:0 0 0 12px; }
}

@media (max-width: 680px) {
  #hbn-pro { width:100%; margin:0 auto 64px; border-right:0; border-left:0; border-radius:0; }
  #hbn-pro .hbn2-main { padding:10px; }
  #hbn-pro .hbn2-main-nav { overflow-x:auto; justify-content:flex-start; padding-inline:10px; }
  #hbn-pro .hbn2-main-nav button { flex:0 0 auto; }
  #hbn-pro .hbn2-mobile-nav { grid-template-columns:repeat(5,minmax(0,1fr)); padding-inline:4px; }
  #hbn-pro .hbn2-mobile-nav button { min-width:0; padding-inline:2px; font-size:9px; }
  .hbn4-ssr-head,.hbn4-stats-hero,.hbn4-comparison-head { padding:20px; }
  .hbn4-ssr-game { grid-template-columns:1fr auto; gap:4px 10px; }
  .hbn4-ssr-game span { grid-column:1 / -1; }
  .hbn4-ssr-game b { white-space:normal; }
  .hbn4-scoreboard { grid-template-columns:1fr; gap:10px; padding:18px; }
  .hbn4-scoreboard > strong { grid-row:2; }
  .hbn4-compare-builder { grid-template-columns:1fr; }
  .hbn4-compare-builder > div { grid-column:auto; }
  .hbn4-compare-builder > button { width:100%; }
  .hbn4-top-team-grid,.hbn4-top-form { grid-template-columns:1fr; }
  .hbn4-section-head,.hbn4-analytics-head { display:block; }
  .hbn4-section-head small { display:block; margin-top:5px; }
  .hbn4-window-tabs { width:100%; margin-top:10px; }
  .hbn4-window-tabs button { flex:1; }
  .hbn4-split-grid { grid-template-columns:1fr; }
  .hbn4-h2h-summary > div { grid-template-columns:1fr; }
  .hbn4-toast { right:12px; bottom:74px; }
}

@media (max-width: 390px) {
  .hbn4-metric-grid,.hbn4-metrics,.hbn4-split-grid .hbn4-metric-grid { grid-template-columns:1fr 1fr; gap:7px; }
  .hbn4-metric,.hbn4-metrics > div { min-height:82px; padding:11px; }
  .hbn4-metric b,.hbn4-metrics b { font-size:20px; }
  .hbn4-section,.hbn4-methodology,.hbn4-h2h-summary { padding:14px; }
  .hbn4-comparison-grid > section { padding:12px; }
  .hbn4-comparison-grid .hbn4-metric-grid { grid-template-columns:1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hbn4-metric,.hbn4-top-team,.hbn4-toast { opacity:1; transform:none; transition:none; }
}

@media print {
  #hbn-pro .hbn2-head-actions,#hbn-pro .hbn2-main-nav,#hbn-pro .hbn2-left,#hbn-pro .hbn2-right,#hbn-pro .hbn2-mobile-nav,#hbn-pro .hbn2-toolbar { display:none !important; }
  #hbn-pro { width:100%; min-height:0; margin:0; border:0; box-shadow:none; }
  #hbn-pro .hbn2-layout { display:block; }
  #hbn-pro .hbn2-main { padding:0; }
}

