/* ═══════════════════════════════════════════════════════════
   designs.css — Clock card styles, UI controls, responsive layout
   Time Flipper | Split from index.html
═══════════════════════════════════════════════════════════ */

/* ── CSS VARIABLES ── */
:root {
  --digitYOffset: 0%;
  --seam: 1px;
  --unit-width: 80px;
  --unit-height: 120px;
  --font-size: 72px;
  --gap: 15px;
  --separator-width: 20px;
  --separator-dot: 8px;
  --date-font-size: 18px;
  --date-spacing: 8px;
  --digit-font: "Oswald", sans-serif;
  --digit-weight: 600;

  /* Dark theme (default) */
  --bg-color: #000;
  --bg-color-3d: #1a1a1a;
  --card-bg: #2a2a2a;
  --card-bg-3d-top: linear-gradient(180deg, #3a3a3a 0%, #2d2d2d 100%);
  --card-bg-3d-bottom: linear-gradient(180deg, #2d2d2d 0%, #252525 100%);
  --text-color: #fff;
  --date-color: #666;
  --separator-color: #666;
  --separator-color-3d: #fff;
  --settings-bg: rgba(30, 30, 30, 0.95);
  --settings-border: rgba(255,255,255,0.2);
  --ampm-color: #666;
  --ampm-color-3d: #888;
}

body.light-theme {
  --bg-color: #f5f5f5;
  --bg-color-3d: #e8e8e8;
  --card-bg: #ffffff;
  --card-bg-3d-top: linear-gradient(180deg, #ffffff 0%, #f8f8f8 100%);
  --card-bg-3d-bottom: linear-gradient(180deg, #f8f8f8 0%, #f0f0f0 100%);
  --text-color: #000;
  --date-color: #666;
  --separator-color: #999;
  --separator-color-3d: #333;
  --settings-bg: rgba(255, 255, 255, 0.95);
  --settings-border: rgba(0,0,0,0.2);
  --ampm-color: #999;
  --ampm-color-3d: #666;
}

/* ── RESET ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  overflow: hidden;
  padding: 20px;
  transition: background 0.3s ease;
  position: relative;
}

body.design-3d { background: var(--bg-color-3d); }

/* ── BACKGROUND CANVAS ── */
#background-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.6;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

/* ── CLOCK CONTAINER ── */
.clock-container {
  text-align: center;
  transform: scale(1.3);
  transform-origin: center;
  width: 100%; max-width: 100%;
  position: relative; z-index: 1;
}

.flip-clock {
  display: flex;
  gap: var(--gap);
  margin-bottom: 30px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

/* ── FLIP UNIT ── */
.flip-unit {
  position: relative;
  width: var(--unit-width);
  height: var(--unit-height);
  flex-shrink: 0;
}

.flip-unit::before {
  content: '';
  position: absolute;
  top: -4px; left: -4px; right: -4px; bottom: -4px;
  background: transparent;
  border-radius: 16px;
  z-index: -1;
  box-shadow: none;
  opacity: 0;
  transition: all 0.3s ease;
}

body.design-3d .flip-unit::before {
  background: linear-gradient(135deg, #4a4a4a 0%, #2a2a2a 50%, #1a1a1a 100%);
  box-shadow: 0 8px 16px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
  opacity: 1;
}

body.light-theme.design-3d .flip-unit::before {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 50%, #e8e8e8 100%);
  box-shadow: 0 8px 16px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.8);
}

/* ── FLIP CARD ── */
.flip-card {
  position: relative;
  width: 100%; height: 100%;
  border-radius: 8px;
  overflow: hidden;
  transition: border-radius 0.3s ease;
}

body.design-3d .flip-card { border-radius: 12px; }

.flip-card-top,
.flip-card-bottom {
  position: absolute;
  width: 100%;
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: 0 2px 5px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
}

body.light-theme .flip-card-top,
body.light-theme .flip-card-bottom { box-shadow: 0 2px 5px rgba(0,0,0,0.15); }

body.design-3d .flip-card-top,
body.design-3d .flip-card-bottom { background: var(--card-bg-3d-top); box-shadow: none; }

.flip-card-top {
  top: 0;
  height: calc(50% + 0.5px);
  border-radius: 8px 8px 0 0;
  transition: border-radius 0.3s ease;
}

body.design-3d .flip-card-top { border-radius: 12px 12px 0 0; }

.flip-card-bottom {
  bottom: 0;
  height: calc(50% - 0.5px);
  border-radius: 0 0 8px 8px;
  transition: border-radius 0.3s ease;
}

body.design-3d .flip-card-bottom {
  background: var(--card-bg-3d-bottom);
  border-radius: 0 0 12px 12px;
}

/* ── SEAM LINE ── */
.flip-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: var(--seam);
  transform: translateY(calc(var(--seam) * -0.5));
  background: rgba(0,0,0,0.85);
  z-index: 9;
  pointer-events: none;
  transition: all 0.3s ease;
}

body.light-theme .flip-card::after { background: rgba(0,0,0,0.2); }

body.design-3d .flip-card::after {
  height: 2px;
  background: #1a1a1a;
  box-shadow: 0 1px 2px rgba(0,0,0,0.5), 0 -1px 2px rgba(0,0,0,0.5);
}

body.light-theme.design-3d .flip-card::after {
  background: #e0e0e0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 -1px 2px rgba(0,0,0,0.1);
}

/* ── DIGIT TEXT (pseudo-elements) ── */
.flip-card-top::before,
.flip-card-bottom::before {
  content: attr(data-value);
  position: absolute;
  left: 0; right: 0;
  width: 100%; height: 200%;
  font-size: var(--font-size);
  font-weight: var(--digit-weight);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--digit-font);
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

body.light-theme .flip-card-top::before,
body.light-theme .flip-card-bottom::before { text-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Font-specific vertical centering adjustments */
[style*='--digit-font: "Oswald"'] .flip-card-top::before,
[style*='--digit-font: "Oswald"'] .flip-card-bottom::before,
[style*='--digit-font: "Oswald"'] .flip-card-top-flip::before,
[style*='--digit-font: "Oswald"'] .flip-card-bottom-flip::before { transform: translateY(-3%); }

[style*='--digit-font: "Roboto Mono"'] .flip-card-top::before,
[style*='--digit-font: "Roboto Mono"'] .flip-card-bottom::before,
[style*='--digit-font: "Roboto Mono"'] .flip-card-top-flip::before,
[style*='--digit-font: "Roboto Mono"'] .flip-card-bottom-flip::before { transform: translateY(-2%); }

[style*='--digit-font: "Bebas Neue"'] .flip-card-top::before,
[style*='--digit-font: "Bebas Neue"'] .flip-card-bottom::before,
[style*='--digit-font: "Bebas Neue"'] .flip-card-top-flip::before,
[style*='--digit-font: "Bebas Neue"'] .flip-card-bottom-flip::before { transform: translateY(3%); }

.flip-card-top::before { top: 0; }
.flip-card-bottom::before { bottom: 0; }

/* ── SHINE OVERLAY ── */
.flip-card-top::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.05), transparent);
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
}

body.design-3d .flip-card-top::after {
  background: linear-gradient(to bottom, rgba(255,255,255,0.08), transparent 50%);
  border-radius: 12px 12px 0 0;
}

/* ── FLIP ANIMATION CARDS ── */
.flip-card-top-flip,
.flip-card-bottom-flip {
  position: absolute;
  width: 100%;
  overflow: hidden;
  background: var(--card-bg);
  backface-visibility: hidden;
  opacity: 0;
  z-index: -1;
  transition: background 0.3s ease;
}

body.design-3d .flip-card-top-flip { background: var(--card-bg-3d-top); }
body.design-3d .flip-card-bottom-flip { background: var(--card-bg-3d-bottom); }

.flip-card-top-flip {
  top: 0;
  height: calc(50% + 0.5px);
  border-radius: 8px 8px 0 0;
  transform-origin: bottom;
  transform: rotateX(0deg);
  transition: border-radius 0.3s ease;
}

body.design-3d .flip-card-top-flip { border-radius: 12px 12px 0 0; }

.flip-card-bottom-flip {
  bottom: 0;
  height: calc(50% - 0.5px);
  border-radius: 0 0 8px 8px;
  transform-origin: top;
  transform: rotateX(90deg);
  transition: border-radius 0.3s ease;
}

body.design-3d .flip-card-bottom-flip { border-radius: 0 0 12px 12px; }

.flip-card-top-flip::before,
.flip-card-bottom-flip::before {
  content: attr(data-value);
  position: absolute;
  left: 0; right: 0;
  width: 100%; height: 200%;
  font-size: var(--font-size);
  font-weight: var(--digit-weight);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--digit-font);
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

body.light-theme .flip-card-top-flip::before,
body.light-theme .flip-card-bottom-flip::before { text-shadow: 0 2px 4px rgba(0,0,0,0.1); }

.flip-card-top-flip::before { top: 0; }
.flip-card-bottom-flip::before { bottom: 0; }

.flip-card-top-flip::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.05), transparent);
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
}

