/* =========================================================================
   Biggest Loser Challenge — Styles
   Dark, athletic, "Biggest Loser"-Vibe
   ========================================================================= */

:root {
  --bg:        #0c0e13;
  --bg-card:   #161a23;
  --bg-card-2: #1d222e;
  --line:      #262d3b;
  --text:      #f2f5fa;
  --text-dim:  #9aa6bd;
  --accent:    #ff6b35;
  --accent-2:  #f7461e;
  --good:      #06d6a0;
  --bad:       #ff5470;
  --warn:      #ffd60a;
  --radius:    18px;
  --shadow:    0 18px 50px -20px rgba(0,0,0,.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 80% -5%, rgba(255,107,53,.18), transparent 70%),
    radial-gradient(50% 45% at 10% 0%, rgba(6,214,160,.12), transparent 70%);
}

.wrap {
  position: relative; z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 18px 60px;
  display: flex; flex-direction: column; gap: 20px;
}

/* ---------- HERO ---------- */
.hero { text-align: center; padding: 14px 0 4px; }
.hero__eyebrow {
  text-transform: uppercase; letter-spacing: .28em;
  font-size: .72rem; font-weight: 700; color: var(--accent);
}
.hero__title {
  font-family: 'Anton', sans-serif;
  font-weight: 400; line-height: .92;
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  letter-spacing: .01em; margin-top: 6px;
  text-shadow: 0 4px 30px rgba(255,107,53,.25);
}
.hero__title span {
  display: block;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* day progress */
.daybar { max-width: 560px; margin: 22px auto 0; }
.daybar__label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 700; font-size: .95rem; margin-bottom: 8px;
}
.daybar__pct { color: var(--accent); }
.daybar__track {
  height: 12px; border-radius: 999px;
  background: var(--bg-card-2); overflow: hidden;
  border: 1px solid var(--line);
}
.daybar__fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--warn));
  border-radius: 999px; transition: width .8s cubic-bezier(.2,.8,.2,1);
}

/* ---------- CHAMP ---------- */
.champ {
  position: relative;
  display: flex; align-items: center; gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255,107,53,.16), rgba(247,70,30,.05)),
    var(--bg-card);
  border: 1px solid rgba(255,107,53,.35);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.champ__crown {
  position: absolute; top: -6px; right: 18px;
  font-size: 2.4rem; transform: rotate(12deg); opacity: .9;
}
.champ__avatar {
  flex: 0 0 auto;
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.6rem; color: #11141b;
  box-shadow: 0 0 0 4px rgba(255,255,255,.08);
}
.champ__info { flex: 1 1 auto; min-width: 0; }
.champ__tag {
  text-transform: uppercase; letter-spacing: .18em;
  font-size: .68rem; font-weight: 700; color: var(--text-dim);
}
.champ__name { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; line-height: 1.1; }
.champ__sub { color: var(--text-dim); font-size: .9rem; margin-top: 2px; }
.champ__stat { text-align: right; flex: 0 0 auto; }
.champ__big {
  display: block; font-family: 'Anton', sans-serif;
  font-size: clamp(2rem, 7vw, 3rem); line-height: 1; color: var(--good);
}
.champ__unit { font-size: .72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .12em; }

/* ---------- CARD ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card__title { font-size: 1.05rem; font-weight: 700; margin-bottom: 16px; }

/* ---------- FORM ---------- */
.grid-form {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field--wide { grid-column: span 3; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--text-dim); }
.field em { font-style: normal; opacity: .65; font-weight: 400; }
.field input, .field select {
  background: var(--bg-card-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit; font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,107,53,.18);
}
.form-actions { grid-column: span 3; display: flex; align-items: center; gap: 14px; }
.form-msg { font-size: .88rem; font-weight: 600; }
.form-msg.ok  { color: var(--good); }
.form-msg.err { color: var(--bad); }

/* ---------- BUTTONS ---------- */
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border-radius: 12px; padding: 11px 20px; border: 1px solid transparent;
  transition: transform .12s, filter .12s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 10px 24px -10px rgba(255,107,53,.7);
}
.btn--primary:hover { filter: brightness(1.07); }
.btn--ghost {
  background: var(--bg-card-2); color: var(--text-dim);
  border-color: var(--line);
}
.btn--ghost:hover { color: var(--text); border-color: var(--accent); }

