/* Global Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Only hide overflow on mobile/display views, not admin */
body.no-scroll {
  overflow: hidden;
}

/* Prevent zoom on iOS */
input, textarea, select {
  font-size: 16px;
}

/* ========================================
   MOBILE CONTROLLER STYLES
   ======================================== */
.mobile-container {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(145deg, #0a0a0f 0%, #12121a 50%, #0d0d14 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.mobile-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(100, 140, 220, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

/* Screen base */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
  z-index: 1;
}

.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

/* Intro Logo */
.intro-logo {
  max-width: 60%;
  max-height: 120px;
  object-fit: contain;
  margin-bottom: 1.5rem;
}

/* Typography */
.headline {
  font-size: clamp(2rem, 8vw, 4rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1.1;
}

.subtext {
  font-size: clamp(0.875rem, 3vw, 1.125rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  line-height: 1.6;
  max-width: 70%;
  margin-top: 1.5rem;
}

.instruction {
  font-size: clamp(0.75rem, 2.5vw, 0.9rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
}

/* Text action link */
.text-action {
  font-size: 1rem;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2rem;
  transition: all 0.3s ease;
  margin-top: 2.5rem;
  display: inline-block;
  background: rgba(40, 40, 60, 0.8);
}

.text-action:hover,
.text-action:active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(60, 60, 90, 0.9);
}

/* Name input screen */
.name-display {
  font-size: clamp(2.5rem, 10vw, 5rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  min-height: 1.2em;
  color: #ffffff;
  position: relative;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: text;
}

.name-display:empty::before {
  content: '|';
  animation: blink 1s infinite;
  opacity: 0.6;
}

.name-display:empty::after {
  content: 'DEIN NAME';
  color: rgba(255, 255, 255, 0.3);
  font-size: clamp(1.5rem, 6vw, 3rem);
}

@keyframes blink {
  0%, 50% { opacity: 0.6; }
  51%, 100% { opacity: 0; }
}

.hidden-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* Sport hint */
.sport-hint {
  font-size: clamp(0.75rem, 2.5vw, 0.9rem);
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

/* Sport selector */
.sport-selector {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  max-width: 90%;
}

.sport-option {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  padding: 0.625rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
}

.sport-option:hover {
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.3);
}

.sport-option.selected {
  color: #ffffff;
  border-color: rgba(160, 196, 255, 0.6);
  background: rgba(160, 196, 255, 0.1);
}

/* Loading state */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: rgba(160, 196, 255, 0.8);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Error message */
.error-message {
  color: rgba(255, 120, 120, 0.9);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 100, 100, 0.1);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 100, 100, 0.2);
}

/* Canvas for particles */
.particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
}

/* Swipe instruction */
.swipe-instruction {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
}

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

.swipe-icon {
  width: 24px;
  height: 24px;
  margin: 0 auto 0.5rem;
  opacity: 0.6;
}

/* Busy state */
.busy-message {
  text-align: center;
  padding: 2rem;
}

.busy-message h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.busy-message p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1.5rem;
}

/* ========================================
   DISPLAY / PROJECTION STYLES
   ======================================== */
.display-container {
  width: 100vw;
  height: 100vh;
  background: #000000;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.video-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.gradient-fallback {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a1a 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  z-index: 1;
}

.color-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.overlay-video,
.overlay-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

.overlay-element {
  position: absolute;
  transform-origin: center center;
}

/* Display Logo */
.display-logo {
  z-index: 15;
  pointer-events: auto;
}

.logo-image {
  width: 200px;
  height: auto;
  object-fit: contain;
}

.display-image {
  pointer-events: auto;
}

#el-imageTop {
  z-index: 8;
}

#el-imageBottom {
  z-index: 7;
}

.display-image-element {
  width: 200px;
  height: auto;
  object-fit: contain;
}

