/* ─── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ─── TOKENS ──────────────────────────────────────────────── */
:root {
  --blue-50:#eff6ff; --blue-100:#dbeafe; --blue-200:#bfdbfe;
  --blue-400:#60a5fa; --blue-500:#3b82f6; --blue-600:#2563eb; --blue-700:#1d4ed8;
  --slate-200:#e2e8f0; --slate-400:#94a3b8; --slate-500:#64748b; --slate-600:#475569;
  --white:#ffffff; --danger:#ef4444; --success:#22c55e;
  --font:'Sora',system-ui,sans-serif;
  --radius:14px; --radius-sm:8px;
  --shadow:0 2px 16px rgba(37,99,235,0.08);
  --shadow-md:0 8px 32px rgba(37,99,235,0.14);
  --tr:0.18s ease;
  --sidebar-w:240px;
  --mheader-h:56px;
  --bnav-h:64px;
  --bg:var(--blue-50);
  --surface:var(--white);
  --border:var(--blue-100);
  --text:#1e3a6e;
  --text-sub:var(--slate-500);
  --text-muted:var(--slate-400);
  --input-bg:var(--blue-50);
}
[data-theme="dark"] {
  --bg:#0f1117; --surface:#1a1d27; --border:rgba(255,255,255,0.08);
  --text:#e2e8f0; --text-sub:#94a3b8; --text-muted:#64748b;
  --input-bg:rgba(255,255,255,0.05);
  --shadow:0 2px 16px rgba(0,0,0,0.3); --shadow-md:0 8px 32px rgba(0,0,0,0.5);
  --blue-50:#1e2a3a; --blue-100:#1e3a5f; --blue-200:#1e4080; --white:#1a1d27;
}

html { font-family:var(--font); -webkit-tap-highlight-color:transparent; font-size:16px; }
body { background:var(--bg); color:var(--text); min-height:100dvh; overflow-x:hidden; transition:background .3s,color .3s; }
.hidden { display:none !important; }

/* ─── AUTH ────────────────────────────────────────────────── */
.screen { display:none; }
.screen.active { display:block; }
#auth-screen { display:none; align-items:center; justify-content:center; min-height:100dvh; padding:16px; position:relative; overflow:hidden; background:linear-gradient(135deg,#eff6ff,#dbeafe); }
[data-theme="dark"] #auth-screen { background:linear-gradient(135deg,#0f1117,#1a1d27); }
#auth-screen.active { display:flex; }

