<?php
/*
 * Self-contained CWC email layout. Upload only this file for design/copy updates.
 * teamAxaXLCombinedEmail.php still supplies dynamic team data and sends attachments.
 */
$layout = <<<'CWC_EMAIL_LAYOUT'
<!-- Dynamic team header is rendered below; the email body begins on the next line. -->
<tr><td style="background:#071d46;padding:14px 28px 10px 28px;">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid rgba(214,173,69,.85);border-radius:20px;background:#061a40;overflow:hidden;">
<tr><td align="center" style="padding:26px 24px 6px 24px;"><div style="display:inline-block;background:#d6ad45;color:#071d46;font-size:12px;letter-spacing:1.7px;text-transform:uppercase;padding:8px 14px;border-radius:999px;font-weight:700;">Launch Highlights • 20 September 2026</div>
<div style="font-family:Georgia,'Times New Roman',serif;font-size:30px;line-height:1.2;color:#ffffff;font-weight:700;margin-top:14px;">The Corporate World Cup™ <span style="color:#d6ad45;">Mega Launch</span></div>
<div style="font-size:14px;line-height:1.75;color:#eaf1ff;margin-top:10px;">On 20 September 2026, the Corporate World Cup™ was officially launched in Gurugram with Global Brand Ambassador <strong>Sanath Jayasuriya</strong>, leaders, partners and corporate cricket teams.</div></td></tr>
<tr><td align="center" style="padding:14px 24px 8px 24px;"><img src="assets/megaluanch-email.jpg" width="736" align="center" alt="Corporate World Cup mega launch on 20 September 2026, with panel discussion and team jersey presentation" style="display:block;width:100%;max-width:736px;height:auto;margin:0 auto;border:0;border-radius:12px;"></td></tr>
<tr><td style="padding:16px 24px 6px 24px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:rgba(4,20,50,.84);border:1px solid rgba(214,173,69,.6);border-radius:14px;"><tr>
<td width="25%" align="center" style="padding:14px 6px;border-right:1px solid rgba(214,173,69,.4);"><div style="font-size:26px;color:#fff;font-weight:800;line-height:1;">192</div><div style="font-size:11px;color:#d6ad45;text-transform:uppercase;letter-spacing:.5px;margin-top:4px;">Teams</div></td>
<td width="25%" align="center" style="padding:14px 6px;border-right:1px solid rgba(214,173,69,.4);"><div style="font-size:26px;color:#fff;font-weight:800;line-height:1;">24</div><div style="font-size:11px;color:#d6ad45;text-transform:uppercase;letter-spacing:.5px;margin-top:4px;">Cities</div></td>
<td width="25%" align="center" style="padding:14px 6px;border-right:1px solid rgba(214,173,69,.4);"><div style="font-size:26px;color:#fff;font-weight:800;line-height:1;">864</div><div style="font-size:11px;color:#d6ad45;text-transform:uppercase;letter-spacing:.5px;margin-top:4px;">Matches</div></td>
<td width="25%" align="center" style="padding:14px 6px;"><div style="font-size:26px;color:#fff;font-weight:800;line-height:1;">July 2027</div><div style="font-size:11px;color:#d6ad45;text-transform:uppercase;letter-spacing:.5px;margin-top:4px;">National Finale</div></td>
</tr></table>
<div style="font-size:12px;line-height:1.6;color:#dfe8ff;text-align:center;margin-top:10px;">24-city pre-qualification: <strong style="color:#d6ad45;">Nov 2026 – Jun 2027</strong> &nbsp;→&nbsp; Corporate World Cup™: <strong style="color:#d6ad45;">July 2027</strong></div></td></tr>
</table></td></tr>
<tr>
<td style="background:#071d46;padding:14px 28px 18px 28px;">
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid rgba(214,173,69,.85);border-radius:20px;background:#061a40;overflow:hidden;">
    <tr>
      <td style="padding:26px 26px 8px 26px;text-align:center;">
        <div style="font-family:Georgia,'Times New Roman',serif;font-size:32px;line-height:1.15;color:#d6ad45;font-weight:700;text-transform:uppercase;letter-spacing:1px;">
          The Opportunity Of A Generation
        </div>
      </td>
    </tr>

    <tr>
      <td style="padding:10px 28px 30px 28px;">
        <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
          <tr>
            <td width="64%" valign="middle" style="padding-right:28px;">

              <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
                <tr>
                  <td width="33.33%" align="center" style="padding:6px;">
                    <div style="border:1px solid rgba(214,173,69,.55);border-radius:15px;padding:16px 9px;background:rgba(255,255,255,.05);min-height:98px;">
                      <div style="font-size:34px;color:#d6ad45;line-height:1;">🛡️</div>
                      <div style="font-size:13px;line-height:1.45;color:#ffffff;font-weight:700;text-transform:uppercase;margin-top:8px;"> AXA XL Has<br>Won Matches.</div>
                    </div>
                  </td>
                  <td width="33.33%" align="center" style="padding:6px;">
                    <div style="border:1px solid rgba(214,173,69,.55);border-radius:15px;padding:16px 9px;background:rgba(255,255,255,.05);min-height:98px;">
                      <div style="font-size:34px;color:#d6ad45;line-height:1;">👥</div>
                      <div style="font-size:13px;line-height:1.45;color:#ffffff;font-weight:700;text-transform:uppercase;margin-top:8px;"> AXA XL Has<br>Built Teams.</div>
                    </div>
                  </td>
                  <td width="33.33%" align="center" style="padding:6px;">
                    <div style="border:1px solid rgba(214,173,69,.55);border-radius:15px;padding:16px 9px;background:rgba(255,255,255,.05);min-height:98px;">
                      <div style="font-size:34px;color:#d6ad45;line-height:1;">🏅</div>
                      <div style="font-size:13px;line-height:1.45;color:#ffffff;font-weight:700;text-transform:uppercase;margin-top:8px;"> AXA XL Has<br>Created Memories.</div>
                    </div>
                  </td>
                </tr>
              </table>

              <div style="font-size:15px;line-height:1.7;color:#ffffff;text-align:center;text-transform:uppercase;letter-spacing:.35px;margin-top:20px;">
                Now AXA XL has the opportunity to compete for something<br>
                no corporate team has ever won.
              </div>

              <div style="font-family:Georgia,'Times New Roman',serif;font-size:38px;line-height:1.06;color:#ffffff;font-weight:700;margin-top:18px;text-align:left;">
                The Inaugural<br>
                <span style="color:#d6ad45;">Corporate World Cup™</span><br>
                Championship
              </div>

              <table role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin-top:24px;">
                <tr>
                  <td style="padding-right:12px;">
                    <a href="https://www.procorporateleague.com/ai/corporate-cricket-team-ai-analysis/pcl-ai-corporate-team-profile.php?team_id=2009&amp;team_name=AXA%20XL" style="display:inline-block;background:#d6ad45;color:#071d46;text-decoration:none;font-size:13px;letter-spacing:.6px;text-transform:uppercase;padding:13px 22px;border-radius:999px;font-weight:700;">View Team Dashboard</a>
                  </td>
                  <td>
                    <a href="https://www.procorporateleague.com/pcl/team-register/" style="display:inline-block;border:1px solid #d6ad45;color:#ffffff;text-decoration:none;font-size:13px;letter-spacing:.6px;text-transform:uppercase;padding:12px 22px;border-radius:999px;font-weight:700;">Reserve Category</a>
                  </td>
                </tr>
              </table>

            </td>

            <td width="36%" valign="middle" align="center" style="padding-left:18px;border-left:1px solid rgba(214,173,69,.35);">
              <div style="background:#ffffff;border-radius:18px;padding:18px 18px 18px 18px;border:1px solid rgba(214,173,69,.65);">
                <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="margin-bottom:12px;">
                  <tr>
                    <td align="center" valign="middle" style="width:50%;">
                      <img src="https://www.procorporateleague.com/wp-includes/images/team/2009.png" width="160" align="center" alt="AXA XL Logo" style="display:block;width:auto;max-width:160px;max-height:70px;height:auto;margin:0 auto;border:0;object-fit:contain;">
                    </td>
                    <td align="center" valign="middle" style="width:50%;">
                      <img src="https://www.procorporateleague.com/2026/pcl/SonyLIV_2020.png" width="72" align="center" alt="Sony LIV" style="display:block;width:auto;max-width:72px;max-height:36px;height:auto;margin:0 auto;border:0;object-fit:contain;border-radius:8px;background:#000000;">
                    </td>
                  </tr>
                </table>

                <img src="https://wplspeedqueen.com/email_api/cwctrophy.png" width="245" alt="Corporate World Cup Trophy" style="display:block;width:100%;max-width:245px;height:auto;border:0;margin:0 auto;object-fit:contain;">

                <div style="font-size:12px;line-height:1.6;color:#071d46;margin-top:10px;text-align:center;">
                  Only 2 teams from Gurugram will qualify for the National Finals ecosystem.
                </div>
              </div>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</td>
