/* === MyD LongTime - Main Stylesheet === */

:root {
  --theme-bg: #0a0a0f;
  --theme-accent: #d4af37;
  --theme-text: #f0d17f;
  --theme-panel: #14141f;
  --theme-surface: rgba(20,20,35,0.95);
  --theme-border: rgba(212,175,55,0.2);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.3s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--theme-bg);
  font-family: var(--font-body);
  color: var(--theme-text);
  -webkit-font-smoothing: antialiased;
}

/* === Logo === */
#app-logo {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 40;
  pointer-events: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#app-logo::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 400px;
  height: 400px;
  transform: translate(-50%, -50%);
  background-image: url("../logo-backw.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.06;
  border-radius: 50%;
  animation: logoSpin 30s linear infinite;
}

#app-logo .logo-main,
#app-logo .logo-sub,
#app-logo .logo-ornament {
  opacity: 0;
  transform-origin: center;
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.9,.3,1);
}

#app-logo.text-visible .logo-main,
#app-logo.text-visible .logo-sub,
#app-logo.text-visible .logo-ornament {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#app-logo .logo-ornament {
  font-size: 28px;
  color: #d4af37;
  text-shadow: 0 0 12px rgba(212,175,55,0.5), 0 2px 4px rgba(0,0,0,0.8);
  transform: translateY(-8px) scale(0.9);
  line-height: 1;
}

#app-logo .logo-main {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #f0d17f;
  background: linear-gradient(180deg, #ffd77a, #d4af37 50%, #b8962e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 0 rgba(0,0,0,0.7), 0 8px 32px rgba(212,175,55,0.3);
  transform: translateY(-12px) scale(0.96);
  line-height: 1.1;
  text-transform: uppercase;
}

#app-logo .logo-sub {
  margin-top: 4px;
  font-family: "Brush Script MT", "Lucida Handwriting", cursive;
  font-size: 22px;
  font-weight: 400;
  color: rgba(245,226,184,0.9);
  text-shadow: 0 1px 0 rgba(0,0,0,0.6), 0 0 16px rgba(245,226,184,0.2);
  transform: translateY(-4px) scale(0.98);
  letter-spacing: 0.04em;
}

#app-logo.text-visible {
  animation: logoPulse 1400ms cubic-bezier(.2,.9,.3,1) forwards;
  will-change: opacity, transform;
}

#app-logo.fade-out {
  transition: opacity 1.2s ease, transform 0.8s ease;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.08);
}

@keyframes logoPulse {
  0% { transform: translate(-50%, -50%) scale(0.92); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.04); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes logoSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === Clock Container === */
#clock-container {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 1080px;
  height: 1920px;
  transform: translate(-50%, -50%) scale(var(--face-scale, 1));
  transform-origin: center center;
  opacity: 0;
  transition: opacity 1s ease, transform 0.18s ease-out;
}

#clock-container.show-clock { opacity: 1; }

#face-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
}

#clock-face {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

#clock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 1080px;
  height: 1920px;
  border: none;
}

/* === Title Overlay === */
#clock-title {
  position: fixed;
  top: 75px;
  left: 0;
  width: 33.33%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 25;
  pointer-events: none;
}

#clock-title.hidden { display: none; }

/* === Date Overlay === */
#date-overlay {
  position: fixed;
  top: 15px;
  right: 0;
  width: 33.33%;
  display: flex;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: #f5e2b8;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
               0 0 12px rgba(0,0,0,0.8);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

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

.title-year, .title-main, .title-index, .title-desc {
  opacity: 0;
  transition: opacity 0.4s ease;
}
.title-year.show, .title-main.show, .title-index.show, .title-desc.show {
  opacity: 1;
}

.title-year {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  text-transform: uppercase;
  color: #f0d98a;
  letter-spacing: 0.28em;
  text-shadow: -4px -4px 0 #000, 4px -4px 0 #000, -4px 4px 0 #000, 4px 4px 0 #000,
               -4px 0 0 #000, 4px 0 0 #000, 0 -4px 0 #000, 0 4px 0 #000,
               -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
               0 0 20px rgba(0,0,0,0.8), 0 0 40px rgba(240,217,138,0.3);
  margin: 0 0 4px 0;
}