.auth-bg { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.auth-blob { position:absolute; border-radius:50%; filter:blur(70px); opacity:.3; animation:blob-float 8s ease-in-out infinite alternate; }
.blob1 { width:400px; height:400px; background:#bfdbfe; top:-100px; right:-100px; }
.blob2 { width:300px; height:300px; background:#93c5fd; bottom:-80px; left:-80px; animation-delay:-4s; }
@keyframes blob-float { from{transform:scale(1) translateY(0)} to{transform:scale(1.1) translateY(20px)} }

.auth-card { background:var(--surface); border-radius:24px; box-shadow:var(--shadow-md); padding:36px 32px; width:100%; max-width:420px; position:relative; z-index:1; border:1px solid var(--border); }
@media(max-width:480px){ .auth-card{ padding:28px 20px; border-radius:20px; } }

.auth-logo { text-align:center; margin-bottom:28px; }
.logo-text { font-size:26px; font-weight:800; color:var(--text); letter-spacing:-0.03em; display:block; }
.logo-sub { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.1em; }
.accent { color:var(--blue-600); }
.auth-form { display:none; }
.auth-form.active { display:block; }
.auth-form h2 { font-size:20px; font-weight:700; margin-bottom:20px; color:var(--text); }

/* ─── INPUTS ──────────────────────────────────────────────── */
.input-group { margin-bottom:14px; }
.input-group label { display:block; font-size:11px; font-weight:600; color:var(--text-sub); text-transform:uppercase; letter-spacing:.06em; margin-bottom:5px; }
.input-group label i { margin-right:4px; opacity:.7; }
.input-group input,
.input-group select,
.input-group textarea {
  width:100%; padding:12px 14px;
  background:var(--input-bg); border:1.5px solid var(--border);
  border-radius:10px; font-family:var(--font); font-size:15px;
  color:var(--text); outline:none; transition:border-color var(--tr),background var(--tr);
  min-height:48px;
}
.input-group input:focus,.input-group select:focus,.input-group textarea:focus { border-color:var(--blue-600); background:var(--surface); }
.input-group input::placeholder,.input-group textarea::placeholder { color:var(--text-muted); }
.input-group textarea { resize:vertical; min-height:88px; }
.input-group select { cursor:pointer; }

.input-password-wrap { position:relative; }
.input-password-wrap input { padding-right:48px; }
.btn-toggle-pass { position:absolute; right:12px; top:50%; transform:translateY(-50%); background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:16px; padding:6px; min-width:40px; min-height:40px; display:flex; align-items:center; justify-content:center; }
.btn-toggle-pass:hover { color:var(--blue-600); }

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn-primary {
  width:100%; padding:14px; background:linear-gradient(135deg,var(--blue-600),var(--blue-700));
  color:#fff; border:none; border-radius:10px; font-family:var(--font);
  font-size:15px; font-weight:700; cursor:pointer;
  box-shadow:0 4px 16px rgba(37,99,235,.28); transition:all var(--tr);
  margin-bottom:12px; display:flex; align-items:center; justify-content:center; gap:8px;
  min-height:48px;
}
.btn-primary:hover { transform:translateY(-1px); box-shadow:0 6px 20px rgba(37,99,235,.38); }
.btn-primary:active { transform:none; box-shadow:0 2px 8px rgba(37,99,235,.2); }
.btn-primary:disabled { opacity:.6; cursor:not-allowed; transform:none; }

.btn-ghost {
  padding:11px 18px; background:rgba(37,99,235,.07); color:var(--blue-600);
  border:1.5px solid var(--border); border-radius:10px; font-family:var(--font);
  font-size:14px; font-weight:600; cursor:pointer; transition:all var(--tr);
  display:inline-flex; align-items:center; gap:6px; min-height:44px;
}
.btn-ghost:hover { background:rgba(37,99,235,.13); }
.btn-ghost:active { transform:scale(.97); }

.btn-google {
  width:100%; padding:12px; background:var(--surface); border:1.5px solid var(--border);
  border-radius:10px; font-family:var(--font); font-size:14px; font-weight:600;
  color:var(--text-sub); cursor:pointer; display:flex; align-items:center;
  justify-content:center; gap:10px; transition:all var(--tr); margin-bottom:16px; min-height:48px;
}
.btn-google:hover { background:var(--input-bg); }

.auth-switch { font-size:13px; color:var(--text-sub); text-align:center; margin-top:8px; }
.auth-switch a { color:var(--blue-600); text-decoration:none; font-weight:600; }
.form-error { background:rgba(239,68,68,.08); border:1px solid rgba(239,68,68,.2); color:var(--danger); border-radius:8px; padding:10px 14px; font-size:13px; margin-bottom:12px; line-height:1.5; }
.form-success { background:rgba(34,197,94,.08); border:1px solid rgba(34,197,94,.2); color:var(--success); border-radius:8px; padding:10px 14px; font-size:13px; margin-bottom:12px; }

/* ─── APP LAYOUT ──────────────────────────────────────────── */
#app-screen { display:none; }
#app-screen.active { display:flex; min-height:100dvh; }

/* ─── SIDEBAR ─────────────────────────────────────────────── */
#sidebar {
  width:var(--sidebar-w); min-height:100dvh; background:var(--surface);
  border-right:1px solid var(--border); display:flex; flex-direction:column;
  position:fixed; top:0; left:0; z-index:200; transition:transform .25s ease;
  box-shadow:2px 0 20px rgba(37,99,235,.06); overflow-y:auto; overflow-x:hidden;
}
.sidebar-logo { padding:20px 18px 14px; border-bottom:1px solid var(--border); flex-shrink:0; }
.sidebar-logo .logo-text { font-size:20px; }

.sidebar-search { padding:12px 14px; position:relative; flex-shrink:0; }
.sidebar-search i { position:absolute; left:26px; top:50%; transform:translateY(-50%); color:var(--text-muted); font-size:13px; pointer-events:none; }
.sidebar-search input { width:100%; padding:9px 12px 9px 32px; background:var(--input-bg); border:1.5px solid var(--border); border-radius:10px; font-family:var(--font); font-size:13px; color:var(--text); outline:none; transition:border-color var(--tr); min-height:40px; }
.sidebar-search input:focus { border-color:var(--blue-600); }
.sidebar-search input::placeholder { color:var(--text-muted); }

.sidebar-nav { padding:6px 10px; display:flex; flex-direction:column; gap:2px; }
.snav-btn {
  display:flex; align-items:center; gap:11px; padding:11px 12px;
  border:none; border-radius:10px; background:transparent;
  font-family:var(--font); font-size:14px; font-weight:500;
  color:var(--text-sub); cursor:pointer; transition:all var(--tr);
  text-align:left; width:100%; min-height:44px;
}
.snav-btn i { width:18px; text-align:center; font-size:15px; flex-shrink:0; }
.snav-btn:hover { background:var(--input-bg); color:var(--text); }
.snav-btn.active { background:rgba(37,99,235,.1); color:var(--blue-600); font-weight:700; }
.snav-btn.active > i { color:var(--blue-600); }

.sidebar-folders-section { padding:4px 10px 8px; border-top:1px solid var(--border); }
.sidebar-section-label { font-size:10px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.08em; padding:8px 6px 6px; display:flex; align-items:center; gap:6px; }
#sidebar-folders { display:flex; flex-direction:column; gap:2px; }
.folder-nav-btn { font-size:13px !important; }
.folder-edit-btn { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:4px; border-radius:6px; font-size:11px; opacity:0; transition:opacity var(--tr); }
.folder-nav-btn:hover .folder-edit-btn { opacity:1; }

.sidebar-bottom { padding:10px 14px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:8px; flex-shrink:0; }
.sidebar-actions { display:flex; gap:6px; align-items:center; }
.notif-wrap { position:relative; }
.sidebar-user { display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:12px; background:var(--input-bg); border:1px solid var(--border); }
.user-avatar-sm { width:36px; height:36px; border-radius:50%; flex-shrink:0; background:linear-gradient(135deg,var(--blue-500),var(--blue-700)); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:13px; overflow:hidden; border:2px solid var(--border); }
.user-avatar-sm img { width:100%; height:100%; object-fit:cover; }
.sidebar-user-info { flex:1; min-width:0; }
.sidebar-user-info strong { display:block; font-size:13px; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-user-info small { font-size:11px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block; }
.sidebar-icon-btn { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:8px; border-radius:8px; font-size:15px; transition:all var(--tr); flex-shrink:0; min-width:36px; min-height:36px; display:flex; align-items:center; justify-content:center; }
.sidebar-icon-btn:hover { background:var(--input-bg); color:var(--blue-600); }
.icon-btn { background:none; border:none; color:var(--text-sub); cursor:pointer; padding:8px; border-radius:8px; font-size:18px; transition:all var(--tr); min-width:44px; min-height:44px; display:flex; align-items:center; justify-content:center; }
.icon-btn:hover { background:var(--input-bg); color:var(--text); }

#sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:190; backdrop-filter:blur(2px); }
#sidebar-overlay.active { display:block; }
#sidebar.mobile-open { transform:translateX(0) !important; box-shadow:4px 0 40px rgba(0,0,0,.3); }

/* ─── MOBILE HEADER ───────────────────────────────────────── */
#mobile-header {
  display:none; position:fixed; top:0; left:0; right:0; z-index:150;
  height:var(--mheader-h); background:var(--surface); border-bottom:1px solid var(--border);
  align-items:center; justify-content:space-between; padding:0 12px;
  box-shadow:var(--shadow);
}
#mobile-header .logo-text { font-size:18px; }

/* ─── MAIN ────────────────────────────────────────────────── */
#app-main { margin-left:var(--sidebar-w); flex:1; padding:28px 28px 40px; min-height:100dvh; overflow-x:hidden; }

/* ─── TABS ────────────────────────────────────────────────── */
.tab { display:none; animation:tab-in .22s ease; max-width:100%; overflow-x:hidden; }
.tab.active { display:block; }
@keyframes tab-in { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

/* ─── TOOLBAR ─────────────────────────────────────────────── */
.tab-toolbar { display:flex; align-items:center; gap:10px; margin-bottom:18px; flex-wrap:wrap; }
.toolbar-top { display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:center; gap:12px; margin-bottom:12px; }
.toolbar-top .tab-title { font-size:20px; font-weight:800; min-width:0; margin:0; display:flex; align-items:center; gap:10px; color:var(--text); line-height:1.15; }
.toolbar-top .tab-title i { color:var(--blue-600); }
.toolbar-top .btn-icon { margin-left:auto; }
.btn-icon { width:36px; height:36px; border-radius:50%; background:var(--blue-600); color:white; border:none; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:16px; transition:all 0.2s; flex-shrink:0; }
.btn-icon:hover { background:var(--blue-700); transform:scale(1.05); }
.tab-title { font-size:20px; font-weight:800; flex:1; display:flex; align-items:center; gap:10px; color:var(--text); }
.tab-title i { color:var(--blue-600); }
.search-input {
  flex:1; min-width:160px; padding:11px 14px;
  background:var(--surface); border:1.5px solid var(--border);
  border-radius:10px; font-family:var(--font); font-size:14px;
  color:var(--text); outline:none; transition:border-color var(--tr); min-height:46px;
}
.search-input:focus { border-color:var(--blue-600); }
.search-input::placeholder { color:var(--text-muted); }

/* ─── CHIPS ───────────────────────────────────────────────── */
.filter-chips,.folder-chips-bar {
  display:flex; gap:8px; flex-wrap:nowrap; margin-bottom:20px;
  overflow-x:auto; -webkit-overflow-scrolling:touch;
  scrollbar-width:none; padding-bottom:2px;
}
.filter-chips::-webkit-scrollbar,.folder-chips-bar::-webkit-scrollbar { display:none; }
.chip {
  padding:8px 14px; border-radius:20px; border:1.5px solid var(--border);
  background:transparent; font-family:var(--font); font-size:12px; font-weight:600;
  color:var(--text-muted); cursor:pointer; transition:all var(--tr);
  display:inline-flex; align-items:center; gap:6px; white-space:nowrap; min-height:36px; flex-shrink:0;
}
.chip:hover,.chip.active { background:rgba(37,99,235,.1); border-color:var(--blue-600); color:var(--blue-600); }
.folder-chip {
  padding:7px 12px; border-radius:20px; border:1.5px solid var(--border);
  background:transparent; font-family:var(--font); font-size:12px; font-weight:600;
  color:var(--text-muted); cursor:pointer; transition:all var(--tr);
  display:inline-flex; align-items:center; gap:6px; white-space:nowrap; min-height:36px; flex-shrink:0;
}
.folder-chip i { color:var(--fc,#2563eb); }
.folder-chip:hover,.folder-chip.active { background:rgba(37,99,235,.1); border-color:var(--blue-600); color:var(--blue-600); }
.folder-chip-del { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:0 0 0 4px; font-size:11px; display:inline-flex; align-items:center; }
.folder-chip-del:hover { color:var(--danger); }

/* ─── CARDS GRID ──────────────────────────────────────────── */
.cards-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr)); gap:16px; }
.empty-state { grid-column:1/-1; text-align:center; padding:60px 20px; color:var(--text-muted); display:flex; flex-direction:column; align-items:center; gap:14px; font-size:15px; }
.empty-state i { opacity:.3; }

/* ─── CARD ANIMATIONS ─────────────────────────────────────── */
.mat-card,.link-card,.pl-card { animation:card-in .25s ease both; }
@keyframes card-in { from{opacity:0;transform:translateY(12px) scale(.98)} to{opacity:1;transform:none} }

/* ─── MATERIAL CARD ───────────────────────────────────────── */
.mat-card { background:var(--surface); border:1.5px solid var(--border); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow); transition:box-shadow var(--tr),transform var(--tr); overflow:hidden; }
.mat-card:hover { box-shadow:var(--shadow-md); transform:translateY(-3px); }
.mat-card-top { display:flex; align-items:flex-start; gap:12px; margin-bottom:10px; }
.mat-card-icon { font-size:22px; flex-shrink:0; width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; }
.mat-card-name {
  font-weight:700; font-size:14px; color:var(--text); margin-bottom:5px;
  word-break:break-word; overflow-wrap:anywhere;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.mat-card-badge { display:inline-block; font-size:11px; font-weight:700; padding:2px 9px; border-radius:20px; }
.mat-card-tags { display:flex; flex-wrap:wrap; gap:4px; margin:8px 0; }
.tag-pill { font-size:10px; font-weight:600; padding:2px 8px; border-radius:20px; background:var(--input-bg); color:var(--text-sub); border:1px solid var(--border); }
.mat-card-desc { font-size:13px; color:var(--text-sub); line-height:1.5; margin-bottom:12px; }
.mat-card-footer { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; margin-top:4px; }
.mat-card-date { font-size:11px; color:var(--text-muted); }
.mat-card-actions { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.btn-sm { padding:7px 11px; border-radius:8px; font-family:var(--font); font-size:12px; font-weight:600; cursor:pointer; border:1.5px solid var(--border); background:rgba(37,99,235,.06); color:var(--blue-600); transition:all var(--tr); display:inline-flex; align-items:center; gap:5px; min-height:36px; }
.btn-sm:hover { background:rgba(37,99,235,.14); }
.btn-sm.danger { color:var(--danger); border-color:rgba(239,68,68,.2); background:rgba(239,68,68,.05); }
.btn-sm.danger:hover { background:rgba(239,68,68,.1); }
.btn-sm.fav-btn { color:var(--text-muted); border-color:transparent; background:none; }
.btn-sm.fav-btn.active { color:#f59e0b; }
.btn-sm.fav-btn:hover { color:#f59e0b; }

/* ─── LINK CARD ───────────────────────────────────────────── */
.link-card { background:var(--surface); border-radius:var(--radius); padding:16px; box-shadow:var(--shadow); border-left:4px solid var(--blue-600); transition:box-shadow var(--tr),transform var(--tr); }
.link-card:hover { box-shadow:var(--shadow-md); transform:translateY(-3px); }
.link-card-tag { font-size:11px; font-weight:700; padding:2px 9px; border-radius:20px; display:inline-block; margin-bottom:8px; }
.link-card-title { font-weight:700; font-size:15px; color:var(--text); margin-bottom:6px; }
.link-card-desc { font-size:13px; color:var(--text-sub); line-height:1.5; margin-bottom:12px; }
.link-card-footer { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:8px; }
.link-card-date { font-size:11px; color:var(--text-muted); }

/* ─── PLAYLIST CARD ───────────────────────────────────────── */
.pl-card { background:var(--surface); border:1.5px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); transition:box-shadow var(--tr),transform var(--tr); }
.pl-card:hover { box-shadow:var(--shadow-md); transform:translateY(-3px); }
.pl-card-thumb { position:relative; cursor:pointer; background:var(--blue-100); aspect-ratio:16/9; overflow:hidden; }
.pl-card-thumb img { width:100%; height:100%; object-fit:cover; display:block; transition:transform .3s ease; }
.pl-card-thumb:hover img { transform:scale(1.04); }
.pl-card-play { position:absolute; inset:0; background:rgba(0,0,0,.35); display:flex; align-items:center; justify-content:center; transition:background var(--tr); }
.pl-card-thumb:hover .pl-card-play { background:rgba(0,0,0,.5); }
.play-icon { width:52px; height:52px; border-radius:50%; background:rgba(37,99,235,.9); display:flex; align-items:center; justify-content:center; color:#fff; font-size:18px; transition:transform .2s; }
.pl-card-thumb:hover .play-icon { transform:scale(1.1); }
.pl-card-count { position:absolute; top:10px; right:10px; background:rgba(0,0,0,.65); color:#fff; font-size:11px; padding:3px 8px; border-radius:6px; display:flex; align-items:center; gap:5px; }
.pl-card-body { padding:14px 16px; }
.pl-card-name { font-weight:700; font-size:15px; color:var(--text); margin-bottom:4px; }
.pl-card-desc { font-size:13px; color:var(--text-sub); margin-bottom:12px; line-height:1.4; }
.pl-card-actions { display:flex; gap:8px; }

/* ─── DASHBOARD ───────────────────────────────────────────── */
.dashboard-greeting { margin-bottom:24px; }
.dashboard-greeting h1 { font-size:24px; font-weight:800; color:var(--text); margin-bottom:4px; }
.dash-sub { color:var(--text-sub); font-size:14px; }
.stats-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; margin-bottom:28px; }
.stat-card { background:var(--surface); border:1.5px solid var(--border); border-radius:var(--radius); padding:16px; display:flex; align-items:center; gap:14px; box-shadow:var(--shadow); cursor:pointer; transition:all var(--tr); }
.stat-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.stat-icon { width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.stat-num { font-size:26px; font-weight:800; color:var(--blue-600); line-height:1; }
.stat-label { font-size:12px; color:var(--text-muted); margin-top:2px; }
.dash-sections { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.dash-section h3 { font-size:14px; font-weight:700; color:var(--text); margin-bottom:12px; display:flex; align-items:center; gap:8px; }
.dash-section h3 i { color:var(--blue-600); }
.recent-list { display:flex; flex-direction:column; gap:8px; }
.recent-item { background:var(--surface); border:1.5px solid var(--border); border-radius:10px; padding:12px 14px; display:flex; align-items:center; gap:12px; cursor:pointer; transition:all var(--tr); }
.recent-item:hover { border-color:var(--blue-400); box-shadow:var(--shadow); }
.recent-item-icon { font-size:18px; width:36px; height:36px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.recent-item-name { font-size:13px; font-weight:600; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.recent-item-meta { font-size:11px; color:var(--text-muted); margin-top:2px; }

/* ─── PLAYER ──────────────────────────────────────────────── */
.player-layout { display:grid; grid-template-columns:1fr 300px; gap:20px; align-items:start; }
.player-frame-wrap { border-radius:14px; overflow:hidden; background:#000; aspect-ratio:16/9; }
#yt-player { width:100%; height:100%; border:none; display:block; }
.player-info { padding:14px 0; }
.player-info h3 { font-size:17px; font-weight:700; color:var(--text); margin-bottom:4px; }
.player-info p { font-size:13px; color:var(--text-sub); }
.player-queue { max-height:500px; overflow-y:auto; background:var(--surface); border-radius:var(--radius); border:1.5px solid var(--border); padding:12px; }
.queue-label { font-size:11px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; margin-bottom:10px; display:flex; align-items:center; gap:6px; }
.queue-item { display:flex; gap:10px; padding:8px; border-radius:10px; cursor:pointer; margin-bottom:6px; border:1.5px solid transparent; transition:all var(--tr); }
.queue-item:hover { background:var(--input-bg); }
.queue-item.active { background:rgba(37,99,235,.09); border-color:rgba(37,99,235,.2); }
.queue-thumb { width:68px; height:48px; border-radius:6px; object-fit:cover; flex-shrink:0; }
.queue-title { font-size:13px; color:var(--text-sub); line-height:1.4; }
.queue-item.active .queue-title { color:var(--blue-600); font-weight:600; }
.queue-num { font-size:11px; color:var(--text-muted); margin-top:4px; }
.btn-back { background:none; border:none; color:var(--blue-600); font-family:var(--font); font-size:14px; font-weight:600; cursor:pointer; padding:0; margin-bottom:20px; display:inline-flex; align-items:center; gap:6px; min-height:44px; }

/* ─── BOTTOM NAV ──────────────────────────────────────────── */
.bottom-nav { display:none; position:fixed; bottom:0; left:0; right:0; z-index:100; height:var(--bnav-h); background:var(--surface); border-top:1px solid var(--border); align-items:center; justify-content:space-around; padding-bottom:env(safe-area-inset-bottom); box-shadow:0 -4px 20px rgba(37,99,235,.08); }
.bnav-btn { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; background:none; border:none; cursor:pointer; font-family:var(--font); color:var(--text-muted); padding:8px 4px; transition:color var(--tr); min-height:var(--bnav-h); }
.bnav-btn i { font-size:20px; transition:transform .2s; }
.bnav-btn.active i { transform:translateY(-1px); }
.bnav-btn small { font-size:10px; font-weight:600; }
.bnav-btn.active { color:var(--blue-600); }

/* ─── MODALS ──────────────────────────────────────────────── */
.modal-overlay { position:fixed; inset:0; background:rgba(15,17,30,.55); backdrop-filter:blur(6px); z-index:300; display:flex; align-items:center; justify-content:center; padding:16px; animation:fade-in .15s ease; }
@keyframes fade-in { from{opacity:0} to{opacity:1} }

.modal { background:var(--surface); border-radius:20px; width:100%; max-width:500px; max-height:90dvh; overflow-y:auto; box-shadow:0 24px 64px rgba(0,0,0,.25); animation:modal-in .18s ease; border:1px solid var(--border); }
.modal-large { max-width:820px; }
@keyframes modal-in { from{opacity:0;transform:translateY(16px) scale(.97)} to{opacity:1;transform:none} }

.modal-header { display:flex; align-items:center; justify-content:space-between; padding:20px 20px 0; }
.modal-header h3 { font-size:17px; font-weight:700; color:var(--text); display:flex; align-items:center; gap:8px; }
.modal-header h3 i { color:var(--blue-600); }
.modal-close { background:var(--input-bg); border:none; border-radius:8px; width:36px; height:36px; color:var(--text-muted); cursor:pointer; transition:all var(--tr); display:flex; align-items:center; justify-content:center; font-size:16px; }
.modal-close:hover { background:var(--border); color:var(--text); }
.modal-body { padding:18px 20px; }
.modal-hint { font-size:13px; color:var(--text-sub); margin-bottom:16px; background:var(--input-bg); padding:10px 14px; border-radius:8px; border-left:3px solid var(--blue-400); line-height:1.5; }
.modal-hint i { margin-right:5px; color:var(--blue-500); }
.modal-footer { padding:0 20px 20px; display:flex; justify-content:flex-end; gap:10px; }
.modal-footer .btn-primary { width:auto; margin-bottom:0; }
.section-label { display:block; font-size:12px; font-weight:700; color:var(--text-sub); text-transform:uppercase; letter-spacing:.06em; margin-bottom:10px; padding-top:4px; }
.section-label i { margin-right:5px; }
.playlist-add-video { border-top:1.5px solid var(--border); padding-top:16px; margin-top:4px; }
#pl-video-list { display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.vid-item { display:flex; align-items:center; gap:10px; padding:8px 12px; background:var(--input-bg); border-radius:8px; border:1px solid var(--border); }
.vid-item img { width:56px; height:40px; border-radius:5px; object-fit:cover; flex-shrink:0; }
.vid-item-title { font-size:13px; color:var(--text); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vid-item-remove { background:none; border:none; color:var(--danger); cursor:pointer; font-size:18px; padding:4px; flex-shrink:0; min-width:36px; min-height:36px; display:flex; align-items:center; justify-content:center; }

/* ─── NOTIFICATIONS (CENTERED MODAL) ─────────────────────── */
.notif-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  max-width: 92vw;
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 32px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.4);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.notif-panel.hidden { display: none; }
.notif-header { 
  padding: 25px 30px; 
  font-size: 20px; 
  font-weight: 900; 
  background: var(--surface-sunken); 
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#notif-list { padding: 15px; overflow-y: auto; flex: 1; }
.notif-item {
  display: flex; gap: 15px; padding: 20px; border-radius: 20px;
  background: var(--surface); border: 1.5px solid var(--border);
  margin-bottom: 12px; transition: all 0.2s; cursor: pointer;
}
.notif-item:hover { border-color: var(--blue-600); background: var(--blue-50); transform: translateX(5px); }
.notif-item.unread { border-color: var(--blue-300); background: rgba(37,99,235,0.06); }
.notif-icon { width: 44px; height: 44px; border-radius: 14px; background: var(--blue-600); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.notif-msg { font-size: 14px; line-height: 1.5; color: var(--text); font-weight: 500; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 6px; font-weight: 700; text-transform: uppercase; }

/* ─── COMMUNITY & USER CARDS ──────────────────────────────── */
.user-card {
  background: var(--surface); border-radius: 28px; border: 1.5px solid var(--border);
  padding: 25px; display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); cursor: pointer; position: relative;
}
.user-card:hover { transform: translateY(-10px); border-color: var(--blue-600); box-shadow: 0 15px 35px rgba(37,99,235,0.15); }
.user-card-avatar { width: 100px; height: 100px; border-radius: 35px; object-fit: cover; margin-bottom: 15px; border: 4px solid var(--border); }
.user-card-name { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 5px; }
.user-card-course { font-size: 12px; font-weight: 700; color: var(--blue-600); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 15px; }
.user-card-badges { display: flex; gap: 6px; justify-content: center; margin-bottom: 15px; }
.min-badge { width: 24px; height: 24px; border-radius: 50%; opacity: 0.4; filter: grayscale(1); }
.min-badge.unlocked { opacity: 1; filter: none; }
.user-card-exp { font-size: 13px; font-weight: 800; color: var(--text-muted); padding: 5px 15px; background: var(--surface-sunken); border-radius: 12px; }

/* ─── RANKING ─────────────────────────────────────────────── */
.ranking-item {
  display: flex; align-items: center; gap: 15px; padding: 15px; border-radius: 18px;
  transition: background 0.2s; border: 1px solid transparent;
}
.ranking-item:hover { background: var(--blue-50); border-color: var(--blue-100); }
.rank-num { font-size: 18px; font-weight: 900; width: 30px; color: var(--blue-600); font-family: 'Inter', sans-serif; }
.rank-avatar { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 14px; font-weight: 800; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-exp { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.rank-medal { font-size: 20px; }

/* ─── FOLDERS MODAL ───────────────────────────────────────── */
.color-picker-row { display:flex; gap:10px; flex-wrap:wrap; padding:4px 0; }
.color-dot { width:32px; height:32px; border-radius:50%; border:3px solid transparent; cursor:pointer; transition:transform var(--tr),border-color var(--tr); }
.color-dot:hover { transform:scale(1.15); }
.color-dot.selected { border-color:var(--text); box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--text); transform:scale(1.1); }

/* ─── PROFILE MODAL ───────────────────────────────────────── */
.profile-avatar-section { display:flex; align-items:center; gap:16px; margin-bottom:20px; padding:16px; background:var(--input-bg); border-radius:14px; border:1px solid var(--border); }
.profile-avatar-big { width:72px; height:72px; border-radius:50%; flex-shrink:0; background:linear-gradient(135deg,var(--blue-500),var(--blue-700)); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:800; font-size:24px; overflow:hidden; border:3px solid var(--border); box-shadow:var(--shadow); }
.profile-avatar-info { min-width:0; }

/* ─── NOTIFS PANEL ────────────────────────────────────────── */
#notif-panel {
  position:fixed; top:50%; left:50%; transform:translate(-50%, -50%);
  width:90%; max-width:440px; background:var(--surface);
  border-radius:24px; box-shadow:0 24px 80px rgba(0,0,0,0.4); z-index:2500;
  display:flex; flex-direction:column; max-height:80vh;
  border:1px solid rgba(255,255,255,0.1); overflow:hidden;
  animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#notif-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.5); backdrop-filter:blur(4px);
  z-index:2400; display:none;
}
#notif-overlay.active { display:block; }
.notif-header { padding:20px 24px; border-bottom:1px solid var(--border); display:flex; justify-content:space-between; align-items:center; }
.notif-header h3 { font-size:18px; font-weight:800; }
#notif-list { overflow-y:auto; padding:10px; }
.notif-item { display:flex; gap:12px; padding:16px; border-radius:14px; transition:background 0.2s; cursor:default; }
.notif-item.unread { background:rgba(37,99,235,0.04); }
.notif-icon { width:40px; height:40px; border-radius:12px; background:var(--white); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; color:var(--blue-600); flex-shrink:0; }
.notif-msg { font-size:13px; line-height:1.4; color:var(--text); font-weight:600; margin-bottom:4px; }
.notif-time { font-size:11px; color:var(--text-muted); }
.notif-empty { text-align:center; padding:50px 20px; color:var(--text-muted); }
.notif-empty i { font-size:32px; margin-bottom:10px; display:block; }

/* ─── TOAST ───────────────────────────────────────────────── */
.toast { position:fixed; bottom:calc(var(--bnav-h) + 16px); left:50%; transform:translateX(-50%); background:#1e3a6e; color:#fff; padding:12px 22px; border-radius:12px; font-size:14px; font-weight:600; box-shadow:0 8px 24px rgba(0,0,0,.25); z-index:500; pointer-events:none; animation:toast-in .2s ease; display:flex; align-items:center; gap:8px; white-space:nowrap; }
[data-theme="dark"] .toast { background:var(--blue-600); }
@keyframes toast-in { from{opacity:0;transform:translateX(-50%) translateY(8px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }

/* ─── SPINNER ─────────────────────────────────────────────── */
.spinner { width:18px; height:18px; border:2.5px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; display:inline-block; vertical-align:middle; flex-shrink:0; }
@keyframes spin { to{transform:rotate(360deg)} }

/* ─── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--blue-200); border-radius:4px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background:rgba(255,255,255,.1); }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */

/* ── Desktop ──────────────────────────────────────────── */
@media(min-width:901px) {
  #mobile-header { display:none; }
  .bottom-nav { display:none !important; }
  .toast { bottom:24px; }
}

/* ── Tablet ─────────────────────────────────────────── */
@media(max-width:1024px) {
  #app-main { padding:24px 20px 40px; }
  .dash-sections { grid-template-columns:1fr; }
  .player-layout { grid-template-columns:1fr; }
  .player-queue { max-height:280px; }
}

/* ── Mobile ─────────────────────────────────────────── */
@media(max-width:900px) {
  #sidebar { transform:translateX(-100%); }
  #mobile-header { display:flex; }
  .bottom-nav { display:flex; }

  #app-main {
    margin-left:0;
    padding:calc(var(--mheader-h) + 16px) 14px calc(var(--bnav-h) + 24px);
  }

  .tab-title { font-size:17px; }
  .cards-grid { grid-template-columns:1fr; }
  .stats-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .stat-card { padding:14px; }
  .stat-num { font-size:22px; }
  .dashboard-greeting h1 { font-size:20px; }
  .dash-sections { grid-template-columns:1fr; }
  .filter-chips,.folder-chips-bar { flex-wrap:nowrap; overflow-x:auto; }
  .tab-toolbar { gap:8px; }
  .player-layout { grid-template-columns:1fr; gap:12px; }
  .player-queue { max-height:220px; }
  .toast { bottom:calc(var(--bnav-h) + 12px); font-size:13px; padding:10px 18px; }

  /* Notif panel: fixo no topo no mobile */
  .notif-panel {
    position:fixed;
    top:calc(var(--mheader-h) + 8px);
    right:12px; left:12px;
    width:auto; max-width:100%;
    bottom:auto; max-height:60dvh;
    border-radius:16px; z-index:500;
  }

  /* Modais sobem como bottom sheet */
  .modal-overlay { align-items:flex-end; padding:0; }
  .modal { border-radius:20px 20px 0 0; max-height:92dvh; animation:modal-slide-up .22s ease; }
  .modal-large { border-radius:20px 20px 0 0; max-width:100%; max-height:96dvh; }
  #view-iframe { height:65dvh !important; }
  @keyframes modal-slide-up { from{transform:translateY(100%)} to{transform:none} }

  /* Material card: ações ficam abaixo */
  .mat-card-footer { flex-direction:column; align-items:flex-start; }
  .mat-card-actions { width:100%; justify-content:flex-end; flex-wrap:wrap; }
  .mat-card-actions .btn-sm { padding:6px 10px; font-size:12px; min-height:34px; }
  .mat-card-actions a { display:contents; }
}

/* ── Toolbar mobile ─────────────────────────────────── */
@media(max-width:600px) {
  .tab-toolbar { flex-wrap:wrap; margin-bottom:12px; }
  .tab-toolbar .tab-title { flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .tab-toolbar .btn-primary { padding:9px 14px; font-size:13px; }
  .search-input { width:100%; }
  .chip,.folder-chip { flex-shrink:0; font-size:12px; padding:6px 12px; }
}

/* ── Telas pequenas ─────────────────────────────────── */
@media(max-width:400px) {
  .auth-card { padding:24px 16px; }
  .stats-grid { grid-template-columns:1fr 1fr; }
  .stat-num { font-size:20px; }
  .tab-title { font-size:15px; }
  .btn-primary { font-size:14px; }
  #app-main { padding-left:12px; padding-right:12px; }
}

/* ─── REDACAO FULL VIEW ────────────────────────────────────── */
.reda-full-grid { display: grid; grid-template-columns: 380px 1fr; gap: 40px; margin-top: 30px; align-items: start; }
.reda-full-side { position: relative; top: auto; }
.reda-full-title-display { font-size: 1.4rem; font-weight: 800; color: var(--blue-700); margin-bottom: 24px; line-height: 1.4; border-bottom: 3px solid var(--blue-100); padding-bottom: 12px; }
.reda-full-text-display { background: var(--surface); padding: 32px; border-radius: 20px; border: 1px solid var(--border); line-height: 2; color: var(--text); font-family: 'Inter', sans-serif; box-shadow: var(--shadow-sm); white-space: pre-wrap; font-size: 15px; letter-spacing: 0.01em; }
.reda-full-main { background: var(--surface); border-radius: 20px; border: 1px solid var(--border); padding: 40px 50px; box-shadow: var(--shadow-md); }
.reda-full-correction-display { color: var(--text); line-height: 1.8; }
.reda-full-correction-display h3 { margin: 40px 0 20px; font-size: 1.5rem; color: var(--blue-600); border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.reda-full-correction-display h4 { margin: 30px 0 15px; font-size: 1.2rem; color: var(--text); }
.reda-full-correction-display p { margin-bottom: 20px; }
.reda-full-correction-display ul, .reda-full-correction-display ol { margin-bottom: 25px; padding-left: 30px; }
.reda-full-correction-display li { margin-bottom: 12px; }
.reda-full-correction-display hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.pos-mark { background-color: rgba(34, 197, 94, 0.2); border-bottom: 2px solid #22c55e; padding: 2px 0; border-radius: 2px; color: #166534; font-weight: 600; }
.neg-mark { background-color: rgba(239, 68, 68, 0.15); border-bottom: 2px solid #ef4444; padding: 2px 0; border-radius: 2px; color: #991b1b; font-weight: 600; }

/* ─── INSIGNIA PROFILE ──────────────────────────────────────── */
.insignia-box { cursor: pointer; }
.insignia-box:hover { transform: translateY(-4px) !important; }
.insignia-box.locked { cursor: not-allowed; }
.insignia-box.locked:hover { transform: none !important; }

/* ─── PROFILE PAGE ──────────────────────────────────────────── */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.profile-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.profile-card-header i { color: var(--blue-600); }

.profile-card .input-group { margin-bottom: 12px; }
.profile-card .input-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  display: block;
  margin-bottom: 6px;
}
.profile-card .input-group input,
.profile-card .input-group textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  transition: all 0.2s;
}
.profile-card .input-group input:focus,
.profile-card .input-group textarea:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.profile-hint {
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 12px;
  background: var(--input-bg);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-hint i { color: var(--blue-500); }

.insignia-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.insignia-grid .insignia-box {
  padding: 12px 6px;
  border-radius: 14px;
}

.stats-grid-profile {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-item-profile {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 10px;
  text-align: center;
}
.stat-num-profile {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: var(--blue-600);
  line-height: 1;
}
.stat-label-profile {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── CONQUEST TOAST ───────────────────────────────────────── */
.conquest-toast {
  position: fixed;
  top: 30px;
  right: 30px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 16px 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 40px rgba(245,158,11,0.5);
  z-index: 1000;
  animation: conquest-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.conquest-toast.hidden { display: none; }
@keyframes conquest-in {
  from { opacity: 0; transform: translateX(100px) scale(0.8); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
.conquest-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  animation: trophy-bounce 0.6s ease infinite;
}
@keyframes trophy-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.conquest-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
}
.conquest-name {
  font-size: 18px;
  font-weight: 900;
  margin-top: 2px;
}

/* ─── COMMUNITY X-STYLE ─────────────────────────────────────── */
.community-layout {
  display: grid;
  grid-template-columns: 240px 1fr 300px;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100dvh - 100px);
}

.community-sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
  padding: 20px;
  border-right: 1px solid var(--border);
}

.comm-sidebar-logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.comm-sidebar-logo i { color: var(--blue-600); }

.comm-nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 30px; }

.comm-nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: none;
  background: transparent;
  border-radius: 30px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.comm-nav-btn i { font-size: 18px; width: 24px; }
.comm-nav-btn:hover { background: var(--input-bg); color: var(--text); }
.comm-nav-btn.active { background: var(--blue-50); color: var(--blue-600); font-weight: 800; }
.comm-nav-btn.active i { color: var(--blue-600); }

.comm-trending {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.comm-trending-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.comm-trending-title i { color: #f59e0b; }
.trending-topic {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-600);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}
.trending-topic:hover { background: var(--blue-50); }

.community-feed {
  border-right: 1px solid var(--border);
  min-height: calc(100dvh - 100px);
}

/* Mobile community header */
.comm-mobile-header {
  display: none;
  position: sticky;
  top: 50px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  z-index: 9;
}

.comm-mobile-nav {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.comm-mobile-nav-btn {
  flex: 1;
  padding: 14px;
  border: none;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}

.comm-mobile-nav-btn.active {
  color: var(--text);
  border-bottom-color: var(--blue-600);
  font-weight: 800;
}

@media (max-width: 768px) {
  .comm-mobile-header {
    display: block;
  }
}

.comm-feed-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  z-index: 10;
}

.comm-feed-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.comm-feed-title i { color: var(--blue-600); }

.comm-search-box { position: relative; }
.comm-search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.comm-search-box input {
  width: 100%;
  padding: 14px 14px 14px 44px;
  background: var(--input-bg);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  transition: all 0.2s;
}
.comm-search-box input:focus {
  border-color: var(--blue-500);
  background: var(--surface);
  outline: none;
}

.comm-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.comm-tab {
  flex: 1;
  padding: 16px;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.comm-tab:hover { background: var(--input-bg); }
.comm-tab.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }

.users-feed-list { padding: 0; }

.user-feed-item {
  display: flex;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.user-feed-item:hover { background: var(--input-bg); }
.user-feed-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-feed-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.user-feed-content { flex: 1; min-width: 0; }
.user-feed-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.user-feed-username { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.user-feed-course {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-600);
  text-transform: uppercase;
  margin-top: 4px;
  letter-spacing: 0.5px;
}
.user-feed-exp {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.user-feed-exp i { color: #f59e0b; }

.community-sidebar-right {
  padding: 20px;
  position: sticky;
  top: 80px;
  height: fit-content;
}

.comm-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}
.comm-widget-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.comm-widget-title i { color: var(--blue-600); }

.comm-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comm-stat-item { text-align: center; padding: 12px; background: var(--input-bg); border-radius: 12px; }
.comm-stat-num { display: block; font-size: 20px; font-weight: 900; color: var(--blue-600); }
.comm-stat-label { display: block; font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-top: 4px; }

.comm-top-list { display: flex; flex-direction: column; gap: 12px; }
.comm-top-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  transition: background 0.2s;
  cursor: pointer;
}
.comm-top-item:hover { background: var(--input-bg); }
.comm-top-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
}
.comm-top-rank.gold { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.comm-top-rank.silver { background: linear-gradient(135deg, #9ca3af, #6b7280); color: white; }
.comm-top-rank.bronze { background: linear-gradient(135deg, #d97706, #b45309); color: white; }
.comm-top-rank.other { background: var(--input-bg); color: var(--text-muted); }
.comm-top-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.comm-top-info { flex: 1; min-width: 0; }
.comm-top-name { font-size: 13px; font-weight: 800; color: var(--text); }
.comm-top-exp { font-size: 11px; font-weight: 700; color: var(--text-muted); }

.comm-widget-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ─── PROFILE RESPONSIVE ────────────────────────────────────── */
@media (max-width: 900px) {
  .profile-page-content { padding: 16px !important; }
  .profile-page-content > div { grid-template-columns: 1fr !important; }
  .profile-avatar-wrapper { top: -55px !important; }
  .profile-avatar-ring { width: 100px !important; height: 100px !important; }
  .profile-avatar-wrapper > div:first-child { margin-left: 0 !important; }
  .profile-page-content > div > div:first-child { margin-left: 130px !important; }
  .stats-grid-profile { grid-template-columns: repeat(2, 1fr) !important; }
  .insignia-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

@media (max-width: 900px) {
  .reda-full-grid { grid-template-columns: 1fr; }
  .reda-full-side { position: static; }
}

/* ─── MOBILE PROFILE X-STYLE ────────────────────────────────────── */
@media (max-width: 768px) {
  .profile-page-content { padding: 0 !important; }
  .profile-page-content > div { grid-template-columns: 1fr !important; gap: 0 !important; }
  
  .profile-page-content > div:first-child {
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  .profile-avatar-wrapper {
    position: absolute !important;
    top: -50px !important;
    left: 12px !important;
  }
  
  .profile-avatar-ring { width: 80px !important; height: 80px !important; }
  .profile-avatar-inner img, #prof-avatar-preview { width: 100% !important; height: 100% !important; }
  #prof-initials { font-size: 28px !important; }
  
  .profile-avatar-wrapper > div:first-child { margin-left: 0 !important; }
  .profile-page-content > div > div:first-child { margin-left: 100px !important; padding-top: 0 !important; }
  
  #prof-level-display { padding: 4px 10px !important; font-size: 10px !important; }
  #prof-exp-text-header { font-size: 10px !important; }
  #prof-exp-bar { height: 6px !important; }
  
  .profile-avatar-edit { width: 28px !important; height: 28px !important; }
  
  .stats-grid-profile { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stat-item-profile { padding: 12px !important; }
  .stat-num-profile { font-size: 20px !important; }
  .stat-label-profile { font-size: 11px !important; }
  
  .insignia-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px !important; }
  .insignia-box { padding: 8px 4px !important; }
  .insignia-box img { width: 32px !important; height: 32px !important; }
  .insignia-box div { font-size: 8px !important; }
  
  .profile-card { margin-bottom: 12px !important; border-radius: 12px !important; }
  .profile-card-header { padding: 12px !important; font-size: 14px !important; }
  .profile-card .input-group { margin-bottom: 10px !important; }
  .profile-card .input-group label { font-size: 12px !important; }
  .profile-card .input-group input,
  .profile-card .input-group textarea { padding: 10px !important; font-size: 14px !important; }
  
  #btn-save-profile { width: 100% !important; margin-top: 10px !important; }
  
  #prof-level-display, #prof-exp-bar, #prof-exp-text-header { display: none !important; }
}

/* ─── MOBILE COMMUNITY X-STYLE ───────────────────────────────────── */
@media (max-width: 768px) {
  .community-layout {
    grid-template-columns: 1fr !important;
    display: block !important;
    min-height: auto !important;
  }
  
  .community-sidebar {
    display: none !important;
  }
  
  .community-sidebar-right {
    display: none !important;
  }
  
  .community-feed {
    border-right: none !important;
    min-height: auto !important;
    padding-bottom: 80px !important;
  }
  
  .comm-feed-header {
    position: relative !important;
    top: auto !important;
    padding: 12px !important;
  }
  
  .comm-feed-title {
    font-size: 16px !important;
    margin-bottom: 12px !important;
  }
  
  .comm-search-box {
    height: 36px !important;
  }
  
  .comm-search-box input {
    font-size: 14px !important;
  }
  
  .comm-tabs {
    display: flex !important;
    border-bottom: 1px solid var(--border) !important;
  }
  
  .comm-tab {
    flex: 1 !important;
    padding: 14px !important;
    font-size: 14px !important;
  }
  
  .user-feed-item {
    padding: 12px !important;
    gap: 12px !important;
  }
  
  .user-feed-avatar, .user-feed-avatar-placeholder {
    width: 44px !important;
    height: 44px !important;
    font-size: 14px !important;
    flex-shrink: 0 !important;
  }
  
  .user-feed-name {
    font-size: 15px !important;
  }
  
  .user-feed-username {
    font-size: 13px !important;
  }
  
  .user-feed-course {
    font-size: 13px !important;
    margin-bottom: 4px !important;
  }
  
  .user-feed-exp {
    font-size: 12px !important;
  }
}

/* ─── MOBILE REDACAO CORRECTION ─────────────────────────────────── */
@media (max-width: 768px) {
  #tab-redacao-view .tab-toolbar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 14px 16px !important;
  }
  
  #tab-redacao-view .tab-toolbar h2 {
    font-size: 16px !important;
    margin: 0 !important;
    width: auto !important;
    text-align: left !important;
  }
  
  #tab-redacao-view .tab-toolbar .btn-ghost {
    width: auto !important;
    min-width: 108px !important;
    justify-content: center !important;
    margin: 0 !important;
  }
  
  .reda-full-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 12px !important;
  }
  
  .reda-full-side {
    order: 2 !important;
  }
  
  .reda-full-main {
    order: 1 !important;
  }
  
  .reda-v-meta {
    flex-wrap: wrap !important;
    font-size: 11px !important;
  }
  
  .reda-full-title-display {
    font-size: 18px !important;
    margin-bottom: 12px !important;
  }
  
  .reda-full-text-display {
    padding: 12px !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    max-height: 200px !important;
    overflow-y: auto !important;
  }
  
  .reda-full-main > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    margin-bottom: 18px !important;
  }
  
  .reda-full-main h3 {
    font-size: 16px !important;
    margin: 0 !important;
    text-align: center !important;
  }
  
  .reda-full-main > div:first-child > div {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .reda-full-main .btn-ghost {
    width: 100% !important;
    justify-content: center !important;
    font-size: 12px !important;
    padding: 10px 12px !important;
    min-height: 48px !important;
    margin: 0 !important;
  }
  
  #reda-v-map-container {
    padding: 12px !important;
  }
  
  #reda-v-map-container h4 {
    font-size: 14px !important;
  }
  
  .reda-full-correction-display {
    padding: 12px !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
  }
  
  .correction-section {
    margin-bottom: 16px !important;
    padding: 12px !important;
  }
  
  .correction-section h4 {
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }
  
  .correction-section p {
    font-size: 13px !important;
    line-height: 1.6 !important;
  }
  
  .score-badge {
    font-size: 12px !important;
    padding: 4px 8px !important;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .profile-avatar-wrapper {
    top: -40px !important;
  }
  
  .profile-avatar-ring {
    width: 64px !important;
    height: 64px !important;
  }
  
  #prof-initials {
    font-size: 22px !important;
  }
  
  .profile-page-content > div > div:first-child {
    margin-left: 80px !important;
  }
  
  .stats-grid-profile {
    grid-template-columns: 1fr 1fr !important;
  }
  
  .insignia-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  
  .user-feed-avatar, .user-feed-avatar-placeholder {
    width: 40px !important;
    height: 40px !important;
  }
  
  .comm-mobile-nav-btn {
    font-size: 12px !important;
    padding: 12px 8px !important;
  }
}

/* Mobile toolbar improvements */
@media (max-width: 768px) {
  .tab-toolbar {
    flex-direction: column !important;
    gap: 10px !important;
    padding: 12px !important;
    position: relative !important;
    top: auto !important;
    background: var(--surface) !important;
    z-index: 20 !important;
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    margin-bottom: 18px !important;
  }
  
  .tab-toolbar .tab-title {
    font-size: 16px !important;
    width: 100% !important;
    text-align: center !important;
  }
  
  .tab-toolbar .btn-primary,
  .tab-toolbar .btn-ghost {
    width: 100% !important;
    justify-content: center !important;
  }
  
  .cards-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 12px !important;
  }
  
  .card {
    padding: 14px !important;
  }
  
  .input-group input,
  .input-group textarea {
    padding: 12px !important;
    font-size: 14px !important;
  }
}

/* ─── MOBILE ARENA PVP ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #tab-duelo > div:first-of-type {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 12px !important;
  }
  
  #tab-duelo h3 {
    font-size: 16px !important;
    margin-bottom: 12px !important;
  }
  
  #tab-duelo > div > div:last-child {
    order: -1;
    padding: 12px !important;
  }
  
  #duel-game-area {
    padding: 12px !important;
  }
  
  #duel-game-area > div {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  #btn-cancel-duel-top {
    position: static !important;
    width: 100% !important;
    margin-bottom: 12px !important;
  }
  
  #duel-lobby-screen {
    padding: 24px !important;
    border-radius: 16px !important;
  }
  
  #lobby-match-title {
    font-size: 20px !important;
    margin-bottom: 24px !important;
  }
  
  #duel-lobby-screen > div:first-child {
    font-size: 12px !important;
    padding: 8px 14px !important;
  }
  
  #duel-lobby-screen > div:nth-child(2) {
    flex-direction: column !important;
    gap: 16px !important;
  }
  
  .lobby-player img {
    width: 80px !important;
    height: 80px !important;
    border-radius: 20px !important;
  }
  
  #duel-lobby-screen > div:nth-child(2) > div:nth-child(2) {
    font-size: 24px !important;
  }
  
  .lobby-player {
    text-align: center;
  }
  
  #lobby-p1-name, #lobby-p2-name {
    font-size: 14px !important;
  }
  
  #lobby-p1-status, #lobby-p2-status {
    font-size: 12px !important;
  }
  
  #btn-ready-duel {
    width: 100% !important;
    padding: 16px 24px !important;
    font-size: 16px !important;
    border-radius: 14px !important;
  }
  
  #duel-playing-screen {
    padding: 20px !important;
    border-radius: 16px !important;
  }
  
  #duel-playing-screen > div:first-child {
    position: static !important;
    margin-bottom: 16px !important;
    font-size: 11px !important;
    padding: 8px 16px !important;
  }
  
  #duel-playing-screen > div:nth-child(2) {
    flex-direction: column !important;
    gap: 16px !important;
    padding-bottom: 20px !important;
    border-bottom: 1px dashed var(--border) !important;
  }
  
  #duel-timer {
    font-size: 28px !important;
    padding: 8px 14px !important;
  }
  
  #duel-playing-screen > div:nth-child(2) > div:last-child {
    text-align: left !important;
  }
  
  #duel-score {
    font-size: 24px !important;
  }
  
  #duel-q-idx {
    font-size: 14px !important;
  }
  
  #duel-question {
    font-size: 18px !important;
    margin-bottom: 20px !important;
  }
  
  #duel-options {
    gap: 10px !important;
  }
  
  .duel-option {
    padding: 14px !important;
    font-size: 14px !important;
  }
}

/* ─── FIX PROFILE MOBILE ───────────────────────────────────────── */
@media (max-width: 768px) {
  #tab-profile .tab-toolbar {
    position: relative !important;
    top: auto !important;
    z-index: 20 !important;
  }
  
  #tab-profile .tab-toolbar .tab-title {
    font-size: 16px !important;
  }
  
  #tab-profile .tab-toolbar #btn-save-profile {
    position: fixed !important;
    bottom: 70px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    z-index: 30 !important;
    padding: 14px !important;
    font-size: 15px !important;
  }
  
  #tab-profile > div {
    padding: 0 !important;
    max-width: 100% !important;
  }
  
  #tab-profile > div > div:first-child {
    border-radius: 0 !important;
    margin-bottom: 16px !important;
  }
  
  #tab-profile > div > div:first-child > div:last-child {
    padding: 0 16px 16px !important;
  }
  
  .profile-avatar-wrapper {
    top: -40px !important;
    left: 12px !important;
  }
  
  .profile-avatar-ring {
    width: 70px !important;
    height: 70px !important;
    padding: 3px !important;
  }
  
  .profile-avatar-inner img, 
  #prof-avatar-preview {
    width: 100% !important;
    height: 100% !important;
  }
  
  #prof-initials {
    font-size: 24px !important;
  }
  
  .profile-avatar-edit {
    width: 24px !important;
    height: 24px !important;
    border-width: 2px !important;
  }
  
  .profile-avatar-edit i {
    font-size: 10px !important;
  }
  
  #tab-profile > div > div:first-child > div:last-child > div {
    margin-left: 90px !important;
    padding-top: 0 !important;
  }
  
  #prof-level-display {
    display: inline-block !important;
    padding: 4px 10px !important;
    font-size: 10px !important;
    margin-bottom: 8px !important;
  }
  
  #tab-profile > div > div:first-child > div:last-child > div > div:last-child {
    flex: none !important;
  }
  
  #tab-profile > div > div:first-child > div:last-child > div > div:last-child > div:first-child {
    font-size: 12px !important;
    margin-bottom: 4px !important;
  }
  
  #prof-exp-bar {
    height: 6px !important;
  }
  
  #prof-exp-text-header {
    font-size: 10px !important;
  }
  
  #tab-profile > div > div:last-child {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 0 12px 100px !important;
  }
  
  .profile-card {
    margin-bottom: 0 !important;
    border-radius: 12px !important;
  }
  
  .profile-card-header {
    padding: 12px !important;
    font-size: 14px !important;
  }
  
  .profile-card .input-group {
    margin-bottom: 10px !important;
  }
  
  .profile-card .input-group label {
    font-size: 12px !important;
  }
  
  .profile-card .input-group input,
  .profile-card .input-group textarea {
    padding: 10px !important;
    font-size: 14px !important;
  }
  
  .profile-card .input-group input:focus,
  .profile-card .input-group textarea:focus {
    padding: 10px !important;
  }
  
  .stats-grid-profile {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  
  .stat-item-profile {
    padding: 10px !important;
    border-radius: 10px !important;
  }
  
  .stat-num-profile {
    font-size: 18px !important;
  }
  
  .stat-label-profile {
    font-size: 10px !important;
  }
  
  .insignia-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
  }
  
  .insignia-box {
    padding: 6px 4px !important;
    border-radius: 10px !important;
  }
  
  .insignia-box img {
    width: 28px !important;
    height: 28px !important;
  }
  
  .insignia-box div {
    font-size: 7px !important;
    line-height: 1.1 !important;
  }
  
  #insignias-count {
    font-size: 11px !important;
  }
  
  .profile-hint {
    padding: 10px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
  }
  
  .profile-hint i {
    font-size: 12px !important;
  }
}

/* Duel Results Mobile */
@media (max-width: 768px) {
  #duel-results-screen {
    margin-top: 12px !important;
  }
  
  #duel-results-screen > div:first-child {
    padding: 20px !important;
    border-radius: 16px !important;
    margin-bottom: 16px !important;
  }
  
  #duel-results-screen h1 {
    font-size: 22px !important;
  }
  
  #res-winner-text {
    font-size: 14px !important;
  }
  
  #duel-results-screen > div:first-child > div:nth-child(2) {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    padding: 20px !important;
    border-radius: 14px !important;
  }
  
  #duel-results-screen > div:first-child > div:nth-child(2) > div:last-child {
    border-left: none !important;
    border-top: 2px dashed var(--border) !important;
    padding-top: 16px !important;
  }
  
  #res-p1-score, #res-p2-score {
    font-size: 32px !important;
  }
  
  #res-p1-name, #res-p2-name {
    font-size: 14px !important;
  }
  
  #duel-results-screen > div:last-child {
    padding: 20px !important;
    border-radius: 16px !important;
  }
  
  #duel-results-screen h3 {
    font-size: 16px !important;
    margin-bottom: 16px !important;
  }
  
  #res-questions-list {
    gap: 16px !important;
  }
}

