@import url('/assets/css/themes.css');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--site-font, 'Poppins', sans-serif);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  position: relative;
  transition: background-color 0.4s ease;
}

#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.app-wrapper {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

.side-nav {
  width: 80px;
  background: var(--bg-secondary);
  backdrop-filter: blur(8px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 30px 0;
  height: 100vh;
  position: sticky;
  top: 0;
  box-shadow: 4px 0 20px var(--shadow-color);
  z-index: 10;
  flex-shrink: 0;
  transition: background 0.4s ease;
}

.nav-image-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: none;
  cursor: default;
  flex-shrink: 0;
  border: none;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-image-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nav-image-icon .logo-placeholder {
  font-size: 28px;
  color: var(--text-accent);
}

.nav-icons {
  display: flex;
  flex-direction: column;
  gap: 28px;
  flex: 1;
}

.nav-icons button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 26px;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-icons button:hover {
  background: var(--hover-bg);
  color: var(--text-accent);
  transform: scale(1.05);
}
.nav-icons button.active {
  color: var(--text-accent);
  background: rgba(180, 130, 255, 0.15);
}

.nav-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-bottom: 8px;
}
.nav-bottom button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 26px;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-bottom button:hover {
  background: var(--hover-bg);
  color: var(--text-accent);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  height: 100vh;
  overflow: hidden;
}

.content-card {
  max-width: 860px;
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(4px);
  border-radius: 48px;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 50px var(--shadow-color);
  display: flex;
  flex-direction: column;
  height: 90%;
  max-height: 700px;
  overflow: hidden;
  padding: 24px 24px 12px 24px;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
}
.card-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}
.card-header h1 i {
  color: var(--text-accent);
}

.nav-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.nav-controls button {
  background: rgba(255,255,255,0.04);
  border: none;
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 40px;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-controls button:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}
.nav-controls button:active {
  transform: scale(0.92);
}
.nav-controls button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.nav-controls button:disabled:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
}

.home-search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.home-search-wrap .home-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  opacity: 0.6;
  font-size: 0.95rem;
  pointer-events: none;
}

.home-search-bar {
  width: 100%;
  padding: 10px 18px 10px 46px;
  border-radius: 60px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: 0.2s;
}
.home-search-bar::placeholder {
  color: var(--text-secondary);
  opacity: 0.5;
}
.home-search-bar:focus {
  border-color: var(--text-accent);
  background: var(--input-bg);
}
.home-search-bar.hidden {
  display: none;
}

.shared-search-bar {
  width: 100%;
  padding: 8px 16px;
  border-radius: 60px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: 0.2s;
  margin-bottom: 12px;
  display: none;
}
.shared-search-bar::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}
.shared-search-bar:focus {
  border-color: var(--text-accent);
  background: var(--input-bg);
}
.shared-search-bar.visible {
  display: block;
}

.ai-response-home {
  background: var(--bg-container);
  border-radius: 20px;
  padding: 14px 18px;
  margin: 8px 0 12px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  line-height: 1.6;
  min-height: 50px;
  display: none;
  color: var(--text-secondary);
}
.ai-response-home.visible {
  display: block;
}
.ai-response-home .ai-label {
  color: var(--text-accent);
  font-weight: 600;
  margin-right: 6px;
}

.content-container {
  flex: 1;
  margin-top: 8px;
  border-radius: 28px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-container);
  padding: 20px;
  min-height: 200px;
  border: 1px solid var(--border-color);
  transition: background 0.4s ease;
}
.content-container::-webkit-scrollbar {
  width: 4px;
}
.content-container::-webkit-scrollbar-track {
  background: transparent;
}
.content-container::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}

