/* ==========================================================================
   OmniDeck PC Remote — iOS 18 Dark Glassmorphism CSS
   ========================================================================== */

:root {
  --bg-primary: #090A0F;
  --bg-secondary: #12141F;
  --glass-bg: rgba(22, 26, 40, 0.65);
  --glass-bg-hover: rgba(30, 36, 56, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(10, 132, 255, 0.5);
  
  --accent-blue: #0A84FF;
  --accent-green: #34C759;
  --accent-red: #FF453A;
  --accent-orange: #FF9F0A;
  --accent-purple: #BF5AF2;

  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-tertiary: rgba(255, 255, 255, 0.38);

  --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 20px);
  --safe-bottom: env(safe-area-inset-bottom, 20px);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: var(--font-stack);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  touch-action: pan-y;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(10, 132, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(191, 90, 242, 0.07) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Glass card styling */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--ease-spring), border-color 0.2s;
}

/* App container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: calc(var(--safe-top) + 60px);
  padding-bottom: calc(var(--safe-bottom) + 90px);
  max-width: 480px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   TOP DYNAMIC PILL (DYNAMIC ISLAND)
   -------------------------------------------------------------------------- */
.dynamic-pill-container {
  position: fixed;
  top: var(--safe-top);
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 100;
  padding: 8px 16px;
  pointer-events: none;
}

.dynamic-pill {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 14px;
  background: rgba(12, 14, 22, 0.82);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  min-height: 40px;
  width: min(94vw, 420px);
  animation: pillPop 0.4s var(--ease-spring);
}

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

.pill-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #8E8E93;
  transition: background-color 0.3s;
}
.status-dot.green {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}
.status-dot.red {
  background-color: var(--accent-red);
}

.status-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

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

.stat-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
}

.pill-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timer-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-orange);
  background: rgba(255, 159, 10, 0.18);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  animation: pulseTimer 1.5s infinite;
}

@keyframes pulseTimer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.icon-btn-pill {
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  cursor: pointer;
  border-radius: 50%;
}
.icon-btn-pill:active {
  color: var(--text-primary);
  transform: scale(0.9);
}

/* --------------------------------------------------------------------------
   MAIN TABS & VIEWS
   -------------------------------------------------------------------------- */
.main-content {
  padding: 0 16px;
  flex: 1;
}

.tab-view {
  display: none;
  animation: fadeInView 0.25s var(--ease-spring);
}
.tab-view.active {
  display: block;
}

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

/* --------------------------------------------------------------------------
   HERO WIDGET (CONTEXT-AWARE)
   -------------------------------------------------------------------------- */
.hero-widget {
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(25, 30, 48, 0.8) 0%, rgba(15, 18, 30, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hero-app-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-icon {
  color: var(--accent-blue);
}

.context-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent-green);
  background: rgba(52, 199, 89, 0.12);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.hero-body {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.media-thumb-box {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.media-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media-info {
  flex: 1;
  min-width: 0;
}

.media-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.media-artist {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-controls {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 4px 0 10px 0;
}

.btn-hero-ctrl {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-hero-ctrl:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.94);
}

.btn-hero-play {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  padding: 0;
  justify-content: center;
  background: var(--text-primary);
  color: #000;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25);
}
.btn-hero-play:active {
  background: #E5E5EA;
}

.hero-expand-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   BENTO GRID
   -------------------------------------------------------------------------- */
.bento-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bento-card {
  padding: 16px;
}

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

.card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  display: block;
}

/* Volume Slider */
.volume-val-badge {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-blue);
}

.volume-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.btn-mute-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.btn-mute-toggle:active {
  background: rgba(255, 255, 255, 0.2);
}

.fluid-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.fluid-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text-primary);
  box-shadow: -400px 0 0 390px var(--accent-blue);
  cursor: pointer;
}

