/* Meta Ray-Ban Display: 600x600 Additive Waveguide CSS */
:root {
  --hud-bg: #000000;
  --hud-card: #0c121d;
  --hud-card-subtle: rgba(12, 18, 29, 0.85);
  --border-dim: rgba(255, 255, 255, 0.16);
  --border-bright: rgba(0, 240, 255, 0.5);
  --accent-cyan: #00f0ff;
  --accent-red: #ff0033;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --text-main: #ffffff;
  --text-muted: #94a3b8;
  --text-sub: #64748b;
  --target-min: 52px;
}

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

html, body {
  width: 600px;
  height: 600px;
  max-width: 600px;
  max-height: 600px;
  overflow: hidden;
  background: var(--hud-bg); /* Optical additive transparent base */
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
}

.hud-canvas {
  width: 600px;
  height: 600px;
  max-width: 600px;
  max-height: 600px;
  padding: 8px; /* Strict 8dp edge margin */
  display: flex;
  flex-direction: column;
  position: relative;
  gap: 6px;
  overflow: hidden;
}

/* ==========================================================================
   Header Bar (Strict >=52px touch targets)
   ========================================================================== */
.hud-bar {
  height: 52px;
  background: var(--hud-card);
  border-radius: 12px;
  border: 1px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  flex-shrink: 0;
}

.hud-bar-left, .hud-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.yt-icon {
  background: var(--accent-red);
  color: #ffffff;
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.hud-title {
  font-weight: 800;
  font-size: 12.5px;
  color: #ff334b;
  letter-spacing: 0.5px;
}

/* Generic Header Buttons (Strict >=52px touch target) */
.hud-btn {
  height: 52px;
  min-height: 52px;
  min-width: 52px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  color: #ffffff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.hud-btn:focus, .hud-btn:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
  transform: scale(0.97);
}

.engine-btn {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.4);
  color: var(--accent-cyan);
}

.engine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-dot 2s infinite;
}

.engine-dot.iframe {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.remote-btn {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
}

/* ==========================================================================
   Dual-Engine Video Container (Height: 216px fits strictly inside 600px)
   ========================================================================== */
.video-container {
  width: 100%;
  height: 216px;
  background: #000000;
  border-radius: 12px;
  border: 1px solid var(--border-bright);
  overflow: hidden;
  position: relative;
  outline: none;
  flex-shrink: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.video-container:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.5);
}

.video-engine {
  width: 100%;
  height: 100%;
  display: none;
  background: #000000;
}

.video-engine.active {
  display: block;
}

#html5-player {
  object-fit: contain;
}

.video-iframe {
  border: none;
  pointer-events: none; /* D-pad trap guard: iframe never receives taps/focus */
}

/* Loader / Buffering Spinner */
.video-loader {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 15;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.video-loader.active {
  display: flex;
}

.loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 240, 255, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loader-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.4px;
}

/* Engine Watermark Badge Overlay */
.engine-watermark {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.4);
  color: var(--accent-cyan);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  pointer-events: none;
  z-index: 10;
  backdrop-filter: blur(4px);
}

/* Embed Restriction Alert */
.embed-alert {
  display: none;
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(220, 38, 38, 0.95);
  border: 1px solid #ff4d6a;
  border-radius: 8px;
  padding: 8px 12px;
  align-items: center;
  gap: 8px;
  z-index: 20;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
}

.embed-alert.active {
  display: flex;
}

.alert-icon {
  font-size: 16px;
}

.alert-text {
  font-size: 11px;
  line-height: 1.25;
}

.alert-text b {
  display: block;
  font-size: 11.5px;
  color: #ffffff;
}

.alert-text span {
  color: #fed7aa;
}

/* ==========================================================================
   Metadata Card & Glowing Timeline (Height: ~48px)
   ========================================================================== */
.meta-card {
  background: var(--hud-card);
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  padding: 6px 10px;
  outline: none;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.meta-card:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.meta-title-box {
  display: flex;
  align-items: baseline;
  gap: 8px;
  overflow: hidden;
  max-width: 420px;
}

.meta-title {
  font-weight: 700;
  font-size: 12.5px;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-channel {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
  white-space: nowrap;
}

.time-display {
  font-size: 11px;
  font-weight: 800;
  color: #cbd5e1;
  font-family: monospace;
  white-space: nowrap;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  outline: none;
}

.progress-track:focus {
  box-shadow: 0 0 8px var(--accent-cyan);
}

.progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: rgba(255, 255, 255, 0.25);
  transition: width 0.25s linear;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff0033, #ff3366);
  box-shadow: 0 0 8px var(--accent-red);
  transition: width 0.2s linear;
}

/* ==========================================================================
   In-Lens Search Rail & Quick Search Triggers (Strict >=52px touch height)
   ========================================================================== */
.search-rail-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

/* Search input bar: Height 52px */
.search-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 52px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  height: 52px;
  background: #101623;
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  transition: all 0.15s ease;
}

