/* Local clone refinements & styles for unlocked Plus controls, custom themes, Rooms, and Share */
body {
  min-height: 100vh;
  overflow: hidden;
  user-select: none;
}

#bg-wrapper {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: #0b0d14;
}

#bg-image,
#bg-video,
#bg-canvas,
#bg-youtube {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

#bg-image,
#bg-video,
#bg-canvas {
  display: none;
}

body[data-theme-type="image"] #bg-image,
body[data-theme-type="upload"] #bg-image {
  display: block;
}

body[data-theme-type="video"] #bg-video {
  display: block;
}

body[data-theme-type="animated"] #bg-canvas {
  display: block;
}

#bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--fl-bg-opacity, 0.2));
  pointer-events: none;
  z-index: 1;
}

#bg-youtube iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120vw;
  height: 120vh;
  min-width: 177.78vh;
  min-height: 56.25vw;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

/* Ensure crisp layout layers above background */
#top, .hero, .subhero, #bottom {
  position: relative;
  z-index: 10;
}

#top-left .logo {
  height: 28px;
  width: auto;
  color: var(--fl-foreground-color, #fff);
  cursor: pointer;
}

#top-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ambient-timer-badge {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fl-foreground-color, #fff);
  opacity: 0.85;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}

body[data-dashboard-mode="ambient"] .ambient-timer-badge {
  display: inline-flex;
}

body[data-dashboard-mode="ambient"] #top-right .flocus-quote,
body[data-dashboard-mode="ambient"] .hero,
body[data-dashboard-mode="ambient"] .subhero {
  display: none !important;
}

body[data-dashboard-mode="home"] #pomodoro-container {
  display: none !important;
}

body[data-dashboard-mode="focus"] flocus-clock {
  display: none !important;
}

/* Top quote */
.flocus-quote {
  max-width: 340px;
  text-align: right;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 500;
  color: var(--fl-foreground-color, #fff);
  opacity: 0.9;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.flocus-quote:hover {
  opacity: 1;
}

.flocus-quote[data-font="serif"] {
  font-family: "DM Serif Display", Georgia, serif;
}

.flocus-quote.hidden-quote {
  display: none !important;
}

/* Popout wrappers */
.tasks-popout-wrapper,
.soundscapes-wrapper,
.notepad-popout-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tasks-popout-wrapper .tasks-wrapper,
.soundscapes-wrapper .soundscapes-popup,
.notepad-popout-wrapper .notepad-popup {
  display: none;
  position: fixed;
  bottom: 72px;
  left: 24px;
  z-index: 1050;
  width: min(520px, 92vw);
  max-height: 75vh;
  overflow-y: auto;
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid rgba(75, 85, 99, 0.55);
  border-radius: 16px;
  color: #fff;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.tasks-popout-wrapper.show .tasks-wrapper,
.soundscapes-wrapper.show .soundscapes-popup,
.notepad-popout-wrapper.show .notepad-popup {
  display: block;
}

.soundscapes-overlay {
  position: fixed;
  inset: 0;
  z-index: 1040;
}

/* Soundscape grid */
.soundscapes-popup {
  width: min(640px, 94vw) !important;
  padding: 1.25rem;
}

.sounds-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1rem;
}

.sounds-nav-tabs {
  display: flex;
  gap: 1.25rem;
}

.sounds-nav-tabs button {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  cursor: pointer;
}

.sounds-nav-tabs button.active {
  color: #fff;
}

.sounds-controls-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sounds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 0.75rem;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.sound-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.4rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.sound-tile:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sound-tile.active {
  background: rgba(116, 50, 255, 0.22);
  border-color: #7432ff;
}

.sound-tile .sound-emoji {
  font-size: 1.75rem;
  line-height: 1.2;
}

.sound-tile .sound-name {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.2;
}

.sound-tile input[type="range"] {
  width: 85%;
  height: 4px;
  accent-color: #7432ff;
}

/* Playlist cards */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.playlist-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.playlist-card:hover,
.playlist-card.active {
  background: rgba(116, 50, 255, 0.22);
  border-color: #7432ff;
}

.playlist-card .pl-emoji {
  font-size: 1.5rem;
}

.playlist-card .pl-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.playlist-card .pl-desc {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}

/* Notepad popup */
.notepad-popup {
  padding: 1rem 1.25rem;
}

.notepad-popup .ql-toolbar.ql-snow {
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.04);
}

.notepad-popup .ql-container.ql-snow {
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 0 0 10px 10px;
  color: #fff;
  font-size: 0.95rem;
}

.notepad-popup .ql-snow .ql-stroke {
  stroke: #d1d5db;
}

.notepad-popup .ql-snow .ql-fill {
  fill: #d1d5db;
}

.notepad-popup .ql-snow .ql-picker {
  color: #d1d5db;
}

/* Tasks panel enhancements */
.tasks-wrapper {
  padding: 1.15rem;
}

.tasks-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tasks-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(116, 50, 255, 0.25);
  color: #a78bfa;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
}

.tasks-header-text {
  flex: 1;
}

.tasks-header-text h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.tasks-header-text .eta-info {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
}

.task-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  margin-top: 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.task-row.subtask-row {
  margin-left: 1.5rem;
  background: rgba(255, 255, 255, 0.025);
}

