/* ==========================================================================
   Apple iOS 26 Liquid Glass Design System
   Yandex Station Max WebApp — station.gamepander.ru
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif;
  --bg-primary: #070810;
  
  /* Glass Variables */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-hover: rgba(255, 255, 255, 0.09);
  --glass-bg-active: rgba(255, 255, 255, 0.14);
  --glass-card-bg: rgba(18, 19, 32, 0.62);
  --glass-border: rgba(255, 255, 255, 0.16);
  --glass-border-highlight: rgba(255, 255, 255, 0.32);
  --glass-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.45);
  --glass-inset: inset 0 1px 1px rgba(255, 255, 255, 0.35), inset 0 -1px 1px rgba(0, 0, 0, 0.4);
  
  /* Accent Colors */
  --accent-cyan: #06b6d4;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-red: #ef4444;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  
  /* Text */
  --text-main: #f8fafc;
  --text-muted: rgba(248, 250, 252, 0.65);
  --text-sub: rgba(248, 250, 252, 0.42);
  
  /* Squircles */
  --radius-card: 28px;
  --radius-pill: 9999px;
  --radius-btn: 18px;
  --radius-tile: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Ambient Dynamic Mesh Gradient
   ========================================================================== */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 10%, #151630 0%, #080911 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  will-change: transform;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, var(--accent-indigo) 0%, transparent 70%);
  top: -100px;
  left: -80px;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
  bottom: 10%;
  right: -80px;
  animation: floatOrb 22s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  top: 40%;
  left: 30%;
  animation: floatOrb 15s ease-in-out infinite alternate;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 80px) scale(1.15); }
  100% { transform: translate(-40px, 40px) scale(0.95); }
}

/* ==========================================================================
   Layout Container
   ========================================================================== */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 840px;
  width: 100%;
  margin: 0 auto;
  padding: env(safe-area-inset-top, 16px) 16px env(safe-area-inset-bottom, 24px) 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ==========================================================================
   Liquid Glass Header
   ========================================================================== */
.glass-header {
  background: var(--glass-card-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-card);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--glass-shadow), var(--glass-inset);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.station-icon-glow {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(168, 85, 247, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.glass-icon-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: var(--glass-inset);
}

.glass-icon-btn:active {
  transform: scale(0.92);
  background: var(--glass-bg-active);
}

/* ==========================================================================
   Navigation Pills
   ========================================================================== */
.glass-nav-pills {
  display: flex;
  gap: 6px;
  padding: 4px 2px;
  justify-content: space-between;
  width: 100%;
}

.nav-pill {
  flex: 1 1 0;
  min-width: 0;
  background: var(--glass-card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-pill);
  padding: 10px 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), var(--glass-inset);
}

.nav-pill svg {
  flex-shrink: 0;
}

.nav-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-pill.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(168, 85, 247, 0.4));
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.45), var(--glass-inset);
}

.nav-pill:active {
  transform: scale(0.95);
}

/* ==========================================================================
   Glass Cards & Sections
   ========================================================================== */
.glass-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.32s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.tab-content.active {
  display: flex;
}

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

.glass-card {
  background: var(--glass-card-bg);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--glass-shadow), var(--glass-inset);
  position: relative;
  overflow: hidden;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.title-with-icon {
  display: flex;
  gap: 14px;
  align-items: center;
}

/* Apple-style Icon Badges */
.icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--glass-inset);
}

.badge-cyan { background: rgba(6, 182, 212, 0.25); color: var(--accent-cyan); }
.badge-purple { background: rgba(168, 85, 247, 0.25); color: var(--accent-purple); }
.badge-indigo { background: rgba(99, 102, 241, 0.25); color: var(--accent-indigo); }
.badge-pink { background: rgba(236, 72, 153, 0.25); color: var(--accent-pink); }
.badge-red { background: rgba(239, 68, 68, 0.25); color: var(--accent-red); }
.badge-green { background: rgba(16, 185, 129, 0.25); color: var(--accent-green); }
.badge-amber { background: rgba(245, 158, 11, 0.25); color: var(--accent-amber); }
.badge-slate { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.badge-rainbow {
  background: conic-gradient(from 180deg at 50% 50%, #f43f5e 0deg, #fbbf24 72deg, #34d399 144deg, #38bdf8 216deg, #818cf8 288deg, #f43f5e 360deg);
  color: #fff;
}

.tile-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--glass-inset);
}

.title-with-icon h2 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.active-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  white-space: nowrap;
}

/* ==========================================================================
   Media Player (Now Playing with Real Cover Art)
   ========================================================================== */
.now-playing-card {
  background: linear-gradient(145deg, rgba(28, 20, 52, 0.65), rgba(14, 15, 28, 0.65));
}

.now-playing-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.album-artwork {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, #3730a3, #6b21a8);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.album-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.album-artwork.has-art img {
  display: block;
}

.album-artwork.has-art #album-art-fallback {
  display: none;
}