.title-main {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  color: #d4af37;
  letter-spacing: 0.22em;
  text-shadow: -4px -4px 0 #000, 4px -4px 0 #000, -4px 4px 0 #000, 4px 4px 0 #000,
               -4px 0 0 #000, 4px 0 0 #000, 0 -4px 0 #000, 0 4px 0 #000,
               -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
               0 0 20px rgba(0,0,0,0.8), 0 0 40px rgba(212,175,55,0.3);
  margin: 0 0 6px 0;
  animation: titleGlow 3s ease-in-out infinite alternate;
  will-change: text-shadow;
}

.title-index {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  font-style: italic;
  text-transform: uppercase;
  color: #f5e2b8;
  text-shadow: -4px -4px 0 #000, 4px -4px 0 #000, -4px 4px 0 #000, 4px 4px 0 #000,
               -4px 0 0 #000, 4px 0 0 #000, 0 -4px 0 #000, 0 4px 0 #000,
               0 0 20px rgba(0,0,0,0.8), 0 0 40px rgba(212,175,55,0.4);
  letter-spacing: 0.08em;
  margin: 2px 0 0 0;
}

.title-index::before, .title-index::after {
  content: "\2014";
  margin: 0 8px;
  color: #d4af37;
  font-size: 0.7em;
  vertical-align: middle;
  opacity: 0.8;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
}

.title-desc {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.35;
  color: rgba(212,175,55,0.85);
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000,
               0 0 12px rgba(0,0,0,0.8);
  text-align: center;
  max-width: 65%;
  margin: 8px auto 0;
  letter-spacing: 0.01em;
}

@keyframes titleGlow {
  from { text-shadow: -4px -4px 0 #000,4px -4px 0 #000,-4px 4px 0 #000,4px 4px 0 #000,-4px 0 0 #000,4px 0 0 #000,0 -4px 0 #000,0 4px 0 #000,-2px -2px 0 #000,2px -2px 0 #000,-2px 2px 0 #000,2px 2px 0 #000,0 0 20px rgba(0,0,0,0.8),0 0 40px rgba(212,175,55,0.3); }
  to   { text-shadow: -4px -4px 0 #000,4px -4px 0 #000,-4px 4px 0 #000,4px 4px 0 #000,-4px 0 0 #000,4px 0 0 #000,0 -4px 0 #000,0 4px 0 #000,-2px -2px 0 #000,2px -2px 0 #000,-2px 2px 0 #000,2px 2px 0 #000,0 0 20px rgba(0,0,0,0.8),0 0 60px rgba(212,175,55,0.6); }
}

/* === Controls === */
.quick-btn:active, #settings-toggle:active {
  transform: scale(0.94);
  filter: brightness(0.9);
}

#quick-controls {
  position: fixed;
  bottom: 75px;
  left: 40px;
  display: flex;
  gap: 50px;
  z-index: 20;
}

#settings-toggle {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15), rgba(30,30,30,0.95), rgba(0,0,0,1));
  color: #fdf5e6;
  font-size: 78px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.85);
  transition: transform var(--transition-fast), box-shadow var(--transition-smooth), filter var(--transition-smooth), opacity 1s ease;
}

.quick-btn {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15), rgba(30,30,30,0.95), rgba(0,0,0,1));
  color: #fefefe;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 7px rgba(0,0,0,0.85);
  transition: transform var(--transition-fast), box-shadow var(--transition-smooth), filter var(--transition-smooth), opacity 1s ease 0.25s;
}

/* === Settings Panel === */
#settings-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
}

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

#settings-panel {
  width: calc(100% - 40px);
  max-width: 360px;
  background: var(--theme-surface);
  color: var(--theme-text);
  border-radius: 16px;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.9), inset 0 1px 0 var(--theme-border);
  border: 1px solid var(--theme-border);
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

#settings-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--theme-border);
  cursor: grab;
  color: var(--theme-accent);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  user-select: none;
}

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

