/* Pricedle — game UI. Layers on the V2 design tokens from blog-v2.css
   (--v2-brand, --v2-ink, --v2-card, --v2-hairline, fonts, radii).
   Mobile-first; the whole game lives in one centered column. */

.pd-main {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(var(--v2-nav-h, 56px) + 24px) 16px 64px;
  min-height: 70vh;
  font-family: var(--v2-sans, 'Inter', sans-serif);
  color: var(--v2-ink, #0f172a);
}

.pd-screen {
  background: var(--v2-card, #fff);
  border: 1px solid var(--v2-hairline, #e2e8f0);
  border-radius: var(--v2-r-3xl, 22px);
  padding: 28px 22px 32px;
  text-align: center;
  box-shadow: 0 8px 40px rgba(15, 23, 42, 0.06);
  animation: pd-fade 0.25s ease;
}

@keyframes pd-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.pd-logo-badge {
  width: 64px; height: 64px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  font-size: 32px;
  background: linear-gradient(135deg, var(--v2-brand, #1d4ed8), var(--v2-accent, #60a5fa));
  border-radius: 20px;
  box-shadow: var(--v2-glow, 0 0 60px rgba(29, 78, 216, 0.18));
}

.pd-title {
  font-family: var(--v2-display, 'Space Grotesk', sans-serif);
  font-size: clamp(24px, 5vw, 32px);
  margin: 8px 0 6px;
  letter-spacing: -0.02em;
}

.pd-eyebrow {
  font-family: var(--v2-mono, 'JetBrains Mono', monospace);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--v2-brand, #1d4ed8);
  margin: 0 0 8px;
}

.pd-muted { color: var(--v2-ink-soft, #64748b); font-size: 15px; line-height: 1.55; margin: 6px 0 18px; }
.pd-error { color: #dc2626; font-size: 14px; min-height: 18px; margin: 8px 0 0; }
.pd-finenote { color: var(--v2-ink-soft, #64748b); font-size: 12px; margin-top: 14px; }

/* ---- buttons ---- */

.pd-btn {
  font-family: var(--v2-sans, 'Inter', sans-serif);
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: var(--v2-r-lg, 12px);
  padding: 13px 22px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s;
}
.pd-btn:disabled { opacity: 0.55; cursor: default; }
.pd-btn-primary {
  background: var(--v2-brand, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.35);
}
.pd-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(29, 78, 216, 0.42); }
.pd-btn-big { width: 100%; padding: 16px 22px; font-size: 17px; margin-top: 8px; }

/* ---- registration ---- */

.pd-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.pd-input {
  font: inherit;
  padding: 13px 16px;
  border: 1.5px solid var(--v2-hairline, #e2e8f0);
  border-radius: var(--v2-r-lg, 12px);
  background: var(--v2-bg, #f8fafc);
  color: var(--v2-ink, #0f172a);
  outline: none;
  transition: border-color 0.15s;
}
.pd-input:focus { border-color: var(--v2-brand-soft, #3b82f6); background: #fff; }

/* ---- rules ---- */

.pd-rules {
  display: flex; flex-direction: column; gap: 6px;
  margin: 18px auto 22px;
  max-width: 300px;
  text-align: left;
  font-size: 14px;
  color: var(--v2-ink-soft, #64748b);
}
.pd-rule { display: flex; align-items: center; gap: 10px; }
.pd-rule-emoji { font-size: 16px; }

/* ---- 3-2-1 ---- */

.pd-precount-num {
  font-family: var(--v2-display, 'Space Grotesk', sans-serif);
  font-size: 96px;
  font-weight: 700;
  color: var(--v2-brand, #1d4ed8);
  line-height: 1.1;
  margin: 24px 0;
  animation: pd-pulse 0.8s ease infinite;
}
@keyframes pd-pulse {
  0% { transform: scale(1); opacity: 1; }
  70% { transform: scale(1.12); opacity: 0.9; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---- round ---- */

.pd-round-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.pd-round-head .pd-eyebrow { margin: 0; }

.pd-timer-ring {
  --pd-frac: 1;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    conic-gradient(var(--v2-brand, #1d4ed8) calc(var(--pd-frac) * 360deg), var(--v2-secondary, #f1f5f9) 0deg);
  transition: background 0.1s linear;
}
.pd-timer-ring::before {
  content: "";
  position: absolute;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--v2-card, #fff);
}
.pd-timer-ring { position: relative; }
.pd-timer-secs {
  position: relative;
  font-family: var(--v2-mono, 'JetBrains Mono', monospace);
  font-size: 18px;
  font-weight: 700;
  color: var(--v2-ink, #0f172a);
}
.pd-timer-danger { background: conic-gradient(#dc2626 calc(var(--pd-frac) * 360deg), var(--v2-secondary, #f1f5f9) 0deg) !important; }
.pd-timer-danger .pd-timer-secs { color: #dc2626; }

.pd-card {
  display: flex; align-items: center; gap: 16px;
  text-align: left;
  background: var(--v2-bg, #f8fafc);
  border: 1px solid var(--v2-hairline, #e2e8f0);
  border-radius: var(--v2-r-xl, 16px);
  padding: 16px;
  margin-bottom: 18px;
}
.pd-product-img {
  width: 110px; height: 110px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--v2-r-lg, 12px);
  border: 1px solid var(--v2-hairline, #e2e8f0);
  flex-shrink: 0;
  padding: 6px;
}
.pd-product-img-sm { width: 84px; height: 84px; }
.pd-product-info { min-width: 0; }
.pd-brand {
  font-family: var(--v2-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--v2-brand, #1d4ed8);
  margin: 0 0 4px;
}
.pd-product-title {
  font-family: var(--v2-sans, 'Inter', sans-serif);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
}

.pd-guess-form { display: flex; flex-direction: column; gap: 12px; }
.pd-input-wrap { position: relative; display: flex; align-items: center; }
.pd-currency-symbol {
  position: absolute; left: 16px;
  font-weight: 700; font-size: 18px;
  color: var(--v2-ink-soft, #64748b);
  pointer-events: none;
}
.pd-guess-input {
  width: 100%;
  padding-left: 42px;
  font-size: 22px;
  font-family: var(--v2-mono, 'JetBrains Mono', monospace);
  font-weight: 700;
  text-align: left;
}

/* ---- reveal ---- */

.pd-reveal-emoji { font-size: 52px; line-height: 1; margin-bottom: 4px; }
.pd-reveal-card { align-items: flex-start; }
.pd-price-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 14px; }
.pd-price-label { color: var(--v2-ink-soft, #64748b); }
.pd-price-actual { font-weight: 700; font-family: var(--v2-mono, 'JetBrains Mono', monospace); }
.pd-price-guess { font-weight: 600; color: var(--v2-ink-soft, #64748b); }
.pd-buy-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--v2-brand, #1d4ed8);
  text-decoration: none;
}
.pd-buy-link:hover { text-decoration: underline; }
.pd-running { font-family: var(--v2-mono, 'JetBrains Mono', monospace); font-size: 14px; color: var(--v2-ink-soft, #64748b); margin: 4px 0 14px; }

/* ---- done ---- */

.pd-final-score {
  font-family: var(--v2-display, 'Space Grotesk', sans-serif);
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--v2-brand, #1d4ed8), var(--v2-accent, #60a5fa));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 4px 0;
}
.pd-final-grid { font-size: 30px; letter-spacing: 4px; margin: 6px 0 4px; }
.pd-grid-strip { font-size: 22px; margin-bottom: 12px; }

.pd-share { margin: 22px 0 8px; }
.pd-share-label { font-size: 13px; font-weight: 600; color: var(--v2-ink-soft, #64748b); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.pd-share-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pd-share-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  transition: transform 0.12s ease, opacity 0.12s;
}
.pd-share-btn:hover { transform: translateY(-1px); opacity: 0.92; }
.pd-share-whatsapp { background: #25d366; }
.pd-share-x { background: #0f1419; }
.pd-share-telegram { background: #229ed9; }
.pd-share-generic { background: var(--v2-secondary, #f1f5f9); color: var(--v2-ink, #0f172a); border: 1px solid var(--v2-hairline, #e2e8f0); }

/* ---- leaderboard ---- */

.pd-leaderboard { margin-top: 26px; text-align: left; }
.pd-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }
.pd-tab {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--v2-hairline, #e2e8f0);
  background: var(--v2-card, #fff);
  color: var(--v2-ink-soft, #64748b);
  cursor: pointer;
}
.pd-tab-active { background: var(--v2-brand, #1d4ed8); color: #fff; border-color: var(--v2-brand, #1d4ed8); }

.pd-lb { display: flex; flex-direction: column; gap: 4px; }
.pd-lb-row {
  display: grid;
  grid-template-columns: 42px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--v2-r-md, 10px);
  font-size: 14px;
}
.pd-lb-row:nth-child(odd) { background: var(--v2-bg, #f8fafc); }
.pd-lb-me { outline: 1.5px solid var(--v2-brand-soft, #3b82f6); background: rgba(59, 130, 246, 0.07) !important; }
.pd-lb-rank { font-family: var(--v2-mono, 'JetBrains Mono', monospace); color: var(--v2-ink-soft, #64748b); font-size: 13px; }
.pd-lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-lb-grid { font-size: 12px; letter-spacing: 1px; color: var(--v2-ink-soft, #64748b); }
.pd-lb-score { font-family: var(--v2-mono, 'JetBrains Mono', monospace); font-weight: 700; }
.pd-lb-mine { text-align: center; font-size: 13px; font-weight: 600; color: var(--v2-brand, #1d4ed8); margin-top: 10px; }

/* ---- loading spinner ---- */

.pd-spinner {
  width: 36px; height: 36px;
  margin: 24px auto 12px;
  border: 3px solid var(--v2-secondary, #f1f5f9);
  border-top-color: var(--v2-brand, #1d4ed8);
  border-radius: 50%;
  animation: pd-spin 0.8s linear infinite;
}
@keyframes pd-spin { to { transform: rotate(360deg); } }

/* ---- desktop ---- */

@media (min-width: 768px) {
  .pd-main { padding-top: calc(var(--v2-nav-h, 56px) + 48px); }
  .pd-screen { padding: 40px 48px 44px; }
  .pd-product-img { width: 140px; height: 140px; }
  .pd-product-title { font-size: 17px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .pd-precount-num, .pd-spinner, .pd-screen { animation: none; }
}
