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

:root {
  --blue: #1a56a0;
  --blue-light: #e8f0fb;
  --blue-dark: #0f3870;
  --green: #1a7a4a;
  --green-light: #e6f4ed;
  --amber: #b45a00;
  --amber-light: #fef3e2;
  --red: #b91c1c;
  --red-light: #fef2f2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.10);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--gray-50); color: var(--gray-800); font-size: 15px; line-height: 1.6; }

/* NAV */
nav { background: var(--blue); padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 56px; position: sticky; top: 0; z-index: 100; }
nav .logo { color: white; font-size: 20px; font-weight: 700; text-decoration: none; letter-spacing: -0.5px; }
nav .logo span { color: #93c5fd; }
nav .nav-links { display: flex; align-items: center; gap: 6px; }
nav .nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; padding: 6px 12px; border-radius: 6px; font-size: 14px; font-weight: 500; transition: background 0.15s; }
nav .nav-links a:hover { background: rgba(255,255,255,0.15); color: white; }
nav .nav-links a.active { background: rgba(255,255,255,0.2); color: white; }
nav .nav-links .btn-nav { background: white; color: var(--blue); padding: 6px 14px; border-radius: 6px; font-weight: 600; }
nav .nav-links .btn-nav:hover { background: var(--blue-light); }
#nav-user { color: rgba(255,255,255,0.7); font-size: 13px; margin-right: 4px; }

/* CONTAINER */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 700; color: var(--gray-800); }
.page-header p { color: var(--gray-600); margin-top: 4px; }

/* CARDS GRID */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.card-photo { width: 100%; height: 180px; object-fit: cover; background: var(--gray-100); display: flex; align-items: center; justify-content: center; color: var(--gray-400); font-size: 40px; }
.card-photo img { width: 100%; height: 180px; object-fit: cover; }
.card-body { padding: 14px; }
.card-name { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.card-meta { font-size: 13px; color: var(--gray-600); margin-bottom: 10px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gray-100); }
.card-user { font-size: 12px; color: var(--gray-600); }
.card-user a { color: var(--blue); text-decoration: none; font-weight: 500; }

/* BADGES */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.badge-nm { background: var(--green-light); color: var(--green); }
.badge-lp { background: var(--blue-light); color: var(--blue-dark); }
.badge-mp { background: var(--amber-light); color: var(--amber); }
.badge-hp { background: var(--red-light); color: var(--red); }
.badge-tcg { background: #f3e8ff; color: #6b21a8; }
.badge-sports { background: #e0f2fe; color: #075985; }
.badge-tier1 { background: var(--gray-100); color: var(--gray-600); }
.badge-tier2 { background: var(--blue-light); color: var(--blue-dark); }
.badge-tier3 { background: #fef9c3; color: #854d0e; }

/* BUTTONS */
.btn { display: inline-block; padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: opacity 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success { background: var(--green); color: white; }
.btn-danger { background: var(--red); color: white; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-full { width: 100%; text-align: center; }

/* FORMS */
.form-card { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); padding: 28px; max-width: 560px; margin: 0 auto; box-shadow: var(--shadow); }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; color: var(--gray-600); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px; font-size: 15px; font-family: inherit; transition: border 0.15s; background: white; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--blue); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* FILTERS */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.filters select, .filters input { padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px; font-size: 14px; background: white; font-family: inherit; }
.filters input { flex: 1; min-width: 180px; }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: var(--red-light); color: var(--red); border: 1px solid #fecaca; }
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; }
.alert-info { background: var(--blue-light); color: var(--blue-dark); border: 1px solid #bfdbfe; }

/* MATCH CARDS */
.match-card { background: white; border-radius: var(--radius); border: 2px solid var(--green); padding: 16px; margin-bottom: 12px; }
.match-card.partial { border-color: var(--blue); }
.match-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; }
.match-mutual { color: var(--green); font-size: 13px; }
.match-partial { color: var(--blue); font-size: 13px; }
.match-cards-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.match-arrow { font-size: 22px; color: var(--gray-400); text-align: center; }
.mini-card { background: var(--gray-50); border-radius: 8px; border: 1px solid var(--gray-200); padding: 10px; font-size: 13px; }
.mini-card .name { font-weight: 600; margin-bottom: 2px; }
.mini-card .meta { color: var(--gray-600); font-size: 12px; }

/* WANT LIST */
.want-item { background: white; border-radius: 8px; border: 1px solid var(--gray-200); padding: 12px 16px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.want-info .name { font-weight: 600; }
.want-info .meta { font-size: 13px; color: var(--gray-600); }

/* OFFER CARD */
.offer-card { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); padding: 16px; margin-bottom: 12px; }
.offer-status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.status-pending { background: var(--amber-light); color: var(--amber); }
.status-accepted { background: var(--green-light); color: var(--green); }
.status-declined { background: var(--red-light); color: var(--red); }

/* PROFILE */
.profile-header { background: white; border-radius: var(--radius); border: 1px solid var(--gray-200); padding: 24px; margin-bottom: 24px; display: flex; align-items: center; gap: 20px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--blue); color: white; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; flex-shrink: 0; }
.profile-name { font-size: 22px; font-weight: 700; }
.profile-meta { color: var(--gray-600); font-size: 14px; margin-top: 4px; }

/* TABS */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; }
.tab { padding: 10px 20px; font-size: 14px; font-weight: 600; color: var(--gray-600); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; text-decoration: none; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* HERO */
.hero { background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%); color: white; padding: 60px 20px; text-align: center; }
.hero h1 { font-size: 36px; font-weight: 800; margin-bottom: 12px; }
.hero p { font-size: 18px; opacity: 0.85; margin-bottom: 28px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-btns .btn-white { background: white; color: var(--blue); }
.hero-btns .btn-outline { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.6); }

/* STATS BAR */
.stats-bar { background: white; border-bottom: 1px solid var(--gray-200); padding: 14px 20px; display: flex; justify-content: center; gap: 40px; }
.stat { text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; color: var(--blue); }
.stat-label { font-size: 12px; color: var(--gray-600); }

/* EMPTY STATE */
.empty { text-align: center; padding: 60px 20px; color: var(--gray-400); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty h3 { font-size: 18px; color: var(--gray-600); margin-bottom: 8px; }

/* MODAL */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: white; border-radius: var(--radius); padding: 28px; max-width: 480px; width: 90%; }
.modal h2 { font-size: 20px; margin-bottom: 16px; }
.modal-footer { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }

/* TOAST */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--gray-800); color: white; padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 999; opacity: 0; transform: translateY(10px); transition: all 0.3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 600px) {
  .hero h1 { font-size: 26px; }
  .form-row { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .stats-bar { gap: 20px; }
  nav .logo { font-size: 17px; }
}
