/* ═══════════════════════════════════════════════════════
   TEAM ACHIEVEMENTS — Design System v3
   Colors: #222831 #393E46 #00ADB5 #EEEEEE
   Khaled = Royal Gold treatment
   ═══════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --fs-xl: 22px; --fs-lg: 16px; --fs-md: 14px; --fs-sm: 12px; --fs-xs: 10px;
  --fw-bold: 700; --fw-semi: 600; --fw-med: 500; --fw-reg: 400;
  --radius: 14px; --radius-sm: 10px; --radius-full: 9999px;
  --shadow: 0 2px 8px rgba(0,0,0,.15);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.25);
  --shadow-glow: 0 0 20px rgba(0,173,181,.15);
  --transition: .2s cubic-bezier(.4,0,.2,1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Khaled gold */
  --gold: #F5A623; --gold-glow: rgba(245,166,35,.3); --gold-dark: #c7841a;
}

/* ══════════════════════════════════════════
   PALETTES
   ══════════════════════════════════════════ */
/* 1 — Dark Space */
body, [data-palette="dark-space"][data-theme="dark"] {
  --bg-1: #222831; --bg-2: #393E46; --bg-3: #2d333b;
  --accent: #00ADB5; --accent-hover: #00c4cf;
  --text-1: #EEEEEE; --text-2: #9ca3af; --text-3: #6b7280;
  --bg-card: #2d333b; --bg-input: #393E46; --border: #4a5568;
  --bg-hover: #3a4149; --danger: #ef4444; --success: #00ADB5;
  --glass: rgba(57,62,70,.6); --glass-border: rgba(238,238,238,.08);
}
[data-palette="dark-space"][data-theme="light"] {
  --bg-1: #f0f2f5; --bg-2: #e2e5ea; --bg-3: #fff;
  --accent: #008b93; --accent-hover: #006d73;
  --text-1: #222831; --text-2: #555e68; --text-3: #8a929c;
  --bg-card: #ffffff; --bg-input: #f5f6fa; --border: #d1d5db;
  --bg-hover: #e8ecf1; --danger: #dc2626; --success: #008b93;
  --glass: rgba(255,255,255,.7); --glass-border: rgba(0,0,0,.06);
}
/* 2 — Frost Teal */
[data-palette="frost-teal"][data-theme="light"] {
  --bg-1: #E3FDFD; --bg-2: #CBF1F5; --bg-3: #fff;
  --accent: #71C9CE; --accent-hover: #5bb8bd;
  --text-1: #1a3c40; --text-2: #3d7a80; --text-3: #6da3a8;
  --bg-card: #ffffff; --bg-input: #e8f8f9; --border: #A6E3E9;
  --bg-hover: #d5f4f7; --danger: #ef4444; --success: #469d9f;
  --glass: rgba(203,241,245,.6); --glass-border: rgba(113,201,206,.15);
}
[data-palette="frost-teal"][data-theme="dark"] {
  --bg-1: #0d2b2e; --bg-2: #163538; --bg-3: #1a3c40;
  --accent: #71C9CE; --accent-hover: #8dd8dc;
  --text-1: #E3FDFD; --text-2: #A6E3E9; --text-3: #71C9CE;
  --bg-card: #1a3c40; --bg-input: #163538; --border: #2a5558;
  --bg-hover: #1f4548; --danger: #ef4444; --success: #71C9CE;
  --glass: rgba(22,53,56,.7); --glass-border: rgba(166,227,233,.1);
}
/* 3 — Navy Blue */
[data-palette="navy-blue"][data-theme="light"] {
  --bg-1: #F9F7F7; --bg-2: #DBE2EF; --bg-3: #fff;
  --accent: #3F72AF; --accent-hover: #2e5d94;
  --text-1: #112D4E; --text-2: #4a6fa5; --text-3: #7a9ac4;
  --bg-card: #ffffff; --bg-input: #eef2f9; --border: #c5d1e5;
  --bg-hover: #e5eaf5; --danger: #dc2626; --success: #27ae60;
  --glass: rgba(219,226,239,.6); --glass-border: rgba(63,114,175,.1);
}
[data-palette="navy-blue"][data-theme="dark"] {
  --bg-1: #112D4E; --bg-2: #1a3a5c; --bg-3: #1e405f;
  --accent: #5e9adb; --accent-hover: #78ade4;
  --text-1: #F9F7F7; --text-2: #DBE2EF; --text-3: #a8b8d0;
  --bg-card: #1a3a5c; --bg-input: #1e405f; --border: #2d5a8a;
  --bg-hover: #234b72; --danger: #ef4444; --success: #2ecc71;
  --glass: rgba(26,58,92,.7); --glass-border: rgba(219,226,239,.08);
}
/* 4 — Peach Blush */
[data-palette="peach-blush"][data-theme="light"] {
  --bg-1: #FFF5E4; --bg-2: #FFE3E1; --bg-3: #fff;
  --accent: #FF9494; --accent-hover: #ff7a7a;
  --text-1: #5a2d2d; --text-2: #8b5e5e; --text-3: #b88888;
  --bg-card: #ffffff; --bg-input: #fff0ed; --border: #FFD1D1;
  --bg-hover: #ffe8e6; --danger: #dc2626; --success: #e67e22;
  --glass: rgba(255,227,225,.6); --glass-border: rgba(255,148,148,.12);
}
[data-palette="peach-blush"][data-theme="dark"] {
  --bg-1: #2d1a1a; --bg-2: #3d2525; --bg-3: #452a2a;
  --accent: #FF9494; --accent-hover: #ffadad;
  --text-1: #FFF5E4; --text-2: #FFD1D1; --text-3: #ff9494;
  --bg-card: #3d2525; --bg-input: #4a2f2f; --border: #5a3838;
  --bg-hover: #4a3030; --danger: #ef4444; --success: #e67e22;
  --glass: rgba(61,37,37,.7); --glass-border: rgba(255,209,209,.08);
}
/* 5 — Crimson Night */
[data-palette="crimson-night"][data-theme="dark"] {
  --bg-1: #0a0a0a; --bg-2: #1a0808; --bg-3: #200e0e;
  --accent: #FF0000; --accent-hover: #ff3333;
  --text-1: #f5f5f5; --text-2: #cc9999; --text-3: #996666;
  --bg-card: #1a0808; --bg-input: #2a0a0a; --border: #3D0000;
  --bg-hover: #2a0e0e; --danger: #FF0000; --success: #950101;
  --glass: rgba(26,8,8,.7); --glass-border: rgba(255,0,0,.08);
}
[data-palette="crimson-night"][data-theme="light"] {
  --bg-1: #fff0f0; --bg-2: #ffe0e0; --bg-3: #fff;
  --accent: #950101; --accent-hover: #b30202;
  --text-1: #1a0000; --text-2: #6b2020; --text-3: #a54040;
  --bg-card: #ffffff; --bg-input: #fff5f5; --border: #ffcccc;
  --bg-hover: #ffe8e8; --danger: #FF0000; --success: #950101;
  --glass: rgba(255,224,224,.6); --glass-border: rgba(149,1,1,.08);
}