#settings-close {
  border: none;
  background: none;
  color: var(--theme-accent);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: background var(--transition-fast);
}

#settings-close:hover { background: rgba(255,255,255,0.1); }

.settings-logo-icon {
  width: 28px;
  height: 28px;
  background-image: url("../logo-backw.png");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.15;
}

/* === Tabs === */
.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--theme-border);
  flex-shrink: 0;
}

.settings-tab {
  flex: 1;
  padding: 10px 6px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
  font-family: var(--font-body);
}

.settings-tab:hover { color: var(--theme-text); }
.settings-tab.active {
  color: var(--theme-accent);
  border-bottom-color: var(--theme-accent);
}

/* === Settings Body === */
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.settings-body::-webkit-scrollbar { width: 4px; }
.settings-body::-webkit-scrollbar-thumb { background: var(--theme-border); border-radius: 2px; }

.settings-tab-panel { animation: fadeIn 0.2s ease; }
.settings-tab-panel.hidden { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.setting-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--theme-border);
}

.setting-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.section-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--theme-accent);
  margin-bottom: 12px;
  font-weight: 700;
}

/* === Face Tab === */
.face-preview {
  width: 100%;
  height: 140px;
  border-radius: 10px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #000;
  border: 1px solid var(--theme-border);
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.face-preview-prev {
  position: absolute;
  left: 0;
  top: 50%;
  width: 50%;
  height: 70px;
  transform: translateY(-50%) translateX(-30px) rotate(-15deg);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 6px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.face-preview-prev.show {
  opacity: 0.5;
  transform: translateY(-50%) translateX(0) rotate(0deg);
}

.face-preview-next {
  position: absolute;
  right: 0;
  top: 50%;
  width: 50%;
  height: 70px;
  transform: translateY(-50%) translateX(30px) rotate(15deg);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 6px;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.face-preview-next.show {
  opacity: 0.5;
  transform: translateY(-50%) translateX(0) rotate(0deg);
}

.face-info { text-align: center; margin-bottom: 12px; }
.face-name { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--theme-accent); }

.face-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.face-nav button { flex: 1; }

.face-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--theme-text);
  opacity: 0.7;
  margin: 12px 0 0 0;
  font-family: Georgia, serif;
  font-style: italic;
}

/* === Form Elements === */
.control-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  min-height: 36px;
  gap: 8px;
}

.control-row:last-child { margin-bottom: 0; }

.label {
  font-size: 13px;
  color: var(--theme-text);
  opacity: 0.8;
  width: 70px;
  flex-shrink: 0;
}

.value {
  flex: 1;
  text-align: right;
  font-size: 13px;
  color: var(--theme-accent);
  font-weight: 600;
  padding-right: 8px;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.slider-row {
  margin-bottom: 10px;
}

.mini-label {
  font-size: 11px;
  color: var(--theme-text);
  opacity: 0.6;
  margin-bottom: 4px;
  display: block;
}

/* === Buttons === */
.btn-secondary {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--theme-border);
  background: rgba(255,255,255,0.05);
  color: var(--theme-text);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  font-family: var(--font-body);
}

.btn-secondary:hover {
  background: rgba(212,175,55,0.1);
  border-color: var(--theme-accent);
}

.btn-primary {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--theme-accent);
  background: rgba(212,175,55,0.15);
  color: var(--theme-accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}

.btn-primary:hover { background: rgba(212,175,55,0.25); }

.btn-danger {
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid rgba(200,60,60,0.3);
  background: rgba(200,60,60,0.1);
  color: #c06060;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-body);
}

.btn-danger:hover { background: rgba(200,60,60,0.2); }

/* === Form Select === */
.form-select {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--theme-border);
  background: rgba(0,0,0,0.4);
  color: var(--theme-text);
  font-size: 12px;
  font-family: var(--font-body);
  cursor: pointer;
}

