/* ============================================
   Backspace.me Documentation Hub
   style.css — Dark/Light theme, responsive layout
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Sizing */
  --sidebar-width: 280px;
  --toc-width: 220px;
  --header-height: 60px;
  --content-max-width: 820px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg-primary: #121212;
  --bg-secondary: #1A1A1A;
  --bg-tertiary: #222222;
  --bg-hover: #2A2A2A;
  --bg-active: #333333;
  --bg-code: #1E1E1E;
  --bg-code-block: #0D0D0D;
  --bg-badge: #2A2215;

  --border-primary: #2A2A2A;
  --border-secondary: #333333;
  --border-accent: #F5A623;

  --text-primary: #E8E8E8;
  --text-secondary: #A0A0A0;
  --text-tertiary: #666666;
  --text-accent: #F5A623;
  --text-link: #F5A623;
  --text-code: #E06C75;

  --accent: #F5A623;
  --accent-hover: #FFBA42;
  --accent-dim: rgba(245, 166, 35, 0.1);
  --accent-glow: rgba(245, 166, 35, 0.15);

  --success: #4CAF50;
  --warning: #FF9800;
  --error: #F44336;
  --info: #2196F3;

  --scrollbar-track: #1A1A1A;
  --scrollbar-thumb: #333333;
  --scrollbar-thumb-hover: #444444;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);

  --search-bg: #1E1E1E;
  --search-border: #333333;

  --table-header-bg: #1E1E1E;
  --table-row-alt: #1A1A1A;
  --table-border: #2A2A2A;
}

/* Light theme */
[data-theme="light"] {
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F8F8;
  --bg-tertiary: #F0F0F0;
  --bg-hover: #ECECEC;
  --bg-active: #E0E0E0;
  --bg-code: #F5F5F5;
  --bg-code-block: #1E1E1E;
  --bg-badge: #FFF8E7;

  --border-primary: #E0E0E0;
  --border-secondary: #D0D0D0;
  --border-accent: #E09000;

  --text-primary: #1A1A1A;
  --text-secondary: #555555;
  --text-tertiary: #888888;
  --text-accent: #D08A00;
  --text-link: #C07A00;
  --text-code: #C7254E;

  --accent: #E09000;
  --accent-hover: #C07A00;
  --accent-dim: rgba(224, 144, 0, 0.08);
  --accent-glow: rgba(224, 144, 0, 0.1);

  --success: #2E7D32;
  --warning: #E65100;
  --error: #C62828;
  --info: #1565C0;

  --scrollbar-track: #F0F0F0;
  --scrollbar-thumb: #C0C0C0;
  --scrollbar-thumb-hover: #A0A0A0;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  --search-bg: #FFFFFF;
  --search-border: #D0D0D0;

  --table-header-bg: #F0F0F0;
  --table-row-alt: #F8F8F8;
  --table-border: #E0E0E0;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background var(--transition-normal), color var(--transition-normal);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-hover);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* ---------- Header ---------- */
.doc-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: var(--sidebar-width);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.header-logo svg {
  width: 28px;
  height: 28px;
}

.header-logo .logo-accent {
  color: var(--accent);
}

.header-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--bg-badge);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