/* ══════════════════════════════════════════
   BASE
   ══════════════════════════════════════════ */
html { font-size: 16px; height: 100%; }
body {
  font-family: var(--font); font-size: var(--fs-md); font-weight: var(--fw-reg);
  color: var(--text-1); background: var(--bg-1);
  line-height: 1.55; min-height: 100%; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
a { color: var(--accent); text-decoration: none; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

/* ══════════════════════════════════════════
   PROFILE SELECTOR (Login)
   ══════════════════════════════════════════ */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; align-items: center; justify-content: center; padding: 20px; }

.selector-container { width: 100%; max-width: 600px; text-align: center; }
.selector-header { margin-bottom: 32px; }
.selector-logo { font-size: 52px; display: block; margin-bottom: 8px; animation: float 3s ease-in-out infinite; }
.selector-title { font-size: 28px; font-weight: 800; letter-spacing: -.5px; background: linear-gradient(135deg, var(--accent), #EEEEEE); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.selector-sub { color: var(--text-2); font-size: var(--fs-lg); margin-top: 4px; }
.selector-footer { color: var(--text-3); font-size: var(--fs-sm); margin-top: 24px; }

@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

.profile-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
@media (max-width: 500px) { .profile-grid { grid-template-columns: repeat(2, 1fr); } }

.profile-pick {
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 20px 12px;
  cursor: pointer; transition: all .25s ease;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  position: relative; overflow: hidden;
}
.profile-pick:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.profile-pick:active { transform: scale(.97); }
.profile-pick .pick-avatar {
  width: 56px; height: 56px; border-radius: 50%; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 2px solid var(--border);
}
.profile-pick .pick-name { font-weight: var(--fw-semi); font-size: var(--fs-md); }
.profile-pick .pick-role { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .5px; }
.profile-pick .pick-status { width: 10px; height: 10px; border-radius: 50%; background: var(--success); position: absolute; top: 12px; right: 12px; border: 2px solid var(--bg-card); }

/* ═══ KHALED — Royal Treatment ═══ */
.profile-pick.is-khaled {
  border-color: var(--gold);
  background: linear-gradient(135deg, var(--bg-card), rgba(245,166,35,.08));
  box-shadow: 0 0 24px var(--gold-glow), var(--shadow);
}
.profile-pick.is-khaled:hover {
  border-color: var(--gold); box-shadow: 0 0 40px var(--gold-glow), var(--shadow-lg);
  transform: translateY(-6px);
}
.profile-pick.is-khaled .pick-avatar {
  border-color: var(--gold); background: linear-gradient(135deg, #3d2e0a, #5a4310);
  box-shadow: 0 0 16px var(--gold-glow);
}
.profile-pick.is-khaled .pick-name { color: var(--gold); }
.profile-pick.is-khaled .pick-crown {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  font-size: 18px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.profile-pick.is-khaled::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 60%, var(--gold-glow));
  pointer-events: none;
}

/* Khaled in feed cards */
.card-author.is-khaled { color: var(--gold) !important; font-weight: 700; }
.card-author.is-khaled::after { content: ' 👑'; font-size: 12px; }
.card-avatar.is-khaled { border: 2px solid var(--gold) !important; box-shadow: 0 0 10px var(--gold-glow); }

/* ══════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════ */
.app-layout { display: flex; min-height: 100vh; padding-bottom: calc(56px + var(--safe-bottom)); }
@media (min-width:1024px) { .app-layout { padding-bottom: 0; } }

/* Sidebar */
.sidebar {
  display: none; flex-direction: column; width: 220px;
  background: var(--bg-2); border-right: 1px solid var(--border);
  padding: 16px 10px; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100;
}
@media (min-width:1024px) { .sidebar { display: flex; } }
.sidebar-header { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 12px; }
.sidebar-logo { font-size: 24px; }
.sidebar-title { font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border); padding-top: 10px; }

/* Online strip */
.online-strip { display: flex; gap: 6px; padding: 8px 12px 12px; flex-wrap: wrap; }
.online-dot {
  width: 32px; height: 32px; border-radius: 50%; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3); border: 2px solid var(--border);
  position: relative; cursor: default;
}
.online-dot.is-khaled { border-color: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.online-dot.is-you { border-color: var(--accent); }
.online-dot .dot-pulse {
  position: absolute; bottom: -1px; right: -1px; width: 8px; height: 8px;
  border-radius: 50%; background: #22c55e; border: 1.5px solid var(--bg-2);
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--text-2);
  font: inherit; font-size: var(--fs-md); font-weight: var(--fw-med);
  cursor: pointer; transition: all var(--transition);
  position: relative; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-1); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-label { white-space: nowrap; }

/* Bottom Bar */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: calc(56px + var(--safe-bottom)); padding-bottom: var(--safe-bottom);
  background: var(--bg-2); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: center; z-index: 200;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
@media (min-width:1024px) { .bottom-bar { display: none; } }
.tab-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; background: none; border: none; color: var(--text-2);
  font-family: var(--font); font-size: var(--fs-xs); font-weight: var(--fw-med);
  cursor: pointer; min-width: 44px; min-height: 44px;
  justify-content: center; position: relative; transition: color var(--transition);
}
.tab-item.active { color: var(--accent); }
.tab-icon { font-size: 18px; }

