:root {
  --bg-main: #eef2f9;
  --bg-surface: #ffffff;
  --bg-card: #f4f6fb;
  --bg-elevated: #e2e8f0;
  --border-subtle: rgba(15, 23, 42, 0.1);
  --primary: #7c5cff;
  --primary-hover: #6744f5;
  --accent: #ff4d8d;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --cyan: #0284c7;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.08);
}

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

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  touch-action: manipulation;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

.hidden { display: none !important; }
.muted-text { color: var(--text-muted); font-size: 0.9rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, opacity 0.2s;
  color: #ffffff;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-accent { background: linear-gradient(135deg, var(--accent), #ff7a59); }
.btn-ghost { background: #e2e8f0; color: var(--text-main); }
.btn-ghost:hover:not(:disabled) { background: #cbd5e1; }
.btn-sm { padding: 6px 12px; font-size: 0.83rem; }
.btn-xs { padding: 4px 8px; font-size: 0.76rem; }
.btn-full { width: 100%; }
input[type="text"], input[type="number"], input[type="password"], select, textarea {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #ffffff; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.84rem; color: var(--text-muted); font-weight: 600; }
.full-col { grid-column: 1 / -1; }

.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #e0e7ff, #fce7f3);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  overflow-y: auto;
}
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-card);
}
.brand-logo {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--cyan), var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 10px;
}

.radio-pill-group { display: flex; gap: 8px; }
.radio-pill { flex: 1; cursor: pointer; }
.radio-pill input { display: none; }
.radio-pill span {
  display: block;
  text-align: center;
  padding: 9px 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-main);
}
.radio-pill input:checked + span {
  background: rgba(124, 92, 255, 0.14);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.app-layout { display: flex; flex-direction: column; min-height: 100vh; width: 100%; }
.topbar {
  height: 64px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand-logo-sm {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--cyan), var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar-stats { display: flex; align-items: center; gap: 12px; }
.xp-widget { width: 165px; }
.xp-label { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 4px; color: var(--text-muted); }
.xp-label strong { color: var(--primary); }
.xp-bar-track { height: 7px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.35s; }

.stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-main);
}
.crystals-pill { color: #0284c7; background: #e0f2fe; border-color: #bae6fd; }
.limit-pill.vip-active { background: linear-gradient(135deg, #fef3c7, #fce7f3); border-color: #f59e0b; color: #b45309; }
.notify-dot { width: 8px; height: 8px; background: #fde047; border-radius: 50%; display: inline-block; }

.workspace { display: flex; flex: 1; width: 100%; }
.sidebar-nav {
  width: 215px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}
.nav-item:hover { background: #f1f5f9; color: var(--text-main); }
.nav-item.active { background: rgba(124, 92, 255, 0.12); color: var(--primary); font-weight: 700; }

.main-content { flex: 1; padding: 22px; max-width: 1360px; margin: 0 auto; width: 100%; min-width: 0; }
.panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }

.toast-container { position: fixed; bottom: 20px; right: 20px; left: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; z-index: 2000; pointer-events: none; }
.toast {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 0.9rem;
  font-weight: 500;
  max-width: 100%;
}
.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.danger  { border-left-color: var(--danger); }

@media (max-width: 860px) {
  .hide-mobile { display: none; }
  .topbar { height: auto; min-height: 56px; padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .brand-logo-sm { font-size: 1.1rem; }
  .topbar-stats { gap: 6px; width: 100%; justify-content: space-between; }
  .xp-widget { flex: 1; min-width: 100px; max-width: 150px; }
  .workspace { flex-direction: column; width: 100%; }
  .sidebar-nav {
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 6px 4px;
    gap: 2px;
  }
  .nav-item {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    font-size: 0.72rem;
    white-space: nowrap;
  }
  .main-content { padding: 12px; width: 100%; max-width: 100%; margin: 0; }
  .auth-overlay { padding: 12px; align-items: flex-start; }
  .auth-card { padding: 18px 14px; width: 100%; max-width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Yjdsq ,htyl-kjujnbg DVLIKE.RU */
.dv-brand { display: inline-flex; align-items: center; gap: 8px; user-select: none; }
.dv-brand-icon { width: 28px; height: 28px; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.45)); }
.dv-brand-text { font-size: 1.35rem; font-weight: 900; letter-spacing: 0.5px; background: linear-gradient(90deg, #00f0ff 0%, #a855f7 50%, #ff2a85 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; line-height: 1; }
.dv-brand-zone { font-size: 0.68rem; font-weight: 800; color: #00f0ff; background: rgba(0, 240, 255, 0.12); border: 1px solid rgba(0, 240, 255, 0.35); border-radius: 6px; padding: 2px 5px; letter-spacing: 0.6px; margin-left: -4px; }
.dv-brand-lg .dv-brand-icon { width: 38px; height: 38px; }
.dv-brand-lg .dv-brand-text { font-size: 1.9rem; }
@media (max-width: 860px) { .dv-brand-icon { width: 24px; height: 24px; } .dv-brand-text { font-size: 1.15rem; } }
.dv-brand-text { background: linear-gradient(90deg, #2563eb 0%, #7c3aed 55%, #ec4899 100%) !important; -webkit-background-clip: text !important; -webkit-text-fill-color: transparent !important; }
.dv-brand-zone { color: #7c3aed !important; background: rgba(124, 58, 237, 0.1) !important; border-color: rgba(124, 58, 237, 0.3) !important; }
