/* HTD Fixture Data — typed mock layer (Fixture Mode).
   Clean API-shaped seams; swap for live contracts later. */
(function () {
  const today = {
    label: "TODAY'S MISSION",
    title: 'RUN 10K FASTED',
    subtitle: 'Zone 2. Stay disciplined.',
    tags: ['ENDURANCE', 'MENTAL EDGE'],
    readiness: 85, hrv: 62, readinessState: 'GOOD',
    difficulty: 8.0, difficultyLabel: 'HARD',
    recovery: 78, recoveryLabel: 'GOOD',
    proof: ['GPS + HR', 'PHOTO FINISH'],
    why: 'Readiness is high and your streak is at risk — today builds aerobic base while protecting long-term progression.',
    duration: '50 MIN', category: 'ENDURANCE',
    protocol: [
      ['WARM-UP', '10 min easy jog, build to Zone 2'],
      ['MAIN SET', '10K continuous, hold 4:55–5:05 /km'],
      ['FUEL', 'Fasted. Water only. No gels.'],
      ['COOL-DOWN', '5 min walk + mobility'],
    ],
    progression: 'Next week: 10K @ 4:50 /km target.',
    regression: 'Knee flare-up? Drop to 6K or swap to row.',
    contra: ['Sharp joint pain', 'Dizziness / lightheaded', 'Chest tightness'],
    recoveryCost: 'MODERATE',
  };

  const crew = { name: 'IRONCROWN', members: 12, avgCompletion: 78, rank: 3, doneToday: 9 };

  const streak = { atRisk: 2, missed: 0,
    bars: [1.0,.35,.55,.4,.62,.48,.7,.5,.66,.44,.6,.5,.72,.46,.58,.5,.64,.42,.56,.5,.68,.46,.6] };

  const calendar = [
    [['28','complete-dim'],['29','missed'],['30','complete-dim'],['31','complete-dim'],['2','complete-dim'],['1','complete'],['4','complete']],
    [['5','complete'],['6','complete-dim'],['7','complete-dim'],['16','missed'],['9','complete-dim'],['10','complete'],['16','complete']],
    [['10','complete'],['12','missed'],['30','complete'],['20','complete'],['30','missed'],['10','complete'],['19','complete']],
    [['20','complete'],['20','missed'],['20','complete-dim'],['28','complete'],['30','missed'],['10','nodata'],['','nodata']],
  ];

  const feed = [
    { id:'p1', user:'DANIEL K.', handle:'IRONCROWN', avatar:'#3a4a2a', ago:'2h',
      mission:'RUN 10K FASTED', kind:'gps',
      metrics:[['10.02 KM','DISTANCE'],['4:58 /KM','AVG PACE'],['49:52','TIME']],
      device:'GARMIN FENIX 7', avgHr:'142 BPM',
      likes:124, comments:18, shares:7, conf:'HIGH' },
    { id:'p2', user:'JESSICA M.', handle:'RELENTLESS', avatar:'#4a2a2a', ago:'4h',
      mission:'HYROX DOUBLES', kind:'watch',
      metrics:[['1:07:32','TIME'],['8','WORKOUT'],['920','CALORIES']],
      device:'POLAR VERITY SENSE', avgHr:'168 BPM',
      likes:98, comments:12, shares:3, conf:'HIGH' },
    { id:'p3', user:'ALEX R.', handle:'DISCIPLINE LAB', avatar:'#2a3a4a', ago:'6h',
      mission:'COLD PLUNGE', kind:'plunge',
      metrics:[['3.0°C','TEMP'],['05:00','DURATION'],['+18','HRV IMPACT']],
      device:'MANUAL', avgHr:'—',
      likes:76, comments:9, shares:4, conf:'MED' },
    { id:'p4', user:'MARCUS T.', handle:'FORGED', avatar:'#4a3a2a', ago:'8h',
      mission:'RUCK 8KM / 20KG', kind:'gps',
      metrics:[['8.04 KM','DISTANCE'],['9:12 /KM','AVG PACE'],['1:14:01','TIME']],
      device:'COROS APEX 2', avgHr:'131 BPM',
      likes:64, comments:6, shares:2, conf:'HIGH' },
  ];

  const comments = [
    { user:'JESSICA M.', handle:'RELENTLESS', avatar:'#4a2a2a', ago:'1h', text:'Negative split on a fasted 10K is filthy. Respect.' },
    { user:'ALEX R.', handle:'DISCIPLINE LAB', avatar:'#2a3a4a', ago:'1h', text:'That last 2k pace though 🔥 locked in.' },
    { user:'MARCUS T.', handle:'FORGED', avatar:'#4a3a2a', ago:'48m', text:'Proof confidence HIGH. No excuses energy.' },
  ];

  const challenges = {
    hero: { code:'HTD 30', tagline:'30 DAYS. NO EXCUSES.', sub:'Build unbreakable discipline.',
      startsIn:5, athletes:'1.2M' },
    live: [
      { name:'HYBRID ATHLETE WEEK', dates:'May 26 – Jun 1', desc:'Train all four. Prove it.', icon:'crew' },
      { name:'GYM VS GYM', dates:'', desc:'Rep your gym. Win together.', icon:'shield' },
      { name:'CITY VS CITY', dates:'', desc:'Your city. Your standard.', icon:'flag' },
    ],
    leaderboard: [
      ['1','IRONCROWN','128,450'],['2','RELENTLESS','114,023'],['3','DISCIPLINE LAB','110,987'],
      ['4','UNBREAKABLE','102,884'],['5','FORGED','98,771'],['6','APEX PROTOCOL','94,210'],
      ['7','NO QUIT','89,540'],['8','THE STANDARD','86,117'],
    ],
    total: 300,
    detail: {
      title:'HTD 30', duration:'30 DAYS', participants:'1,204,882',
      rules:['1 mission per day, 30 days straight','Proof required every day','One rest day allowed per week','Miss 2 days = removed from ranking'],
      proof:['GPS or wearable snapshot','Photo finish on key days'],
      reward:'HTD 30 FINISHER BADGE + ELITE TIER',
      plan:'FREE',
    },
  };

  const ai = {
    updated: 'May 20',
    radar: [
      { k:'MENTAL TOUGHNESS', v:78 }, { k:'CONSISTENCY', v:62 }, { k:'RECOVERY', v:71 },
      { k:'NUTRITION', v:68 }, { k:'STRESS CONTROL', v:54 }, { k:'FOCUS', v:65 },
    ],
    top10: [88,82,84,80,78,80],
    avoidance: { line:'You avoid early starts and hard efforts.',
      trigger:['Early Morning','Discomfort'], behavior:['Snooze / Delay','Rationalize'], impact:['Missed Edge','Lower Output'] },
    prescription: { focus:'MENTAL TOUGHNESS', mission:['5:30AM WORKOUT','45 MIN Z2 RUN'],
      ritual:['Sleep by 22:00','No Alcohol','Hydrate 3L'] },
    insights: [
      ['STRONGEST PATTERN', 'Evening strength sessions — 94% completion'],
      ['AVOIDANCE PATTERN', 'Pre-7AM efforts skipped 6 of last 9'],
      ['RECOVERY CONSTRAINT', 'HRV drops 18% on <6h sleep nights'],
      ['PREFERRED PROOF', 'GPS map + heart rate'],
    ],
    coachLine: 'Your missions adapt from completion, skips, soreness, safety flags, and repeat willingness.',
  };

  const profile = {
    handle:'@HARDCASE', name:'YOU', avatar:'#3a4a2a',
    score:842, scoreMax:1000, tier:'ELITE',
    streak:18, proofs:142, crews:2, challengesN:3,
    heatmap: Array.from({length: 7}, () => Array.from({length: 18}, () => {
      const r = Math.random(); return r > .82 ? 'missed' : r > .68 ? 'partial' : r > .22 ? 'complete' : r > .12 ? 'complete-dim' : 'nodata';
    })),
    recent: [
      { mission:'RUN 10K FASTED', when:'TODAY', conf:'HIGH' },
      { mission:'COLD PLUNGE 5:00', when:'YDAY', conf:'HIGH' },
      { mission:'BACK SQUAT 5×5', when:'2D', conf:'MED' },
    ],
  };

  // — Onboarding —
  const onboarding = {
    personas: [
      ['HYBRID ATHLETE','Run, lift, repeat.','pulse'],
      ['TACTICAL PREP','Operator readiness.','shield'],
      ['COMBAT ATHLETE','Fight-ready engine.','flame'],
      ['FOUNDER HARD MODE','Output under load.','zap'],
      ['GYM CREW','Train with your people.','crew'],
      ['BEGINNER','Start the standard.','target'],
      ['INJURED / RECOVERY','Safe comeback path.','shieldCheck'],
      ['ELITE','Higher standards only.','trophy'],
    ],
    goals: ['DAILY CONSISTENCY','MENTAL TOUGHNESS','ENDURANCE','STRENGTH','RECOVERY DISCIPLINE','TACTICAL READINESS','COMPETITION','FAT LOSS','HABIT REPAIR'],
    trainingAge: ['BEGINNER','INTERMEDIATE','ADVANCED','ELITE'],
    equipment: ['RUNNING','ROWER','BIKE','ASSAULT BIKE','DUMBBELLS','BARBELL','KETTLEBELL','PULL-UP BAR','POOL','TRACK','GYM ACCESS'],
    constraints: ['INJURY','NO RUNNING','NO JUMPING','SHOULDER','KNEE','BACK','LIMITED TIME','TRAVEL','SLEEP RESTRICTION'],
    proofModes: [
      ['GPS MAP','gps'],['WEARABLE SNAPSHOT','watch'],['TIMER CAPTURE','timer'],
      ['PHOTO PROOF','camera'],['VIDEO PROOF','camera'],['MANUAL REFLECTION','feed'],['CREW VERIFIED','crew'],
    ],
    wearables: [
      ['APPLE HEALTH','READY'],['GOOGLE FIT','READY'],['GARMIN','READY'],
      ['WHOOP','PROVIDER PENDING'],['STRAVA','READY'],['MANUAL IMPORT','ALWAYS'],
    ],
  };

  // — P8 Protocols / Progression —
  const protocols = {
    tracks: [
      { name:'HYBRID 30', days:30, tag:'PERSONA TRACK', done:18, locked:false },
      { name:'TACTICAL 60', days:60, tag:'PERSONA TRACK', done:0, locked:false },
      { name:'COMEBACK 14', days:14, tag:'RECOVERY', done:0, locked:false },
      { name:'ELITE 90', days:90, tag:'PERSONA TRACK', done:0, locked:true },
    ],
    library: [
      { name:'FASTED 10K', type:'PHYSICAL', proof:'GPS + HR', cert:true, locked:false },
      { name:'BACK SQUAT 5×5', type:'PHYSICAL', proof:'VIDEO', cert:true, locked:false },
      { name:'COLD EXPOSURE', type:'RECOVERY', proof:'TIMER', cert:true, locked:false },
      { name:'BOX BREATH 4×4', type:'MENTAL', proof:'REFLECTION', cert:true, locked:false },
      { name:'ZONE 2 BENCHMARK', type:'PHYSICAL', proof:'WEARABLE', cert:true, locked:true },
      { name:'FEAR INVENTORY', type:'MENTAL', proof:'REFLECTION', cert:true, locked:true },
    ],
    detail: {
      name:'FASTED 10K', type:'PHYSICAL · ENDURANCE',
      purpose:'Build aerobic base and metabolic flexibility under glycogen restriction.',
      proof:'GPS track + heart-rate stream, photo finish.',
      progression:'+0.5 km/wk or −5s/km pace target.',
      regression:'Drop to 6K or row 2km if joints flare.',
      contra:['Type 1 diabetes — do not train fasted','Recent injury to load-bearing joints','Dizziness or lightheadedness'],
      recoveryCost:'MODERATE',
      equipment:['Running','Track','Treadmill'],
      cues:['Relaxed jaw + shoulders','Cadence ~178','Nasal breathing in Z2'],
      failure:['Going to Z3+ too early','Skipping warm-up','Breaking fast mid-run'],
      subs:['Row 10K','Assault bike 30 min','Ruck 8 km'],
      cert:'SAFETY REVIEWED · MAY 2026',
    },
    progression: {
      cycle:'BUILD BLOCK · WEEK 3 / 12',
      markers:[['BUILD','done'],['BUILD','done'],['BUILD','now'],['DELOAD','next'],['BENCHMARK','next'],['BUILD','next']],
      readinessAdj:'−1 intensity step today (HRV down 12%)',
      streakRisk:'2 days at risk',
      upcoming:[['BACK SQUAT 5×5','TMRW · STRENGTH'],['ZONE 2 90MIN','THU · ENDURANCE'],['DELOAD WEEK','MON · RECOVERY']],
    },
  };

  // — P9 Readiness —
  const readiness = {
    score:85, state:'GOOD', fatigue:'LOW', source:'GARMIN FENIX 7',
    metrics:[['SLEEP','7h 42m','+0.4h'],['RESTING HR','48 BPM','−2'],['HRV','62 MS','+5'],['STRAIN','14.2','MODERATE']],
    adjust:'Readiness is high — full mission intensity cleared. Difficulty held at 8.0.',
    providers:[['APPLE HEALTH','READY'],['GOOGLE FIT','READY'],['GARMIN','CONNECTED'],['WHOOP','PROVIDER PENDING'],['STRAVA','READY'],['MANUAL','ALWAYS']],
  };

  // — P10 Monetization —
  const monetization = {
    current:'ATHLETE PRO', state:'ACTIVE',
    plans:[
      { name:'FREE', price:'$0', period:'', feats:['1 daily mission','Public proof feed','Basic streak'], cta:'CURRENT', tier:0 },
      { name:'ATHLETE PRO', price:'$12', period:'/mo', feats:['AI Resilience Architect','Premium protocols','Challenge entry','Wearable readiness'], cta:'ACTIVE', tier:1, hot:true },
      { name:'COACH', price:'$39', period:'/mo', feats:['Everything in Pro','Crew management','Athlete dashboards','Custom protocols'], cta:'UPGRADE', tier:2 },
      { name:'TEAM', price:'$99', period:'/mo', feats:['Everything in Coach','Up to 25 seats','Org leaderboard','Priority support'], cta:'UPGRADE', tier:3 },
    ],
    gate:{ feature:'ELITE 90 PROTOCOL', need:'COACH', blurb:'Unlock the 90-day elite progression and certified premium protocols.' },
  };

  // — P11 Settings —
  const sessions = [
    ['IPHONE 15 PRO','San Francisco · THIS DEVICE', true],
    ['MACBOOK PRO','San Francisco · 2h ago', false],
    ['IPAD AIR','Oakland · 3d ago', false],
  ];
  const notifications = [
    ['Mission reminder','Daily at 06:00', true],
    ['Streak risk','When streak is at risk', true],
    ['Crew activity','Proofs & comments', true],
    ['Challenge rank','Rank movement', false],
    ['AI prescription','Tomorrow’s plan ready', true],
  ];

  // — Intro value frames —
  const intro = [
    { icon:'target',  title:'DAILY MISSIONS',  line:'One hard thing, assigned every day. Earned, not chosen.' },
    { icon:'shieldCheck', title:'PROOF NETWORK', line:'GPS, wearables, photo finish. Receipts or it didn’t happen.' },
    { icon:'pulse',   title:'AI PROGRESSION',  line:'Every completion, skip, and signal adapts tomorrow’s standard.' },
    { icon:'crew',    title:'CREWS & CHALLENGES', line:'Public standards. Crew pressure. No hiding.' },
  ];

  // — Safety screening —
  const safety = {
    points: [
      ['FITNESS DISCLAIMER','HTD missions are physical training, not medical advice. Train within your capacity.'],
      ['EMERGENCY SYMPTOMS','Stop immediately for chest pain, dizziness, sharp joint pain, or trouble breathing.'],
      ['RECOVERY PRINCIPLE','Recovery days are missions. Skipping recovery is a failure, not a flex.'],
    ],
    exposure: 'Cold exposure, fasted training, and breath work are opt-in and gated by your constraints.',
  };

  // — Failure / comeback —
  const failure = {
    missed: { title:'RUN 10K FASTED', when:'YESTERDAY · 06:00', category:'ENDURANCE' },
    reasons: ['SCHEDULE','LOW ENERGY','AVOIDANCE','SORENESS / PAIN','TRAVEL','SLEEP DEBT','LIFE EVENT'],
    pattern: 'Third early-morning miss in 3 weeks. Pattern: pre-7AM efforts after <6h sleep.',
    comeback: {
      title:'30 MIN Z2 + 20 PUSH-UPS', sub:'Low friction. High signal. Repair the chain.',
      difficulty:4.0, duration:'30 MIN', proof:'TIMER + PHOTO',
      why:'A comeback mission is deliberately easier — the win is showing up, not the load.',
      rules:['Complete within 24h to repair the streak','Streak resumes at 18 (not reset)','Miss the comeback → streak resets to 0'],
    },
  };

  // — Profile sub-scores + badges —
  profile.subScores = [
    ['PHYSICAL', 86],['MENTAL', 74],['RECOVERY', 81],['CONSISTENCY', 88],['PROOF CONFIDENCE', 96],
  ];
  profile.badges = [
    ['HTD 30 FINISHER','trophy', true],['IRON STREAK 14','flame', true],['FIRST PROOF','shieldCheck', true],
    ['COMEBACK','trend', true],['CREW FOUNDER','crew', false],['ELITE 90','lock', false],
  ];

  // — Calendar day details —
  const calendarMeta = {
    month:'MAY 2026',
    categories:['ALL','ENDURANCE','STRENGTH','MENTAL','RECOVERY'],
    dayDetail: { day:'MAY 20', mission:'RUN 10K FASTED', status:'COMPLETE', proof:'GPS + HR', conf:'HIGH', score:'+14' },
    stats:[['24','COMPLETE'],['4','MISSED'],['2','COMEBACKS'],['86%','RATE']],
  };

  // — Activity library —
  const activities = [
    { name:'FASTED 10K', cat:'ENDURANCE', dur:'50 MIN', diff:8.0, safety:'STANDARD', equip:'RUNNING' },
    { name:'RUCK 8KM / 20KG', cat:'ENDURANCE', dur:'75 MIN', diff:7.5, safety:'STANDARD', equip:'RUCK' },
    { name:'BACK SQUAT 5×5', cat:'STRENGTH', dur:'45 MIN', diff:7.0, safety:'STANDARD', equip:'BARBELL' },
    { name:'COLD PLUNGE 5:00', cat:'RECOVERY', dur:'15 MIN', diff:6.0, safety:'OPT-IN', equip:'PLUNGE' },
    { name:'BOX BREATH 4×4', cat:'MENTAL', dur:'16 MIN', diff:3.0, safety:'STANDARD', equip:'NONE' },
    { name:'FEAR INVENTORY', cat:'MENTAL', dur:'20 MIN', diff:5.0, safety:'STANDARD', equip:'NONE' },
    { name:'ZONE 2 90MIN', cat:'ENDURANCE', dur:'90 MIN', diff:6.5, safety:'STANDARD', equip:'ANY CARDIO' },
    { name:'DEAD HANG MAX', cat:'STRENGTH', dur:'10 MIN', diff:5.5, safety:'STANDARD', equip:'BAR' },
  ];

  // — Growth layer —
  const drop = {
    liveNow: 9412, completedToday: '184,201', windowLeft: '5:42:18',
    nextDrop: '05:00', city: 'SAN FRANCISCO',
  };
  const duels = {
    active: {
      opponent: 'JESSICA M.', oppAvatar: '#4a2a2a', oppHandle: 'RELENTLESS',
      mission: 'RUN 10K FASTED', stake: 'LOSER POSTS THE L CARD',
      ends: '14:22:08', you: 72, opp: 64,
      log: [['YOU', 'GPS locked · 7.2K down', '2h'], ['JESSICA', 'Mid-run · pace 5:04', '1h'], ['YOU', 'Negative split engaged', '40m']],
    },
    record: { w: 8, l: 3 },
    callouts: [
      ['DANIEL K.', '#3a4a2a', 'IRONCROWN', 'W 12 · L 4'],
      ['ALEX R.', '#2a3a4a', 'DISCIPLINE LAB', 'W 9 · L 6'],
      ['MARCUS T.', '#4a3a2a', 'FORGED', 'W 15 · L 2'],
    ],
    stakes: ['LOSER POSTS THE L CARD', 'WINNER PICKS NEXT MISSION', 'BRAGGING RIGHTS ONLY'],
  };
  const league = {
    tier: 'STEEL', tiers: ['IRON', 'STEEL', 'CARBON', 'TITAN', 'OBSIDIAN'],
    week: 'WEEK 24', ends: '2D 14H',
    cohort: [
      ['1', 'KAI N.', '2,840', 'up'], ['2', 'SOFIA R.', '2,615', 'up'], ['3', 'YOU', '2,540', 'up'],
      ['4', 'OMAR D.', '2,488', 'up'], ['5', 'LENA P.', '2,310', 'up'],
      ['6', 'JESS M.', '2,180', 'mid'], ['7', 'TOM W.', '2,054', 'mid'], ['8', 'IVY C.', '1,980', 'mid'],
      ['9', 'NICO F.', '1,710', 'mid'], ['10', 'ASH B.', '1,544', 'mid'],
      ['26', 'SAM K.', '420', 'down'], ['27', 'RUI T.', '388', 'down'], ['28', 'MAX D.', '310', 'down'],
    ],
    promo: 5, releg: 25, size: 30,
  };
  const reels = [
    { user: 'DANIEL K.', avatar: '#3a4a2a', mission: 'RUN 10K FASTED', grad: 'linear-gradient(160deg,#16240e,#050705 70%)',
      stat: ['4:58 /KM', '49:52'], respect: '1.2K', comments: 84, conf: 'HIGH', caption: 'Fasted. Negative split. No debate.' },
    { user: 'JESSICA M.', avatar: '#4a2a2a', mission: 'HYROX DOUBLES', grad: 'linear-gradient(160deg,#241410,#050705 70%)',
      stat: ['1:07:32', '920 CAL'], respect: '986', comments: 61, conf: 'HIGH', caption: 'Doubles with the crew. Lungs gone.' },
    { user: 'ALEX R.', avatar: '#2a3a4a', mission: 'COLD PLUNGE 3°C', grad: 'linear-gradient(160deg,#0e1a24,#050705 70%)',
      stat: ['3.0°C', '05:00'], respect: '2.4K', comments: 203, conf: 'HIGH', caption: 'Five minutes. The mind quits first.' },
  ];
  const wrapped = {
    season: 'SEASON 04', slides: [
      { k: 'MISSIONS PROVEN', v: '142', sub: 'Top 4% globally' },
      { k: 'HARDEST WEEK', v: 'W18', sub: '9 missions · 2 comebacks' },
      { k: 'LONGEST STREAK', v: '34', sub: 'days without a miss' },
      { k: 'YOUR IDENTITY', v: 'RELENTLESS', sub: 'You show up when it’s hardest' },
    ],
  };
  const shields = { available: 2, max: 3, refill: 'EARN 1 PER PERFECT WEEK' };

  // — Soul layer —
  const manifesto = ['NO ONE\nIS COMING.', 'COMFORT\nIS A CAGE.', 'PROOF\nIS POWER.', 'EARN YOUR\nFREEDOM.'];
  today.lore = 'Fasted work teaches the body what the mind already knows: you can go further on less.';
  const identity = {
    ranks: [
      ['RECRUIT', 'Day 1 — you showed up', true],
      ['OPERATOR', '21 proven days', true],
      ['HARDCASE', '60 proven days · 1 comeback', true],
      ['UNBREAKABLE', '100 proven days', false],
      ['RELENTLESS', '250 proven days · top 5%', false],
    ],
    current: 'HARDCASE', daysToNext: 18, next: 'UNBREAKABLE',
    creed: 'You don’t have goals anymore. You have a standard.',
  };
  const checkins = {
    today: [
      ['DANIEL K.', '#3a4a2a', 'IN', 'Fasted 10K done. 4:58s.', '2h'],
      ['JESSICA M.', '#4a2a2a', 'IN', 'Doubles at dawn. Crew of two.', '3h'],
      ['MARCUS T.', '#4a3a2a', 'STRUGGLING', 'Rough night. Zero sleep, travel day.', '1h'],
      ['ALEX R.', '#2a3a4a', 'IN', 'Plunge done before coffee.', '4h'],
    ],
    backups: 2,
  };
  const stories = [
    { id:'s1', name:'MARCUS T.', avatar:'#4a3a2a', days:90,
      headline:'90 DAYS AGO MARCUS COULDN’T RUN 2K.',
      arc:[['DAY 1','2K · walked half'],['DAY 45','8K ruck · first comeback'],['DAY 90','HALF MARATHON · 1:58']],
      quote:'I stopped negotiating with myself. That was the whole trick.',
      respect:'4.8K' },
  ];
  const referral = {
    code:'HARDCASE-3X', invited:[['JORDAN P.','JOINED · DAY 6'],[null,null],[null,null]],
    reward:'1 STREAK SHIELD PER 3 ATHLETES', lifetime:4,
  };
  const debrief = {
    week:'WEEK 24', fallback: {
      proved:'6 of 7 missions. Hardest: fasted 10K on 6h sleep — you went anyway.',
      avoided:'You delayed Tuesday’s 5:30AM session to evening. Third time this month.',
      arc:'Next week holds difficulty at 8.0 and puts your two hardest efforts before 7AM. We attack the avoidance directly.',
    },
  };
  const overload = {
    strain:'18.4', hrvDrop:'−24%', sleepDebt:'−6.2H',
    line:'Three red signals. Discipline includes restraint — today the mission is to stand down.',
  };

  // — Apex layer (Bucket A) —
  const liveSession = {
    mission:'RUN 10K FASTED', elapsed:'18:52',
    members:[
      ['DANIEL K.','#3a4a2a', 72, '7.2 KM', '142'],
      ['JESSICA M.','#4a2a2a', 64, '6.4 KM', '156'],
      ['ALEX R.','#2a3a4a', 81, '8.1 KM', '139'],
    ],
    voice:'CREW AUDIO · 2 TALKING',
  };
  const gym = {
    name:'IRONWORKS SF', city:'SAN FRANCISCO', members:184, rank:'#2 IN SF',
    weekPts:'48,210', rival:'DOGPATCH BARBELL',
    board:[['1','DANIEL K.','2,840'],['2','YOU','2,540'],['3','PRIYA S.','2,410'],['4','JAMES O.','2,180'],['5','LENA P.','2,054']],
    sessions:[['MON 06:00','CREW RUN · 12 IN'],['WED 18:30','STRENGTH · 9 IN'],['SAT 08:00','LONG RUCK · 21 IN']],
  };
  const worldDay = {
    date:'JUNE 21', name:'HTD WORLD DAY', mission:'5K. EVERYONE. EVERYWHERE.',
    sub:'One mission. Every athlete on Earth. Same day.',
    joined:'2,418,335', cities:'1,904', countdown:'11D 07H',
  };
  const trust = {
    score:96, verifications:38, accuracy:'97%', status:'VERIFIER · LEVEL 2',
    queue:[
      { mission:'RUN 21K', flag:'Pace 2:58/km — implausible', user:'ANON-4821', vote:null },
      { mission:'COLD PLUNGE 10:00', flag:'Duplicate media checksum', user:'ANON-1107', vote:null },
    ],
  };
  const pushGallery = [
    ['05:00','MISSION DROP','Today’s mission is live. 9,412 already moving.'],
    ['06:40','CREW PRESSURE','Marcus checked in STRUGGLING. Back him up.'],
    ['12:15','DUEL EXPIRING','Jessica is at 64%. Your lead is 8. 6h left.'],
    ['18:00','STREAK RISK','4h left in the window. 18 days on the line.'],
    ['20:30','DEBRIEF READY','Sunday debrief synthesized. 2 minutes.'],
    ['21:00','SHIELD EARNED','Perfect week. +1 streak shield.'],
  ];
  const arc = {
    weeks:[
      ['W1','BASE','Build the habit. Z2 + bodyweight.', 'done-none'],
      ['W2','LOAD','First fasted efforts. Crew joins.', 'done-none'],
      ['W3','BENCHMARK','10K test + cold exposure.', 'done-none'],
      ['W4','PROVE IT','Peak week. Day 30: the standard.', 'done-none'],
    ],
    line:'Built from your mode, goals, equipment, and constraints.',
  };

  window.HTD_FIX = { today, crew, streak, calendar, feed, comments, challenges, ai, profile, onboarding,
    protocols, readiness, monetization, sessions, notifications, intro, safety, failure, calendarMeta, activities,
    drop, duels, league, reels, wrapped, shields, manifesto, identity, checkins, stories, referral, debrief, overload,
    liveSession, gym, worldDay, trust, pushGallery, arc };

  // — Seasonal challenge catalog —
  challenges.calendar = [
    { code:'JUN', name:'DAWN PATROL', tagline:'30 SUNRISES. NO SNOOZE.', state:'LIVE', sub:'Every mission before 07:00.', joined:'412K' },
    { code:'JUL', name:'FURNACE', tagline:'TRAIN THROUGH THE HEAT.', state:'STARTS JUL 1', sub:'Heat-adapted endurance block.', joined:'88K' },
    { code:'AUG', name:'CARRY MONTH', tagline:'NOTHING IS LIGHT.', state:'STARTS AUG 1', sub:'Rucks, carries, grip. Daily.', joined:'31K' },
  ];
  challenges.ladders = [
    ['HTD 7','THE ON-RAMP','7 days · proof daily', false],
    ['HTD 14','THE HABIT','14 days · 1 rest day', false],
    ['HTD 30','THE STANDARD','30 days · the flagship', true],
  ];
  challenges.skillArcs = [
    ['FIRST 5K','ENDURANCE','21-day couch-to-proof','pulse'],
    ['FIRST MURPH','HYBRID','6-week build to the full','flame'],
    ['100 STRICT PUSH-UPS','STRENGTH','unbroken · 8-week arc','zap'],
    ['COLD 30','RECOVERY','30 plunges · 30 days','droplet'],
  ];
  challenges.partner = {
    name:'TWO-MAN CONTRACT', sub:'You and one athlete. Both finish or both fail.',
    rule:'Shared streak — one miss breaks both. Brutal by design.',
  };
  challenges.categories = ['ALL','ENDURANCE','STRENGTH','MENTAL','RECOVERY','HYBRID'];

  // — App Store kit —
  window.HTD_FIX.storeKit = {
    shots: [
      ['DO HARD THINGS DAILY','One adaptive mission. Every day. Earned, not chosen.'],
      ['PROOF OR IT DIDN\u2019T HAPPEN','GPS, heart rate, photo finish. Numbers that can\u2019t be faked.'],
      ['YOUR CREW IS WAITING','Check-ins, pressure, comebacks. Discipline is contagious.'],
      ['AN AI THAT KNOWS YOUR PATTERNS','It sees what you avoid — and prescribes it.'],
      ['BECOME UNBREAKABLE','Ranks are earned in days proven, never given.'],
      ['EARN YOUR FREEDOM','No one is coming. Join 1.2M athletes.'],
    ],
    sub:'Free to start · iOS & Android · htd.app',
  };
})();
