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

:root {
  --bg-base: #050505;
  --bg-elevated: #0a0a0a;
  --bg-card: #0f0f0f;
  --bg-hover: #141414;
  --bg-input: #0c0c0c;

  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.1);
  --border-active: rgba(255, 255, 255, 0.15);

  --text-primary: #f0f0f0;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);

  --accent: #a78bfa;
  --accent-rgb: 167, 139, 250;
  --accent-glow: rgba(167, 139, 250, 0.15);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 100px;

  --sidebar-width: 240px;
  --transition: 0.3s ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

#blob-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  filter: blur(120px);
  pointer-events: none;
}
#blob-bg .blob {
  position: absolute;
  border-radius: 50%;
  will-change: transform;
}
#blob-bg .blob-1 {
  width: 80vw; height: 80vw;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.55) 0%, rgba(249, 115, 22, 0.2) 40%, transparent 70%);
  top: -20%; left: -15%;
  animation: blobMove1 18s ease-in-out infinite alternate;
}
#blob-bg .blob-2 {
  width: 75vw; height: 75vw;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.5) 0%, rgba(139, 92, 246, 0.18) 40%, transparent 70%);
  bottom: -25%; right: -10%;
  animation: blobMove2 20s ease-in-out infinite alternate;
}
#blob-bg .blob-3 {
  width: 70vw; height: 70vw;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.45) 0%, rgba(244, 114, 182, 0.15) 40%, transparent 70%);
  top: 30%; left: 40%;
  animation: blobMove3 15s ease-in-out infinite alternate;
}
#blob-bg .blob-4 {
  width: 85vw; height: 85vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, rgba(79, 70, 229, 0.15) 40%, transparent 70%);
  top: 50%; left: -25%;
  animation: blobMove4 22s ease-in-out infinite alternate;
}
@keyframes blobMove1 {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(25vw, 25vh) scale(1.25); }
  50%  { transform: translate(10vw, 45vh) scale(0.85); }
  75%  { transform: translate(35vw, 15vh) scale(1.15); }
  100% { transform: translate(20vw, 35vh) scale(1.05); }
}
@keyframes blobMove2 {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(-30vw, -20vh) scale(1.2); }
  50%  { transform: translate(-15vw, -40vh) scale(0.9); }
  75%  { transform: translate(-35vw, -10vh) scale(1.3); }
  100% { transform: translate(-20vw, -30vh) scale(1.1); }
}
@keyframes blobMove3 {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(-35vw, -15vh) scale(1.3); }
  50%  { transform: translate(-20vw, 20vh) scale(0.8); }
  75%  { transform: translate(-40vw, 10vh) scale(1.2); }
  100% { transform: translate(-25vw, -5vh) scale(1.1); }
}
@keyframes blobMove4 {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(30vw, -25vh) scale(1.15); }
  50%  { transform: translate(40vw, -15vh) scale(1.3); }
  75%  { transform: translate(15vw, -35vh) scale(0.9); }
  100% { transform: translate(25vw, -20vh) scale(1.2); }
}

#sidebar {
  backdrop-filter: blur(40px) saturate(1.3);
  -webkit-backdrop-filter: blur(40px) saturate(1.3);
}
#content {
  position: relative;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

svg.lucide, [data-lucide] {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

::selection {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  border: 2px solid var(--bg-base);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: rgba(5, 5, 5, 0.65);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 14px;
  z-index: 100;
  transition: transform var(--transition);
  position: relative;
}

.sidebar-header {
  padding: 0 8px 28px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.logo-svg {
  width: 100%;
  height: auto;
  display: block;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
  position: relative;
  border: 1px solid transparent;
}

.nav-item i, .nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity var(--transition);
}

.nav-item span {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-subtle);
}
.nav-item:hover i, .nav-item:hover svg { opacity: 0.7; }
.nav-item:hover span { color: var(--text-primary); }

.nav-item.active {
  background: rgba(249, 115, 22, 0.06);
  border-color: rgba(249, 115, 22, 0.1);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  background: linear-gradient(180deg, #fbbf24, #f97316);
  border-radius: 0 3px 3px 0;
}
.nav-item.active i, .nav-item.active svg {
  opacity: 1;
  color: #f97316;
}
.nav-item.active span {
  color: var(--text-primary);
  font-weight: 500;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.sidebar-version {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.5px;
}

#mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(8, 8, 8, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 90;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
#mobile-menu-btn { padding: 6px; }
#mobile-menu-btn i, #mobile-menu-btn svg { width: 20px; height: 20px; opacity: 0.6; }
.mobile-title {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 1px;
}

#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 95;
  opacity: 0;
  transition: opacity var(--transition);
}
#sidebar-overlay.active {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  #mobile-header { display: flex; }
  #sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: var(--shadow-xl);
  }
  #sidebar.open { transform: translateX(0); }
  #content { margin-left: 0; padding-top: 56px; }
}

