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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #555568;
  --accent-1: #6c5ce7;
  --accent-2: #00cec9;
  --accent-3: #fd79a8;
  --accent-4: #fdcb6e;
  --accent-5: #e17055;
  --border-color: rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(108, 92, 231, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(0, 206, 201, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 0%, rgba(253, 121, 168, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 0;
  transition: left 0.1s ease, top 0.1s ease;
}

.container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
  z-index: 1;
}

.header {
  text-align: center;
  margin-bottom: 60px;
  animation: fadeDown 0.8s ease;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logo-icon {
  font-size: 28px;
  color: var(--accent-1);
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dot {
  color: var(--accent-2);
  -webkit-text-fill-color: var(--accent-2);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 400;
}

.section {
  margin-bottom: 50px;
  animation: fadeUp 0.6s ease;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.title-icon {
  font-size: 22px;
}

.clocks-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.clock-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px 24px;
  backdrop-filter: blur(12px);
  transition: var(--transition);
}

.clock-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.1);
}

.clock-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 20px;
}

.clock-face {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #1a1a2e, #0f0f1a);
  border: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 40px rgba(108, 92, 231, 0.1), inset 0 0 40px rgba(0, 0, 0, 0.3);
  position: relative;
}

.clock-inner {
  width: 100%;
  height: 100%;
  position: relative;
}

.clock-hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 4px;
  transition: transform 0.05s cubic-bezier(0.4, 2.08, 0.55, 0.44);
}

.hour-hand {
  width: 4px;
  height: 50px;
  background: linear-gradient(to top, var(--accent-1), var(--accent-2));
  margin-left: -2px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(108, 92, 231, 0.3);
}

.minute-hand {
  width: 3px;
  height: 72px;
  background: linear-gradient(to top, var(--accent-2), #81ecec);
  margin-left: -1.5px;
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(0, 206, 201, 0.3);
}

.second-hand {
  width: 2px;
  height: 82px;
  background: linear-gradient(to top, var(--accent-3), #fab1a0);
  margin-left: -1px;
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(253, 121, 168, 0.4);
}

.clock-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--accent-3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(253, 121, 168, 0.5);
  z-index: 5;
}

.marker {
  position: absolute;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-12 { top: 4px; left: 50%; transform: translateX(-50%); }
.marker-1 { top: 18px; right: 44px; }
.marker-2 { top: 46px; right: 16px; }
.marker-3 { top: 50%; right: 4px; transform: translateY(-50%); }
.marker-4 { bottom: 46px; right: 16px; }
.marker-5 { bottom: 18px; right: 44px; }
.marker-6 { bottom: 4px; left: 50%; transform: translateX(-50%); }
.marker-7 { bottom: 18px; left: 44px; }
.marker-8 { bottom: 46px; left: 16px; }
.marker-9 { top: 50%; left: 4px; transform: translateY(-50%); }
.marker-10 { top: 46px; left: 16px; }
.marker-11 { top: 18px; left: 44px; }

.digital-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.digital-display {
  text-align: center;
  padding: 20px 0;
}

.time-display {
  font-size: 52px;
  font-weight: 300;
  letter-spacing: 4px;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-variant-numeric: tabular-nums;
  margin-bottom: 8px;
  line-height: 1.2;
}

.date-display {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
}

.timezone-info {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.nav-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.02) 100%);
  pointer-events: none;
}

.nav-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.fortune-btn:hover { background: rgba(108, 92, 231, 0.08); border-color: rgba(108, 92, 231, 0.2); }
.counter-btn:hover { background: rgba(0, 206, 201, 0.08); border-color: rgba(0, 206, 201, 0.2); }

.nav-btn-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.nav-btn-text {
  font-size: 17px;
  font-weight: 500;
  flex: 1;
}

.nav-btn-arrow {
  font-size: 20px;
  color: var(--text-muted);
  transition: var(--transition);
}

.nav-btn:hover .nav-btn-arrow {
  transform: translateX(4px);
  color: var(--accent-1);
}

.fortune-container {
  text-align: center;
}

.wheel-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
}

#wheelCanvas {
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(108, 92, 231, 0.15), 0 0 120px rgba(108, 92, 231, 0.05);
  transition: box-shadow 0.3s ease;
}

.wheel-pointer {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 36px;
  color: var(--accent-4);
  filter: drop-shadow(0 4px 12px rgba(253, 203, 110, 0.4));
  z-index: 10;
  line-height: 1;
}

.spin-btn {
  display: block;
  margin: 20px auto 0;
  padding: 14px 48px;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-1), #a29bfe);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
  letter-spacing: 0.5px;
}

.spin-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4);
}

.spin-btn:active {
  transform: translateY(0);
}

.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.fortune-result {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(12px);
}

.result-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.result-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--accent-4);
  min-height: 36px;
}

.counter-container {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.counter-display {
  font-size: 96px;
  font-weight: 200;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-2), #81ecec, var(--accent-1));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 24px;
  font-variant-numeric: tabular-nums;
  transition: transform 0.15s ease;
}

.counter-display.pop {
  transform: scale(1.1);
}

.counter-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.counter-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 26px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.counter-btn:hover {
  transform: translateY(-2px);
}

.counter-minus:hover {
  background: rgba(253, 121, 168, 0.1);
  border-color: rgba(253, 121, 168, 0.3);
  color: var(--accent-3);
}

.counter-plus:hover {
  background: rgba(0, 206, 201, 0.1);
  border-color: rgba(0, 206, 201, 0.3);
  color: var(--accent-2);
}

.counter-reset:hover {
  background: rgba(253, 203, 110, 0.1);
  border-color: rgba(253, 203, 110, 0.3);
  color: var(--accent-4);
}

.counter-btn:active {
  transform: scale(0.92);
}

.footer {
  text-align: center;
  padding: 40px 0 20px;
  border-top: 1px solid var(--border-color);
  margin-top: 20px;
}

.footer p {
  font-size: 14px;
  color: var(--text-muted);
}

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

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

.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-1), #a29bfe);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4);
}

.scroll-top:active {
  transform: translateY(0);
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media (max-width: 700px) {
  .clocks-wrapper {
    grid-template-columns: 1fr;
  }

  .clock-face {
    width: 180px;
    height: 180px;
  }

  .time-display {
    font-size: 40px;
  }

  .nav-buttons {
    grid-template-columns: 1fr;
  }

  .counter-display {
    font-size: 72px;
  }

  .container {
    padding: 24px 16px;
  }

  .scroll-top {
    bottom: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    font-size: 20px;
  }
}

@media (max-width: 400px) {
  .clock-face {
    width: 150px;
    height: 150px;
  }

  .time-display {
    font-size: 32px;
  }

  .counter-display {
    font-size: 56px;
  }

  .logo h1 {
    font-size: 22px;
  }
}