.header-search {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.header-search input {
  width: 100%;
  height: 38px;
  background: var(--search-bg);
  border: 1px solid var(--search-border);
  border-radius: 8px;
  padding: 0 14px 0 38px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.header-search input::placeholder {
  color: var(--text-tertiary);
}

.header-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.header-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.header-search .search-shortcut {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.header-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header-btn svg {
  width: 20px;
  height: 20px;
}

.mobile-menu-btn {
  display: none;
}

/* ---------- Search Results Overlay ---------- */
.search-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.search-overlay.active {
  display: block;
}

.search-results {
  display: none;
  position: fixed;
  top: calc(var(--header-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 560px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 1001;
  padding: 8px;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-result-item:hover,
.search-result-item.selected {
  background: var(--bg-hover);
}

.search-result-item .result-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.search-result-item .result-section {
  font-size: 12px;
  color: var(--text-tertiary);
}

.search-result-item .result-snippet {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.search-result-item mark {
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 2px;
}

.search-no-results {
  padding: 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ---------- Layout ---------- */
.doc-layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ---------- Sidebar ---------- */
.doc-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 0;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.sidebar-section {
  margin-bottom: 4px;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}

.sidebar-section-title:hover {
  color: var(--text-secondary);
}

.sidebar-section-title .chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.sidebar-section.collapsed .chevron {
  transform: rotate(-90deg);
}

.sidebar-section.collapsed .sidebar-links {
  display: none;
}

.sidebar-links {
  list-style: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 20px 7px 28px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast),
              border-left var(--transition-fast);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.6;
}

.sidebar-link.active svg {
  opacity: 1;
}

/* ---------- Main Content ---------- */
.doc-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-right: var(--toc-width);
  padding: 32px 48px 80px;
  max-width: calc(100% - var(--sidebar-width) - var(--toc-width));
  min-height: calc(100vh - var(--header-height));
}

.doc-content-inner {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

.breadcrumbs a {
  color: var(--text-tertiary);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .separator {
  font-size: 10px;
}

.breadcrumbs .current {
  color: var(--text-secondary);
}

/* Page sections */
.doc-page {
  display: none;
  animation: fadeIn 0.2s ease;
}

.doc-page.active {
  display: block;
}

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

/* Typography */
.doc-page h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.doc-page h1 .accent {
  color: var(--accent);
}

.doc-page .page-description {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}

.doc-page h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-primary);
  letter-spacing: -0.3px;
}

.doc-page h2:first-of-type {
  margin-top: 0;
}

.doc-page h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 12px;
}

.doc-page h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 24px 0 8px;
}

.doc-page p {
  margin-bottom: 16px;
  color: var(--text-primary);
  line-height: 1.7;
}

.doc-page ul, .doc-page ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.doc-page li {
  margin-bottom: 6px;
  color: var(--text-primary);
  line-height: 1.6;
}

.doc-page li strong {
  color: var(--text-primary);
}

.doc-page strong {
  font-weight: 600;
}

/* Inline code */
.doc-page code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-code);
  color: var(--text-code);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-primary);
}

/* Code blocks */
.code-block {
  position: relative;
  margin: 16px 0 24px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-primary);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-primary);
  font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.code-block-copy {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-sans);
  padding: 4px 8px;
  border-radius: 4px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.code-block-copy:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.code-block-copy.copied {
  color: var(--success);
}

.code-block-copy svg {
  width: 14px;
  height: 14px;
}

.code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  background: var(--bg-code-block);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #ABB2BF;
}

.code-block pre code {
  font-family: inherit;
  font-size: inherit;
}

/* Syntax colors */
.code-block .keyword { color: #C678DD; }
.code-block .string { color: #98C379; }
.code-block .comment { color: #5C6370; font-style: italic; }
.code-block .function { color: #61AFEF; }
.code-block .number { color: #D19A66; }
.code-block .variable { color: #E06C75; }
.code-block .operator { color: #56B6C2; }
.code-block .punctuation { color: #ABB2BF; }

/* Callout boxes */
.callout {
  margin: 20px 0;
  padding: 16px 20px;
  border-radius: 8px;
  border-left: 4px solid;
  font-size: 14px;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}

.callout-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.callout.info {
  background: rgba(33, 150, 243, 0.08);
  border-color: var(--info);
}
.callout.info .callout-title { color: var(--info); }

.callout.warning {
  background: rgba(255, 152, 0, 0.08);
  border-color: var(--warning);
}
.callout.warning .callout-title { color: var(--warning); }

.callout.tip {
  background: rgba(76, 175, 80, 0.08);
  border-color: var(--success);
}
.callout.tip .callout-title { color: var(--success); }

.callout.danger {
  background: rgba(244, 67, 54, 0.08);
  border-color: var(--error);
}
.callout.danger .callout-title { color: var(--error); }

.callout p:last-child {
  margin-bottom: 0;
}

/* Tables */
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
  border: 1px solid var(--table-border);
  border-radius: 8px;
  overflow: hidden;
}

.doc-table th {
  background: var(--table-header-bg);
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--table-border);
  font-size: 13px;
}

.doc-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--table-border);
  color: var(--text-primary);
}

.doc-table tr:nth-child(even) td {
  background: var(--table-row-alt);
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table code {
  font-size: 12px;
}

/* Feature cards (for welcome page) */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast),
              transform var(--transition-fast);
}

.feature-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-2px);
}

.feature-card-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-dim);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--accent);
}