.home-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.home-content .welcome {
  text-align: center;
  padding: 10px 0 10px;
}
.home-content .welcome h2 {
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.home-content .welcome h2 i {
  color: var(--text-accent);
}
.home-content .welcome p {
  opacity: 0.5;
  font-size: 1rem;
  margin-bottom: 12px;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 8px 0 16px;
}
.social-icons a {
  color: var(--text-secondary);
  font-size: 2rem;
  transition: 0.2s;
  text-decoration: none;
  width: 54px;
  height: 54px;
  border-radius: 30px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}
.social-icons a:hover {
  color: var(--text-accent);
  background: var(--hover-bg);
  transform: translateY(-3px);
  border-color: var(--text-accent);
}

.recent-section {
  margin-top: 6px;
}
.recent-section h3 {
  font-size: 0.85rem;
  opacity: 0.5;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.recent-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.recent-item {
  background: var(--game-card-bg);
  border-radius: 16px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.9rem;
}
.recent-item:hover {
  background: var(--game-card-hover);
  border-color: var(--text-accent);
  transform: translateY(-2px);
}
.recent-item img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}
.recent-item .recent-name {
  color: var(--text-primary);
}

.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0.4;
  transition: 0.2s;
  padding: 2px 4px;
  line-height: 1;
  flex-shrink: 0;
}
.fav-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}
.fav-btn.fav-active {
  color: #ff6b6b;
  opacity: 1;
}
.recent-item .fav-btn {
  margin-left: auto;
}

