/* ==========================================================================
   Glassmorphism Design System - Online Clock
   ========================================================================== */

/* DSEG7 Classic Webfont (SIL Open Font License 1.1) */
@font-face {
  font-family: 'DSEG7-Classic';
  src: url('../fonts/DSEG7Classic-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DSEG7-Classic';
  src: url('../fonts/DSEG7Classic-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Color Palette - Light Mode */
  --bg-gradient-1: #e0eafc;
  --bg-gradient-2: #cfdef3;
  --bg-gradient-3: #f5f7fa;
  --orb-1: rgba(120, 165, 255, 0.45);
  --orb-2: rgba(255, 182, 193, 0.4);
  --orb-3: rgba(160, 230, 255, 0.45);

  --glass-bg: rgba(255, 255, 255, 0.48);
  --glass-bg-hover: rgba(255, 255, 255, 0.65);
  --glass-card: rgba(255, 255, 255, 0.52);
  --glass-card-sub: rgba(255, 255, 255, 0.35);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-border-sub: rgba(255, 255, 255, 0.4);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --glass-shadow: 0 20px 50px rgba(31, 38, 135, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.8);
  --glass-shadow-sm: 0 8px 25px rgba(31, 38, 135, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.7);

  --blur-amt: 28px;

  /* Typography Colors */
  --text-main: #1d212a;
  --text-sub: #555e6d;
  --text-muted: #828c9b;
  --accent-color: #0071e3;
  --accent-gradient: linear-gradient(135deg, #0071e3 0%, #47a3ff 100%);
  --danger-color: #ff3b30;
  --success-color: #34c759;
  --warning-color: #ff9500;

  /* Clock Specific Display Colors (Light) */
  --clock-digit-color: #1a1e29;
  --clock-glow: none;
  --clock-sub-color: #4a5568;

  /* Fonts */
  --font-jp: 'Noto Sans JP', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-digital: 'DSEG7-Classic', monospace;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* 3D Drum Stage Dynamic Radius & Gap */
  --drum-tz: 220px;
  --drum-gap: 104px;

  /* Transitions & Radii */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-full: 9999px;
  --transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==========================================================================
   Dark Mode Styles (Neon Orange Activation)
   ========================================================================== */
[data-theme="dark"] {
  --bg-gradient-1: #090c14;
  --bg-gradient-2: #0f1322;
  --bg-gradient-3: #06080e;
  --orb-1: rgba(255, 107, 0, 0.18);
  --orb-2: rgba(45, 90, 255, 0.15);
  --orb-3: rgba(255, 70, 0, 0.12);

  --glass-bg: rgba(18, 24, 38, 0.62);
  --glass-bg-hover: rgba(26, 34, 52, 0.75);
  --glass-card: rgba(20, 27, 44, 0.68);
  --glass-card-sub: rgba(14, 19, 32, 0.5);
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-border-sub: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  --glass-shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);

  --text-main: #f0f4fc;
  --text-sub: #a6b2c6;
  --text-muted: #6b778d;
  --accent-color: #ff7700;
  --accent-gradient: linear-gradient(135deg, #ff6b00 0%, #ffa500 100%);

  /* IMPORTANT: Clock Digit Color in Dark Mode turns Neon Orange! */
  --clock-digit-color: #ff6e00;
  --clock-glow: 0 0 12px rgba(255, 110, 0, 0.7), 0 0 28px rgba(255, 110, 0, 0.45), 0 0 60px rgba(255, 110, 0, 0.25);
  --clock-sub-color: #ff9d47;
}

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

body {
  font-family: var(--font-jp);
  background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3));
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background 0.6s ease, color 0.4s ease;
}

/* Ambient Floating Orbs for Glass Refraction */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.75;
  animation: floatOrb 22s infinite alternate ease-in-out;
  transition: background 0.8s ease;
}

.orb-1 {
  width: 550px;
  height: 550px;
  background: var(--orb-1);
  top: -120px;
  left: -80px;
}

.orb-2 {
  width: 650px;
  height: 650px;
  background: var(--orb-2);
  bottom: -150px;
  right: -100px;
  animation-duration: 28s;
  animation-delay: -5s;
}

.orb-3 {
  width: 480px;
  height: 480px;
  background: var(--orb-3);
  top: 35%;
  left: 45%;
  animation-duration: 20s;
  animation-delay: -10s;
}

@keyframes floatOrb {
  0% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(60px, 40px) scale(1.1);
  }

  100% {
    transform: translate(-40px, 70px) scale(0.95);
  }
}

