/* ==========================================================================
   Zen & StandBy Clock — UI Stylesheet
   Inspired by GitHub Open Source Clocks:
   - kelaocai/retro-flip-clock & lutfialdrii/zen-clock-web (3D Split-Flap Mechanics)
   - pnxl/standby-clock & rakeshkanna-rk/Standby-Clock (Apple StandBy Solar & Night Mode)
   - grovixlab/kyoto (OBS Transparent Overlay & Glassmorphic Controls)
   ========================================================================== */

:root {
  /* Theme Variables: Default Obsidian (Fliqlo Classic) */
  --bg-primary: #090a0d;
  --bg-secondary: #12141c;
  --card-bg-top: #1d2028;
  --card-bg-bottom: #171920;
  --card-border: rgba(255, 255, 255, 0.07);
  --card-text: #f0f2f7;
  --accent-color: #ff9f0a;
  --accent-glow: rgba(255, 159, 10, 0.35);
  --orb-1: rgba(255, 149, 0, 0.14);
  --orb-2: rgba(88, 86, 214, 0.14);
  --orb-3: rgba(52, 199, 89, 0.08);
  --glass-bg: rgba(22, 24, 32, 0.68);
  --glass-border: rgba(255, 255, 255, 0.11);
  --text-muted: rgba(240, 242, 247, 0.52);
  --standby-gradient: linear-gradient(180deg, #ffffff 0%, #c8d0e0 100%);
  --standby-shadow: 0 12px 45px rgba(0, 0, 0, 0.55);
}

/* Theme 2: Solari Cifra 3 Retro Gold & Cream */
body.theme-solari {
  --bg-primary: #1a1612;
  --bg-secondary: #2a241d;
  --card-bg-top: #332c24;
  --card-bg-bottom: #28221c;
  --card-border: rgba(201, 169, 97, 0.22);
  --card-text: #f5ead6;
  --accent-color: #c9a961;
  --accent-glow: rgba(201, 169, 97, 0.4);
  --orb-1: rgba(201, 169, 97, 0.22);
  --orb-2: rgba(139, 111, 71, 0.2);
  --orb-3: rgba(245, 234, 214, 0.08);
  --standby-gradient: linear-gradient(180deg, #f5ead6 0%, #c9a961 100%);
}

/* Theme 3: Apple StandBy OLED Night Red */
body.theme-nightred {
  --bg-primary: #000000;
  --bg-secondary: #080101;
  --card-bg-top: #140303;
  --card-bg-bottom: #0d0202;
  --card-border: rgba(255, 45, 32, 0.25);
  --card-text: #ff2d20;
  --accent-color: #ff2d20;
  --accent-glow: rgba(255, 45, 32, 0.5);
  --orb-1: rgba(255, 30, 20, 0.18);
  --orb-2: rgba(160, 10, 10, 0.12);
  --orb-3: rgba(90, 0, 0, 0.1);
  --text-muted: rgba(255, 69, 58, 0.58);
  --standby-gradient: linear-gradient(180deg, #ff453a 0%, #b8140d 100%);
  --standby-shadow: 0 0 50px rgba(255, 45, 32, 0.35);
}

/* Theme 4: Solar Aurora */
body.theme-aurora {
  --bg-primary: #060d1a;
  --bg-secondary: #0c192e;
  --card-bg-top: #132238;
  --card-bg-bottom: #0e1a2d;
  --card-border: rgba(56, 189, 248, 0.22);
  --card-text: #e0f2fe;
  --accent-color: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.45);
  --orb-1: rgba(56, 189, 248, 0.28);
  --orb-2: rgba(168, 85, 247, 0.25);
  --orb-3: rgba(16, 185, 129, 0.18);
  --standby-gradient: linear-gradient(135deg, #ffffff 0%, #7dd3fc 50%, #c084fc 100%);
}

/* Theme 5: Kyoto Cyber Neon */
body.theme-cyber {
  --bg-primary: #06060b;
  --bg-secondary: #0d0d18;
  --card-bg-top: #131424;
  --card-bg-bottom: #0d0e1a;
  --card-border: rgba(0, 255, 204, 0.32);
  --card-text: #00ffcc;
  --accent-color: #00ffcc;
  --accent-glow: rgba(0, 255, 204, 0.55);
  --orb-1: rgba(0, 255, 204, 0.22);
  --orb-2: rgba(255, 0, 128, 0.2);
  --orb-3: rgba(112, 0, 255, 0.2);
  --standby-gradient: linear-gradient(180deg, #00ffcc 0%, #00b4d8 100%);
  --standby-shadow: 0 0 38px rgba(0, 255, 204, 0.45);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--card-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  user-select: none;
  transition: background-color 0.6s ease, color 0.4s ease;
}

/* OBS Transparent Mode */
body.obs-transparent {
  background: transparent !important;
}
body.obs-transparent .ambient-bg,
body.obs-transparent .top-bar,
body.obs-transparent .bottom-dock,
body.obs-transparent .toast-tip,
body.obs-transparent .floating-modal {
  display: none !important;
}

/* Auto-hide Idle UI Mode */
body.ui-idle {
  cursor: none;
}
body.ui-idle .top-bar {
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
}
body.ui-idle .bottom-dock {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
body.ui-idle .toast-tip {
  opacity: 0;
}

/* ==========================================================================
   Ambient Background & Solar Orbs & Starfield
   ========================================================================== */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 35%, var(--bg-secondary) 0%, var(--bg-primary) 75%);
  transition: background 1.2s ease;
}

.solar-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.85;
  transition: background 1.5s ease, transform 10s ease-in-out;
  will-change: transform;
}

.orb-1 {
  width: 55vw;
  height: 55vw;
  max-width: 720px;
  max-height: 720px;
  top: -15%;
  left: -10%;
  background: var(--orb-1);
  animation: floatOrb1 22s ease-in-out infinite alternate;
}

.orb-2 {
  width: 50vw;
  height: 50vw;
  max-width: 680px;
  max-height: 680px;
  bottom: -18%;
  right: -8%;
  background: var(--orb-2);
  animation: floatOrb2 26s ease-in-out infinite alternate;
}

.orb-3 {
  width: 40vw;
  height: 40vw;
  max-width: 520px;
  max-height: 520px;
  top: 30%;
  left: 35%;
  background: var(--orb-3);
  animation: floatOrb1 18s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6%, 8%) scale(1.12); }
}