.roster-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  padding: 10px 0;
}
.roster-card {
  background: var(--game-card-bg);
  border-radius: 24px;
  padding: 16px 16px 14px;
  width: 140px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: 0.2s;
  cursor: pointer;
  position: relative;
}
.roster-card .fav-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  backdrop-filter: blur(4px);
  opacity: 0.7;
}
.roster-card .fav-btn:hover {
  opacity: 1;
  background: rgba(0,0,0,0.6);
}
.roster-card:hover {
  background: var(--game-card-hover);
  transform: translateY(-4px);
  border-color: var(--text-accent);
}
.roster-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 18px;
  background: var(--bg-primary);
}
.roster-card span {
  display: block;
  margin-top: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.game-iframe-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.game-iframe-overlay.active {
  display: flex;
  animation: overlayFadeIn 0.3s ease;
}
.game-iframe-container {
  width: 100%;
  max-width: 1000px;
  height: 85%;
  background: var(--bg-primary);
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  border: 2px solid var(--border-color);
  box-shadow: 0 30px 80px var(--shadow-color);
  animation: slideInSide 0.35s ease;
}
@keyframes overlayFadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes slideInSide {
  0% { transform: translateX(120%); }
  100% { transform: translateX(0); }
}
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
.game-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.game-iframe-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 40px;
  font-size: 1.4rem;
  cursor: pointer;
  transition: 0.15s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-iframe-close:hover {
  background: rgba(255,255,255,0.15);
}
.game-iframe-reload {
  position: absolute;
  top: 16px;
  right: 74px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.15s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-iframe-reload:hover {
  background: rgba(255,255,255,0.15);
}
.game-iframe-fullscreen {
  position: absolute;
  top: 16px;
  right: 128px;
  background: rgba(255,255,255,0.08);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.15s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-iframe-fullscreen:hover {
  background: rgba(255,255,255,0.15);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  margin-top: 6px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.card-footer .page-indicator {
  background: rgba(0,0,0,0.2);
  padding: 4px 18px;
  border-radius: 60px;
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-color);
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.popup-overlay.active {
  display: flex;
}
.popup-box {
  background: var(--popup-bg);
  border: 1px solid var(--border-color);
  border-radius: 40px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 36px 30px 30px;
  box-shadow: 0 30px 60px var(--shadow-color);
  color: var(--text-primary);
  animation: fadeUp 0.25s ease;
  transition: background 0.4s ease;
  position: relative;
}
.popup-box::-webkit-scrollbar {
  width: 4px;
}
.popup-box::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}
@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.popup-close-x {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 30px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.popup-close-x:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.popup-box h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  padding-right: 40px;
}
.popup-box h2 i {
  color: var(--text-accent);
}
.popup-box p {
  opacity: 0.7;
  margin-bottom: 20px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.extension-item {
  background: rgba(255,255,255,0.04);
  border-radius: 20px;
  padding: 16px 18px;
  margin: 12px 0;
  border: 1px solid var(--border-color);
  transition: 0.2s;
}
.extension-item:hover {
  background: var(--hover-bg);
  border-color: var(--text-accent);
}
.extension-item .ext-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.extension-item .ext-header h3 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.extension-item .ext-header h3 i {
  color: var(--text-accent);
}
.extension-item .ext-desc {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 10px;
}
.extension-item .ext-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.extension-item .ext-controls input,
.extension-item .ext-controls select {
  padding: 6px 14px;
  border-radius: 60px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  outline: none;
  font-size: 0.9rem;
  min-width: 80px;
}
.extension-item .ext-controls input:focus,
.extension-item .ext-controls select:focus {
  border-color: var(--text-accent);
}
.extension-item .ext-controls button {
  background: var(--scrollbar-thumb);
  border: none;
  color: white;
  padding: 6px 18px;
  border-radius: 60px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}
.extension-item .ext-controls button:hover {
  background: var(--text-accent);
}
.extension-item .ext-controls button.danger {
  background: #5a2a2a;
}
.extension-item .ext-controls button.danger:hover {
  background: #8a3a3a;
}
.extension-item .ext-status {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: 6px;
}
.extension-item .ext-keybind {
  font-size: 0.8rem;
  background: rgba(255,255,255,0.05);
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.custom-theme-section {
  margin: 16px 0;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 16px;
}
.custom-theme-section .color-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 8px 0;
  flex-wrap: wrap;
}
.custom-theme-section .color-row label {
  min-width: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.custom-theme-section .color-row input[type="color"] {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  background: transparent;
  cursor: pointer;
  padding: 2px;
}
.custom-theme-section .color-row input[type="text"] {
  flex: 1;
  padding: 6px 12px;
  border-radius: 60px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  outline: none;
  font-size: 0.85rem;
  min-width: 120px;
}
.custom-theme-section .color-row input[type="text"]:focus {
  border-color: var(--text-accent);
}
.custom-theme-section .theme-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.custom-theme-section .theme-actions button {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 60px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.85rem;
}
.custom-theme-section .theme-actions button:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}
.custom-theme-section .theme-actions button.primary {
  background: var(--scrollbar-thumb);
  color: white;
}
.custom-theme-section .theme-actions button.primary:hover {
  background: var(--text-accent);
}

.logo-section {
  margin: 16px 0;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 16px;
}
.logo-section label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.logo-section .logo-preview {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  border: 2px solid var(--border-color);
  overflow: hidden;
  margin: 8px 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-section .logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.logo-section .logo-preview .placeholder {
  font-size: 30px;
  color: var(--text-secondary);
}
.logo-section .logo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.logo-section .logo-actions input[type="file"] {
  display: none;
}
.logo-section .logo-actions button {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 60px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.85rem;
}
.logo-section .logo-actions button:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}
.logo-section .logo-actions button.primary {
  background: var(--scrollbar-thumb);
  color: white;
}
.logo-section .logo-actions button.primary:hover {
  background: var(--text-accent);
}

.theme-selector {
  margin: 12px 0 20px;
}
.theme-selector label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.theme-selector select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 60px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  cursor: pointer;
  transition: 0.2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b7a0c9' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.theme-selector select:focus {
  border-color: var(--text-accent);
}
.theme-selector select option {
  background: var(--popup-bg);
  color: var(--text-primary);
  padding: 8px;
}

.cloak-section {
  margin: 16px 0;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 16px;
}
.cloak-section label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.cloak-section input,
.cloak-section select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 60px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: 0.2s;
}
.cloak-section input:focus,
.cloak-section select:focus {
  border-color: var(--text-accent);
}
.cloak-section select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b7a0c9' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.cloak-section .cloak-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.cloak-section .cloak-actions button {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 60px;
  cursor: pointer;
  transition: 0.2s;
  font-size: 0.85rem;
  flex: 1;
}
.cloak-section .cloak-actions button:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.cloak-section .switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}
.cloak-section .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cloak-section .switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--scrollbar-thumb);
  transition: 0.3s;
  border-radius: 20px;
}
.cloak-section .switch .slider:before {
  content: '';
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: var(--text-primary);
  transition: 0.3s;
  border-radius: 50%;
}
.cloak-section .switch input:checked + .slider {
  background: var(--text-accent);
}
.cloak-section .switch input:checked + .slider:before {
  transform: translateX(16px);
}
.cloak-section h3 .switch {
  vertical-align: middle;
}