/* Mobile Modals */
@media (max-width: 768px) {
  .modal {
    width: 95% !important;
    max-width: 95% !important;
    margin: 10px !important;
    border-radius: 16px !important;
    max-height: 90vh !important;
  }
  
  .modal-header {
    padding: 14px !important;
    border-radius: 16px 16px 0 0 !important;
  }
  
  .modal-header h3 {
    font-size: 16px !important;
  }
  
  .modal-body {
    padding: 16px !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
  }
  
  .modal-footer {
    padding: 12px !important;
    flex-direction: column !important;
    gap: 10px !important;
  }
  
  .modal-footer button {
    width: 100% !important;
    justify-content: center !important;
  }
  
  .modal-hint {
    font-size: 12px !important;
    padding: 10px !important;
    border-radius: 8px !important;
    margin-bottom: 14px !important;
  }
  
  .input-group {
    margin-bottom: 14px !important;
  }
  
  .input-group label {
    font-size: 12px !important;
    margin-bottom: 6px !important;
  }
  
  .input-group input,
  .input-group textarea,
  .input-group select {
    padding: 10px !important;
    font-size: 14px !important;
    height: auto !important;
  }
  
  .input-group select {
    padding: 10px !important;
  }
  
  #modal-create-duel .modal-body > div:nth-child(4) {
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  #modal-create-duel .modal-body > div:nth-child(4) > div {
    flex: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   NOVO CSS: PvP ARENA - MOBILE FIRST
══════════════════════════════════════════════════════════════ */
.duelo-container { padding: 16px; max-width: 1200px; margin: 0 auto; }

.duelo-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.duelo-title { font-size: 20px; font-weight: 800; color: var(--text); margin: 0; display: flex; align-items: center; gap: 8px; }
.duelo-title i { color: var(--blue-600); }

.duelo-main { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.duelo-challenges h3, .duelo-leaderboard h3 { font-size: 16px; margin-bottom: 16px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.duelo-challenges h3 i { color: var(--blue-600); }
.duelo-leaderboard h3 i { color: #f59e0b; }

.duelo-cards { display: flex; flex-direction: column; gap: 12px; }
.duelo-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; cursor: pointer; transition: all 0.2s; }
.duelo-card:hover { border-color: var(--blue-500); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.duelo-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.duelo-card-theme { background: var(--blue-50); color: var(--blue-600); padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.duelo-card-difficulty { font-size: 11px; color: var(--text-muted); }
.duelo-card-info { display: flex; gap: 16px; font-size: 13px; color: var(--text-sub); }
.duelo-card-info span { display: flex; align-items: center; gap: 6px; }

.duelo-lb-list { display: flex; flex-direction: column; gap: 8px; }
.duelo-lb-item { display: flex; align-items: center; gap: 12px; padding: 10px; background: var(--surface); border-radius: 12px; border: 1px solid var(--border); }
.duelo-lb-rank { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.duelo-lb-rank.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
.duelo-lb-rank.silver { background: linear-gradient(135deg, #9ca3af, #6b7280); color: white; }
.duelo-lb-rank.bronze { background: linear-gradient(135deg, #d97706, #b45309); color: white; }
.duelo-lb-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-100); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--blue-600); }
.duelo-lb-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.duelo-lb-exp { font-size: 12px; color: var(--text-muted); }

/* Game Area */
.duelo-game { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 20px; }
.duelo-game-inner { width: 100%; max-width: 800px; }

.duelo-exit-btn { background: var(--surface); border: 1px solid var(--border); padding: 10px 20px; border-radius: 12px; font-weight: 600; color: var(--text-sub); cursor: pointer; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; width: 100%; justify-content: center; }
.duelo-exit-btn:hover { background: var(--input-bg); }

.duelo-lobby { background: var(--surface); border-radius: 24px; padding: 32px; text-align: center; border: 1px solid var(--border); }
.duelo-lobby-badge { display: inline-block; background: var(--blue-50); color: var(--blue-600); padding: 8px 16px; border-radius: 12px; font-weight: 900; font-size: 12px; letter-spacing: 1px; margin-bottom: 16px; }
.duelo-lobby h2 { font-size: 24px; margin-bottom: 24px; color: var(--text); }
.duelo-lobby-players { display: flex; justify-content: center; align-items: center; gap: 24px; margin-bottom: 24px; }
.lobby-player { text-align: center; }
.lobby-player img { width: 80px; height: 80px; border-radius: 20px; border: 3px solid var(--blue-500); object-fit: cover; margin-bottom: 8px; }
.lobby-player div { font-size: 14px; font-weight: 700; }
.lobby-player div:last-child { color: var(--text-muted); font-weight: 500; font-size: 12px; }
.lobby-vs { font-size: 24px; font-weight: 900; color: var(--blue-600); font-style: italic; }
#lobby-p2-card img { border: 3px dashed var(--border); opacity: 0.5; }

.duelo-arena { background: var(--surface); border-radius: 24px; padding: 24px; border: 1px solid var(--blue-500); }
.duelo-arena-badge { display: block; text-align: center; background: linear-gradient(90deg, var(--blue-600), var(--purple-600)); color: white; padding: 8px 20px; border-radius: 12px; font-weight: 900; font-size: 12px; letter-spacing: 1px; margin-bottom: 20px; }
.duelo-arena-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 16px; border-bottom: 2px dashed var(--border); margin-bottom: 20px; }
.duelo-timer-wrap { text-align: center; }
#duel-timer { font-size: 32px; font-weight: 900; color: var(--blue-600); background: var(--blue-50); padding: 8px 16px; border-radius: 12px; font-family: monospace; }
.duelo-timer-wrap span { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.duelo-score-wrap { text-align: right; }
#duel-score { font-size: 28px; font-weight: 900; color: var(--success); }
.duelo-score-wrap span { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }

.duelo-question-area { text-align: left; }
.duelo-q-badge { display: inline-block; background: var(--blue-50); color: var(--blue-600); padding: 6px 12px; border-radius: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; margin-bottom: 12px; }
#duel-question { font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.4; margin-bottom: 20px; }
.duelo-options { display: flex; flex-direction: column; gap: 10px; }
.duelo-option { background: var(--input-bg); border: 2px solid var(--border); padding: 14px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; transition: all 0.2s; }
.duelo-option:hover { border-color: var(--blue-500); background: var(--blue-50); }
.duelo-option.correct { background: var(--success); border-color: var(--success); color: white; }
.duelo-option.wrong { background: var(--danger); border-color: var(--danger); color: white; }

.duelo-results { margin-top: 16px; }
.duelo-results-card { background: var(--surface); border-radius: 20px; padding: 24px; border: 1px solid var(--border); text-align: center; margin-bottom: 16px; }
.duelo-results-card h1 { font-size: 24px; margin-bottom: 8px; color: var(--text); display: flex; align-items: center; justify-content: center; gap: 10px; }
.duelo-results-card h1 i { color: #fbbf24; }
.duelo-results-card h2 { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.duelo-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; background: var(--bg); border-radius: 16px; padding: 20px; }
.score-box { text-align: center; }
.score-box h3 { font-size: 14px; color: var(--text-sub); margin-bottom: 8px; }
.score-box div:first-of-type { font-size: 36px; font-weight: 900; color: var(--blue-600); }
.score-box span { font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }

.duelo-gabarito { background: var(--surface); border-radius: 20px; padding: 20px; border: 1px solid var(--border); }
.duelo-gabarito h3 { font-size: 16px; margin-bottom: 16px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.gabarito-item { padding: 12px; background: var(--bg); border-radius: 12px; margin-bottom: 10px; }
.gabarito-q { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 8px; }
.gabarito-correct { color: var(--success); font-weight: 600; font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════
   NOVO CSS: PROFILE - MOBILE FIRST  
══════════════════════════════════════════════════════════════ */
.profile-container { max-width: 1100px; margin: 0 auto; }

.profile-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; gap: 12px; flex-wrap: wrap; }
.profile-header h2 { font-size: 20px; font-weight: 800; color: var(--text); margin: 0; display: flex; align-items: center; gap: 8px; }
.profile-header h2 i { color: var(--blue-600); }

.profile-banner-wrap { position: relative; height: 140px; background: linear-gradient(120deg, #1e3a5f 0%, #2563eb 50%, #0f172a 100%); }
.profile-banner { width: 100%; height: 100%; }
.profile-banner img { width: 100%; height: 100%; object-fit: cover; }
.profile-banner-btn { position: absolute; bottom: 12px; right: 12px; background: rgba(0,0,0,0.6); color: white; border: none; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; }

.profile-main { padding: 0 16px 100px; }
.profile-avatar-section { display: flex; align-items: flex-end; gap: 16px; margin-top: -40px; margin-bottom: 20px; }
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar-ring { width: 90px; height: 90px; border-radius: 50%; padding: 4px; background: linear-gradient(135deg, var(--blue-500), #7c3aed); box-shadow: 0 4px 16px rgba(37,99,235,0.3); }
.profile-avatar-inner { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.profile-avatar-inner img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-inner span { font-size: 28px; font-weight: 900; color: white; background: linear-gradient(135deg, var(--blue-500), #7c3aed); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.profile-avatar-edit { position: absolute; bottom: 0; right: 0; background: var(--blue-600); color: white; border: 3px solid var(--surface); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px; }

.profile-info { flex: 1; min-width: 0; padding-bottom: 8px; }
.profile-level { display: inline-block; background: linear-gradient(135deg, #f59e0b, #d97706); color: white; padding: 4px 12px; border-radius: 20px; font-weight: 800; font-size: 11px; margin-bottom: 8px; }
.profile-progress { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-progress > span:first-child { font-size: 12px; color: var(--text-muted); font-weight: 600; width: 100%; margin-bottom: 4px; }
.profile-exp-bar { flex: 1; min-width: 100px; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.profile-exp-bar div { height: 100%; background: linear-gradient(90deg, var(--blue-500), #7c3aed); border-radius: 4px; transition: width 0.5s; }
.profile-progress > span:last-child { font-size: 11px; font-weight: 700; color: var(--text-sub); }

.profile-content { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
.profile-form, .profile-stats { display: flex; flex-direction: column; gap: 16px; }

.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.profile-card-header { background: var(--input-bg); padding: 14px 16px; font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.profile-card-header i { color: var(--blue-600); }
.profile-card-header span:last-child { margin-left: auto; font-size: 11px; color: var(--text-muted); }

.profile-card .input-group { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.profile-card .input-group:last-child { border-bottom: none; }
.profile-card .input-group label { display: block; font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.profile-card .input-group input, .profile-card .input-group textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 14px; }
.profile-card .input-group input:focus, .profile-card .input-group textarea:focus { outline: none; border-color: var(--blue-500); }

.profile-hint { padding: 12px 16px; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; background: var(--yellow-50); border-top: 1px solid var(--yellow-200); }
.profile-hint i { color: var(--yellow-600); }

.profile-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 16px; }
.profile-badge { text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--input-bg); border: 1px solid var(--border); }
.profile-badge.unlocked { background: var(--blue-50); border-color: var(--blue-200); }
.profile-badge img { width: 36px; height: 36px; object-fit: contain; }
.profile-badge.locked img { filter: grayscale(1); opacity: 0.4; }
.profile-badge span { display: block; font-size: 8px; font-weight: 700; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; }
.profile-badge.unlocked span { color: var(--text); }

.profile-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px; }
.stat-box { text-align: center; padding: 16px; background: var(--input-bg); border-radius: 12px; }
.stat-box .stat-num { display: block; font-size: 24px; font-weight: 900; color: var(--blue-600); }
.stat-box .stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

/* MOBILE RESPONSIVE */
@media (max-width: 900px) {
  .duelo-main { grid-template-columns: 1fr; }
  .duelo-leaderboard { order: -1; }
  .profile-content { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .toolbar-top,
  .tab-toolbar,
  .duelo-header,
  .visit-header {
    position: relative;
    top: auto;
    z-index: 20;
    margin: 0 0 18px;
    padding: 14px 16px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(37,99,235,0.08);
    backdrop-filter: blur(10px);
  }

  .toolbar-top .tab-title,
  .tab-toolbar .tab-title,
  .duelo-title,
  .visit-header h2 {
    font-size: 16px;
    min-width: 0;
  }

  .tab-toolbar {
    gap: 10px;
    align-items: center;
  }

  .toolbar-top + .cards-grid,
  .tab-toolbar + .cards-grid,
  .toolbar-top + .player-layout,
  .tab-toolbar + .reda-full-grid,
  .toolbar-top + .filter-chips,
  .toolbar-top + .folder-chips-bar {
    margin-top: 14px;
  }

  .btn-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(37,99,235,0.18);
  }
  
  .duelo-container, .profile-container { padding: 0; }
  .profile-header { padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); position: relative; top: auto; z-index: 20; border-radius: 18px; box-shadow: 0 10px 24px rgba(37,99,235,0.08); }
  .duelo-title, .profile-header h2 { font-size: 16px; }
  .duelo-header .btn-primary, .profile-header .btn-primary { padding: 8px 14px; font-size: 13px; }
  .btn-text { display: none; }
  
  .duelo-main { padding: 12px; gap: 16px; }
  .duelo-challenges h3, .duelo-leaderboard h3 { font-size: 14px; margin-bottom: 12px; }
  .duelo-card { padding: 12px; }
  .duelo-card-header { flex-wrap: wrap; gap: 8px; }
  .duelo-card-theme { font-size: 10px; padding: 3px 8px; }
  .duelo-card-info { font-size: 12px; flex-wrap: wrap; }
  
  .duelo-game { padding: 12px; }
  .duelo-lobby { padding: 20px; border-radius: 16px; }
  .duelo-lobby-badge { font-size: 10px; padding: 6px 12px; }
  .duelo-lobby h2 { font-size: 18px; margin-bottom: 16px; }
  .duelo-lobby-players { gap: 12px; }
  .lobby-player img { width: 56px; height: 56px; border-radius: 14px; }
  .lobby-vs { font-size: 18px; }
  .duelo-lobby .btn-primary { width: 100%; padding: 14px; font-size: 15px; }
  
  .duelo-arena { padding: 16px; border-radius: 16px; }
  .duelo-arena-badge { font-size: 10px; padding: 6px 12px; margin-bottom: 12px; }
  .duelo-arena-header { flex-direction: column; gap: 12px; align-items: stretch; }
  .duelo-timer-wrap, .duelo-score-wrap { text-align: center; }
  #duel-timer { font-size: 24px; padding: 6px 12px; }
  #duel-score { font-size: 24px; }
  #duel-question { font-size: 16px; margin-bottom: 16px; }
  .duelo-option { padding: 12px; font-size: 13px; }
  
  .duelo-results-card { padding: 16px; border-radius: 16px; }
  .duelo-results-card h1 { font-size: 18px; }
  .duelo-scores { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
  .score-box div:first-of-type { font-size: 28px; }
  .duelo-gabarito { padding: 16px; border-radius: 16px; }
  
  .profile-banner-wrap { height: 100px; }
  .profile-banner-btn { bottom: 8px; right: 8px; padding: 6px 10px; font-size: 10px; }
  .profile-main { padding: 0 12px 100px; }
  .profile-avatar-section { margin-top: -35px; margin-bottom: 16px; gap: 12px; }
  .profile-avatar-ring { width: 70px; height: 70px; }
  .profile-avatar-inner span { font-size: 22px; }
  .profile-avatar-edit { width: 24px; height: 24px; font-size: 9px; }
  .profile-level { font-size: 10px; padding: 3px 8px; }
  .profile-progress > span:first-child { display: none; }
  
  .profile-card-header { padding: 12px; font-size: 13px; }
  .profile-card .input-group { padding: 12px; }
  .profile-card .input-group label { font-size: 11px; }
  .profile-card .input-group input, .profile-card .input-group textarea { padding: 8px 10px; font-size: 13px; }
  .profile-badges { grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 12px; }
  .profile-badge { padding: 6px 2px; }
  .profile-badge img { width: 28px; height: 28px; }
  .profile-badge span { font-size: 7px; }
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px; }
  .stat-box { padding: 12px; }
  .stat-box .stat-num { font-size: 20px; }
  .stat-box .stat-label { font-size: 10px; }
  
  .profile-header .btn-primary { position: fixed; bottom: 70px; left: 12px; right: 12px; z-index: 20; width: auto; }
}

/* VISIT PROFILE */
.visit-profile-container { max-width: 800px; margin: 0 auto; }
.visit-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); position: relative; top: auto; z-index: 10; border-radius: 18px; box-shadow: 0 10px 24px rgba(37,99,235,0.08); margin-bottom: 18px; }
.visit-header .btn-ghost { padding: 8px 14px; font-size: 13px; }
.visit-header h2 { font-size: 18px; font-weight: 800; color: var(--text); margin: 0; flex: 1; display: flex; align-items: center; gap: 8px; }
.visit-header h2 i { color: var(--blue-600); }

.visit-banner-wrap { height: 120px; background: linear-gradient(120deg, #1e3a5f 0%, #2563eb 50%, #0f172a 100%); }
.visit-banner { width: 100%; height: 100%; background-size: cover; background-position: center; }

.visit-main { padding: 0 16px 80px; margin-top: -40px; }
.visit-avatar-section { display: flex; justify-content: center; margin-bottom: 16px; }
.visit-avatar-wrap { position: relative; }

.visit-info { text-align: center; margin-bottom: 16px; }
.visit-level { display: inline-block; background: linear-gradient(135deg, #f59e0b, #d97706); color: white; padding: 4px 14px; border-radius: 20px; font-weight: 800; font-size: 12px; margin-bottom: 12px; }
.visit-stats-row { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.visit-stat { font-size: 14px; color: var(--text-sub); font-weight: 600; }
.visit-stat span { color: var(--blue-600); font-weight: 900; }

.visit-bio { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; text-align: center; margin-bottom: 16px; font-size: 14px; color: var(--text); }

.visit-badges { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.visit-badges-header { background: var(--input-bg); padding: 12px 16px; font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.visit-badges-header i { color: var(--blue-600); }
.visit-badges-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 16px; }
.visit-badge { text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--input-bg); }
.visit-badge img { width: 40px; height: 40px; object-fit: contain; }
.visit-badge.locked img { filter: grayscale(1); opacity: 0.4; }
.visit-badge span { display: block; font-size: 9px; font-weight: 700; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; }

@media (max-width: 600px) {
  .visit-header { top: auto; }
  .visit-header h2 { font-size: 16px; }
  .visit-banner-wrap { height: 80px; }
  .visit-main { margin-top: -30px; }
  .visit-stats-row { gap: 12px; }
  .visit-stat { font-size: 12px; }
  .visit-badges-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 12px; }
  .visit-badge img { width: 32px; height: 32px; }
  .visit-badge span { font-size: 7px; }
}

/* ═══════════════════════════════════════════════════════════════
   MY PROFILE - NEW DESIGN
══════════════════════════════════════════════════════════════ */
.my-profile { max-width: 800px; margin: 0 auto; padding-bottom: 100px; display: flex; flex-direction: column; gap: 14px; }

.my-profile-header { background: transparent; border: none; border-radius: 0; padding: 8px 0 0; box-shadow: none; }
.btn-save-profile { width:100%; padding:12px; background:var(--blue-600); color:white; border:none; border-radius:10px; font-weight:700; font-size:14px; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:8px; transition:all 0.2s; margin-top:8px; }
.btn-save-profile:hover { background:var(--blue-700); }

.my-profile-header-content { display: flex; justify-content: center; align-items: center; width: 100%; padding: 0; margin: 0; position: relative; text-align: center; }
.my-profile-avatar-panel { width: 100%; max-width: 260px; margin: 0 auto; padding: 0; background: transparent; border: none; box-shadow: none; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.my-profile-avatar-wrap { position: relative; display: flex; justify-content: center; align-items: center; width: 112px; margin: 0 auto; padding-bottom: 18px; }
.my-profile-avatar { width: 112px; height: 112px; border-radius: 50%; overflow: hidden; border: 4px solid rgba(255,255,255,0.96); background: linear-gradient(135deg, var(--blue-500), #7c3aed); box-shadow: 0 16px 34px rgba(59,130,246,0.22); display: flex; align-items: center; justify-content: center; }
.my-profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: none; }
.my-profile-avatar span { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: white; font-size: 32px; font-weight: 900; }
.my-profile-avatar-btn { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); background: var(--blue-600); color: white; border: 2px solid rgba(255,255,255,0.96); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; box-shadow: 0 10px 22px rgba(37,99,235,0.24); }
.my-profile-avatar-copy { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.my-profile-avatar-copy strong { font-size: 15px; font-weight: 800; color: var(--text); }
.my-profile-avatar-copy span { font-size: 12px; color: var(--text-muted); }
.my-profile-avatar-guide { width: 100%; padding: 12px 14px; border: 1px solid rgba(96,165,250,0.16); border-radius: 16px; background: rgba(239,246,255,0.72); text-align: left; }
.my-profile-avatar-guide strong { display: block; font-size: 13px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.my-profile-avatar-guide p { font-size: 12px; line-height: 1.45; color: var(--text-sub); margin: 0 0 6px; }
.my-profile-avatar-guide p:last-child { margin-bottom: 0; }

[data-theme="dark"] .my-profile-header {
  background: transparent;
  border: none;
  box-shadow: none;
}

[data-theme="dark"] .my-profile-avatar-copy strong {
  color: #e5eefc;
}

[data-theme="dark"] .my-profile-avatar-copy span {
  color: #9fb2d3;
}

[data-theme="dark"] .my-profile-avatar-btn {
  background: #3b82f6;
  border-color: rgba(15,23,42,0.94);
  box-shadow: 0 12px 24px rgba(0,0,0,0.34);
}

[data-theme="dark"] .my-profile-avatar-guide {
  background: rgba(15,23,42,0.72);
  border-color: rgba(96,165,250,0.14);
}

[data-theme="dark"] .my-profile-avatar-guide strong {
  color: #e5eefc;
}

[data-theme="dark"] .my-profile-avatar-guide p {
  color: #9fb2d3;
}

[data-theme="dark"] .my-profile-info,
[data-theme="dark"] .my-profile-stats,
[data-theme="dark"] .my-profile-card {
  border-color: rgba(96,165,250,0.12);
  box-shadow: 0 12px 28px rgba(0,0,0,0.22);
}

[data-theme="dark"] .my-profile-info {
  background: transparent;
  border: none;
  box-shadow: none;
}

[data-theme="dark"] .my-profile-card-header {
  background: linear-gradient(180deg, rgba(37,99,235,0.16), rgba(30,41,59,0.72));
  border-bottom-color: rgba(96,165,250,0.12);
}

[data-theme="dark"] .my-profile-card-body .input-group input,
[data-theme="dark"] .my-profile-card-body .input-group textarea {
  background: linear-gradient(180deg, rgba(30,41,59,0.92), rgba(15,23,42,0.88));
  border-color: rgba(96,165,250,0.14);
  color: #e5eefc;
}

[data-theme="dark"] .my-profile-card-body .input-group input::placeholder,
[data-theme="dark"] .my-profile-card-body .input-group textarea::placeholder {
  color: #8ea3c7;
}

.my-profile-info { padding: 8px 8px 14px; background: transparent; border: none; border-radius: 0; box-shadow: none; text-align: center; }

.my-profile-name-row { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; margin-bottom: 14px; }
.my-profile-name-row h1 { font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 4px 0; }
.my-profile-name-row p { font-size: 14px; color: var(--text-muted); margin: 0; }
.my-profile-level span { display: inline-block; background: linear-gradient(135deg, #f59e0b, #d97706); color: white; padding: 6px 14px; border-radius: 20px; font-weight: 800; font-size: 12px; }

.my-profile-exp { }
.my-profile-exp-info { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.my-profile-exp-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.my-profile-exp-bar div { height: 100%; background: linear-gradient(90deg, var(--blue-500), #7c3aed); border-radius: 4px; transition: width 0.5s; }

.my-profile-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid rgba(96,165,250,0.18); border-radius: 22px; overflow: hidden; box-shadow: 0 10px 28px rgba(37,99,235,0.06); }
.my-profile-stat { flex: 1; text-align: center; padding: 16px 10px; border-right: 1px solid rgba(96,165,250,0.14); }
.my-profile-stat:last-child { border-right: none; }
.my-profile-stat-num { display: block; font-size: 24px; font-weight: 900; color: var(--blue-600); }
.my-profile-stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

.my-profile-body { padding: 0; }
.my-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.my-profile-section { display: flex; flex-direction: column; gap: 16px; }

.my-profile-card { background: var(--surface); border: 1px solid rgba(96,165,250,0.16); border-radius: 20px; overflow: hidden; box-shadow: 0 10px 24px rgba(37,99,235,0.05); }
.my-profile-card-header { background: linear-gradient(180deg, rgba(219,234,254,0.55), rgba(219,234,254,0.3)); padding: 14px 16px; font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(96,165,250,0.14); }
.my-profile-card-header i { color: var(--blue-600); }
.my-profile-card-header span { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.my-profile-card-body { padding: 16px; }
.my-profile-card-body .input-group { margin-bottom: 14px; }
.my-profile-card-body .input-group:last-child { margin-bottom: 0; }
.my-profile-card-body .input-group label { display: block; font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.my-profile-card-body .input-group input,
.my-profile-card-body .input-group textarea { width: 100%; padding: 12px 14px; border: 1px solid rgba(96,165,250,0.2); border-radius: 12px; background: linear-gradient(180deg, rgba(239,246,255,0.9), rgba(219,234,254,0.7)); color: var(--text); font-size: 14px; box-sizing: border-box; }
.my-profile-card-body .input-group input:focus,
.my-profile-card-body .input-group textarea:focus { outline: none; border-color: var(--blue-500); background: var(--surface); box-shadow: 0 0 0 4px rgba(96,165,250,0.12); }
.my-profile-hint { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; padding: 10px; background: var(--yellow-50); border-radius: 8px; margin-top: 12px; }
.my-profile-hint i { color: var(--yellow-600); }

.my-profile-badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.my-profile-badge { text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--input-bg); border: 1px solid var(--border); }
.my-profile-badge.unlocked { background: var(--blue-50); border-color: var(--blue-200); }
.my-profile-badge img { width: 36px; height: 36px; object-fit: contain; }
.my-profile-badge.locked img { filter: grayscale(1); opacity: 0.4; }
.my-profile-badge span { display: block; font-size: 8px; font-weight: 700; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; }
.my-profile-badge.unlocked span { color: var(--text); }

/* Mobile */
@media (max-width: 768px) {
  .my-profile { }
  .my-profile-header { padding: 4px 0 0; border-radius: 0; }
  .my-profile-header-content { padding: 0 12px 10px; justify-content: center; position: relative; }
  .my-profile-avatar-panel { max-width: 100%; padding: 4px 0 0; gap: 12px; }
  .my-profile-avatar-wrap { width: 92px; justify-content: center; padding-bottom: 16px; }
  .my-profile-avatar { width: 92px; height: 92px; border-width: 4px; }
  .my-profile-avatar span { font-size: 26px; }
  .my-profile-avatar-btn { width: 30px; height: 30px; font-size: 10px; left: 50%; right: auto; bottom: 0; }
  .my-profile-avatar-copy strong { font-size: 14px; }
  .my-profile-avatar-copy span { font-size: 11px; }
  .my-profile-avatar-guide { padding: 10px 12px; border-radius: 14px; }
  .my-profile-avatar-guide strong { font-size: 12px; }
  .my-profile-avatar-guide p { font-size: 11px; }

  .my-profile-info { padding: 8px 6px 14px; text-align: center; border-radius: 0; }
  .my-profile-name-row { flex-direction: column; gap: 6px; align-items: center; }
  .my-profile-name-row h1 { font-size: 18px; }
  .my-profile-name-row p { font-size: 13px; }
  .my-profile-level { align-self: center; }
  .my-profile-level span { font-size: 11px; }
  
  .my-profile-stats { border-radius: 20px; }
  .my-profile-stat { padding: 12px 6px; }
  .my-profile-stat-num { font-size: 16px; }
  .my-profile-stat-label { font-size: 9px; }
  
  .my-profile-body { padding: 0; }
  .my-profile-grid { grid-template-columns: 1fr; gap: 12px; }
  
  .my-profile-card { border-radius: 18px; }
  .my-profile-card-header { padding: 12px 14px; font-size: 13px; }
  .my-profile-card-body { padding: 12px; }
  .my-profile-badges { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .my-profile-badge { padding: 6px 2px; }
  .my-profile-badge img { width: 28px; height: 28px; }
  .my-profile-badge span { font-size: 7px; }
}

/* PROFILE SOCIAL REBUILD */
#tab-profile .social-profile {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 0 110px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#tab-profile .social-profile-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.28), transparent 34%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92));
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 32px;
  padding: 28px;
  box-shadow: 0 24px 48px rgba(37, 99, 235, 0.08);
}

#tab-profile .social-profile-top {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
}

#tab-profile .social-avatar-wrap {
  width: 132px;
  margin: 0 auto;
  padding: 0;
  position: relative;
}

#tab-profile .social-avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.96);
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 18px 42px rgba(37, 99, 235, 0.22);
}

#tab-profile #prof-avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#tab-profile #prof-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #fff;
  font-size: 42px;
  font-weight: 900;
}

#tab-profile .my-profile-avatar-btn {
  left: auto;
  right: 6px;
  bottom: 6px;
  transform: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.95);
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

#tab-profile .social-profile-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

#tab-profile .social-profile-headline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

#tab-profile .social-profile-headline h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.05;
  font-weight: 900;
  color: var(--text);
}

#tab-profile .social-level-pill {
  display: inline-grid;
  place-items: center;
  text-align: center;
  min-height: 32px;
  min-width: 84px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b 0%, #fb923c 52%, #f97316 100%);
  border: 1px solid rgba(249, 115, 22, 0.22);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.08em;
  white-space: nowrap;
  box-shadow:
    0 10px 18px rgba(249, 115, 22, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  position: relative;
  overflow: hidden;
  vertical-align: middle;
}

#tab-profile .social-level-pill::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 48%);
  pointer-events: none;
}

#tab-profile .social-handle,
#tab-profile .social-status {
  margin: 0;
}

#tab-profile .social-handle {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-700);
}

#tab-profile .social-status {
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-sub);
}

#tab-profile .social-profile-exp {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(96, 165, 250, 0.18);
}

#tab-profile .social-profile-exp .my-profile-exp-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--text-sub);
}

#tab-profile .social-exp-label {
  font-weight: 800;
}

#tab-profile .social-exp-side {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

#tab-profile .social-profile-exp .my-profile-exp-bar {
  height: 10px;
  background: rgba(191, 219, 254, 0.9);
}

#tab-profile .social-profile-exp .my-profile-exp-bar div {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}

#tab-profile .social-profile-stats {
  margin-top: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(96, 165, 250, 0.16);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.06);
}

#tab-profile .social-profile-stats .my-profile-stat {
  padding: 18px 10px;
}

#tab-profile .social-profile-stats .my-profile-stat-num {
  font-size: 26px;
}

#tab-profile .social-profile-stats .my-profile-stat-label {
  font-size: 11px;
  letter-spacing: 0.04em;
}

#tab-profile .social-profile-body {
  padding: 0;
}

#tab-profile .social-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 20px;
}

#tab-profile .social-profile-section {
  gap: 20px;
}

#tab-profile .social-profile-card {
  border-radius: 28px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92));
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.06);
}

#tab-profile .social-profile-card .my-profile-card-header {
  min-height: 60px;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(219, 234, 254, 0.7), rgba(239, 246, 255, 0.5));
  border-bottom: 1px solid rgba(96, 165, 250, 0.14);
  font-size: 15px;
  font-weight: 800;
}

#tab-profile .social-profile-card .my-profile-card-body {
  padding: 20px;
}

#tab-profile .social-profile-card .input-group {
  margin-bottom: 16px;
}