/* Master Layout Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-sm);
  transition: var(--transition);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 113, 227, 0.35);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-main), var(--text-sub));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 113, 227, 0.12);
  color: var(--accent-color);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Glass Capsule Buttons */
.glass-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border-sub);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-jp);
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: var(--transition);
  user-select: none;
}

.glass-btn:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
}

.glass-btn:active {
  transform: scale(0.96);
}

.glass-btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.35);
}

.glass-btn-primary:hover {
  background: var(--accent-gradient);
  filter: brightness(1.08);
  box-shadow: 0 8px 24px rgba(0, 113, 227, 0.45);
}

.glass-btn-danger {
  color: var(--danger-color);
  border-color: rgba(255, 59, 48, 0.25);
  background: rgba(255, 59, 48, 0.08);
}

.glass-btn-danger:hover {
  background: rgba(255, 59, 48, 0.16);
  border-color: rgba(255, 59, 48, 0.4);
}

/* Dark Mode Toggle Switch */
.theme-toggle-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.theme-toggle-btn .sun-icon {
  display: none;
}

.theme-toggle-btn .moon-icon {
  display: block;
  color: #4a5568;
}

[data-theme="dark"] .theme-toggle-btn .sun-icon {
  display: block;
  color: #ffa500;
}

[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}

/* Hamburger button for mobile */
.hamburger-btn {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.hamburger-line {
  width: 18px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: var(--transition);
}

/* ==========================================================================
   Quick Launch Action Bar
   ========================================================================== */
.quick-action-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.action-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: var(--glass-card);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-sm);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.action-pill:hover {
  transform: translateY(-3px) scale(1.02);
  background: var(--glass-bg-hover);
  border-color: var(--glass-highlight);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.action-pill svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: var(--accent-color);
}

/* ==========================================================================
   Main Clock Section (現在の時刻)
   ========================================================================== */
.main-clock-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

.clock-card {
  width: 100%;
  max-width: 1240px;
  padding: 44px 32px 38px;
  border-radius: var(--radius-xl);
  background: var(--glass-card);
  backdrop-filter: blur(34px) saturate(190%);
  -webkit-backdrop-filter: blur(34px) saturate(190%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: visible;
  transition: var(--transition);
}

/* Light beam / specular glare */
.clock-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
}

.clock-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(52, 199, 89, 0.14);
  color: var(--success-color);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success-color);
  box-shadow: 0 0 8px var(--success-color);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.location-badge {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* GIANT MAIN CLOCK DISPLAY (Individual Zero-Jitter Digit Slots) */
.clock-time-display {
  font-family: var(--font-digital);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 16px;
  user-select: none;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.clock-digits-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.digit-box {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 0.72em;
  min-width: 0.72em;
  max-width: 0.72em;
  font-size: clamp(2rem, 9.6vw, 6.8rem);
  font-weight: 700;
  color: var(--clock-digit-color);
  text-shadow: var(--clock-glow);
  text-align: center;
  flex-shrink: 0;
  overflow: hidden;
  line-height: 1;
}

.time-sep {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 0.36em;
  min-width: 0.36em;
  max-width: 0.36em;
  font-size: clamp(2rem, 9.6vw, 6.8rem);
  font-weight: 700;
  color: var(--clock-digit-color);
  text-shadow: var(--clock-glow);
  text-align: center;
  flex-shrink: 0;
  opacity: 0.9;
  line-height: 1;
  animation: blinkSep 2s infinite;
  transform: translateY(-0.04em);
}

@keyframes blinkSep {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.25;
  }
}

.time-ampm {
  font-family: var(--font-jp);
  font-size: clamp(0.78rem, 2.2vw, 1.4rem);
  font-weight: 600;
  margin-left: clamp(8px, 1.5vw, 20px);
  letter-spacing: 0.04em;
  color: var(--clock-sub-color);
  white-space: nowrap;
  flex-shrink: 0;
  padding: clamp(4px, 0.8vw, 6px) clamp(8px, 1.5vw, 14px);
  border-radius: var(--radius-full);
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border-sub);
  box-shadow: var(--glass-shadow-sm);
  align-self: center;
}

