html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #000000;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#app-title {
  position: fixed;
  top: 10px;
  right: 16px;
  color: #d4af37;
  font-family: "Georgia", "Times New Roman", serif;
  font-weight: 700;
  font-size: min(5.2vw, 28px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.7);
  background: radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.08), transparent 60%) rgba(0, 0, 0, 0.75);
  text-shadow:
    0 0 4px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(212, 175, 55, 0.7),
    0 0 18px rgba(212, 175, 55, 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 25;
  animation: appTitleFade 5s ease-out 0.5s forwards;
}

@keyframes appTitleFade {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  20% {
    opacity: 1;
    transform: translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

body.cursor-hidden {
  cursor: none;
}

#clock {
  display: block;
  width: 100vw;
  height: 100vh;
}

.clock-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.clock-grid-container canvas {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1;
  max-width: 400px;
  margin: 0 auto;
}

#bottom-controls {
  position: fixed;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 16px;
  z-index: 20;
}

.bottom-ctrl {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 20, 20, 0.9);
  color: #f5f5f5;
  font-size: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  padding: 0;
  box-sizing: border-box;
  transition: opacity 0.4s ease-out;
  opacity: 1;
}

.bottom-ctrl.faded {
  opacity: 0.05;
  transition: opacity 10s ease-in-out;
}

.bottom-ctrl.disabled {
  opacity: 0.25;
  filter: grayscale(1);
  pointer-events: none;
  cursor: default;
}

.bottom-ctrl:hover {
  opacity: 1 !important;
}

.bottom-ctrl:active {
  transform: scale(0.96) !important;
  animation: none !important;
}

.bottom-ctrl.active {
  background: rgba(20, 20, 20, 0.9);
  color: #f5f5f5;
  box-shadow:
    0 0 10px rgba(245, 245, 245, 0.6),
    0 0 20px rgba(212, 175, 55, 0.7),
    0 0 30px rgba(212, 175, 55, 0.5);
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.bottom-ctrl.floating {
  animation: iconFloat 4s ease-in-out infinite;
}

#slideshow-toggle {
  overflow: hidden;
}

#fullscreen-toggle {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

#face-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

#settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 30;
}

#settings-overlay.hidden {
  display: none;
}

#settings-panel {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(8px);
  color: #f5f5f5;
  border-radius: 0 0 16px 16px;
  padding: 12px 16px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7);
  position: fixed;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  cursor: grab;
}

.settings-header:active {
  cursor: grabbing;
}

#settings-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 18px;
  padding: 4px;
  cursor: pointer;
}

.settings-section {
  margin-top: 8px;
}

.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  margin-bottom: 2px;
}

.button-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.cycle-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.compact-btn {
  max-width: 200px;
}

.cycle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.cycle-btn:active {
  transform: scale(0.98);
}

.opacity-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1d1d1d;
  color: #f5f5f5;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
}

.opacity-btn.selected {
  background: #f5f5f5;
  color: #111111;
  border-color: #f5f5f5;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0;
  cursor: pointer;
}

.swatch.selected {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

/* New helper text and inline toggle styling */
.section-help {
  font-size: 10px;
  opacity: 0.7;
  margin-bottom: 4px;
}

.inline-toggle {
  margin-top: 4px;
}

.subsection-label {
  font-size: 10px;
  opacity: 0.75;
  margin-top: 8px;
  margin-bottom: 4px;
}

.toggle-row {
  display: flex;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
}

.toggle-row input {
  margin-right: 6px;
}

.tooltip {
  position: fixed;
  background: radial-gradient(circle at 10% 0%, rgba(255, 255, 255, 0.12), transparent 55%)
    rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 18px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 25;
}

.tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.tooltip.fade-out {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

@media (min-width: 600px) {
  #settings-panel {
    border-radius: 0 0 16px 16px;
    margin-top: 0;
  }
}

@media (max-width: 767px) {
  .bottom-ctrl {
    width: 26px;
    height: 26px;
    font-size: 23px;
  }

  #fullscreen-toggle {
    font-size: 12px;
    display: none;
  }

  /* Make settings overlay much more transparent on mobile (≈90% transparent) */
  #settings-overlay {
    background: rgba(0, 0, 0, 0.1);
  }

  /* Mobile-specific settings panel typography + left gutter */
  #settings-panel {
    padding-left: 36px; /* original 16px + extra 20px left padding */
  }

  .settings-header {
    font-size: 10px; /* 14px - 4 */
  }

  .settings-section,
  .settings-section * {
    font-size: inherit;
  }

  .section-title {
    font-size: 7px; /* 11px - 4 */
  }

  .cycle-btn {
    font-size: 9px; /* 13px - 4 */
  }

  .opacity-btn {
    font-size: 8px; /* 12px - 4 */
  }

  .section-help {
    font-size: 6px; /* 10px - 4 */
  }

  .subsection-label {
    font-size: 6px; /* 10px - 4 */
  }

  .toggle-row {
    font-size: 8px; /* 12px - 4 */
  }

  /* Reduce padding for all main buttons in the settings window on mobile */
  #settings-panel .cycle-btn {
    padding: 5px 11px; /* 10px 16px - 5px on all sides */
  }

  #settings-panel .opacity-btn {
    padding: 2px 5px; /* 7px 10px - 5px on all sides */
  }

  #settings-panel #settings-close {
    padding: 0px; /* 4px - 5px, clamped to 0 */
  }
}

