/* ============================================
   PREDIXER DESIGN SYSTEM - Optimized
   ============================================
   Refactored for reduced redundancy and better maintainability.
   See HTML_CHANGES.md for required markup updates.
   ============================================ */

/* === DESIGN TOKENS === */
:root {
  /* Colors */
  --primary: #2E1A47;
  --secondary: #2E7D32;
  --flame: #F59E0B;
  --danger: #DC2626;
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --text-main: #1A1A1A;
  --text-sub: #666666;
  --text-muted: #999999;

  /* Borders - consolidated (removed --border-subtle duplicate) */
  --border-light: #E5E7EB;
  --border: #eeeeee;
  --border-muted: #CCCCCC;

  /* Backgrounds */
  --card-bg: #F9F9F9;
  --disabled: #9CA3AF;

  /* Shadows */
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-modal: 0 10px 40px rgba(0, 0, 0, 0.2);
  --shadow-elevated: 0 4px 12px rgba(46, 26, 71, 0.2);
  --shadow-heavy: 0 10px 40px rgba(0, 0, 0, 0.3);

  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  /* Transitions */
  --transition-fast: 0.2s ease;

  /* Layout */
  --nav-height: 60px;
}

/* === RESET & BASE === */
* { box-sizing: border-box; }

body {
  background-color: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
}

/* === UTILITY CLASSES === */
[x-cloak] { display: none !important; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Flex utilities */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* Spacing */
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* Text colors */
.text-sub { color: var(--text-sub); font-size: 14px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--secondary); }

/* === ANIMATIONS (single definitions) === */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.7; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

@keyframes wallet-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(46, 125, 50, 0.3); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}