[data-theme="dark"] .time-ampm {
  background: rgba(255, 110, 0, 0.12);
  border-color: rgba(255, 110, 0, 0.28);
}

/* Japanese Date Display */
.clock-date-display {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}

.date-japanese {
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.date-weekday {
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border-sub);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-color);
}

.date-calendar-era {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}



/* ==========================================================================
   World Clock Section (世界時計 3D Rolling)
   ========================================================================== */
.world-clock-section {
  width: 100%;
  display: flex;
  justify-content: center;
}

.world-clock-container {
  width: 100%;
  max-width: 1240px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.world-clock-section {
  width: 100%;
}

.world-clock-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 4px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.section-title svg {
  color: var(--accent-color);
}

.world-clock-card {
  width: 100%;
  padding: 24px 28px 20px;
  border-radius: var(--radius-xl);
  background: var(--glass-card);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.city-select-wrapper {
  position: relative;
  min-width: 0;
  width: 100%;
}

.world-clock-controls-top {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-direction: column;
  width: 100%;
}

.city-search-wrapper {
  position: relative;
  min-width: 0;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

.city-search-input {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  padding: 0 32px 0 38px;
  border-radius: var(--radius-full);
  font-size: 0.92rem;
  line-height: 40px;
  background: var(--glass-card);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow-sm);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.search-clear-btn:hover {
  color: var(--danger-color);
}

.glass-select {
  width: 100%;
  height: 42px;
  box-sizing: border-box;
  padding: 0 38px 0 16px;
  border-radius: var(--radius-full);
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-family: var(--font-jp);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 40px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  box-shadow: var(--glass-shadow-sm);
  transition: var(--transition);
}

.glass-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

.glass-select option {
  background: #ffffff;
  color: #1a1e29;
}

[data-theme="dark"] .glass-select option {
  background: #182030;
  color: #f0f4fc;
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
}

/* 3D Rolling Carousel Stage */
.stage-3d-wrapper {
  position: relative;
  width: 100%;
  height: clamp(300px, 36vw, 350px);
  perspective: 1200px;
  perspective-origin: 50% 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* Subtle cylinder viewfinder guidelines framing the active slot */
.stage-3d-wrapper::before,
.stage-3d-wrapper::after {
  content: '';
  position: absolute;
  left: 6%;
  right: 6%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 113, 227, 0.28), transparent);
  pointer-events: none;
  z-index: 4;
}

.stage-3d-wrapper::before {
  top: calc(50% - 56px);
}

.stage-3d-wrapper::after {
  bottom: calc(50% - 56px);
}

[data-theme="dark"] .stage-3d-wrapper::before,
[data-theme="dark"] .stage-3d-wrapper::after {
  background: linear-gradient(90deg, transparent, rgba(255, 110, 0, 0.35), transparent);
}

.carousel-3d-stage {
  position: relative;
  width: min(78%, 800px);
  height: clamp(92px, 11vw, 108px);
  transform-style: preserve-3d;
}

/* 3D Drum Slot Card Rotations & Continuous Smooth Cylindrical Depth */
.slot-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.38s ease,
    filter 0.38s ease,
    box-shadow 0.38s ease,
    background 0.32s ease,
    border-color 0.32s ease;
  will-change: transform, opacity;
  box-sizing: border-box;
}

.slot-card[data-offset="-4"],
.slot-card[data-offset="-3"] {
  transform: translateY(calc(-2.6 * var(--drum-gap, 104px))) translateZ(calc(var(--drum-tz, 220px) - 150px)) rotateX(54deg) scale(0.72);
  opacity: 0;
  filter: blur(3px);
  z-index: 1;
  pointer-events: none;
}

.slot-card[data-offset="-2"] {
  transform: translateY(calc(-1.75 * var(--drum-gap, 104px))) translateZ(calc(var(--drum-tz, 220px) - 95px)) rotateX(42deg) scale(0.82);
  opacity: 0.2;
  filter: blur(1.2px);
  z-index: 3;
  cursor: pointer;
}

.slot-card[data-offset="-1"] {
  transform: translateY(calc(-1 * var(--drum-gap, 104px))) translateZ(calc(var(--drum-tz, 220px) - 34px)) rotateX(24deg) scale(0.95);
  opacity: 0.52;
  filter: grayscale(18%);
  z-index: 7;
  cursor: pointer;
}

.slot-card[data-offset="0"] {
  transform: translateY(0px) translateZ(var(--drum-tz, 220px)) rotateX(0deg) scale(1.02);
  opacity: 1;
  filter: none;
  z-index: 12;
  cursor: default;
}

.slot-card[data-offset="1"] {
  transform: translateY(calc(1 * var(--drum-gap, 104px))) translateZ(calc(var(--drum-tz, 220px) - 34px)) rotateX(-24deg) scale(0.95);
  opacity: 0.52;
  filter: grayscale(18%);
  z-index: 7;
  cursor: pointer;
}

.slot-card[data-offset="2"] {
  transform: translateY(calc(1.75 * var(--drum-gap, 104px))) translateZ(calc(var(--drum-tz, 220px) - 95px)) rotateX(-42deg) scale(0.82);
  opacity: 0.2;
  filter: blur(1.2px);
  z-index: 3;
  cursor: pointer;
}

.slot-card[data-offset="3"],
.slot-card[data-offset="4"] {
  transform: translateY(calc(2.6 * var(--drum-gap, 104px))) translateZ(calc(var(--drum-tz, 220px) - 150px)) rotateX(-54deg) scale(0.72);
  opacity: 0;
  filter: blur(3px);
  z-index: 1;
  pointer-events: none;
}

.slot-card[data-offset="-1"]:hover,
.slot-card[data-offset="1"]:hover {
  opacity: 0.72;
  filter: brightness(1.05) grayscale(0%);
}

/* Non-center card: mute text color */
.slot-card:not([data-offset="0"]) .city-digital-time {
  color: var(--text-muted);
  text-shadow: none;
}

.slot-card:not([data-offset="0"]) .city-name-jp {
  color: var(--text-sub);
  font-weight: 600;
}

.slot-card:not([data-offset="0"]) .city-flag {
  opacity: 0.7;
}

.slot-card:not([data-offset="0"]) .time-diff-badge {
  opacity: 0.6;
}

/* Center card: make time and city name bold and vivid */
.slot-card[data-offset="0"] .city-digital-time {
  color: var(--text-main);
  font-size: clamp(1.5rem, 3.8vw, 2.7rem);
  font-weight: 700;
}

.slot-card[data-offset="0"] .city-name-jp {
  font-size: clamp(1.15rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: var(--text-main);
}

[data-theme="dark"] .slot-card:not([data-offset="0"]) .city-digital-time {
  color: rgba(200, 210, 230, 0.45);
  text-shadow: none;
}

[data-theme="dark"] .slot-card:not([data-offset="0"]) .city-name-jp {
  color: rgba(200, 210, 230, 0.5);
}

[data-theme="dark"] .slot-card[data-offset="0"] .city-digital-time {
  color: var(--text-main);
  text-shadow: 0 0 16px rgba(255, 110, 0, 0.35);
}

.world-clock-cylinder-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--glass-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(10px, 1.8vw, 16px) clamp(16px, 2.5vw, 28px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-sizing: border-box;
}

[data-theme="dark"] .world-clock-cylinder-card {
  background: rgba(18, 24, 40, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
}

.world-clock-cylinder-card.active-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: 0 16px 40px rgba(0, 70, 180, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.8), inset 0 1px 2px rgba(255, 255, 255, 1);
}

[data-theme="dark"] .world-clock-cylinder-card.active-card {
  background: rgba(24, 32, 54, 0.95);
  border-color: rgba(255, 110, 0, 0.4);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.7), 0 0 20px rgba(255, 110, 0, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.2);
}


.city-info-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.city-header-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.city-flag {
  font-size: clamp(0.8rem, 1.6vw, 0.95rem);
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 113, 227, 0.12);
  color: var(--accent-color);
  letter-spacing: 0.05em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .city-flag {
  background: rgba(255, 110, 0, 0.16);
  color: #ff9d47;
}

.city-name-jp {
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.city-sub-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(0.72rem, 1.4vw, 0.85rem);
  color: var(--text-sub);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
}

.city-sub-meta>span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}