.nav-badge {
  background: var(--danger); color: #fff; font-size: var(--fs-xs); font-weight: 700;
  padding: 1px 5px; border-radius: var(--radius-full);
  position: absolute; top: 2px; right: 6px; min-width: 16px; text-align: center;
}

/* Main Content */
.main-content { flex: 1; min-width: 0; max-width: 680px; margin: 0 auto; padding: 16px; width: 100%; }
@media (min-width:1024px) { .main-content { margin-left: 220px; padding: 20px 28px; } }

.view { display: none; }
.view.active { display: block; animation: fadeIn .2s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:none} }

.view-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 10px; }
.view-header h1 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.3px; }

/* ══════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════ */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font: inherit; font-size: var(--fs-md); font-weight: var(--fw-semi);
  border: none; cursor: pointer; min-height: 44px; min-width: 44px;
  transition: all var(--transition); touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-glow); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-1); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; min-height: 36px; font-size: var(--fs-sm); }
.btn-icon { padding: 8px; font-size: 16px; background: none; border: none; color: var(--text-2); border-radius: var(--radius-sm); min-height: 44px; min-width: 44px; cursor: pointer; transition: all var(--transition); }
.btn-icon:hover { background: var(--bg-hover); color: var(--text-1); }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--text-2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.optional { font-weight: var(--fw-reg); text-transform: none; letter-spacing: 0; }
input[type="text"], input[type="search"], input[type="number"], textarea, select {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input); color: var(--text-1);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: var(--fs-md); transition: border var(--transition); min-height: 44px;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(0,173,181,.12); }
textarea { resize: vertical; min-height: 72px; }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.char-count { font-size: var(--fs-sm); color: var(--text-3); text-align: right; display: block; margin-top: 3px; }
.input-with-action { display: flex; gap: 6px; }
.input-with-action input { flex: 1; }
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: var(--fw-med); }
.toggle-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.toggle-hint { font-size: var(--fs-sm); color: var(--text-3); margin-left: auto; }