</tr>

<tr>
<td style="padding:12px 28px;background:#ffffff;">
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #d6ad45;border-radius:18px;overflow:hidden;background:#fff8e4;">
    <tr>
      <td width="58%" valign="middle" style="padding:24px;">
        <div style="font-size:12px;line-height:1.6;color:#a17300;letter-spacing:2px;text-transform:uppercase;">PCL Season 11 Closing Ceremony</div>
        <h2 style="margin:8px 0 10px 0;font-family:Georgia,'Times New Roman',serif;font-size:26px;line-height:1.25;color:#071d46;font-weight:700;">Chris Gayle Presence Added Authenticity To The Corporate Champions Celebration</h2>
        <div style="font-size:14px;line-height:1.8;color:#24304a;">
        #TheUniverseBoss Chris Gayle joined the PCL Season 11 Closing Ceremony to celebrate corporate champions, adding global sporting recognition and further strengthening the credibility, prestige, and legacy of the Pro Corporate League ecosystem. 🏆
        </div>
      </td>

      <td width="42%" valign="middle" align="center" style="padding:18px;">
        <a href="https://procorporateleague.com/assets/highlights/2025_Corporate_Champions.mp4" style="text-decoration:none;">
          <img src="https://www.procorporateleague.com/uploads/sliders/mobile/images/20260603085928_Chris_Gayle_X_PCL__Slider_for_Mobile_.jpg" width="330" align="center" alt="Chris Gayle at PCL Season 11 Closing Ceremony" style="display:block;width:100%;max-width:330px;height:auto;margin:0 auto;border:0;border-radius:14px;">
          <div style="display:inline-block;margin-top:12px;background:#071d46;color:#ffffff;font-size:12px;letter-spacing:.6px;text-transform:uppercase;padding:10px 16px;border-radius:999px;">Watch Champions Highlights</div>
        </a>
        <div style="margin-top:10px;">
          <a href="https://drive.google.com/file/d/11inKVLn04e01_PKFZGghXWu0la02PVqk/view?usp=sharing"
             target="_blank"
             style="display:inline-block;background:#d6ad45;color:#071d46;font-size:12px;letter-spacing:.6px;text-transform:uppercase;padding:10px 16px;border-radius:999px;font-weight:700;text-decoration:none;">
            Download PCL Profile
          </a>
        </div>
      </td>

      
       
        
          
    </tr>
  </table>