@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-7%, -6%) scale(1.15); }
}

.starfield-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0.75;
}

.noise-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.025;
  background-image: radial-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 0);
  background-size: 24px 24px;
}

/* ==========================================================================
   Top Status Bar (Weather, Lunar Date, Timezone, WakeLock)
   ========================================================================== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  gap: 12px;
  flex-wrap: wrap;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  color: var(--card-text);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: all 0.25s ease;
}

.status-pill:hover {
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.weather-pill {
  cursor: pointer;
}

.weather-icon {
  display: inline-flex;
  align-items: center;
  color: var(--accent-color);
}

.weather-temp {
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--card-text);
}

.weather-city {
  color: var(--text-muted);
}

.weather-desc {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-color);
}

.weather-desc:empty {
  display: none;
}

.pill-divider {
  opacity: 0.25;
  margin: 0 2px;
}

.lunar-text {
  color: var(--accent-color);
  font-weight: 600;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tz-select {
  background: transparent;
  border: none;
  color: var(--card-text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.tz-select option {
  background: #161820;
  color: #f0f2f7;
}

.badge-btn {
  cursor: pointer;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
  transition: all 0.3s ease;
}

.badge-btn.active .status-dot {
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

/* ==========================================================================
   Main Clock Stage & OLED Pixel-Shift Container
   ========================================================================== */
.clock-stage {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
}

.pixel-shift-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  transition: transform 3s ease-in-out;
}

.clock-face {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  animation: faceFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.clock-face.active {
  display: flex;
}

@keyframes faceFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ==========================================================================
   FACE 1: 3D Retro Mechanical Flip Clock (Solari Cifra 3 / Fliqlo)
   ========================================================================== */
.flip-clock-board {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.2vw, 32px);
}

.flip-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.unit-caption {
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.flip-unit-container {
  position: relative;
  width: clamp(105px, 23vw, 270px);
  height: clamp(135px, 30vw, 340px);
  perspective: 1400px;
  border-radius: clamp(14px, 2.2vw, 28px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.72),
    0 6px 18px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.theme-cyber .flip-unit-container {
  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.8),
    0 0 32px rgba(0, 255, 204, 0.18);
}

body.theme-nightred .flip-unit-container {
  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.9),
    0 0 35px rgba(255, 45, 32, 0.16);
}