.form-select option { background: #1a1a2e; color: #e0e0e0; }

/* === Range Sliders === */
.form-range {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  outline: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--theme-accent);
  cursor: pointer;
  border: 2px solid rgba(0,0,0,0.5);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* === Toggle Switch === */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(50,50,50,0.8);
  border: 1px solid rgba(255,255,255,0.1);
  position: relative;
  transition: all var(--transition-smooth);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff, #f0f0f0);
  transition: transform var(--transition-smooth);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--theme-accent), #b8964f);
  border-color: var(--theme-accent);
  box-shadow: 0 0 8px rgba(212,175,55,0.3);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* === Audio Note Indicator === */
.audio-note-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(30,30,50,0.8), rgba(20,20,35,0.9));
  border: 1px solid var(--theme-accent);
  border-radius: 12px;
  box-shadow: 
    0 4px 20px rgba(0,0,0,0.4),
    inset 0 1px 1px rgba(255,255,255,0.05),
    0 0 30px rgba(212,175,55,0.15);
}

.note-icon {
  font-size: 32px;
  color: var(--theme-accent);
  text-shadow: 
    0 0 10px rgba(212,175,55,0.6),
    0 2px 4px rgba(0,0,0,0.5);
  animation: notePulse 2s ease-in-out infinite;
}

.note-interval {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--theme-text);
  min-width: 40px;
  text-align: center;
  background: rgba(0,0,0,0.3);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

@keyframes notePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.85;
  }
}

/* === Chime Tooltip === */
.chime-tooltip {
  position: fixed;
  z-index: 99999;
  max-width: 320px;
  padding: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20,18,14,0.97), rgba(12,10,8,0.97));
  border: 1px solid rgba(212,175,55,0.25);
  box-shadow:
    0 12px 40px rgba(0,0,0,0.6),
    0 0 0 1px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  pointer-events: none;
  overflow: hidden;
}

.chime-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  animation: tooltipGlow 2.5s ease-in-out infinite;
}

@keyframes tooltipGlow {
  0%, 100% {
    box-shadow:
      0 12px 40px rgba(0,0,0,0.6),
      0 0 0 1px rgba(0,0,0,0.4),
      inset 0 1px 0 rgba(255,255,255,0.06),
      0 0 20px rgba(212,175,55,0.1);
  }
  50% {
    box-shadow:
      0 12px 40px rgba(0,0,0,0.6),
      0 0 0 1px rgba(0,0,0,0.4),
      inset 0 1px 0 rgba(255,255,255,0.06),
      0 0 35px rgba(212,175,55,0.25);
  }
}

.chime-tooltip::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.6), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.3; transform: translateX(-20%); }
  50% { opacity: 1; transform: translateX(20%); }
}

.chime-tooltip-icon {
  font-size: 28px;
  text-align: center;
  padding: 16px 0 4px;
  filter: drop-shadow(0 2px 6px rgba(212,175,55,0.3));
  animation: bellSway 2s ease-in-out infinite;
}

@keyframes bellSway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.chime-tooltip-name {
  font-family: var(--font-display, serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--theme-accent, #d4af37);
  text-align: center;
  padding: 2px 20px 8px;
  letter-spacing: 0.05em;
}

.chime-tooltip-desc {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--theme-text, #e0e0e0);
  opacity: 0.85;
  padding: 0 20px 18px;
  text-align: center;
}

[data-chime-tooltip] {
  cursor: help;
  border-bottom: 1px dotted rgba(212,175,55,0.4);
  transition: color 0.2s ease;
}

[data-chime-tooltip]:hover {
  color: var(--theme-accent, #d4af37);
}

/* === Info Tab === */
.info-section { text-align: center; }

.info-section h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--theme-accent);
  margin: 0 0 8px 0;
}

.info-section p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--theme-text);
  opacity: 0.7;
  margin: 0 0 16px 0;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 14px;
  margin: 0 0 16px 0;
  border: 1px solid rgba(255,255,255,0.06);
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.shortcut-item:hover {
  background: rgba(255,255,255,0.05);
}

.keycap {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.keycap kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.15);
  border-bottom: 2px solid rgba(0,0,0,0.4);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
  color: var(--theme-accent);
  font-family: var(--font-body, sans-serif);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.shortcut-desc {
  font-size: 12px;
  color: var(--theme-text);
  opacity: 0.85;
}

.info-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.info-actions button { width: 100%; }

