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

:root {
  --btc-orange: #f7931a;
  --btc-orange-hover: #ffa740;
  --tn-navy: hsl(225 60% 30%);
  --tn-red: hsl(4 71% 47%);
  --bg: hsl(0 0% 100%);
  --bg-card: hsl(0 0% 100%);
  --bg-muted: hsl(210 16% 96%);
  --text-primary: hsl(223 10% 10%);
  --text-secondary: hsl(215 16% 35%);
  --text-dim: hsl(215 16% 55%);
  --green: hsl(158 60% 36%);
  --border: hsl(210 16% 90%);
  --radius: 8px;
  --radius-md: 4px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

.container {
  max-width: 520px;
  width: 100%;
  padding: 2rem 1.5rem;
  text-align: center;
}

/* Header */
.header-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  display: block;
  opacity: 0.85;
}

.header h1 {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.btc-orange {
  color: var(--btc-orange);
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card .card-content {
  width: 100%;
  height: 100%;
}

.card.revealed {
  border-color: var(--btc-orange);
  box-shadow: 0 2px 12px rgba(247, 147, 26, 0.1);
}

.intro-state {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.intro-text {
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1.7;
}

/* Card inner layout */
.card-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  gap: 0;
}

.card-inner .card-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

/* Revealed card content */
.item-name {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.2;
}

.item-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.item-why {
  font-size: 0.82rem;
  color: var(--tn-red);
  font-style: italic;
  opacity: 0.9;
}

.item-source {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
}

.item-source a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
}

.item-source a:hover {
  color: var(--btc-orange);
  text-decoration-color: var(--btc-orange);
}

/* Stats row */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

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

.stat-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
}

.stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Result */
.result {
  margin-bottom: 1rem;
  padding: 1rem 0;
}

.worth-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.worth-amount {
  font-size: 3rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.return-label {
  font-size: 1.5rem;
  color: var(--btc-orange);
  font-weight: 600;
  margin-top: 0.25rem;
  min-height: 1.4em;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.return-label.visible {
  opacity: 1;
}

/* Button */
.button-area {
  margin-bottom: 1.5rem;
}

.sub-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.sub-text.visible {
  opacity: 1;
}

.sub-text:empty::before {
  content: '\00a0';
}

.shuffle-btn {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: 'Public Sans', 'Inter', sans-serif;
  background: var(--btc-orange);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.shuffle-btn:hover {
  background: var(--btc-orange-hover);
  box-shadow: 0 2px 12px rgba(247, 147, 26, 0.25);
}

.shuffle-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shuffle-btn.reactivate {
  animation: btnFadeIn 0.4s ease forwards;
}

@keyframes btnFadeIn {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* Progress bar */
.progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--btc-orange);
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 2px;
}

/* Footer */
footer {
  padding-top: 1rem;
}

footer p {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--btc-orange);
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  color: var(--btc-orange-hover);
  text-decoration: underline;
}

.disclaimer {
  font-size: 0.65rem !important;
  opacity: 0.6;
}

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

.fade-in-up {
  animation: fadeInUp 0.35s ease forwards;
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .card {
    height: 320px;
  }

  .worth-amount {
    font-size: 2.2rem;
  }

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