:focus-visible,
.settings-tab:focus,
.sidebar-btn:focus,
.theme-card:focus,
.theme-btn:focus,
.wisp-option:focus,
.wallpaper-item:focus,
.tab:focus,
.nav-btn-group button:focus,
.nav-action-group button:focus,
#controls-slot button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:root {
  --bg: #061212;
  --surface: #0a1a1a;
  --surface-hover: #0e2222;
  --surface-active: #122a2a;
  --surface-glass: rgba(10, 26, 26, 0.85);
  --border: #143030;
  --border-light: #1a3a3a;
  --border-glow: rgba(0, 229, 255, 0.06);

  --text: #e0f0f0;
  --text-muted: #5a8a8a;
  --text-dim: #3a5a5a;

  --accent: #00e5ff;
  --accent-dim: rgba(0, 229, 255, 0.7);
  --accent-glow: rgba(0, 229, 255, 0.08);

  --success: #00e676;
  --warning: #ffab00;
  --error: #ff1744;
  --info: #00b8d4;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.7);

  --radius-sm: 5px;
  --radius-md: 9px;
  --radius-lg: 13px;
  --radius-full: 9999px;

  --transition-fast: 0.1s ease;
  --transition-normal: 0.18s ease;
  --transition-slow: 0.3s ease;

  --font-sans: "Geist", system-ui, -apple-system, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", monospace;

  --nav-height: 52px;
  --tabs-height: 40px;
  --chrome-height: calc(var(--nav-height) + var(--tabs-height) + 2px);
}

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

body,
html,
#app {
  font-family: var(--font-sans);
  width: 100vw;
  height: 100vh;
  background: var(--bg);
  overflow: hidden;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.browser-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.tabs {
  display: flex;
  align-items: flex-end;
  padding: 8px 10px 0;
  gap: 3px;
  background: var(--bg);
  overflow-x: auto;
  flex-shrink: 0;
  height: var(--tabs-height);
}

.tabs::-webkit-scrollbar {
  height: 0;
}

.tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  min-width: 160px;
  max-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast);
  position: relative;
}

.tab::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--surface);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tab.active::after {
  opacity: 1;
}

.tab:hover {
  background: var(--surface-hover);
}

.tab.active {
  background: var(--surface-hover);
  border-color: var(--border-light);
}

.tab-favicon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  opacity: 0.9;
}

.tab-title {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.tab-close {
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  opacity: 0;
}

.tab:hover .tab-close {
  opacity: 1;
}

.tab-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.new-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 12px;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.new-tab:hover {
  background: var(--surface);
  color: var(--text-muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  flex-shrink: 0;
}

.nav-btn-group {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
}

.nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 13px;
}

.nav button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.address-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.address-icon {
  position: absolute;
  left: 12px;
  color: var(--text-dim);
  font-size: 11px;
  pointer-events: none;
  z-index: 1;
}

input.bar {
  width: 100%;
  height: 38px;
  padding: 0 40px 0 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text);
  font-size: 12.5px;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--transition-normal);
  letter-spacing: -0.01em;
}

input.bar:focus {
  border-color: var(--border-light);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input.bar::placeholder {
  color: var(--text-muted);
}

#star-btn {
  position: absolute;
  right: 38px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

#star-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

#home-btn-nav {
  position: absolute;
  right: 5px;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all var(--transition-fast);
}

#home-btn-nav:hover {
  color: var(--text);
  background: var(--surface-active);
}

.nav-action-group {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
}

.loading-bar-container {
  height: 2px;
  background: transparent;
  flex-shrink: 0;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, transparent, var(--text), transparent);
  background-size: 200% 100%;
  transition:
    width 0.25s ease,
    opacity 0.15s;
}

.iframe-container {
  flex: 1;
  position: relative;
  background: var(--bg);
  overflow: hidden;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  position: absolute;
  top: 0;
  left: 0;
}

.iframe-container iframe.hidden {
  display: none;
}

.iframe-container iframe.loading {
  filter: blur(12px) brightness(0.7);
  transition: filter 0.4s ease;
}

.message-container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: var(--text);
  text-align: center;
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(6, 18, 18, 0.75);
  backdrop-filter: blur(20px) saturate(0.5);
  -webkit-backdrop-filter: blur(20px) saturate(0.5);
  z-index: 10;
}