.track-meta {
  flex: 1;
  overflow: hidden;
}

.track-title {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.track-artist {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playback-badge {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.pulse-bar {
  width: 4px;
  height: 100%;
  background: var(--accent-purple);
  border-radius: 2px;
  animation: pulseBar 1.2s ease-in-out infinite alternate;
}

.pulse-bar:nth-child(2) { animation-delay: 0.3s; height: 60%; }
.pulse-bar:nth-child(3) { animation-delay: 0.6s; height: 80%; }

@keyframes pulseBar {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

.transport-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin: 22px 0 16px;
}

.glass-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  color: #fff;
  cursor: pointer;
  border-radius: var(--radius-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: var(--glass-inset);
}

.glass-btn.icon-only {
  width: 48px;
  height: 48px;
}

.glass-btn.play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.7), rgba(168, 85, 247, 0.7));
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.glass-btn:active {
  transform: scale(0.92);
}

.volume-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
}

.glass-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.glass-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent-indigo);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s;
}

.glass-slider::-webkit-slider-thumb:active {
  transform: scale(1.25);
}

.slider-val {
  font-size: 0.8rem;
  font-weight: 600;
  width: 42px;
  text-align: right;
  color: var(--text-muted);
}

/* ==========================================================================
   Apple iOS Toggle Switch
   ========================================================================== */
.toggle-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
}

.toggle-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toggle-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.toggle-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ios-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
  flex-shrink: 0;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  border-radius: 30px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.ios-slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 2px;
  bottom: 2px;
  background-color: #fff;
  transition: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.ios-switch input:checked + .ios-slider {
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  border-color: rgba(255, 255, 255, 0.4);
}

.ios-switch input:checked + .ios-slider:before {
  transform: translateX(22px);
}

/* ==========================================================================
   Segmented Controls (Bass Levels)
   ========================================================================== */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 4px;
}

.segment-btn {
  background: transparent;
  border: none;
  border-radius: 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 0;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.25, 1, 0.5, 1);
}

.segment-btn.active {
  background: var(--glass-bg-active);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), var(--glass-inset);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   DSP Preset Tiles Grid
   ========================================================================== */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.preset-tile {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-tile);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: var(--glass-inset);
}

.preset-tile.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.3));
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.35), var(--glass-inset);
}

.preset-tile:active {
  transform: scale(0.96);
}

.tile-info h3 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.tile-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   Performance Metrics
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.metric-card {
  background: var(--glass-card-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-card);
  padding: 16px;
  box-shadow: var(--glass-shadow), var(--glass-inset);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.metric-icon-svg {
  color: var(--accent-indigo);
  display: flex;
}

.metric-val {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 2px;
}

.metric-sub {
  font-size: 0.74rem;
  color: var(--text-sub);
}

.text-green {
  color: var(--accent-green) !important;
}

.perf-profiles-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.perf-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-tile);
  padding: 14px 18px;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: var(--glass-inset);
}

.perf-btn-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.perf-btn h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.perf-btn p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.perf-btn.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.35), rgba(99, 102, 241, 0.45));
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 28px -4px rgba(236, 72, 153, 0.4), var(--glass-inset);
}

.perf-btn:active {
  transform: scale(0.97);
}

.card-action-bar {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.glass-action-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  color: #fff;
  border-radius: var(--radius-btn);
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: var(--glass-inset);
}

.glass-action-btn.primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.7), rgba(168, 85, 247, 0.7));
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.4), var(--glass-inset);
}

.glass-action-btn.danger {
  background: rgba(239, 68, 68, 0.35);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fee2e2;
}

.glass-action-btn:active {
  transform: scale(0.94);
}

/* ==========================================================================
   TV Remote Apple-Style D-Pad
   ========================================================================== */
.dpad-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
}

.dpad-container {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--glass-shadow), inset 0 2px 4px rgba(0, 0, 0, 0.6);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dpad-btn {
  position: absolute;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.dpad-btn:active {
  color: #fff;
  transform: scale(1.15);
}

.dpad-up { top: 12px; width: 60px; height: 50px; }
.dpad-down { bottom: 12px; width: 60px; height: 50px; }
.dpad-left { left: 12px; width: 50px; height: 60px; }
.dpad-right { right: 12px; width: 50px; height: 60px; }

.dpad-center {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), var(--glass-inset);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.dpad-center:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.25);
}

.tv-aux-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.glass-pill-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 10px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.24s;
  box-shadow: var(--glass-inset);
}

.glass-pill-btn:active {
  transform: scale(0.94);
}

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.app-tile {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-tile);
  padding: 14px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.24s;
  box-shadow: var(--glass-inset);
}

.app-tile:active {
  transform: scale(0.94);
  background: var(--glass-bg-active);
}

/* YouTube Input */
.input-action-row {
  display: flex;
  gap: 10px;
}

.glass-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-btn);
  padding: 12px 16px;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.glass-input:focus {
  border-color: var(--accent-indigo);
}