.time-diff-badge {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 113, 227, 0.12);
  color: var(--accent-color);
  font-weight: 600;
  font-size: clamp(0.7rem, 1.2vw, 0.78rem);
  white-space: nowrap;
  flex-shrink: 0;
}

.city-time-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 12px;
}

.city-digital-time {
  font-family: var(--font-digital);
  font-size: clamp(1.35rem, 3.4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
  line-height: 1.1;
}

[data-theme="dark"] .city-digital-time {
  color: var(--text-main);
  text-shadow: 0 0 12px rgba(255, 110, 0, 0.2);
}

.city-date-jp {
  font-size: clamp(0.75rem, 1.4vw, 0.88rem);
  color: var(--text-sub);
  font-weight: 500;
  white-space: nowrap;
}

/* 3D Navigation Controls (Up / Down) */
.controls-3d {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  position: relative;
  z-index: 20;
}

.btn-3d-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-bounce);
}

.btn-3d-nav:hover {
  background: var(--glass-bg-hover);
  transform: scale(1.1);
  border-color: var(--glass-highlight);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.btn-3d-nav:active {
  transform: scale(0.92);
}

.nav-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Active Task Lists (Alarms & Timers Cards)
   ========================================================================== */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  width: 100%;
}

.task-section-card {
  border-radius: var(--radius-xl);
  background: var(--glass-card);
  backdrop-filter: blur(var(--blur-amt));
  -webkit-backdrop-filter: blur(var(--blur-amt));
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 260px;
}

