/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --accent: hsl(var(--hue-1), 55%, 48%);
  --accent-light: hsl(var(--hue-1), 45%, 95%);
  --accent-hover: hsl(var(--hue-1), 55%, 42%);
  --text: #111;
  --text-secondary: #555;
  --text-muted: #999;
  --bg: #fff;
  --surface: #f7f7f8;
  --border: #e5e5e5;
  --radius: 12px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

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

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.auction-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 2.5rem 0 1.25rem;
  animation: fadeUp 0.5s ease-out;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.3rem 0.85rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.domain-name {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
  word-break: break-all;
}

.hero-tagline {
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* ─── Bid Banner ─── */
.bid-banner {
  animation: fadeUp 0.5s ease-out 0.05s both;
}

.bid-banner-inner {
  background: var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  color: white;
}

.bid-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.8;
  margin-bottom: 0.3rem;
}

.bid-amount {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.bid-count {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  opacity: 0.75;
}

/* ─── Section Title ─── */
.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Countdown ─── */
.countdown-section {
  padding: 1.5rem 0;
  animation: fadeUp 0.5s ease-out 0.1s both;
}

.countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

.countdown-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  text-align: center;
  min-width: 58px;
}

.countdown-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.countdown-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-top: 0.1rem;
}

.countdown-separator {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ddd;
}

/* ─── Bid Form ─── */
.bid-form-section {
  padding: 1.25rem 0;
  animation: fadeUp 0.5s ease-out 0.15s both;
}

.bid-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.form-group input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px; /* prevent iOS zoom */
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  background: white;
  color: var(--text);
}

.form-group input::placeholder {
  color: #bbb;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px hsla(var(--hue-1), 55%, 48%, 0.1);
}

.bid-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.bid-input-wrapper input {
  padding-left: 2rem;
  padding-right: 2.2rem;
  font-size: 1.15rem;
  font-weight: 700;
}


.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.bid-button {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.15s;
  margin-top: 0.25rem;
  -webkit-appearance: none;
}

.bid-button:hover {
  background: var(--accent-hover);
}

.bid-button:active {
  transform: scale(0.99);
}

.bid-button-icon {
  font-size: 1.2rem;
  transition: transform 0.15s;
}

.bid-button:hover .bid-button-icon {
  transform: translateX(3px);
}

.bid-message {
  text-align: center;
  margin-top: 0.75rem;
  padding: 0.7rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.85rem;
  display: none;
}

.bid-message.success {
  display: block;
  background: #ecfdf5;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.bid-message.error {
  display: block;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* ─── Bid History ─── */
.bid-history-section {
  padding: 1.25rem 0;
  animation: fadeUp 0.5s ease-out 0.2s both;
}

.bid-history {
  max-height: 340px;
  overflow-y: auto;
}

.bid-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  margin-bottom: 0.3rem;
  border: 1px solid transparent;
  animation: slide-in 0.25s ease-out both;
}

.bid-highest {
  background: var(--accent-light);
  border-color: hsla(var(--hue-1), 50%, 80%, 0.5);
}

.bid-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.bid-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.bid-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bid-item-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bid-item-time {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.bid-item-amount {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.no-bids {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* ─── Stats ─── */
.stats-section {
  padding: 1.25rem 0;
  animation: fadeUp 0.5s ease-out 0.25s both;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 0.75rem;
  text-align: center;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.stat-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 0.15rem;
  letter-spacing: 0.06em;
}

/* ─── Trust ─── */
.trust-section {
  padding: 1.25rem 0;
  animation: fadeUp 0.5s ease-out 0.3s both;
}

.trust-grid {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.trust-icon {
  font-size: 1rem;
}

.trust-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ─── How It Works ─── */
.how-it-works {
  padding: 1.5rem 0;
  animation: fadeUp 0.5s ease-out 0.35s both;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
}

.step-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.step-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ─── Footer ─── */
.auction-footer {
  text-align: center;
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.auction-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auction-footer a:hover {
  text-decoration: underline;
}

/* ─── Confetti Canvas ─── */
#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ═══════════════════════════════════
   Desktop overrides (min-width: 640px)
   ═══════════════════════════════════ */
@media (min-width: 640px) {
  .auction-page {
    padding: 0 1.25rem 2rem;
  }

  .hero {
    padding: 3.5rem 1rem 1.5rem;
  }

  .hero-badge {
    padding: 0.35rem 1rem;
    font-size: 0.72rem;
    margin-bottom: 1.25rem;
  }

  .domain-name {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    word-break: normal;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .bid-banner-inner {
    padding: 2rem;
  }

  .bid-amount {
    font-size: clamp(3rem, 8vw, 4rem);
  }

  .countdown {
    gap: 0.5rem;
  }

  .countdown-item {
    padding: 0.9rem 1.1rem;
    min-width: 68px;
  }

  .countdown-value {
    font-size: 1.8rem;
  }

  .countdown-separator {
    font-size: 1.5rem;
  }

  .bid-form {
    padding: 1.75rem;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .bid-history {
    max-height: 380px;
  }

  .bid-item {
    padding: 0.85rem 1rem;
  }

  .bid-item-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.88rem;
  }

  .bid-item-name {
    font-size: 0.88rem;
  }

  .bid-item-amount {
    font-size: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .step-card {
    padding: 1.5rem 1.25rem;
  }
}
