/* Reset & Fullscreen Layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: #000000;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

/* =========================================
   GLASSMORPHISM SEMI-TRANSPARENT CONTROL BAR
   ========================================= */
.controls-bar {
  background: rgba(247, 156, 0, 0.5);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.controls-bar.hidden {
  display: none !important;
}

.input-group {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
}

/* Glassmorphism Text Input */
.text-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  color: #ffffff;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.text-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: #eff1f1;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
}

.options-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Glassmorphism Control Items */
.control-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 4px 10px;
  transition: all 0.2s ease;
}

.control-item:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
}

.control-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Color Pickers */
.color-picker {
  -webkit-appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
}

/* Glassmorphism Dropdowns */
.control-select {
  background-color: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding: 4px 0;
}

.control-select option {
  background-color: #161622;
  color: #ffffff;
  font-weight: 600;
}

/* Glassmorphism Buttons */
.icon-btn-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.icon-btn-toggle.active {
  background: rgba(0, 240, 255, 0.25);
  color: #00f0ff;
  border-color: #00f0ff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}

.icon-btn-eye {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.85);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn-eye:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #9d3d32;
  border-color: #1a2368;
}

/* Floating Eye Button in Glassmorphism Style */
.floating-eye-btn {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 100;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.45;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.floating-eye-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.25);
  border-color: #00f0ff;
  color: #00f0ff;
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.hidden {
  display: none !important;
}

/* Live Display Screen Area */
.banner-screen {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background-color: #000000;
  cursor: pointer;
}

/* Marquee Rotator Wrapper (Handles 90°/270° orientation rotation without conflicting with keyframe translation) */
.marquee-rotator {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: visible;
  pointer-events: none;
  transform-origin: center center;
}

/* Mode: Horizontal (Standard Desktop & Landscape) */
.banner-screen.mode-horizontal {
  justify-content: flex-start;
  align-items: center;
}

.banner-screen.mode-horizontal .marquee-rotator {
  width: 100%;
  height: 100%;
  transform: none;
}

.banner-screen.mode-horizontal .marquee-track {
  display: flex;
  flex-direction: row;
  white-space: nowrap;
  animation-name: scrollMarqueeHoriz;
}

.banner-screen.mode-horizontal .marquee-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-right: 1.2em;
  padding-bottom: 0;
  white-space: nowrap;
}

/* Mode: Rotate 90° Clockwise (Optimized for holding phone vertically in hand) */
.banner-screen.mode-rotate90 {
  justify-content: center;
  align-items: center;
}

.banner-screen.mode-rotate90 .marquee-rotator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
}

.banner-screen.mode-rotate90 .marquee-track {
  display: flex;
  flex-direction: row;
  white-space: nowrap;
  animation-name: scrollMarqueeHoriz;
}

.banner-screen.mode-rotate90 .marquee-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-right: 1.2em;
  padding-bottom: 0;
  white-space: nowrap;
}

/* Mode: Rotate 270° Counter-Clockwise (Reverse hand hold) */
.banner-screen.mode-rotate270 {
  justify-content: center;
  align-items: center;
}

.banner-screen.mode-rotate270 .marquee-rotator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.banner-screen.mode-rotate270 .marquee-track {
  display: flex;
  flex-direction: row;
  white-space: nowrap;
  animation-name: scrollMarqueeHoriz;
}

.banner-screen.mode-rotate270 .marquee-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-right: 1.2em;
  padding-bottom: 0;
  white-space: nowrap;
}

/* Mode: Vertical Scroll (Bottom to Top Upward Marquee) */
.banner-screen.mode-vertical {
  justify-content: center;
  align-items: flex-start;
}

.banner-screen.mode-vertical .marquee-rotator {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  transform: none;
}

.banner-screen.mode-vertical .marquee-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation-name: scrollMarqueeVert;
}

.banner-screen.mode-vertical .marquee-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-right: 0;
  padding-bottom: 1.5em;
  padding-top: 0.5em;
  width: 100%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.15;
}

.vertical-msg-block {
  padding: 0.4em 0;
  width: 100%;
  display: block;
}

/* Seamless Infinite Marquee Track */
.marquee-track {
  display: flex;
  will-change: transform;
  animation: scrollMarqueeHoriz 8s linear infinite;
  pointer-events: none;
  /* Allows double taps on text to bubble to banner-screen */
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-right: 1.2em;
  line-height: 1;
  transition: text-shadow 0.3s;
  pointer-events: none;
}

/* LED Neon Aura Glow Effect */
.marquee-item.glow-effect {
  text-shadow:
    0 0 10px currentColor,
    0 0 20px currentColor,
    0 0 40px currentColor,
    0 0 80px currentColor;
}

/* Font Styles */
.font-normal {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
}

.font-bold {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.font-cyber {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.font-neon {
  font-family: 'Monoton', cursive;
  text-transform: uppercase;
}

.font-russo {
  font-family: 'Russo One', sans-serif;
  text-transform: uppercase;
}

.font-synth {
  font-family: 'Righteous', cursive;
  text-transform: uppercase;
}

.font-retro {
  font-family: 'Bungee', cursive;
  text-transform: uppercase;
}

.font-pixel {
  font-family: 'Press Start 2P', monospace;
  text-transform: uppercase;
}

/* Continuous Infinite Scroll Keyframes */
@keyframes scrollMarqueeHoriz {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes scrollMarqueeVert {
  0% {
    transform: translateY(0%);
  }
  100% {
    transform: translateY(-50%);
  }
}

@keyframes scrollMarquee {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Mobile & Portrait Screen Optimization */
@media (max-width: 768px) {
  .controls-bar {
    padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    gap: 8px;
  }

  .input-group {
    flex: 1 1 100%;
  }

  .options-group {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .control-item {
    padding: 3px 8px;
  }

  .text-input,
  .control-select {
    font-size: 16px; /* Avoid iOS Safari automatic zoom on focus */
  }

  .control-label {
    font-size: 0.68rem;
  }

  .floating-eye-btn {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    width: 42px;
    height: 42px;
  }
}