/* ---------- CHART ---------- */
.chart-head {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.chart-head .card__title { margin-bottom: 0; }
.metric-switch {
  display: inline-flex; background: var(--bg-card-2);
  border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px;
}
.metric-switch button {
  font: inherit; font-size: .85rem; font-weight: 600;
  color: var(--text-dim); background: transparent;
  border: 0; border-radius: 9px; padding: 7px 13px; cursor: pointer;
  transition: background .15s, color .15s;
}
.metric-switch button.is-active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
}
.chart-box { position: relative; height: 340px; }
.chart-hint { margin-top: 10px; font-size: .8rem; color: var(--text-dim); text-align: center; }

/* ---------- TABLE ---------- */
.table-scroll { overflow-x: auto; }
.board { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 620px; }
.board th, .board td { padding: 12px 10px; text-align: center; white-space: nowrap; }
.board thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); border-bottom: 1px solid var(--line); font-weight: 700;
}
.ta-left { text-align: left !important; }
.board tbody tr { border-bottom: 1px solid rgba(38,45,59,.5); transition: background .15s; }
.board tbody tr:hover { background: var(--bg-card-2); }
.board tbody tr.is-leader { background: rgba(255,107,53,.10); }
.board .rank { font-family: 'Anton', sans-serif; font-size: 1.1rem; color: var(--text-dim); }
.board tr.is-leader .rank { color: var(--accent); }
.who { display: inline-flex; align-items: center; gap: 10px; }
.who__dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #11141b;
}
.who__name { font-weight: 700; }
.delta-good { color: var(--good); font-weight: 700; }
.delta-bad  { color: var(--bad);  font-weight: 700; }
.muted { color: var(--text-dim); }
.bmi-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-weight: 700; font-size: .85rem;
}
.bmi-under  { background: rgba(76,201,240,.18);  color: #7ad4f5; }
.bmi-normal { background: rgba(6,214,160,.18);   color: #2fe0b0; }
.bmi-over   { background: rgba(255,214,10,.16);  color: var(--warn); }
.bmi-obese  { background: rgba(255,84,112,.16);  color: var(--bad); }

/* ---------- FOOTER ---------- */
.foot { text-align: center; color: var(--text-dim); display: flex; flex-direction: column; gap: 16px; align-items: center; }
.tools {
  width: 100%; max-width: 560px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 4px 16px;
}
.tools summary { cursor: pointer; padding: 12px 0; font-weight: 600; font-size: .9rem; }
.tools__row { display: flex; gap: 12px; flex-wrap: wrap; padding: 6px 0 12px; }
.tools__hint { font-size: .8rem; padding-bottom: 12px; }
.tools code { background: var(--bg-card-2); padding: 1px 6px; border-radius: 5px; }
.foot__sig { font-size: .82rem; letter-spacing: .04em; }

/* ---------- PASSWORT-GATE ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: none; place-items: center;
  background: rgba(8,10,14,.86); backdrop-filter: blur(8px);
  padding: 20px;
}
.gate.is-open { display: grid; }
.gate__box {
  width: 100%; max-width: 380px; text-align: center;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 34px 28px; display: flex; flex-direction: column; gap: 14px;
}
.gate__emoji { font-size: 2.4rem; }
.gate__title { font-family: 'Anton', sans-serif; font-weight: 400; font-size: 1.7rem; letter-spacing: .01em; }
.gate__lead { color: var(--text-dim); font-size: .92rem; margin-top: -6px; }
.gate__box input {
  background: var(--bg-card-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 13px 15px; font: inherit; font-size: 1rem; text-align: center;
}
.gate__box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,107,53,.18); }
.gate__btn { width: 100%; }
.gate__msg { min-height: 1.2em; font-size: .88rem; font-weight: 600; color: var(--bad); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 680px) {
  .grid-form { grid-template-columns: 1fr 1fr; }
  .field--wide, .form-actions { grid-column: span 2; }
  .champ { flex-wrap: wrap; }
  .champ__stat { width: 100%; text-align: left; }
  .champ__big { display: inline; }
}
@media (max-width: 460px) {
  .grid-form { grid-template-columns: 1fr; }
  .field--wide, .form-actions { grid-column: span 1; }
}