/* Settings */
.settings-list { display: flex; flex-direction: column; gap: 20px; }
.setting-group { background: var(--bg-card); border-radius: var(--radius); padding: 18px; border: 1px solid var(--glass-border); }
.setting-group h3 { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: 14px; }
.setting-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.setting-item:last-child { border-bottom: none; }
.setting-item label { font-size: var(--fs-md); font-weight: var(--fw-med); color: var(--text-1); text-transform: none; letter-spacing: 0; margin-bottom: 0; }
.setting-item select, .setting-item input[type="number"] { width: 140px; }
.setting-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.inline-action { display: flex; align-items: center; gap: 8px; }
.inline-action code { background: var(--bg-input); padding: 5px 10px; border-radius: var(--radius-sm); font-size: var(--fs-md); border: 1px solid var(--border); }

/* ── Achievement Cards ── */
.card-list { display: flex; flex-direction: column; gap: 10px; }

.achievement-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 14px;
  border: 1px solid var(--glass-border);
  transition: all .2s ease; position: relative; animation: slideIn .25s ease;
}
.achievement-card:hover { border-color: var(--border); box-shadow: var(--shadow); }
@keyframes slideIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:none} }

.card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: var(--bg-2); flex-shrink: 0; border: 2px solid transparent;
}
.card-avatar.has-ring { border-color: var(--accent); }
.card-meta { flex: 1; min-width: 0; }
.card-author { font-weight: var(--fw-semi); font-size: var(--fs-md); }
.card-time { font-size: var(--fs-sm); color: var(--text-3); }
.card-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: 4px; }
.card-desc { color: var(--text-2); font-size: var(--fs-md); line-height: 1.5; margin-bottom: 8px; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: var(--fs-xs); font-weight: var(--fw-semi); text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 8px; border-radius: var(--radius-full);
}
.badge-small { background: rgba(34,197,94,.15); color: #22c55e; }
.badge-medium { background: rgba(234,179,8,.15); color: #eab308; }
.badge-major { background: rgba(239,68,68,.15); color: #ef4444; }
.badge-pinned { background: var(--accent); color: #fff; }

/* Reactions */
.reaction-bar { display: flex; align-items: center; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.reaction-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: var(--radius-full);
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: 13px; cursor: pointer; transition: all var(--transition); min-height: 28px;
}
.reaction-btn:hover { border-color: var(--accent); }
.reaction-btn.active { border-color: var(--accent); background: rgba(0,173,181,.15); }
.reaction-count { font-size: var(--fs-xs); font-weight: var(--fw-semi); }
.reply-count { font-size: var(--fs-sm); color: var(--text-3); margin-left: auto; cursor: pointer; }
.reply-count:hover { color: var(--accent); }

/* Difficulty Picker */
.difficulty-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.diff-btn {
  padding: 10px 6px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 2px solid var(--border);
  color: var(--text-1); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semi);
  cursor: pointer; text-align: center; transition: all var(--transition); min-height: 44px;
}
.diff-btn:hover { border-color: var(--accent); }
.diff-btn.selected { border-color: var(--accent); background: var(--accent); color: #fff; }
.diff-pts { font-weight: var(--fw-reg); font-size: var(--fs-xs); opacity: .8; }

/* Quest tabs */
.quest-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.tab-btn {
  padding: 7px 16px; border-radius: var(--radius-full);
  background: var(--bg-2); border: none; color: var(--text-2);
  font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semi); cursor: pointer; transition: all var(--transition);
}
.tab-btn.active { background: var(--accent); color: #fff; }

/* Progress bar */
.progress-bar { width: 100%; height: 6px; background: var(--bg-2); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: var(--radius-full); transition: width .5s ease; }

/* Checklist */
.checklist-card { background: var(--bg-card); border-radius: var(--radius); padding: 14px; border: 1px solid var(--glass-border); }
.cl-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.cl-item:last-child { border-bottom: none; }
.cl-check { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.cl-text { flex: 1; font-size: var(--fs-md); }
.cl-text.done { text-decoration: line-through; color: var(--text-3); }
.cl-claimer { font-size: var(--fs-sm); color: var(--accent); white-space: nowrap; }
.cl-comment-count { font-size: var(--fs-sm); color: var(--text-3); cursor: pointer; margin-top: 6px; }
.checklist-editor { display: flex; flex-direction: column; gap: 5px; margin-bottom: 6px; }
.cl-editor-item { display: flex; gap: 6px; align-items: center; }
.cl-editor-item input { flex: 1; }
.cl-editor-item .btn-icon { color: var(--danger); min-height: 32px; min-width: 32px; font-size: 13px; }

/* Profile */
.profile-card {
  background: var(--bg-card); border-radius: var(--radius);
  padding: 22px; text-align: center; border: 1px solid var(--glass-border); margin-bottom: 20px;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 36px; background: var(--bg-2); margin-bottom: 10px; border: 3px solid var(--accent);
}
.profile-name { font-size: 20px; font-weight: 800; margin-bottom: 3px; }
.profile-rank { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: var(--fs-md); color: var(--text-2); margin-bottom: 14px; }
.rank-badge { font-size: 20px; }
.rank-title { font-weight: var(--fw-semi); }
.profile-stats { display: flex; justify-content: center; gap: 28px; }
.stat { text-align: center; }
.stat-value { display: block; font-size: 22px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; }
.profile-section { margin-bottom: 20px; }
.profile-section h3 { font-size: var(--fs-lg); font-weight: var(--fw-bold); margin-bottom: 10px; }

/* Heatmap */
.heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.heatmap-cell { aspect-ratio: 1; border-radius: 2px; background: var(--bg-2); }
.heatmap-cell.l1 { background: color-mix(in srgb, var(--accent) 25%, var(--bg-2)); }
.heatmap-cell.l2 { background: color-mix(in srgb, var(--accent) 50%, var(--bg-2)); }
.heatmap-cell.l3 { background: color-mix(in srgb, var(--accent) 75%, var(--bg-2)); }
.heatmap-cell.l4 { background: var(--accent); }

/* Badge gallery */
.badge-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px; background: var(--bg-card); border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border); min-width: 64px;
}
.badge-icon { font-size: 24px; }
.badge-name { font-size: var(--fs-xs); color: var(--text-3); text-align: center; }

/* Playground */
.playground-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width:400px) { .playground-grid { grid-template-columns: 1fr; } }
.playground-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 14px; background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--glass-border); color: var(--text-1);
  font: inherit; cursor: pointer; transition: all .2s ease; text-align: center;
}
.playground-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.pg-icon { font-size: 32px; }
.pg-title { font-size: var(--fs-md); font-weight: 700; }
.pg-desc { font-size: var(--fs-sm); color: var(--text-3); line-height: 1.3; }

