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

:root {
  --bg: #050508;
  --surface: rgba(255, 255, 255, 0.03);
  --border: rgba(255, 255, 255, 0.06);
  --text-primary: #e8e8ed;
  --text-secondary: rgba(255, 255, 255, 0.35);
  --text-tertiary: rgba(255, 255, 255, 0.18);
  --accent: #8b5cf6;
  --accent-dim: rgba(139, 92, 246, 0.12);
  --accent-glow: rgba(139, 92, 246, 0.25);
  --white-glow: rgba(255, 255, 255, 0.06);
  --font-body: "Inter", -apple-system, sans-serif;
  --font-mono: "Space Mono", monospace;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

#app * {
  pointer-events: auto;
}

#top-bar {
  display: flex;
  justify-content: center;
  padding: 28px 32px;
  z-index: 10;
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
}

#pre-shift {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
}

#counter-section {
  text-align: center;
}

#counter-label {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-transform: lowercase;
}

#counter {
  position: relative;
}

#counter-value {
  font-family: var(--font-mono);
  font-size: clamp(56px, 14vw, 160px);
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--text-primary);
  line-height: 1;
  opacity: 0.9;
}

#button-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#shift-btn {
  position: relative;
  padding: 18px 52px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  text-transform: lowercase;
}

#shift-btn::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--accent-dim), transparent, var(--accent-dim));
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: -1;
}

#shift-btn:hover {
  border-color: rgba(139, 92, 246, 0.3);
  color: white;
  box-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(139, 92, 246, 0.08);
  transform: scale(1.02);
}

#shift-btn:hover::before {
  opacity: 1;
}

#shift-btn:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}

.hidden {
  display: none !important;
}

#post-shift {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#ceremony {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.ceremony-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.ceremony-text {
  font-size: 22px;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: 1px;
  line-height: 1.6;
}

.ceremony-label {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 4px;
  color: var(--text-secondary);
  text-transform: lowercase;
  margin-bottom: 8px;
}

.ceremony-number {
  font-family: var(--font-mono);
  font-size: clamp(48px, 12vw, 96px);
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
}

.fade-text {
  opacity: 0;
  transform: translateY(8px);
  animation: textReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes textReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#final-badge {
  text-align: center;
  padding: 48px 64px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  backdrop-filter: blur(40px);
  opacity: 0;
  transform: scale(0.95);
  animation: badgeReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes badgeReveal {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.badge-top {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.badge-main {
  font-family: var(--font-mono);
  font-size: clamp(40px, 10vw, 72px);
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
}

.badge-divider {
  width: 40px;
  height: 1px;
  background: var(--border);
  margin: 20px auto;
}

.badge-bottom {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--text-secondary);
  text-transform: lowercase;
}

#post-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  opacity: 0;
  animation: textReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}

#post-counter-value {
  font-family: var(--font-mono);
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
  opacity: 0.9;
}

.post-counter-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--text-secondary);
  text-transform: lowercase;
}

#share-btn {
  margin-top: 32px;
  padding: 14px 36px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 100px;
  cursor: pointer;
  text-transform: lowercase;
  transition: all 0.4s ease;
  opacity: 0;
  animation: textReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
}

#share-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--surface);
}

#bottom-bar {
  display: flex;
  justify-content: center;
  padding: 20px 32px;
  z-index: 10;
}

.credit-link {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.credit-link:hover {
  color: var(--text-secondary);
}

#flash-overlay {
  position: fixed;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  mix-blend-mode: screen;
}

#flash-overlay.flash {
  animation: flashBang 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes flashBang {
  0% {
    opacity: 0.4;
  }

  100% {
    opacity: 0;
  }
}

.screen-shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(-3px, -2px);
  }

  40% {
    transform: translate(3px, 1px);
  }

  60% {
    transform: translate(-2px, 3px);
  }

  80% {
    transform: translate(2px, -1px);
  }
}

@media (max-width: 600px) {
  #top-bar {
    padding: 20px 20px;
  }

  .logo-text {
    font-size: 9px;
  }

  #shift-btn {
    padding: 16px 40px;
    font-size: 13px;
  }

  #final-badge {
    padding: 36px 40px;
  }

  #pre-shift {
    gap: 44px;
  }
}