:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
  --night: #1a2240;
  --day: #ffb84d;
  --twilight: #6b4a8a;
}

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

html, body {
  width: 600px; height: 600px; overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-variant-numeric: tabular-nums;
}

#app { width: 100%; height: 100%; position: relative; }

.screen {
  width: 100%; height: 100%;
  position: absolute; top: 0; left: 0;
  display: flex; flex-direction: column;
}
.screen.hidden { display: none; }

.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
}
.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}
.hidden { display: none !important; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 18px 24px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--bg-tertiary);
  min-height: 64px;
}
.topbar .title {
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
}
.topbar .local-time {
  text-align: right;
  font-size: 18px;
  color: var(--accent);
  font-weight: 500;
}
.topbar .back {
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text-secondary);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-self: start;
}

.hint {
  background: var(--bg-primary);
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 10px;
  border-top: 1px solid var(--bg-tertiary);
}

/* HOME — dial of cities */
.dial {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-primary);
}
.city-tile {
  flex: 1;
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  min-height: 78px;
}
.city-tile .sun {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: var(--night);
  border: 2px solid var(--bg-tertiary);
  position: relative;
  overflow: hidden;
}
.city-tile .sun.day { background: linear-gradient(135deg, #ffb84d, #ff7a3d); }
.city-tile .sun.dawn { background: linear-gradient(135deg, #6b4a8a, #ffb84d); }
.city-tile .sun.dusk { background: linear-gradient(135deg, #ff7a3d, #6b4a8a); }
.city-tile .sun.night { background: linear-gradient(135deg, #1a2240, #2d1f4a); }

.city-tile .info { min-width: 0; }
.city-tile .city-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.city-tile .city-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.city-tile .right { text-align: right; }
.city-tile .time {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.city-tile .delta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.city-tile.local .city-name::after {
  content: " ●";
  color: var(--accent-secondary);
  font-size: 13px;
}

/* DETAIL */
.detail-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px 28px;
  background: var(--bg-primary);
  gap: 16px;
}
.big-time {
  font-size: 84px;
  font-weight: 300;
  text-align: center;
  letter-spacing: -3px;
  color: var(--text-primary);
  line-height: 1;
}
.big-date {
  font-size: 18px;
  text-align: center;
  color: var(--text-secondary);
}
.meta-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.meta-block {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.meta-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.meta-value {
  font-size: 18px;
  color: var(--text-primary);
  margin-top: 4px;
  font-weight: 500;
}

.daylight-bar {
  position: relative;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 8px 8px 24px;
}
.daylight-track {
  position: relative;
  height: 22px;
  border-radius: 6px;
  background: linear-gradient(
    to right,
    #1a2240 0%,
    #1a2240 22%,
    #6b4a8a 27%,
    #ffb84d 33%,
    #ff7a3d 50%,
    #ffb84d 66%,
    #6b4a8a 73%,
    #1a2240 78%,
    #1a2240 100%
  );
  overflow: hidden;
}
.daylight-cursor {
  position: absolute;
  top: -3px;
  width: 4px;
  height: 28px;
  background: var(--text-primary);
  box-shadow: 0 0 8px var(--accent);
  border-radius: 2px;
  transform: translateX(-2px);
  transition: left 0.3s ease;
}
.daylight-labels {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 4px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}
.btn {
  flex: 1;
  min-height: 56px;
  padding: 14px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}

/* PICKER */
.picker-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.picker-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: 10px;
  min-height: 56px;
}
.picker-row .pname { font-size: 15px; color: var(--text-primary); }
.picker-row .poffset { font-size: 12px; color: var(--text-muted); }
.picker-row .ptime { font-size: 16px; color: var(--accent); font-weight: 500; min-width: 64px; text-align: right; }

/* SETTINGS */
.settings-list {
  flex: 1;
  padding: 16px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  min-height: 72px;
}
.setting-label { font-size: 17px; font-weight: 500; }
.setting-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.setting-value {
  font-size: 18px;
  color: var(--accent);
  font-weight: 600;
}
.setting-value.danger { color: var(--danger); font-size: 22px; }
