﻿/* ---- CSS VARIABLES ---- */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@100;300;400;500;600;700;800&display=swap');


:root {
  --bg: url('../Webpic/Training/background.png');
  --surface: #ffffff;
  --surface2: #e4f1f5;
  --border: #b8d9e2;
  --accent: #1da4c9;
  --accent2: #008eb5;
  --warn: #dd7226;
  --gold: #9a7000;
  --red: #b83252;
  --text: #0d2d38;
  --muted: #4d8999;
  --green: #27ae60;
  --white: #ffffff;
  --logout: rgb(255 110 110);
  --admin: rgb(255, 161, 60);
  --dev : #a78bfa;
  /* ── Game UI shared palette ── */
  --primary: #008eb5;       /* dark teal — gradient start (panel headers, main buttons) */
  --primary2: #1da4c9;      /* teal — gradient end */
  --accent-light: #1a8aad;  /* lighter accent — small button gradient end */
  --win: #27ae60;           /* win / TP green */
  --fire: #e67e22;          /* streak / fire orange */
  --chart-bg: #131722;      /* TradingView chart dark background */
  --buy: #157fa5;           /* buy button gradient start */
  --buy2: #10bfa7;          /* buy button gradient end */
}

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

/* ---- INLINE ICON IMAGES ---- */
img[src*="Webpic/icon/"] {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* ---- BASE ---- */
body {
  background: url('../../Webpic/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,160,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,160,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ---- GLOW ORBS ---- */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.orb-1 { width: 400px; height: 400px; background: rgba(0,229,160,0.06); top: -100px; left: -100px; }
.orb-2 { width: 300px; height: 300px; background: rgba(0,180,216,0.06); bottom: 100px; right: -50px; }

/* ---- CONTAINER ---- */
.container {
  position: relative;
  z-index: 1;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0px 40px 0px 40px;
}
@media (max-width: 768px) {
  .container { padding: 0px 20px 0px 20px; }
}

/* ---- AUTH CONTAINER (Login / Register / Forgot Password) ---- */
.container-auth {
  position: relative;
  z-index: 1;
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 40px 40px 40px 40px;
}

/* ---- NAVBAR ---- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  margin: 0 -40px;
  background: linear-gradient(269deg, #1da4c9 0%, #008eb5 45%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 32px rgba(0,0,0,0.28);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 24px;
}

.navbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(119, 220, 232, 0.22);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  font-family: 'Sarabun', sans-serif;
}
.nav-link:hover {
  color: #fff;
}
.nav-link.active {
  color: #ffffff;
}

.logo {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.logo span { 
  color: var(--white);
  font-size: 22px;
}

.header-stats {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ---- NAVBAR RIGHT SIDE ---- */
.navbar-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- HAMBURGER BUTTON (hidden on desktop) ---- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.18); }
.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- SIDE DRAWER OVERLAY ---- */
.nav-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.nav-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ---- SIDE DRAWER PANEL ---- */
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 85vw);
  z-index: 999;
  background: #0080a2;
  box-shadow: 4px 0 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-drawer.open { transform: translateX(0); }

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary);
  padding: 7px 15px;
  border-bottom: 1px solid rgba(119, 220, 232, 0.15);
  flex-shrink: 0;
}
.nav-drawer-close {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  color: rgba(255,255,255,0.8);
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.nav-drawer-close:hover { background: rgba(255,255,255,0.2); color: #fff; }

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  padding: 5px 5px;
  gap: 4px;
  flex: 1;
}
.nav-drawer-link {
  display: block;
  padding: 12px 16px;
  border-radius: 5px;
  color: var(--white);
  text-decoration: none;
  font-weight: 300;
  font-family: 'Sarabun', sans-serif;
  transition: background 0.18s, color 0.18s;
}
.nav-drawer-link:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.nav-drawer-link.active {
  background: rgba(119, 220, 232, 0.14);
  color: var(--white);
  font-weight: 700;
  border-left: 3px solid var(--primary2);
  padding-left: 13px;
}

.nav-drawer-footer {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.nav-drawer-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  background: var(--primary2);
  border-radius: 10px;
  margin-bottom: 4px;
}
.nav-drawer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(119,220,232,0.35);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.nav-drawer-uname { font-size: 14px; font-weight: 700; color: #FFFFFF; }
.nav-drawer-role  { font-size: 11px; color: #FFFFFF; margin-top: 2px; }

.nav-drawer-actions { display: flex; flex-direction: column; gap: 4px; }
.nav-drawer-action-link {
  display: block;
  padding: 14px 12px;
  border-radius: 8px;
  color: rgb(255, 255, 255);
  background: #27ae60;
  text-decoration: none;
  font-family: 'Sarabun', sans-serif;
  transition: background 0.18s, color 0.18s;
}
.nav-drawer-action-link:hover  { background: rgba(255,255,255,0.1); color: #fff; }

/* ---- ADMIN Mobile ---- */
.nav-drawer-action-link.admin  { 
  color: var(--white); 
  font-weight: 700;
  background: var(--admin); 
}

/* ---- DEV Mobile ---- */
.nav-drawer-action-link.dev{
  background: var(--dev);
  color: var(--white);
}

.nav-drawer-action-link.dev:hover {
  background: var(--dev);
  color: var(--white);
}

/* ---- Logout Mobile ---- */
.nav-drawer-action-link.logout { 
  color: var(--white);
  font-weight: 700;
  background: var(--logout);
}
.nav-drawer-action-link.logout:hover { 
  color: var(--white);
  font-weight: 700;
  background: var(--logout);
}

.nav-drawer-extra { padding: 4px 0; }

/* ---- USER HEADER AREA ---- */
.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.user-menu {
  position: relative;
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0);
  padding: 5px 12px;
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.user-pill:hover {
  color: rgb(255, 255, 255);
}
.user-pill:hover .user-name,
.user-pill:hover .user-pill-chevron {
  color: rgb(255, 255, 255);
  transition: color 0.2s, background 0.2s;
}
.user-pill:focus-visible {
  outline: 2px solid rgba(255,255,255,0.45);
  outline-offset: 2px;
}
.user-pill-toggle {
  cursor: pointer;
}
.user-pill-toggle.open {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.34);
}
.user-pill-toggle .user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-pill-chevron {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  transition: transform 0.18s ease;
}
.user-pill-toggle.open .user-pill-chevron {
  transform: rotate(180deg);
}
.user-pill .user-icon { font-size: 15px; }
.user-pill .user-name { color: rgba(255, 255, 255, 0.9);; }
.user-avatar-mini {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(119,220,232,0.4);
}
.user-avatar-initials {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), #2e8fa8);
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: -0.02em;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  width: min(320px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #eefbff 45%);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 80;
}
.user-menu.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--primary);
  margin-bottom: 12px;
}
.user-avatar-large {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.18);
  flex-shrink: 0;
}
.user-avatar-large.user-avatar-initials {
  font-size: 15px;
}
.user-dropdown-name {
  color: #008eb5;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}
.user-dropdown-role-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.user-dropdown-meta {
  display: grid;
  gap: 10px;
}
.user-dropdown-row {
  display: grid;
  gap: 3px;
}
.user-dropdown-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
}
.user-dropdown-value {
  font-size: 13px;
  color: var(--primary);
  word-break: break-word;
}
.user-dropdown-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.user-dropdown-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}
.user-dropdown-link:hover {
  background: rgb(51, 181, 217);
  transform: translateY(-1px);
}
.user-dropdown-link.logout {
  background: rgb(255 110 110);
}
.user-dropdown-link.logout:hover {
  background: rgb(255, 145, 145);
}
.btn-admin-edit {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgb(255, 161, 60);
  border: 1px solid rgba(255,160,60,0.35);
  border-radius: 5px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn-admin-edit:hover {
  background: rgb(255, 171, 80);
  border-color: rgb(255, 161, 60);
  transform: translateY(-1px);
}
.logout-btn {
  display: flex;
  align-items: center;
  border-radius: 20px;
  padding: 5px 16px;
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  color: #ffffff;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.logout-btn:hover {
  background: rgba(184,50,82,0.28);
  border-color: rgba(184,50,82,0.55);
}
.login-btn {
  display: flex;
  border: #000000 10px;
  align-items: center;
  border-radius: 16px;
  padding: 5px 18px;
  font-family: 'Sarabun', sans-serif;
  background: #ffffffcc;
  font-size: 13px;
  font-weight: 600;
  color: #0d2d38;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  align-items: center;
  justify-content: center;
}
.login-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(119,220,232,0.08);
  border: 1px solid rgba(119,220,232,0.2);
  border-radius: 20px;
  padding: 5px 14px;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  transition: background 0.2s, border-color 0.2s;
}
.stat-pill:hover {
  background: rgba(119,220,232,0.14);
  border-color: rgba(119,220,232,0.35);
}
.stat-pill .label { color: rgba(255,255,255,0.5); }
.stat-pill .value { color: #77dce8; font-weight: 700; }
.streak-fire { font-size: 14px; }

/* ══════════════════════════════════════════════════
   InvestEd HERO SECTION
══════════════════════════════════════════════════ */
.ie-hero {
  position: relative;
  background: linear-gradient(180deg, #eaf3ff 0%, #f4f9ff 55%, #ffffff 100%);
  margin: 0 -40px;              /* bleed to full width inside .container padding */
  overflow: visible;
}
.ie-hero-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 45% 55%;
  align-items: center;
  gap: 32px;
}

/* ── LEFT ── */
.ie-hero-content { min-width: 0; }
.ie-eyebrow {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #2e8fa8;
  margin: 0 0 10px;
}
.ie-headline {
  margin: 0 0 15px;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 800;
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.ie-headline-dark { display: block; color: #12233f; }
.ie-headline-grad {
  display: block;
  background: linear-gradient(90deg, #3cafcd 0%, #63bfdf 60%, #17acd3 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.ie-subtitle {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.65;
  color: #5b7089;
  margin: 0 0 30px;
  font-weight: 500;
}

/* ── CTA ── */
.ie-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 32px;
}
.ie-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 28px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  border: 1px solid transparent;
}
.ie-btn-primary {
  background: linear-gradient(90deg, #3cafcd 0%, #63bfdf 60%, #17acd3 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgb(37 171 235 / 32%);
}
.ie-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgb(37 171 235 / 42%); }
.ie-btn-secondary {
  background: #ffffff;
  color: #12233f;
  border-color: #cddcf3;
  box-shadow: 0 4px 14px rgba(16,49,99,0.06);
}
.ie-btn-secondary:hover { transform: translateY(-2px); background: #f2f7ff; border-color: #9dbdf0; }
.ie-play { color: #2563eb; font-size: 12px; }

/* ── SOCIAL PROOF ── */
.ie-social-proof {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ie-avatars { display: flex; }
.ie-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 3px solid #fff;
  margin-left: -12px;
  background: linear-gradient(135deg, var(--a), var(--b));
  box-shadow: 0 2px 6px rgba(16,49,99,0.15);
  overflow: hidden;
}
.ie-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ie-avatar:first-child { margin-left: 0; }
.ie-social-text { display: flex; flex-direction: column; line-height: 1.35; }
.ie-social-text strong { font-size: 15px; color: #12233f; font-weight: 800; }
.ie-social-text span { font-size: 13px; color: #6b7f97; }

/* ── RIGHT VISUAL ── */
.ie-hero-visual {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 100%, #dcecff 0%, transparent 70%);
}
.ie-hero-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom center;
  object-position: 72% center;
  transform: scale(1);
  transform-origin: center;
  display: block;
  z-index: 1;
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}

/* ── DECORATIVE TEXT ── */
.ie-deco {
  position: absolute;
  z-index: 2;
  font-family: 'Bebas Neue', 'Sarabun', cursive;
  color: #7aa0d0;
  font-size: 15px;
  line-height: 1.3;
  opacity: 0.75;
  pointer-events: none;
  transform: rotate(-6deg);
}
.ie-deco-1 { top: 14px; left: 8px; }
.ie-deco-2 { top: 40px; right: 6px; text-align: right; transform: rotate(5deg); }
.ie-deco-3 { bottom: 28px; left: 14px; transform: rotate(-3deg); letter-spacing: 0.06em; }

/* ── STATS BAR ── */
.ie-stats {
  position: relative;
  z-index: 5;
  max-width: 1180px;
  margin: 44px auto -52px;      /* overlap the bottom edge of the hero */
  padding: 8px 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #ffffff;
  border: 1px solid #e6eef8;
  border-radius: 26px;
  box-shadow: 0 20px 50px rgba(16,49,99,0.12);
}
.ie-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 26px;
  min-height: 96px;
}
.ie-stat + .ie-stat { border-left: 1px solid #eef3fb; }
.ie-stat-icon {
  flex-shrink: 0;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 60px;
  background: #eaf2ff;
  color: #59bbda;
}
.ie-stat-icon svg { width: 24px; height: 24px; }
.ie-stat-body { display: flex; flex-direction: column; line-height: 1.25; }
.ie-stat-num { font-size: 24px; font-weight: 800; color: #12233f; font-family: 'Sarabun', sans-serif; }
.ie-stat-label { font-size: 13px; color: #6b7f97; }

/* ── RESPONSIVE: Tablet ── */
@media (max-width: 1024px) {
  .ie-hero-inner { padding: 0 40px; gap: 24px; }
  .ie-headline { font-size: 50px; }
  .ie-stats {
    grid-template-columns: 1fr 1fr;
    max-width: 720px;
  }
  .ie-stat:nth-child(3) { border-left: none; }     /* new row start */
  .ie-stat:nth-child(odd) { border-left: none; }
  .ie-stat:nth-child(even) { border-left: 1px solid #eef3fb; }
  .ie-stat:nth-child(1), .ie-stat:nth-child(2) { border-bottom: 1px solid #eef3fb; }
}

/* ── RESPONSIVE: Mobile ── */
@media (max-width: 768px) {
  .ie-hero { padding-top: 36px; }
  .ie-hero-inner {
    grid-template-columns: 1fr;
    padding: 0 20px;
    gap: 28px;
  }
  .ie-hero-content { order: 1; text-align: center; }
  .ie-hero-visual  { order: 2; min-height: 260px; }
  .ie-headline { font-size: 40px; }
  .ie-subtitle { font-size: 16px; }
  .ie-cta-row { flex-direction: column; }
  .ie-btn { width: 100%; justify-content: center; }
  .ie-social-proof { justify-content: center; }
  .ie-eyebrow { letter-spacing: 0.12em; }
  .ie-stats { margin-bottom: -40px; }
}
@media (max-width: 420px) {
  .ie-headline { font-size: 34px; }
  .ie-stat { padding: 16px 14px; gap: 10px; min-height: 78px; }
  .ie-stat-num { font-size: 19px; }
  .ie-stat-label { font-size: 11px; }
  .ie-stat-icon { width: 38px; height: 38px; }
}

/* ---- HERO (main.php) ---- */
.hero {
  text-align: left;
  font-family: inherit;
  position: relative;
  padding: 48px 0 0;
  overflow: hidden;
  min-height: 360px;
}
.hero-ghost {
  position: absolute;
  top: -24px; right: -32px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 300px; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(16,112,148,0.09);
  letter-spacing: 0.04em;
  pointer-events: none; user-select: none;
  white-space: nowrap;
  z-index: 0;
}
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(16,112,148,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,112,148,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--bg, #d1e8f2));
  pointer-events: none; z-index: 1;
}

/* ---- Candle Rain ---- */
#rainWrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.rain-candle {
  position: absolute;
  top: -80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: candleFall linear infinite;
  will-change: transform, opacity;
}
@keyframes candleFall {
  0%   { transform: translateY(0);                opacity: 0; }
  8%   { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(calc(100vh + 120px)); opacity: 0; }
}
.rc-wick {
  width: 2px;
  border-radius: 2px;
}
.rc-body {
  width: 10px;
  border-radius: 2px;
}
.hero-inner {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 0 120px;
}
.hero-left {
  min-width: 0;
  position: relative;
  padding: 40px 44px;
  border-radius: 18px;
  overflow: hidden;
}
.hero-left::before {
  content: '';
  position: absolute; inset: 0;
  background: url('../../Webpic/homepage.png') center/cover no-repeat;
  opacity: 0.22;
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}
.hero-left > * { position: relative; z-index: 1; }
.hero-eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.eyebrow-line { width: 28px; height: 0.8px; background: var(--muted); }
.eyebrow-text {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(16,112,148,0.1);
  border: 1px solid rgba(16,112,148,0.2);
  border-radius: 20px;
  padding: 3px 10px;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
}
.badge-pulse {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.3; transform:scale(0.8); }
}
.hero-h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18vh;
  line-height: 1;
  letter-spacing: 0.03em;
}
.h1-line1 { display: block; color: #3186a3; text-shadow: -6px 4px 2px #2a6e854d;
  animation: heroLineIn 0.7s 0.05s cubic-bezier(0.22,1,0.36,1) both;font-weight: 700;font-size: 15vh; }
.h1-line2 {
  font-weight: 700;
  display: block;
  color: #226278;
  text-shadow: -6px 4px 2px #2a6e854d;
  animation: heroLineIn 0.7s 0.2s cubic-bezier(0.22,1,0.36,1) both;
}
.h1-line3 { display: block; color: #3186a3; text-shadow: -6px 4px 2px #2a6e854d;
  animation: heroLineIn 0.7s 0.35s cubic-bezier(0.22,1,0.36,1) both;font-weight: 700;font-size: 15vh; }
.hero-sub {
    font-size: 15px;
    color: #0f5465;
    line-height: 1.75;
    max-width: 380px;
    margin-bottom: 20px;
    font-weight: 700;
}
.hpill {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 4px;
  border: 1px solid;
  transition: all .18s;
  cursor: default;
}
.hp-blue  { color:var(--accent); border-color:rgba(16,112,148,0.28); background:rgba(16,112,148,0.07); }
.hp-grey  { color:var(--muted);  border-color:rgba(77,137,153,0.22); background:rgba(77,137,153,0.05); }
.hpill:hover { transform: translateY(-1px); }
.hp-blue:hover { background:rgba(16,112,148,0.13); border-color:rgba(16,112,148,0.45); }
.hp-grey:hover { background:rgba(77,137,153,0.1);  border-color:rgba(77,137,153,0.35); }
.hero-card {
  width: 100%;
  max-width: 720px;
  background: rgb(255, 255, 255);
  border: 1px solid rgba(184,217,226,0.9);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  box-shadow: 0 -6px 28px rgba(16,112,148,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
  margin: 0 auto;
  padding: 20px 18px 22px;
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: '';
  position: absolute; top:0; left:0; right:0; height:3px;
  background: linear-gradient(90deg, var(--accent), #2e8fa8);
  border-radius: 14px 14px 0 0;
}
.card-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-user-avatar {
  width: 45px; height: 45px; flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #2e8fa8);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  font-size: 20px; color: #fff;
  letter-spacing: 0.05em;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 2px solid rgba(119,220,232,0.25);
}
.card-user-avatar:hover {
  box-shadow: 0 0 0 3px rgba(16,112,148,0.35);
  transform: scale(1.06);
}

/* ---- HERO CARD CONTENT ---- */
.card-user-info { flex: 1; min-width: 0; }
.card-user-name {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 25px; font-weight: 700;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-user-badge {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
  margin-top: 2px;
}
.card-user-status {
  display: flex; align-items: center; gap: 5px;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px; color: var(--muted);
  white-space: nowrap;
}
.card-user-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #27ae60;
  box-shadow: 0 0 5px rgba(39,174,96,0.6);
  animation: pulse 2s ease-in-out infinite;
}
.card-title {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px; font-weight: 1000;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.card-title::before { content: ''; width:12px; height:1.5px; background: #2e8fa8; }
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}
.stat-box {
  background: rgba(16,112,148,0.06);
  border: 1px solid rgba(16,112,148,0.14);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.stat-box-label {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted);
}
.stat-box-val {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 24px; font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 4px;
}
.stat-box-sub {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.val-streak { color: var(--accent); }
.val-wr     { color: #27ae60; }
.val-rounds { color: var(--accent); }
.val-rank   { color: var(--gold); }
.card-divider { height: 1px; background: var(--border); margin-bottom: 14px; }
.card-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 9px;
}
.card-row:last-child { margin-bottom: 0; }
.card-row-label { font-size: 14px; color: var(--muted); }
.card-row-val {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px; font-weight: 600;
  color: var(--text);
}
.card-row-val.up   { color: var(--accent); }
.card-row-val.warn { color: #e67e22; }
.card-spark { margin-top: 14px; height: 36px; position: relative; }
.card-spark svg { width:100%; height:100%; }
.card-continue {
  display: block;
  margin: 12px 0 0;
  padding: 9px 0;
  text-align: center;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none;
  transition: background .18s, transform .18s;
}
.card-continue:hover { background: #0d8ab0; transform: translateY(-1px); }


.progress-bar-wrapper {
  margin-top: 20px;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.progress-bar {
  width: 100%;
  height: 50px;
  background: var(--surface2);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.progress-fill {
  height: 100%;
  background: repeating-linear-gradient(
    -55deg,
    #0e7b8e 0px,
    #0e7b8e 10px,
    #178ea3 10px,
    #178ea3 19px
  );
  background-size: 200% 100%;
  width: 0%;
  transition: width 0.7s ease;
  animation: stripe-move 0.6s linear infinite;
  position: relative;
  overflow: hidden;
}

.progress-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1), transparent);
  animation: water-flow 2s linear infinite;
  pointer-events: none;
}

@keyframes stripe-move {
  from { background-position: 0 0; }
  to   { background-position: 22px 0; }
}

.progress-text {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

/* ---- AVATAR MODAL ---- */
.avatar-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 92%; max-width: 400px;
  overflow: hidden;
  box-shadow: 0 28px 72px rgba(0,0,0,0.28), 0 0 0 1px rgba(119,220,232,0.12);
  transform: translateY(40px) scale(0.95);
  transition: transform 0.38s cubic-bezier(0.34,1.56,0.64,1), opacity 0.25s;
  opacity: 0;
  position: relative;
}
.modal-overlay.show .avatar-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.avatar-modal .modal-close-btn {
  position: absolute; top: 12px; right: 14px;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 50%; font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
  z-index: 2;
}
.avatar-modal .modal-close-btn:hover { background: rgba(255,255,255,0.32); }

.avatar-modal-header {
  background: linear-gradient(135deg, #0d4f6b 0%, #1a6582 50%, #1e7a9e 100%);
  border-bottom: 1px solid rgba(119, 220, 232, 0.15);
  box-shadow: 0 4px 24px rgba(0,0,0,0.22);
  padding: 36px 24px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 15px;
}

.avatar-modal-preview {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.25), rgba(255,255,255,0.08));
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
  border: 3px solid rgba(255,255,255,0.55);
  font-size: 36px; font-weight: 700;
  color: #fff;
  font-family: 'Sarabun', sans-serif;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  cursor: default;
}
.avatar-modal-preview > img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}

.avatar-modal-camera {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 30px; height: 30px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: transform 0.2s, background 0.2s;
  z-index: 2;
  pointer-events: auto;
}
.avatar-modal-camera:hover { transform: scale(1.15); background: #e8f6fb; }

.avatar-modal-name {
  font-family: 'Sarabun', sans-serif;
  font-size: 17px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
  margin-top: 4px;
}
.avatar-modal-role {
  font-size: 12px; color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px; padding: 2px 10px;
}

.avatar-modal-body {
  padding: 20px 20px 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.avatar-modal-body .upload-drop-area { margin: 0; }

.avatar-upload-status {
  font-size: 13px; color: var(--muted);
  min-height: 16px; text-align: center;
  background: linear-gradient(45deg, #e6ffe6e0, #d1facc91);
  border: 1px solid rgba(6,214,160,0.35);
  border-radius: 8px; padding: 10px 10px;
}

.avatar-modal-close-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 20px;
  font-size: 14px; color: var(--text);
  cursor: pointer; transition: background 0.2s;
  font-family: 'Sarabun', sans-serif;
}
.avatar-modal-close-btn:hover { background: #d0eaf2; }

.btn-danger-sm {
  background: rgb(228 42 42 / 80%);
  border: 1px solid rgba(220, 50, 50, 0.28);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Sarabun', sans-serif;
}
.btn-danger-sm:hover { background: rgba(220,50,50,0.2); }

/* ---- SECTION TITLE ---- */
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: #FFFFFF;
  text-transform: uppercase;
  margin-top: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 3px;
  background: var(--border);
}

/* ---- MODE CARDS ---- */
.mode-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  margin: 0 auto;
  max-width: 90%;
}

/* ---- Backtest mode card ---- */
.mode-card {
  position: relative;
  display: block;
  padding: 0;
  border: none;
  border-radius: 16px;
  background: #06203f;
  cursor: pointer;
  outline-offset: 8px;
  text-decoration: none;
  color: inherit;
}
.mode-card-rim {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 36px 32px 32px;
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(135deg, #0a1e2e 0%, #0d2a3e 45%, #071929 100%);
  box-shadow:
    0 12px 0 rgb(0, 55, 70),
    0 20px 26px rgba(0,0,0,0.55);
  transition: transform 110ms ease, box-shadow 110ms ease, filter 150ms ease;
}

/* speed lines â€” always visible */
.mode-card-rim::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    110deg,
    transparent 0px, transparent 22px,
    rgba(0,212,232,0.04) 22px,
    rgba(0,212,232,0.04) 23px
  );
  pointer-events: none;
  z-index: 0;
}

/* shimmer sweep on hover */
.mode-card-rim::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 55%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.07), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
  z-index: 0;
}

.mode-card:hover .mode-card-rim {
  transform: translateY(-3px);
  filter: brightness(1.1);
  box-shadow:
    0 15px 0 rgb(0, 55, 70),
    0 24px 32px rgba(0,0,0,0.6),
    0 0 30px 6px rgba(57,212,255,0.55);
}
.mode-card:hover .mode-card-rim::after { left: 140%; }
.mode-card:active .mode-card-rim {
  transform: translateY(10px);
  filter: brightness(0.92);
  box-shadow:
    0 2px 0 rgb(0, 55, 70),
    0 4px 10px rgba(0,0,0,0.5),
    0 0 18px 3px rgba(57,212,255,0.5);
}
.mode-card:focus-visible .mode-card-rim {
  outline: 3px solid #35d4ff;
}

/* image-only card (Day Trade) */
.mode-card-rim.mode-card-rim-img {
  padding: 0;
  min-height: 280px;
  background: #0b1d4d;
}
.mode-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* flag â€” left teal bar */
.mode-card-flag {
  position: absolute;
  left: 0; top: 15%; height: 70%;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: #00d4e8;
  box-shadow: 0 0 12px #00d4e8;
  z-index: 2;
  transition: box-shadow 0.25s;
}
.mode-card:hover .mode-card-flag { box-shadow: 0 0 20px #00d4e8; }

/* icon */
.mode-card-icon {
  font-size: 36px;
  line-height: 1;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}
.mode-card:hover .mode-card-icon { transform: scale(1.15) translateY(-2px); }

/* label */
.mode-card-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 2;
}
.mode-card-main {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 65px;
  letter-spacing: 0.1em;
  line-height: 1;
  color: #fff;
  transition: letter-spacing 0.3s ease;
}
.mode-card:hover .mode-card-main { letter-spacing: 0.18em; }
.mode-card-sub {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00d4e8;
  opacity: 0.7;
}

/* desc */
.mode-card-desc {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.65;
  position: relative;
  z-index: 2;
  max-width: 500px;
}

/* chevrons */
.mode-card-chevrons {
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;
  z-index: 2;
}

/* accent â€” bottom teal line */
.mode-card-accent {
  position: absolute;
  bottom: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00d4e8, transparent);
  opacity: 0.5;
  transition: opacity 0.25s, left 0.3s, right 0.3s;
  z-index: 2;
}
.mode-card:hover .mode-card-accent {
  opacity: 1;
  left: 5%;
  right: 5%;
}

/* chevron colors + hover (reuse .chev) */
.mode-card-chevrons .chev {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  line-height: 1;
  color: rgba(255,255,255,0.2);
  transition: transform 0.25s ease, color 0.25s ease;
}
.mode-card-chevrons .chev:nth-child(2) { color: rgba(255,255,255,0.4); transition-delay: 0.04s; }
.mode-card-chevrons .chev:nth-child(3) { color: rgba(255,255,255,0.65); transition-delay: 0.08s; }
.mode-card:hover .mode-card-chevrons .chev              { color: rgba(0,212,232,0.45); transform: translateX(2px); }
.mode-card:hover .mode-card-chevrons .chev:nth-child(2) { color: rgba(0,212,232,0.7);  transform: translateX(4px); }
.mode-card:hover .mode-card-chevrons .chev:nth-child(3) { color: #00d4e8;              transform: translateX(6px); }

/* ---- LEADERBOARD PANEL ---- */
.lb-panel-grid-override { grid-column: 1 / -1; }
.lb-panel-soon {
  opacity: 0.7;
}

/* ── Coming-soon card ── */
.mode-card-soon {
  background: linear-gradient(135deg, #111827 0%, #1a2233 60%, #0e1520 100%);
  border-color: rgba(148,163,184,0.15);
  cursor: default;
  pointer-events: none;
}
.mode-card-soon::before {
  background: repeating-linear-gradient(
    110deg,
    transparent 0px, transparent 22px,
    rgba(148,163,184,0.03) 22px,
    rgba(148,163,184,0.03) 23px
  );
}
.mode-card-soon:hover {
  border-color: rgba(148,163,184,0.15);
  box-shadow: none;
  transform: none;
}
.mode-card-flag-soon {
  background: #64748b;
  box-shadow: 0 0 10px #64748b;
}
.mode-card-soon-badge {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(100,116,139,0.18);
  border: 1px solid rgba(100,116,139,0.35);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.06em;
  z-index: 3;
}
.mode-card-main-soon {
  color: #475569;
}
.mode-card-sub-soon {
  color: #64748b;
  opacity: 1;
}
.mode-card-desc-soon {
  color: rgba(148,163,184,0.4);
}
.mode-card-accent-soon {
  background: linear-gradient(90deg, transparent, #475569, transparent);
  opacity: 0.3;
}

.lb-panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 4px 20px rgba(16,112,148,0.08);
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: default;
}
.lb-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(16,112,148,0.2);
}
.lb-panel-header > span:first-child {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.lb-panel-sub {
  font-size: 10px;
  color: var(--muted);
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lb-panel-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.lb-panel-row {
  display: grid;
  grid-template-columns: 28px 1fr 50px 50px 60px;
  align-items: center;
  gap: 6px;
  padding: 7px 6px;
  border-radius: 6px;
  font-size: 13px;
  transition: background 0.15s;
}
.lb-panel-row:hover:not(.lb-panel-head) {
  background: rgba(16,112,148,0.07);
}

.lb-panel-head {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding-bottom: 6px;
  border-radius: 0;
}
.lb-panel-head:hover { background: transparent; }
.lb-panel-head span:nth-child(1) { text-align: center; }
.lb-panel-head span:nth-child(n+3) { text-align: right; }
.lb-sort-col {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.lb-sort-col:hover { color: var(--accent); }
.lb-sort-col.lb-sort-active {
  color: var(--accent);
  font-weight: 700;
  position: relative;
}
.lb-sort-col.lb-sort-active::after {
  content: ' ▼';
  font-size: 8px;
  opacity: 0.7;
}

.lb-panel-row .rank {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  text-align: center;
  color: var(--muted);
}
.lb-panel-row .lb-name {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 7px;
}
.lb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 1px rgba(16,112,148,0.18);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lb-avatar-init {
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.lb-panel-row .lb-winrate {
  text-align: right;
  color: var(--accent);
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.lb-panel-row .lb-streak {
  text-align: right;
  color: var(--warn);
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.lb-panel-row .lb-pnl {
  text-align: right;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.lb-panel-row .lb-pnl.green { color: #16a34a; }
.lb-panel-row .lb-pnl.red   { color: #dc2626; }

/* Top 3 rank colors */
.lb-panel-row .rank.rank-1 { color: #b8860b; font-size: 18px; }
.lb-panel-row .rank.rank-2 { color: #808080; font-size: 18px; }
.lb-panel-row .rank.rank-3 { color: #a0522d; font-size: 17px; }

/* Logged-in user highlight */
.lb-panel-row.lb-me-row {
  background: rgba(16,112,148,0.10);
  border: 1px solid rgba(16,112,148,0.25);
  border-radius: 6px;
}
.lb-panel-row.lb-me-row:hover { background: rgba(16,112,148,0.15); }
.lb-panel-row.lb-me-row .lb-name { color: var(--accent); font-weight: 700; }

.lb-panel-loading {
  color: var(--muted);
  font-style: italic;
  font-size: 12px;
  padding: 20px 0;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   LEADERBOARD MODAL — shared (backtest + main)
═══════════════════════════════════════════════════════ */

.lb-modal {
  width: 80vh;
  padding: 0;
  overflow: hidden;
  gap: 0;
  height: 80vh;
}

/* ── GRADIENT HEADER ── */
.lb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 20px;
  background: linear-gradient(135deg, #0d4f6b 0%, #1a6582 50%, #1e7a9e 100%);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.lb-modal-title-wrap { display: flex; align-items: center; gap: 14px; }
.lb-modal-trophy { font-size: 36px; line-height: 1; filter: drop-shadow(0 0 8px rgba(255,200,0,0.5)); }
.lb-modal-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px; letter-spacing: 0.12em; color: #fff; line-height: 1;
}
.lb-modal-subtitle {
  font-size: 11px; color: rgba(255,255,255,0.55);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: 0.12em; margin-top: 3px;
}
.lb-modal-header .hist-close-btn {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
}
.lb-modal-header .hist-close-btn:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* ── STATS BAR ── */
.lb-stats-bar {
  display: flex; gap: 16px; padding: 8px 22px 6px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  font-family: 'Sarabun', sans-serif; font-size: 12px;
  color: var(--muted); min-height: 30px; align-items: center;
}
.lb-stat-item b { color: var(--muted); }
.lb-stat-item + .lb-stat-item::before { content: '·'; margin-right: 16px; }
.lb-stat-rank { color: var(--accent) !important; }
.lb-stat-badge {
  margin-left: auto;
  background: rgba(200,160,0,0.15); border: 1px solid rgba(200,160,0,0.35);
  border-radius: 20px; padding: 2px 10px;
  font-size: 11px; font-weight: 700; color: #c8a800;
}

/* ── TABLE AREA ── */
.lb-modal .hist-table-wrap { max-height: 100%; border-radius: 0; border: none; }

/* ── RANK CELLS ── */
.lb-rank-cell { text-align: center; }
.lb-medal { font-size: 20px; line-height: 1; display: inline-block; }
.lb-rank-num { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; color: var(--muted); }

/* ── TOP-3 ROW HIGHLIGHTING ── */
.lb-table tbody tr.lb-rank-gold   { background: linear-gradient(90deg, rgba(200,160,0,0.12), transparent); }
.lb-table tbody tr.lb-rank-silver { background: linear-gradient(90deg, rgba(160,160,160,0.10), transparent); }
.lb-table tbody tr.lb-rank-bronze { background: linear-gradient(90deg, rgba(160,82,45,0.10), transparent); }
.lb-table tbody tr.lb-rank-gold   td { border-bottom-color: rgba(200,160,0,0.15); }
.lb-table tbody tr.lb-rank-silver td { border-bottom-color: rgba(160,160,160,0.12); }
.lb-table tbody tr.lb-rank-bronze td { border-bottom-color: rgba(160,82,45,0.12); }

/* ── USER'S OWN ROW ── */
.lb-table tbody tr.lb-me {
  background: rgba(16,112,148,0.12);
  outline: 1px solid rgba(16,112,148,0.3); outline-offset: -1px;
}
.lb-table tbody tr.lb-me td { color: var(--accent); }
.lb-table tbody tr.lb-me.lb-rank-gold { background: linear-gradient(90deg, rgba(200,160,0,0.18), rgba(16,112,148,0.10)); }

/* ── DISCONNECTED PLAYER ROW ── */
.lb-table tbody tr.lb-offline { background: rgba(120,120,120,0.08) !important; }
.lb-table tbody tr.lb-offline td { color: var(--muted) !important; opacity: 0.65; }
.lb-offline-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px 2px;
  background: rgba(120,120,120,0.25); color: var(--muted); border-radius: 20px;
  font-size: 10px; font-weight: 700; vertical-align: middle;
}

/* ── NAME CELL ── */
.lb-name-cell { font-size: 13px; color: var(--text); overflow: hidden; }
.lb-name-wrap { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.lb-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lb-name-cell b { color: var(--accent); }
/* override 28px mini-panel avatar → 26px no-border inside full modal */
.lb-modal .lb-avatar      { width: 26px; height: 26px; border: none; box-shadow: none;}
.lb-modal .lb-avatar-init { width: 26px; height: 26px; border-radius: 50%; }

/* ── PNL CELL ── */
.lb-pnl-cell { text-align: right; padding-right: 14px !important; }
.lb-pnl-main { display: block; font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;; font-size: 13px; font-weight: 700; }
.lb-pnl-main.green { color: #27ae60; }
.lb-pnl-main.red   { color: #b83252; }
.lb-pnl-sub        { display: block; font-size: 9.5px; color: var(--muted); margin-top: 1px; }

/* ── YOU BADGE ── */
.lb-you-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px 3px;
  background: var(--accent); color: #fff;
  border-radius: 20px; font-size: 9.5px; font-weight: 700; vertical-align: middle;
}

/* ── LB SPINNER ── */
@keyframes spin { to { transform: rotate(360deg); } }
.lb-loading { vertical-align: middle; }
.lb-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
  margin-right: 8px; vertical-align: middle;
}

.mode-icon-wrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  position: relative;
  z-index: 3;
}
.mode-card[data-mode="backtest"] .mode-icon-wrap { background: rgba(0,229,160,0.1);   border-color: rgba(0,229,160,0.2); }
.mode-card[data-mode="compete"]  .mode-icon-wrap { background: rgba(255,209,102,0.1); border-color: rgba(255,209,102,0.2); }

.mode-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 50px;
  letter-spacing: 0.06em;
  color: #ffffff;
  margin-bottom: 6px;
  position: relative;
  z-index: 3;
  width: 100%;
  text-align: center;
}
.mode-name-th {
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 12px;
  font-weight: 700;
  position: relative;
  z-index: 3;
  width: 100%;
  text-align: center;
}
.mode-desc {
  font-size: 13px;
  color: #ffffff;
  line-height: 1.6;
  position: relative;
  z-index: 3;
  width: 100%;
  text-align: center;
}

.mode-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #ffffff;
}
.feat-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--mode-color);
}

/* ---- WIN STREAK BADGE ---- */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255,209,102,0.15), rgba(255,107,53,0.1));
  border: 1px solid rgba(255,209,102,0.3);
  color: var(--gold);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  margin-top: 16px;
}

/* ---- START BUTTON ---- */
.start-section {
  text-align: center;
  margin-bottom: 20px;
}

.btn-start {
  position: relative;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 18px 56px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.btn-start::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-start:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,229,160,0.4); }
.btn-start:hover::before { opacity: 1; }
.btn-start:active { transform: scale(0.98); }
.btn-start:disabled { background: var(--surface2); color: var(--muted); cursor: not-allowed; box-shadow: none; transform: none; }

.btn-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

/* ---- LEADERBOARD ---- */
.leaderboard-section {
  margin-bottom: 64px;
}

.lb-table {
  background: var(--surface);
  overflow: hidden;
}

.lb-row {
  display: grid;
  grid-template-columns: 48px 1fr auto auto auto;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  gap: 12px;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255,255,255,0.02); }
.lb-row.header {
  background: var(--surface2);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.rank {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 19px;
  text-align: center;
}
.rank-1 { color: var(--gold); }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

.lb-name { font-size: 14px; font-weight: 500; }
.lb-level {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.lb-level.basic        { background: rgba(6,214,160,0.15);  color: var(--green); }
.lb-level.intermediate { background: rgb(255, 255, 255);  color: var(--accent2); }
.lb-level.advance      { background: rgba(255,107,53,0.15); color: var(--warn); }

.lb-streak {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--gold);
  font-weight: 700;
  text-align: right;
}
.lb-winrate {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--green);
  text-align: right;
}
.lb-rounds {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--muted);
  text-align: right;
}

/* Highlight logged-in user */
.lb-me-row {
  background: rgba(16,112,148,0.10);
  border-left: 3px solid var(--accent);
}
.lb-me-row .lb-name { color: var(--accent); }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(25 54 73 / 74%);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

/* ---- LESSON MODAL (new design) ---- */
.lesson-modal-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 90%;
  max-width: 520px;
  overflow: hidden;
  transform: translateY(30px) scale(0.97);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 32px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,229,160,0.08);
}
.modal-overlay.show .lesson-modal-box {
  transform: translateY(0) scale(1);
}

.lm-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 28px 24px 28px;
  background: linear-gradient(135deg, rgb(87 215 255 / 27%) 0%, rgba(0, 229, 160, 0.03) 100%);
  border-bottom: 1px solid var(--border);
}
.lm-icon-wrap {
  font-size: 48px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0,229,160,0.3));
}
.lm-header-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lm-badge {
  display: inline-block;
  background: rgba(0,229,160,0.12);
  border: 1px solid rgba(0,229,160,0.3);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  font-weight: 600;
  width: fit-content;
}
.lm-title {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
  line-height: 1;
  align-items: center;
}
.lm-subtitle {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.lm-body {
  padding: 24px 28px;
}
.lm-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.lm-intro {
  font-size: 14px;
  color: var(--text);
  line-height: 1.75;
  background: var(--bg);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 20px 0;
}
.lm-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lm-point-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  transition: border-color 0.2s;
}
.lm-point-item:hover {
  border-color: rgba(0,229,160,0.35);
}
.lm-point-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.lm-footer {
  padding: 0 28px 28px 28px;
}
.lm-btn-start {
  width: 100%;
  font-weight: 500;
  background: linear-gradient(145deg, rgba(16, 113, 148, 0.9) 0%, rgba(2, 77, 117, 0.7) 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 20px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(0,229,160,0.25);
}
.lm-btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,229,160,0.4);
}

/* ---- QUIZ MODAL (original) ---- */
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 90%;
  max-width: 90%;
  height: 90%;
  max-height: 90%;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.show .modal { transform: translateY(0); }

.modal-title {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1.28px;
  margin-bottom: 8px;
  color: var(--accent);
}
.modal-sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

.modal-chart {
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  height: 200px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  gap: 4px;
  overflow: hidden;
  position: relative;
}

.chart-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  transition: opacity 0.2s;
  min-width: 0;
}
.chart-bar:hover { opacity: 0.8; }

.modal-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}
.info-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.info-box .ib-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  letter-spacing: 1.28px;
  text-transform: uppercase;
}
.info-box .ib-val {
  font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17.6px;
  font-weight: 700;
}
.ib-val.green { color: var(--green); }
.ib-val.red   { color: var(--red); }
.ib-val.gold  { color: var(--gold); }

