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

:root {
  --chrome-bg: rgba(18, 18, 24, 0.92);
  --chrome-border: rgba(255, 255, 255, 0.08);
  --tab-bg: rgba(255, 255, 255, 0.06);
  --tab-active: rgba(255, 255, 255, 0.12);
  --address-bg: rgba(0, 0, 0, 0.4);
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.4);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --content-bg: #0f0f17;
}

body {
  background: #08080d;
  font-family: 'Bricolage Grotesque', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Glassmorphism chrome */
.browser-chrome {
  background: var(--chrome-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--chrome-border);
}

/* Address bar */
.address-bar {
  background: var(--address-bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.address-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.address-bar input {
  background: transparent;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

/* Nav buttons */
.nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.nav-btn:active {
  transform: scale(0.9);
}

/* Spinning refresh */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning {
  animation: spin 0.6s ease-in-out;
}

/* Nested browser wrapper */
.nested-browser {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

/* Auto-dive animation */
@keyframes dive-pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 20px 4px var(--accent-glow); }
}

.diving {
  animation: dive-pulse 0.8s ease-in-out;
}

/* Content pages */
.page-content {
  background: var(--content-bg);
  color: var(--text-primary);
}

/* Recurgle search engine */
.recurgle-logo {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -2px;
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.search-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 10px 20px;
  color: var(--text-primary);
  width: 100%;
  max-width: 400px;
  outline: none;
  font-family: 'Bricolage Grotesque', sans-serif;
  transition: border-color 0.2s;
}

.search-box:focus {
  border-color: var(--accent);
}

/* Infiniscroll */
.post-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

/* Control panel */
.control-panel {
  background: rgba(18, 18, 24, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  z-index: 9999;
}

/* Custom slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--accent-glow);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Theme: light */
.theme-light {
  --chrome-bg: rgba(242, 242, 247, 0.95);
  --chrome-border: rgba(0, 0, 0, 0.1);
  --tab-bg: rgba(0, 0, 0, 0.04);
  --tab-active: rgba(0, 0, 0, 0.08);
  --address-bg: rgba(0, 0, 0, 0.06);
  --text-primary: #1a1a2e;
  --text-secondary: #64748b;
  --content-bg: #ffffff;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);
}

/* Theme: retro */
.theme-retro {
  --chrome-bg: rgba(192, 192, 192, 0.95);
  --chrome-border: #808080;
  --tab-bg: #c0c0c0;
  --tab-active: #dfdfdf;
  --address-bg: #ffffff;
  --text-primary: #000000;
  --text-secondary: #333333;
  --content-bg: #008080;
  --accent: #000080;
  --accent-glow: rgba(0, 0, 128, 0.3);
}

.theme-retro .browser-chrome {
  backdrop-filter: none;
  border-bottom: 2px outset #ffffff;
}

.theme-retro .address-bar {
  border-radius: 0;
  border: 2px inset #808080;
}

.theme-retro .nav-btn {
  border-radius: 0;
  border: 2px outset #ffffff;
  background: #c0c0c0;
}

.theme-retro .nav-btn:active {
  border-style: inset;
}

/* Theme: neon */
.theme-neon {
  --chrome-bg: rgba(5, 5, 15, 0.95);
  --chrome-border: rgba(0, 255, 136, 0.2);
  --tab-bg: rgba(0, 255, 136, 0.05);
  --tab-active: rgba(0, 255, 136, 0.12);
  --address-bg: rgba(0, 0, 0, 0.6);
  --text-primary: #00ff88;
  --text-secondary: #00cc6a;
  --content-bg: #050510;
  --accent: #ff00ff;
  --accent-glow: rgba(255, 0, 255, 0.4);
}

.theme-neon .browser-chrome {
  border-bottom: 1px solid rgba(0, 255, 136, 0.3);
  box-shadow: 0 2px 20px rgba(0, 255, 136, 0.1);
}

/* Depth shadow layers */
.depth-shadow {
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 40px rgba(99, 102, 241, 0.05);
}

/* Perspective container */
.perspective-container {
  perspective: 1200px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Tab */
.tab {
  background: var(--tab-bg);
  border-radius: 8px 8px 0 0;
  padding: 6px 14px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab.active {
  background: var(--tab-active);
  color: var(--text-primary);
}

/* Bottom message */
.bottom-message {
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
}

/* Fade in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Auto-dive zoom */
@keyframes autoDiveZoom {
  0% { transform: scale(1); }
  100% { transform: scale(2.5); }
}

.auto-diving-container {
  transition: transform 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Floating panel drag handle */
.drag-handle {
  cursor: grab;
}

.drag-handle:active {
  cursor: grabbing;
}

/* Link styling in content */
.content-link {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  transition: opacity 0.15s;
}

.content-link:hover {
  opacity: 0.8;
}

/* Footer */
.remix-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  transition: color 0.2s;
}

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