/* ========== RESET & BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin:0; padding:0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, 'Noto Sans SC', sans-serif;
  background: #1A2332; color: #FFFFFF; line-height: 1.5;
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0,150,0,0.04) 0px,
      rgba(0,150,0,0.04) 60px,
      transparent 60px,
      transparent 120px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0,130,0,0.03) 0px,
      rgba(0,130,0,0.03) 80px,
      transparent 80px,
      transparent 160px
    ),
    radial-gradient(ellipse at 50% 0%, rgba(0,200,83,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(0,150,0,0.08) 0%, transparent 50%),
    linear-gradient(175deg, #1A2332 0%, #1E3A28 30%, #1A2332 70%, #162020 100%);
}
input, select, button { font-family: inherit; font-size: inherit; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ========== SCREENS ========== */
.screen { display: none; min-height: 100vh; flex-direction: column; }
.screen.active { display: flex; }

/* ========== SPLASH ========== */
#splash {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0,160,0,0.04) 0px,
      rgba(0,160,0,0.04) 50px,
      transparent 50px,
      transparent 100px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0,140,0,0.03) 0px,
      rgba(0,140,0,0.03) 70px,
      transparent 70px,
      transparent 140px
    ),
    radial-gradient(ellipse at 50% 30%, rgba(34,180,34,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 80%, rgba(0,100,0,0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 70% 60%, rgba(0,120,0,0.06) 0%, transparent 40%),
    linear-gradient(175deg, #163B22 0%, #1A4528 20%, #153520 60%, #122A18 100%);
  justify-content: center; align-items: center; padding: 24px 16px;
}
.splash-inner { max-width: 400px; width: 100%; text-align: center; }
.splash-icon { font-size: 64px; margin-bottom: 16px; }
.splash-inner h1 { font-size: 28px; font-weight: 700; color: #FFFFFF; margin-bottom: 4px; }
.splash-sub { color: #90A4AE; font-size: 14px; margin-bottom: 32px; }
.splash-card {
  background: #253A58; border-radius: 12px; padding: 20px; margin-bottom: 16px;
  border-left: 4px solid #00E676; text-align: left;
}
.splash-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 12px;
  background: #152540; border: 1px solid #2A4A6F; border-radius: 8px;
  color: #FFFFFF; font-size: 15px; height: 44px;
}
.splash-card input::placeholder { color: #546E7A; }
.splash-card .btn-primary { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #00E676, #00C853); color: #1A2332;
  border: none; border-radius: 8px; padding: 12px 20px; font-size: 16px;
  font-weight: 700; cursor: pointer; height: 44px; transition: opacity .2s;
}
.btn-primary:active { opacity: 0.8; }
.btn-accent {
  background: #448AFF; color: #FFFFFF; border: none; border-radius: 8px;
  padding: 12px 20px; font-size: 15px; font-weight: 600; cursor: pointer;
  height: 44px; width: 100%; transition: opacity .2s;
}
.btn-accent:active { opacity: 0.8; }
.splash-hint { color: #90A4AE; font-size: 13px; margin-top: 16px; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
}
.badge-free { background: #FF9100; color: #1A2332; }

/* ========== TOP BAR ========== */
#topBar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; background: linear-gradient(90deg, #153020, #1A3828);
  border-bottom: 1px solid #2A4A30;
}
.top-title { font-size: 16px; font-weight: 700; color: #FFFFFF; flex: 1; }
.top-user { font-size: 13px; color: #90A4AE; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#memberBadge { flex-shrink: 0; }

/* ========== CONTENT ========== */
#content { flex: 1; padding: 12px 12px 80px; max-width: 800px; margin: 0 auto; width: 100%; }

/* ========== TAB PAGE ========== */
.tab-page { display: none; }
.tab-page.active { display: block; }

/* ========== CARD ========== */
.card {
  border-radius: 10px; margin-bottom: 12px; overflow: hidden;
  position: relative;
}
.card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.card.accent-green::before { background: #00E676; }
.card.accent-blue::before { background: #448AFF; }
.card.accent-purple::before { background: #BB86FC; }
.card.accent-orange::before { background: #FF9100; }
.card.accent-red::before { background: #FF5252; }
.card.accent-gold::before { background: #FFD740; }

.card-header {
  background: linear-gradient(90deg, #1E3825, #224030); padding: 10px 16px; font-size: 14px; font-weight: 700;
  color: #FFFFFF; border-bottom: 1px solid #1A2510;
}

/* ========== INPUT GRID ========== */
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; color: #90A4AE; font-weight: 600; }
.field input, .field select {
  padding: 8px 10px; background: #152540; border: 1px solid #2A4A6F;
  border-radius: 6px; color: #00E676; font-weight: 700; font-size: 14px;
  height: 44px; width: 100%;
}
.field select { color: #448AFF; }
.field input:focus, .field select:focus { outline: none; border-color: #00E676; }

/* ========== CALC GRID ========== */
.calc-grid, .auto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 12px; }
.calc-item, .auto-item { padding: 8px 12px; }
.calc-item { grid-template-columns: 1fr auto; }
.calc-label { font-size: 11px; color: #90A4AE; }
.calc-val { font-size: 18px; font-weight: 700; color: #00E676; }
.calc-val.highlight { color: #FFD740; }

/* ========== TABLES ========== */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead { background: #243650; position: sticky; top: 0; }
th { padding: 8px 6px; font-size: 11px; color: #90A4AE; font-weight: 600; text-align: center; white-space: nowrap; }
td { padding: 8px 6px; text-align: center; border-bottom: 1px solid #172840; }
tbody tr:nth-child(even) { background: #172840; }
tbody tr.row-best td { background: rgba(0,230,118,0.08); }
.val-green { color: #00E676; font-weight: 700; } /* 亏损/负值 */
.val-red { color: #FF5252; font-weight: 700; } /* 盈利/正值 */
.val-yellow { color: #FFD740; }

/* ========== GOAL INPUTS ========== */
.goal-input-grid { padding: 12px; }
.goal-header-row { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 4px; }
.goal-header { font-size: 12px; color: #90A4AE; font-weight: 600; text-align: center; }
.goal-row { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.goal-row label { font-size: 13px; color: #FF9100; font-weight: 600; text-align: right; padding-right: 8px; }
.goal-row input {
  padding: 8px 10px; background: #152540; border: 1px solid #2A4A6F;
  border-radius: 6px; color: #FF9100; font-weight: 700; font-size: 13px;
  height: 44px;
}

/* ========== FIELD ROW ========== */
.field-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.field-row label { font-size: 12px; color: #90A4AE; white-space: nowrap; }
.field-row input {
  flex: 1; padding: 8px 10px; background: #152540; border: 1px solid #2A4A6F;
  border-radius: 6px; color: #00E676; font-weight: 700; font-size: 14px; height: 44px;
}

/* ========== RULES ========== */
.rules-grid { padding: 12px; display: grid; gap: 6px; }
.rules-list-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.rules-list-item.pass { background: rgba(255,82,82,0.08); color: #FF5252; } /* 通过=红 */
.rules-list-item.fail { background: rgba(0,230,118,0.08); color: #00E676; } /* 失败=绿 */
.rules-list { padding: 12px; }
.rules-list p { font-size: 13px; color: #90A4AE; padding: 4px 0; border-bottom: 1px solid #172840; }
.rules-list p:last-child { border-bottom: none; }
.priority-list { padding: 12px; }
.pri-item { padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pri-best { background: rgba(255,82,82,0.12); color: #FF5252; } /* 最优=红 */
.pri-ok { background: rgba(68,138,255,0.12); color: #448AFF; }
.pri-bad { background: rgba(0,230,118,0.12); color: #00E676; } /* 最差=绿 */

.warning-text { padding: 10px 12px; font-size: 12px; color: #FF5252; background: rgba(255,82,82,0.08); }
.sub-text { padding: 8px 12px; font-size: 12px; color: #90A4AE; }

/* ========== LOCK HINT ========== */
.lock-hint {
  padding: 10px 12px; text-align: center; font-size: 12px;
  color: #FFD740; background: rgba(255,215,64,0.06);
  border-top: 1px solid rgba(255,215,64,0.15);
}
.locked-page {
  position: relative;
}
.locked-page::after {
  content: '🔒 会员功能 - 获取卡密解锁';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13,27,42,0.85);
  display: flex; align-items: center; justify-content: center;
  color: #FFD740; font-size: 18px; font-weight: 700;
  z-index: 50; pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ========== TAB BAR ========== */
#tabBar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  display: flex; justify-content: space-around; align-items: center;
  height: 60px; padding-bottom: env(safe-area-inset-bottom, 0);
  background: linear-gradient(90deg, #153020, #1A3828); border-top: 1px solid #2A4A30;
}
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; background: none; border: none;
  color: #546E7A; cursor: pointer; padding: 4px 2px; transition: color .2s;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn.active { color: #00E676; }
.tab-btn.locked { color: #546E7A; opacity: 0.5; }
.tab-btn.locked .tab-icon::after { content: '🔒'; font-size: 8px; vertical-align: super; margin-left: -4px; }
.tab-icon { font-size: 16px; line-height: 1; }
.tab-label { font-size: 9px; font-weight: 600; }

/* ========== ABOUT / FOOTER ========== */
.about-grid { padding: 12px; display: grid; gap: 12px; }
.about-section { background: #172840; border-radius: 8px; padding: 12px; }
.about-section h3 { font-size: 13px; color: #00E676; margin-bottom: 8px; }
.about-section p { font-size: 12px; color: #90A4AE; padding: 3px 0; }
#appFooter { padding: 20px 12px; text-align: center; }
#appFooter p { font-size: 12px; color: #546E7A; }
.footer-ver { font-size: 11px; color: #333D4A; margin-top: 4px; }

/* ========== RESPONSIVE ========== */
/* iPhone SE (375px) */
@media (min-width: 375px) {
  .input-grid { grid-template-columns: 1fr 1fr; }
}
/* iPhone 15 Pro Max (430px) */
@media (min-width: 430px) {
  #content { padding: 12px 16px 80px; }
}
/* Foldable expanded / phablet (600px) */
@media (min-width: 600px) {
  .input-grid { grid-template-columns: repeat(4, 1fr); }
  .calc-grid, .auto-grid { grid-template-columns: repeat(3, 1fr); }
}
/* iPad / tablet (768px) */
@media (min-width: 768px) {
  #content { max-width: 700px; }
  .table-wrap { overflow-x: visible; }
  table { font-size: 13px; }
  th, td { padding: 10px 8px; }
}
/* Desktop (1024px+) */
@media (min-width: 1024px) {
  #content { max-width: 800px; padding: 20px 20px 80px; }
  .card-header { font-size: 15px; padding: 12px 16px; }
  #tabBar { max-width: 800px; left: 50%; transform: translateX(-50%); border-left: 1px solid #2A4A6F; border-right: 1px solid #2A4A6F; }
}

/* ========== UTILITIES ========== */
.text-green { color: #00E676; }
.text-red { color: #FF5252; }
.text-yellow { color: #FFD740; }
.bg-green { background: #163B22; }
.bg-blue { background: #1A2845; }
.bg-purple { background: #251840; }
.bg-orange { background: #3A2518; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2A4A6F; border-radius: 2px; }

/* ========== MOBILE FIRST ADJUSTMENTS ========== */
@media (max-width: 374px) {
  /* iPhone SE 1st gen */
  .tab-label { font-size: 8px; }
  .tab-icon { font-size: 14px; }
  #tabBar { height: 52px; }
  .card-header { font-size: 13px; padding: 8px 12px; }
  .input-grid { gap: 6px; padding: 10px; }
  .field input, .field select { font-size: 13px; }
  .referral-code-value { font-size: 18px; }
  .splash-invite-banner { font-size: 11px; padding: 8px; }
}

/* Larger phones */
@media (min-width: 375px) and (max-width: 428px) {
  .referral-code-value { font-size: 20px; }
}

/* Full-screen phones (iPhone X+, with notch) */
@media (min-width: 375px) and (min-height: 812px) {
  .splash-inner { padding-top: calc(40px + env(safe-area-inset-top, 0px)); }
  .splash-card input { height: 50px; }
  .referral-code-value { font-size: 22px; }
}

/* Safe area for notch phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #tabBar { padding-bottom: env(safe-area-inset-bottom); }
  #content { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  #topBar {
    padding-top: env(safe-area-inset-top);
    height: calc(56px + env(safe-area-inset-top));
  }
  .splash-inner { padding-top: calc(20px + env(safe-area-inset-top)); }
}

/* Full-screen / notched phone landscape fix */
@supports (padding: env(safe-area-inset-left)) {
  #content {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  #topBar {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  #tabBar {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Dark mode system preference */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; }
}

/* ========== TOP BAR PROFILE BTN ========== */
.top-profile {
  background: none; border: none; font-size: 20px; cursor: pointer;
  padding: 4px 8px; border-radius: 50%; transition: background .2s;
}
.top-profile:active { background: rgba(255,255,255,0.1); }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: flex; justify-content: center; align-items: flex-end;
}
.modal-panel {
  background: #253A58; border-radius: 16px 16px 0 0;
  width: 100%; max-width: 480px; max-height: 85vh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal-panel.modal-lg { max-width: 600px; max-height: 90vh; }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid #2A4A6F;
  font-size: 16px; font-weight: 700;
}
.modal-close {
  background: none; border: none; color: #90A4AE; font-size: 20px;
  cursor: pointer; padding: 4px 8px;
}
.modal-body { padding: 20px; }

/* ========== PROFILE ========== */
.profile-avatar {
  font-size: 48px; text-align: center; margin-bottom: 8px;
}
.profile-name {
  text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 4px;
}
.profile-status {
  text-align: center; font-size: 14px; color: #90A4AE; margin-bottom: 16px;
}
.profile-info {
  text-align: center; font-size: 12px; color: #546E7A; margin-bottom: 20px;
}
.profile-section {
  margin-bottom: 20px; }
.profile-section h4 {
  font-size: 13px; color: #FFD740; margin-bottom: 8px;
  padding-bottom: 4px; border-bottom: 1px solid #2A4A6F;
}
.profile-activate-row {
  display: flex; gap: 8px;
}
.profile-activate-row input {
  flex: 1; padding: 10px 12px; background: #152540;
  border: 1px solid #2A4A6F; border-radius: 8px;
  color: #FF5252; font-weight: 700; font-size: 14px; height: 44px;
}
.profile-activate-row input:focus { outline: none; border-color: #FF5252; }
.btn-sm {
  padding: 10px 16px; background: linear-gradient(135deg, #FF5252, #D32F2F);
  color: #FFF; border: none; border-radius: 8px; font-weight: 700;
  font-size: 14px; cursor: pointer; white-space: nowrap;
}
.profile-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.btn-action {
  padding: 12px 8px; background: #243650; border: 1px solid #2A4A6F;
  border-radius: 8px; color: #FFFFFF; font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: center; transition: background .2s;
}
.btn-action:active { background: #2E4565; }
.btn-action.btn-danger { border-color: #FF5252; color: #FF5252; }

/* ========== ADMIN PANEL ========== */
.admin-section {
  margin-bottom: 20px;
}
.admin-section h4 {
  font-size: 14px; color: #FF5252; margin-bottom: 8px;
}
.admin-stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px;
}
.admin-stat {
  background: #243650; border-radius: 8px; padding: 12px 8px; text-align: center;
}
.admin-stat .stat-val { font-size: 24px; font-weight: 700; color: #FF5252; }
.admin-stat .stat-label { font-size: 11px; color: #90A4AE; }
.admin-code-list {
  background: #152540; border-radius: 8px; padding: 12px;
  font-family: 'Courier New', monospace; font-size: 13px;
  color: #FF5252; line-height: 1.8; word-break: break-all;
  max-height: 200px; overflow-y: auto;
}
.admin-config-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.admin-config-row label {
  font-size: 13px; color: #90A4AE; min-width: 80px;
}
.admin-config-row input {
  flex: 1; padding: 8px 12px; background: #152540;
  border: 1px solid #2A4A6F; border-radius: 6px;
  color: #FFFFFF; font-size: 14px; height: 40px;
}
.admin-config-row input:focus { outline: none; border-color: #FF5252; }
.admin-btn-row {
  display: flex; gap: 8px; margin-top: 8px;
}
.admin-btn {
  padding: 10px 16px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.admin-btn-primary { background: #FF5252; color: #FFF; }
.admin-btn-secondary { background: #2A4A6F; color: #90A4AE; }
.admin-user-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px;
}
.admin-user-table th {
  background: #243650; padding: 8px 6px; text-align: left;
  color: #90A4AE; font-size: 11px;
}
.admin-user-table td {
  padding: 8px 6px; border-bottom: 1px solid #172840;
}

/* ========== LOGIN ========== */
.splash-card input + input {
  margin-top: 0;
}
.splash-card .splash-hint {
  color: #546E7A; font-size: 12px; margin: 4px 0 12px; text-align: left; padding: 0;
}

/* 新用户福利横幅 */
.splash-bonus {
  background: linear-gradient(135deg, #243650, #2E4565);
  border: 1px solid #FF5252;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: center;
}
.bonus-title {
  font-size: 18px; font-weight: 700; color: #FF5252;
  margin-bottom: 6px;
}
.bonus-desc {
  font-size: 13px; color: #FFFFFF; line-height: 1.6;
}
.bonus-desc b { color: #FF5252; font-size: 16px; }
.bonus-steps {
  font-size: 12px; color: #90A4AE; margin-top: 8px;
  line-height: 1.6;
}

/* 邀请横幅（登录页） */
.splash-invite-banner {
  background: linear-gradient(135deg, #FF5252, #FF9100);
  color: #FFF; font-size: 13px; font-weight: 700;
  border-radius: 8px; padding: 10px 14px; margin-top: 10px;
  text-align: center;
  animation: bannerPulse 2s ease-in-out infinite;
}
.splash-invite-banner b { font-size: 16px; }
@keyframes bannerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* 微信联系 */
.splash-contact {
  text-align: center; font-size: 14px; color: #FFD740;
  margin-top: 12px; padding: 10px;
  border-top: 1px solid #2A4A6F;
}
.splash-contact b { color: #FF5252; font-weight: 700; }

/* 超管密码行 */
.admin-pass-row {
  display: flex; width: 100%;
}
.admin-pass-row input {
  width: 100%; padding: 14px 16px; background: #152540;
  border: 1px solid #2A4A6F; border-radius: 10px;
  color: #FF5252; font-weight: 700; font-size: 16px;
  height: 48px; margin-bottom: 12px;
}
.admin-pass-row input:focus { outline: none; border-color: #FF5252; }

/* 邀请码行（登录页） */
.referral-row {
  width: 100%;
}
.referral-row input {
  width: 100%; padding: 12px 16px; background: #152540;
  border: 1px solid #2A4A6F; border-radius: 10px;
  color: #90A4AE; font-size: 14px;
  height: 44px; margin-bottom: 12px;
}
.referral-row input:focus { outline: none; border-color: #FFD740; }
.referral-row input::placeholder { color: #37474F; }

/* 个人中心倒计时 */
.profile-countdown {
  display: flex; align-items: baseline; justify-content: center;
  gap: 4px; margin-bottom: 16px;
}
.countdown-label { font-size: 13px; color: #90A4AE; }
.countdown-days { font-size: 36px; font-weight: 700; color: #FF5252; }
.countdown-unit { font-size: 14px; color: #90A4AE; }

/* 到期提示 */
.profile-expired {
  background: rgba(255,82,82,0.08); border: 1px solid #FF5252;
  border-radius: 10px; padding: 14px; text-align: center;
  margin-bottom: 16px;
}
.profile-expired p { font-size: 14px; color: #FF5252; margin: 4px 0; }
.profile-expired b { color: #FFD740; }

/* 邀请码区域（个人中心-新版） */
.referral-section {
  background: linear-gradient(135deg, rgba(255,82,82,0.08), rgba(255,145,0,0.08));
  border: 1px solid rgba(255,82,82,0.3) !important;
}
.referral-header {
  font-size: 18px; font-weight: 700; color: #FF5252;
  text-align: center; margin-bottom: 8px;
}
.referral-highlight {
  background: rgba(255,82,82,0.12); border-radius: 8px;
  padding: 10px; text-align: center; font-size: 13px;
  color: #FFD740; line-height: 1.6; margin-bottom: 12px;
}
.referral-code-box-big {
  background: #152540; border: 2px solid #FF5252;
  border-radius: 12px; padding: 16px; text-align: center;
  margin-bottom: 12px;
}
.referral-code-label {
  font-size: 11px; color: #90A4AE; text-transform: uppercase;
  letter-spacing: 2px; margin-bottom: 6px;
}
.referral-code-value {
  font-size: 24px; font-weight: 700; color: #FF5252;
  letter-spacing: 2px; margin-bottom: 12px;
  word-break: break-all;
}
.referral-code-actions {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.btn-copy-ref, .btn-share-ref {
  font-size: 13px; padding: 8px 16px; border-radius: 8px;
  border: none; cursor: pointer; font-weight: 600;
}
.btn-copy-ref { background: #FF5252; color: #FFF; }
.btn-share-ref { background: #FF9100; color: #FFF; }
.referral-qr {
  text-align: center; margin: 12px 0;
}
.qr-placeholder {
  width: 160px; height: 160px; margin: 0 auto;
  background: #152540; border: 2px dashed #2A4A6F;
  border-radius: 8px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #546E7A;
}
.qr-placeholder span { font-size: 32px; }
.qr-placeholder small { font-size: 10px; margin-top: 4px; }
.referral-hint { font-size: 12px; color: #546E7A; margin-bottom: 8px; }
.referral-code-box {
  display: flex; align-items: center; gap: 8px;
  background: #152540; border: 1px solid #2A4A6F;
  border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
}
.referral-label { font-size: 12px; color: #90A4AE; white-space: nowrap; }
.referral-code { flex: 1; font-size: 16px; font-weight: 700; color: #FF5252; letter-spacing: 1px; }
.referral-stats {
  font-size: 13px; color: #90A4AE; text-align: center;
}
.referral-stats b { color: #FF5252; }

/* ========== DISCLAIMER & TERMS ========== */
.hero-disclaimer {
  font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 10px;
  background: rgba(0,0,0,0.3); padding: 4px 12px; border-radius: 20px;
}
.footer-disclaimer {
  font-size: 11px; color: #FF9100; margin-top: 8px;
  padding: 8px 0; font-weight: 600;
}
.about-disclaimer {
  font-size: 12px; color: #FF9100; margin-top: 12px;
  padding: 10px; background: rgba(255,145,0,0.08); border-radius: 8px;
  border: 1px solid rgba(255,145,0,0.2); font-weight: 600;
}
.terms-explain {
  padding: 12px; background: rgba(255,215,64,0.04);
  border-top: 1px solid rgba(255,215,64,0.1);
}
.terms-explain p {
  font-size: 12px; color: #B0BEC5; padding: 4px 0; line-height: 1.6;
}
.terms-explain p b { color: #FFD740; }
.rule-explain {
  display: block; font-size: 11px; color: #78909C;
  margin-top: 2px; padding-left: 34px; font-weight: 400;
}

/* ========== FOOTBALL ELEMENTS ========== */
.hero-icon-group {
  font-size: 40px; margin-bottom: 8px;
  letter-spacing: 12px;
  animation: ballBounce 2s ease-in-out infinite;
}
@keyframes ballBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Card background lighter */
.card {
  background: linear-gradient(180deg, #253A58, #1E3048);
}
.card-header {
  background: linear-gradient(90deg, #1E3828, #2A4835) !important;
}

/* Section title football deco */
.home-section-title::after {
  content: ' ⚽'; font-size: 14px;
}

/* ========== HOME PAGE ========== */
.home-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  min-height: 200px;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #1E5530 0%, #43A047 40%, #1E5530 100%);
  z-index: 0;
}
.hero-bg::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(0,230,118,0.25) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(255,82,82,0.12) 0%, transparent 40%);
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background: 
    radial-gradient(circle at 50% 50%, transparent 48px, rgba(255,255,255,0.08) 49px, rgba(255,255,255,0.08) 50px, transparent 51px),
    linear-gradient(90deg, transparent 49.8%, rgba(255,255,255,0.06) 49.8%, rgba(255,255,255,0.06) 50.2%, transparent 50.2%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 40px, transparent 40px, transparent 80px);
}
.hero-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 20px 24px; text-align: center;
}
.hero-icon { font-size: 48px; margin-bottom: 8px; }
.hero-title { font-size: 24px; font-weight: 800; color: #FFF; margin-bottom: 4px; letter-spacing: 1px; }
.hero-sub { font-size: 13px; color: #90A4AE; margin-bottom: 10px; }
.hero-badge {
  display: inline-block; padding: 4px 16px; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, #FF5252, #FF9100); color: #FFF;
}

/* Home sections */
.home-section { margin-bottom: 16px; }
.home-section-title {
  font-size: 15px; font-weight: 700; color: #FFD740;
  padding: 0 4px 8px;
  border-bottom: 1px solid #2A4A6F;
  margin-bottom: 12px;
}

/* Quick grid */
.quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.quick-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px;
  background: #253A58; border-radius: 12px;
  border: 1px solid #2A4A6F;
  cursor: pointer; transition: all .2s;
}
.quick-card:active { transform: scale(0.95); background: #243650; }
.quick-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.quick-label {
  font-size: 11px; font-weight: 600; color: #90A4AE; white-space: nowrap;
}

/* Home calc card */
.home-calc-card {
  background: #253A58; border-radius: 12px; padding: 14px;
  border-left: 4px solid #00E676;
}
.home-calc-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.home-calc-row label {
  font-size: 12px; color: #90A4AE; min-width: 64px; white-space: nowrap;
}
.home-calc-row input, .home-calc-row select {
  flex: 1; padding: 8px 10px; background: #152540; border: 1px solid #2A4A6F;
  border-radius: 6px; color: #00E676; font-weight: 700; font-size: 14px; height: 40px;
}
.home-calc-row select { color: #448AFF; }
.home-calc-row input:focus, .home-calc-row select:focus { outline: none; border-color: #00E676; }

.home-calc-results {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: #152540; border-radius: 8px; padding: 10px;
}
.hcr-item {
  display: flex; flex-direction: column; gap: 2px;
}
.hcr-label { font-size: 10px; color: #546E7A; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.hcr-val { font-size: 16px; font-weight: 700; color: #FFD740; }

/* Home rules */
.home-rules {
  display: flex; flex-direction: column; gap: 6px;
}
.home-rule-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #253A58; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #E0E0E0;
}
.rule-num {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #FF5252, #D32F2F);
  color: #FFF; font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}

/* Home timing card */
.home-timing-card {
  background: #253A58; border-radius: 12px; overflow: hidden;
}
.timing-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid #172840;
}
.timing-row.timing-best {
  background: rgba(255,82,82,0.08);
}
.timing-row.timing-tip {
  justify-content: center; font-size: 12px; color: #546E7A; border-bottom: none;
}
.timing-time {
  font-size: 14px; font-weight: 800; color: #FFD740; min-width: 56px;
}
.timing-label {
  font-size: 12px; font-weight: 600; color: #E0E0E0; flex: 1;
}
.timing-odds {
  font-size: 11px; font-weight: 700; color: #00E676;
}

/* Upgrade card */
.home-upgrade-card {
  background: linear-gradient(135deg, #243650, #2E4565);
  border: 1px solid #FF5252;
  border-radius: 12px; padding: 20px 16px; text-align: center;
}
.upgrade-icon { font-size: 36px; margin-bottom: 8px; }
.upgrade-title { font-size: 18px; font-weight: 700; color: #FF5252; margin-bottom: 6px; }
.upgrade-desc { font-size: 12px; color: #90A4AE; line-height: 1.6; margin-bottom: 14px; }
.upgrade-btn { max-width: 200px; margin: 0 auto; }

/* Hide upgrade card for members */
.home-upgrade-hidden { display: none; }

/* Responsive quick grid for small screens */
@media (max-width: 374px) {
  .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .quick-card { padding: 10px 4px; }
  .quick-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 8px; }
  .quick-label { font-size: 10px; }
  .hero-title { font-size: 20px; }
  .hero-icon { font-size: 40px; }
}
@media (min-width: 600px) {
  .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .quick-card { padding: 18px 12px; }
  .quick-icon { width: 52px; height: 52px; font-size: 24px; border-radius: 14px; }
  .quick-label { font-size: 12px; }
}
