/* ===== KonkoorCoach v8 enhancements: large charts, champions, group race ===== */

/* Full-size charts */
.kc-chart-full {
  margin: 16px 0 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 14px 12px;
  box-shadow: var(--shadow-sm);
}
.kc-chart-full .kc-chart-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--primary-500);
}
.kc-chart-full .kc-chart-desc strong {
  color: var(--navy);
  display: block;
  margin-bottom: 4px;
  font-size: 13.5px;
}
.kc-chart-full .chart-panel,
.kc-chart-full svg {
  width: 100% !important;
  max-width: 100%;
  min-height: 280px;
}
.kc-chart-full .chart-title {
  font-size: 15px !important;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 6px;
}
.kc-chart-fs-btn {
  float: left;
  margin: 0 0 8px 8px;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--navy);
  cursor: pointer;
  font-family: inherit;
}
.kc-chart-fs-btn:hover { background: var(--primary-50); }

/* Fullscreen modal for charts */
.kc-fs-overlay {
  position: fixed; inset: 0; z-index: 99990;
  background: rgba(8, 20, 40, 0.88);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.kc-fs-modal {
  background: var(--surface);
  border-radius: 18px;
  width: min(1100px, 96vw);
  max-height: 92vh;
  overflow: auto;
  padding: 20px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  position: relative;
}
.kc-fs-close {
  position: absolute; top: 12px; left: 14px;
  border: none; background: var(--danger-soft); color: var(--danger);
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 18px; cursor: pointer; font-weight: 700;
}
.kc-fs-modal .chart-panel, .kc-fs-modal svg {
  width: 100% !important; min-height: 420px;
}

/* Time range chips */
.kc-range-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 16px; align-items: center;
}
.kc-range-chips .kc-range-label {
  font-size: 12px; font-weight: 700; color: var(--text-muted); margin-left: 6px;
}
.kc-range-chip {
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--navy);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 160ms ease;
}
.kc-range-chip:hover { background: var(--primary-50); border-color: var(--primary-200); }
.kc-range-chip.active {
  background: linear-gradient(135deg, var(--primary-900), var(--primary-500));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(33,150,243,.28);
}