.display-headline {
  font-size: 120px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #ffffff;
  text-shadow: 0 0 60px rgba(160, 196, 255, 0.4);
  z-index: 15;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.display-subtitle {
  z-index: 14;
}

.extra-text {
  z-index: 13;
}

@keyframes breathe {
  0%, 100% { transform: var(--calibrated-transform, translate(-50%, -50%)) scale(1); opacity: 1; }
  50% { transform: var(--calibrated-transform, translate(-50%, -50%)) scale(1.02); opacity: 0.95; }
}

/* Stroke Draw Animation - Uses CSS text-stroke for outline effect */
/* --stroke-color is set via JS from the original element's computed color */
/* Animation: outline appears immediately, holds for 70%, then fills */
@keyframes strokeDrawIn {
  0% {
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-color: var(--stroke-color, #ffffff);
    -webkit-text-fill-color: transparent;
    opacity: 1;
  }
  70% {
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-color: var(--stroke-color, #ffffff);
    -webkit-text-fill-color: transparent;
    opacity: 1;
  }
  100% {
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-color: var(--stroke-color, #ffffff);
    -webkit-text-fill-color: var(--stroke-color, #ffffff);
    opacity: 1;
  }
}

/* Out animation: filled text -> outline only -> fade out */
@keyframes strokeDrawOut {
  0% {
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-color: var(--stroke-color, #ffffff);
    -webkit-text-fill-color: var(--stroke-color, #ffffff);
    opacity: 1;
  }
  30% {
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-color: var(--stroke-color, #ffffff);
    -webkit-text-fill-color: transparent;
    opacity: 1;
  }
  90% {
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-color: var(--stroke-color, #ffffff);
    -webkit-text-fill-color: transparent;
    opacity: 1;
  }
  100% {
    -webkit-text-stroke-width: 2px;
    -webkit-text-stroke-color: var(--stroke-color, #ffffff);
    -webkit-text-fill-color: transparent;
    opacity: 0;
  }
}

/* Stroke draw clone element - used with Web Animations API */
.stroke-draw-clone {
  pointer-events: none;
  -webkit-text-stroke-width: 2px;
  -webkit-text-stroke-color: var(--stroke-color, #ffffff);
  -webkit-text-fill-color: transparent;
}

.display-sport {
  font-size: 48px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.8);
}

.display-subtitle {
  font-size: 28px;
  font-weight: 400;
  color: #ffffff;
  text-align: center;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Custom Text Fields */
.custom-text-fields-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

.custom-text-field {
  position: absolute;
  font-family: 'Raleway', sans-serif;
  font-size: 32px;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.custom-text-field.visible {
  opacity: 1;
}

.custom-text-field[data-formatting-type="extraText1"] {
  font-weight: 700;
}

.custom-text-field[data-formatting-type="extraText2"] {
  font-weight: 500;
  font-style: italic;
}

.qr-container {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 20;
  pointer-events: auto;
}

.qr-wrapper {
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code canvas,
.qr-code img {
  display: block !important;
  width: 200px !important;
  height: 200px !important;
}

/* Ensure only one QR element is visible if the library appends both */
.qr-code canvas + img {
  display: none !important;
}

.qr-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 50px);
  transform: translateX(-50%);
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* Sport management styles */
.sport-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.sport-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sport-id {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
}

.sport-bg-badge {
  background: rgba(100, 200, 100, 0.2);
  color: #8f8;
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.625rem;
  text-transform: uppercase;
}

.sport-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.palette-color {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.3);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.palette-color:hover {
  transform: scale(1.1);
  border-color: rgba(255,255,255,0.6);
}

.palette-color .delete-color {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: #e74c3c;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
  cursor: pointer;
}

.palette-color:hover .delete-color {
  display: flex;
}

.sport-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  transition: background 0.2s ease;
}

.sport-checkbox:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sport-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.subtitle-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.subtitle-item .text {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.subtitle-item .sports {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Light point animation */
.light-point {
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #ffffff 0%, rgba(160, 196, 255, 0.8) 30%, transparent 70%);
  border-radius: 50%;
  filter: blur(2px);
  box-shadow: 0 0 30px rgba(160, 196, 255, 0.8), 0 0 60px rgba(160, 196, 255, 0.4);
  z-index: 15;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Display canvas for particles */
.display-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 12;
  pointer-events: none;
}

/* Calibration mode */
.calibration-active .overlay-element,
.calibration-active .custom-text-field {
  pointer-events: auto;
  cursor: move;
  outline: 2px dashed rgba(255, 255, 0, 0.5);
  outline-offset: 8px;
}

/* Image elements need special handling - use box-shadow instead of outline for centered elements */
.calibration-active .display-image {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 0, 0.5);
  background: rgba(255, 255, 0, 0.1);
}

.calibration-controls {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.9);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 100;
  pointer-events: auto;
  display: none;
  max-width: 300px;
}

.calibration-active .calibration-controls {
  display: block;
}

.calibration-controls h3 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: rgba(255, 255, 0, 0.9);
  cursor: move;
  user-select: none;
  padding: 0.25rem;
  margin: -0.25rem -0.25rem 1rem -0.25rem;
  border-radius: 4px;
}

.calibration-controls h3:hover {
  background: rgba(255, 255, 255, 0.1);
}

.control-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.control-row label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  min-width: 60px;
}

.control-row input[type="range"] {
  flex: 1;
}

.control-row input[type="number"] {
  width: 60px;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-size: 0.75rem;
}

.calibration-btn {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calibration-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.calibration-btn.primary {
  background: rgba(100, 180, 100, 0.3);
  border-color: rgba(100, 180, 100, 0.5);
}

/* ========================================
   ADMIN STYLES
   ======================================== */
.admin-container {
  min-height: 100vh;
  background: #f5f5f7;
  color: #1d1d1f;
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 2rem;
  overflow: auto;
}

.admin-header {
  max-width: 1200px;
  margin: 0 auto 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

.admin-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-nav-btn {
  padding: 0.5rem 1rem;
  background: #ffffff;
  border: 1px solid #d1d1d6;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-nav-btn:hover {
  background: #f0f0f2;
}

.admin-nav-btn.active {
  background: #1d1d1f;
  color: #ffffff;
  border-color: #1d1d1f;
}

.admin-content {
  max-width: 1200px;
  margin: 0 auto;
}

.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #d1d1d6;
  padding-bottom: 1rem;
}

.admin-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6e6e73;
}

.admin-tab:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #1d1d1f;
}

.admin-tab.active {
  background: #ffffff;
  color: #0071e3;
  border-color: #d1d1d6;
  border-bottom-color: #ffffff;
  margin-bottom: -1px;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

/* Preset subtabs (Text vs Media) */
.preset-subtabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.preset-subtab {
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6e6e73;
}

.preset-subtab:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #1d1d1f;
}

.preset-subtab.active {
  background: #0071e3;
  color: #ffffff;
  border-color: #0071e3;
}

.preset-subtab-content {
  display: none;
}

.preset-subtab-content.active {
  display: block;
}

.admin-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.admin-card h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e5e5e7;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: #6e6e73;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #d1d1d6;
  border-radius: 6px;
  font-size: 0.9375rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #0071e3;
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: #f0f0f2;
  border-radius: 1rem;
  font-size: 0.8125rem;
}

.tag-remove {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
}

.tag-remove:hover {
  background: rgba(0, 0, 0, 0.2);
}

.btn {
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: #0071e3;
  color: #ffffff;
}

.btn-primary:hover {
  background: #0077ed;
}

.btn-secondary {
  background: #f0f0f2;
  color: #1d1d1f;
  border: 1px solid #d1d1d6;
}

.btn-secondary:hover {
  background: #e5e5e7;
}

.btn-danger {
  background: #ff3b30;
  color: #ffffff;
}

.btn-danger:hover {
  background: #ff453a;
}

.btn-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-content {
  background: #1a1a2e;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  color: #fff;
}

.modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animation Preview Container */
.animation-preview-container {
  position: relative;
  width: 100%;
  height: 150px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.animation-preview-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
  opacity: 0.4;
  z-index: 1;
}

.animation-preview-title {
  position: relative;
  z-index: 2;
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.animation-preview-subtitle {
  position: relative;
  z-index: 2;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.85);
  margin-top: 0.25rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.link-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.link-buttons a {
  text-decoration: none;
  text-align: center;
}

/* Design Controls */
.design-element-select {
  margin-bottom: 1.5rem;
}

.design-element-select label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.design-sliders {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.slider-group label {
  font-size: 0.875rem;
  color: #666;
}

.slider-group input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e5e5e7;
  outline: none;
  cursor: pointer;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007aff;
  cursor: pointer;
}

.slider-group input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #007aff;
  cursor: pointer;
  border: none;
}

.minitext-item {
  background: #f9f9fb;
  border: 1px solid #e5e5e7;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.minitext-item .text {
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.minitext-item .sports {
  font-size: 0.75rem;
  color: #6e6e73;
}

.location-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.location-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid #e5e5e7;
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.location-card:hover {
  border-color: #0071e3;
  box-shadow: 0 2px 8px rgba(0, 113, 227, 0.1);
}

.location-card.active {
  border-color: #0071e3;
  background: rgba(0, 113, 227, 0.05);
}

.location-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.location-card p {
  font-size: 0.8125rem;
  color: #6e6e73;
}

/* Error page */
.error-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0a0a0f 0%, #12121a 100%);
  color: #ffffff;
  text-align: center;
  padding: 2rem;
}

.error-container h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.error-container p {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2rem;
}

.location-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.location-links a {
  color: rgba(160, 196, 255, 0.9);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(160, 196, 255, 0.3);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.location-links a:hover {
  background: rgba(160, 196, 255, 0.1);
  border-color: rgba(160, 196, 255, 0.5);
}

/* ========================================
   MEDIA LIBRARY MODAL
   ======================================== */
.media-library-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.media-library-content {
  background: #1a1a1a;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.media-library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #333;
}

.media-library-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #fff;
}

.media-library-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.75rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.media-library-close:hover {
  color: #fff;
}

.media-library-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem 0;
}

.media-library-tab {
  padding: 0.5rem 1rem;
  border: none;
  background: #2a2a2a;
  color: #888;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.media-library-tab:hover {
  background: #333;
  color: #ccc;
}

.media-library-tab.active {
  background: #333;
  color: #fff;
}

.media-library-upload-section {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #333;
}

.media-library-upload-zone {
  border: 2px dashed #444;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.media-library-upload-zone:hover,
.media-library-upload-zone.dragover {
  border-color: #666;
  background: rgba(255, 255, 255, 0.02);
}

.upload-zone-content {
  color: #888;
}

.upload-zone-content .upload-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.upload-browse-btn {
  background: none;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
}

.upload-browse-btn:hover {
  color: #60a5fa;
}

#media-library-upload-progress {
  margin-top: 1rem;
  text-align: center;
}

#media-library-upload-progress .upload-progress-bar {
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

#media-library-upload-progress .upload-progress-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 50%;
  background: #3b82f6;
  animation: progressPulse 1s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(200%); }
}

.upload-progress-text {
  color: #888;
  font-size: 0.875rem;
}

.media-library-grid {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  align-content: start;
}

.media-library-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: #222;
}

.media-library-item:hover {
  border-color: #555;
  transform: scale(1.02);
}

.media-library-item.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.media-library-item img,
.media-library-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-library-item .item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.media-library-item .item-name {
  font-size: 0.75rem;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-library-item .item-type {
  font-size: 0.625rem;
  color: #888;
  text-transform: uppercase;
}

.media-library-item .item-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
}

.media-library-item .item-badge.video {
  background: #ef4444;
  color: #fff;
}

.media-library-item .item-badge.image {
  background: #22c55e;
  color: #fff;
}

.media-library-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-style: italic;
  padding: 2rem;
}

.media-library-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #333;
}

/* Media Picker Button (replaces select dropdowns) */
.media-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.media-picker-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #ccc;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
  flex: 1;
  min-width: 0;
}