.task-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border-sub);
}

.task-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.task-count-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border-sub);
  color: var(--text-sub);
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 16px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  stroke-width: 1.5;
  opacity: 0.6;
}

/* Task Item Card (Alarm & Timer) */
.item-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border-sub);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: var(--transition);
}

.item-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.item-main-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-time-title {
  font-family: var(--font-digital);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

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

.item-label-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.sound-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent-color);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* REAL-TIME REMAINING TIME BADGE */
.remaining-time-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.15);
}

[data-theme="dark"] .remaining-time-bar {
  background: rgba(255, 110, 0, 0.1);
  border-color: rgba(255, 110, 0, 0.25);
}

.remaining-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
}

.remaining-digits {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 0.03em;
}

[data-theme="dark"] .remaining-digits {
  color: #ff943d;
}

/* Progress bar for Timers */
.progress-bar-container {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .progress-bar-container {
  background: rgba(255, 255, 255, 0.1);
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}

.item-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.btn-item-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-full);
}

.btn-item-edit {
  background: rgba(0, 113, 227, 0.12);
  color: var(--accent-color);
  border: 1px solid rgba(0, 113, 227, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-item-edit:hover {
  background: rgba(0, 113, 227, 0.2);
  border-color: var(--accent-color);
}

[data-theme="dark"] .btn-item-edit {
  background: rgba(255, 122, 0, 0.12);
  color: #ff9d42;
  border-color: rgba(255, 122, 0, 0.3);
}

[data-theme="dark"] .btn-item-edit:hover {
  background: rgba(255, 122, 0, 0.22);
  border-color: #ff9d42;
}

/* ==========================================================================
   Modals & Popups (Frosted Glass Sheet)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-xl);
  background: var(--glass-card);
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.7);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.modal-overlay.active .modal-window {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border-sub);
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border-sub);
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--text-main);
  transform: scale(1.08);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-sub);
}

.glass-input {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-family: var(--font-jp);
  font-size: 1.05rem;
  font-weight: 500;
  outline: none;
  transition: var(--transition);
}

.glass-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

/* Time Picker Spinner for Timer & Alarm */
.time-spinners-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border-sub);
}

.spinner-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.spinner-input {
  width: 72px;
  height: 60px;
  text-align: center;
  font-family: var(--font-digital);
  font-size: 1.8rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  outline: none;
}

.spinner-select {
  width: 84px;
  height: 56px;
  padding: 6px 10px;
  text-align: center;
  font-family: var(--font-digital);
  font-size: 1.65rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  cursor: pointer;
  outline: none;
  text-align-last: center;
  -webkit-appearance: none;
  appearance: none;
  transition: var(--transition);
}

.spinner-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

[data-theme="dark"] .spinner-select:focus {
  box-shadow: 0 0 0 3px rgba(255, 110, 0, 0.25);
}

.spinner-unit {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.spinner-colon {
  font-family: var(--font-digital);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-muted);
  transform: translateY(-8px);
}

/* Sound Selector Row with Preview Button */
.sound-selector-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-preview {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  box-sizing: border-box;
  font-size: 0.88rem;
}

.btn-preview.playing {
  background: var(--warning-color);
  color: #fff;
  border-color: var(--warning-color);
  box-shadow: 0 0 16px rgba(255, 149, 0, 0.4);
}