.modal-actions { display: flex; gap: 12px; }

.btn-modal-primary {
  flex: 1;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 19px;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-modal-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,229,160,0.3); }

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 6px;
}
.modal-close-btn:hover {
  background: var(--surface2);
  color: var(--accent);
}

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroLineIn {
  from { opacity: 0; transform: translateX(-48px) skewX(-6deg); }
  to   { opacity: 1; transform: translateX(0)     skewX(0deg); }
}
.hero            { animation: fadeUp 0.6s ease both; }
.mode-grid       { animation: fadeUp 0.6s 0.2s ease both; }

/* ---- SCROLL REVEAL ---- */
.scroll-fade-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.scroll-fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.why-aqt-features .why-aqt-feature:nth-child(2) { transition-delay: 0.1s; }
.why-aqt-features .why-aqt-feature:nth-child(3) { transition-delay: 0.2s; }
.why-aqt-features .why-aqt-feature:nth-child(4) { transition-delay: 0.3s; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 0 24px;
    gap: 24px;
  }
  .hero-h1 { font-size: 15vh; }
  .h1-line1 { font-size: 12vh; }
  .h1-line3 { font-size: 12vh; }
  .hero-ghost { display: none; }
  .hero-card { max-width: 100%; }
  .mode-grid       { grid-template-columns: 1fr; }
  .header-stats    { display: none; }

  /* show hamburger, hide desktop nav links */
  .nav-hamburger   { display: flex; }
  .navbar-divider,
  .navbar-links    { display: none; }

  /* hide username text + admin btn from header (both live in drawer) */
  .header-user .user-name,
  .header-user .user-pill-chevron,
  .header-user .btn-admin-edit { display: none; }
  .user-pill { padding: 4px 6px; }
  .header-user {
    width: auto;
    justify-content: flex-end;
  }
  .user-dropdown {
    right: 0;
    width: min(320px, calc(100vw - 24px));
  }
  .hero-inner { padding: 0 16px; }
  .hero-h1    { font-size: 18vw; }
  .h1-line1 { font-size: 15vw; }
  .h1-line3 { font-size: 15vw; }

  .mode-card-rim      { padding: 24px 20px 20px; gap: 10px; }
  .mode-card-main     { font-size: 44px; }
  .mode-card-sub      { font-size: 13px; }
  .mode-card-icon     { font-size: 28px; }
}