/* Search */
.search-bar { margin-bottom: 14px; }
.search-filters { display: flex; gap: 6px; margin-top: 6px; }
.search-filters select { flex: 1; min-height: 36px; }

/* Empty states */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty-icon { font-size: 40px; display: block; margin-bottom: 8px; }

/* Notification cards */
.notif-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: var(--bg-card); border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent); border: 1px solid var(--glass-border);
  border-left: 3px solid var(--accent);
}
.notif-card.unread { border-left-color: var(--danger); background: var(--bg-hover); }
.notif-icon { font-size: 20px; flex-shrink: 0; }
.notif-body { flex: 1; }
.notif-text { font-size: var(--fs-md); }
.notif-time { font-size: var(--fs-sm); color: var(--text-3); margin-top: 2px; }

/* Energy bar */
.energy-bar-wrap { padding: 6px 14px 8px; }
.energy-label { font-size: var(--fs-xs); font-weight: var(--fw-semi); color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; display: block; }

/* ══════════════════════════════════════════
   SHEETS
   ══════════════════════════════════════════ */
.sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .15s ease; backdrop-filter: blur(4px);
}
.sheet {
  background: var(--bg-card); border-radius: var(--radius) var(--radius) 0 0;
  padding: 18px 18px calc(18px + var(--safe-bottom));
  width: 100%; max-width: 520px; max-height: 85vh; overflow-y: auto;
  animation: sheetUp .25s cubic-bezier(.4,0,.2,1);
  border: 1px solid var(--glass-border); border-bottom: none;
}
@keyframes sheetUp { from{transform:translateY(100%)} to{transform:none} }
.sheet-handle { width: 32px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 14px; }
.sheet-title { font-size: var(--fs-xl); font-weight: 800; margin-bottom: 16px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
@media (min-width:768px) {
  .sheet-overlay { align-items: center; }
  .sheet { border-radius: var(--radius); border-bottom: 1px solid var(--glass-border); max-height: 80vh; }
  @keyframes sheetUp { from{opacity:0;transform:scale(.95)} to{opacity:1;transform:none} }
}

/* FAB */
.fab {
  position: fixed; bottom: calc(68px + var(--safe-bottom)); right: 18px;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  font-size: 26px; font-weight: 300; box-shadow: 0 4px 16px rgba(0,173,181,.35);
  cursor: pointer; z-index: 150;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,173,181,.45); }