#content {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
}

.page {
  display: none;
  opacity: 0;
  min-height: 100%;
  padding: 48px 40px;
  will-change: transform, opacity;
  max-width: 1400px;
  margin: 0 auto;
}

.page.active {
  display: block;
  opacity: 1;
}

.page.page-enter {
  display: block;
  animation: pageIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.page.page-exit {
  display: block;
  animation: pageOut 0.25s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pageOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

@media (max-width: 768px) {
  .page { padding: 24px 16px; }
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 30%, #f472b6 60%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 100%;
  animation: shimmerText 6s ease-in-out infinite;
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  font-weight: 300;
}

.card {
  background: linear-gradient(145deg, rgba(15, 15, 15, 0.7), rgba(8, 8, 8, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.35s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.search-container {
  position: relative;
  max-width: 640px;
  margin: 0 auto 36px;
}
.search-container i, .search-container svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 14px 20px 14px 52px;
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 400;
  outline: none;
  transition: all var(--transition);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  background: rgba(40, 40, 40, 0.7);
  border-color: var(--border-hover);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.85rem;
  transition: all var(--transition);
  border: 1px solid transparent;
  line-height: 1;
}
.btn i, .btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(168, 85, 247, 0.15));
  border-color: rgba(249, 115, 22, 0.3);
  color: #fbbf24;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.1);
}
.btn-primary:hover {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25), rgba(168, 85, 247, 0.25));
  border-color: rgba(249, 115, 22, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(249, 115, 22, 0.18);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition);
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.btn-icon i, .btn-icon svg { width: 16px; height: 16px; opacity: 0.7; }

.grid {
  display: grid;
  gap: 20px;
}
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.15);
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.filter-chip {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
  color: var(--text-secondary);
}
.filter-chip.active {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
}

.home-hero {
  text-align: center;
  padding: 80px 20px 60px;
}

.home-hero-logo {
  width: 200px;
  height: 200px;
  margin: 0 auto 28px;
  position: relative;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  perspective: 600px;
}
.orb-glow {
  position: absolute;
  inset: -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.25) 0%, rgba(236, 72, 153, 0.12) 30%, rgba(168, 85, 247, 0.08) 50%, transparent 70%);
  animation: orbGlow 4s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes orbGlow {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.15); opacity: 1; }
}
.orb-body {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbbf24 0%, #f97316 25%, #ea580c 45%, #c026d3 70%, #7c3aed 90%);
  box-shadow:
    inset -20px -20px 40px rgba(0, 0, 0, 0.4),
    inset 10px 10px 30px rgba(251, 191, 36, 0.2),
    0 0 60px rgba(249, 115, 22, 0.3),
    0 0 120px rgba(168, 85, 247, 0.15);
  transition: transform 0.1s ease-out;
  transform-style: preserve-3d;
  animation: orbFloat 6s ease-in-out infinite;
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0) rotateX(0) rotateY(0); }
  25% { transform: translateY(-6px) rotateX(3deg) rotateY(5deg); }
  50% { transform: translateY(0) rotateX(-2deg) rotateY(-3deg); }
  75% { transform: translateY(4px) rotateX(2deg) rotateY(-4deg); }
}
.orb-highlight {
  position: absolute;
  width: 35%;
  height: 35%;
  top: 22%;
  left: 42%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.15) 40%, transparent 70%);
  filter: blur(6px);
  pointer-events: none;
  transition: left 0.15s ease-out, top 0.15s ease-out;
}

