*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --primary: 142.1 76.2% 36.3%;
  --primary-foreground: 355.7 100% 97.3%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 210 90% 60%;
  --accent-foreground: 0 0% 100%;
  --border: 240 3.7% 15.9%;
  --radius: 0.75rem;
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
}

html.dark body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

html.light {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --secondary: 240 4.8% 95.9%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
}

html.light body {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(34, 197, 94, 0.18), transparent 60%),
    radial-gradient(circle at bottom, rgba(59, 130, 246, 0.18), transparent 60%),
    hsl(var(--background));
  color: hsl(var(--foreground));
}

.hidden {
  display: none !important;
}

.text-accent {
  color: hsl(var(--primary));
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.logo-tik {
  color: hsl(var(--foreground));
}
.logo-spy {
  color: hsl(var(--primary));
}

.theme-toggle {
  display: flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: hsl(var(--secondary));
  color: hsl(var(--primary));
  border: none;
  cursor: pointer;
  transition: 0.3s;
}
.theme-toggle:hover {
  box-shadow: 0 0 12px hsla(var(--primary), 0.6);
}

/* Main Layout */
.main {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 2.5rem;
}
.container {
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Hero */
.hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.title {
  font-size: 2.25rem;
  font-weight: 700;
}
.subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 1.05rem;
}

/* Inputs */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.input-wrapper {
  position: relative;
}
.username-input {
  width: 100%;
  border-radius: 0.75rem;
  background-color: hsl(var(--secondary));
  padding: 1rem 3rem 1rem 1.25rem;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  outline: none;
  transition: 0.25s;
}
.username-input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 1px hsl(var(--primary));
}
.input-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
}

.connect-btn {
  width: 100%;
  border-radius: 0.75rem;
  padding: 1rem;
  font-weight: 600;
  color: hsl(var(--primary-foreground));
  border: none;
  cursor: pointer;
  background: linear-gradient(
    90deg,
    hsl(var(--primary)),
    hsla(var(--primary), 0.85),
    hsl(var(--primary))
  );
  background-size: 200%;
  animation: btnGlow 3s infinite linear;
  transition: transform 0.2s, box-shadow 0.2s;
}
.connect-btn:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 25px hsla(var(--primary), 0.4);
}
.connect-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Features */
.features-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.connected-info {
  text-align: center;
}
.username-highlight {
  color: hsl(var(--primary)) !important;
  font-weight: 600;
}
.features-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.feature-card {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--primary));
  background-color: hsl(var(--card));
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.25s;
}
.feature-card:hover {
  transform: scale(1.02);
  box-shadow: 0 0 14px hsla(var(--primary), 0.5);
}
.feature-icon-wrapper {
  display: flex;
  width: 3rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  flex-shrink: 0;
  transition: 0.3s;
}
.feature-card:hover .feature-icon-wrapper {
  box-shadow: 0 0 12px hsla(var(--primary), 0.6);
}
.icon-primary {
  background-color: hsla(var(--primary), 0.2);
  color: hsl(var(--primary));
}
.icon-accent {
  background-color: hsla(var(--accent), 0.2);
  color: hsl(var(--accent));
}
.feature-name {
  font-weight: 600;
}
.feature-description {
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
}

/* Selected Feature */
.feature-card.selected {
  border: 2px solid hsl(var(--primary));
  background-color: hsla(var(--primary), 0.12);
  box-shadow:
    0 0 18px hsla(var(--primary), 0.65),
    inset 0 0 10px hsla(var(--primary), 0.35);
  transform: scale(1.03);
  animation: greenShine 1.6s ease-in-out infinite;
}
@keyframes greenShine {
  0% {
    box-shadow: 0 0 12px hsla(var(--primary), 0.45);
  }
  50% {
    box-shadow: 0 0 28px hsla(var(--primary), 0.9);
  }
  100% {
    box-shadow: 0 0 12px hsla(var(--primary), 0.45);
  }
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: hsl(var(--background));
  z-index: 40;
}