.volume-quick-steps {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.btn-chip {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  padding: 6px 0;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-chip:active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

/* Quick Launch Dock */
.dock-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.dock-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}
.dock-btn:active {
  transform: scale(0.93);
  background: rgba(255, 255, 255, 0.12);
}

.dock-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
}
.yt-bg { background: #FF0000; color: #FFF; }
.fb-bg { background: #1877F2; color: #FFF; }
.nf-bg { background: #E50914; color: #FFF; }
.tt-bg { background: #000000; color: #FFF; border: 1px solid #333; }
.gray-bg { background: #3A3A3C; color: #FFF; font-size: 22px; }
.blue-bg { background: var(--accent-blue); color: #FFF; font-size: 20px; }

/* Power Suite */
.power-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.power-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: var(--text-primary);
  cursor: pointer;
}
.power-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.12);
}
.power-btn svg {
  margin-bottom: 4px;
}
.power-btn span {
  font-size: 13px;
  font-weight: 700;
}
.power-btn small {
  font-size: 10px;
  color: var(--text-secondary);
}

.btn-monitor svg { color: var(--accent-blue); }
.btn-lock svg { color: var(--accent-purple); }
.btn-timer svg { color: var(--accent-orange); }
.btn-shutdown svg { color: var(--accent-red); }

/* --------------------------------------------------------------------------
   TAB 2: TRACKPAD & KEYBOARD
   -------------------------------------------------------------------------- */
.trackpad-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trackpad-surface {
  height: 48vh;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  touch-action: none;
  background: rgba(20, 24, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.trackpad-surface:active {
  border-color: var(--glass-border-focus);
}

.trackpad-watermark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-tertiary);
  pointer-events: none;
  text-align: center;
  padding: 0 16px;
}
.trackpad-watermark span {
  font-size: 15px;
  font-weight: 700;
}
.trackpad-watermark small {
  font-size: 11px;
}

.trackpad-clicks {
  display: flex;
  gap: 8px;
}

.trackpad-btn {
  flex: 1;
  height: 52px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.trackpad-btn:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.96);
}

.trackpad-monitors-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.trackpad-mon-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.mon-jump-btn {
  flex: 1;
  justify-content: center;
  font-size: 11px;
}

.keyboard-box {
  padding: 12px;
}

.input-with-send {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.input-with-send input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.input-with-send input:focus {
  border-color: var(--accent-blue);
}

.btn-send-text {
  background: var(--accent-blue);
  color: #FFF;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-send-text:active {
  opacity: 0.8;
}

.keys-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.key-pill {
  flex: 1;
  min-width: calc(25% - 6px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 4px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}
.key-pill:active {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.95);
}

/* --------------------------------------------------------------------------
   TAB 3: LIVE SCREEN PEEK
   -------------------------------------------------------------------------- */
.screen-peek-wrapper {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.screen-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.screen-peek-actions {
  display: flex;
  gap: 8px;
}

.chip-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.chip-action:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.14);
}

.screen-monitor-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.mon-bar-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.mon-pills-group {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  width: 100%;
}
.mon-pill {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.mon-pill.active {
  background: var(--accent-blue);
  color: #FFF;
  border-color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.35);
}

.win-mon-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  background: rgba(0, 122, 255, 0.2);
  color: var(--accent-blue);
  border: 1px solid rgba(0, 122, 255, 0.3);
}
.win-mon-badge.laptop {
  background: rgba(255, 149, 0, 0.2);
  color: var(--accent-orange);
  border-color: rgba(255, 149, 0, 0.35);
}

.screen-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  touch-action: none;
}
.screen-viewport img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.screen-touch-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  color: var(--text-secondary);
  pointer-events: none;
  white-space: nowrap;
}

.screen-click-actions {
  display: flex;
  gap: 8px;
}
.screen-btn-pill {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 8px 0;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.screen-btn-pill.active {
  background: var(--accent-blue);
  color: #FFF;
  border-color: var(--accent-blue);
}

/* --------------------------------------------------------------------------
   TAB 4: ACTIVE WINDOWS MANAGER
   -------------------------------------------------------------------------- */
.windows-container {
  padding: 14px;
}

.windows-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.windows-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
}

.windows-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.window-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  transition: all 0.15s;
}
.window-item.active {
  border-color: var(--glass-border-focus);
  background: rgba(10, 132, 255, 0.1);
}

.window-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.window-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.window-info {
  flex: 1;
  min-width: 0;
}
.window-app-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.window-title-text {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-actions {
  display: flex;
  gap: 6px;
}
.btn-win-action {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-primary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.btn-win-action.btn-close {
  color: var(--accent-red);
}
.btn-win-action:active {
  background: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   FLOATING BOTTOM NAVIGATION BAR
   -------------------------------------------------------------------------- */
.floating-nav-bar {
  position: fixed;
  bottom: var(--safe-bottom);
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 420px);
  height: 64px;
  background: rgba(14, 17, 28, 0.85);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 36px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 10px;
  z-index: 90;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
  transition: all 0.2s var(--ease-spring);
}
.nav-tab.active {
  color: var(--accent-blue);
  transform: translateY(-2px);
}
.nav-tab:active {
  transform: scale(0.9);
}

/* Floating Voice Orb in Navigation */
.voice-orb-wrapper {
  position: relative;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -24px;
}

.voice-orb-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue) 0%, #0056B3 100%);
  border: 3px solid #090A0F;
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.5);
  transition: all 0.2s var(--ease-spring);
  position: relative;
}
.voice-orb-btn:active {
  transform: scale(0.92);
}

