/* === General Reset & Base === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg, rgba(255, 255, 255, 0.05)); /* --bg is set by theme and can be overridden for dark/light mode */
  color: var(--text, #fff);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background: var(--bg, rgba(255, 255, 255, 0.08)); /* --bg is set by theme and can be overridden for dark/light mode */
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 0 30px rgba(0,0,0,0.25);
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
}

/* === Title === */
.title {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  font-weight: bold;
}

/* === Flip Timer === */
.timer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 1.2rem;
}

.flip-unit {
  flex: 1;
  background: var(--flip-bg, #00000040);
  border-radius: 12px;
  padding: 10px;
  box-shadow: inset 0 0 5px #00000066;
  transition: transform 0.4s cubic-bezier(.68,-0.55,.27,1.55), box-shadow 0.4s;
  will-change: transform, box-shadow;
  animation: glow 2.5s infinite alternate;
  min-width: 110px;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.flip-unit:focus-within, .flip-unit:hover {
  transform: scale(1.08);
  box-shadow: 0 0 32px 8px var(--flip-bg, #fff8), 0 0 8px #00000066 inset;
  animation: pop 0.5s;
}

.flip {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--flip-text, #fff);
  background: var(--flip-bg, #111);
  padding: 10px 0;
  margin-top: 5px;
  border-radius: 8px;
  animation: flipIn 0.7s cubic-bezier(.68,-0.55,.27,1.55);
  transition: background 0.3s, color 0.3s, box-shadow 0.4s;
  will-change: background, color, box-shadow;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 2.8em;
}

/* === Controls === */
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.controls button {
  padding: 10px 15px;
  border: none;
  border-radius: 10px;
  background: var(--btn-bg, #1a1a1a);
  color: var(--btn-text, #fff);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, transform 0.2s, box-shadow 0.3s;
  box-shadow: 0 2px 8px #0002;
}

.controls button:hover, .controls button:focus {
  background: var(--btn-hover, #333);
  transform: scale(1.12);
  box-shadow: 0 4px 16px #0003;
}

/* === Settings Panel === */
.settings-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, padding 0.3s ease;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 15px;
  margin-top: 1rem;
  padding: 0 1rem;
}

.settings-panel.open {
  max-height: 500px;
  padding: 1rem;
}

.settings-panel h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1.1rem;
  color: #ffd;
}

.custom-time {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.custom-time input {
  width: 60px;
  padding: 6px;
  font-size: 1rem;
  text-align: center;
  border-radius: 8px;
  border: none;
  background: var(--btn-bg, #1a1a1a);
  color: var(--btn-text, #fff);
}

.custom-time button {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--btn-bg, #0077ff);
  border: none;
  color: var(--btn-text, #fff);
  font-weight: bold;
  cursor: pointer;
}

.theme-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 1rem;
}

/* === Easter Egg Styles === */
.easter-btn {
  position: fixed;
  top: 18px;
  z-index: 1001;
  background: var(--btn-bg, #1a1a1a);
  color: var(--btn-text, #fff);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 2px 12px #0005;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
  opacity: 0.92;
}
.easter-btn.left { left: 18px; }
.easter-btn.right { right: 18px; }
.easter-btn:hover, .easter-btn:focus {
  background: var(--btn-hover, #333);
  transform: scale(1.13) rotate(-6deg);
  box-shadow: 0 4px 24px #0007;
}

/* === Hamburger Icon === */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
  height: 24px;
  justify-content: center;
  align-items: center;
}
.hamburger-icon span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--btn-text, #fff);
  border-radius: 2px;
  transition: background 0.3s;
}

/* === Secret Dev Panel === */
.dev-secret-panel {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10,10,10,0.98);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.5s;
  font-family: 'Fira Mono', 'Consolas', 'Courier New', monospace;
}
.dev-secret-panel.open {
  display: flex;
}
.dev-secret-content {
  background: linear-gradient(135deg, #111 80%, #222 100%);
  color: #39ff14;
  border: 2.5px solid #39ff14;
  border-radius: 12px;
  padding: 2.5rem 2rem 2rem 2rem;
  box-shadow: 0 0 32px #000a, 0 0 0 4px #39ff1440 inset, 0 0 0 8px #ff005520;
  min-width: 340px;
  max-width: 98vw;
      max-height: 90vh;
  overflow-y: auto;
  text-align: left;
  position: relative;
  animation: flickerIn 0.7s cubic-bezier(.68,-0.55,.27,1.55);
  font-family: 'Fira Mono', 'Consolas', 'Courier New', monospace;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px #39ff14, 0 0 2px #fff2;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: #39ff14 #222;
}
/* WebKit browsers */
.dev-secret-content::-webkit-scrollbar {
  width: 8px;
  background: #222;
}
.dev-secret-content::-webkit-scrollbar-thumb {
  background: #39ff14;
  border-radius: 8px;
}
.dev-secret-content h2 {
  margin-bottom: 1rem;
  color: #ff0055;
  font-size: 1.3em;
  font-family: inherit;
  text-shadow: 0 0 8px #ff0055, 0 0 2px #fff2;
}
.dev-secret-content button {
  margin: 0.5rem 0.5rem 0 0;
  background: #111;
  color: #39ff14;
  border: 1px solid #39ff14;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1em;
  padding: 0.4em 1.2em;
  transition: background 0.2s, color 0.2s, border 0.2s;
  box-shadow: 0 0 8px #39ff1440;
}
.dev-secret-content button:hover, .dev-secret-content button:focus {
  background: #39ff14;
  color: #111;
  border: 1px solid #ff0055;
  outline: 2px solid #ff0055;
}
.dev-secret-content input {
  background: #111;
  color: #39ff14;
  border: 1px solid #39ff14;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1em;
  padding: 0.2em 0.7em;
  margin-left: 0.5em;
  box-shadow: 0 0 8px #39ff1440;
}
.dev-options {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}
.easter-hint {
  margin-top: 2rem;
  color: #ff0055;
  font-size: 1.1em;
  font-style: italic;
  text-shadow: 0 0 8px #ff0055, 0 0 2px #fff2;
}
.easter-egg-emoji {
  font-size: 1.2em;
  filter: grayscale(1) brightness(2);
}
@keyframes flickerIn {
  0% { opacity: 0; filter: blur(8px); }
  60% { opacity: 1; filter: blur(1px); }
  100% { opacity: 1; filter: blur(0); }
}

@keyframes flipIn {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes glow {
  0% { box-shadow: 0 0 0px #fff0; }
  50% { box-shadow: 0 0 24px 6px var(--glow-color, #7fd7ff); }
  100% { box-shadow: 0 0 0px #fff0; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.party {
  animation: partyBg 0.5s infinite alternate;
}

@keyframes partyBg {
  0% { background: #ffb347; }
  25% { background: #ff6961; }
  50% { background: #77dd77; }
  75% { background: #aec6cf; }
  100% { background: #f49ac2; }
}

@media (max-width: 700px) {
  .container {
    padding: 1.2rem 0.5rem;
    max-width: 98vw;
  }
  .title {
    font-size: 1.3rem;
  }
  .flip {
    font-size: 1.2rem;
  }
  .timer {
    gap: 4px;
  }
  .corner-btns {
    top: 8px;
    right: 8px;
    gap: 6px;
  }
  .corner-btn {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  .dropdown-menu { min-width: 140px; top: 44px; }
}

@media (max-width: 600px) {
  .easter-btn.left, .easter-btn.right { top: 8px; left: 8px; right: 8px; width: 38px; height: 38px; font-size: 1.1rem; }
  .dev-secret-content { padding: 1.2rem 0.5rem; min-width: 0; }
}

@media (max-width: 400px) {
  .flip {
    font-size: 0.9rem;
    padding: 4px 0;
  }
  .controls button {
    padding: 6px 8px;
    font-size: 0.9rem;
  }
}

body.show-grid {
  background-image: linear-gradient(rgba(200,200,255,0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(200,200,255,0.12) 1px, transparent 1px);
  background-size: 32px 32px;
}
body.no-animations *, body.no-animations *:before, body.no-animations *:after {
  animation: none !important;
  transition: none !important;
}

body.glitch {
  animation: glitchy 0.2s infinite;
}
@keyframes glitchy {
  0% { filter: none; }
  20% { filter: blur(1px) hue-rotate(10deg); }
  40% { filter: contrast(2) brightness(1.2); }
  60% { filter: blur(2px) hue-rotate(-10deg); }
  80% { filter: none; }
  100% { filter: none; }
}
body.scanlines::before {
  content: '';
  pointer-events: none;
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 4000;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.12) 0px,
    rgba(0,0,0,0.12) 1px,
    transparent 2px,
    transparent 4px
  );
}
body.crt::after {
  content: '';
  pointer-events: none;
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 4001;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.08) 0%, rgba(0,0,0,0.18) 100%);
  box-shadow: 0 0 80px 8px #39ff1440 inset;
  mix-blend-mode: screen;
}

.corner-btns {
  position: fixed;
  top: 24px;
  right: 32px;
  display: flex;
  gap: 14px;
  z-index: 1100;
}
.corner-btn {
  background: var(--btn-bg, #1a1a1a);
  color: var(--btn-text, #fff);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 2px 12px #0005;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
  opacity: 0.97;
  position: relative;
  outline: none;
}
.corner-btn:focus, .corner-btn:hover {
  background: var(--btn-hover, #333);
  transform: scale(1.13) rotate(-6deg);
  box-shadow: 0 4px 24px #0007;
  outline: 2px solid #ffd;
}
.corner-btn.google {
  background: #fff;
  color: #4285F4;
  border: 2px solid #4285F4;
  box-shadow: 0 2px 12px #4285F455;
}
.corner-btn.google:focus, .corner-btn.google:hover {
  background: #f5f5f5;
  border-color: #EA4335;
  color: #EA4335;
}
.google-icon {
  width: 24px;
  height: 24px;
  display: block;
}

/* === Dropdown Menu === */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 56px;
  right: 0;
  min-width: 210px;
  background: var(--bg, #222);
  color: var(--text, #fff);
  border-radius: 12px;
  box-shadow: 0 8px 32px #000a;
  z-index: 1200;
  padding: 0.5rem 0;
  animation: fadeIn 0.3s;
  transition: opacity 0.3s, transform 0.3s;
  opacity: 0;
  pointer-events: none;
}
.dropdown-menu.open {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.main-panels {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 4vw;
  margin-top: 3.5rem;
  margin-bottom: 3.5rem;
  width: 100vw;
  max-width: 1200px;
  min-height: 60vh;
  padding: 0 3vw;
}

.timer-panel, .ambient-panel {
  flex: 1 1 420px;
  min-width: 340px;
  max-width: 600px;
  border-radius: 32px;
  box-shadow: 0 8px 48px #0005, 0 0 0 2px var(--btn-bg, #1a1a1a) inset;
  padding: 3.5rem 2.5rem 2.5rem 2.5rem;
  margin: 0 0.5vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  transition: box-shadow 0.4s, background 0.4s;
  animation: fadeIn 0.7s cubic-bezier(.68,-0.55,.27,1.55);
}

.timer-panel {
  box-shadow: 0 8px 48px #0007, 0 0 0 2px var(--btn-bg, #1a1a1a) inset;
}

.ambient-panel {
  box-shadow: 0 8px 48px #0005, 0 0 0 2px var(--btn-bg, #232a2e) inset;
  align-items: flex-start;
  /* Reduce vertical size by half */
  max-height: 240px;
  min-height: 120px;
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
  overflow-y: auto;
}

.ambient-panel h2 {
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
  color: var(--btn-text, #39ff14);
  text-align: center;
  width: 100%;
}

/* Align ambient-panel inner content to match notes-panel */
.ambient-panel .ambient-controls {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  padding: 0;
}
.ambient-panel {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5em;
  padding-right: 1.5em;
}

/* Make sure notes-panel and ambient-panel have the same padding and width */
.notes-panel, .ambient-panel {
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5em;
  padding-right: 1.5em;
}

@media (min-width: 1400px) {
  .main-panels {
    max-width: 1600px;
    gap: 6vw;
    min-height: 65vh;
    padding: 0 8vw;
  }
  .timer-panel, .ambient-panel {
    max-width: 700px;
    padding: 4.5rem 3.5rem 3.5rem 3.5rem;
    border-radius: 40px;
  }
}

@media (max-width: 1100px) {
  .main-panels {
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    min-height: unset;
    padding: 0 2vw;
  }
  .timer-panel, .ambient-panel {
    max-width: 98vw;
    min-width: 0;
    width: 100%;
    margin: 0;
    border-radius: 24px;
    padding: 2.5rem 1.2rem 1.5rem 1.2rem;
  }
}

/* === Slider Styles === */
:root {
  --slider-track: var(--btn-bg, #1a1a1a);
  --slider-thumb: var(--btn-text, #fff);
  --slider-fill: var(--btn-hover, #333);
  --slider-focus: var(--btn-text, #ffd);
}

/* Modern slider styling for ambient panel */
.ambient-controls input[type="range"] {
  width: 160px;
  height: 4px;
  background: var(--slider-track);
  border-radius: 4px;
  outline: none;
  box-shadow: 0 1px 6px #0002;
  transition: background 0.2s;
  accent-color: var(--slider-fill);
}
.ambient-controls input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--slider-thumb);
  border: 2.5px solid var(--slider-fill);
  box-shadow: 0 2px 8px #0003;
  transition: border 0.2s, background 0.2s;
}
.ambient-controls input[type="range"]:focus::-webkit-slider-thumb {
  border-color: var(--slider-focus);
  background: var(--slider-focus);
}
.ambient-controls input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--slider-thumb);
  border: 2.5px solid var(--slider-fill);
  box-shadow: 0 2px 8px #0003;
  transition: border 0.2s, background 0.2s;
}
.ambient-controls input[type="range"]:focus::-moz-range-thumb {
  border-color: var(--slider-focus);
  background: var(--slider-focus);
}
.ambient-controls input[type="range"]::-ms-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--slider-thumb);
  border: 2.5px solid var(--slider-fill);
  box-shadow: 0 2px 8px #0003;
  transition: border 0.2s, background 0.2s;
}
.ambient-controls input[type="range"]:focus::-ms-thumb {
  border-color: var(--slider-focus);
  background: var(--slider-focus);
}
.ambient-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: var(--slider-track);
  border-radius: 4px;
}
.ambient-controls input[type="range"]::-ms-fill-lower {
  background: var(--slider-fill);
}
.ambient-controls input[type="range"]::-ms-fill-upper {
  background: var(--slider-track);
}
.ambient-controls input[type="range"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--slider-focus);
}
.ambient-controls input[type="range"]:hover::-webkit-slider-thumb {
  border-color: var(--slider-focus);
}
.ambient-controls input[type="range"]:hover::-moz-range-thumb {
  border-color: var(--slider-focus);
}
.ambient-controls input[type="range"]:hover::-ms-thumb {
  border-color: var(--slider-focus);
}

.ambient-controls {
  display: flex;
  flex-direction: column;
  gap: 1.1em;
  width: 100%;
}
.ambient-controls label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1.2em;
  width: 100%;
  font-size: 1em;
  color: var(--text, #fff);
}
.ambient-controls input[type="range"] {
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 320px;
  margin-left: 1.2em;
  margin-right: 0;
  display: block;
}
.ambient-controls input[type="file"],
.ambient-controls input[type="text"],
.ambient-controls button {
  margin-left: 1.2em;
}

/* === Panel Cards === */
.panel-cards {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin: 2rem 0 2.5rem 0;
  align-items: stretch;
}
.info-card {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  border-radius: 18px;
  box-shadow: 0 4px 24px #0002, 0 0 0 2px var(--btn-bg, #1a1a1a) inset;
  padding: 1.2rem 1.5rem;
  transition: box-shadow 0.3s, transform 0.3s;
  animation: fadeIn 0.7s cubic-bezier(.68,-0.55,.27,1.55);
  will-change: box-shadow, transform;
}
.info-card:hover, .info-card:focus-within {
  box-shadow: 0 8px 32px #0004, 0 0 0 3px var(--btn-hover, #333) inset;
  transform: scale(1.03) translateY(-2px);
}
.card-icon {
  font-size: 2.2rem;
  margin-top: 0.1em;
  filter: drop-shadow(0 2px 6px #0002);
  flex-shrink: 0;
}
.card-content h2 {
  font-size: 1.15rem;
  margin-bottom: 0.2em;
  color: var(--text, #fff);
  font-weight: 600;
}
.card-content p {
  font-size: 1rem;
  color: var(--text, #fff);
}

.back-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.7em 2em;
  border-radius: 10px;
  background: var(--btn-bg, #1a1a1a);
  color: var(--btn-text, #fff);
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 2px 8px #0002;
  transition: background 0.3s, color 0.3s, transform 0.2s, box-shadow 0.3s;
  font-size: 1.1em;
}
.back-btn:hover, .back-btn:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
  transform: scale(1.08);
  box-shadow: 0 4px 16px #0003;
}

/* === Hamburger Dropdown Modern Menu Items === */
.dropdown-menu ul { display: none; } /* Hide old list */
.dropdown-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 1em;
  width: 100%;
  background: none;
  border: none;
  color: var(--text, #fff);
  font-size: 1.08em;
  padding: 0.9em 1.5em;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  outline: none;
  margin: 0.1em 0;
  text-align: left;
  font-weight: 500;
  box-shadow: none;
}
.dropdown-menu .menu-item:hover, .dropdown-menu .menu-item:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
  transform: scale(1.04) translateX(4px);
}
.menu-item .menu-icon {
  font-size: 1.3em;
  width: 1.5em;
  text-align: center;
  flex-shrink: 0;
}
.info-link {
  color: var(--btn-text, #39ff14);
  text-decoration: underline;
  transition: color 0.2s;
}
.info-link:hover, .info-link:focus {
  color: var(--btn-hover, #ffd);
}
.external-link {
  color: var(--btn-text, #39ff14);
  text-decoration: underline;
}

/* Motivational quote styling */
.motivational-quote {
  margin: 1.2em auto 0.8em auto;
  font-size: 1.1em;
  color: var(--text, #fff); /* Use theme text color for dark/light mode */
  background: rgba(60,255,100,0.07);
  border-radius: 10px;
  padding: 0.7em 1.2em;
  text-align: center;
  font-style: italic;
  box-shadow: 0 2px 8px #0001;
}

/* Checklist/task panel */
.task-panel {
  border-radius: 16px;
  box-shadow: 0 2px 12px #0002;
  padding: 1.2em 1.5em;
  margin: 1.2em 0 0.5em 0;
  max-width: 420px;
  width: 100%;
  text-align: left;
}
.task-panel h3 {
  margin-bottom: 0.7em;
  color: var(--btn-text, #39ff14);
  font-size: 1.1em;
}
.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.task-list li {
  display: flex;
  align-items: center;
  gap: 0.7em;
  margin-bottom: 0.5em;
  font-size: 1em;
}
.task-list .task-item {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.2em 0.5em;
  border-radius: 6px;
  transition: background 0.2s;
}
.task-list .task-item input[type="checkbox"] {
  accent-color: var(--btn-bg, #1a1a1a);
  width: 1.2em; height: 1.2em;
}
.task-list .task-item span {
  flex: 1;
  font-size: 1.08em;
  transition: color 0.2s, text-decoration 0.2s;
}
.task-list .task-item button.remove-task-btn {
  background: none;
  border: none;
  color: #ff0055;
  font-size: 1.2em;
  cursor: pointer;
  padding: 0 0.3em;
  border-radius: 4px;
  transition: background 0.2s;
}
.task-list .task-item button.remove-task-btn:hover {
  background: #ff005522;
}
.add-task-row {
  display: flex;
  gap: 0.7em;
  margin-top: 0.7em;
}
.add-task-row input[type="text"] {
  flex: 1;
  border-radius: 8px;
  border: 1px solid var(--btn-bg, #1a1a1a);
  background: var(--bg, #232a2e);
  color: var(--text, #fff);
  font-size: 1em;
  padding: 0.2em 0.7em;
}
.add-task-row button {
  padding: 0.3em 1em;
  border-radius: 8px;
  background: var(--btn-bg, #1a1a1a);
  color: var(--btn-text, #fff);
  border: none;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.add-task-row button:hover, .add-task-row button:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
}

/* Onboarding tour highlight */
.tour-highlight {
  box-shadow: 0 0 0 4px #39ff14cc, 0 0 24px #39ff1440;
  z-index: 2001 !important;
  position: relative;
  animation: fadeIn 0.5s;
}
.tour-btn {
  margin-top: 2em;
  padding: 0.7em 2em;
  border-radius: 10px;
  background: var(--btn-bg, #1a1a1a);
  color: var(--btn-text, #fff);
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 2px 8px #0002;
  transition: background 0.3s, color 0.3s, transform 0.2s, box-shadow 0.3s;
  font-size: 1.1em;
  border: none;
  cursor: pointer;
}
.tour-btn:hover, .tour-btn:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
  transform: scale(1.08);
  box-shadow: 0 4px 16px #0003;
}

/* === Onboarding Overlay Modern Card === */
.onboarding-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 3000;
  background: rgba(0,0,0,0.65);
  color: #fff;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.1em;
  padding: 2em 1em;
  animation: fadeIn 0.5s;
}
.onboarding-overlay[style*="flex"] { display: flex; }
.onboarding-card {
  background: rgba(34, 40, 60, 0.85);
  border-radius: 28px;
  box-shadow: 0 8px 48px #0008, 0 0 0 2px var(--btn-bg, #1a1a1a) inset;
  padding: 2.5em 2em 2em 2em;
  max-width: 420px;
  width: 98vw;
  margin: auto;
  position: relative;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  animation: slideInUp 0.7s cubic-bezier(.68,-0.55,.27,1.55);
  outline: none;
}
@keyframes slideInUp {
  0% { opacity: 0; transform: translateY(40px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.onboarding-header {
  margin-bottom: 1.2em;
}
.onboarding-logo {
  font-size: 2.5em;
  display: block;
  margin-bottom: 0.2em;
}
.onboarding-title {
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 0.2em;
}
.onboarding-subtitle {
  font-size: 1.05em;
  color: var(--btn-text, #39ff14);
  margin-bottom: 0.7em;
  font-style: italic;
}
.onboarding-step {
  font-size: 1.13em;
  margin-bottom: 1.2em;
  min-height: 3.2em;
  color: var(--text, #fff);
}
.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: 0.5em;
  margin-bottom: 1.5em;
}
.onboarding-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--btn-bg, #fff3);
  border: 2px solid var(--btn-hover, #39ff14);
  transition: background 0.3s, border 0.3s;
}
.onboarding-dot.active {
  background: var(--btn-text, #39ff14);
  border-color: var(--btn-text, #39ff14);
}
.onboarding-actions {
  display: flex;
  justify-content: space-between;
  gap: 1em;
}
.tour-btn.secondary {
  background: transparent;
  color: var(--btn-text, #fff);
  border: 2px solid var(--btn-bg, #39ff14);
  font-weight: 500;
}
.tour-btn.secondary:hover, .tour-btn.secondary:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
  border-color: var(--btn-text, #ffd);
}
@media (max-width: 600px) {
  .onboarding-card { padding: 1.2em 0.5em; }
  .onboarding-title { font-size: 1.1em; }
  .onboarding-step { font-size: 1em; }
}

/* === Task Panel - Remove Task Button === */
.remove-task-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--btn-text, #ff4444);
  font-size: 1.2em;
  cursor: pointer;
  padding: 0.2em 0.5em;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  outline: none;
  display: flex;
  align-items: center;
}
.remove-task-btn:hover, .remove-task-btn:focus {
  background: var(--btn-hover, #ffdddd);
  color: #c00;
  transform: scale(1.18) rotate(-8deg);
}

.presets-panel, .stats-panel, .notes-panel, .settings-io-panel, .background-panel, .advanced-panel {
  border-radius: 16px;
  box-shadow: 0 2px 12px #0002;
  padding: 1.2em 1.5em;
  margin: 1.2em 0 0.5em 0;
  max-width: 420px;
  width: 100%;
  text-align: left;
  color: var(--text, #fff);
}
.presets-panel h3, .stats-panel h3, .notes-panel h3, .settings-io-panel h3, .background-panel h3, .advanced-panel h3 {
  margin-bottom: 0.7em;
  color: var(--btn-text, #39ff14);
  font-size: 1.1em;
}
.presets-panel select, .presets-panel input[type="text"] {
  margin-right: 0.5em;
  border-radius: 8px;
  border: 1px solid var(--btn-bg, #1a1a1a);
  background: var(--bg, #232a2e);
  color: var(--text, #fff);
  font-size: 1em;
  padding: 0.2em 0.7em;
}
.presets-panel button, .settings-io-panel button, .background-panel button, .advanced-panel button {
  margin-right: 0.5em;
  margin-top: 0.3em;
  padding: 0.3em 1em;
  border-radius: 8px;
  background: var(--btn-bg, #1a1a1a);
  color: var(--btn-text, #fff);
  border: none;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.presets-panel button:hover, .settings-io-panel button:hover, .background-panel button:hover, .advanced-panel button:hover {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
}
.notes-panel textarea {
  width: 100%;
  min-height: 60px;
  border-radius: 8px;
  border: 1px solid var(--btn-bg, #1a1a1a);
  background: var(--bg, #232a2e);
  color: var(--text, #fff);
  font-size: 1em;
  padding: 0.5em;
  margin-top: 0.5em;
  resize: vertical;
}
#confettiCanvas {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 5000;
  pointer-events: none;
  animation: confettiFadeIn 0.3s;
}
@keyframes confettiFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* Optional: lively pop for confetti particles (used in JS as needed) */
@keyframes confettiPop {
  0% { transform: scale(0.7); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
#onboardingTour.onboarding-overlay {
  display: none;
}
#onboardingTour.onboarding-overlay.flex, #onboardingTour[style*="flex"] {
  display: flex !important;
}

/* === Dashboard Modal Overlay === */
.dashboard-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 5000;
  background: rgba(0,0,0,0.82);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s;
}
.dashboard-modal.open {
  display: flex;
}
.dashboard-content {
  border-radius: 32px;
  box-shadow: 0 8px 48px #000a, 0 0 0 2px #39ff1440 inset;
  padding: 2.5rem 2rem 2rem 2rem;
  max-width: 700px;
  width: 98vw;
  min-width: 320px;
  min-height: 420px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  outline: none;
}
.dashboard-tabs {
  display: flex;
  gap: 0.5em;
  margin-bottom: 1.2em;
  justify-content: center;
  flex-wrap: wrap;
}
.dashboard-tab {
  background: none;
  border: none;
  color: var(--btn-text, #39ff14);
  font-size: 1.1em;
  padding: 0.7em 1.5em;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
  outline: none;
}
.dashboard-tab[aria-selected="true"], .dashboard-tab.active {
  background: var(--btn-bg, #1a1a1a);
  color: var(--btn-text, #ffd);
  box-shadow: 0 2px 12px #39ff1440;
}
.dashboard-tab:hover, .dashboard-tab:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
}
.dashboard-panels {
  flex: 1 1 auto;
  min-height: 260px;
  background: none;
  display: flex;
  flex-direction: column;
}
.dashboard-panel {
  display: block;
  background: none;
  border-radius: 0 0 18px 18px;
  box-shadow: none;
  padding: 0 0.5em;
  min-height: 220px;
}
.dashboard-panel[hidden] {
  display: none;
}
.close-dashboard {
  position: absolute;
  top: 1.2em;
  right: 1.2em;
  background: transparent;
  border: none;
  color: #ff0055;
  font-size: 1.7em;
  cursor: pointer;
  border-radius: 50%;
  padding: 0.2em 0.5em;
  transition: background 0.2s, color 0.2s;
}
.close-dashboard:hover, .close-dashboard:focus {
  background: #ff005522;
  color: #fff;
}
.dashboard-btn-row {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2em;
}
.dashboard-btn {
  background: var(--btn-bg, #1a1a1a);
  color: var(--btn-text, #39ff14);
  border: none;
  border-radius: 12px;
  font-size: 1.1em;
  padding: 0.7em 2em;
  font-weight: bold;
  box-shadow: 0 2px 8px #0002;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, transform 0.2s, box-shadow 0.3s;
}
.dashboard-btn:hover, .dashboard-btn:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
  transform: scale(1.08);
  box-shadow: 0 4px 16px #0003;
}

/* Accordion styles for decluttered UI */
.accordion {
  width: 100%;
  margin-top: 1.5rem;
  border-radius: 18px;
  background: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 0.7em;
}
.accordion-item {
  border-radius: 14px;
  background: rgba(0,0,0,0.13);
  box-shadow: 0 2px 8px #0001;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.accordion-header {
  width: 100%;
  background: var(--btn-bg, #232a2e);
  color: var(--text, #fff);
  border: none;
  outline: none;
  font-size: 1.08em;
  font-weight: 600;
  padding: 0.9em 1.2em;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-bottom: 1px solid #2224;
  display: flex;
  align-items: center;
  gap: 0.7em;
}
.accordion-header[aria-expanded="true"] {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
}
.accordion-panel {
  padding: 1.1em 1.2em 1.2em 1.2em;
  background: rgba(0,0,0,0.08);
  transition: max-height 0.4s, padding 0.3s;
}
.accordion-panel[hidden] {
  display: none;
  padding: 0 1.2em;
}

/* Tabbed panel for ambient/tasks */
.tabbed-panel {
  width: 100%;
  margin-top: 1.2em;
  background: none;
}
.tab-row {
  display: flex;
  gap: 0.5em;
  margin-bottom: 0.7em;
}
.tab {
  flex: 1 1 0;
  background: var(--btn-bg, #232a2e);
  color: var(--text, #fff);
  border: none;
  border-radius: 10px 10px 0 0;
  padding: 0.7em 0.5em;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tab.active, .tab:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
  outline: 2px solid #ffd;
}
.tab-content {
  background: rgba(0,0,0,0.08);
  border-radius: 0 0 12px 12px;
  padding: 1.1em 1.2em 1.2em 1.2em;
  min-height: 120px;
  transition: background 0.2s;
  display: block;
}
.tab-content[hidden] {
  display: none !important;
  padding: 0 1.2em;
}

/* Reduce margin for main panels */
.main-panels {
  margin-top: 2.2rem;
  margin-bottom: 2.2rem;
  gap: 2vw;
}

/* Hide duplicate confetti button in advanced-panel accordion */
.advanced-panel #triggerConfettiBtn {
  display: none;
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.2rem;
  background: var(--bg, #181c20);
  box-shadow: 0 2px 16px #0002;
  z-index: 2000;
  padding: 0.5rem 2.5rem 0.5rem 1.5rem;
  height: 64px;
}
.topbar .easter-btn.left {
  position: static;
  margin-right: auto;
}
.dashboard-icon {
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-layout {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding-top: 80px;
  gap: 0;
}
.clock-section {
  flex: 1 1 480px;
  max-width: 540px;
  margin: 0 auto;
  background: var(--bg, #232a2e);
  border-radius: 32px;
  box-shadow: 0 8px 48px #0005, 0 0 0 2px var(--btn-bg, #1a1a1a) inset;
  padding: 3.5rem 2.5rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.sidepanels {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  margin-left: 2.5rem;
  height: 100%;
}
.side-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
  background: var(--bg, #232a2e);
  border-radius: 18px;
  box-shadow: 0 2px 12px #0002;
  padding: 1.2em 0.5em;
  align-items: center;
  min-width: 56px;
  margin-top: 1.5rem;
}
.side-tab {
  background: none;
  border: none;
  color: var(--btn-text, #fff);
  font-size: 1.5rem;
  border-radius: 10px;
  padding: 0.7em 0.5em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  outline: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.side-tab.active, .side-tab:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
  outline: 2px solid #ffd;
}
.side-content {
  background: var(--bg, #232a2e);
  border-radius: 18px;
  box-shadow: 0 2px 12px #0002;
  margin-left: 1.2rem;
  margin-top: 1.5rem;
  min-width: 320px;
  max-width: 420px;
  min-height: 420px;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
}
.side-panel {
  display: none;
}
.side-panel.active {
  display: block;
  animation: fadeIn 0.4s;
}

/* Modal styles for settings/dashboard */
.modal, .dashboard-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.1em;
  animation: fadeIn 0.5s;
}
.modal[hidden], .dashboard-modal[hidden] { display: none !important; }
.modal:not([hidden]), .dashboard-modal:not([hidden]) { display: flex !important; }
.modal-content, .dashboard-content {
  background: rgba(34, 40, 60, 0.95);
  border-radius: 28px;
  box-shadow: 0 8px 48px #0008, 0 0 0 2px var(--btn-bg, #1a1a1a) inset;
  padding: 2.5em 2rem 2em 2rem;
  max-width: 480px;
  width: 98vw;
  margin: auto;
  position: relative;
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  animation: slideInUp 0.7s cubic-bezier(.68,-0.55,.27,1.55);
  outline: none;
}
.close-modal, .close-dashboard {
  position: absolute;
  top: 1.2em;
  right: 1.2em;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5em;
  cursor: pointer;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.close-modal:hover, .close-dashboard:hover {
  background: #222a;
}

@media (max-width: 900px) {
  .dashboard-layout {
    flex-direction: column;
    align-items: stretch;
    padding-top: 80px;
  }
  .sidepanels {
    flex-direction: row;
    margin-left: 0;
    margin-top: 2rem;
    justify-content: center;
  }
  .side-content {
    margin-left: 0.5rem;
    min-width: 0;
    max-width: 98vw;
    padding: 1.2rem 0.5rem;
  }
}
@media (max-width: 600px) {
  .topbar {
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
    height: 48px;
  }
  .dashboard-layout {
    padding-top: 56px;
  }
  .clock-section {
    padding: 1.2rem 0.5rem 1rem 0.5rem;
    border-radius: 18px;
  }
  .side-tabs {
    min-width: 40px;
    padding: 0.5em 0.2em;
  }
  .side-content {
    min-width: 0;
    max-width: 98vw;
    padding: 0.7rem 0.2rem;
    border-radius: 12px;
  }
}

/* === Main Action Bar/Buttons === */
.main-action-bar {
  display: flex;
  justify-content: center;
  gap: 1.5em;
  margin-top: 80px;
  margin-bottom: 0.5em;
  z-index: 2100;
}
.main-action-btn {
  background: var(--btn-bg, #232a2e);
  color: var(--btn-text, #fff);
  border: none;
  border-radius: 12px;
  font-size: 1.2em;
  font-weight: 600;
  padding: 0.8em 2.2em;
  cursor: pointer;
  box-shadow: 0 2px 8px #0002;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.main-action-btn:hover, .main-action-btn:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
  outline: 2px solid #ffd;
  transform: scale(1.07);
}

.ambient-overlay {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(34, 40, 60, 0.97);
  border-radius: 24px;
  box-shadow: 0 8px 48px #000a, 0 0 0 2px #39ff1440 inset;
  z-index: 4000;
  min-width: 320px;
  max-width: 98vw;
  min-height: 120px;
  padding: 2.2em 2em 1.5em 2em;
  outline: none;
  animation: fadeIn 0.4s;
}
.ambient-overlay[hidden] { display: none !important; }
.ambient-overlay:not([hidden]) { display: flex !important; flex-direction: column; align-items: center; }
.ambient-overlay-content { width: 100%; }
.ambient-overlay h3 { text-align: center; margin-bottom: 1.2em; color: var(--btn-text, #39ff14); }
.ambient-overlay .ambient-controls { margin-bottom: 1.2em; }
.ambient-overlay .close-modal { position: absolute; top: 1.2em; right: 1.2em; }

/* Remove container2-tabs styles if present */
.container2-tabs, .container2-tab { display: none !important; }
.side-content > .container2-tabs {
  display: flex !important;
  gap: 0.5em;
  margin-bottom: 1.2em;
  justify-content: center;
}
/* Hide tab switcher in overlays and dev panel */
.ambient-overlay .container2-tabs,
.dev-secret-panel .container2-tabs {
  display: none !important;
}

/* === Theme Visuals Z-Index Fix === */
#theme-visuals {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 180px;
  z-index: 2999 !important;
  pointer-events: none;
}
#theme-hills {
  position: fixed;
  left: 0; bottom: 0; width: 100vw; height: 180px;
  z-index: 2999 !important;
  pointer-events: none;
}
.dev-secret-panel {
  z-index: 3000 !important;
}

/* === Improved Hills SVG (for realism, in .hills-svg) === */
.hills-svg {
  filter: drop-shadow(0 8px 24px #0004);
}

/* === Misc Polish === */
.ambient-controls label {
  font-size: 1.1em;
  font-weight: 500;
  color: var(--text, #fff);
}

/* Timer Presets Buttons Polished */
.timer-presets {
  display: flex;
  gap: 0.7em;
  justify-content: center;
  margin-bottom: 1em;
}
.preset-btn {
  background: var(--btn-bg, #232a2e);
  color: var(--btn-text, #fff);
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 1.08em;
  font-weight: 600;
  box-shadow: 0 2px 8px #0002;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5em;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.preset-btn:hover, .preset-btn:focus {
  background: var(--btn-hover, #333);
  color: var(--btn-text, #ffd);
  transform: scale(1.08);
  box-shadow: 0 4px 16px #0003;
}