.progress-circle-container {
  position: relative;
  width: 7rem;
  height: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.progress-svg {
  width: 7rem;
  height: 7rem;
  transform: rotate(-90deg);
}
.progress-bg {
  fill: none;
  stroke: hsl(var(--secondary));
  stroke-width: 6;
}
.progress-ring {
  fill: none;
  stroke: hsl(var(--primary));
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 0.15s ease-out;
}
.progress-center {
  position: absolute;
  font-size: 1.5rem;
  font-weight: 700;
  color: hsl(var(--primary));
}
.loading-text {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: hsl(var(--muted-foreground));
}
.progress-bar-container {
  width: 16rem;
  height: 0.5rem;
  background-color: hsl(var(--secondary));
  border-radius: 9999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background-color: hsl(var(--primary));
  width: 0%;
  transition: width 0.15s;
}

/* Verification Screen */
.verification-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.blur-bg {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(12px);
  background: rgba(0, 0, 0, 0.45);
}
.verify-box {
  position: relative;
  z-index: 10;
  border-radius: 1rem;
  width: 90%;
  max-width: 28rem;
  padding: 2rem;
  background: linear-gradient(
      to bottom right,
      hsla(var(--primary), 0.12),
      hsla(var(--primary), 0.03)
    ),
    hsl(var(--card));
  border: 2px solid hsla(var(--primary), 0.6);
  box-shadow: 0 0 25px hsla(var(--primary), 0.6);
  text-align: center;
}
.verify-header {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.verify-warning-icon {
  width: 2.2rem;
  height: 2.2rem;
  color: #facc15;
}
.pulse-warning {
  animation: pulseWarn 1.5s infinite;
}
@keyframes pulseWarn {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}
.verify-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.verify-text {
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
}
.badge-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.badge {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.7rem;
  border-radius: 9999px;
  background-color: hsl(var(--secondary));
  font-size: 0.85rem;
}
.timer-box {
  margin: 1rem 0;
  font-size: 1rem;
  font-weight: 500;
}
.timer-box span {
  color: hsl(var(--primary));
  font-size: 1.4rem;
  font-weight: 700;
}
.verify-btn {
  display: block;
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(
    90deg,
    hsl(var(--primary)),
    hsla(var(--primary), 0.85),
    hsl(var(--primary))
  );
  background-size: 200%;
  animation: btnGlow 3s infinite linear;
  color: hsl(var(--primary-foreground));
  border-radius: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.verify-btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 25px hsla(var(--primary), 0.5);
}
.restart-btn {
  display: block;
  width: 100%;
  padding: 0.9rem;
  background-color: #ef4444;
  color: white;
  border-radius: 0.75rem;
  font-weight: 600;
  margin-top: 0.75rem;
  border: none;
  cursor: pointer;
  transition: 0.2s;
}
.restart-btn:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.5);
}

.shake {
  animation: shakeBox 0.5s ease-in-out;
}
@keyframes shakeBox {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-10px);
  }
  40% {
    transform: translateX(10px);
  }
  60% {
    transform: translateX(-10px);
  }
  80% {
    transform: translateX(10px);
  }
  100% {
    transform: translateX(0);
  }
}

/* Spinner for connect button */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid hsla(var(--primary-foreground), 0.3);
  border-top-color: hsl(var(--primary-foreground));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Fade-in animation */
.animate-fade-in-up {
  animation: fadeInUp 0.4s ease-out both;
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button gradient animation */
@keyframes btnGlow {
  0% {
    background-position: 0%;
  }
  100% {
    background-position: 200%;
  }
}

/* --- FORCE REAL BUTTON LOOK FOR CONNECT + VERIFY --- */
.connect-btn,
.verify-btn,
.restart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: none;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

/* Connect button style */
.connect-btn {
  background: linear-gradient(90deg, #22c55e, #16a34a, #22c55e);
  color: #f9fafb;
}

/* Verify button style */
.verify-btn {
  background: linear-gradient(90deg, #22c55e, #16a34a, #22c55e);
  color: #f9fafb;
}

/* Restart button style */
.restart-btn {
  background: #ef4444;
  color: #f9fafb;
}