/* Stopwatch Modal Display */
.stopwatch-display-large {
  font-family: var(--font-digital);
  font-size: clamp(2.6rem, 8vw, 3.8rem);
  font-weight: 700;
  text-align: center;
  color: var(--text-main);
  letter-spacing: 0.04em;
  padding: 24px 10px;
  border-radius: var(--radius-lg);
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border-sub);
  margin: 6px 0;
}

.stopwatch-controls-row {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.lap-list-table {
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border-sub);
}

.lap-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  border-bottom: 1px solid var(--glass-border-sub);
}

.lap-row:last-child {
  border-bottom: none;
}

.lap-row.live-lap-row {
  background: rgba(0, 113, 227, 0.1);
  color: var(--accent-color);
  font-weight: 700;
  border-bottom: 1px solid rgba(0, 113, 227, 0.2);
}

[data-theme="dark"] .lap-row.live-lap-row {
  background: rgba(255, 110, 0, 0.15);
  color: #ff9d47;
  border-bottom-color: rgba(255, 110, 0, 0.3);
}

.live-lap-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-lap-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
  animation: pulseDot 1s infinite;
}

[data-theme="dark"] .live-lap-dot {
  background: #ff6e00;
  box-shadow: 0 0 8px #ff6e00;
}

.live-lap-digits {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Ringing Alert Screen (Alarm / Timer Triggered) */
.ringing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.ringing-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ringing-card {
  width: 100%;
  max-width: 440px;
  border-radius: var(--radius-xl);
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 80px rgba(255, 59, 48, 0.4);
  padding: 44px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  animation: shakeAlert 1s infinite alternate;
}

@keyframes shakeAlert {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }

  100% {
    transform: scale(1);
  }
}

.ringing-icon-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff3b30, #ff9500);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 35px rgba(255, 59, 48, 0.6);
  animation: ringPulse 1.2s infinite;
}

@keyframes ringPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7);
  }

  70% {
    box-shadow: 0 0 0 25px rgba(255, 59, 48, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 48, 0);
  }
}

.ringing-title {
  font-size: 1.8rem;
  font-weight: 700;
}

.ringing-desc {
  font-size: 1.1rem;
  color: var(--text-sub);
}

.btn-stop-ring {
  width: 100%;
  padding: 16px;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #ff3b30, #ff453a);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(255, 59, 48, 0.4);
  transition: var(--transition-bounce);
}

.btn-stop-ring:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
}

/* ==========================================================================
   Mobile Slide-out Drawer
   ========================================================================== */
.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100%;
  background: var(--glass-card);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-left: 1px solid var(--glass-border);
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.3);
  z-index: 1201;
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer-overlay.active .mobile-drawer {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border-sub);
}

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--glass-card-sub);
  border: 1px solid var(--glass-border-sub);
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.drawer-nav-item:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border);
  transform: translateX(-4px);
  text-decoration: none;
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */
@media (max-width: 1100px) {
  :root {
    --drum-tz: 190px;
    --drum-gap: 98px;
  }

  .carousel-3d-stage {
    width: min(80%, 780px);
  }
}

/* Wide screen: switch world clock controls to horizontal layout */
@media (min-width: 768px) {
  .world-clock-section {
    margin-top: 30px;
  }

  .section-header-row {
    flex-direction: row;
    align-items: center;
  }

  .world-clock-controls-top {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: auto;
    flex: 1;
    justify-content: flex-end;
  }

  .city-search-wrapper {
    width: auto;
    flex: 2 1 180px;
    max-width: 300px;
  }

  .city-select-wrapper {
    width: auto;
    flex: 1 1 180px;
    max-width: 280px;
  }
}