#tab-profile .social-profile-card .input-group label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#tab-profile .social-profile-card .input-group input,
#tab-profile .social-profile-card .input-group textarea {
  min-height: 52px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(232, 241, 255, 0.92));
}

#tab-profile .social-profile-card .input-group textarea {
  min-height: 124px;
  resize: vertical;
}

#tab-profile .btn-save-profile {
  min-height: 52px;
  border-radius: 16px;
  margin-top: 10px;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.18);
}

#tab-profile .my-profile-hint {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
}

#tab-profile .my-profile-badges {
  gap: 10px;
}

#tab-profile #prof-error {
  margin-top: 4px;
}

[data-theme="dark"] #tab-profile .social-profile-hero {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.28), transparent 36%),
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94));
  border-color: rgba(96, 165, 250, 0.16);
  box-shadow: 0 28px 54px rgba(2, 6, 23, 0.42);
}

[data-theme="dark"] #tab-profile .social-profile-card,
[data-theme="dark"] #tab-profile .social-profile-stats,
[data-theme="dark"] #tab-profile .social-profile-exp {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.92));
  border-color: rgba(96, 165, 250, 0.14);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.32);
}

[data-theme="dark"] #tab-profile .social-profile-card .my-profile-card-header {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.86));
}

[data-theme="dark"] #tab-profile .social-handle {
  color: #8bb8ff;
}