/* Screenshot Viewport */
.screenshot-container {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.screenshot-placeholder {
  color: var(--text-sub);
  font-size: 0.82rem;
}

.screenshot-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Display & LED Grid
   ========================================================================== */
.anim-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.anim-tile {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-highlight);
  border-radius: var(--radius-tile);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.22s;
  box-shadow: var(--glass-inset);
}

.anim-tile:active {
  transform: scale(0.92);
}

.color-palette {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
}

.color-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px var(--c);
  cursor: pointer;
  transition: transform 0.2s;
}

.color-dot:active, .color-dot.active {
  transform: scale(1.22);
  border-color: #fff;
}

.color-dot.rainbow-dot {
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.4);
}

.color-dot.off-dot {
  background: #1e1e24;
  box-shadow: none;
  position: relative;
}

.color-dot.off-dot::after {
  content: "✕";
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* ==========================================================================
   Gemini 3.8 Live View
   ========================================================================== */
.gemini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 20px;
  background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.25) 0%, rgba(18, 19, 32, 0.7) 70%);
}

.gemini-visualizer-orb {
  width: 110px;
  height: 110px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.orb-core {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #38bdf8 0%, #6366f1 70%, #a855f7 100%);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.75);
  animation: pulseGemini 2.5s ease-in-out infinite alternate;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  animation: spinRing 16s linear infinite;
}

@keyframes pulseGemini {
  0% { transform: scale(0.9); filter: hue-rotate(0deg); }
  100% { transform: scale(1.15); filter: hue-rotate(60deg); }
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.gemini-meta h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gemini-meta p {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 320px;
  margin: 6px auto 24px;
}

.gemini-controls-row {
  display: flex;
  gap: 14px;
}

.gemini-btn {
  padding: 12px 28px;
  font-size: 0.95rem;
}

/* ==========================================================================
   Mobile & Responsive Adaptations (Telegram WebApp & Mobile Screens)
   ========================================================================== */
@media (max-width: 580px) {
  .app-container {
    padding: env(safe-area-inset-top, 10px) 10px env(safe-area-inset-bottom, 18px) 10px;
    gap: 12px;
  }

  .glass-header {
    padding: 12px 14px;
    border-radius: 22px;
  }

  .glass-nav-pills {
    gap: 4px;
    padding: 2px 0;
  }

  .nav-pill {
    padding: 8px 6px;
    font-size: 0.75rem;
    gap: 4px;
    border-radius: 9999px;
  }

  .nav-pill svg {
    width: 14px;
    height: 14px;
  }

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

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .color-palette {
    gap: 10px;
  }

  .color-dot {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 380px) {
  .nav-pill {
    padding: 7px 4px;
    font-size: 0.68rem;
    gap: 3px;
  }

  .nav-pill svg {
    width: 12px;
    height: 12px;
  }
}

/* ==========================================================================
   Apple iOS 26 Liquid Glass: Auth Overlay & Lock Screen
   ========================================================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 16, 0.82);
  backdrop-filter: blur(36px) saturate(180%);
  -webkit-backdrop-filter: blur(36px) saturate(180%);
  padding: 20px;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  padding: 34px 26px;
  text-align: center;
  border-radius: 32px;
  background: rgba(22, 22, 36, 0.75);
  backdrop-filter: blur(40px) saturate(190%);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  animation: authCardScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authCardScale {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.auth-icon-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(6, 182, 212, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.auth-title {
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.auth-tg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(42, 171, 238, 0.35);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-tg-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(42, 171, 238, 0.45);
}

.auth-waiting-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 12px;
  font-size: 0.78rem;
  color: #a1a1aa;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  animation: authPulse 1.6s infinite ease-in-out;
}

@keyframes authPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.25); box-shadow: 0 0 10px #38bdf8; }
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 14px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-divider span {
  padding: 0 12px;
}

.auth-code-box {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.auth-code-input {
  flex: 1;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-family: monospace;
}

.auth-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 10px;
}

.auth-hint a {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}

.auth-error-msg {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  color: #fca5a5;
  font-size: 0.8rem;
}

.auth-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: authSpin 0.9s linear infinite;
  margin: 16px auto;
}

@keyframes authSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Admin Management UI
   ========================================================================== */
.header-user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-user-badge:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.admin-session-info-pill {
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.admin-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.88rem;
}

.admin-user-badge {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 9999px;
  font-weight: 700;
}

.admin-user-badge.owner {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.admin-user-badge.admin {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.btn-remove-user {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.btn-remove-user:hover {
  background: rgba(239, 68, 68, 0.15);
}

.admin-add-user-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.services-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.service-tile {
  padding: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
}

.service-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.service-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: monospace;
}

.btn-danger-soft {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

.admin-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.admin-session-item {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.session-current-tag {
  color: #10b981;
  font-weight: 700;
  font-size: 0.72rem;
}