.message-content {
  max-width: 420px;
  padding: 48px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.message-content h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.message-content p {
  color: var(--text-muted);
  font-size: 18px;
  word-break: break-all;
  font-family: var(--font-mono);
  line-height: 1.6;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 20px;
}

#skip-btn {
  margin-top: 20px;
  padding: 7px 18px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-sans);
  transition: all var(--transition-normal);
  display: none;
  letter-spacing: -0.01em;
}

#skip-btn:hover {
  border-color: var(--accent-dim);
  color: var(--text);
  background: var(--surface-hover);
}

.tab-spinner {
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.settings-card {
  background: var(--surface);
  width: 420px;
  max-width: 90vw;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideUp 0.18s ease;
}

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

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.settings-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.02em;
}

.settings-header h2 i {
  font-size: 12px;
  color: var(--text-muted);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 5px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.settings-content {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.settings-content::-webkit-scrollbar {
  width: 4px;
}

.settings-content::-webkit-scrollbar-track {
  background: transparent;
}

.settings-content::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}

.category-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.category-header i {
  font-size: 20px;
  color: var(--accent);
  width: 20px;
  text-align: center;
}

.category-header span {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.section-title {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}

.wisp-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.wisp-option:hover {
  border-color: var(--border-light);
}

.wisp-option.active {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.wisp-option-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wisp-option-name {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.01em;
}

.wisp-option-name i {
  font-size: 14px;
  color: var(--success);
}

.wisp-option-url {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 1px;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ping-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.status-indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: background var(--transition-normal);
}

.status-indicator.status-success {
  background: var(--success);
  box-shadow: 0 0 4px var(--success);
}
.status-indicator.status-error {
  background: var(--error);
}

.custom-input-group {
  display: flex;
  gap: 7px;
}

.custom-input-group input {
  flex: 1;
  height: 42px;
  padding: 0 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 17px;
  outline: none;
  transition: all var(--transition-fast);
  letter-spacing: -0.01em;
}

.custom-input-group input:focus {
  border-color: var(--border-light);
}
.custom-input-group input::placeholder {
  color: var(--text-dim);
}

.custom-input-group button {
  height: 44px;
  width: 44px;
  background: var(--surface-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.custom-input-group button:hover {
  background: var(--surface-active);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.settings-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 17px;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.delete-wisp-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
  font-size: 17px;
  display: flex;
  align-items: center;
}

.delete-wisp-btn:hover {
  color: var(--error);
}

.flex {
  display: flex;
}

.panel-empty {
  padding: 48px 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.panel-section-label {
  padding: 16px 0 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.panel-section-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.panel-item:hover {
  background: var(--surface-hover);
}

.panel-item-favicon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-item-favicon img {
  width: 16px;
  height: 16px;
  border-radius: 3px;
}

.panel-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.panel-item-content {
  flex: 1;
  min-width: 0;
}

.panel-item-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-item-sub {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.panel-item-action {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.panel-item-action:hover {
  color: var(--text);
  background: var(--surface-active);
}

.window-controls {
  display: flex;
  gap: 6px;
  padding: 4px;
}

.window-controls button {
  width: 46px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background-color: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.window-controls button svg {
  width: 10px;
  height: 10px;
  fill: var(--text-muted);
  transition: fill 0.2s ease;
}

.window-controls .minimize-btn:hover,
.window-controls .maximize-btn:hover {
  background: var(--surface-hover);
  transform: scale(1.1);
}

.window-controls .close-btn:hover {
  background: var(--error);
  transform: scale(1.1);
}

.window-controls .close-btn:hover svg {
  fill: var(--text);
}

.app-layout {
  width: 100%;
  height: 100%;
  position: relative;
}

.sidebar {
  position: fixed;
  top: 8px;
  left: 8px;
  height: calc(100vh - 16px);
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 100;
  user-select: none;
  transform: translateX(0);
  transition: transform 0.3s ease;
}

.sidebar.collapsed {
  transform: translateX(calc(-100% - 16px));
}

.sidebar-home {
  flex-shrink: 0;
  padding: 10px 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 4px 0;
}

.sidebar-nav {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 4px;
  width: calc(100% - 8px);
}

.sidebar-footer {
  flex-shrink: 0;
  padding: 0 0 10px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sidebar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 7px 4px 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: grab;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  font-size: 18px;
  position: relative;
}

.sidebar-btn:active {
  cursor: grabbing;
}

.sidebar-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-btn.active {
  background: var(--surface-active);
  color: var(--accent);
}

.sidebar-home .sidebar-btn,
.sidebar-footer .sidebar-btn {
  border: 1px solid var(--border);
}

.sidebar-home .sidebar-btn.active,
.sidebar-footer .sidebar-btn.active {
  border-color: var(--accent);
}

.sidebar-btn-img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: cover;
}

.sidebar-btn.drag-over {
  border-top: 2px solid var(--accent);
}

.sidebar-btn.drag-over-bottom {
  border-bottom: 2px solid var(--accent);
}

.sidebar-btn[data-tooltip] {
  position: relative;
}

.sidebar-btn[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: fixed;
  left: 68px;
  top: auto;
  margin-top: -18px;
  background: rgba(0, 0, 0, 0.92);
  color: #eee;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 15px;
  white-space: nowrap;
  font-family: var(--font-sans);
  pointer-events: none;
  z-index: 999;
  letter-spacing: 0.01em;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  animation: tooltipIn 0.18s ease-out;
}

@keyframes tooltipIn {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.restore-btn {
  position: fixed;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 99;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.restore-btn.visible {
  display: block;
  opacity: 1;
}

.restore-btn .sidebar-btn {
  width: 36px;
  height: 44px;
  font-size: 14px;
  border-radius: 0 12px 12px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: none;
  color: var(--text-muted);
  cursor: pointer;
}

.restore-btn .sidebar-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.content-area {
  margin-left: 76px;
  margin-right: 8px;
  height: 100%;
  overflow: hidden;
  position: relative;
  transition: margin-left 0.3s ease;
}

.content-area.expanded {
  margin-left: 8px;
}

.browser-view {
  width: 100%;
  height: 100%;
  display: none;
}

.browser-view.active {
  display: block;
  animation: viewIn 0.25s ease;
}

.simple-view {
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.simple-view.active {
  display: flex;
  animation: viewIn 0.25s ease;
}

.home-view {
  width: 100%;
  height: 100%;
  display: none;
  background: var(--bg);
  position: relative;
}

.home-view.active {
  display: block;
  animation: viewIn 0.25s ease;
}

.home-view iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.games-view {
  width: 100%;
  height: 100%;
  display: none;
  background: var(--bg);
  position: relative;
}

.games-view.active {
  display: block;
  animation: viewIn 0.25s ease;
}

.games-view iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.movies-view {
  width: 100%;
  height: 100%;
  display: none;
  background: var(--bg);
  position: relative;
}

.movies-view.active {
  display: block;
  animation: viewIn 0.25s ease;
}

.movies-view iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.settings-view {
  width: 100%;
  height: 100%;
  display: none;
  background: var(--bg);
  position: relative;
  overflow-y: auto;
}

.settings-view.active {
  display: block;
  animation: viewIn 0.25s ease;
}

.settings-view .settings-content {
  max-height: none;
  padding: 40px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.settings-view .category-card {
  background: var(--surface);
}

.settings-layout {
  display: flex;
  height: 100%;
  gap: 0;
}

.settings-tabs {
  width: 250px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.settings-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.settings-tab i {
  font-size: 22px;
  width: 20px;
  text-align: center;
}

.settings-tab:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border);
}

.settings-tab.active {
  background: var(--surface-active);
  color: var(--accent);
  border-color: var(--border-light);
}

.settings-panels {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
  animation: viewIn 0.2s ease;
}

.about-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.about-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  font-size: 21px;
  transition: all var(--transition-fast);
}

.about-link:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.about-link i {
  font-size: 30px;
  width: 24px;
  text-align: center;
  margin-left: -3px;
}

@keyframes viewIn {
  from {
    opacity: 0;
    filter: blur(8px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

.simple-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.simple-content img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
}

.simple-content span {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.02em;
  font-family: var(--font-sans);
}

.theme-list {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.theme-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.theme-btn:hover {
  border-color: var(--border-light);
  color: var(--text);
}

.theme-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 229, 255, 0.05);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-md) + 2px);
  cursor: pointer;
  font-family: var(--font-sans);
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast);
}

.theme-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 80% at 50% 0%,
    color-mix(in srgb, var(--sw-accent) 18%, transparent),
    transparent 70%
  );
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}

.theme-card:hover {
  border-color: var(--border-light);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.theme-card:hover::before {
  opacity: 1;
}

.theme-card:active {
  transform: translateY(-1px) scale(0.98);
}

.theme-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px color-mix(in srgb, var(--sw-accent) 35%, transparent);
}

.theme-card.active::before {
  opacity: 1;
}

.theme-card.active::after {
  content: "\2713";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  line-height: 1;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.theme-preview {
  position: relative;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--sw-accent);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.theme-card-name {
  position: relative;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-align: center;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-card:hover .theme-card-name,
.theme-card.active .theme-card-name {
  color: var(--text);
}

.settings-card-wide {
  width: 560px;
}

.announce-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px) saturate(0.5);
  -webkit-backdrop-filter: blur(16px) saturate(0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: fadeIn 0.2s ease;
}

.announce-overlay.show {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.announce-panel {
  width: 520px;
  max-width: 92%;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideUp 0.25s ease;
}

.announce-header {
  text-align: center;
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.announce-header .title {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.announce-header .subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.announce-body {
  padding: 20px;
}

.announce-card {
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.announce-card h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.announce-card p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-line;
}

.announce-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px 20px;
  flex-wrap: wrap;
}

.announce-btn {
  border: none;
  cursor: pointer;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-sans);
  transition: all var(--transition-normal);
  min-width: 100px;
}

.announce-btn:hover {
  transform: translateY(-2px);
}

.announce-btn.prev,
.announce-btn.next {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border-light);
}

.announce-btn.prev:hover,
.announce-btn.next:hover {
  background: var(--surface-active);
  border-color: var(--accent-dim);
  color: var(--accent);
}

.announce-btn.exit {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.announce-btn.exit:hover {
  background: rgba(255, 17, 68, 0.1);
  border-color: var(--error);
  color: var(--error);
}

.announce-counter {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* --- Custom background + custom colors --- */
#custom-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
}

#custom-bg-tint {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

#custom-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

html[data-custom-bg] html,
html[data-custom-bg] body,
html[data-custom-bg] #app,
html[data-custom-bg] .browser-container,
html[data-custom-bg] .tabs,
html[data-custom-bg] .nav,
html[data-custom-bg] .simple-view,
html[data-custom-bg] .iframe-container,
html[data-custom-bg] .home-view,
html[data-custom-bg] .games-view,
html[data-custom-bg] .movies-view,
html[data-custom-bg] .settings-view {
  background: transparent;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.color-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.color-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.color-field input[type="color"] {
  width: 100%;
  height: 34px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.file-input {
  flex: 1;
  height: 42px;
  padding: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.file-input:hover {
  border-color: var(--border-light);
}

.file-input::file-selector-button {
  height: 100%;
  margin-right: 10px;
  padding: 0 14px;
  border: none;
  border-right: 1px solid var(--border-light);
  background: var(--surface-hover);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.file-input::file-selector-button:hover {
  background: var(--surface-active);
  color: var(--accent);
}

.bg-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bg-add-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-dim);
  color: var(--accent);
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

#settings-wallpaper-presets {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.wallpaper-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-md) + 2px);
  cursor: pointer;
  min-width: 0;
  transition: border-color var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.wallpaper-item:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.wallpaper-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 14px color-mix(in srgb, var(--accent) 30%, transparent);
}

.wallpaper-item.active::after {
  content: "\2713";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 11px;
  line-height: 1;
  color: var(--accent);
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 2;
}

.wallpaper-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wallpaper-thumb img,
.wallpaper-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wallpaper-thumb.none {
  border: 1px dashed var(--border-light);
  background: transparent;
  color: var(--text-dim);
  font-size: 20px;
}

.wallpaper-play {
  position: absolute;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.wallpaper-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wallpaper-item:hover .wallpaper-name,
.wallpaper-item.active .wallpaper-name {
  color: var(--text);
}

.wallpaper-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--surface-active);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  z-index: 3;
}

.wallpaper-item:hover .wallpaper-delete {
  display: flex;
}

.wallpaper-delete:hover {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}

/* --- Custom scrollbar --- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

*::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--accent-dim);
  border: 2px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}
