:root {
  /* M3 Aqua Theme Palette & Dark Mode Gradients */
  --color-bg-primary: #041822;
  --color-bg-secondary: #072535;
  --color-aqua-primary: #00e5ff;
  --color-aqua-glow: rgba(0, 229, 255, 0.4);
  --color-teal-accent: #00b4d8;
  --color-deep-ocean: #012a4a;
  --color-surface-glass: rgba(7, 37, 53, 0.8);
  --color-border-glass: rgba(0, 229, 255, 0.25);
  --color-text-primary: #ffffff;
  --color-text-secondary: #a9d6e5;
  --color-success-bg: rgba(46, 213, 115, 0.15);
  --color-success-border: #2ed573;
  --color-error-bg: rgba(255, 71, 87, 0.15);
  --color-error-border: #ff4757;
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 229, 255, 0.15);
  --shadow-btn: 0 4px 20px rgba(0, 229, 255, 0.35);
}

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

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at 50% 0%, var(--color-bg-secondary) 0%, var(--color-bg-primary) 75%);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  padding: 2rem 1rem;
}

/* Animated Water Wave Background */
.waves-background {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 25vh;
  min-height: 140px;
  max-height: 250px;
  z-index: -1;
  pointer-events: none;
}

.waves {
  width: 100%;
  height: 100%;
}

.wave1 { fill: rgba(0, 180, 216, 0.25); animation: move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite; }
.wave2 { fill: rgba(0, 229, 255, 0.2); animation: move-forever 18s cubic-bezier(.55,.5,.45,.5) infinite -5s; }
.wave3 { fill: rgba(1, 42, 74, 0.4); animation: move-forever 13s cubic-bezier(.55,.5,.45,.5) infinite -2s; }
.wave4 { fill: rgba(4, 24, 34, 0.8); animation: move-forever 8s cubic-bezier(.55,.5,.45,.5) infinite -3s; }

@keyframes move-forever {
  0% { transform: translate3d(-90px, 0, 0); }
  100% { transform: translate3d(85px, 0, 0); }
}

/* Container & Glass Card */
.container {
  width: 100%;
  max-width: 600px;
  margin: auto;
  z-index: 10;
}

.glass-card {
  background: var(--color-surface-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--color-border-glass);
  border-radius: 28px;
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: cardAppear 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardAppear {
  0% { opacity: 0; transform: translateY(20px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.card-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
}

.logo-wrapper {
  width: 64px;
  height: 64px;
  background: radial-gradient(circle, var(--color-aqua-primary) 0%, var(--color-teal-accent) 100%);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 1rem;
  box-shadow: 0 0 25px var(--color-aqua-glow);
  animation: floatDrop 3s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo-wrapper:hover {
  animation-play-state: paused;
  box-shadow: 0 0 35px var(--color-aqua-primary);
  transform: scale(1.08);
}

.water-drop-icon {
  font-size: 2rem;
}

@keyframes floatDrop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

h1 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, var(--color-aqua-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-block;
  background: rgba(0, 229, 255, 0.15);
  color: var(--color-aqua-primary);
  border: 1px solid rgba(0, 229, 255, 0.4);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.8rem;
  border-radius: 50px;
}

.subtitle {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
  margin-bottom: 2rem;
}

.subtitle strong {
  color: #fff;
}

/* Features List */
.features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.25rem;
}

.features-list li {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 0.9rem 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.features-list li:hover {
  transform: translateX(4px);
  border-color: rgba(0, 229, 255, 0.3);
}

.feature-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.feature-text strong {
  display: block;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.15rem;
}

.feature-text span {
  display: block;
  font-size: 0.825rem;
  color: var(--color-text-secondary);
}

/* Live Gift Pool Counter */
.pool-counter-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--color-aqua-primary);
  border-radius: 20px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 2.25rem;
  box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.15), 0 8px 30px rgba(0, 0, 0, 0.4);
  width: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pool-counter-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 25px rgba(0, 229, 255, 0.25), 0 10px 35px rgba(0, 0, 0, 0.5);
}

.counter-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.counter-stats {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.numbers {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.count-glow {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 15px var(--color-aqua-primary);
  line-height: 1;
}

.count-slash {
  font-size: 1.5rem;
  color: var(--color-text-secondary);
  opacity: 0.6;
}

.count-total {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.count-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-aqua-primary);
  margin-left: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pool-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
  background: rgba(46, 213, 115, 0.15);
  border: 1px solid #2ed573;
  color: #2ed573;
  letter-spacing: 0.04em;
}

.pool-badge.exhausted {
  background: rgba(255, 71, 87, 0.15);
  border: 1px solid #ff4757;
  color: #ff4757;
}

.progress-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-teal-accent) 0%, var(--color-aqua-primary) 100%);
  border-radius: 50px;
  box-shadow: 0 0 12px var(--color-aqua-primary);
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Action Section & Turnstile */
.action-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.turnstile-wrapper {
  min-height: 65px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn {
  width: 100%;
  padding: 1.1rem;
  border-radius: 16px;
  border: none;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-aqua-primary) 0%, var(--color-teal-accent) 100%);
  color: #012a4a;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 229, 255, 0.55);
}