[data-theme="dark"] #tab-profile .social-level-pill {
  border-color: rgba(251, 146, 60, 0.22);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.3),
    0 8px 18px rgba(249, 115, 22, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] #tab-profile .social-status,
[data-theme="dark"] #tab-profile .social-profile-exp .my-profile-exp-info {
  color: #a7bad8;
}

[data-theme="dark"] #tab-profile .social-profile-card .input-group input,
[data-theme="dark"] #tab-profile .social-profile-card .input-group textarea {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.92));
  border-color: rgba(96, 165, 250, 0.18);
  color: #e5eefc;
}

[data-theme="dark"] #tab-profile .social-profile-card .input-group input::placeholder,
[data-theme="dark"] #tab-profile .social-profile-card .input-group textarea::placeholder {
  color: #8ea3c7;
}

@media (max-width: 768px) {
  #tab-profile .social-profile {
    padding-top: 4px;
    gap: 16px;
  }

  #tab-profile .social-profile-hero {
    padding: 20px 16px 16px;
    border-radius: 26px;
  }

  #tab-profile .social-profile-top {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 16px;
  }

  #tab-profile .social-avatar-wrap {
    width: 112px;
  }

  #tab-profile .social-avatar {
    width: 112px;
    height: 112px;
  }

  #tab-profile #prof-initials {
    font-size: 36px;
  }

  #tab-profile .social-profile-meta {
    align-items: center;
  }

  #tab-profile .social-profile-headline {
    justify-content: center;
  }

  #tab-profile .social-profile-headline h1 {
    font-size: 28px;
  }

  #tab-profile .social-handle {
    font-size: 15px;
  }

  #tab-profile .social-status {
    font-size: 13px;
  }

  #tab-profile .social-profile-exp {
    margin-top: 18px;
    padding: 14px;
  }

  #tab-profile .social-profile-exp .my-profile-exp-info {
    align-items: flex-start;
    flex-direction: column;
  }

  #tab-profile .social-exp-side {
    width: 100%;
    justify-content: space-between;
  }

  #tab-profile .social-profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #tab-profile .social-profile-stats .my-profile-stat:nth-child(2) {
    border-right: none;
  }

  #tab-profile .social-profile-stats .my-profile-stat:nth-child(-n+2) {
    border-bottom: 1px solid rgba(96, 165, 250, 0.14);
  }

  #tab-profile .social-profile-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  #tab-profile .social-profile-card {
    border-radius: 22px;
  }

  #tab-profile .social-profile-card .my-profile-card-header {
    min-height: 54px;
    padding: 14px 16px;
    font-size: 14px;
  }

  #tab-profile .social-profile-card .my-profile-card-body {
    padding: 16px;
  }
}