/* Mechanical Side Hinges */
.flip-hinge-left,
.flip-hinge-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(4px, 0.6vw, 8px);
  height: clamp(18px, 3vw, 34px);
  background: linear-gradient(180deg, #444 0%, #1a1a1a 50%, #444 100%);
  border-radius: 3px;
  z-index: 25;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.flip-hinge-left {
  left: -3px;
}

.flip-hinge-right {
  right: -3px;
}

.ampm-badge {
  position: absolute;
  top: clamp(12px, 1.8vw, 22px);
  left: clamp(14px, 2vw, 24px);
  z-index: 22;
  font-size: clamp(11px, 1.4vw, 17px);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-color);
  font-family: 'JetBrains Mono', monospace;
  opacity: 0.9;
}

.ampm-badge.hidden {
  display: none;
}

.flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  font-size: clamp(72px, 17.5vw, 215px);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  transform-style: preserve-3d;
}

.flip-card-half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  color: var(--card-text);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--card-border);
}

.flip-card-top {
  top: 0;
  align-items: flex-end;
  background: linear-gradient(180deg, var(--card-bg-top) 0%, var(--card-bg-bottom) 100%);
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: none;
  transform-origin: 50% 100%;
}

.flip-card-top span {
  display: block;
  transform: translateY(50%);
}

.flip-card-bottom {
  bottom: 0;
  align-items: flex-start;
  background: linear-gradient(180deg, var(--card-bg-bottom) 0%, var(--card-bg-top) 100%);
  border-radius: inherit;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  transform-origin: 50% 0%;
}

.flip-card-bottom span {
  display: block;
  transform: translateY(-50%);
}

.flip-card-top-static,
.flip-card-bottom-static {
  z-index: 1;
}

.flip-anim-layer {
  display: none;
  z-index: 3;
  will-change: transform;
}

.flip-unit-container.is-flipping .flip-anim-layer[data-role="top-anim"] {
  display: flex;
  animation: flipTurnTop 0.34s cubic-bezier(0.37, 0, 0.63, 1) forwards;
}

.flip-unit-container.is-flipping .flip-anim-layer[data-role="bottom-anim"] {
  display: flex;
  transform: rotateX(90deg);
  animation: flipTurnBottom 0.36s cubic-bezier(0.22, 1, 0.36, 1) 0.33s forwards;
}

@keyframes flipTurnTop {
  0% {
    transform: rotateX(0deg);
    filter: brightness(1);
  }
  100% {
    transform: rotateX(-90deg);
    filter: brightness(0.45);
  }
}

@keyframes flipTurnBottom {
  0% {
    transform: rotateX(90deg);
    filter: brightness(1.25);
  }
  75% {
    transform: rotateX(-4deg);
  }
  100% {
    transform: rotateX(0deg);
    filter: brightness(1);
  }
}

/* Split-Flap Center Divider Crease */
.flip-split-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  transform: translateY(-50%);
  background: #060709;
  z-index: 15;
  box-shadow:
    0 1px 2px rgba(255, 255, 255, 0.06),
    0 -1px 2px rgba(0, 0, 0, 0.85);
}

/* Animated Colon Divider */
.flip-colon {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3.2vw, 36px);
  padding-bottom: 26px;
}

.colon-dot {
  width: clamp(8px, 1.3vw, 16px);
  height: clamp(8px, 1.3vw, 16px);
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 16px var(--accent-glow);
  animation: colonPulse 2s ease-in-out infinite;
}

@keyframes colonPulse {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.28; transform: scale(0.88); }
}

/* ==========================================================================
   FACE 2: Apple StandBy Solar & Ambient Light Clock
   ========================================================================== */
.standby-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.2vw, 24px);
  width: 100%;
  max-width: 1200px;
}

.standby-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.standby-date-badge,
.standby-weather-badge {
  font-size: clamp(15px, 2.2vw, 26px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--card-text);
  opacity: 0.88;
  display: flex;
  align-items: center;
  gap: 10px;
}

.standby-weather-badge {
  color: var(--accent-color);
  padding-left: 16px;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
}

.standby-digits-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 900;
  font-size: clamp(92px, 24vw, 310px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  filter: drop-shadow(var(--standby-shadow));
}

