:root {
  --primary-bg: #000810;
  --text-primary: #fff;
  --text-secondary: rgba(255, 255, 255, 0.9);
  --accent-color: #2196f3;
  --overlay-bg: rgba(0, 0, 0, 0.92);
  --glass-bg: rgba(255, 255, 255, 0.07);
  --button-bg: rgba(255, 255, 255, 0.85);
  --content-max: 600px;
  --content-width: min(92vw, var(--content-max));
}

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

html,
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--primary-bg);
  color: var(--text-primary);
  min-height: 100%;
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

body {
  display: grid;
  grid-template-rows: 1fr auto;
  font-size: 15px;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-text-size-adjust: 100%;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1rem, 3vw, 1.6rem);
  text-align: center;
  position: relative;
  background: linear-gradient(to bottom, #001428, var(--primary-bg));
  min-height: calc(100vh - 3rem);
  min-height: calc(100dvh - 3rem);
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

h1 {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  margin: 1rem 0;
  background: linear-gradient(120deg, #fff, #88cfff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

#clockCanvasParent,
#arcCanvasParent,
#infoBox,
#daySlider,
.button-group,
#locationDropdownContainer,
#barCanvasParent,
.location-header {
  width: var(--content-width);
  max-width: var(--content-max);
  margin-inline: auto;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

#locationDisplay {
  display: block;
  font-size: 1rem;
  margin: 0.2rem 0 0.5rem;
  color: var(--text-secondary);
  word-break: break-word;
}

.location-header {
  z-index: 2;
}

#clockCanvasParent {
  height: clamp(240px, 60vw, 320px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  position: relative;
  margin-top: 1rem;
}

#barCanvasParent {
  height: clamp(36px, 8vw, 48px);
  margin-top: 1rem;
}

#arcCanvasParent {
  background: transparent;
  position: relative;
  margin-top: 1rem;
}

#arcOverlay {
  display: none;
}

#infoBox {
  margin-top: 0.8rem;
  padding: 0.8rem;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  color: var(--text-primary);
  line-height: 1.4;
}

#daySlider {
  height: 8px;
  margin: 1rem 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin-top: 2rem;
}

#daySlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgb(255, 215, 0);
  cursor: pointer;
  border: 3px solid rgba(255, 225, 100, 0.9);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  transition: all 0.2s ease;
}

#daySlider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgb(255, 215, 0);
  cursor: pointer;
  border: 3px solid rgba(255, 225, 100, 0.9);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  transition: all 0.2s ease;
}

#daySlider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
}

#daySlider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
}

.controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  width: 100%;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.control-button {
  background: var(--button-bg);
  color: var(--primary-bg);
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 140px;
  min-height: 44px;
  flex: 1 1 140px;
}

.control-button:hover {
  background: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.control-button:active {
  transform: translateY(0);
}

.control-button-wide {
  width: 100%;
  flex-basis: 100%;
}

.location-button-row {
  margin-top: 0.5rem;
}

/*brightyyellow */
#infoDate {
  color: rgb(255, 215, 0);
}

.status-overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  padding: 1rem;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.status-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

footer {
  text-align: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-secondary);
  margin-top: auto;
}

footer a {
  color: var(--accent-color);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

#locationDropdownContainer {
  margin-top: 0.5rem;
}

#locationPanel {
  margin-top: 0.6rem;
  padding: 0.75rem;
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

#locationSearch {
  width: 100%;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 16px;
}

#locationSearch::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.location-action {
  background: var(--button-bg);
  color: var(--primary-bg);
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 40px;
  touch-action: manipulation;
}

.location-action:hover {
  background: var(--text-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.location-results {
  margin-top: 0.7rem;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overscroll-behavior: contain;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

.location-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  width: 100%;
  text-align: left;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
  min-width: 0;
  touch-action: manipulation;
}

.location-option:hover {
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.location-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 180px;
}

.location-label {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-meta {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-left: auto;
  flex-shrink: 0;
}

.location-badge {
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 215, 0, 0.18);
  color: #ffd54f;
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.location-hint {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

@media (max-width: 560px) {
  .control-button {
    min-width: 120px;
  }

  .location-results {
    max-height: 40vh;
  }

  .location-option {
    align-items: flex-start;
  }

  .location-label {
    white-space: normal;
  }

  .location-meta {
    width: 100%;
    margin-left: 0;
  }
}