/* === Inactivity === */
#quick-controls {
  pointer-events: none;
}

#settings-toggle, .quick-btn {
  opacity: 0;
  transition: opacity 2.5s ease;
}

body.controls-ready #settings-toggle,
body.controls-ready .quick-btn {
  opacity: 0.56;
  pointer-events: auto;
}

body.user-inactive #settings-toggle,
body.user-inactive .quick-btn {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Stagger: fullscreen button fades 1/4 second after settings button */
body.controls-ready .quick-btn {
  transition: opacity 2.5s ease 0.25s;
}

body.user-inactive .quick-btn {
  transition: opacity 2.5s ease 0.25s;
}

@media (min-width: 601px) {
  body.user-inactive { cursor: none; }
}

/* === Ambient Mode === */
body.ambient-mode #quick-controls,
body.ambient-mode #clock-title,
body.ambient-mode #settings-toggle {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 2s ease;
}

/* === Mobile === */
@media (max-width: 600px) {
  #app-logo .logo-main { font-size: 32px; }
  #app-logo .logo-sub { font-size: 16px; }
  #app-logo .logo-ornament { font-size: 20px; }
  #app-logo::before { width: 250px; height: 250px; }

  #clock-title {
    top: 25px;
    left: 0;
    width: 33.33%;
  }

  .title-year { font-size: 25px; }
  .title-main { font-size: 21px; }
  .title-index { font-size: 16px; }
  .title-desc { font-size: 19px; }
  .title-index::before, .title-index::after { margin: 0 5px; }

  #settings-panel {
    width: calc(100% - 16px);
    max-width: 100%;
    left: 8px;
    top: auto;
    bottom: 8px;
    transform: none;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
  }

  #quick-controls { bottom: 66px; left: 16px; gap: 30px; }

  #settings-toggle, .quick-btn {
    width: 96px;
    height: 96px;
  }
  #settings-toggle { font-size: 56px; }

  .shortcut-grid {
    grid-template-columns: 1fr;
  }
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  #app-logo.text-visible {
    animation: none;
    opacity: 1;
  }

  .title-main {
    animation: none;
  }

  .note-icon {
    animation: none;
  }

  #clock-container {
    transition: opacity 0.3s ease;
  }

  #app-logo.fade-out {
    transition: opacity 0.3s ease;
  }

  .quick-btn, #settings-toggle {
    transition: none;
  }

  .settings-tab-panel {
    animation: none;
  }
}

/* === Focus Styles (Accessibility) === */
.quick-btn:focus-visible,
#settings-toggle:focus-visible,
#settings-close:focus-visible,
.settings-tab:focus-visible,
.btn-secondary:focus-visible,
.btn-primary:focus-visible,
.btn-danger:focus-visible,
.form-select:focus-visible,
.form-range:focus-visible {
  outline: 2px solid var(--theme-accent);
  outline-offset: 2px;
}

.toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--theme-accent);
  outline-offset: 2px;
}

.settings-tab[aria-selected="true"] {
  color: var(--theme-accent);
  border-bottom-color: var(--theme-accent);
}

/* === Skip Link === */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--theme-accent);
  color: #000;
  padding: 8px 16px;
  z-index: 100;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* === Custom Select with Thumbnail Preview === */
.custom-select {
  position: relative;
  flex: 1;
}

.custom-select-trigger {
  width: 100%;
  padding: 8px 12px;
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  color: var(--theme-text);
  font-size: 14px;
  font-family: var(--font-display);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: var(--theme-accent);
}

.custom-select-arrow {
  font-size: 10px;
  opacity: 0.6;
}

.custom-select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--theme-surface);
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 4px 0;
}

.custom-select-dropdown.open {
  display: block;
}

.custom-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--theme-text);
  transition: background 0.15s ease;
  position: relative;
}

.custom-select-option:hover {
  background: rgba(212,175,55,0.12);
}

.custom-select-option.selected {
  color: var(--theme-accent);
  font-weight: 600;
}

.custom-select-option-thumb {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 10;
}

.custom-select-option:hover .custom-select-option-thumb {
  opacity: 1;
}