/* VISIT PROFILE REBUILD */
#tab-visit-profile .visit-profile-container {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 110px;
}

#tab-visit-profile .visit-header {
  margin-bottom: 0;
}

#tab-visit-profile .visit-social-hero {
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.26), transparent 34%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92));
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 30px;
  box-shadow: 0 24px 48px rgba(37, 99, 235, 0.08);
  overflow: hidden;
}

#tab-visit-profile .visit-main {
  margin-top: 0;
  padding: 28px;
}

#tab-visit-profile .visit-avatar-section {
  margin-bottom: 18px;
}

#tab-visit-profile .visit-avatar-ring {
  width: 120px;
  height: 120px;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.22);
}

#tab-visit-profile .visit-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
}

#tab-visit-profile .visit-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#tab-visit-profile .visit-avatar-inner span {
  color: #fff;
  font-size: 38px;
  font-weight: 900;
}

#tab-visit-profile .visit-info {
  margin-bottom: 20px;
}

#tab-visit-profile .visit-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

#tab-visit-profile .visit-title-row h3 {
  margin: 0;
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.05;
  font-weight: 900;
  color: var(--text);
}

#tab-visit-profile .visit-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0;
}

#tab-visit-profile .visit-course,
#tab-visit-profile .visit-status {
  margin: 0;
  text-align: center;
}

