.helf-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 2%, rgba(34,197,94,.2), transparent 32rem),
    radial-gradient(circle at 92% 14%, rgba(132,204,22,.18), transparent 30rem),
    linear-gradient(145deg, #f0fdf4 0%, #f7fee7 52%, #fffbeb 100%);
}

.helf-shell { padding-bottom: max(48px, calc(24px + env(safe-area-inset-bottom))); }
.helf-hero h1 span { color: #15803d; }
.helf-brand { color: inherit; text-decoration: none; }
.helf-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.helf-hero-actions .button { text-decoration: none; }
.helf-separation-pill,
.helf-honor-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(22,101,52,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #166534;
  font-size: .82rem;
  font-weight: 800;
}

.helf-progress-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.helf-stat-card,
.helf-wheel-card,
.helf-bank-card,
.helf-league-card,
.helf-history-card {
  border: 1px solid rgba(22,101,52,.13);
  background: rgba(255,255,255,.9);
  box-shadow: 0 18px 48px rgba(21,128,61,.1);
}

.helf-stat-card {
  display: grid;
  min-height: 132px;
  padding: 18px;
  align-content: center;
  gap: 5px;
  border-radius: 22px;
}
.helf-stat-card > span { color: #4b5563; font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.helf-stat-card > strong { color: #14532d; font-size: clamp(1.7rem, 4vw, 2.45rem); line-height: 1; }
.helf-stat-card > small { color: #6b7280; }
.helf-goal-card { align-content: start; }
.helf-goal-dots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.helf-goal-dot { height: 9px; border-radius: 99px; background: #dcfce7; border: 1px solid #bbf7d0; }
.helf-goal-dot.is-complete { background: #22c55e; border-color: #16a34a; }

.helf-main-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: start;
}
.helf-wheel-card,
.helf-bank-card,
.helf-league-card,
.helf-history-card { border-radius: 28px; padding: clamp(20px, 3.5vw, 30px); }
.helf-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.helf-card-heading h2,
.helf-league-card h2,
.helf-history-card h2 { margin: 4px 0 0; font-size: clamp(1.5rem, 3vw, 2rem); }

.helf-wheel-stage {
  position: relative;
  width: min(78vw, 430px);
  aspect-ratio: 1;
  margin: 24px auto 18px;
  filter: drop-shadow(0 20px 30px rgba(20,83,45,.18));
}
.helf-wheel {
  position: absolute;
  inset: 3%;
  overflow: hidden;
  border: 10px solid #f0fdf4;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(20,83,45,.22), 0 0 0 2px rgba(20,83,45,.16);
  transform: rotate(0deg);
  transition: transform 4.2s cubic-bezier(.16,.8,.18,1);
  will-change: transform;
}
.helf-wheel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 32%, rgba(255,255,255,.22), transparent 36%);
  pointer-events: none;
}
.helf-wheel.is-spinning { box-shadow: inset 0 0 0 2px rgba(20,83,45,.3), 0 0 0 4px rgba(34,197,94,.12), 0 16px 32px rgba(20,83,45,.18); }
.helf-wheel-pointer {
  position: absolute;
  z-index: 5;
  top: -1px;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 34px solid #052e16;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.18));
}
.helf-wheel-labels { position: absolute; inset: 0; }
.helf-wheel-label {
  position: absolute;
  width: 27%;
  transform: translate(-50%, -50%);
  white-space: pre-line;
  text-align: center;
  color: #fff;
  font-size: clamp(.58rem, 1.8vw, .78rem);
  font-weight: 900;
  line-height: 1.08;
  text-shadow: 0 1px 3px rgba(0,0,0,.42);
  pointer-events: none;
}
.helf-wheel-hub {
  position: absolute;
  z-index: 3;
  inset: 50% auto auto 50%;
  display: grid;
  width: 22%;
  aspect-ratio: 1;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 7px solid rgba(255,255,255,.94);
  border-radius: 50%;
  background: #14532d;
  box-shadow: 0 8px 18px rgba(0,0,0,.2);
  font-size: clamp(1.45rem, 5vw, 2.45rem);
}
.helf-spin-button { width: 100%; min-height: 58px; font-size: 1rem; background: linear-gradient(135deg, #166534, #16a34a); }
.helf-spin-status { min-height: 1.4em; margin: 10px 0 0; text-align: center; color: #4b5563; font-weight: 700; }

.helf-result-card {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid rgba(22,163,74,.22);
  border-radius: 22px;
  background: linear-gradient(145deg, #f0fdf4, #fff);
  text-align: center;
}
.helf-result-card.is-complete { background: linear-gradient(145deg, #dcfce7, #fefce8); }
.helf-result-card h3 { margin: 5px 0; font-size: clamp(1.8rem, 5vw, 2.7rem); color: #14532d; }
.helf-result-amount { display: block; font-size: 1.25rem; }
.helf-result-points { margin: 7px 0 0; color: #166534; font-weight: 800; }
.helf-result-timer { margin: 16px 0 8px; color: #052e16; font-size: clamp(2.3rem, 9vw, 4.4rem); font-variant-numeric: tabular-nums; font-weight: 950; letter-spacing: -.04em; }
.helf-result-actions { display: flex; gap: 10px; margin-top: 16px; }
.helf-result-actions .button { flex: 1; min-height: 50px; }

.helf-bank-copy,
.helf-bank-note,
.helf-league-card p { color: #5f6b63; line-height: 1.55; }
.helf-bank-copy { margin: 12px 0 16px; }
.helf-bank-list { display: grid; gap: 10px; }
.helf-bank-row {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(22,101,52,.11);
  border-radius: 18px;
  background: rgba(240,253,244,.68);
}
.helf-bank-number { display: grid; width: 30px; aspect-ratio: 1; place-items: center; border-radius: 50%; background: #166534; color: white; font-size: .82rem; font-weight: 900; }
.helf-bank-controls { display: grid; grid-template-columns: minmax(160px,1fr) minmax(86px,.34fr); gap: 8px; }
.helf-field { display: grid; gap: 4px; min-width: 0; }
.helf-field > span { color: #647067; font-size: .7rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.helf-field select,
.helf-field input {
  width: 100%;
  min-height: 43px;
  padding: 8px 10px;
  border: 1px solid #bbd8c2;
  border-radius: 12px;
  background: #fff;
  color: #17251b;
  font: inherit;
}
.helf-custom-name-field { grid-column: 1 / 2; }
.helf-custom-unit-field { grid-column: 2 / 3; }
.helf-bank-score { white-space: nowrap; color: #166534; font-size: .83rem; font-weight: 900; }
.helf-remove-workout {
  min-height: 42px;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  background: #fff;
  color: #9f1239;
  font-weight: 800;
  cursor: pointer;
}
.helf-remove-workout:disabled { opacity: .35; cursor: default; }
.helf-bank-actions { display: flex; gap: 10px; margin-top: 14px; }
.helf-bank-actions .button { min-height: 48px; }
.helf-bank-note { margin: 13px 0 0; font-size: .85rem; }

.helf-bottom-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: 18px; margin-top: 18px; }
.helf-league-you { display: flex; justify-content: space-between; gap: 16px; margin: 18px 0 10px; padding: 15px 16px; border-radius: 17px; background: #f0fdf4; color: #14532d; font-weight: 850; }
.helf-history { display: grid; gap: 8px; margin-top: 16px; }
.helf-history-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(22,101,52,.1); }
.helf-history-row:last-child { border-bottom: 0; }
.helf-history-row > div { display: grid; gap: 3px; }
.helf-history-row span { color: #6b7280; font-size: .84rem; }
.helf-history-points { color: #15803d; white-space: nowrap; }
.helf-history-empty { margin: 15px 0 0; color: #6b7280; }

@media (max-width: 900px) {
  .helf-progress-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .helf-main-grid,
  .helf-bottom-grid { grid-template-columns: 1fr; }
  .helf-wheel-card { order: -1; }
}

@media (max-width: 640px) {
  .helf-shell { padding-left: 14px; padding-right: 14px; }
  .helf-progress-grid { gap: 8px; }
  .helf-stat-card { min-height: 116px; padding: 14px; border-radius: 18px; }
  .helf-wheel-card,
  .helf-bank-card,
  .helf-league-card,
  .helf-history-card { padding: 18px 15px; border-radius: 23px; }
  .helf-wheel-stage { width: min(88vw, 390px); }
  .helf-wheel { border-width: 8px; }
  .helf-wheel-label { width: 29%; font-size: clamp(.52rem, 2.6vw, .7rem); }
  .helf-bank-row { grid-template-columns: 30px minmax(0,1fr) auto; align-items: start; }
  .helf-bank-controls { grid-template-columns: minmax(0,1fr) 84px; }
  .helf-bank-score { grid-column: 2 / 3; align-self: center; }
  .helf-remove-workout { grid-column: 3 / 4; grid-row: 1 / span 2; align-self: center; font-size: .78rem; }
  .helf-result-actions,
  .helf-bank-actions { flex-direction: column; }
  .helf-result-actions .button,
  .helf-bank-actions .button { width: 100%; }
  .helf-league-you { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 390px) {
  .helf-bank-row { grid-template-columns: 28px minmax(0,1fr); }
  .helf-bank-controls { grid-template-columns: minmax(0,1fr) 76px; }
  .helf-bank-score { grid-column: 2 / 3; }
  .helf-remove-workout { grid-column: 2 / 3; grid-row: auto; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .helf-wheel { transition-duration: .01ms; }
}