.lens-suggest-dropdown {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  background: #090e18;
  border: 1.5px solid var(--accent-cyan);
  border-radius: 10px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.95);
}

.lens-suggest-dropdown.active {
  display: block;
}

.lens-suggest-item {
  height: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.12s ease, color 0.12s ease;
  outline: none;
}

.lens-suggest-item:last-child {
  border-bottom: none;
}

.lens-suggest-item:hover,
.lens-suggest-item:focus,
.lens-suggest-item.selected {
  background: rgba(0, 240, 255, 0.22);
  color: var(--accent-cyan);
}

.lens-suggest-icon {
  font-size: 13px;
  color: var(--accent-cyan);
  opacity: 0.85;
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}

.search-icon {
  font-size: 15px;
  color: var(--text-muted);
}

.lens-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.lens-search-input::placeholder {
  color: var(--text-muted);
  font-size: 12px;
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 6px;
  outline: none;
  min-width: 52px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:focus, .search-clear-btn:hover {
  color: #ffffff;
}

.search-go-btn {
  height: 52px;
  min-height: 52px;
  min-width: 58px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(0, 240, 255, 0.1));
  border: 2px solid var(--accent-cyan);
  border-radius: 10px;
  color: var(--accent-cyan);
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-go-btn:focus, .search-go-btn:hover {
  background: var(--accent-cyan);
  color: #000000;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.7);
}

/* Hands-Free Voice Search Button (Strict >=52px) */
.voice-search-btn {
  height: 52px;
  min-height: 52px;
  min-width: 68px;
  padding: 0 10px;
  background: linear-gradient(135deg, rgba(255, 0, 51, 0.25), rgba(255, 0, 51, 0.1));
  border: 2px solid var(--accent-red);
  border-radius: 10px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  outline: none;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  transition: all 0.15s ease;
  touch-action: manipulation;
}

.voice-search-btn:focus, .voice-search-btn:hover {
  background: var(--accent-red);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 0, 51, 0.75);
}

.voice-search-btn.listening {
  background: var(--accent-red) !important;
  color: #ffffff !important;
  animation: mic-pulse 0.8s infinite alternate ease-in-out;
}

@keyframes mic-pulse {
  0% { transform: scale(1); box-shadow: 0 0 12px rgba(255, 0, 51, 0.6); }
  100% { transform: scale(1.05); box-shadow: 0 0 28px rgba(255, 0, 51, 0.95); }
}

.voice-mic-icon {
  font-size: 15px;
}

.voice-mic-label {
  font-size: 11px;
  font-weight: 900;
}

/* Voice Dictation Live Pulse Overlay */
.voice-listening-overlay {
  display: none;
  position: absolute;
  top: 56px;
  left: 8px;
  right: 8px;
  background: rgba(12, 18, 29, 0.97);
  border: 2px solid var(--accent-red);
  border-radius: 12px;
  padding: 10px 14px;
  z-index: 250;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
}

.voice-listening-overlay.active {
  display: flex;
}

.voice-mic-pulse {
  font-size: 24px;
  animation: mic-pulse 0.7s infinite alternate ease-in-out;
}

.voice-status-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.voice-status-text {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
}

.voice-status-sub {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.voice-cancel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* For You Recommendation Chip */
.rail-chip.foryou-chip {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.06));
  border-color: rgba(255, 215, 0, 0.5);
  color: #ffd700;
}

.rail-chip.foryou-chip:focus, .rail-chip.foryou-chip.active {
  background: rgba(255, 215, 0, 0.3);
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.6);
}

/* Quick Search / Channel Rail Chips (All >=52px touch height!) */
.channel-rail {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
  height: 52px;
  padding: 0 1px;
}

.channel-rail::-webkit-scrollbar {
  display: none;
}

.rail-chip {
  flex: 0 0 auto;
  height: 52px;
  min-height: 52px;
  min-width: 52px;
  padding: 0 14px;
  background: #141b29;
  color: #94a3b8;
  border: 1px solid var(--border-dim);
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.18s ease;
}

.rail-chip:focus, .rail-chip.active {
  background: rgba(0, 240, 255, 0.25);
  color: var(--accent-cyan);
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.5);
  transform: scale(0.97);
}

/* ==========================================================================
   Action Controls Row (Strict Meta Glasses UI: Height 54px >= 52px)
   ========================================================================== */
.controls-row {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  height: 54px;
}

.ctrl-btn {
  flex: 1;
  height: 54px;
  min-height: 52px;
  min-width: 52px;
  background: #151e2c;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.ctrl-btn.primary {
  flex: 1.35;
  background: linear-gradient(135deg, #ff0033, #d6002c);
  border-color: #ff3355;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 0, 51, 0.35);
}

.ctrl-btn.engine-toggle-btn {
  background: rgba(0, 240, 255, 0.15);
  border-color: rgba(0, 240, 255, 0.5);
  color: var(--accent-cyan);
}

.ctrl-btn:focus, .ctrl-btn:hover {
  border-color: var(--accent-cyan) !important;
  background: rgba(0, 240, 255, 0.3) !important;
  color: var(--accent-cyan) !important;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.6) !important;
}