.popup-close {
  margin-top: 24px;
  background: rgba(255,255,255,0.04);
  border: none;
  color: var(--text-secondary);
  padding: 10px 28px;
  border-radius: 60px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.15s;
}
.popup-close:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.keybind-input {
  display: flex;
  align-items: center;
  gap: 8px;
}
.keybind-input input {
  width: 80px;
  text-align: center;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}
.keybind-input .keybind-hint {
  font-size: 0.7rem;
  opacity: 0.4;
}

.ai-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.ai-presets button {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 14px;
  border-radius: 60px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: 0.2s;
  white-space: nowrap;
}
.ai-presets button:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--text-accent);
}
.ai-presets button i {
  margin-right: 6px;
  opacity: 0.6;
}

/* Browser overlay */
.browser-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.browser-overlay.active {
  display: flex;
}
.browser-window {
  width: 100%;
  max-width: 1200px;
  height: 90%;
  background: var(--bg-primary);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  box-shadow: 0 30px 80px var(--shadow-color);
  animation: fadeUp 0.2s ease;
}
.browser-toolbar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 8px;
  gap: 4px;
  flex-shrink: 0;
  min-height: 44px;
}
.browser-tabs {
  display: flex;
  gap: 3px;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
  align-items: stretch;
  min-width: 0;
  padding: 2px 0;
}
.browser-tabs::-webkit-scrollbar {
  height: 3px;
}
.browser-tabs::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}
.browser-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: 0.15s;
  min-width: 0;
  flex-shrink: 0;
  max-width: 200px;
}
.browser-tab:hover {
  background: rgba(255,255,255,0.08);
}
.browser-tab.active {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: var(--text-accent);
}
.browser-tab .browser-tab-fav {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
  object-fit: contain;
}
.browser-tab .browser-tab-fav.fallback {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.browser-tab .browser-tab-title {
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-tab .browser-tab-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.6rem;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  opacity: 0.5;
  transition: 0.15s;
  line-height: 1;
  flex-shrink: 0;
}
.browser-tab .browser-tab-close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
}
.browser-toolbar-btn {
  background: rgba(255,255,255,0.04);
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.browser-toolbar-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}
.browser-toolbar-close:hover {
  background: rgba(255,60,60,0.2);
  color: #ff6b6b;
}
.browser-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.browser-nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.browser-nav-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
}
.browser-nav-btn:active {
  transform: scale(0.92);
}
.browser-url-wrap {
  flex: 1;
  display: flex;
}
.browser-url {
  width: 100%;
  padding: 8px 14px;
  border-radius: 60px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: 0.15s;
}
.browser-url:focus {
  border-color: var(--text-accent);
}
.browser-content {
  flex: 1;
  display: flex;
  position: relative;
  background: white;
}
.browser-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 700px) {
  .content-card { padding: 16px; height: 95%; }
  .card-header h1 { font-size: 1.2rem; }
  .roster-card { width: 110px; padding: 12px; }
  .home-content .welcome h2 { font-size: 1.8rem; }
  .game-iframe-container { height: 70%; }
  .extension-item .ext-controls { flex-direction: column; }
  .extension-item .ext-controls input { width: 100%; }
  .custom-theme-section .color-row { flex-direction: column; align-items: stretch; }
  .custom-theme-section .color-row label { min-width: auto; }
  .ai-presets button { font-size: 0.65rem; padding: 3px 10px; }
  .browser-overlay { padding: 10px; }
  .browser-window { height: 95%; border-radius: 14px; }
  .browser-nav { padding: 6px 8px; gap: 4px; }
  .browser-url { font-size: 0.75rem; padding: 6px 10px; }
  .browser-tab { font-size: 0.7rem; padding: 4px 8px; max-width: 120px; }
}
/* ===== Bunnies Instant Play ===== */
.instant-fab {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 30px;
  background: var(--scrollbar-thumb);
  border: none;
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  z-index: 3500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s;
  box-shadow: 0 6px 20px var(--shadow-color);
}
.instant-fab:hover {
  background: var(--text-accent);
  transform: scale(1.1) rotate(-12deg);
  box-shadow: 0 8px 28px var(--shadow-color);
}
.instant-fab:active {
  transform: scale(0.95) rotate(-12deg);
}
body.instant-open .instant-fab {
  display: none;
}
body.nav-top .instant-fab {
  top: auto;
  bottom: 18px;
  right: 18px;
}
body.nav-top .instant-fab:hover {
  transform: scale(1.1) rotate(12deg);
}
body.nav-top .instant-fab:active {
  transform: scale(0.95) rotate(12deg);
}