.standby-digit {
  display: inline-block;
  background: var(--standby-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.standby-digit.pop {
  animation: digitPop 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes digitPop {
  0% { transform: translateY(10px) scale(0.94); opacity: 0.65; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.standby-colon {
  margin: 0 0.04em;
  color: var(--accent-color);
  animation: colonPulse 2s ease-in-out infinite;
}

.standby-side-meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-left: clamp(10px, 1.8vw, 24px);
  gap: 8px;
}

.standby-ampm {
  font-size: clamp(18px, 3vw, 38px);
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.standby-sec {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(24px, 4.5vw, 62px);
  font-weight: 800;
  color: var(--accent-color);
  letter-spacing: -0.03em;
}

/* StandBy World Clock Strip */
.standby-world-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.8vw, 22px);
  flex-wrap: wrap;
  margin-top: 8px;
}

.world-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.25s ease;
}

.world-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.wc-city {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.wc-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--card-text);
}

/* ==========================================================================
   Bottom Floating Control Dock
   ========================================================================== */
.bottom-dock {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.dock-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  flex-wrap: wrap;
  justify-content: center;
}

.dock-segment {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.28);
  padding: 4px;
  border-radius: 999px;
  gap: 4px;
}

.segment-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.22s ease;
}

.segment-btn:hover {
  color: var(--card-text);
}

.segment-btn.active {
  background: var(--accent-color);
  color: #090a0d;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.dock-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
}

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

.theme-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dot-color);
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.theme-dot:hover {
  transform: scale(1.15);
}

.theme-dot.active {
  border-color: #ffffff;
  transform: scale(1.18);
  box-shadow: 0 0 12px var(--dot-color);
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: var(--card-text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.dock-btn.active {
  background: rgba(255, 159, 10, 0.16);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* ==========================================================================
   Floating Modals (White Noise Studio & OBS Overlay Config)
   ========================================================================== */
.floating-modal {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(92vw, 440px);
  border-radius: 22px;
  background: rgba(18, 20, 28, 0.92);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  padding: 20px;
  color: #f0f2f7;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.floating-modal.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-color);
}

.modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sound-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sound-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sound-name {
  font-size: 13.5px;
  font-weight: 600;
}

.sound-sub {
  font-size: 11.5px;
  color: rgba(240, 242, 247, 0.55);
}

.sound-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.09);
  margin: 2px 0;
}

.section-hint {
  font-size: 12px;
  color: rgba(240, 242, 247, 0.65);
}

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

.noise-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f0f2f7;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.noise-card:hover {
  background: rgba(255, 255, 255, 0.08);
}

.noise-card.playing {
  background: rgba(255, 159, 10, 0.16);
  border-color: var(--accent-color);
}

.noise-emoji {
  font-size: 20px;
}

.noise-title {
  font-size: 13px;
  font-weight: 600;
}

.noise-state {
  font-size: 11px;
  color: rgba(240, 242, 247, 0.5);
}

.noise-card.playing .noise-state {
  color: var(--accent-color);
  font-weight: 600;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  padding-top: 4px;
}

.volume-control input[type="range"] {
  flex: 1;
  accent-color: var(--accent-color);
  cursor: pointer;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.16);
  transition: 0.25s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--accent-color);
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

/* OBS URL Generator Box */
.obs-url-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.url-copy-row {
  display: flex;
  gap: 8px;
}

.url-copy-row input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px 12px;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  outline: none;
}

.copy-btn {
  background: var(--accent-color);
  color: #090a0d;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.copy-btn:hover {
  opacity: 0.9;
}

.obs-tip {
  font-size: 11px;
  color: rgba(240, 242, 247, 0.5);
  line-height: 1.45;
}

/* Bottom Toast Tip */
.toast-tip {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.42);
  pointer-events: none;
  transition: opacity 0.5s ease;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .top-bar {
    padding: 14px 16px;
    justify-content: center;
  }
  .date-pill {
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .flip-clock-board {
    gap: 8px;
  }
  .flip-unit-container {
    width: 27vw;
    height: 36vw;
  }
  .flip-card {
    font-size: 20vw;
  }
  .dock-inner {
    border-radius: 22px;
    padding: 10px;
  }
  .dock-divider {
    display: none;
  }
}