.home-hero h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 14px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 25%, #f472b6 55%, #c084fc 80%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 100%;
  animation: shimmerText 6s ease-in-out infinite;
  text-shadow: none;
  position: relative;
}
.home-hero h1::after {
  content: 'HORIZON';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #fbbf24, #f97316, #f472b6, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: blur(28px);
  opacity: 0.4;
  z-index: -1;
  animation: shimmerText 6s ease-in-out infinite;
  background-size: 200% 100%;
}
@keyframes shimmerText {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.home-hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto 40px;
  line-height: 1.8;
  font-weight: 300;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.home-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.feature-card {
  text-align: center;
  padding: 32px 24px 28px;
  background: linear-gradient(145deg, rgba(15, 15, 15, 0.8), rgba(10, 10, 10, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.3), rgba(168, 85, 247, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.feature-card:hover::before { opacity: 1; }
.feature-card .feature-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(249, 115, 22, 0.1);
}
.feature-card .feature-icon i,
.feature-card .feature-icon svg {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  color: #f97316;
}
.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  font-weight: 300;
}

.announcements {
  max-width: 600px;
  margin: 56px auto 0;
}
.announcements h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}
.announcements h2 i, .announcements h2 svg { width: 16px; height: 16px; opacity: 0.5; }
.announcement-item {
  padding: 18px 22px;
  margin-bottom: 10px;
}
.announcement-item .ann-date {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.announcement-item .ann-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 300;
}

.proxy-container {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding-top: 40px;
}

.proxy-search-wrap { margin: 40px 0 20px; }

.proxy-engine-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 36px;
}
.engine-btn {
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.engine-btn i, .engine-btn svg { width: 16px; height: 16px; }
.engine-btn.active {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.2);
  color: var(--accent);
}
.engine-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

.proxy-frame-wrap {
  display: none;
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  z-index: 500;
  background: var(--bg-base);
  flex-direction: column;
}
.proxy-frame-wrap.active { display: flex; }

.proxy-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.proxy-url-display {
  flex: 1;
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.proxy-frame {
  flex: 1;
  width: 100%;
  border: none;
  min-height: 0;
}

@media (max-width: 768px) { .proxy-frame-wrap { left: 0; } }

.games-header {
  text-align: center;
  margin-bottom: 8px;
}

.game-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(145deg, rgba(15, 15, 15, 0.7), rgba(8, 8, 8, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.35s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(249, 115, 22, 0.15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(249, 115, 22, 0.08);
}
.game-card:hover .game-thumb img {
  transform: scale(1.05);
}

.game-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.game-thumb .game-thumb-placeholder {
  opacity: 0.15;
}
.game-thumb .game-thumb-placeholder i,
.game-thumb .game-thumb-placeholder svg {
  width: 32px;
  height: 32px;
}

.game-info {
  padding: 14px 16px;
}
.game-info h3 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.game-info .game-category {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.game-viewer {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 96px);
  gap: 20px;
}

.gv-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.gv-title {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.gv-iframe-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: #000;
}
.gv-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.gv-iframe-wrap.focused {
  border-color: rgba(var(--accent-rgb), 0.2);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.gv-suggestions { flex-shrink: 0; }
.gv-suggestions h3 {
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 14px;
  color: var(--text-muted);
}
.gv-suggestions-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.gv-suggest-card {
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition);
}
.gv-suggest-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.gv-suggest-card .suggest-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gv-suggest-card .suggest-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gv-suggest-card .suggest-title {
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .gv-suggestions-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .gv-suggestions-grid { grid-template-columns: repeat(2, 1fr); }
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 16px;
  cursor: pointer;
}
.app-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
  border: 1px solid var(--border-subtle);
}
.app-icon i, .app-icon svg { width: 22px; height: 22px; }
.app-card:hover .app-icon { transform: scale(1.08); }
.app-name {
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
  color: var(--text-secondary);
}

.settings-container {
  max-width: 640px;
  margin: 0 auto;
}

.settings-group { margin-bottom: 36px; }
.settings-group-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.settings-group-title i, .settings-group-title svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  margin-bottom: 8px;
}
.setting-label { flex: 1; }
.setting-label h4 {
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 3px;
  color: var(--text-primary);
}
.setting-label p {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 300;
}
.setting-control {
  flex-shrink: 0;
  margin-left: 16px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition: all var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #e0e0e0 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: all var(--transition);
}
.toggle input:checked + .toggle-slider {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.3);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.setting-input {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.82rem;
  width: 200px;
  outline: none;
  transition: all var(--transition);
}
.setting-input:focus { border-color: var(--border-hover); }

.setting-select {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  appearance: none;
  cursor: pointer;
  min-width: 160px;
}

.panic-key-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.panic-key-display:hover { border-color: var(--border-hover); }
.panic-key-display i, .panic-key-display svg { width: 16px; height: 16px; opacity: 0.5; }
.panic-key-display kbd {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-family: 'Poppins', monospace;
  font-size: 0.78rem;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-top-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i, .empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: 0.2; }
.empty-state p { font-size: 0.88rem; font-weight: 300; }

.stagger-item {
  opacity: 0;
  transform: translateY(10px);
  animation: staggerIn 0.4s ease forwards;
}
@keyframes staggerIn {
  to { opacity: 1; transform: translateY(0); }
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 400;
  z-index: 1000;
  box-shadow: var(--shadow-xl);
  animation: toastIn 0.3s ease forwards;
}
.toast.toast-out { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(12px); }
}