.fab:active { transform: scale(.93); }
@media (min-width:1024px) { .fab { bottom: 28px; right: 28px; } }

/* Toast */
.toast-container {
  position: fixed; bottom: calc(68px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 600; display: flex; flex-direction: column; gap: 6px;
  pointer-events: none; width: calc(100% - 28px); max-width: 400px;
}
@media (min-width:1024px) { .toast-container { bottom: 28px; left: auto; right: 28px; transform: none; } }
.toast {
  background: var(--bg-card); color: var(--text-1);
  padding: 10px 14px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); border-left: 3px solid var(--accent);
  animation: toastIn .3s ease; pointer-events: all;
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-md); font-weight: var(--fw-med);
  border: 1px solid var(--glass-border);
}
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-success { border-left-color: var(--success); }
.toast-undo { color: var(--accent); font-weight: 700; cursor: pointer; margin-left: auto; }
@keyframes toastIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:none} }
.toast-exit { animation: toastOut .25s ease forwards; }
@keyframes toastOut { to{opacity:0;transform:translateY(-6px)} }

/* Confetti */
.confetti-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 700; }

/* Onboarding */
.onboarding-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65); z-index: 800;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(6px);
}
.onboarding-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 36px 28px;
  max-width: 380px; width: 100%; text-align: center;
  border: 1px solid var(--glass-border);
}
.onboarding-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.onboarding-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.onboarding-card p { color: var(--text-2); line-height: 1.5; margin-bottom: 20px; }
.onboarding-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 16px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all var(--transition); }
.dot.active { background: var(--accent); width: 20px; border-radius: 3px; }
.onboarding-step { display: none; }
.onboarding-step:not(.hidden) { display: block; animation: fadeIn .3s ease; }

/* Level-up */
.levelup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 750;
  display: flex; align-items: center; justify-content: center; animation: fadeIn .3s ease;
}
.levelup-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 40px 28px;
  text-align: center; max-width: 340px; width: 100%; border: 1px solid var(--glass-border);
  animation: levelUpPop .4s cubic-bezier(.17,.67,.35,1.2);
}
@keyframes levelUpPop { from{opacity:0;transform:scale(.7)} to{opacity:1;transform:none} }
.levelup-emoji { font-size: 64px; display: block; margin-bottom: 10px; animation: float 2s ease-in-out infinite; }
.levelup-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.levelup-card p { color: var(--text-2); margin-bottom: 20px; }