</td>
</tr>

<tr>
<td style="padding:12px 28px;background:#ffffff;">
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #e2e7f0;border-radius:18px;overflow:hidden;background:#071d46;">
    <tr>
      <td style="padding:24px 24px 12px 24px;">
        <div style="font-size:12px;line-height:1.6;color:#d6ad45;letter-spacing:2px;text-transform:uppercase;">Celebrity Trust & Corporate Credibility</div>
        <h2 style="margin:8px 0 10px 0;font-family:Georgia,'Times New Roman',serif;font-size:28px;line-height:1.2;color:#ffffff;font-weight:700;">15 Years Of Building Corporate Teams Beyond The Workplace</h2>
        <div style="font-size:14px;line-height:1.8;color:#eaf1ff;">
          Pro Corporate League has engaged 500+ corporate teams and worked alongside global cricket personalities to create one of India's most visible corporate cricket ecosystems.
        </div>
      </td>
    </tr>
    <tr>
      <td align="center" style="padding:10px 24px 0 24px;">
        <img src="assets/15year1st-email.jpg" width="752" align="center" alt="15 years of Pro Corporate League legacy with cricket legends and trusted partners" style="display:block;width:100%;max-width:752px;height:auto;margin:0 auto;border:0;border-radius:14px;">
      </td>
    </tr>
    <tr>
      <td align="center" style="padding:12px 24px 0 24px;">
        <img src="assets/15years2-email.jpg" width="752" align="center" alt="500-plus corporate teams and 15-plus years of corporate cricket participation" style="display:block;width:100%;max-width:752px;height:auto;margin:0 auto;border:0;border-radius:14px;">
      </td>
    </tr>
    <tr>
      <td style="padding:14px 24px 24px 24px;font-size:13px;line-height:1.7;color:#dfe8ff;">
        A credibility-led ecosystem supported by cricket legends, corporate leaders and national-level corporate sporting stories.
      </td>
    </tr>
  </table>
</td>
</tr>




<tr>
<td style="padding:12px 28px;background:#ffffff;">
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #e2e7f0;border-radius:18px;overflow:hidden;background:#ffffff;">
    <tr>
      <td width="28%" valign="middle" align="center" style="padding:22px;background:#f7f9fc;">
        <img src="https://www.procorporateleague.com/2026/pcl/SonyLIV_2020.png" width="120" alt="Sony LIV" style="display:block;width:120px;max-width:120px;height:auto;border:0;margin:0 auto;">
      </td>
      <td width="72%" valign="middle" style="padding:22px;">
        <div style="font-size:12px;line-height:1.6;color:#a17300;letter-spacing:2px;text-transform:uppercase;">Broadcast Visibility</div>
        <h2 style="margin:8px 0 10px 0;font-family:Georgia,'Times New Roman',serif;font-size:25px;line-height:1.25;color:#071d46;font-weight:700;">PCL On Sony LIV</h2>
        <div style="font-size:14px;line-height:1.8;color:#24304a;">
          Pro Corporate League's Eleven 11 highlight property has been showcased through the Sony LIV ecosystem, adding broadcast credibility and visibility to participating corporate teams.
        </div>
        <div style="margin-top:14px;">
          <a href="https://www.procorporateleague.com/pcl/media/pcl-eleven11-sony-liv-highlight/" style="display:inline-block;background:#071d46;color:#ffffff;text-decoration:none;font-size:12px;letter-spacing:.6px;text-transform:uppercase;padding:11px 17px;border-radius:999px;">View Sony LIV Coverage</a>
        </div>
      </td>
    </tr>
  </table>
</td>
</tr>