.voice-pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(10, 132, 255, 0.5);
  animation: voicePulse 2s infinite;
  pointer-events: none;
}

@keyframes voicePulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* --------------------------------------------------------------------------
   EXPANDABLE BOTTOM SHEET
   -------------------------------------------------------------------------- */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-spring);
}
.bottom-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(16, 20, 32, 0.94);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 30px 30px 0 0;
  z-index: 120;
  padding: 10px 20px calc(var(--safe-bottom) + 20px) 20px;
  transform: translateY(105%);
  transition: transform 0.35s var(--ease-spring);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.7);
}
.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-handle-bar {
  display: flex;
  justify-content: center;
  padding: 6px 0 14px 0;
  cursor: grab;
}
.sheet-handle {
  width: 40px;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.sheet-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--accent-red);
  background: rgba(255, 69, 58, 0.15);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}
.sheet-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

.sheet-media-hero {
  text-align: center;
  margin-bottom: 18px;
}
.sheet-title {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.sheet-artist {
  font-size: 13px;
  color: var(--text-secondary);
}

.sheet-playback-cluster {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 20px;
}

.sheet-ctrl-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sheet-ctrl-btn small {
  font-size: 9px;
  font-weight: 700;
}
.sheet-ctrl-btn:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(0.92);
}

.sheet-play-large {
  width: 64px;
  height: 64px;
  background: var(--text-primary);
  color: #000;
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.sheet-features-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.feature-chip {
  flex: 1;
  min-width: calc(50% - 6px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 10px 8px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.feature-chip:active {
  background: rgba(255, 255, 255, 0.18);
}

.sheet-speed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.speed-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.speed-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sheet-search-box {
  display: flex;
  gap: 8px;
}
.sheet-search-box input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.btn-yt-search-action {
  background: var(--accent-red);
  color: #FFF;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Couch Scroller Styles */
.couch-swipe-pad {
  height: 180px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  touch-action: none;
}

.couch-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.couch-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  padding: 12px 8px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.couch-btn:active {
  background: rgba(255, 255, 255, 0.2);
}
.couch-btn.btn-danger {
  color: var(--accent-red);
}

/* --------------------------------------------------------------------------
   MODALS (VOICE, TIMER, CONFIRM, QR, PIN)
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  width: 100%;
  max-width: 360px;
  padding: 24px 20px;
  text-align: center;
}
.modal-box h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 18px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.btn-primary {
  background: var(--accent-blue);
  color: #FFF;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger {
  background: var(--accent-red);
  color: #FFF;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* Voice Modal */
.voice-modal-content {
  width: 100%;
  max-width: 360px;
  padding: 30px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.voice-listening-orb {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.orb-core {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0 24px rgba(10, 132, 255, 0.8);
}

.orb-wave {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--accent-blue);
  animation: orbWavePulse 2s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
}
.wave-1 { inset: -10px; animation-delay: 0s; }
.wave-2 { inset: -20px; animation-delay: 0.5s; }
.wave-3 { inset: -30px; animation-delay: 1s; }

@keyframes orbWavePulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.voice-prompt {
  font-size: 17px;
  margin-bottom: 8px;
}

.voice-transcript {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 16px;
  min-height: 40px;
}

.voice-feedback {
  background: rgba(52, 199, 89, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(52, 199, 89, 0.3);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 16px;
}

.btn-voice-cancel {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-primary);
  padding: 8px 24px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Timer Chips */
.timer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.timer-chip {
  flex: 1;
  min-width: 45%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.timer-chip:active {
  background: var(--accent-blue);
}

.timer-custom-input {
  display: flex;
  gap: 8px;
}
.timer-custom-input input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 10px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}

/* QR Modal */
.qr-image-wrapper {
  background: #FFF;
  padding: 12px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin-bottom: 14px;
}
.qr-image-wrapper img {
  width: 180px;
  height: 180px;
  display: block;
}

/* PIN Entry */
.pin-display {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 24px;
  color: var(--accent-blue);
}
.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 260px;
  margin: 0 auto 10px auto;
}
.pin-key {
  height: 56px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pin-key:active {
  background: rgba(255, 255, 255, 0.25);
}
.pin-error {
  color: var(--accent-red);
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   APP DOCK & 1-TAP LAUNCHER
--------------------------------------------------------------------------- */
.app-dock-container {
  padding: 16px;
  margin-bottom: 12px;
}
.section-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0 14px 0;
}
.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 10px;
}
.app-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 12px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.app-tile:active {
  transform: scale(0.93);
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-blue);
}
.app-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.app-tile-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.app-tile-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
}

/* Custom App Modal */
.custom-app-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 380px;
  background: rgba(20, 22, 32, 0.96);
  backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 20px;
  z-index: 1002;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.custom-app-modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.modal-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 4px;
}
.modal-input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
}
.modal-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.1);
}
.modal-hint {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.modal-btn.btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}
.modal-btn.btn-save {
  background: var(--accent-blue);
  color: white;
}