body.design-3d .flip-card-top-flip::after {
  background: linear-gradient(to bottom, rgba(255,255,255,0.08), transparent 50%);
  border-radius: 12px 12px 0 0;
}

/* ── FLIP KEYFRAMES ── */
.flipping .flip-card-top-flip {
  animation: flipTop 0.6s ease-in-out;
  z-index: 10; opacity: 1;
}

.flipping .flip-card-bottom-flip {
  animation: flipBottom 0.6s ease-in-out 0.3s;
  z-index: 9; opacity: 1;
}

@keyframes flipTop {
  0%   { transform: rotateX(0deg); }
  100% { transform: rotateX(-90deg); }
}

@keyframes flipBottom {
  0%   { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

/* ── AM/PM INDICATOR ── */
.ampm-indicator {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 10px;
  color: var(--ampm-color);
  font-weight: normal;
  z-index: 20;
  transition: color 0.3s ease;
}

body.design-3d .ampm-indicator { color: var(--ampm-color-3d); }

/* ── DATE DISPLAY ── */
.date-display {
  color: var(--date-color);
  font-size: var(--date-font-size);
  letter-spacing: var(--date-spacing);
  text-transform: uppercase;
  font-weight: 300;
}

/* ── SEPARATOR DOTS ── */
.separator {
  width: var(--separator-width);
  height: var(--unit-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.separator span {
  width: var(--separator-dot);
  height: var(--separator-dot);
  background: var(--separator-color);
  border-radius: 50%;
  transition: all 0.3s ease;
}

body.design-3d .separator span {
  background: var(--separator-color-3d);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

body.light-theme.design-3d .separator span { box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

/* ── SETTINGS BUTTON ── */
.settings-btn {
  position: fixed;
  top: 30px; left: 30px;
  width: 50px; height: 50px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0.3;
}

body.light-theme .settings-btn {
  background: rgba(0,0,0,0.05);
  border: 2px solid rgba(0,0,0,0.1);
}

.settings-btn:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); opacity: 1; }
body.light-theme .settings-btn:hover { background: rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.2); }

.settings-btn svg { width: 24px; height: 24px; fill: #fff; }
body.light-theme .settings-btn svg { fill: #333; }

/* ── SETTINGS PANEL ── */
.settings-panel {
  position: fixed;
  top: 90px; left: 30px;
  background: var(--settings-bg);
  border: 2px solid var(--settings-border);
  border-radius: 10px;
  padding: 15px;
  min-width: 200px; max-width: 220px;
  opacity: 0; visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 999;
  backdrop-filter: blur(10px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.settings-panel.active { opacity: 1; visibility: visible; transform: translateY(0); }

.settings-panel h3 {
  color: var(--text-color);
  font-size: 13px;
  margin-bottom: 10px;
  font-weight: 600;
}

.font-option, .bg-option {
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ccc;
  font-size: 12px;
}

body.light-theme .font-option,
body.light-theme .bg-option {
  background: rgba(0,0,0,0.03);
  border: 2px solid rgba(0,0,0,0.1);
  color: #666;
}

.font-option:hover, .bg-option:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }
body.light-theme .font-option:hover,
body.light-theme .bg-option:hover   { background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.2); }

.font-option.active, .bg-option.active {
  background: rgba(100,100,255,0.2);
  border-color: rgba(100,100,255,0.5);
  color: #fff;
}

body.light-theme .font-option.active,
body.light-theme .bg-option.active {
  background: rgba(100,100,255,0.15);
  border-color: rgba(100,100,255,0.4);
  color: #333;
}

.settings-section {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

body.light-theme .settings-section { border-bottom: 1px solid rgba(0,0,0,0.1); }
.settings-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }

/* ── OPACITY SLIDER ── */
.opacity-slider {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin-bottom: 8px;
}

body.light-theme .opacity-slider { background: rgba(0,0,0,0.1); }

.opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px;
  background: rgba(100,100,255,0.8);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.3);
  transition: all 0.2s ease;
}

.opacity-slider::-webkit-slider-thumb:hover { background: rgba(120,120,255,1); transform: scale(1.1); }
.opacity-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  background: rgba(100,100,255,0.8);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.3);
  transition: all 0.2s ease;
}
.opacity-slider::-moz-range-thumb:hover { background: rgba(120,120,255,1); transform: scale(1.1); }
.opacity-value { color: #999; font-size: 11px; text-align: center; }

/* ── THEME TOGGLE BUTTON ── */
.theme-toggle-btn {
  position: fixed;
  top: 30px; right: 90px;
  width: 50px; height: 26px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0.3;
  color: #fff;
}

body.light-theme .theme-toggle-btn {
  background: rgba(0,0,0,0.05);
  border: 2px solid rgba(0,0,0,0.1);
  color: #333;
}

.theme-toggle-btn:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); opacity: 1; }
body.light-theme .theme-toggle-btn:hover { background: rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.2); }