#tab-visit-profile .visit-course {
  font-size: 16px;
  font-weight: 700;
  color: var(--blue-700);
}

#tab-visit-profile .visit-status {
  margin-top: 8px;
  color: var(--text-sub);
  font-size: 14px;
}

#tab-visit-profile .visit-exp-card,
#tab-visit-profile .visit-bio-card,
#tab-visit-profile .visit-badges {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 24px;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.05);
}

#tab-visit-profile .visit-exp-card {
  padding: 16px 18px;
}

#tab-visit-profile .visit-exp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--text-sub);
  font-weight: 700;
}

#tab-visit-profile .visit-exp-track {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(191, 219, 254, 0.9);
}

#tab-visit-profile #visit-exp-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  transition: width 0.4s ease;
}

#tab-visit-profile .visit-stats-grid,
#tab-visit-profile .visit-content-grid {
  display: grid;
  gap: 18px;
}

#tab-visit-profile .visit-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

#tab-visit-profile .visit-stat-card {
  min-height: 92px;
  padding: 16px 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(96, 165, 250, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

#tab-visit-profile .visit-stat-card span {
  font-size: 25px;
  font-weight: 900;
  color: var(--blue-600);
}

#tab-visit-profile .visit-stat-card small {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

#tab-visit-profile .visit-content-grid {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

#tab-visit-profile .visit-badges-header {
  padding: 15px 18px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.14);
  background: linear-gradient(180deg, rgba(219, 234, 254, 0.7), rgba(239, 246, 255, 0.5));
}

#tab-visit-profile .visit-bio {
  margin-bottom: 0;
  min-height: 180px;
  border: none;
  background: transparent;
  padding: 18px;
  text-align: left;
  line-height: 1.7;
}

#tab-visit-profile .visit-badges-grid {
  padding: 18px;
}

[data-theme="dark"] #tab-visit-profile .visit-social-hero {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.28), transparent 36%),
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94));
  border-color: rgba(96, 165, 250, 0.16);
  box-shadow: 0 28px 54px rgba(2, 6, 23, 0.4);
}

[data-theme="dark"] #tab-visit-profile .visit-exp-card,
[data-theme="dark"] #tab-visit-profile .visit-bio-card,
[data-theme="dark"] #tab-visit-profile .visit-badges,
[data-theme="dark"] #tab-visit-profile .visit-stat-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.92));
  border-color: rgba(96, 165, 250, 0.14);
  box-shadow: 0 18px 34px rgba(2, 6, 23, 0.3);
}

[data-theme="dark"] #tab-visit-profile .visit-badges-header {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.86));
}

[data-theme="dark"] #tab-visit-profile .visit-course {
  color: #8bb8ff;
}

[data-theme="dark"] #tab-visit-profile .visit-status,
[data-theme="dark"] #tab-visit-profile .visit-exp-head {
  color: #a7bad8;
}

@media (max-width: 768px) {
  #tab-visit-profile .visit-main {
    padding: 20px 16px;
  }

  #tab-visit-profile .visit-avatar-ring {
    width: 104px;
    height: 104px;
  }

  #tab-visit-profile .visit-avatar-inner span {
    font-size: 34px;
  }

  #tab-visit-profile .visit-title-row h3 {
    font-size: 28px;
  }

  #tab-visit-profile .visit-stats-grid,
  #tab-visit-profile .visit-content-grid {
    grid-template-columns: 1fr 1fr;
  }

  #tab-visit-profile .visit-content-grid {
    grid-template-columns: 1fr;
  }
}

/* COMMUNITY REBUILD */
#tab-comunidade .community-layout {
  max-width: 1280px;
  margin: 0 auto;
  gap: 22px;
  align-items: start;
}

#tab-comunidade .community-sidebar,
#tab-comunidade .community-feed,
#tab-comunidade .community-sidebar-right {
  background: transparent;
}

#tab-comunidade .community-sidebar {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#tab-comunidade .comm-sidebar-logo,
#tab-comunidade .comm-trending,
#tab-comunidade .comm-widget,
#tab-comunidade .comm-widget-hint,
#tab-comunidade .comm-feed-header,
#tab-comunidade .comm-mobile-header,
#tab-comunidade .comm-mobile-nav,
#tab-comunidade .user-feed-item {
  border-radius: 26px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.06);
}

#tab-comunidade .comm-sidebar-logo,
#tab-comunidade .comm-trending,
#tab-comunidade .comm-widget,
#tab-comunidade .comm-widget-hint,
#tab-comunidade .comm-feed-header,
#tab-comunidade .comm-mobile-header,
#tab-comunidade .comm-mobile-nav {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92));
}

#tab-comunidade .comm-sidebar-logo {
  min-height: 84px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 900;
}

#tab-comunidade .comm-sidebar-logo i {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(124, 58, 237, 0.12));
}

#tab-comunidade .comm-nav {
  gap: 10px;
  margin-bottom: 0;
}

#tab-comunidade .comm-nav-btn {
  min-height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#tab-comunidade .comm-nav-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

#tab-comunidade .comm-nav-btn.active {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.9), rgba(239, 246, 255, 0.9));
  border-color: rgba(96, 165, 250, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

#tab-comunidade .comm-trending,
#tab-comunidade .comm-widget {
  padding: 18px;
}

#tab-comunidade .comm-trending-title,
#tab-comunidade .comm-widget-title {
  font-size: 15px;
  font-weight: 900;
  margin-bottom: 14px;
}

#tab-comunidade #comm-trending-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#tab-comunidade .trending-topic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(219, 234, 254, 0.82));
  border: 1px solid rgba(96, 165, 250, 0.16);
  font-size: 12px;
  font-weight: 800;
  color: var(--blue-700);
}

#tab-comunidade .community-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#tab-comunidade .comm-feed-header {
  min-height: 92px;
  padding: 20px 22px;
  align-items: center;
}

#tab-comunidade .comm-feed-title {
  font-size: 24px;
  font-weight: 900;
}

#tab-comunidade .comm-search-box {
  min-width: 280px;
}

#tab-comunidade .comm-search-box input {
  min-height: 54px;
  padding-left: 46px;
  border-radius: 18px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(232, 241, 255, 0.92));
}

#tab-comunidade .users-feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#tab-comunidade .user-feed-item {
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92));
  border-color: rgba(96, 165, 250, 0.16);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
}

#tab-comunidade .user-feed-item-ranking {
  grid-template-columns: auto auto minmax(0, 1fr);
}

#tab-comunidade .user-feed-item:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(231, 242, 255, 0.94));
  border-color: rgba(59, 130, 246, 0.22);
  box-shadow: 0 22px 40px rgba(37, 99, 235, 0.08);
}

#tab-comunidade .user-feed-avatar,
#tab-comunidade .user-feed-avatar-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 20px;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

#tab-comunidade .user-feed-avatar-placeholder {
  font-size: 18px;
}

#tab-comunidade .user-feed-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#tab-comunidade .user-feed-name {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}

#tab-comunidade .user-feed-username {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 800;
}

#tab-comunidade .user-feed-course {
  margin-top: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: none;
}

#tab-comunidade .user-feed-exp {
  margin-top: 10px;
  min-height: 36px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(96, 165, 250, 0.14);
  font-size: 12px;
  font-weight: 800;
  width: fit-content;
  max-width: 100%;
}

#tab-comunidade .user-feed-exp-main,
#tab-comunidade .user-feed-exp-compare {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

#tab-comunidade .user-feed-exp-compare {
  color: var(--text-muted);
  font-weight: 700;
}

#tab-comunidade .user-feed-rank-badge {
  min-width: 52px;
  width: 52px;
  min-height: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  color: var(--text-muted);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 241, 255, 0.92));
  border: 1px solid rgba(96, 165, 250, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

#tab-comunidade .community-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#tab-comunidade .comm-stats-grid {
  gap: 14px;
}

#tab-comunidade .comm-stat-item {
  padding: 16px 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(232, 241, 255, 0.9));
  border: 1px solid rgba(96, 165, 250, 0.14);
}

#tab-comunidade .comm-stat-num {
  font-size: 24px;
}

#tab-comunidade .comm-top-list {
  gap: 12px;
}

#tab-comunidade .comm-top-item {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(96, 165, 250, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.88));
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

#tab-comunidade .comm-top-item:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.07);
}

#tab-comunidade .comm-top-rank {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  font-size: 13px;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

#tab-comunidade .comm-top-avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.14);
}

#tab-comunidade .comm-top-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.14);
}

#tab-comunidade .comm-top-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#tab-comunidade .comm-top-name {
  font-size: 14px;
  font-weight: 900;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#tab-comunidade .comm-top-exp {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
}

#tab-comunidade .comm-widget-hint {
  padding: 16px 18px;
  line-height: 1.5;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.92));
}

[data-theme="dark"] #tab-comunidade .comm-sidebar-logo,
[data-theme="dark"] #tab-comunidade .comm-trending,
[data-theme="dark"] #tab-comunidade .comm-widget,
[data-theme="dark"] #tab-comunidade .comm-widget-hint,
[data-theme="dark"] #tab-comunidade .comm-feed-header,
[data-theme="dark"] #tab-comunidade .comm-mobile-header,
[data-theme="dark"] #tab-comunidade .comm-mobile-nav,
[data-theme="dark"] #tab-comunidade .user-feed-item,
[data-theme="dark"] #tab-comunidade .comm-top-item,
[data-theme="dark"] #tab-comunidade .comm-stat-item {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
  border-color: rgba(96, 165, 250, 0.14);
  box-shadow: 0 20px 38px rgba(2, 6, 23, 0.3);
}

[data-theme="dark"] #tab-comunidade .comm-nav-btn.active {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.9));
}

[data-theme="dark"] #tab-comunidade .comm-nav-btn {
  color: #c8d6ee;
}

[data-theme="dark"] #tab-comunidade .comm-nav-btn:hover {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(96, 165, 250, 0.16);
}

[data-theme="dark"] #tab-comunidade .comm-feed-title,
[data-theme="dark"] #tab-comunidade .comm-widget-title,
[data-theme="dark"] #tab-comunidade .comm-trending-title,
[data-theme="dark"] #tab-comunidade .comm-sidebar-logo {
  color: #eef4ff;
}

[data-theme="dark"] #tab-comunidade .comm-search-box input {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.92));
  border-color: rgba(96, 165, 250, 0.16);
  color: #eef4ff;
}

[data-theme="dark"] #tab-comunidade .comm-search-box input::placeholder {
  color: #8ea3c7;
}

[data-theme="dark"] #tab-comunidade .trending-topic,
[data-theme="dark"] #tab-comunidade .user-feed-exp {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.92));
  border-color: rgba(96, 165, 250, 0.14);
  color: #8bb8ff;
}

[data-theme="dark"] #tab-comunidade .user-feed-username,
[data-theme="dark"] #tab-comunidade .comm-mobile-nav-btn.active,
[data-theme="dark"] #tab-comunidade .user-feed-rank-badge {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.92));
  border-color: rgba(96, 165, 250, 0.16);
  color: #8bb8ff;
}

[data-theme="dark"] #tab-comunidade .user-feed-course {
  color: #a7bad8;
}

[data-theme="dark"] #tab-comunidade .user-feed-exp-compare,
[data-theme="dark"] #tab-comunidade .comm-top-exp,
[data-theme="dark"] #tab-comunidade .comm-top-name {
  color: #a7bad8;
}

[data-theme="dark"] #tab-comunidade .comm-top-avatar-placeholder {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 10px 18px rgba(2, 6, 23, 0.28);
}

@media (max-width: 1100px) {
  #tab-comunidade .community-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  #tab-comunidade .community-sidebar,
  #tab-comunidade .community-sidebar-right {
    position: static;
  }
}

@media (max-width: 768px) {
  #tab-comunidade .community-layout {
    gap: 14px;
  }

  #tab-comunidade .comm-mobile-header {
    display: none;
  }

  #tab-comunidade .comm-mobile-nav {
    display: flex;
  }

  #tab-comunidade .comm-mobile-nav {
    padding: 8px;
    gap: 8px;
  }

  #tab-comunidade .comm-mobile-nav-btn {
    min-height: 44px;
    border-radius: 14px;
    font-weight: 800;
  }

  #tab-comunidade .comm-mobile-nav-btn.active {
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.9), rgba(239, 246, 255, 0.92));
  }

  #tab-comunidade .comm-feed-header {
    padding: 14px 14px 12px;
    min-height: auto;
    border-radius: 20px;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }

  #tab-comunidade .comm-feed-title {
    font-size: 16px;
    line-height: 1.2;
  }

  #tab-comunidade .comm-search-box {
    width: 100%;
    min-width: 0;
  }

  #tab-comunidade .comm-search-box input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding-left: 42px;
    padding-right: 14px;
    border-radius: 16px;
    font-size: 14px;
    background: color-mix(in srgb, var(--surface) 82%, black 18%);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  #tab-comunidade .comm-search-box i {
    left: 15px;
    font-size: 15px;
    top: 50%;
    transform: translateY(-50%);
  }

  #tab-comunidade .comm-mobile-nav {
    margin-top: 2px;
    padding: 6px;
    gap: 6px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  }

  #tab-comunidade .comm-mobile-nav-btn {
    min-height: 42px;
    border-radius: 14px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 800;
    background: transparent;
    border: 1px solid transparent;
  }

  #tab-comunidade .comm-mobile-nav-btn.active {
    background: rgba(37, 99, 235, 0.16);
    border-color: rgba(59, 130, 246, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  #tab-comunidade .user-feed-item {
    padding: 16px 14px;
    border-radius: 22px;
    column-gap: 12px;
    align-items: flex-start;
  }

  #tab-comunidade .user-feed-item-ranking {
    grid-template-columns: 52px 52px minmax(0, 1fr);
  }

  #tab-comunidade .user-feed-avatar,
  #tab-comunidade .user-feed-avatar-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 18px;
  }

  #tab-comunidade .user-feed-name {
    font-size: 15px;
  }

  #tab-comunidade .user-feed-course {
    font-size: 13px;
  }

  #tab-comunidade .user-feed-exp {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  #tab-comunidade .user-feed-rank-badge {
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    border-radius: 18px;
    font-size: 17px;
  }
}

@media (max-width: 768px) {
  [data-theme="dark"] #tab-comunidade .comm-feed-header,
  [data-theme="dark"] #tab-comunidade .comm-mobile-nav {
    background: #1b202b;
    border-color: rgba(148, 163, 184, 0.14);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  }

  [data-theme="dark"] #tab-comunidade .comm-search-box input {
    background: #202737;
    border-color: rgba(148, 163, 184, 0.14);
    color: #dbe7ff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }

  [data-theme="dark"] #tab-comunidade .comm-search-box i {
    color: #8ea3c7;
  }

  [data-theme="dark"] #tab-comunidade .comm-mobile-nav-btn {
    color: #91a4c5;
  }

  [data-theme="dark"] #tab-comunidade .comm-mobile-nav-btn.active {
    background: #22314d;
    border-color: rgba(59, 130, 246, 0.18);
    color: #77abff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }
}