@keyframes oddsFlash {
  0% { background: #4CAF50; color: white; }
  50% { background: #66BB6A; color: white; }
  100% { background: #f5f5f7; color: var(--text-sub); }
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === BASE COMPONENTS === */

/* Card */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* Button Base */
.btn {
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Overlay Base - extended by all modals/panels */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
}

.overlay--dark { background: rgba(0, 0, 0, 0.6); }
.overlay--modal { z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay--bottom { z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.overlay--notification { z-index: 1000; }

/* Modal Base */
.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
}

/* Close Button - consolidated pattern */
.btn-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-close:hover { color: #666; }

.btn-close--light {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 20px;
}

.btn-close--light:hover { background: rgba(255, 255, 255, 0.3); }

/* Tabs - shared by picks and flexboard */
.tabs {
  display: flex;
  background: var(--surface);
  padding: 12px 16px;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: #f0f0f0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab.active {
  background: var(--secondary);
  color: white;
}

/* === LOGIN SCREEN === */
.login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #4a2c7a 100%);
}

.login-logo { font-size: 48px; margin-bottom: 8px; }

.login-brand {
  font-size: 32px;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
  letter-spacing: -1px;
}

.login-tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 40px;
}

.login-card {
  padding: 32px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-heavy);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}

.login-footer a { color: white; font-weight: 600; }

/* === FORM ELEMENTS === */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-size: 16px;
  transition: border-color var(--transition-fast);
}

.form-input:focus { outline: none; border-color: var(--primary); }
.form-input::placeholder { color: var(--disabled); }

/* === BUTTONS === */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 8px;
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-primary:hover { background: #3d2460; }
.btn-primary:disabled { background: var(--disabled); cursor: not-allowed; }

.btn-primary.loading { position: relative; color: transparent; }

.btn-primary.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  margin-top: 8px;
}

.btn-secondary:hover { border-color: var(--text-sub); }

.btn-danger {
  flex: 1;
  padding: 14px;
  background: var(--danger);
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
}

.btn-danger:hover { background: #B91C1C; }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px;
  text-decoration: underline;
  cursor: pointer;
}

.btn-link:hover { color: #3d2460; }
.btn-link:disabled { color: var(--text-sub); }

.btn-back {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  align-self: flex-start;
}

.btn-back:hover { color: white; }

.btn-signout {
  background: white;
  color: var(--danger);
  font-weight: 700;
  border: 1px solid #fee;
  border-radius: var(--radius-lg);
  padding: 16px;
  text-align: center;
  width: 100%;
  cursor: pointer;
}

.btn-signout:hover { background: #FEF2F2; }

/* === MESSAGES === */
.error-message {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: var(--danger);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.error-message.hidden { display: none; }

.success-message {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  color: var(--secondary);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
  text-align: center;
}

.info-message {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

.info-message strong { color: white; font-weight: 600; }

/* === CODE INPUT === */
.code-input-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.code-digit {
  width: 48px;
  height: 56px;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  transition: border-color var(--transition-fast);
}

.code-digit:focus { outline: none; border-color: var(--primary); }

.code-input-single {
  width: 100%;
  padding: 16px;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 8px;
  transition: border-color var(--transition-fast);
}

.code-input-single:focus { outline: none; border-color: var(--primary); }
.code-input-single::placeholder { letter-spacing: 4px; font-weight: 400; color: var(--border-muted); }

/* === INVITE CODE SECTION === */
.invite-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 8px;
  width: 100%;
}

.invite-toggle:hover { color: var(--primary); }
.invite-toggle .chevron { transition: transform var(--transition-fast); }
.invite-toggle.open .chevron { transform: rotate(180deg); }

.invite-section { display: none; margin-bottom: 16px; }
.invite-section.open { display: block; }

.league-badge {
  background: #F3F0F7;
  color: var(--primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.resend-section {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-sub);
}

/* === SCREEN TITLES === */
.screen-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  text-align: center;
}

.screen-subtitle {
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 24px;
  text-align: center;
  line-height: 1.5;
}

/* === SUCCESS SCREEN === */
.success-container { text-align: center; padding: 24px; }
.success-icon { font-size: 64px; margin-bottom: 16px; }
.success-title { font-size: 24px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.success-subtitle { font-size: 14px; color: var(--text-sub); }

/* === LOADING SCREEN === */
.loading-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.loading-spinner { font-size: 48px; animation: pulse 1.5s ease-in-out infinite; }
.loading-spinner-small { font-size: 32px; animation: spin 1s linear infinite; margin-bottom: 12px; }

/* === APP HEADER === */
.app-header {
  background-color: var(--primary);
  color: white;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.league-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.league-selector:hover { background: rgba(255,255,255,0.1); }
.league-emoji { font-size: 20px; }
.league-name { font-weight: 700; font-size: 16px; }
.league-chevron { font-size: 10px; opacity: 0.7; }

.header-actions { display: flex; align-items: center; gap: 12px; }

.btn-refresh-header {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  color: white;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  line-height: 1;
}

.btn-refresh-header:hover { opacity: 1; }

.notification-icon { position: relative; font-size: 20px; cursor: pointer; padding: 4px; }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Wallet Pill - consolidated */
.wallet-pill {
  background: rgba(255,255,255,0.1);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wallet-pill:hover { transform: scale(1.02); }
.wallet-pill:active { transform: scale(0.98); }
.wallet-pill.wallet-animate { animation: wallet-pulse 0.4s ease; }

/* === LEAGUE DROPDOWN === */
.league-dropdown {
  position: absolute;
  top: 60px;
  left: 16px;
  right: 16px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 101;
}

.league-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.league-dropdown-item:last-child { border-bottom: none; }
.league-dropdown-item:hover { background: var(--bg); }
.league-dropdown-item.active { background: #F3F0F7; }

/* === MAIN CONTENT === */
.main-content {
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + 24px);
  min-height: calc(100vh - 60px - var(--nav-height));
}

.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  color: var(--text-sub);
  text-align: center;
}

.placeholder-content p:first-child { font-size: 48px; margin-bottom: 8px; }

/* === BOTTOM NAVIGATION === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: white;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #C0C0C0;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  width: 20%;
  padding: 6px 0;
}

.nav-item.active {
  color: var(--primary);
  background: rgba(46, 26, 71, 0.08);
  border-radius: var(--radius-lg);
}

.nav-icon { font-size: 20px; }

/* === PROFILE SCREEN === */
.profile-content {
  padding: 16px;
  padding-bottom: calc(var(--nav-height) + 24px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.identity-card { padding: 20px; display: flex; align-items: center; gap: 16px; }

.avatar {
  width: 60px;
  height: 60px;
  background: #E0E0E0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #888;
}

.user-info { display: flex; flex-direction: column; gap: 4px; }
.user-name { font-size: 18px; font-weight: 800; color: var(--text-main); }
.user-email { font-size: 14px; color: var(--text-sub); }
.edit-link { font-size: 13px; color: var(--primary); font-weight: 600; cursor: pointer; }

/* Stats Card */
.stats-card {
  background: linear-gradient(135deg, var(--primary) 0%, #4a2c7a 100%);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  color: white;
  box-shadow: 0 4px 12px rgba(46, 26, 71, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-block { display: flex; flex-direction: column; gap: 4px; }

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  font-weight: 700;
  color: var(--text-sub);
}

.stats-card .stat-label { color: white; }
.stat-value { font-size: 22px; font-weight: 800; }

/* No League Card */
.no-league-card { padding: 24px; text-align: center; }
.no-league-card p { color: var(--text-sub); margin-bottom: 16px; }

/* Menu List */
.menu-list {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #F5F5F7;
  cursor: pointer;
}

.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: var(--bg); }
.menu-left { display: flex; align-items: center; gap: 12px; }
.menu-icon { font-size: 18px; width: 24px; text-align: center; }
.menu-label { font-size: 15px; font-weight: 600; color: var(--text-main); }
.menu-chevron { color: var(--border-muted); font-weight: 800; font-size: 12px; }

/* Sub-screen Header */
.sub-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.sub-title { font-size: 18px; font-weight: 700; color: var(--text-main); }

/* League Items */
.league-item {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.league-item:hover { background: #F9F9F9; }

.league-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  cursor: pointer;
}

.league-item-emoji { font-size: 32px; }
.league-item-name { font-size: 16px; font-weight: 700; color: var(--text-main); }
.league-item-stats { font-size: 13px; color: var(--text-sub); }
.league-item-arrow { color: var(--border-muted); font-size: 16px; }

.league-item-actions { display: flex; align-items: center; gap: 8px; }

.btn-leave {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #FEE2E2;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-leave:hover { background: #FECACA; }

/* Join League Card */
.join-league-card { padding: 20px; margin-top: 16px; }

.join-preview-card {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.join-preview-card h3 { margin: 0 0 4px 0; font-size: 18px; font-weight: 700; color: var(--text-main); }

.join-type-selector { display: flex; gap: 8px; }

.join-type-btn {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  background: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.join-type-btn.active { border-color: var(--primary); background: #F3F0F7; color: var(--primary); }
.join-type-btn:hover:not(.active) { border-color: #D1D5DB; }

.helper-text { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.loading-state { text-align: center; padding: 20px; color: var(--text-sub); }

/* === MODALS === */
.modal-overlay { z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }

.modal-card {
  padding: 24px;
  max-width: 340px;
  width: 100%;
  position: relative;
  z-index: 201;
}

.modal-title { font-size: 20px; font-weight: 700; color: var(--text-main); margin: 0 0 12px 0; text-align: center; }
.modal-message { font-size: 15px; color: var(--text-main); text-align: center; margin: 0 0 8px 0; line-height: 1.5; }
.modal-warning { font-size: 13px; color: var(--text-sub); text-align: center; margin: 0 0 20px 0; }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn-secondary { flex: 1; margin-top: 0; }

.modal-dialog {
  padding: 0;
  max-width: 400px;
  width: 90%;
  overflow: hidden;
  position: relative;
  z-index: 201;
  background: white;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-main); }

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal-close:hover { color: #666; }
.modal-body { padding: 24px; }
.modal-body p { margin: 0; color: var(--text-main); line-height: 1.6; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

/* === HOME SCREEN === */
.hero-card {
  background: linear-gradient(135deg, var(--primary) 0%, #4a2c7a 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
}

.hero-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--flame);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.match-time { font-size: 14px; color: rgba(255, 255, 255, 0.7); margin-bottom: 16px; }

.versus-display { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.team-side { flex: 1; text-align: center; }

.team-name {
  font-size: 16px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.team-form { font-size: 12px; color: rgba(255, 255, 255, 0.6); margin-bottom: 12px; font-family: monospace; }
.vs-badge { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, 0.6); padding: 8px; }

.odds-btn {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.odds-btn:hover { background: var(--flame); color: white; }
.odds-btn:disabled { background: var(--border-light); color: var(--text-sub); cursor: not-allowed; }
.odds-btn:disabled:hover { background: var(--border-light); color: var(--text-sub); }
.odds-btn.my-team { border-color: var(--flame); }

.hero-trash-talk-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.2);
  border: 2px solid rgba(220, 38, 38, 0.5);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
  z-index: 1;
}

.hero-trash-talk-btn:hover { background: rgba(220, 38, 38, 0.3); transform: scale(1.1); }
.hero-trash-talk-btn:active { transform: scale(0.95); }

/* === MATCH LIST === */
.section-header { margin-bottom: 12px; }
.section-header h2 { font-size: 18px; font-weight: 600; color: var(--text-main); }

.match-list { display: flex; flex-direction: column; gap: 12px; }

.match-card { padding: 16px; border-radius: var(--radius-md); border-left: 3px solid transparent; }
.match-card.my-match-border { border-left-color: var(--secondary); }

.match-time-small { font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }
.match-teams { display: flex; flex-direction: column; gap: 8px; }
.team-row { display: flex; align-items: center; gap: 8px; }

.team-row .team-name {
  flex: 1;
  font-size: 14px;
  margin-bottom: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.team-form-small { font-size: 11px; color: var(--text-sub); font-family: monospace; min-width: 50px; }

.odds-btn-small {
  background: var(--primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  min-width: 60px;
  position: relative;
}

.odds-btn-small:hover { background: var(--flame); color: white; }
.odds-btn-small:disabled { background: var(--disabled); cursor: not-allowed; }
.odds-btn-small:disabled:hover { background: var(--disabled); }

/* Results View */
.winner-row { font-weight: 700; }
.winner-check { font-size: 18px; color: var(--secondary); font-weight: 700; min-width: 60px; text-align: center; }

/* Empty/Loading States */
.empty-state { text-align: center; padding: 40px; color: var(--text-sub); }

/* Refresh Button */
.btn-refresh {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.btn-refresh:hover { background: rgba(0, 0, 0, 0.05); }
.btn-refresh:disabled { opacity: 0.5; cursor: not-allowed; }

/* Filter Pills */
.filter-pills { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 4px; }

.filter-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: white;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill.active {
  border-color: var(--secondary);
  background: var(--secondary);
  color: white;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
  transform: translateY(-1px);
}

.filter-pill:hover:not(.active) { border-color: var(--secondary); color: var(--secondary); background: rgba(46, 125, 50, 0.05); }

/* === BET SLIP === */
.bet-slip-minimized {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 350px;
  background: var(--primary);
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  box-shadow: 0 4px 12px rgba(46, 26, 71, 0.4);
  z-index: 101;
  cursor: pointer;
}

.slip-selection { display: flex; align-items: center; gap: 8px; font-weight: 600; }

.slip-odds {
  background: rgba(255,255,255,0.25);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  color: white;
}

.slip-expand-hint { font-size: 12px; opacity: 0.7; }

.bet-slip-overlay { z-index: 200; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.6); }

.bet-slip-panel {
  background: white;
  width: 100%;
  max-width: 450px;
  border-radius: var(--radius-xl) 16px 0 0;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 201;
}

.slip-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
}

.slip-title { margin: 0 0 20px 0; color: var(--primary); text-transform: uppercase; font-size: 14px; letter-spacing: 0.5px; }

.slip-selection-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.slip-team-container { display: flex; flex-direction: column; gap: 4px; }
.slip-team { font-weight: 700; color: var(--primary); }
.slip-opponent { font-size: 13px; color: var(--text-sub); opacity: 0.7; font-weight: 400; }
.slip-match-time { font-size: 12px; color: var(--text-sub); opacity: 0.6; font-weight: 400; margin-top: 2px; }

.slip-odds-badge {
  background: #4CAF50;
  color: white;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 20px;
}

.slip-odds-timestamp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #f5f5f7;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-sub);
  transition: background-color 0.3s ease;
}

.slip-odds-timestamp.odds-flash { animation: oddsFlash 0.6s ease-out; }
.odds-time-label { flex: 1; }

.btn-refresh-odds {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: transform var(--transition-fast) ease, opacity 0.2s ease;
  opacity: 0.6;
}

.btn-refresh-odds:hover:not(:disabled) { opacity: 1; transform: rotate(-45deg); }
.btn-refresh-odds:disabled { cursor: not-allowed; opacity: 0.3; animation: spin 1s linear infinite; }

.slip-input-row { margin-bottom: 12px; }
.slip-input-row label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }

.slip-input-group {
  display: flex;
  align-items: center;
  background: #f5f5f7;
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.slip-amount-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  text-align: right;
  outline: none;
  -moz-appearance: textfield;
}

.slip-amount-input::-webkit-outer-spin-button,
.slip-amount-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.slip-currency { font-size: 18px; margin-left: 4px; }

.slip-presets { display: flex; gap: 8px; margin-bottom: 16px; }

.preset-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  background: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.preset-btn:hover { background: #f5f5f7; }

.slip-potential-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.slip-potential-row span:first-child { color: var(--text-sub); }
.slip-potential-value { font-size: 18px; font-weight: 700; color: var(--secondary); }
.slip-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; text-align: center; }

.btn-lock-it-in {
  width: 100%;
  padding: 16px;
  background: var(--secondary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-lock-it-in:disabled { background: #ccc; cursor: not-allowed; }

.btn-remove-selection {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--danger);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

/* === SKELETON LOADERS === */
.skeleton-container { display: flex; flex-direction: column; gap: 12px; }

.skeleton-match-card { background: white; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.skeleton-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.skeleton-teams { display: flex; flex-direction: column; gap: 8px; }
.skeleton-team-row { display: flex; align-items: center; gap: 8px; }

.skeleton-text {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  height: 14px;
}

.skeleton-time { width: 120px; }
.skeleton-heat { width: 80px; }
.skeleton-name { flex: 1; max-width: 140px; }
.skeleton-form { width: 40px; }

.skeleton-btn {
  width: 60px;
  height: 32px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-bet-card { background: white; padding: 16px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.skeleton-bet-result {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

.skeleton-bet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 16px; }
.skeleton-bet-footer { display: flex; gap: 24px; padding-top: 12px; border-top: 1px solid #f5f5f7; }
.skeleton-flexboard-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 8px; }

/* === MY PICKS === */
.picks-content { padding-bottom: 100px; }

.picks-summary {
  display: flex;
  justify-content: space-around;
  padding: 16px;
  background: #f9f9f9;
  border-bottom: 1px solid var(--border);
}

.summary-item { text-align: center; }
.summary-label { display: block; font-size: 12px; color: var(--text-sub); margin-bottom: 4px; }
.summary-value { font-size: 18px; font-weight: 700; }
.summary-value.positive { color: var(--secondary); }

.bets-list { padding: 16px; }

.bet-card { padding: 16px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.bet-card.open { border-left: 4px solid var(--flame); }
.bet-card.won { border-left: 4px solid var(--secondary); }
.bet-card.lost { border-left: 4px solid var(--danger); }

.bet-result-header { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.bet-result-header.won { color: var(--secondary); }
.bet-result-header.lost { color: var(--danger); }

.bet-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.bet-selection { flex: 1; }
.bet-team { display: block; font-size: 16px; font-weight: 700; color: var(--primary); }
.bet-context { display: block; font-size: 13px; color: var(--text-sub); margin-top: 2px; }
.bet-match-time { display: block; font-size: 12px; color: var(--text-sub); opacity: 0.6; margin-top: 4px; font-weight: 400; }
.team-picked { font-weight: 700; color: var(--primary); }
.team-not-picked { font-weight: 400; color: var(--text-sub); opacity: 0.6; }

.bet-odds { background: #f5f5f7; padding: 6px 12px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; }

.bet-card-bottom { display: flex; gap: 24px; padding-top: 12px; border-top: 1px solid #f5f5f7; }
.bet-financial { font-size: 14px; }
.bet-label { color: var(--text-sub); }
.bet-value { font-weight: 700; margin-left: 4px; }
.bet-value.positive { color: var(--secondary); }
.bet-value.negative { color: var(--danger); }

.pnl-header {
  background: linear-gradient(135deg, var(--secondary) 0%, #1B5E20 100%);
  color: white;
  padding: 24px;
  text-align: center;
}

.pnl-label { font-size: 12px; text-transform: uppercase; opacity: 0.8; }
.pnl-value { font-size: 36px; font-weight: 800; margin: 8px 0; }
.pnl-value.negative { background: linear-gradient(135deg, var(--danger) 0%, #B71C1C 100%); }
.pnl-record { font-size: 14px; opacity: 0.9; }

.btn-load-more {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid #ddd;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.btn-load-more:hover { background: #f5f5f7; }

.btn-delete-bet {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease;
  line-height: 1;
}

.btn-delete-bet:hover:not(:disabled) { opacity: 1; }
.btn-delete-bet:disabled { cursor: not-allowed; opacity: 0.3; }

/* === FLEXBOARD === */
.flexboard-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
}

.flexboard-filter-group { display: flex; gap: 8px; }
.flexboard-meta { display: flex; align-items: center; gap: 8px; }
.flexboard-timestamp { font-size: 12px; color: var(--text-sub); white-space: nowrap; }

.btn-flexboard-refresh {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: white;
  color: var(--text-main);
  font-size: 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-flexboard-refresh:hover:not(:disabled) { background: var(--primary); color: white; transform: rotate(90deg); }
.btn-flexboard-refresh:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-flexboard-refresh.refreshing { animation: spin 0.5s linear; }

.flexboard-content { padding: 16px; padding-bottom: calc(var(--nav-height) + 24px); }
.flexboard-list { display: flex; flex-direction: column; gap: 8px; }

.flexboard-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }

.flexboard-row--me {
  background: linear-gradient(135deg, rgba(46, 26, 71, 0.08) 0%, rgba(46, 26, 71, 0.04) 100%);
  border: 2px solid var(--primary);
}

.flexboard-rank { font-size: 14px; font-weight: 700; color: var(--text-sub); min-width: 28px; }
.flexboard-medal { font-size: 20px; min-width: 28px; text-align: center; }

.flexboard-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}

.flexboard-name > span:first-child { overflow: hidden; text-overflow: ellipsis; }

.you-badge {
  display: inline-block;
  background: #22c55e;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.flexboard-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.flexboard-primary { font-size: 16px; font-weight: 700; }
.flexboard-primary.positive { color: var(--secondary); }
.flexboard-primary.negative { color: var(--danger); }
.flexboard-secondary { font-size: 12px; color: var(--text-sub); }
.flexboard-separator { text-align: center; padding: 8px 0; color: var(--text-sub); font-size: 14px; letter-spacing: 4px; }

/* === WALLET MODAL === */
.wallet-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.wallet-modal {
  background: var(--surface);
  width: 100%;
  max-width: 450px;
  border-radius: 24px 24px 0 0;
  overflow: hidden;
  max-height: 70vh;
  position: relative;
  z-index: 201;
}

.wallet-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.wallet-modal-title { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-main); }

.wallet-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-sub);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.wallet-loading,
.wallet-error { padding: 48px 24px; text-align: center; color: var(--text-sub); }

.wallet-content { padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

.wallet-balance-hero { text-align: center; padding: 24px 0 32px; }

.wallet-balance-label {
  font-size: 14px;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.wallet-balance-value {
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wallet-balance-emoji { font-size: 36px; }

.wallet-breakdown {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 4px;
  margin-bottom: 16px;
}

.wallet-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-radius: 12px;
}

.wallet-breakdown-row.available-row { background: rgba(46, 125, 50, 0.08); }
.wallet-breakdown-left { display: flex; align-items: center; gap: 10px; }
.wallet-breakdown-icon { font-size: 16px; }
.wallet-breakdown-label { font-size: 15px; color: var(--text-main); }
.wallet-breakdown-value { font-size: 16px; font-weight: 700; }
.wallet-breakdown-value.available { color: var(--secondary); }
.wallet-breakdown-value.at-risk { color: var(--flame); }

.wallet-info-text { font-size: 13px; color: var(--text-sub); text-align: center; margin: 0 0 20px; line-height: 1.5; }

.btn-wallet-refresh {
  width: 100%;
  padding: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-wallet-refresh:hover:not(:disabled) { background: var(--surface); }
.btn-wallet-refresh:disabled { opacity: 0.6; cursor: not-allowed; }

/* === PICKED INDICATORS === */
.picked-check { color: var(--secondary); font-weight: 700; margin-right: 4px; }
.team-row.picked-row .team-name { font-weight: 700; color: var(--text-main); }
.team-row.opponent-of-picked .team-name { color: var(--text-sub); opacity: 0.7; }
.team-side .picked-check { color: var(--flame); }

.picked-indicator { position: absolute; top: -4px; right: -4px; font-size: 15px; line-height: 1; }
.odds-btn .picked-indicator { font-size: 18px; top: -5px; right: -5px; }

/* === CARD SCREENS === */
.card-screen-content { padding: 16px; padding-bottom: 100px; min-height: 100vh; }
.card-header { margin-bottom: 16px; }

.card-loading,
.card-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  text-align: center;
  color: var(--text-sub);
}

.card-error p { margin: 8px 0; }
.card-body { animation: fadeIn 0.2s ease-out; }
.card-hero { text-align: center; margin-bottom: 24px; padding: 16px 0; }

.card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.card-name { font-size: 24px; font-weight: 700; margin: 0 0 4px 0; }
.card-subtitle { color: var(--text-sub); margin: 0; }

.spectator-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  background: var(--text-muted);
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.card-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.stat-system { color: var(--text-sub); font-weight: 400; font-size: 14px; margin-left: 4px; }
.form-display { letter-spacing: 2px; }
.card-section { margin-top: 24px; }

.card-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

.card-list-row {
  display: flex;
  align-items: center;
  padding: 14px;
  background: var(--card-bg);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.card-list-row:active { background: var(--border); }
.row-name { flex: 1; font-weight: 500; }
.row-detail { color: var(--text-sub); font-size: 14px; margin-right: 8px; }
.row-chevron { color: var(--text-muted); font-size: 18px; }

/* Tappable Names */
.tappable-name {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--text-sub);
  text-underline-offset: 3px;
}

.tappable-name:active { opacity: 0.7; }

/* === NOTIFICATIONS PANEL === */
.notification-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 400px;
  height: 100%;
  background: var(--bg);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.2s ease-out;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.notification-header h3 { margin: 0; font-size: 18px; font-weight: 700; }

.notification-close {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-sub);
  padding: 0;
  line-height: 1;
}

.notification-list { flex: 1; overflow-y: auto; padding: 8px; }

.notification-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--card-bg);
  transition: background 0.15s;
}

.notification-item.unread { background: rgba(138, 79, 255, 0.1); border-left: 3px solid var(--primary); }
.notification-icon-small { font-size: 28px; flex-shrink: 0; }
.notification-content { flex: 1; min-width: 0; }
.notification-title { font-weight: 600; margin-bottom: 4px; }
.notification-message { font-size: 14px; color: var(--text-sub); margin-bottom: 6px; word-wrap: break-word; }
.notification-time { font-size: 12px; color: var(--text-muted); }

.notification-empty,
.notification-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-sub);
  padding: 48px;
}

.notification-load-more { padding: 16px 8px; text-align: center; }

.load-more-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 24px;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
}

.load-more-btn:hover:not(:disabled) { background: var(--bg); border-color: var(--primary); }
.load-more-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.notification-header-actions { display: flex; align-items: center; gap: 12px; }

.clear-all-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
}

.clear-all-btn:hover { text-decoration: underline; }

/* === CARD SCREEN HEADERS (Prototype Style) === */
.member-card-screen,
.team-card-screen {
  padding: 0;
  padding-bottom: 100px;
  min-height: 100vh;
  background: var(--bg);
}

.mc-header {
  background: linear-gradient(135deg, var(--primary) 0%, #4a2c7a 100%);
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  color: white;
  position: relative;
}

.tc-header {
  background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top));
  color: white;
  position: relative;
}

.card-close-light {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-close-light:hover { background: rgba(255, 255, 255, 0.3); }

.card-profile { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }

.card-profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  border: 3px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.card-profile-avatar.square { border-radius: 12px; font-size: 32px; }
.card-profile-info { flex: 1; min-width: 0; }
.card-profile-name { font-size: 22px; font-weight: 800; margin: 0 0 4px 0; word-wrap: break-word; }
.card-profile-meta { font-size: 12px; opacity: 0.7; }

.card-profile-badge {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.card-stats-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.card-stats-item { display: flex; flex-direction: column; gap: 4px; }

.card-stats-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.card-stats-value { font-size: 20px; font-weight: 800; }
.card-stats-sub { font-size: 11px; opacity: 0.8; }

.card-header-actions { display: flex; gap: 8px; }

.card-action-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  opacity: 0.7;
}

.card-action-btn.fist-bump { background: rgba(255, 255, 255, 0.2); border: 2px solid rgba(255, 255, 255, 0.5); color: white; }
.card-action-btn.trash-talk { background: transparent; border: 2px solid rgba(220, 38, 38, 0.7); color: #FCA5A5; }

.card-body-section { padding: 16px; }

.card-body-card {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.card-body-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.card-body-stat-row:last-child { border-bottom: none; }

/* Team Card Roster */
.tc-roster-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card-bg);
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: background 0.15s;
}

.tc-roster-row:active { background: var(--border); }
.tc-roster-row:last-child { margin-bottom: 0; }

.tc-roster-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #E0E0E0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #888;
  flex-shrink: 0;
}

.tc-roster-info { flex: 1; min-width: 0; }

.tc-roster-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tc-roster-stats { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--danger);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.toast-visible {
  opacity: 1;
}