/* hide user menu and guest login button on mobile (user info + links live in the drawer) */
@media (max-width: 768px) {
  .header-user .user-menu,
  .header-user .login-btn { display: none; }
}



@media (orientation: landscape) and (max-height: 300px) {
  /* ซ่อน header ยกเว้น main และ lesson (backtest ฯลฯ) — ไม่แสดง main/lesson */
  header:not([data-nav="main"]):not([data-nav="lesson"]) { display: none; }

  header[data-nav="main"],
  header[data-nav="lesson"] {
    height: 44px;
    padding: 0 16px;
    margin: 0 -40px;
  }

  /* ซ่อนบางส่วนของ nav links (override max-width query) */
  header[data-nav="main"] .navbar-links,
  header[data-nav="lesson"] .navbar-links   { display: flex !important; }

  /* แสดง divider */
  header[data-nav="main"] .navbar-divider,
  header[data-nav="lesson"] .navbar-divider { display: block !important; }

  /* ซ่อน hamburger และ nav links */
  header[data-nav="main"] .nav-hamburger,
  header[data-nav="lesson"] .nav-hamburger  { display: none !important; }

  /* ซ่อน username/chevron/admin-btn */
  header[data-nav="main"] .user-name,
  header[data-nav="lesson"] .user-name,
  header[data-nav="main"] .user-pill-chevron,
  header[data-nav="lesson"] .user-pill-chevron,
  header[data-nav="main"] .btn-admin-edit,
  header[data-nav="lesson"] .btn-admin-edit { display: none !important; }

  /* ปรับขนาด logo */
  header[data-nav="main"] .logo img,
  header[data-nav="lesson"] .logo img       { height: 30px; }
  header[data-nav="main"] .logo,
  header[data-nav="lesson"] .logo           { font-size: 15px; }

  .mode-grid          { grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
  .mode-card-rim      { padding: 16px 14px; gap: 6px; }
  .mode-card-main     { font-size: 32px; }
  .mode-card-icon     { font-size: 22px; }
  .mode-card-desc     { display: none; }
}

/* ═══════════════════════════════════════════════════════
   MOVED FROM main.php <style> — takes precedence over
   duplicate selectors defined earlier in this file
═══════════════════════════════════════════════════════ */

/* =========================================================
  GLOBAL
  ========================================================= */

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}