<tr>
   
  <td style="padding:12px 28px;background:#ffffff;">
    <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0"
      style="background:#071d46;border-radius:18px;overflow:hidden;">

      <tr>
        <td colspan="2" align="center" style="padding:32px 32px 0;">

          <table role="presentation" cellpadding="0" cellspacing="0" border="0">
            <tr>
              <td style="background:rgba(255,255,255,0.12);border:1px solid rgba(255,255,255,0.22);border-radius:999px;padding:10px 16px;text-align:center;">
                <span style="font-family:Arial,Helvetica,sans-serif;font-size:11px;font-weight:700;color:#ffffff;text-transform:uppercase;letter-spacing:1.5px;">
                  &#11044;&nbsp; Jan–Feb 2026 &nbsp;•&nbsp; BCCI Initiative &nbsp;•&nbsp; WPLT20 Authenticity
                </span>
              </td>
            </tr>
            
          </table>

          <div style="font-family:Georgia,'Times New Roman',serif;font-size:28px;line-height:1.2;color:#ffffff;font-weight:700;padding-top:24px;text-align:center;">
            National cricket credibility,<br>
            now connected to
            <span style="color:#ffe28a;">PCL's corporate cricket ecosystem.</span>
          </div>

          <div style="padding-top:20px;">
            <table role="presentation" cellpadding="0" cellspacing="0" border="0">
              <tr>
                <td>
                  <a href="https://procorporateleague.com/2026/wpl/wplspeedqueen/"
                    style="display:inline-block;background:linear-gradient(135deg,#ec008c,#ff4eb8);color:#ffffff;text-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:13px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;padding:13px 24px;border-radius:999px;">
                    View Full Case Study
                  </a>
                </td>
              </tr>
            </table>
          </div>
        </td>
      </tr>
      <tr>
        <td colspan="2" align="center" style="padding:24px 32px 8px;">
        <a href="https://procorporateleague.com/2026/wpl/wplspeedqueen/" target="_blank" style="text-decoration:none; display:block;">
          <img src="https://wplspeedqueen.com/email_api/Website_Banner1.jpg"
                align="center"
                width="736"
                alt="WPL Speed Queen case study"
                style="display:block;width:100%;max-width:736px;height:auto;margin:0 auto;border:0;">
        </a>
        </td>
      </tr>

    

      <tr>
        <td colspan="2" style="padding:0 32px 32px 32px;">
          <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
            <tr>

              <td width="23%" align="center" valign="top"
                  style="padding:16px 12px;background:rgba(255,255,255,0.06);border-radius:12px;">
                <div style="font-family:Arial,Helvetica,sans-serif;font-size:24px;font-weight:700;color:#ffe28a;">
                  28
                </div>
                <div style="font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:18px;color:#ffffff;padding-top:6px;">
                  Cities activated
                </div>
              </td>

              <td width="2%"></td>

              <td width="23%" align="center" valign="top"
                  style="padding:16px 12px;background:rgba(255,255,255,0.06);border-radius:12px;">
                <div style="font-family:Arial,Helvetica,sans-serif;font-size:24px;font-weight:700;color:#ffe28a;">
                  13K+
                </div>
                <div style="font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:18px;color:#ffffff;padding-top:6px;">
                  Registration footprint
                </div>
              </td>

              <td width="2%"></td>

              <td width="23%" align="center" valign="top"
                  style="padding:16px 12px;background:rgba(255,255,255,0.06);border-radius:12px;">
                <div style="font-family:Arial,Helvetica,sans-serif;font-size:24px;font-weight:700;color:#ffe28a;">
                  7.5K+
                </div>
                <div style="font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:18px;color:#ffffff;padding-top:6px;">
                  On-ground participation
                </div>
              </td>

              <td width="2%"></td>

              <td width="23%" align="center" valign="top"
                  style="padding:16px 12px;background:rgba(255,255,255,0.06);border-radius:12px;">
                <div style="font-family:Arial,Helvetica,sans-serif;font-size:24px;font-weight:700;color:#ffe28a;">
                  40
                </div>
                <div style="font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:18px;color:#ffffff;padding-top:6px;">
                  Day execution window
                </div>
              </td>

            </tr>
          </table>
        </td>
      </tr>

    </table>
  </td>
    
</tr>








<tr>
<td style="background:#071d46;padding:8px 24px 18px 24px;">
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid rgba(214,173,69,.75);border-radius:16px;background:#061a40;">
    <tr>
      <td width="54%" valign="middle" style="padding:24px;border-right:1px solid rgba(214,173,69,.45);">
        <div style="font-family:Georgia,'Times New Roman',serif;font-size:27px;line-height:1.2;color:#d6ad45;font-weight:700;text-transform:uppercase;">Secure Your Spot</div>
        <div style="font-size:14px;line-height:1.75;color:#ffffff;margin-top:8px;">
          Confirm your participation and become part of the most prestigious corporate cricket journey ever. Let’s build history together.
        </div>
      </td>
      <td width="46%" valign="middle" align="center" style="padding:24px;">
        <a href="https://www.procorporateleague.com/pcl/team-register/" style="display:inline-block;background:#d6ad45;color:#071d46;text-decoration:none;font-family:Georgia,'Times New Roman',serif;font-size:18px;line-height:1.2;font-weight:700;text-transform:uppercase;padding:15px 44px;border-radius:8px;">Reserve Your Category</a>
        <div style="font-size:13px;line-height:1.7;color:#ffffff;margin-top:14px;">Only 8 Teams Per City • Only 1 Team Per Sector</div>
      </td>
    </tr>
  </table>
</td>
</tr>