.media-picker-btn:hover {
  background: #333;
  border-color: #555;
}

.media-picker-preview {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.media-picker-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.media-picker-clear {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.2s;
}

.media-picker-clear:hover {
  color: #ef4444;
}

/* ========================================
   SUBLINE SELECTOR STYLES
   ======================================== */
.subline-selector {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 95%;
  max-height: 40vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.subline-option {
  font-size: 0.8rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  line-height: 1.4;
}

.subline-option:hover {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.subline-option.selected {
  color: #ffffff;
  border-color: rgba(160, 196, 255, 0.6);
  background: rgba(160, 196, 255, 0.15);
}

/* ========================================
   COUNTDOWN SCREEN STYLES
   ======================================== */
.confetti-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.countdown-container {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  animation: fadeInScale 0.6s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.countdown-title {
  font-size: clamp(1rem, 4vw, 1.5rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.countdown-timer {
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 0 40px rgba(160, 196, 255, 0.5);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 40px rgba(160, 196, 255, 0.5);
  }
  50% {
    transform: scale(1.02);
    text-shadow: 0 0 60px rgba(160, 196, 255, 0.7);
  }
}

.countdown-name {
  font-size: clamp(1.5rem, 6vw, 3rem);
  font-weight: 700;
  color: rgba(160, 196, 255, 1);
  margin-top: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.countdown-subline {
  font-size: clamp(0.75rem, 3vw, 1rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1rem;
  max-width: 80%;
  line-height: 1.5;
  font-style: italic;
}