.instant-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1500;
  display: none;
  justify-content: flex-end;
}
.instant-overlay.active {
  display: flex;
}
.instant-panel {
  width: 380px;
  max-width: 92vw;
  height: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--border-color);
  box-shadow: -20px 0 60px var(--shadow-color);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.instant-overlay.active .instant-panel {
  transform: translateX(0);
  animation: instantPopIn 0.45s cubic-bezier(0.22, 1.2, 0.36, 1);
}
@keyframes instantPopIn {
  0% { transform: translateX(120%) scale(0.92); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: translateX(0) scale(1); opacity: 1; }
}
.instant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.instant-header h2 {
  font-size: 1.2rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.instant-header h2 i {
  color: var(--text-accent);
}
.instant-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 30px;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.instant-close:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}
.instant-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}
.instant-body::-webkit-scrollbar {
  width: 4px;
}
.instant-body::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}

.instant-search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.instant-search-wrap .instant-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  opacity: 0.6;
  pointer-events: none;
}
.instant-search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  border-radius: 60px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: 0.2s;
}
.instant-search-wrap input:focus {
  border-color: var(--text-accent);
}

.instant-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.instant-ql {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-container);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.instant-ql:hover {
  color: var(--text-accent);
  background: var(--hover-bg);
  border-color: var(--text-accent);
  transform: translateY(-2px);
}

.instant-section {
  margin-bottom: 20px;
}
.instant-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  opacity: 0.6;
  margin-bottom: 10px;
}
.instant-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.instant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--game-card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  cursor: pointer;
  transition: 0.15s;
}
.instant-item:hover {
  background: var(--game-card-hover);
  border-color: var(--text-accent);
}
.instant-item img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}
.instant-name {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.instant-empty {
  font-size: 0.85rem;
  opacity: 0.4;
}

.instant-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-color);
}
.instant-option:last-child {
  border-bottom: none;
}
.instant-option span {
  color: var(--text-primary);
  font-size: 0.95rem;
}
.instant-option small {
  display: block;
  color: var(--text-secondary);
  opacity: 0.6;
  font-size: 0.78rem;
  margin-top: 2px;
}
.instant-option .switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.instant-option .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.instant-option .switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--scrollbar-thumb);
  transition: 0.3s;
  border-radius: 20px;
}
.instant-option .switch .slider:before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--text-primary);
  transition: 0.3s;
  border-radius: 50%;
}
.instant-option .switch input:checked + .slider {
  background: var(--text-accent);
}
.instant-option .switch input:checked + .slider:before {
  transform: translateX(18px);
}