<tr>
<td style="background:#041432;padding:18px 24px;border-top:1px solid rgba(214,173,69,.45);">
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
      <td align="center" style="font-size:13px;line-height:1.7;color:#ffffff;">☎ +91 98185 96699</td>
      <td align="center" style="font-size:13px;line-height:1.7;color:#ffffff;">✉ pcl@procorporateleague.com</td>
      <td align="center" style="font-size:13px;line-height:1.7;color:#ffffff;">🌐 www.procorporateleague.com</td>
    </tr>
  </table>
</td>
</tr>

<tr>
<td style="background:#071d46;padding:0 22px 26px 22px;text-align:center;">
  <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#ffffff;border-radius:0 0 22px 22px;overflow:hidden;border-top:4px solid #d6ad45;">
    <tr>
      <td style="padding:24px 18px 16px 18px;text-align:center;">
        <div style="font-family:Georgia,'Times New Roman',serif;font-size:24px;line-height:1.25;color:#071d46;font-weight:700;margin-bottom:8px;">
          Corporate World Cup™ Ecosystem
        </div>
        <div style="font-size:12px;line-height:1.7;color:#5d6880;">
          15+ Years Building Corporate Cricket • 500+ Corporate Teams • 3000+ Matches Conducted
        </div>
      </td>
    </tr>

    <tr>
      <td style="padding:0 18px 18px 18px;">
        <table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border:1px solid #d8dfeb;border-radius:16px;overflow:hidden;">
          <tr>
            <td width="14.28%" align="center" valign="middle" style="padding:16px 8px;border-right:1px solid #d8dfeb;background:#fbfcff;">
              <a href="https://www.procorporateleague.com/ai/corporate-cricket-team-ai-analysis/pcl-ai-corporate-team-profile.php?team_id=2009&amp;team_name=AXA%20XL" style="text-decoration:none;color:#071d46;">
                <div style="font-size:10px;line-height:1.4;color:#5d6880;text-transform:uppercase;letter-spacing:.7px;">
                  Your Sector
                </div>

                <img src="https://www.procorporateleague.com/wp-includes/images/team/2009.png"
                    width="140"
                    alt="AXA XL Logo"
                    style="display:block;width:auto;max-width:140px;max-height:70px;height:auto;border:0;margin:9px auto 8px auto;">

                <div style="font-size:12px;line-height:1.35;color:#071d46;font-weight:700;">
                  Insurance
                </div>
              </a>
            </td>

            <td width="14.28%" align="center" valign="middle" style="padding:16px 8px;border-right:1px solid #d8dfeb;background:#ffffff;">
              <a href="https://www.procorporateleague.com/pcl/media/pcl-eleven11-sony-liv-highlight/" style="text-decoration:none;color:#071d46;">
                <div style="font-size:10px;line-height:1.4;color:#5d6880;text-transform:uppercase;letter-spacing:.7px;">OTT Partner</div>
                <img src="https://www.procorporateleague.com/2026/pcl/SonyLIV_2020.png" width="62" alt="Sony LIV" style="display:block;width:62px;height:auto;border:0;border-radius:8px;margin:9px auto 8px auto;background:#000000;">
                <div style="font-size:12px;line-height:1.35;color:#071d46;font-weight:700;">Sony LIV</div>
              </a>
            </td>

            <td width="14.28%" align="center" valign="middle" style="padding:16px 8px;border-right:1px solid #d8dfeb;background:#fbfcff;">
              <a href="https://www.procorporateleague.com/" style="text-decoration:none;color:#071d46;">
                <div style="font-size:10px;line-height:1.4;color:#5d6880;text-transform:uppercase;letter-spacing:.7px;">Powered By</div>
                <img src="https://www.procorporateleague.com/2026/pcl/pclimage.png" width="78" alt="Pro Corporate League" style="display:block;width:auto;max-width:78px;max-height:42px;height:auto;border:0;margin:9px auto 8px auto;">
                <div style="font-size:12px;line-height:1.35;color:#071d46;font-weight:700;">PCL</div>
              </a>
            </td>

            <td width="14.28%" align="center" valign="middle" style="padding:16px 8px;border-right:1px solid #d8dfeb;background:#ffffff;">
              <a href="https://www.procorporateleague.com/pcl/media/pcl-corporate-cricket-electronic-media-coverage/" style="text-decoration:none;color:#071d46;">
                <div style="font-size:10px;line-height:1.4;color:#5d6880;text-transform:uppercase;letter-spacing:.7px;">Media</div>
                <div style="font-size:28px;line-height:1;margin:9px 0 8px 0;">🎥</div>
                <div style="font-size:12px;line-height:1.35;color:#071d46;font-weight:700;">Highlights</div>
              </a>
            </td>

            <td width="14.28%" align="center" valign="middle" style="padding:16px 8px;border-right:1px solid #d8dfeb;background:#fbfcff;">
              <a href="https://www.procorporateleague.com/pcl/media/pcl-legacy-corporate-cricket-india/" style="text-decoration:none;color:#071d46;">
                <div style="font-size:10px;line-height:1.4;color:#5d6880;text-transform:uppercase;letter-spacing:.7px;">Legacy</div>
                <div style="font-size:28px;line-height:1;margin:9px 0 8px 0;">🏆</div>
                <div style="font-size:12px;line-height:1.35;color:#071d46;font-weight:700;">15+ Years</div>
              </a>
            </td>

            <td width="14.28%" align="center" valign="middle" style="padding:16px 8px;border-right:1px solid #d8dfeb;background:#ffffff;">
              <a href="https://www.procorporateleague.com/ai/corporate-cricket-rankings-india" style="text-decoration:none;color:#071d46;">
                <div style="font-size:10px;line-height:1.4;color:#5d6880;text-transform:uppercase;letter-spacing:.7px;">Platform</div>
                <div style="font-size:28px;line-height:1;margin:9px 0 8px 0;">📊</div>
                <div style="font-size:12px;line-height:1.35;color:#071d46;font-weight:700;">AI Rankings</div>
              </a>
            </td>

            <td width="14.28%" align="center" valign="middle" style="padding:16px 8px;background:#fbfcff;">
              <a href="https://www.procorporateleague.com/pcl/media/pcl-eleven11-sony-liv-highlight/" style="text-decoration:none;color:#071d46;">
                <div style="font-size:10px;line-height:1.4;color:#5d6880;text-transform:uppercase;letter-spacing:.7px;">On Sony LIV</div>
                <div style="font-size:28px;line-height:1;margin:9px 0 8px 0;">📺</div>
                <div style="font-size:12px;line-height:1.35;color:#071d46;font-weight:700;">PCL on Sony LIV</div>
              </a>
            </td>
          </tr>
        </table>
      </td>
    </tr>

    <tr>
      <td style="padding:6px 24px 8px 24px;text-align:center;">
        <div style="font-size:12px;line-height:2;color:#5d6880;">
          <a href="https://corporateworldcup.com/" style="color:#d6ad45;text-decoration:none;font-weight:700;">corporateworldcup.com</a>
          &nbsp;|&nbsp;
          <a href="https://www.roadtocorporateworldcup.com/" style="color:#d6ad45;text-decoration:none;font-weight:700;">roadtocorporateworldcup.com</a>
          <br>
          <a href="https://www.procorporateleague.com/pcl/media/chris-gayle-universe-boss-corporate-cricket-india/" style="color:#d6ad45;text-decoration:none;">Chris Gayle at PCL</a>
          &nbsp;|&nbsp;
          <a href="https://www.procorporateleague.com/pcl/media/jonty-rhodes-goat-pcl-corporate-cricket-india/" style="color:#d6ad45;text-decoration:none;">Jonty Rhodes at PCL</a>
          &nbsp;|&nbsp;
          <a href="https://www.procorporateleague.com/pcl/media/pcl-legacy-corporate-cricket-india/" style="color:#d6ad45;text-decoration:none;">PCL Legacy</a>
          <br>
          <a href="https://www.procorporateleague.com/pcl/media/pcl-print-media-coverage-corporate-cricket-india/" style="color:#d6ad45;text-decoration:none;">Print Media</a>
          &nbsp;|&nbsp;
          <a href="https://www.procorporateleague.com/pcl/media/pcl-corporate-cricket-electronic-media-coverage/" style="color:#d6ad45;text-decoration:none;">Electronic Media</a>
          &nbsp;|&nbsp;
          <a href="https://www.procorporateleague.com/pcl/media/pcl-eleven11-sony-liv-highlight/" style="color:#d6ad45;text-decoration:none;">PCL on Sony LIV</a>
          &nbsp;|&nbsp;
          <a href="https://www.procorporateleague.com/ai/pcl-ai-sports-tech-platform/" style="color:#d6ad45;text-decoration:none;">PCL AI Sports Tech</a>
          &nbsp;|&nbsp;
          <a href="https://www.procorporateleague.com/ai/corporate-cricket-rankings-india" style="color:#d6ad45;text-decoration:none;">Corporate Cricket Rankings</a>
        </div>
      </td>
    </tr>

    <tr>
      <td style="padding:14px 24px 18px 24px;text-align:center;border-top:1px solid #e7ebf3;">
        <div style="font-size:12px;line-height:1.9;color:#071d46;">
          <a href="https://www.procorporateleague.com/ai/corporate-cricket-team-ai-analysis/pcl-ai-corporate-team-profile.php?team_id=2009&amp;team_name=AXA%20XL" style="color:#071d46;text-decoration:none;font-weight:700;">View Team Dashboard</a>
          &nbsp;|&nbsp;
          <a href="https://www.procorporateleague.com/pcl/team-register/" style="color:#071d46;text-decoration:none;font-weight:700;">Reserve Category</a>
          &nbsp;|&nbsp;
          <a href="https://corporateworldcup.com/" style="color:#071d46;text-decoration:none;font-weight:700;">corporateworldcup.com</a>
          <br>
          <a href="mailto:pcl@procorporateleague.com" style="color:#071d46;text-decoration:none;">pcl@procorporateleague.com</a>
          <br>
          <span style="color:#5d6880;">© 2026 Pro Corporate League. This communication is an official Corporate World Cup™ invitation for AXA XL.</span>
        </div>
      </td>
    </tr>
  </table>