.btn-primary:disabled {
  background: #2a4150;
  color: #6a8292;
  box-shadow: none;
  cursor: not-allowed;
}

.security-text {
  font-size: 0.775rem;
  color: var(--color-text-secondary);
  text-align: center;
  opacity: 0.85;
}

/* Result Section */
.result-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  animation: fadeIn 0.5s ease;
  width: 100%;
}

.status-banner {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.instructions-text {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  text-align: center;
}

.instructions-text strong {
  color: #2ed573;
}

.field-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-left: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #02121a;
  border: 1px solid var(--color-aqua-primary);
  border-radius: 14px;
  padding: 0.75rem 1.1rem;
  width: 100%;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.url-box {
  background: rgba(1, 42, 74, 0.4);
  border: 1px dashed var(--color-teal-accent);
}

.code-display code {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
  word-break: break-all;
}

.url-box span {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-aqua-primary);
  word-break: break-all;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy {
  background: rgba(0, 229, 255, 0.15);
  color: var(--color-aqua-primary);
  border: 1px solid var(--color-aqua-primary);
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.825rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--color-aqua-primary);
  color: #012a4a;
}

.btn-action {
  background: linear-gradient(135deg, #2ed573 0%, #20bf55 100%);
  color: #011c10;
  box-shadow: 0 4px 20px rgba(46, 213, 115, 0.4);
  font-size: 1.15rem;
  padding: 1.25rem;
  margin-bottom: 0.5rem;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(46, 213, 115, 0.6);
  background: linear-gradient(135deg, #35de7a 0%, #22cb5c 100%);
}

/* Store link section */
.store-link-section {
  text-align: center;
  margin-top: 0.5rem;
  padding: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

.store-link-section p {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.35rem;
}

.external-store-link {
  color: var(--color-aqua-primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s, text-decoration 0.2s;
}

.external-store-link:hover {
  color: #fff;
  text-decoration: underline;
}

/* Manual Instructions Accordion */
.manual-instructions {
  width: 100%;
  margin-top: 0.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 0.8rem 1.2rem;
}

.manual-instructions details {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.manual-instructions summary {
  font-weight: 600;
  outline: none;
  transition: color 0.2s;
}

.manual-instructions summary:hover {
  color: #fff;
}

.manual-instructions ol {
  margin-top: 0.75rem;
  margin-left: 1.5rem;
  line-height: 1.6;
}

/* Error Section */
.error-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.error-box {
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  padding: 1.25rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #fff;
  width: 100%;
}

.error-icon {
  font-size: 1.75rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Utility Hidden & Toast */
.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  bottom: 2rem;
  background: var(--color-aqua-primary);
  color: #012a4a;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

@keyframes slideUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Footer */
.footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.825rem;
  color: var(--color-text-secondary);
  opacity: 0.7;
  z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 500px) {
  .glass-card {
    padding: 1.75rem 1.25rem;
  }
  
  h1 {
    font-size: 1.45rem;
  }
  
  .code-display {
    flex-direction: column;
    gap: 0.65rem;
    text-align: center;
  }

  .url-box span {
    max-width: 100%;
    white-space: normal;
    word-break: break-all;
    font-size: 0.78rem;
  }
  
  .btn-copy {
    width: 100%;
  }
}