/* --------------------------------------------------------------------------
   GAME CONTROLLER & GYRO RACING
--------------------------------------------------------------------------- */
.game-controller-container {
  padding: 14px;
  user-select: none;
  -webkit-touch-callout: none;
}
.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.game-mode-pills {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px;
  border-radius: var(--radius-pill);
}
.mode-pill {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}
.mode-pill.active {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.35);
}

/* Shoulders row */
.game-shoulders-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.game-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.game-btn:active, .game-btn.pressed {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(0.94);
  border-color: var(--accent-blue);
}
.game-bumper {
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
}
.game-center-meta {
  display: flex;
  gap: 8px;
}
.game-meta-btn {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

/* Arena: D-Pad vs ABXY */
.gamepad-arena {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 10px 4px;
}

/* Cross D-Pad */
.dpad-wrapper {
  width: 150px;
  height: 150px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dpad-cross {
  width: 140px;
  height: 140px;
  position: relative;
}
.dpad-btn {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.dpad-up    { top: 0; left: 47px; border-bottom: none; }
.dpad-down  { bottom: 0; left: 47px; border-top: none; }
.dpad-left  { top: 47px; left: 0; border-right: none; }
.dpad-right { top: 47px; right: 0; border-left: none; }
.dpad-center {
  position: absolute;
  top: 47px;
  left: 47px;
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.04);
}

/* Diamond ABXY */
.abxy-wrapper {
  width: 150px;
  height: 150px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.abxy-diamond {
  width: 140px;
  height: 140px;
  position: relative;
}
.abxy-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.abxy-btn small {
  font-size: 8px;
  font-weight: 500;
  opacity: 0.7;
  margin-top: -2px;
}
.btn-y { top: 0; left: 46px; background: rgba(255, 204, 0, 0.15); border-color: rgba(255, 204, 0, 0.4); color: #ffd60a; }
.btn-a { bottom: 0; left: 46px; background: rgba(52, 199, 89, 0.15); border-color: rgba(52, 199, 89, 0.4); color: #30d158; }
.btn-x { top: 46px; left: 0; background: rgba(0, 122, 255, 0.15); border-color: rgba(0, 122, 255, 0.4); color: #0a84ff; }
.btn-b { top: 46px; right: 0; background: rgba(255, 59, 48, 0.15); border-color: rgba(255, 59, 48, 0.4); color: #ff453a; }

/* Bottom Game Actions */
.game-bottom-pedals {
  display: flex;
  gap: 10px;
}
.pedal-btn {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
}
.pedal-jump {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.25) 0%, rgba(0, 122, 255, 0.1) 100%);
  border-color: rgba(0, 122, 255, 0.4);
}

/* Gyro Racing View */
.racing-wheel-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}
.racing-wheel {
  transition: transform 0.05s linear;
}
.racing-tilt-status {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.racing-steer-label {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0, 122, 255, 0.2);
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 11px;
}
.racing-pedals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 10px;
  margin-top: 10px;
}
.pedal-racing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 8px;
  border-radius: 16px;
  gap: 4px;
}
.pedal-brake {
  background: rgba(255, 59, 48, 0.15);
  border-color: rgba(255, 59, 48, 0.35);
  color: #ff453a;
}
.pedal-gas {
  background: rgba(52, 199, 89, 0.2);
  border-color: rgba(52, 199, 89, 0.5);
  color: #30d158;
}
.pedal-handbrake {
  background: rgba(255, 149, 0, 0.15);
  border-color: rgba(255, 149, 0, 0.35);
  color: #ff9f0a;
}
.pedal-icon {
  font-size: 20px;
}
.pedal-name {
  font-size: 13px;
  font-weight: 800;
}