.task-row.completed input[type="text"] {
  text-decoration: line-through;
  opacity: 0.55;
}

.task-row input[type="text"] {
  flex: 1;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  min-width: 0;
}

.task-row .drag-handle {
  cursor: grab;
  color: rgba(255, 255, 255, 0.35);
  padding: 0 0.2rem;
  font-size: 0.9rem;
}

.task-tag-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.task-emoji-btn {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0 2px;
  font-size: 1rem;
  line-height: 1;
}

.task-eta-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  border-radius: 6px;
  font-size: 0.72rem;
  padding: 0.15rem 0.3rem;
}

.task-menu-btn {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 2px 4px;
}

.task-menu-btn:hover {
  color: #fff;
}

.task-counter {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #7432ff;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.task-counter[data-count="0"] {
  display: none;
}

/* Focus intention editable */
.focus-intention-input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--fl-foreground-color, #fff);
  text-align: center;
  font-size: 1.35rem;
  font-weight: 600;
  outline: none;
  margin-bottom: 0.75rem;
  width: min(520px, 85vw);
  padding: 0.2rem 0.5rem;
  transition: border-color 0.2s;
}

.focus-intention-input:focus {
  border-bottom-color: rgba(255, 255, 255, 0.4);
}

.focus-intention-input::placeholder {
  color: var(--fl-foreground-color, #fff);
  opacity: 0.6;
}

/* Theme gallery in settings */
.theme-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.theme-category-pill {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid transparent;
  cursor: pointer;
}

.theme-category-pill.active {
  background: #7432ff;
  color: #fff;
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 0.75rem;
}

.theme-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  cursor: pointer;
  border: 2px solid transparent;
  background: #181a24;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.theme-card:hover {
  transform: translateY(-2px);
}

.theme-card.active {
  border-color: #7432ff;
  box-shadow: 0 0 0 2px rgba(116, 50, 255, 0.35);
}

.theme-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.theme-card .theme-card-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.35rem 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-card .apply-all-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  opacity: 0;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  font-size: 0.68rem;
  padding: 2px 6px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.theme-card:hover .apply-all-btn {
  opacity: 1;
}

/* Settings preview card */
.theme-preview {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.75rem 0 1rem;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.theme-preview .preview-clock {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.theme-preview .preview-name-pill {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Stats Heatmap */
.stats-calendar-grid {
  display: grid;
  grid-template-columns: repeat(26, 1fr);
  gap: 3px;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  overflow-x: auto;
}

.cal-cell {
  aspect-ratio: 1;
  min-width: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.cal-cell[data-level="1"] { background: rgba(116, 50, 255, 0.3); }
.cal-cell[data-level="2"] { background: rgba(116, 50, 255, 0.55); }
.cal-cell[data-level="3"] { background: rgba(116, 50, 255, 0.8); }
.cal-cell[data-level="4"] { background: #7432ff; }

/* Onboarding overlay */
body #onboarding:not(.hidden) {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 20, 0.55);
  backdrop-filter: blur(12px);
}

.onboarding-card {
  width: min(420px, 92vw);
  background: #141724;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 2rem;
  color: #fff;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

/* Streak badge */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  color: var(--fl-foreground-color, #fff);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

/* Tooltip popovers */
.flocus-coach-tip {
  position: fixed;
  bottom: 72px;
  z-index: 1200;
  background: #181b28;
  color: #fff;
  border: 1px solid rgba(116, 50, 255, 0.5);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  max-width: 280px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font-size: 0.85rem;
}

/* Flip clock theme swatches */
.flip-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: inline-block;
  margin-right: 6px;
}
.flip-swatch.active {
  border-color: #7432ff;
  box-shadow: 0 0 0 2px #fff;
}

/* Option preview cards for Timer styles & Clock fonts */
.font-option-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid transparent;
  cursor: pointer;
}
.font-option-card.active {
  border-color: #7432ff;
  background: rgba(116, 50, 255, 0.16);
}

.timer-style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-align: center;
}
.timer-style-card.active {
  border-color: #7432ff;
  background: rgba(116, 50, 255, 0.16);
}

/* Alert & Tally picker grids */
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.picker-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid transparent;
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}
.picker-chip.active {
  border-color: #7432ff;
  background: rgba(116, 50, 255, 0.22);
}

/* Room live indicator */
.room-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  box-shadow: 0 0 8px #22c55e;
}

.hidden {
  display: none !important;
}

/* Settings modal nav icon + dark panel polish */
.offcanvas#offcanvas {
  --bs-offcanvas-width: min(880px, 96vw);
  width: var(--bs-offcanvas-width) !important;
  background: #0f111a;
  color: #f3f4f6;
}
#settModal-tab {
  position: static !important;
  width: 215px !important;
  min-width: 215px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem 0.75rem;
  overflow-y: auto;
}
#settModal-tabContent {
  margin-left: 0 !important;
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  padding: 1.75rem 2rem;
}
.settings-group {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}
.settings-input-group {
  margin-bottom: 1rem;
}
.settings-input-group:last-child {
  margin-bottom: 0;
}
.settings-header {
  margin-bottom: 1.25rem;
}
.settings-header h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.settings-header .subtitle {
  color: #9ca3af;
  font-size: 0.92rem;
}
.description {
  font-size: 0.8rem;
  color: #9ca3af;
}