/* Hide all SVG icons by default, show correct one per theme */
.theme-toggle-btn svg { width: 16px; height: 16px; display: none; }
.theme-toggle-btn .theme-icon-moon { display: block; fill: currentColor; stroke: none; }
body.light-theme .theme-toggle-btn .theme-icon-moon { display: none; }
body.light-theme .theme-toggle-btn .theme-icon-sun {
  display: block; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── DESIGN TOGGLE BUTTON (flat / 3D) ── */
.design-toggle-btn {
  position: fixed;
  top: 30px; right: 30px;
  width: 50px; height: 26px;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 13px;
  cursor: pointer;
  display: flex; align-items: center;
  padding: 3px;
  transition: all 0.3s ease;
  z-index: 1000;
  opacity: 0.3;
}

body.light-theme .design-toggle-btn { background: rgba(0,0,0,0.1); border: 2px solid rgba(0,0,0,0.2); }
.design-toggle-btn:hover { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.5); opacity: 1; }
body.light-theme .design-toggle-btn:hover { background: rgba(0,0,0,0.15); border-color: rgba(0,0,0,0.3); }

.design-toggle-btn::before {
  content: '';
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  position: absolute;
  left: 3px;
}

body.light-theme .design-toggle-btn::before { background: #333; }
body.design-3d .design-toggle-btn::before { transform: translateX(24px); }

.design-toggle-btn::after {
  content: '';
  position: absolute;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  color: transparent;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

body.design-3d .design-toggle-btn::after { content: '3D'; color: #fff; left: 6px; right: auto; }
body.light-theme.design-3d .design-toggle-btn::after { color: #333; }

/* ── FULLSCREEN BUTTON ── */
.fullscreen-btn {
  position: fixed;
  bottom: 30px; right: 30px;
  width: 50px; height: 50px;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease;
  z-index: 1000;
}

body.light-theme .fullscreen-btn { background: rgba(0,0,0,0.05); border: 2px solid rgba(0,0,0,0.1); }
.fullscreen-btn:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); }
body.light-theme .fullscreen-btn:hover { background: rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.2); }
.fullscreen-btn svg { width: 24px; height: 24px; fill: #fff; }
body.light-theme .fullscreen-btn svg { fill: #333; }
.fullscreen-btn.hidden { opacity: 0; pointer-events: none; }

/* ── VERSION LABEL ── */
.version-label {
  position: fixed;
  bottom: 30px; left: 30px;
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
  letter-spacing: 0.5px;
  z-index: 1000;
  transition: all 0.3s ease;
}

body.light-theme .version-label { color: rgba(0,0,0,0.3); }
.version-label:hover { color: rgba(255,255,255,0.6); }
body.light-theme .version-label:hover { color: rgba(0,0,0,0.6); }

/* ── MUSIC BUTTON ── */
#musicToggle {
  position: fixed;
  bottom: 25px; left: 25px;
  width: 50px; height: 50px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.9);
  font-size: 20px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  z-index: 9999;
  transition: all 0.3s ease;
  opacity: 0.3;
}

#musicToggle:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); color: #fff; opacity: 1; }
body.light-theme #musicToggle { background: rgba(0,0,0,0.08); border: 2px solid rgba(0,0,0,0.2); color: rgba(0,0,0,0.75); }
body.light-theme #musicToggle:hover { background: rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.2); color: rgba(0,0,0,0.85); }
.music-btn.hidden { opacity: 0; pointer-events: none; }

/* ── SEO CONTENT (visually hidden, crawlable) ── */
.seo-content {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ══════════════════════════════════════════════
   MOBILE CLOCK LAYOUT  ≤575px

        AM / PM
       [ H ][ H ]
       [ M ][ M ]
   ════════════○  ← seconds arc
    TUE MAR 31
══════════════════════════════════════════════ */

/* Desktop defaults: hide mobile-only elements */
.mobile-ampm        { display: none; }
.mobile-colon       { display: none; }
.clock-row-label-ss { display: none; }
.mobile-seconds-arc { display: none; }
.clock-row-hhmm     { display: contents; }
.digit-pair         { display: contents; }
.clock-row-ss       { display: none; }

/* Mobile ≤575px */
@media (max-width: 575px) {
  body { padding: 20px 16px; align-items: center; }

  :root {
    --unit-width:   76px;
    --unit-height: 112px;
    --font-size:    68px;
    --gap:           6px;
    --separator-width: 0px;
    --separator-dot:   0px;
    --date-font-size: 13px;
    --date-spacing:    5px;
  }

  .clock-container {
    transform: none !important;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .flip-clock {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 0;
    margin-bottom: 0 !important;
  }

  .mobile-ampm {
    display: block !important;
    order: -1;
    font-size: 11px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    color: var(--ampm-color);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 8px;
  }

  .clock-row-hhmm {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .digit-pair {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--gap);
  }

  .clock-row-hhmm > .separator,
  .clock-row-hhmm > #seconds-tens,
  .clock-row-hhmm > #seconds-ones { display: none !important; }

  .mobile-colon    { display: none !important; }
  .ampm-indicator  { display: none !important; }

  .mobile-seconds-arc {
    display: block !important;
    width: 88%;
    max-width: 340px;
    margin-top: 14px;
  }

  .mobile-seconds-arc svg { display: block; margin: 0 auto; overflow: visible; }

  .date-display {
    text-align: center !important;
    margin-top: 10px;
    font-size: var(--date-font-size);
    letter-spacing: var(--date-spacing);
  }

  .settings-btn, .fullscreen-btn { width: 40px; height: 40px; }
  .settings-btn svg, .fullscreen-btn svg { width: 18px; height: 18px; }
  .settings-btn   { top: 14px; left: 14px; }
  .fullscreen-btn { bottom: 16px; right: 16px; }
  .theme-toggle-btn  { top: 14px; right: 66px; width: 44px; height: 24px; }
  .design-toggle-btn { top: 14px; right: 14px; width: 44px; height: 24px; }
  .design-toggle-btn::before { width: 16px; height: 16px; }
  body.design-3d .design-toggle-btn::before { transform: translateX(20px); }
  .settings-panel { top: 64px; left: 14px; padding: 12px; min-width: 175px; max-width: 185px; }
  #musicToggle    { bottom: 16px; left: 16px; width: 40px; height: 40px; font-size: 16px; }
  .version-label  { bottom: 20px; left: 70px; font-size: 9px; }
}

/* Tiny phones ≤374px */
@media (max-width: 374px) {
  :root {
    --unit-width:   62px;
    --unit-height:  92px;
    --font-size:    55px;
  }
  .theme-toggle-btn { right: 68px; }
}

/* ── RESPONSIVE DESKTOP SCALING ── */
@media (min-width: 1400px) { .clock-container { transform: scale(1.3); } }
@media (max-width: 1399px) and (min-width: 1200px) { .clock-container { transform: scale(1.2); } }
@media (max-width: 1199px) and (min-width: 992px)  { .clock-container { transform: scale(1.1); } }

@media (max-width: 991px) and (min-width: 768px) {
  .clock-container { transform: scale(0.95); }
  :root { --unit-width: 75px; --unit-height: 110px; --font-size: 68px; --gap: 12px; --date-font-size: 16px; --date-spacing: 6px; }
}

@media (max-width: 767px) and (min-width: 576px) {
  .clock-container { transform: scale(1.1); }
  :root { --unit-width: 70px; --unit-height: 105px; --font-size: 64px; --gap: 12px; --separator-width: 18px; --separator-dot: 7px; --date-font-size: 16px; --date-spacing: 6px; }
  .theme-toggle-btn { right: 90px; }
}

@media (max-width: 575px) and (min-width: 480px) { .theme-toggle-btn { right: 90px; } }

@media (max-height: 500px) and (orientation: landscape) {
  body { padding: 10px; }
  .clock-container { transform: scale(0.65); }
  .flip-clock { margin-bottom: 15px; }
}

/* ══════════════════════════════════════════════
   COLLAPSIBLE SETTINGS SECTIONS
══════════════════════════════════════════════ */

.settings-section.collapsible {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

body.light-theme .settings-section.collapsible {
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

/* Toggle button — acts as the section header */
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 0;
  color: var(--text-color);
  font-size: 13px;
  font-weight: 600;
  font-family: Arial, sans-serif;
  text-align: left;
  gap: 6px;
  transition: opacity 0.2s ease;
}

.section-toggle:hover { opacity: 0.8; }

/* Chevron icon */
.section-toggle .chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: var(--text-color);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}

/* Rotate chevron when open */
.section-toggle.open .chevron {
  transform: rotate(180deg);
}

/* Collapsible body */
.section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding-bottom: 0;
}

.section-body.open {
  max-height: 600px;   /* large enough for any content */
  padding-bottom: 10px;
}

/* ══════════════════════════════════════════════
   SHARE BUTTON
══════════════════════════════════════════════ */
.share-btn {
  position: fixed;
  top: 90px;
  left: 30px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 34px;
  background: rgba(100, 100, 255, 0.18);
  border: 2px solid rgba(100, 100, 255, 0.4);
  border-radius: 8px;
  cursor: pointer;
  color: rgba(200, 200, 255, 0.9);
  font-size: 11px;
  font-weight: 600;
  font-family: Arial, sans-serif;
  letter-spacing: 0.4px;
  transition: all 0.25s ease;
  z-index: 998;
  opacity: 0.5;
  white-space: nowrap;
}

body.light-theme .share-btn {
  background: rgba(100, 100, 255, 0.12);
  border-color: rgba(100, 100, 255, 0.3);
  color: rgba(80, 80, 200, 0.9);
}

.share-btn:hover {
  opacity: 1;
  background: rgba(100, 100, 255, 0.3);
  border-color: rgba(140, 140, 255, 0.7);
  color: #fff;
}

body.light-theme .share-btn:hover {
  color: rgba(60, 60, 180, 1);
}

.share-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
}

.share-label  { transition: opacity 0.2s ease; }
.share-copied {
  font-size: 10px;
  color: rgba(120, 255, 180, 0.95);
  opacity: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -18px;
  white-space: nowrap;
}
.share-copied.show { opacity: 1; }

/* Push down when settings panel is open on mobile */
@media (max-width: 575px) {
  .share-btn {
    top: 64px;
    left: 14px;
    height: 28px;
    padding: 0 9px;
    font-size: 10px;
  }
}