/* DUELO UI REFRESH */
#tab-duelo .duelo-container {
  max-width: 1240px;
  padding: 10px 0 110px;
}

#tab-duelo .duelo-header {
  padding: 16px 18px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

#tab-duelo .duelo-main {
  align-items: start;
}

#tab-duelo .duelo-challenges h3,
#tab-duelo .duelo-leaderboard h3 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 900;
}

#tab-duelo .duelo-cards {
  gap: 16px;
}

#tab-duelo .duelo-cards > div {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 24px !important;
  padding: 22px !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease !important;
}

#tab-duelo .duelo-cards > div:hover {
  border-color: rgba(59, 130, 246, 0.2) !important;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08) !important;
}

#tab-duelo .duelo-cards > div > div:first-child {
  gap: 14px !important;
}

#tab-duelo .duelo-cards > div > div:first-child > div:first-child {
  gap: 14px !important;
}

#tab-duelo .duelo-cards > div img {
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
}

#tab-duelo .duelo-cards > div > div:nth-child(2) {
  background: var(--bg) !important;
  border: 1px dashed var(--border) !important;
  border-radius: 18px !important;
  padding: 16px !important;
}

#tab-duelo .duelo-cards > div > div:nth-child(2) > div:nth-child(2) {
  color: var(--text) !important;
}

#tab-duelo .duelo-cards > div > div:last-child {
  align-items: stretch !important;
}

#tab-duelo .duelo-cards > div .btn-primary {
  min-height: 52px;
  border-radius: 16px !important;
  font-weight: 800;
}

#tab-duelo .duelo-cards > div .btn-ghost {
  min-width: 56px;
  border-radius: 16px !important;
}

#tab-duelo .duelo-cards > div.empty-state,
#tab-duelo .duelo-empty-state {
  min-height: 210px;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: transparent !important;
  border: 2px dashed var(--border) !important;
  box-shadow: none !important;
}

#tab-duelo .duelo-empty-state i {
  font-size: 40px;
  color: var(--text-muted);
}

#tab-duelo .duelo-empty-state span {
  color: var(--text-sub);
  font-weight: 800;
}

#tab-duelo .duelo-profile-card {
  display: grid;
  grid-template-columns: 34px 46px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#tab-duelo .duelo-profile-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.2);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

#tab-duelo .duelo-profile-rank {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  background: var(--input-bg);
  color: var(--text-muted);
}

#tab-duelo .duelo-profile-rank.gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
#tab-duelo .duelo-profile-rank.silver { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
#tab-duelo .duelo-profile-rank.bronze { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }

#tab-duelo .duelo-profile-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid rgba(59, 130, 246, 0.12);
  box-shadow: 0 10px 18px rgba(37, 99, 235, 0.14);
}

#tab-duelo .duelo-profile-copy {
  min-width: 0;
}

#tab-duelo .duelo-profile-name {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
}

#tab-duelo .duelo-profile-exp {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  color: var(--success);
}

#tab-duelo .duelo-lb-empty {
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
}

#tab-duelo .duelo-leaderboard,
#tab-duelo .duelo-challenges {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#tab-duelo .duelo-leaderboard > h3,
#tab-duelo .duelo-challenges > h3 {
  padding-left: 4px;
}

#tab-duelo .duelo-lobby,
#tab-duelo .duelo-arena,
#tab-duelo .duelo-results-card,
#tab-duelo .duelo-gabarito {
  border-radius: 26px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
}

#tab-duelo .duelo-lobby {
  padding: 30px 24px;
}

#tab-duelo .duelo-lobby-players {
  gap: 18px;
}

#tab-duelo .lobby-player {
  flex: 1;
  max-width: 220px;
  padding: 18px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 22px;
}

#tab-duelo .lobby-player img {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  margin-bottom: 12px;
}

#tab-duelo .lobby-vs {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.08);
}

#tab-duelo .duelo-exit-btn,
#tab-duelo #btn-ready-duel {
  min-height: 50px;
  border-radius: 16px;
  font-weight: 800;
}

#tab-duelo .duelo-arena {
  border-color: rgba(59, 130, 246, 0.18);
}

#tab-duelo .duelo-arena-header {
  padding-bottom: 18px;
}

#tab-duelo .duelo-timer-wrap,
#tab-duelo .duelo-score-wrap {
  min-width: 180px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
}

#tab-duelo #duel-timer,
#tab-duelo #duel-score {
  display: block;
}

#tab-duelo .duelo-q-badge {
  border-radius: 12px;
}

#tab-duelo .duelo-option {
  border-radius: 16px;
  padding: 16px 18px;
  background: var(--surface);
}

#tab-duelo .duelo-option:hover {
  transform: translateY(-1px);
}

#tab-duelo .duelo-scores {
  border: 1px solid var(--border);
}

#tab-duelo .score-box {
  padding: 14px;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
}

#tab-duelo .gabarito-item {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 16px;
}

[data-theme="dark"] #tab-duelo .duelo-header,
[data-theme="dark"] #tab-duelo .duelo-profile-card,
[data-theme="dark"] #tab-duelo .duelo-lb-empty,
[data-theme="dark"] #tab-duelo .duelo-lobby,
[data-theme="dark"] #tab-duelo .duelo-arena,
[data-theme="dark"] #tab-duelo .duelo-results-card,
[data-theme="dark"] #tab-duelo .duelo-gabarito,
[data-theme="dark"] #tab-duelo .duelo-cards > div {
  background: #1b202b !important;
  border-color: rgba(148, 163, 184, 0.14) !important;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24) !important;
}

[data-theme="dark"] #tab-duelo .lobby-player,
[data-theme="dark"] #tab-duelo .duelo-timer-wrap,
[data-theme="dark"] #tab-duelo .duelo-score-wrap,
[data-theme="dark"] #tab-duelo .score-box,
[data-theme="dark"] #tab-duelo .gabarito-item,
[data-theme="dark"] #tab-duelo .duelo-cards > div > div:nth-child(2),
[data-theme="dark"] #tab-duelo .duelo-empty-state,
[data-theme="dark"] #tab-duelo .duelo-option {
  background: #202737 !important;
  border-color: rgba(148, 163, 184, 0.14) !important;
}

[data-theme="dark"] #tab-duelo .duelo-profile-name,
[data-theme="dark"] #tab-duelo .duelo-title,
[data-theme="dark"] #tab-duelo .duelo-challenges h3,
[data-theme="dark"] #tab-duelo .duelo-leaderboard h3,
[data-theme="dark"] #tab-duelo #duel-question {
  color: #f3f7ff;
}

[data-theme="dark"] #tab-duelo .duelo-profile-rank.other,
[data-theme="dark"] #tab-duelo .duelo-lobby-badge,
[data-theme="dark"] #tab-duelo .duelo-q-badge,
[data-theme="dark"] #tab-duelo .duelo-cards > div > div:first-child > div:last-child {
  background: #22314d !important;
  color: #77abff !important;
  border-color: rgba(59, 130, 246, 0.18) !important;
}

@media (max-width: 900px) {
  #tab-duelo .duelo-container {
    padding: 6px 0 100px;
  }

  #tab-duelo .duelo-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  #tab-duelo .duelo-container {
    padding: 8px 12px 100px;
  }

  #tab-duelo .duelo-header {
    padding: 14px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
  }

  #tab-duelo .duelo-title {
    font-size: 18px;
  }

  #tab-duelo .duelo-cards > div,
  #tab-duelo .duelo-lobby,
  #tab-duelo .duelo-arena,
  #tab-duelo .duelo-results-card,
  #tab-duelo .duelo-gabarito {
    border-radius: 22px !important;
  }

  #tab-duelo .duelo-cards > div {
    padding: 16px !important;
    gap: 16px !important;
  }

  #tab-duelo .duelo-profile-card {
    grid-template-columns: 30px 42px minmax(0, 1fr);
  }

  #tab-duelo .duelo-profile-avatar {
    width: 42px;
    height: 42px;
  }

  #tab-duelo .duelo-lobby-players {
    flex-direction: column;
  }

  #tab-duelo .lobby-player {
    max-width: none;
    width: 100%;
  }

  #tab-duelo .lobby-vs {
    width: 48px;
    height: 48px;
  }

  #tab-duelo .duelo-arena-header {
    flex-direction: column;
    gap: 12px;
  }

  #tab-duelo .duelo-timer-wrap,
  #tab-duelo .duelo-score-wrap {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  #tab-duelo .duelo-scores {
    grid-template-columns: 1fr;
  }
}

/* COMMUNITY PVP STYLE */
#tab-comunidade .community-layout {
  grid-template-columns: 250px minmax(0, 1fr) 290px;
  gap: 20px;
  max-width: 1240px;
  min-height: auto;
  padding: 6px 0 110px;
}

#tab-comunidade .community-sidebar,
#tab-comunidade .community-feed,
#tab-comunidade .community-sidebar-right {
  border: none;
  min-height: auto;
}

#tab-comunidade .community-sidebar,
#tab-comunidade .community-sidebar-right {
  top: 18px;
  padding: 0;
}

#tab-comunidade .community-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#tab-comunidade .comm-sidebar-logo,
#tab-comunidade .comm-trending,
#tab-comunidade .comm-widget,
#tab-comunidade .comm-widget-hint,
#tab-comunidade .comm-feed-header,
#tab-comunidade .comm-mobile-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

#tab-comunidade .comm-sidebar-logo {
  min-height: 74px;
  margin-bottom: 18px;
  padding: 0 20px;
  font-size: 18px;
}

#tab-comunidade .comm-sidebar-logo i {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.12);
}

#tab-comunidade .comm-nav {
  gap: 10px;
}

#tab-comunidade .comm-nav-btn {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text-sub);
  font-weight: 700;
}

#tab-comunidade .comm-nav-btn:hover {
  background: var(--surface);
  border-color: var(--border);
}

#tab-comunidade .comm-nav-btn.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(59, 130, 246, 0.18);
  color: var(--blue-600);
}

#tab-comunidade .comm-trending,
#tab-comunidade .comm-widget {
  padding: 18px;
}

#tab-comunidade .comm-trending-title,
#tab-comunidade .comm-widget-title,
#tab-comunidade .comm-feed-title {
  font-size: 16px;
  font-weight: 800;
}

#tab-comunidade .trending-topic {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--input-bg);
  border: 1px solid var(--border);
}

#tab-comunidade .comm-feed-header {
  position: relative;
  top: auto;
  padding: 16px 18px;
  z-index: auto;
}

#tab-comunidade .comm-feed-title {
  margin: 0 0 14px 0;
}

#tab-comunidade .comm-search-box input {
  min-height: 48px;
  padding: 0 16px 0 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
}

#tab-comunidade .comm-search-box input:focus {
  background: var(--bg);
}

#tab-comunidade .comm-mobile-nav {
  padding: 6px;
  gap: 6px;
}

#tab-comunidade .comm-mobile-nav-btn {
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid transparent;
}

#tab-comunidade .comm-mobile-nav-btn.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(59, 130, 246, 0.18);
  color: var(--blue-600);
}

#tab-comunidade .users-feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#tab-comunidade .user-feed-item,
#tab-comunidade .comm-top-item {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

#tab-comunidade .user-feed-item {
  border-radius: 20px;
}

#tab-comunidade .user-feed-avatar,
#tab-comunidade .user-feed-avatar-placeholder {
  border-radius: 16px;
}

#tab-comunidade .user-feed-avatar-placeholder {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}

#tab-comunidade .user-feed-name {
  font-size: 16px;
}

#tab-comunidade .user-feed-username {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(59, 130, 246, 0.14);
  background: rgba(37, 99, 235, 0.1);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.02em;
}

#tab-comunidade .user-feed-course {
  color: var(--text-sub);
}

#tab-comunidade .user-feed-exp {
  background: var(--bg);
  border-color: var(--border);
}

#tab-comunidade .comm-stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#tab-comunidade .comm-stat-item {
  background: var(--bg);
  border: 1px solid var(--border);
}

#tab-comunidade .comm-top-item {
  border-radius: 16px;
}

#tab-comunidade .comm-top-rank {
  box-shadow: none;
}

#tab-comunidade .comm-widget-hint {
  justify-content: flex-start;
  text-align: left;
}

[data-theme="dark"] #tab-comunidade .comm-sidebar-logo,
[data-theme="dark"] #tab-comunidade .comm-trending,
[data-theme="dark"] #tab-comunidade .comm-widget,
[data-theme="dark"] #tab-comunidade .comm-widget-hint,
[data-theme="dark"] #tab-comunidade .comm-feed-header,
[data-theme="dark"] #tab-comunidade .comm-mobile-nav,
[data-theme="dark"] #tab-comunidade .user-feed-item,
[data-theme="dark"] #tab-comunidade .comm-top-item {
  background: #1b202b;
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] #tab-comunidade .comm-search-box input,
[data-theme="dark"] #tab-comunidade .trending-topic,
[data-theme="dark"] #tab-comunidade .comm-stat-item,
[data-theme="dark"] #tab-comunidade .user-feed-exp {
  background: #202737;
  border-color: rgba(148, 163, 184, 0.14);
  color: #dbe7ff;
}

[data-theme="dark"] #tab-comunidade .comm-nav-btn {
  color: #a7bad8;
}

[data-theme="dark"] #tab-comunidade .comm-nav-btn:hover {
  background: #1b202b;
}

[data-theme="dark"] #tab-comunidade .comm-nav-btn.active,
[data-theme="dark"] #tab-comunidade .comm-mobile-nav-btn.active,
[data-theme="dark"] #tab-comunidade .user-feed-username {
  background: #22314d;
  border-color: rgba(59, 130, 246, 0.2);
  color: #77abff;
}

[data-theme="dark"] #tab-comunidade .comm-feed-title,
[data-theme="dark"] #tab-comunidade .comm-widget-title,
[data-theme="dark"] #tab-comunidade .comm-trending-title,
[data-theme="dark"] #tab-comunidade .comm-sidebar-logo,
[data-theme="dark"] #tab-comunidade .user-feed-name,
[data-theme="dark"] #tab-comunidade .comm-top-name {
  color: #f3f7ff;
}

[data-theme="dark"] #tab-comunidade .user-feed-course,
[data-theme="dark"] #tab-comunidade .user-feed-exp-compare,
[data-theme="dark"] #tab-comunidade .comm-top-exp,
[data-theme="dark"] #tab-comunidade .comm-widget-hint,
[data-theme="dark"] #tab-comunidade .comm-stat-label {
  color: #9fb2d3;
}

@media (max-width: 1100px) {
  #tab-comunidade .community-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  #tab-comunidade .community-sidebar,
  #tab-comunidade .community-sidebar-right {
    display: none;
  }
}

@media (max-width: 768px) {
  #tab-comunidade .community-layout {
    padding-bottom: 100px;
  }

  #tab-comunidade .community-feed {
    padding: 8px 12px 0;
  }

  #tab-comunidade .comm-feed-header,
  #tab-comunidade .comm-mobile-nav,
  #tab-comunidade .user-feed-item {
    border-radius: 20px;
  }

  #tab-comunidade .comm-feed-header {
    padding: 14px 16px 16px;
    margin-bottom: 0;
    row-gap: 14px;
  }

  #tab-comunidade .comm-feed-title {
    font-size: 16px;
    margin-bottom: 0;
  }

  #tab-comunidade .comm-search-box {
    margin-top: 2px;
  }

  #tab-comunidade .comm-search-box input {
    min-height: 46px;
    font-size: 14px;
    border-radius: 14px;
    margin-bottom: 0;
  }

  #tab-comunidade .comm-mobile-nav {
    padding: 6px;
  }

  #tab-comunidade .comm-mobile-nav-btn {
    min-height: 40px;
    font-size: 14px;
  }

  #tab-comunidade .user-feed-item {
    padding: 14px;
  }

  #tab-comunidade .user-feed-item-ranking {
    grid-template-columns: 52px 52px minmax(0, 1fr);
  }
}
