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

body {
  background: #020617;
  color: #fff;
  font-family: "Inter", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  text-align: center;
  overflow: hidden;
  user-select: none;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    #1e3a8a44 0%,
    transparent 70%
  );
  z-index: 0;
  pointer-events: none;
}

.back-home {
  position: fixed;
  top: 20px;
  left: 24px;
  font-size: 0.85rem;
  color: #475569;
  text-decoration: none;
  transition: color 0.2s;
  z-index: 10;
}

.back-home:hover {
  color: #fff;
}

.container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  max-width: 600px;
  width: 100%;
}

h1 {
  font-family: "Syne", sans-serif;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 900;
  margin: 0 0 6px;
  letter-spacing: -2px;
}

.subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 48px;
}

/* percentage */
.pct {
  font-family: "Syne", sans-serif;
  font-size: clamp(5rem, 20vw, 9rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -6px;
  margin-bottom: 6px;
  transition: color 0.3s;
  color: #f8fafc;
}

.pct.danger {
  color: #f87171;
}

.pct.winning {
  color: #10b981;
}

.pct-label {
  font-size: 0.8rem;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 32px;
}

/* progress bar */
.bar-wrap {
  width: 100%;
  height: 28px;
  background: rgba(30, 58, 138, 0.2);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 32px;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #3b82f6;
  transition:
    width 0.08s linear,
    background 0.3s;
  width: 0%;
}

.bar-fill.danger {
  background: #ef4444;
}

.bar-fill.winning {
  background: #10b981;
}

/* scroll instruction */
.scroll-hint {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 36px;
  min-height: 24px;
  transition: color 0.3s;
}

.scroll-hint.urgent {
  color: #fbbf24;
}

/* comment */
.comment {
  font-size: 1rem;
  color: #475569;
  min-height: 26px;
  font-style: italic;
  transition: opacity 0.25s;
}

/* win screen */
.win-screen {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s;
  backdrop-filter: blur(8px);
}

.win-screen.show {
  opacity: 1;
  pointer-events: all;
}

.win-emoji {
  font-size: 5rem;
  margin-bottom: 16px;
  animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
  to {
    transform: translateY(-12px);
  }
}

.win-title {
  font-family: "Syne", sans-serif;
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  margin: 0 0 10px;
  color: #10b981;
}

.win-sub {
  color: #64748b;
  font-size: 1rem;
  margin-bottom: 28px;
}

.win-btn {
  padding: 14px 36px;
  background: rgba(16, 185, 129, 0.2);
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  border-radius: 999px;
  color: #fff;
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
}

.win-btn:hover {
  background: rgba(16, 185, 129, 0.35);
}

.win-btn:active {
  transform: scale(0.97);
}