</td>
</tr></table>

</td>
</tr>
</table></body></html>
CWC_EMAIL_LAYOUT;

$firstLineEnd = strpos($layout, "\n");
if ($firstLineEnd === false)
  throw new RuntimeException('Email layout header is incomplete');
$escape = static function ($value): string {
  return htmlspecialchars(trim((string) $value), ENT_QUOTES, 'UTF-8');
};
$number = static function ($value): string {
  return is_numeric($value) ? number_format((float) $value, 0) : '—';
};
$hasProfile = !empty($profile);
$rank = $hasProfile && is_numeric($profile['team_rank'] ?? null) ? '#' . $number($profile['team_rank']) : '—';
$points = $hasProfile && is_numeric($profile['team_overall_ai'] ?? null) ? number_format((float) $profile['team_overall_ai'], 2) : '—';
$matches = $number($profile['matches_played'] ?? null);
$runs = $number($profile['total_runs_scored'] ?? null);
$wickets = $number($profile['total_wickets_taken'] ?? null);
$introTitle = "{$safeTeam} Has Been Shortlisted";
$introKicker = 'OUT OF 500+ CORPORATE TEAMS EVALUATED';
$introText = "<strong>{$safeTeam}</strong> has been shortlisted to begin the journey towards the Corporate World Cup™ Qualification Round in <strong>{$safeCity}</strong>, representing the <strong>{$safeSector}</strong> sector. See the launch and the people behind the journey below.";
$header = <<<HTML
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=860"><meta name="x-apple-disable-message-reformatting"><title>{$safeTeam} Has Been Shortlisted | Corporate World Cup™</title></head>
<body style="margin:0;padding:0;background:#edf1f7;font-family:Arial,Helvetica,sans-serif;color:#17233c;-webkit-text-size-adjust:none;text-size-adjust:none;">
<table role="presentation" width="860" cellpadding="0" cellspacing="0" border="0" align="center" style="width:860px;min-width:860px;max-width:860px;background:#edf1f7;"><tr><td align="center" style="padding:14px 8px;">
<table role="presentation" width="840" cellpadding="0" cellspacing="0" border="0" style="width:840px;min-width:840px;background:#071d46;border-radius:20px;overflow:hidden;border:1px solid #d8dfeb;">
<tr><td style="background:#041432;padding:20px 30px;border-bottom:1px solid #b98b31;"><table role="presentation" width="100%"><tr>
<td width="78" align="center" valign="middle"><div style="background:#fff;border-radius:12px;padding:9px;width:54px;height:54px;text-align:center;"><img src="{$teamLogoUrl}" width="54" align="center" alt="{$safeTeam} logo" style="max-width:54px;max-height:54px;"></div></td>
<td valign="middle"><div style="font-size:11px;letter-spacing:2px;font-weight:700;color:#d9ad45;">PRO CORPORATE LEAGUE • 15 YEARS OF LEGACY</div><div style="font-size:11px;letter-spacing:2px;font-weight:700;color:#d9ad45;margin-top:4px;">THE WORLD’S FIRST</div><div style="font-family:Georgia,serif;font-size:25px;line-height:30px;font-weight:700;color:#fff3ce;margin-top:2px;">CORPORATE CRICKET WORLD CUP</div><div style="font-size:13px;color:#d9ad45;margin-top:4px;font-weight:700;">TEAM INVITATION 2026</div></td>
</tr></table></td></tr>
<tr><td align="center" style="padding:18px 30px 4px;"><div style="font-size:11px;letter-spacing:1.5px;font-weight:700;color:#d9ad45;">{$introKicker}</div><div style="font-family:Georgia,serif;font-size:27px;line-height:34px;font-weight:700;color:#fff;margin-top:5px;">{$introTitle}</div></td></tr>
<tr><td align="center" style="padding:6px 38px 16px;text-align:center;color:#eadfc8;"><div style="font-family:Arial,Helvetica,sans-serif;font-size:14px!important;line-height:22px!important;font-weight:400;color:#eadfc8;-webkit-text-size-adjust:100%;text-size-adjust:100%;">{$introText}</div></td></tr>
HTML;
$header .= '<tr><td style="padding:8px 30px 22px;"><table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="background:#fff;border:2px solid #1838a8;border-radius:18px;color:#07184b;">';
$header .= '<tr><td style="padding:20px 24px 12px;"><table role="presentation" width="100%"><tr><td style="font-size:20px;font-weight:800;color:#1838a8;">' . $rank . '</td><td align="right" style="font-size:20px;font-weight:800;color:#1838a8;">' . $points . ' AI pts</td></tr></table></td></tr>';
$header .= '<tr><td align="center" style="padding:12px 20px 20px;"><table role="presentation" width="112" height="112" cellpadding="0" cellspacing="0" border="0" style="width:112px;height:112px;border:3px solid #c8cee4;border-radius:56px;background:#f8f9fd;"><tr><td align="center" valign="middle"><img src="' . $escape($teamLogoUrl) . '" alt="' . $safeTeam . ' logo" width="82" style="display:block;max-width:82px;max-height:82px;width:auto;height:auto;margin:0 auto;"></td></tr></table><div style="font-size:25px;font-weight:800;color:#050b1f;margin-top:16px;">' . $safeTeam . '</div><div style="font-size:12px;font-weight:700;color:#6b7392;margin-top:5px;letter-spacing:.5px;">PCL CORPORATE TEAM</div></td></tr>';
$header .= '<tr><td style="padding:8px 20px 20px;"><table role="presentation" width="100%" cellspacing="8"><tr>';
foreach ([['Matches', $matches], ['Runs', $runs], ['Wickets', $wickets]] as $stat) {
  $header .= '<td align="center" width="33%" style="background:#f3f4f8;border-radius:12px;padding:16px 5px;"><strong style="font-size:23px;color:#1531a0;">' . $stat[1] . '</strong><br><span style="font-size:13px;color:#6b7392;">' . $stat[0] . '</span></td>';
}
$header .= '</tr></table></td></tr>';
$topPlayers = array_values(array_filter($profileRows, static function ($row) {
  return is_array($row) && !empty($row['player_name']) && is_numeric($row['overall_ai_score'] ?? null);
}));
usort($topPlayers, static fn($a, $b) => (float) $b['overall_ai_score'] <=> (float) $a['overall_ai_score']);
$topPlayers = array_slice($topPlayers, 0, 5);
if ($topPlayers) {
  $header .= '<tr><td style="border-top:1px solid #e2e5ef;padding:20px 16px 24px;text-align:center;"><div style="font-size:13px;letter-spacing:1.5px;font-weight:800;color:#1838a8;margin-bottom:16px;">AI TEAM SCORES</div><table role="presentation" width="100%"><tr>';
  foreach ($topPlayers as $player) {
    $name = $escape($player['player_name']);
    $nameWords = preg_split('/\s+/u', trim((string) $player['player_name']));
    $initial = $escape(strtoupper(substr((string) $nameWords[0], 0, 1) . substr((string) end($nameWords), 0, 1)));
    $playerRank = $number($player['team_player_rank'] ?? null);
    $isBowler = stripos((string) ($player['player_role'] ?? ''), 'bowl') !== false;
    $metric = $number($isBowler ? ($player['total_wickets'] ?? null) : ($player['total_runs'] ?? null));
    $metricLabel = $isBowler ? 'Wkts' : 'Runs';
    $header .= '<td align="center" valign="top" width="20%" style="padding:3px;"><div style="width:54px;height:54px;line-height:54px;border-radius:50%;background:#e9edfa;border:2px solid #d9ad45;color:#1838a8;font-size:20px;font-weight:800;margin:0 auto 7px;">' . $initial . '</div><div style="font-size:11px;font-weight:800;color:#0b1f78;">#' . $playerRank . '</div><div style="font-size:10px;font-weight:700;color:#111;line-height:1.35;">' . $name . '</div><div style="font-size:10px;font-weight:700;color:#9a6a00;">' . $metric . ' ' . $metricLabel . '</div></td>';
  }
  $header .= '</tr></table></td></tr>';
}
$header .= '</table></td></tr>';
$layout = $header . "\n" . substr($layout, $firstLineEnd + 1);
$layout = str_replace(' AXA XL Has<br>Won Matches.', ' Teams Can<br>Win Matches.', $layout);
$layout = str_replace(' AXA XL Has<br>Built Teams.', ' Teams Can<br>Build Culture.', $layout);
$layout = str_replace(' AXA XL Has<br>Created Memories.', ' Teams Can<br>Create Memories.', $layout);
$layout = str_replace('As one of the handpicked 8 teams, AXA XL will be part of the Founding 8™ and compete for the honor every corporate team will aspire to win.', 'Subject to city and sector availability, AXA XL can explore a place among the Founding 8™ and the journey towards the Corporate World Cup™.', $layout);
$layout = str_replace('You Are One Of Them.', 'Explore Your Place.', $layout);
$layout = str_replace('Only 2 teams from Gurugram will qualify for the National Finals ecosystem.', 'The top 2 qualifying city teams progress to the National Finals ecosystem.', $layout);

