:root {
  --cyan: #00f0ff;
  --pink: #ff2fd0;
  --green: #39ff14;
  --blue: #3b82f6;
  --bg: #05060f;
}

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

body {
  background: var(--bg);
  font-family: 'Share Tech Mono', monospace;
  color: #cfe9ff;
  overflow-x: hidden;
  min-height: 100vh;
}

.app-root {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 15%, rgba(0,240,255,0.10), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(255,47,208,0.10), transparent 45%),
    radial-gradient(circle at 50% 50%, #0a0c1a, #05060f 80%);
}

.grid-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,240,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,240,255,0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: gridDrift 24s linear infinite;
  mask-image: radial-gradient(circle at center, black, transparent 75%);
}
@keyframes gridDrift { from { background-position: 0 0; } to { background-position: 44px 44px; } }

.scanline {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(0,240,255,0.03) 50%, transparent 50%);
  background-size: 100% 4px;
  opacity: 0.4;
}

.content {
  position: relative; z-index: 2;
  max-width: 680px; margin: 0 auto;
  padding: 32px 16px 40px;
  display: flex; flex-direction: column;
}

/* header */
.title {
  font-family: 'Orbitron', sans-serif;
  font-weight: 900;
  font-size: clamp(2.4rem, 9vw, 4rem);
  letter-spacing: 0.35em;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(0,240,255,0.7), 0 0 30px rgba(0,240,255,0.35);
  animation: titlePulse 4s ease-in-out infinite;
  padding-left: 0.35em;
}
@keyframes titlePulse {
  0%,100% { text-shadow: 0 0 12px rgba(0,240,255,0.7), 0 0 30px rgba(0,240,255,0.35); }
  50% { text-shadow: 0 0 18px rgba(0,240,255,0.9), 0 0 44px rgba(255,47,208,0.4); }
}
.title.glitch { animation: glitchIn 0.7s steps(6) 1; }
@keyframes glitchIn {
  0% { opacity: 0.2; transform: translateX(-4px) skewX(6deg); filter: hue-rotate(90deg); }
  40% { opacity: 0.6; transform: translateX(3px) skewX(-4deg); }
  70% { opacity: 0.4; transform: translateX(-2px); }
  100% { opacity: 1; transform: none; filter: none; }
}
.tagline {
  margin-top: 8px; font-size: 0.72rem; letter-spacing: 0.28em;
  color: rgba(57,255,20,0.7); text-transform: uppercase;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 8px var(--green); animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* tabs */
.tab-bar {
  position: relative;
  display: flex;
  background: rgba(10,14,30,0.5);
  border: 1px solid rgba(0,240,255,0.2);
  border-radius: 16px;
  padding: 6px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 20px rgba(0,240,255,0.08);
}
.tab-indicator {
  position: absolute; top: 6px; bottom: 6px;
  background: linear-gradient(135deg, rgba(0,240,255,0.18), rgba(255,47,208,0.18));
  border: 1px solid rgba(0,240,255,0.5);
  border-radius: 11px;
  transition: left 0.35s cubic-bezier(.6,.05,.2,1);
  box-shadow: 0 0 16px rgba(0,240,255,0.3);
}
.tab {
  position: relative; z-index: 1; flex: 1;
  background: none; border: none; cursor: pointer;
  color: rgba(207,233,255,0.4);
  padding: 10px 4px; border-radius: 11px;
  font-family: 'Orbitron', sans-serif; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: color 0.25s, transform 0.15s;
}
.tab:hover { color: rgba(0,240,255,0.8); }
.tab:active { transform: scale(0.94); }
.tab-active { color: var(--cyan); text-shadow: 0 0 8px rgba(0,240,255,0.6); }
.tab-icon { font-size: 1.2rem; }
.tab-label { font-size: 0.55rem; letter-spacing: 0.12em; }

/* panel */
.panel {
  background: rgba(10,14,30,0.4);
  border: 1px solid rgba(0,240,255,0.16);
  border-radius: 22px;
  padding: 32px 20px;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 40px rgba(0,240,255,0.06), inset 0 0 30px rgba(255,47,208,0.03);
  min-height: 420px;
  display: flex; align-items: center; justify-content: center;
  animation: fadeUp 0.4s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* analog */
.analog-wrap { width: min(280px, 72vw); }
.analog-svg { width: 100%; height: auto; display: block; }

/* digital */
.digital-display {
  font-family: 'Orbitron', sans-serif; font-weight: 700;
  font-size: clamp(2rem, 10vw, 3.4rem);
  display: flex; align-items: baseline; gap: 2px;
  color: var(--cyan);
}
.digit-seg { text-shadow: 0 0 12px rgba(0,240,255,0.7); }
.digit-seg.sec { color: var(--pink); text-shadow: 0 0 12px rgba(255,47,208,0.7); }
.colon { color: var(--cyan); transition: opacity 0.2s; }
.colon.dim { opacity: 0.2; }
.ampm { font-size: 0.9rem; color: var(--green); margin-left: 8px; text-shadow: 0 0 8px var(--green); align-self: center; }
.date-str { letter-spacing: 0.25em; font-size: 0.8rem; color: rgba(207,233,255,0.6); }

.toggle-btn {
  font-family: 'Orbitron', sans-serif; font-weight: 700;
  background: rgba(0,240,255,0.08);
  border: 1px solid rgba(0,240,255,0.4);
  color: var(--cyan);
  padding: 8px 20px; border-radius: 10px; cursor: pointer;
  letter-spacing: 0.2em; transition: all 0.2s;
}
.toggle-btn:hover { background: rgba(0,240,255,0.18); box-shadow: 0 0 16px rgba(0,240,255,0.4); }

/* big timer / stopwatch */
.big-timer {
  font-family: 'Orbitron', sans-serif; font-weight: 700;
  font-size: clamp(2.6rem, 13vw, 4.6rem);
  letter-spacing: 0.04em;
}
.glow-cyan { color: var(--cyan); text-shadow: 0 0 18px rgba(0,240,255,0.6); }

/* control buttons */
.ctrl {
  font-family: 'Orbitron', sans-serif; font-weight: 700;
  padding: 12px 26px; border-radius: 12px; cursor: pointer;
  letter-spacing: 0.15em; font-size: 0.85rem;
  border: 1px solid; background: transparent;
  transition: all 0.2s;
}
.ctrl:active { transform: scale(0.93); }
.ctrl:disabled { opacity: 0.3; cursor: not-allowed; }
.ctrl-green { color: var(--green); border-color: var(--green); box-shadow: 0 0 14px rgba(57,255,20,0.25); }
.ctrl-green:hover:not(:disabled) { background: rgba(57,255,20,0.14); box-shadow: 0 0 22px rgba(57,255,20,0.5); }
.ctrl-pink { color: var(--pink); border-color: var(--pink); box-shadow: 0 0 14px rgba(255,47,208,0.25); }
.ctrl-pink:hover:not(:disabled) { background: rgba(255,47,208,0.14); box-shadow: 0 0 22px rgba(255,47,208,0.5); }
.ctrl-cyan { color: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 14px rgba(0,240,255,0.25); }
.ctrl-cyan:hover:not(:disabled) { background: rgba(0,240,255,0.14); box-shadow: 0 0 22px rgba(0,240,255,0.5); }
.ctrl-muted { color: rgba(207,233,255,0.6); border-color: rgba(207,233,255,0.3); }
.ctrl-muted:hover:not(:disabled) { color: #fff; border-color: rgba(207,233,255,0.7); }

/* laps */
.lap-list {
  width: 100%; max-width: 380px; max-height: 200px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.lap-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; border-radius: 8px;
  background: rgba(0,240,255,0.04);
  border: 1px solid rgba(0,240,255,0.12);
  font-size: 0.85rem;
}
.lap-num { color: rgba(207,233,255,0.6); letter-spacing: 0.1em; }
.lap-split { color: var(--cyan); font-family: 'Orbitron', sans-serif; }
.lap-total { color: rgba(207,233,255,0.5); font-size: 0.75rem; }
.lap-fast { border-color: rgba(57,255,20,0.5); box-shadow: 0 0 10px rgba(57,255,20,0.2); }
.lap-fast .lap-split { color: var(--green); }
.lap-slow { border-color: rgba(255,47,208,0.5); }
.lap-slow .lap-split { color: var(--pink); }

/* timer */
.timer-ring-wrap { position: relative; width: min(240px, 66vw); }
.timer-ring { width: 100%; height: auto; display: block; }
.timer-center {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Orbitron', sans-serif; font-weight: 700;
  font-size: clamp(1.6rem, 8vw, 2.4rem); letter-spacing: 0.03em;
}
.stepper { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-btn {
  background: rgba(0,240,255,0.08); border: 1px solid rgba(0,240,255,0.3);
  color: var(--cyan); width: 46px; height: 30px; border-radius: 8px; cursor: pointer;
  font-size: 0.7rem; transition: all 0.15s;
}
.step-btn:hover { background: rgba(0,240,255,0.2); box-shadow: 0 0 12px rgba(0,240,255,0.4); }
.step-btn:active { transform: scale(0.9); }
.step-val { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 1.6rem; color: var(--cyan); text-shadow: 0 0 10px rgba(0,240,255,0.5); }
.step-lbl { font-size: 0.55rem; letter-spacing: 0.2em; color: rgba(207,233,255,0.5); }
.step-colon { font-family: 'Orbitron', sans-serif; font-size: 1.6rem; color: rgba(0,240,255,0.4); align-self: center; margin-top: 26px; }
.chip {
  background: rgba(255,47,208,0.06); border: 1px solid rgba(255,47,208,0.3);
  color: var(--pink); padding: 6px 16px; border-radius: 20px; cursor: pointer;
  font-family: 'Orbitron', sans-serif; font-size: 0.7rem; letter-spacing: 0.1em; transition: all 0.15s;
}
.chip:hover { background: rgba(255,47,208,0.18); box-shadow: 0 0 14px rgba(255,47,208,0.4); }
.chip:active { transform: scale(0.92); }
.times-up {
  font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: 1.6rem;
  color: var(--pink); letter-spacing: 0.25em;
  text-shadow: 0 0 16px rgba(255,47,208,0.8);
  animation: flashUp 0.8s ease-in-out infinite;
}
@keyframes flashUp { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.06); } }

/* world */
.world-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: 100%;
}
@media (max-width: 480px) { .world-grid { grid-template-columns: 1fr; } }
.zone-card {
  position: relative;
  padding: 16px 16px 14px; border-radius: 14px;
  background: rgba(10,14,30,0.5);
  border: 1px solid rgba(0,240,255,0.18);
  transition: all 0.25s;
}
.zone-card:hover { border-color: rgba(0,240,255,0.5); box-shadow: 0 0 18px rgba(0,240,255,0.15); transform: translateY(-2px); }
.zone-day { border-color: rgba(255,210,59,0.25); }
.zone-day:hover { box-shadow: 0 0 18px rgba(255,210,59,0.2); }
.zone-night { border-color: rgba(59,130,246,0.3); }
.zone-remove {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: rgba(207,233,255,0.35);
  cursor: pointer; font-size: 1.1rem; line-height: 1; transition: color 0.2s;
}
.zone-remove:hover { color: var(--pink); text-shadow: 0 0 8px var(--pink); }
.zone-icon { font-size: 1.1rem; }
.zone-day .zone-icon { color: #ffd23b; text-shadow: 0 0 10px rgba(255,210,59,0.6); }
.zone-night .zone-icon { color: var(--blue); text-shadow: 0 0 10px rgba(59,130,246,0.6); }
.zone-label { font-family: 'Orbitron', sans-serif; font-weight: 700; letter-spacing: 0.15em; font-size: 0.7rem; color: rgba(207,233,255,0.7); margin: 2px 0 6px; }
.zone-time { font-family: 'Orbitron', sans-serif; font-weight: 700; font-size: 1.7rem; color: var(--cyan); text-shadow: 0 0 10px rgba(0,240,255,0.4); }
.zone-sec { font-size: 0.9rem; color: var(--pink); text-shadow: 0 0 8px rgba(255,47,208,0.5); }
.zone-ap { font-size: 0.7rem; color: var(--green); }
.zone-meta { margin-top: 6px; font-size: 0.65rem; letter-spacing: 0.12em; color: rgba(207,233,255,0.45); }
.zone-select {
  font-family: 'Orbitron', sans-serif; font-size: 0.75rem; letter-spacing: 0.1em;
  background: rgba(0,240,255,0.06); border: 1px solid rgba(0,240,255,0.35);
  color: var(--cyan); padding: 10px 20px; border-radius: 12px; cursor: pointer;
  appearance: none; outline: none;
}
.zone-select:hover { background: rgba(0,240,255,0.14); box-shadow: 0 0 14px rgba(0,240,255,0.3); }
.zone-select option { background: #0a0c1a; color: #cfe9ff; }

/* footer */
.footer {
  margin-top: 24px; text-align: center;
  font-size: 0.68rem; letter-spacing: 0.1em; color: rgba(207,233,255,0.4);
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.remix-link {
  color: var(--pink); text-decoration: none; letter-spacing: 0.15em;
  border-bottom: 1px solid rgba(255,47,208,0.3); padding-bottom: 1px; transition: all 0.2s;
}
.remix-link:hover { text-shadow: 0 0 10px rgba(255,47,208,0.7); border-color: var(--pink); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,240,255,0.3); border-radius: 3px; }