@media (max-width: 900px) {
  .app-container {
    padding: 16px 14px 50px;
    gap: 20px;
  }

  .clock-card {
    padding: 32px 20px 28px;
  }

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

@media (max-width: 850px) {
  :root {
    --drum-tz: 150px;
    --drum-gap: 94px;
  }

  .carousel-3d-stage {
    width: min(84%, 740px);
  }
}

@media (max-width: 640px) {
  :root {
    --drum-tz: 110px;
    --drum-gap: 88px;
  }

  .world-clock-card {
    padding: 20px 14px 18px;
    border-radius: var(--radius-lg);
  }

  .carousel-3d-stage {
    width: 98%;
  }

  .world-clock-cylinder-card {
    padding: 10px 12px;
  }

  .slot-card[data-offset="0"] .city-digital-time {
    font-size: clamp(1.32rem, 3.5vw, 1.55rem);
  }

  .city-sub-meta {
    gap: 6px;
  }

  .time-diff-badge {
    padding: 2px 6px;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .section-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .world-clock-controls-top {
    width: 100%;
    max-width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .city-search-wrapper,
  .city-select-wrapper {
    width: 100%;
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
  }

  .city-search-input,
  .glass-select {
    font-size: 0.85rem;
  }

  /* Mobile Header Optimization */
  .site-header {
    padding: 10px 14px;
    border-radius: var(--radius-lg);
  }

  .brand-area {
    gap: 8px;
    min-width: 0;
  }

  .brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hamburger-btn {
    display: flex;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
  }

  .theme-toggle-btn {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
  }

  .header-controls {
    gap: 8px;
    flex-shrink: 0;
  }

  .desktop-action-bar {
    display: none;
  }

  /* Task Item Card (Alarm & Timer) on Mobile */
  .item-card {
    padding: 14px 16px;
    gap: 10px;
  }

  .item-main-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
  }

  .item-label-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
  }

  .item-time-title {
    font-size: 1.55rem;
    line-height: 1.1;
  }

  .item-label-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
  }

  .sound-badge {
    white-space: nowrap;
    font-size: 0.72rem;
    padding: 3px 8px;
    flex-shrink: 0;
    margin-top: 2px;
  }

  .time-spinners-row {
    gap: 6px;
    padding: 8px;
  }

  .spinner-input {
    width: 58px;
    height: 52px;
    font-size: 1.5rem;
  }
}

@media (max-width: 460px) {
  :root {
    --drum-tz: 75px;
    --drum-gap: 84px;
  }

  .world-clock-card {
    padding: 16px 10px 14px;
  }

  .carousel-3d-stage {
    width: 100%;
  }

  .world-clock-cylinder-card {
    padding: 8px 10px;
  }

  .slot-card[data-offset="0"] .city-digital-time {
    font-size: 1.32rem;
  }

  .city-name-jp {
    font-size: 1.02rem;
  }

  .world-clock-controls-top {
    flex-direction: column;
    gap: 8px;
  }

  .city-search-wrapper,
  .city-select-wrapper {
    width: 100%;
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100%;
  }

  .city-time-group {
    margin-left: 6px;
  }

  .city-sub-meta {
    gap: 5px;
    font-size: 0.72rem;
  }

  .time-diff-badge {
    padding: 2px 5px;
    font-size: 0.68rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 0.88rem;
  }

  .item-label-text {
    max-width: 130px;
  }
}

/* ==========================================================================
   DSEG7 Utility Class
   ========================================================================== */
.dseg {
  font-family: 'DSEG7-Classic', monospace;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Remaining time bar in alarm/timer list cards */
.remaining-time-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 4px;
}

.remaining-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.remaining-digits {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 0.06em;
}

.remaining-digits.dseg {
  font-family: 'DSEG7-Classic', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px rgba(0, 113, 227, 0.4);
}

[data-theme="dark"] .remaining-digits.dseg {
  color: #ff9f2d;
  text-shadow: 0 0 10px rgba(255, 159, 45, 0.5);
}

/* ==========================================================================
   Site Common Footer
   ========================================================================== */
.site-footer {
  text-align: center;
  padding: 32px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.site-footer .footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.site-footer .footer-links a {
  color: var(--text-sub);
  font-size: 0.88rem;
  text-decoration: none;
  transition: var(--transition);
  text-decoration: underline;
}

.site-footer .footer-links a:hover {
  color: var(--accent-color);
}

.site-footer .footer-copyright {
  font-size: 0.82rem;
  margin-top: 10px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.site-footer .footer-separator {
  color: var(--text-muted);
  opacity: 0.5;
  font-size: 0.82rem;
  user-select: none;
}

.contact-highlight-link {
  color: #2563eb !important;
  font-weight: 600;
  text-decoration: underline !important;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="dark"] .contact-highlight-link {
  color: #60a5fa !important;
}

.contact-highlight-link:hover {
  color: #1d4ed8 !important;
  text-decoration-thickness: 2px !important;
}

[data-theme="dark"] .contact-highlight-link:hover {
  color: #93c5fd !important;
}