// Keep the email desktop-like on phones while giving text more horizontal room.
// Tighter section gutters shorten the long email without removing any content.
$layout = str_replace(
  ['min-width:780px;', 'width="760"', 'width:760px;min-width:760px;', 'padding:22px 10px;', 'padding:12px 28px;', 'padding:14px 28px 10px 28px;', 'padding:14px 28px 18px 28px;'],
  ['min-width:860px;', 'width="840"', 'width:840px;min-width:840px;', 'padding:14px 8px;', 'padding:8px 24px;', 'padding:9px 24px 6px 24px;', 'padding:9px 24px 12px 24px;'],
  $layout
);

// Replace the preview's local paths with absolute URLs in sent email HTML.
$layout = str_replace('src="assets/', 'src="' . htmlspecialchars($imageBase, ENT_QUOTES, 'UTF-8'), $layout);
$layout = str_replace('team_id=2009&amp;team_name=AXA%20XL', 'team_id=' . rawurlencode($teamId) . '&amp;team_name=' . rawurlencode($teamName), $layout);
$layout = str_replace('team/2009.png', 'team/' . rawurlencode($teamId) . '.png', $layout);
$layout = str_replace('Insurance', $safeSector, $layout);
$layout = str_replace('AXA XL', $safeTeam, $layout);
echo $layout;