/* =========================================================
  LEADERBOARD BUTTON
  ========================================================= */

.lb-expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border: 1px solid rgba(16,112,148,.25);
  border-radius: 6px;
  background: rgba(16,112,148,.07);
  color: var(--accent);
  font-size: 14px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
}

.lb-expand-btn:hover {
  background: rgba(16,112,148,.16);
  border-color: var(--accent);
}


/* =========================================================
  MODAL
  ========================================================= */

@keyframes popIn {
  from { transform: scale(.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hist-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hist-modal-overlay.show {
  display: flex;
}

.hist-modal {
  display: flex;
  flex-direction: column;
  width: 720px;
  max-width: 95vw;
  max-height: 85vh;
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  animation: popIn .3s cubic-bezier(.34,1.56,.64,1);
}

.hist-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Sarabun', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.hist-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: all .2s;
}

.hist-close-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}


/* =========================================================
  HISTORY TABLE
  ========================================================= */

.hist-table-wrap {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 15px;
}

.hist-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
}

.hist-table thead tr {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(135deg,#1a6582,#2e8fa8);
  color: #fff;
}

.hist-table th {
  padding: 9px 12px;
  text-align: left;
  vertical-align: middle;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

.hist-table th:not(:first-child) {
  text-align: center;
}

.hist-table td {
  padding: 9px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
}

.hist-table td.center { text-align: center; }
.hist-table td.green  { color: #27ae60; font-weight: 700; }
.hist-table td.red    { color: #b83252; font-weight: 700; }
.hist-table td.fire   { color: #e67e22; font-weight: 700; }

.hist-table tbody tr:hover {
  background: rgba(16,112,148,.06);
}

.hist-table tbody tr:last-child td {
  border-bottom: 0;
}

.hist-empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

.lb-name-text {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  text-overflow: clip;
}


/* =========================================================
  HERO
  ========================================================= */

.ie-hero {
  position: relative;
  width: 100vw;
  min-height: 720px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: #f5f9ff;
  overflow: hidden;
}


/*
  สำคัญ:
  ต้องไม่ใส่ position:relative ที่นี่

  เพื่อให้ .ie-hero-visual ที่เป็น absolute
  อิงกับ .ie-hero แทน
*/

.ie-hero-inner {
  position: static;
  width: min(1400px, calc(100% - 80px));
  min-height: 580px;
  margin: 0 0 0 100px;
}


/* =========================================================
  HERO LEFT
  ========================================================= */

.ie-hero-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 580px;
  box-sizing: border-box;
}


/* =========================================================
  HERO RIGHT — FULL HEIGHT / EDGE TO EDGE
  ========================================================= */

.ie-hero-visual {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 62vw;
  overflow: hidden;
}

.ie-hero-img {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  display: block;
}


/* Fade image เข้าหาพื้นหลังฝั่งข้อความ */

.ie-hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;

  background: linear-gradient(
    90deg,
    #f5f9ff 0%,
    rgba(245,249,255,.95) 2%,
    rgba(245,249,255,.72) 7%,
    rgba(245,249,255,.35) 14%,
    rgba(245,249,255,0) 25%
  );
}

.ie-deco {
  position: absolute;
  z-index: 3;
}


/* =========================================================
  STATS
  ========================================================= */

.ie-stats {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  width: min(1180px, calc(100% - 80px));
  min-height: 105px;
  margin: -35px auto 45px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(30,80,150,.10);
  border-radius: 26px;
  box-shadow: 0 18px 45px rgba(20,55,100,.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ie-stat {
  min-width: 0;
}


/* =========================================================
  TABLET
  ========================================================= */

@media (max-width: 1100px) {

  .ie-hero {
    min-height: 620px;
  }

  .ie-hero-inner {
    width: calc(100% - 50px);
    min-height: 550px;
  }

  .ie-hero-content {
    width: 44%;
    padding: 65px 20px 70px 0;
  }

  .ie-hero-visual {
    width: 57vw;
  }

  .ie-hero-img {
    object-position: 58% center;
    transform: scale(1.02);
  }

  .ie-stats {
    width: calc(100% - 50px);
  }
}


/* =========================================================
  MOBILE
  ========================================================= */

@media (max-width: 767px) {

  .ie-hero {
    min-height: 0;
    padding-top: 0;
  }

  .ie-hero-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    margin: 0;
  }

  .ie-hero-content {
    width: 100%;
    max-width: none;
    padding: 50px 20px 30px;
  }

  /* รูปเป็นพื้นหลังด้านหลัง .ie-hero-content */
  .ie-hero-visual {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: auto;
  }

  .ie-hero-img {
    object-position: 60% center;
    transform: none;
    opacity: 0.1;
  }

  .ie-hero-visual::after {
    display: none;
  }

  .ie-stats {
    width: calc(100% - 32px);
    margin: -10px auto 30px;
    grid-template-columns: repeat(2,minmax(0,1fr));
    border-radius: 20px;
  }
}


/* =========================================================
  MOBILE MODAL
  ========================================================= */

@media (max-width: 640px) {

  .hist-modal {
    width: 92vw;
    max-width: 92vw;
  }

  .lb-modal {
    width: calc(100% - 32px);
    max-width: calc(100% - 32px);
    height: 90dvh;
    margin: 16px;
    padding: 0;
    gap: 0;
    border-radius: 20px;
  }

  .lb-modal-header {
    padding: 14px 14px 12px;
  }

  .lb-modal-title {
    font-size: 18px;
  }

  .lb-modal-trophy {
    font-size: 24px;
  }

  .hist-table-wrap {
    max-height: calc(90dvh - 140px);
    overflow-x: auto;
    overflow-y: auto;
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .hist-table {
    width: 100%;
    font-size: 11.5px;
  }

  .hist-table th {
    padding: 8px;
    font-size: 10.5px;
  }

  .hist-table td {
    padding: 8px;
    font-size: 11px;
  }
}


/* =========================================================
  MOBILE LANDSCAPE
  ========================================================= */

@media (max-height: 500px) and (orientation: landscape) {

  .hist-modal {
    width: 96vw;
    max-width: 96vw;
    max-height: 92vh;
  }

  .lb-modal {
    width: calc(100% - 24px);
    max-width: calc(100% - 24px);
    height: 92dvh;
    margin: 12px;
    border-radius: 14px;
  }

  .hist-table-wrap {
    max-height: calc(92dvh - 120px);
    overflow-x: hidden;
  }

  .hist-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .lb-modal-header {
    padding: 10px 14px 8px;
  }
}

/* ══════════════════════════════════════════════════
   WHY AI QUANTTECH SECTION
══════════════════════════════════════════════════ */
.why-aqt {
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, #fefefe 100%);
  margin: 0px -40px 0;
  padding: 40px;
  overflow: hidden;
}
.why-aqt-inner {
  max-width: 90%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
}

/* ── LEFT ── */
.why-aqt-content { min-width: 0; }
.why-aqt-eyebrow {
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.why-aqt-title {
  font-family: 'Sarabun', sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.3;
}
.why-aqt-desc {
  font-family: 'Sarabun', sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 480px;
  font-weight: 500;
}

.why-aqt-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.why-aqt-feature {
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}

.why-aqt-feature-icon {
  flex-shrink: 0;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 60px;
  background: #eaf2ff;
  color: #59bbda;
}
.why-aqt-feature-icon svg { width: 24px; height: 24px; }
.why-aqt-feature-body {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  gap: 8px;
}
.why-aqt-feature-text {
  font-family: 'Sarabun', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #12233f;
}

.why-aqt-feature-text-sub {
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #6b7f97;
}


/* ── RIGHT ── */
.why-aqt-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}
.why-aqt-img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 20px 40px rgba(16,112,148,0.18));
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .why-aqt-inner { gap: 36px; }
  .why-aqt-title { font-size: 30px; }
  .why-aqt-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .why-aqt { padding: 40px 20px; }
  .why-aqt-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .why-aqt-visual { order: -1; }
  .why-aqt-desc { margin-left: auto; margin-right: auto; }
  .why-aqt-features { grid-template-columns: 1fr; text-align: left; }
  .why-aqt-title { font-size: 26px; }
  .why-aqt-img { max-width: 320px; }
}

/* ── SITE FOOTER ── */
.site-footer {
  text-align: center;
  padding: 8px 8px;
  background: #1da4c9;
}
.site-footer-copy {
  margin: 0 0 5px;
  font-size: 13px;
  color: #ffffff;
}
.site-footer-links {
  margin: 0;
  font-size: 13px;
  color: #e2e2e2;
}
.site-footer-links a {
  color: #e2e2e2;
  text-decoration: none;
}
.site-footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════
   HOW IT WORKS SECTION
══════════════════════════════════════════════════ */
.how-it-works {
  position: relative;
  background: linear-gradient(0deg, #f4fafd 0%, #f3f9fd 100%);
  margin: 0 -40px 0;
  padding: 40px;
}

.how-inner {
  max-width: 90%;
  margin: 0 auto;
  margin-bottom: 30px;
}

.how-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}
.how-eyebrow {
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.how-title {
  font-family: 'Sarabun', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

/* ── STEPS ROW ── */
.how-steps {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.how-step {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  background: #ffffff;
  border-radius: 22px;
  padding: 36px 22px 28px;
  box-shadow: 0 14px 34px rgba(16,49,99,0.08);
}

.how-step-badge {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #107094, #6bacb4);
  color: #ffffff;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(16,112,148,0.35);
}

.how-step-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  margin-top: 6px;
}
.how-step-icon svg { width: 26px; height: 26px; }

/* per-step accent colors: blue / purple / green / gold */
.how-step-1 { background: linear-gradient(160deg, #5fa8e76e 0%, #70baf15e 55%); }
.how-step-2 { background: linear-gradient(160deg, #8e5fe76e 0%, #9c70f15e 55%); }
.how-step-3 { background: linear-gradient(160deg, #17a06b6e 0%, #1dbd805e 55%); }
.how-step-4 { background: linear-gradient(160deg, #ffb7046e 0%, #ffbd065e 55%); }

.how-step-1 .how-step-icon { background: #e8f1ff; color: #2f6fed; }
.how-step-2 .how-step-icon { background: #f2ecfd; color: #8250df; }
.how-step-3 .how-step-icon { background: #e6faf1; color: #17a06b; }
.how-step-4 .how-step-icon { background: #fdf3d9; color: #b8860b; }

.how-step-1 .how-step-badge { background: linear-gradient(135deg, #2f6fed, #6ea8ff); box-shadow: 0 6px 16px rgba(47,111,237,0.35); }
.how-step-2 .how-step-badge { background: linear-gradient(135deg, #8250df, #b18aff); box-shadow: 0 6px 16px rgba(130,80,223,0.35); }
.how-step-3 .how-step-badge { background: linear-gradient(135deg, #17a06b, #4fd8a4); box-shadow: 0 6px 16px rgba(23,160,107,0.35); }
.how-step-4 .how-step-badge { background: linear-gradient(135deg, #b8860b, #e8bf4e); box-shadow: 0 6px 16px rgba(184,134,11,0.35); }

.how-step-title {
  font-family: 'Sarabun', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.how-step-desc {
  font-family: 'Sarabun', sans-serif;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}

.how-arrow {
  flex: 0 0 auto;
  align-self: center;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b7c8de;
}
.how-arrow svg { width: 22px; height: 22px; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .how-it-works { margin: 0 -24px 0; padding: 50px 24px 60px; }
  .how-title { font-size: 28px; }
  .how-steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px 20px;
  }
  .how-arrow { display: none; }
}
@media (max-width: 640px) {
  .how-it-works { padding: 40px 20px 50px; }
  .how-header { margin-bottom: 36px; }
  .how-title { font-size: 24px; }
  .how-steps { grid-template-columns: 1fr; gap: 32px; }
}
