/* ==========================================================================
   CLUB CARRY · WHS 2024-2026 GOLF HANDICAP CALCULATOR
   Adapts cleanly to both Links Vellum (light) and Night Doppler Radar (dark)
   ========================================================================== */

.hc-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 36px;
}

.hc-controls,
.hc-results {
  min-width: 0;
}

.hc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.hc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.hc-field.is-full {
  grid-column: 1 / -1;
}

.hc-field label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hc-field input,
.hc-field select {
  width: 100%;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-warm);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9rem;
}

.hc-submit-btn {
  width: 100%;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--pine);
  background: var(--pine);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
}

.hc-form-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--flag);
  background: rgba(196, 67, 34, 0.09);
  color: var(--flag);
  font-size: 0.82rem;
  font-weight: 600;
}

.hc-quick-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.hc-chip-btn {
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.hc-chip-btn:hover {
  border-color: var(--turf);
}

.hc-clear-btn {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.hc-clear-confirm {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--flag);
  background: rgba(196, 67, 34, 0.08);
}

.hc-clear-confirm p {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--ink);
}

.hc-clear-actions {
  display: flex;
  gap: 8px;
}

.hc-btn-danger {
  padding: 7px 12px;
  border-radius: 7px;
  border: 1px solid var(--flag);
  background: var(--flag);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

/* Index Hero Banner */
.hc-index-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg);
  margin: 12px 0 16px;
}

.hc-index-kicker {
  display: block;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--turf);
}

.hc-index-value {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
  margin: 4px 0;
}

.hc-index-sub {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.hc-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  flex: 1 1 260px;
}

.hc-kpi {
  padding: 10px 11px;
  border: 1px solid var(--hairline);
  border-radius: 9px;
  background: var(--bg-warm);
}

.hc-kpi span {
  display: block;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
}

.hc-kpi strong {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--ink);
}

.hc-nine-note {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--brass);
  background: rgba(154, 109, 36, 0.11);
  color: var(--ink);
  font-size: 0.81rem;
}

/* Trend SVG */
.hc-trend-box {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 13px;
  background: var(--bg);
  margin-bottom: 16px;
}

.hc-trend-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.hc-trend-head strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.hc-trend-head span {
  font-size: 0.76rem;
  color: var(--muted);
}

.hc-trend-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: var(--bg-warm);
}

.hc-grid-line {
  stroke: var(--hairline);
  stroke-width: 1;
}

.hc-axis-text {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}

.hc-index-line {
  stroke: var(--turf);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

.hc-index-tag {
  fill: var(--turf);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
}

.hc-trend-path {
  stroke: var(--ink-70);
  stroke-width: 1.8;
}

.hc-dot-used {
  fill: var(--turf);
  stroke: var(--bg);
  stroke-width: 1.6;
}

.hc-dot-idle {
  fill: var(--muted);
  stroke: var(--bg);
  stroke-width: 1.2;
}

/* Course & Playing Handicap Converter */
.hc-course-panel {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg);
  margin-bottom: 16px;
}

.hc-course-head {
  margin-bottom: 10px;
}

.hc-course-head strong {
  display: block;
  font-size: 0.92rem;
  color: var(--ink);
}

.hc-course-head span {
  font-size: 0.78rem;
  color: var(--muted);
}

.hc-course-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.hc-course-outputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.hc-course-out {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--tour-zone);
  border: 1px solid var(--hairline);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.hc-course-out span {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}

.hc-course-out strong {
  font-family: var(--mono);
  font-size: 1.45rem;
  color: var(--turf);
}

.hc-course-formula {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

/* Backup / Import Bar */
.hc-backup-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.hc-btn-primary,
.hc-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border-radius: 9px;
  font-family: var(--sans);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
}

.hc-btn-primary {
  background: var(--pine);
  color: var(--bg);
  border: 1px solid var(--pine);
}

.hc-btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
}

.hc-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hc-import-label {
  position: relative;
  overflow: hidden;
}

.hc-import-label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.hc-import-msg {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 600;
}

.hc-import-msg.is-ok {
  background: var(--tour-zone);
  border: 1px solid var(--turf);
  color: var(--ink);
}

.hc-import-msg.is-error {
  background: rgba(196, 67, 34, 0.09);
  border: 1px solid var(--flag);
  color: var(--flag);
}

/* Rounds Ledger Table */
.hc-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}

.hc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.81rem;
  white-space: nowrap;
}

.hc-table th,
.hc-table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
}

.hc-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--bg-warm);
}

.hc-table tbody tr.is-used {
  background: var(--tour-zone);
}

.hc-table tbody tr.is-archived {
  opacity: 0.62;
}

.hc-pill-used,
.hc-pill-idle,
.hc-pill-arch {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.hc-pill-used {
  background: var(--pine);
  color: var(--bg);
}

.hc-pill-idle {
  background: var(--bg-warm);
  color: var(--muted);
  border: 1px solid var(--hairline);
}

.hc-pill-arch {
  background: transparent;
  color: var(--muted);
}

.hc-del-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.hc-del-btn:hover {
  border-color: var(--flag);
  color: var(--flag);
}

.hc-empty-cell {
  text-align: center;
  padding: 18px 12px;
  color: var(--muted);
}

.hc-disclaimer {
  margin: 12px 0 0;
  font-size: 0.77rem;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 980px) {
  .hc-workspace {
    grid-template-columns: 1fr;
  }
  .hc-course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .hc-kpi-row {
    grid-template-columns: 1fr;
  }
  .hc-course-outputs {
    grid-template-columns: 1fr;
  }
  .hc-backup-bar {
    flex-direction: column;
  }
  .hc-btn-primary,
  .hc-btn-secondary {
    width: 100%;
  }
}

@media print {
  .site-header,
  .site-footer,
  .hc-controls,
  .hc-backup-bar,
  .hc-del-btn,
  .guide-content {
    display: none !important;
  }
  .hc-workspace {
    display: block !important;
  }
}