/* Champions tab */
.kc-champ-wrap { margin-top: 8px; }
.kc-champ-header {
  background: linear-gradient(135deg, #0a3a82 0%, #0d47a1 45%, #1565c0 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.kc-champ-header h2 { color: #fff; margin: 0 0 6px; font-size: 1.35rem; }
.kc-champ-header p { margin: 0; opacity: .9; font-size: 13px; line-height: 1.6; }
.kc-champ-filters {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px;
  align-items: flex-end;
}
.kc-champ-filters .field { margin: 0; min-width: 140px; }
.kc-champ-metric-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px;
}
.kc-champ-metric-tabs button {
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: inherit; color: var(--navy);
}
.kc-champ-metric-tabs button.active {
  background: linear-gradient(135deg, #c98006, #e0a020);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(201,128,6,.3);
}
.kc-champ-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width:700px){ .kc-champ-podium { grid-template-columns: 1fr; } }
.kc-champ-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.kc-champ-card.rank-1 {
  border-color: #e0a020;
  background: linear-gradient(180deg, #fff8e6 0%, var(--surface) 60%);
  box-shadow: 0 8px 24px rgba(224,160,32,.18);
}
.kc-champ-card.rank-2 { border-color: #90a4ae; }
.kc-champ-card.rank-3 { border-color: #c47a4a; }
.kc-champ-rank {
  font-size: 28px; font-weight: 800; line-height: 1;
  margin-bottom: 6px;
}
.kc-champ-card.rank-1 .kc-champ-rank { color: #c98006; }
.kc-champ-card.rank-2 .kc-champ-rank { color: #607d8b; }
.kc-champ-card.rank-3 .kc-champ-rank { color: #a05a2c; }
.kc-champ-name { font-weight: 800; font-size: 15px; color: var(--navy); margin-bottom: 4px; }
.kc-champ-meta { font-size: 11.5px; color: var(--text-muted); margin-bottom: 8px; }
.kc-champ-val { font-size: 22px; font-weight: 800; color: var(--primary-900); }
.kc-champ-val-unit { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.kc-champ-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.kc-champ-table th {
  text-align: right; padding: 10px 8px;
  background: var(--surface-2); color: var(--navy);
  border-bottom: 2px solid var(--border); font-weight: 700;
}
.kc-champ-table td {
  padding: 9px 8px; border-bottom: 1px solid var(--border);
}
.kc-champ-table tr:hover td { background: var(--primary-50); }
.kc-champ-group-badge {
  display: inline-block;
  background: var(--primary-50);
  color: var(--primary-900);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 11.5px; font-weight: 700;
}

/* Live race board in companion */
.kc-race-board {
  margin: 14px 0 18px;
  background: linear-gradient(145deg, #0a3a82, #1565c0);
  border-radius: var(--radius-lg);
  padding: 16px 16px 12px;
  color: #fff;
  box-shadow: var(--shadow-md);
}
.kc-race-board h3 {
  color: #fff; margin: 0 0 4px; font-size: 1.05rem;
}
.kc-race-board .kc-race-sub {
  font-size: 12px; opacity: .88; margin-bottom: 12px; line-height: 1.5;
}
.kc-race-list { display: flex; flex-direction: column; gap: 8px; }
.kc-race-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.1);
  border-radius: 12px;
  padding: 10px 12px;
  transition: background 200ms ease;
}
.kc-race-row.me {
  background: rgba(255,255,255,.22);
  box-shadow: 0 0 0 2px rgba(255,215,0,.45);
}
.kc-race-pos {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.kc-race-row.rank1 .kc-race-pos { background: #e0a020; color: #1a1200; }
.kc-race-name { flex: 1; font-weight: 700; font-size: 13.5px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc-race-mins {
  font-variant-numeric: tabular-nums;
  font-weight: 800; font-size: 16px;
  letter-spacing: -.02em;
}
.kc-race-mins small { font-size: 11px; font-weight: 600; opacity: .85; margin-right: 2px; }
.kc-race-bar-wrap {
  width: 100%; height: 4px; background: rgba(255,255,255,.15);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.kc-race-bar {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #90caf9, #fff59d);
  transition: width 0.8s ease;
}
@keyframes kc-pulse-live {
  0%,100% { opacity: 1; }
  50% { opacity: .55; }
}
.kc-live-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: #4caf50;
  margin-left: 6px; vertical-align: middle;
  animation: kc-pulse-live 1.4s ease infinite;
}

/* Grade field highlight */
.kc-grade-field label::after {
  content: " *";
  color: var(--danger);
}

/* Data hub champions box */
.data-hub-box-champions {
  position: relative;
  background: linear-gradient(145deg, #fff8e6, #fff);
  border: 2px solid #e0a020 !important;
}
.data-hub-box-champions .data-hub-ico { color: #c98006; }
.data-hub-box-champions.active {
  box-shadow: 0 0 0 3px rgba(224,160,32,.35), var(--shadow-md);
}
html.dark .data-hub-box-champions {
  background: linear-gradient(145deg, #3a2e10, #1a2433);
  border-color: #c98006 !important;
}



/* ===== v8.2 Duo layout: Champions + Selfcheck pills matching design ===== */
.data-hub-duo-row{
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  margin-top: 12px;
  padding-top: 14px;
  flex-wrap: wrap;
}
.data-hub-box-champions{
  width: min(320px, 46vw);
  min-height: 88px;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px;
  padding: 14px 18px 14px 16px !important;
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 45%, #ea580c 100%) !important;
  border: none !important;
  border-radius: 999px !important;
  box-shadow: 0 10px 28px rgba(234,88,12,.28), 0 0 0 1px rgba(255,255,255,.12) inset;
  cursor: pointer;
  color: #fff !important;
}
.data-hub-box-champions .dh-champ-cup{
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  order: 2;
}
.data-hub-box-champions .dh-champ-cup svg{
  width: 52px;
  height: 52px;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.18));
}
.data-hub-box-champions .dh-champ-text{
  flex: 1;
  min-width: 0;
  text-align: right;
  order: 1;
}
.data-hub-box-champions .data-hub-ttl{
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #fff !important;
  text-align: right !important;
  margin: 0 0 4px !important;
  line-height: 1.3;
}
.data-hub-box-champions .data-hub-sub{
  display: block !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: rgba(255,255,255,.9) !important;
  text-align: right !important;
  line-height: 1.45;
  margin: 0 !important;
}
.data-hub-box-champions:hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(234,88,12,.36), 0 0 0 1px rgba(255,255,255,.16) inset;
}
.data-hub-box-champions.active{
  box-shadow: 0 0 0 3px rgba(251,191,36,.55), 0 12px 30px rgba(234,88,12,.4) !important;
}

/* Selfcheck horizontal pill — target icon */
.data-hub-duo-row .data-hub-box-selfcheck{
  width: min(320px, 46vw);
  min-height: 88px;
  border-radius: 999px !important;
  padding: 14px 18px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 14px;
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #1e88e5 100%) !important;
  border: none !important;
  box-shadow: 0 10px 28px rgba(13,71,161,.3), 0 0 0 1px rgba(255,255,255,.1) inset;
}
.data-hub-duo-row .data-hub-box-selfcheck::before{
  display: none !important;
  animation: none !important;
  content: none !important;
}
.data-hub-box-selfcheck::before{
  display: none !important;
  animation: none !important;
}
.data-hub-duo-row .data-hub-box-selfcheck .dh-target{
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.14);
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.28);
}
.data-hub-duo-row .data-hub-box-selfcheck .dh-target svg{
  width: 34px !important;
  height: 34px !important;
  color: #fff;
}
.data-hub-duo-row .data-hub-box-selfcheck .sc-text{
  flex: 1;
  min-width: 0;
  text-align: right;
}
.data-hub-duo-row .data-hub-box-selfcheck .data-hub-ttl{
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #fff !important;
  margin: 0 0 4px !important;
}
.data-hub-duo-row .data-hub-box-selfcheck .data-hub-sub{
  font-size: 11px !important;
  font-weight: 600 !important;
  color: rgba(255,255,255,.88) !important;
  margin: 0 !important;
  line-height: 1.45;
}
.data-hub-duo-row .data-hub-box-selfcheck:hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(13,71,161,.38);
}
.data-hub-duo-row .data-hub-box-selfcheck.active{
  box-shadow: 0 0 0 3px rgba(144,202,249,.55), 0 12px 30px rgba(13,71,161,.4) !important;
}

@media (max-width: 560px){
  .data-hub-box-champions,
  .data-hub-duo-row .data-hub-box-selfcheck{
    width: 100%;
    min-width: 0;
  }
}

html.dark .data-hub-box-champions{
  background: linear-gradient(135deg, #c47a0a 0%, #d97706 45%, #b45309 100%) !important;
  border-color: transparent !important;
}
html.dark .data-hub-box-champions .data-hub-ttl{ color: #fff !important; }
html.dark .data-hub-box-champions .data-hub-sub{ color: rgba(255,255,255,.88) !important; }

/* Live race — peer sticker badge (replaces the old traffic-light status dot) */
.kc-race-sticker{
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  box-shadow: 0 2px 6px rgba(0,0,0,.28), 0 0 0 2px rgba(255,255,255,.2);
  overflow: hidden;
}
.kc-race-sticker svg{ width: 84%; height: 84%; overflow: visible; display: block; }
.kc-race-row.rank1 .kc-race-sticker{ box-shadow: 0 2px 8px rgba(224,160,32,.55), 0 0 0 2px #e0a020; }
@media (max-width: 640px){ .kc-race-sticker{ width: 28px; height: 28px; } }
.kc-race-mins.done-red{ color: #ff8a80 !important; }
.kc-race-timer{
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .02em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.kc-race-timer.done-red{ color: #ff8a80; }
.kc-race-timer.rest-amber{ color: #ffe082; }

/* Per-chart range chips */
.kc-chart-range-local{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  align-items: center;
}
.kc-chart-range-local .kc-cr-label{
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 4px;
}
.kc-chart-range-local button{
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 140ms ease;
}
.kc-chart-range-local button:hover{ background: var(--primary-50); }
.kc-chart-range-local button.active{
  background: linear-gradient(135deg, var(--primary-900), var(--primary-500));
  color: #fff;
  border-color: transparent;
}