.feature-card-icon svg {
  width: 20px;
  height: 20px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* Prev/Next navigation */
.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border-primary);
}

.page-nav-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  max-width: 50%;
  text-decoration: none;
}

.page-nav-btn:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.page-nav-btn.next {
  margin-left: auto;
  text-align: right;
}

.page-nav-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.page-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

/* ---------- Table of Contents (Right side) ---------- */
.doc-toc {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--toc-width);
  padding: 24px 16px;
  overflow-y: auto;
  border-left: 1px solid var(--border-primary);
  background: var(--bg-primary);
}

.toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.toc-links {
  list-style: none;
}

.toc-link {
  display: block;
  padding: 4px 0 4px 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  text-decoration: none;
  line-height: 1.4;
  margin-bottom: 2px;
}

.toc-link:hover {
  color: var(--text-secondary);
}

.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.toc-link.depth-3 {
  padding-left: 24px;
  font-size: 12px;
}

/* ---------- Footer ---------- */
.doc-footer {
  text-align: center;
  padding: 24px;
  font-size: 13px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-primary);
  margin-top: 48px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .doc-toc {
    display: none;
  }
  .doc-content {
    margin-right: 0;
    max-width: calc(100% - var(--sidebar-width));
  }
}

@media (max-width: 860px) {
  .mobile-menu-btn {
    display: flex;
  }

  .header-left {
    min-width: auto;
  }

  .header-badge {
    display: none;
  }

  .header-search .search-shortcut {
    display: none;
  }

  .doc-sidebar {
    transform: translateX(-100%);
    z-index: 500;
    box-shadow: var(--shadow-lg);
  }

  .doc-sidebar.open {
    transform: translateX(0);
  }

  .doc-content {
    margin-left: 0;
    max-width: 100%;
    padding: 24px 20px 60px;
  }

  .page-nav {
    flex-direction: column;
  }

  .page-nav-btn {
    max-width: 100%;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .doc-page h1 {
    font-size: 26px;
  }
  .doc-page h2 {
    font-size: 20px;
  }
  .header-center {
    padding: 0 8px;
  }
}

/* ---------- Sidebar overlay on mobile ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 499;
}

.sidebar-overlay.active {
  display: block;
}

/* ---------- Command table specific ---------- */
.command-table td:first-child code {
  white-space: nowrap;
  color: var(--accent);
  background: var(--accent-dim);
  border-color: transparent;
}

/* ---------- Hero section on welcome ---------- */
.hero-section {
  text-align: center;
  padding: 48px 0 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-primary);
}

.hero-section h1 {
  font-size: 40px;
  margin-bottom: 12px;
}

.hero-section .page-description {
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto 24px;
}

.hero-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.hero-badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* ---------- Heading anchors ---------- */
.heading-anchor {
  color: var(--text-tertiary);
  text-decoration: none;
  margin-left: 8px;
  opacity: 0;
  transition: opacity var(--transition-fast);
  font-weight: 400;
}

h2:hover .heading-anchor,
h3:hover .heading-anchor {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--accent);
}

/* ---------- Difficulty tier badges ---------- */
.tier-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.tier-badge.easy { background: rgba(76,175,80,0.15); color: var(--success); }
.tier-badge.medium { background: rgba(255,152,0,0.15); color: var(--warning); }
.tier-badge.hard { background: rgba(244,67,54,0.15); color: var(--error); }
.tier-badge.legendary { background: rgba(245,166,35,0.15); color: var(--accent); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  z-index: 50;
  box-shadow: var(--shadow-md);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-2px);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}