.recorder-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.recorder-controls button {
  background: var(--scrollbar-thumb);
  border: none;
  color: white;
  padding: 8px 16px;
  border-radius: 60px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: 0.15s;
}
.recorder-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.recorder-controls button:hover:not(:disabled) {
  background: var(--text-accent);
}
.recorder-controls button i {
  margin-right: 6px;
}
.rec-download {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 60px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: 0.15s;
}
.rec-download:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}
.rec-status {
  font-size: 0.8rem;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-bottom: 8px;
}
.rec-video {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border-color);
}

/* ===== Simple Mode ===== */
body.simple-mode .side-nav {
  background: var(--bg-secondary);
  backdrop-filter: none;
}
body.simple-mode .content-card {
  background: var(--bg-primary);
  backdrop-filter: none;
  padding: 16px;
}
body.simple-mode .content-container {
  background: var(--bg-container);
  backdrop-filter: none;
}
body.simple-mode .home-content .welcome p,
body.simple-mode .social-icons {
  display: none;
}
body.simple-mode .card-header {
  padding-bottom: 8px;
}
body.simple-mode .roster-card img {
  background: var(--bg-primary);
}
body.simple-mode .popup-box,
body.simple-mode .browser-window {
  backdrop-filter: none;
}

/* ===== Reduce Motion ===== */
body.reduce-motion * {
  transition: none !important;
  animation: none !important;
}

/* ===== Nav Bar Position ===== */
body.nav-top .app-wrapper {
  flex-direction: column;
}
body.nav-top .side-nav {
  width: 100%;
  height: 74px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-right: none;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px var(--shadow-color);
}
body.nav-top .nav-image-icon {
  margin-bottom: 0;
}
body.nav-top .nav-icons {
  flex-direction: row;
  gap: 14px;
  flex: 1;
  justify-content: center;
}
body.nav-top .nav-bottom {
  margin-top: 0;
  flex-direction: row;
  gap: 14px;
  padding-bottom: 0;
}
body.nav-top .main-content {
  height: auto;
  flex: 1;
  min-height: 0;
  padding: 20px;
}
/* Instant Play in horizontal mode (navbar on top) */
body.nav-top .instant-overlay {
  justify-content: flex-end;
  align-items: flex-end;
}
body.nav-top .instant-panel {
  width: 100%;
  max-width: none;
  height: min(420px, 92vh);
  border-left: none;
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -20px 60px var(--shadow-color);
  transform: translateY(100%);
}
body.nav-top .instant-overlay.active .instant-panel {
  transform: translateY(0);
  animation: instantPopUp 0.45s cubic-bezier(0.22, 1.2, 0.36, 1);
}
@keyframes instantPopUp {
  0% { transform: translateY(100%) scale(0.96); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@media (max-width: 700px) {
  body.nav-top .side-nav {
    padding: 0 12px;
  }
  body.nav-top .nav-icons {
    gap: 6px;
  }
}

/* ===== Bigger Iframes ===== */
body.big-iframes .game-iframe-container {
  max-width: 1300px;
  height: 92%;
}

/* ===== Fades (Animation Settings) ===== */
body.fades-enabled .popup-box {
  animation: fadeIn 0.25s ease;
}
body.fades-enabled .instant-panel {
  opacity: 0;
  transform: none;
  transition: opacity 0.3s ease;
  animation: none;
}
body.fades-enabled .instant-overlay.active .instant-panel {
  opacity: 1;
  transform: none;
  animation: none;
}
body.fades-enabled .game-iframe-overlay.active {
  animation: overlayFadeIn 0.3s ease;
}
body.fades-enabled .game-iframe-container {
  animation: fadeIn 0.35s ease;
}

/* ===== Theme Share ===== */
.custom-theme-section .theme-actions.share-actions {
  margin-top: 8px;
}
.custom-theme-section .theme-actions.share-actions button {
  padding: 6px 14px;
  font-size: 0.8rem;
}
.ext-status#themeStatus {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: 8px;
}