/* ══════════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms!important; transition-duration: .01ms!important; } }
:focus:not(:focus-visible) { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ══════════════════════════════════════════
   LEADERBOARD
   ══════════════════════════════════════════ */
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; background: var(--bg-card);
  border-radius: var(--radius); border: 1px solid var(--glass-border);
  transition: all .2s ease;
}
.lb-row:hover { border-color: var(--border); }
.lb-row.lb-1st { border-color: #F5A623; background: linear-gradient(135deg, var(--bg-card), rgba(245,166,35,.08)); }
.lb-row.lb-2nd { border-color: #C0C0C0; }
.lb-row.lb-3rd { border-color: #CD7F32; }
.lb-row.lb-you { box-shadow: 0 0 12px rgba(0,173,181,.2); border-color: var(--accent); }
.lb-rank { font-size: 20px; font-weight: 800; width: 36px; text-align: center; flex-shrink: 0; }
.lb-rank.rank-1 { color: #F5A623; }
.lb-rank.rank-2 { color: #C0C0C0; }
.lb-rank.rank-3 { color: #CD7F32; }
.lb-avatar { width: 38px; height: 38px; border-radius: 50%; font-size: 20px; display: flex; align-items: center; justify-content: center; background: var(--bg-2); flex-shrink: 0; }
.lb-avatar.is-khaled { border: 2px solid var(--gold); box-shadow: 0 0 8px var(--gold-glow); }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 700; font-size: var(--fs-md); }
.lb-name.is-khaled { color: var(--gold); }
.lb-name.is-khaled::after { content: ' 👑'; font-size: 12px; }
.lb-streak { font-size: var(--fs-sm); color: var(--text-3); }
.lb-pts { font-size: 18px; font-weight: 800; color: var(--accent); }
.lb-bar-wrap { flex: 1; max-width: 120px; }

/* ══════════════════════════════════════════
   FOMO TICKER
   ══════════════════════════════════════════ */
.fomo-ticker {
  background: linear-gradient(90deg, rgba(0,173,181,.08), rgba(0,173,181,.15), rgba(0,173,181,.08));
  border-radius: var(--radius-sm); padding: 8px 14px;
  font-size: var(--fs-sm); color: var(--accent); font-weight: 600;
  margin-bottom: 10px; text-align: center;
  animation: tickerPulse 2s ease-in-out infinite;
  border: 1px solid rgba(0,173,181,.15);
}
@keyframes tickerPulse { 0%,100%{opacity:.7} 50%{opacity:1} }

/* ══════════════════════════════════════════
   DAILY TASKS
   ══════════════════════════════════════════ */
.task-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 14px;
  border: 1px solid var(--glass-border); display: flex; align-items: center; gap: 12px;
}
.task-card.task-done { opacity: .6; }
.task-check { width: 22px; height: 22px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.task-info { flex: 1; }
.task-title { font-weight: 700; font-size: var(--fs-md); }
.task-assignee { font-size: var(--fs-sm); color: var(--text-3); }
.task-pts { font-weight: 700; color: var(--accent); font-size: var(--fs-sm); white-space: nowrap; }

/* ══════════════════════════════════════════
   LOCKED ACHIEVEMENTS
   ══════════════════════════════════════════ */
.locked-badge {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 8px; background: var(--bg-card); border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border); min-width: 72px; text-align: center;
  position: relative; overflow: hidden;
}
.locked-badge.is-locked { opacity: .45; filter: grayscale(.6); }
.locked-badge.is-locked::after {
  content: '🔒'; position: absolute; top: 4px; right: 4px; font-size: 10px;
}
.locked-badge.is-unlocked { border-color: var(--accent); animation: unlockGlow 1.5s ease-in-out; }
@keyframes unlockGlow { 0%{box-shadow: 0 0 20px var(--accent)} 100%{box-shadow: none} }
.locked-badge .badge-icon { font-size: 26px; }
.locked-badge .badge-name { font-size: var(--fs-xs); color: var(--text-2); }
.locked-badge .badge-desc { font-size: 9px; color: var(--text-3); line-height: 1.2; }