/* ==========================================================================
   Search Results Drawer / Overlay
   ========================================================================== */
.search-drawer {
  display: none;
  position: absolute;
  inset: 58px 8px 8px 8px; /* sits right below top bar */
  background: rgba(8, 12, 20, 0.96);
  border: 2px solid var(--accent-cyan);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  z-index: 150;
  flex-direction: column;
  padding: 10px;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
}

.search-drawer.active {
  display: flex;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 8px;
}

.drawer-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.drawer-close {
  height: 52px;
  min-height: 52px;
  min-width: 52px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close:focus {
  background: var(--accent-red);
  border-color: #ff3355;
  box-shadow: 0 0 12px rgba(255, 0, 51, 0.6);
}

.drawer-results {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
}

.drawer-item {
  min-height: 52px;
  background: #111827;
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.drawer-item:focus, .drawer-item:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
  transform: scale(0.98);
}

.drawer-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-item-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-item-sub {
  font-size: 11px;
  color: var(--accent-cyan);
}

.drawer-item-dur {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  font-family: monospace;
}

/* ==========================================================================
   HUD Toast Notification
   ========================================================================== */
.hud-toast {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 2px solid var(--accent-cyan);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  display: none;
  z-index: 200;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
  white-space: nowrap;
}

/* ==========================================================================
   Phone Remote Modal
   ========================================================================== */
.remote-modal {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(10px);
  z-index: 250;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.remote-modal.active {
  display: flex;
}

.modal-card {
  width: 94%;
  max-width: 480px;
  background: #0c121d;
  border: 2px solid var(--accent-cyan);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.4);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.modal-close {
  height: 52px;
  min-height: 52px;
  min-width: 52px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.modal-close:focus, .modal-close:hover {
  color: #ffffff;
  background: rgba(255, 0, 51, 0.3);
  border-color: var(--accent-red);
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-instruct {
  font-size: 12px;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.qr-box {
  width: 170px;
  height: 170px;
  background: #ffffff;
  padding: 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-url {
  font-size: 10px;
  color: var(--accent-cyan);
  word-break: break-all;
  margin-bottom: 6px;
  font-weight: 600;
}

.qr-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 10px;
  max-width: 380px;
}

.done-btn {
  width: 100%;
  height: 52px;
  min-height: 52px;
  background: var(--accent-cyan);
  color: #040810;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
}

.done-btn:focus {
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.8);
}

/* ==========================================================================
   Dedicated Fullscreen Theater Mode (Optical Waveguide 600x600 Inset)
   - Fixed 600x600 pure #000000 black canvas (0mW additive micro-LED)
   - Conceals HUD bars and controls
   - High-contrast floating exit pill (52px target)
   ========================================================================== */
.hud-canvas.fullscreen-active {
  padding: 0 !important;
  overflow: hidden !important;
  background: #000000 !important;
}

.hud-canvas.fullscreen-active .hud-bar,
.hud-canvas.fullscreen-active .meta-card,
.hud-canvas.fullscreen-active .search-rail-container,
.hud-canvas.fullscreen-active .controls-row,
.hud-canvas.fullscreen-active .search-drawer {
  display: none !important;
}

.hud-canvas.fullscreen-active .video-container {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 600px !important;
  height: 600px !important;
  border-radius: 0 !important;
  border: none !important;
  z-index: 9999 !important;
  background: #000000 !important;
}

.hud-canvas.fullscreen-active .video-engine {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #000000 !important;
}

/* Floating Fullscreen Exit Pill (Visible strictly in Fullscreen Mode) */
.fs-exit-pill {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.85);
  border: 1.5px solid var(--accent-cyan);
  color: var(--accent-cyan);
  padding: 0 16px;
  height: 52px;
  min-height: 52px;
  min-width: 52px;
  border-radius: 26px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
  transition: opacity 0.4s ease, background 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  touch-action: manipulation;
  opacity: 0.95;
}

.hud-canvas.fullscreen-active.faded-controls .fs-exit-pill {
  opacity: 0.2;
}

.fs-exit-pill:focus,
.fs-exit-pill:hover,
.hud-canvas.fullscreen-active.faded-controls .fs-exit-pill:hover,
.hud-canvas.fullscreen-active.faded-controls .fs-exit-pill:focus {
  opacity: 1 !important;
  background: var(--accent-cyan);
  color: #000000;
  box-shadow: 0 0 24px var(--accent-cyan);
}

.hud-canvas.fullscreen-active .fs-exit-pill {
  display: flex !important;
}

/* Fullscreen buttons active indicators */
.hud-btn.fs-btn.active,
.ctrl-btn.fs-btn.active {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}
