/* ===== Money Counter — $TRRR ===== */

:root {
  --bg: #071b0f;
  --bg-2: #0d2a17;
  --green: #33e07a;
  --green-dim: #1e8a4c;
  --green-bright: #7dffb0;
  --display-bg: #04150a;
  --paper: #eafff0;
  --ink: #06210f;
  --accent-gold: #f4d35e;
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: 'Courier New', ui-monospace, Menlo, monospace;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse at 50% -10%, #123a1f 0%, transparent 55%),
    repeating-linear-gradient(0deg, rgba(51,224,122,0.03) 0px, rgba(51,224,122,0.03) 1px, transparent 1px, transparent 3px),
    var(--bg);
  min-height: 100vh;
}

h1, h2 {
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

a { color: inherit; }

/* ---------- falling bills background ---------- */
.bills-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bill {
  position: absolute;
  top: -60px;
  width: 46px;
  height: 22px;
  background: linear-gradient(135deg, #2f9e57, #1c6b39);
  border: 1px solid rgba(234,255,240,0.5);
  border-radius: 2px;
  opacity: 0.35;
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.bill::after {
  content: "$";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  color: rgba(234,255,240,0.6);
}

@keyframes fall {
  0%   { transform: translateY(-10vh) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(360deg); }
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(7, 27, 15, 0.9);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid var(--green-dim);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  font-weight: bold;
  font-size: 1.3rem;
  color: var(--green-bright);
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(125,255,176,0.5);
}

.brand-dollar { color: var(--accent-gold); }

.ca-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--display-bg);
  border: 1px solid var(--green-dim);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  flex: 1 1 260px;
  max-width: 420px;
}

.ca-label { color: var(--green-dim); }
.ca-value {
  color: var(--green-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.copy-btn {
  background: var(--green-dim);
  color: var(--ink);
  border: none;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
}
.copy-btn:hover { background: var(--green-bright); }

.sound-toggle {
  background: var(--display-bg);
  border: 1px solid var(--green-dim);
  color: var(--green-bright);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.sound-toggle[aria-pressed="true"] {
  background: var(--green-dim);
  color: var(--ink);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 56px 20px 24px;
  text-align: center;
}

.hero-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(51,224,122,0.25), transparent 70%);
  filter: blur(10px);
  z-index: -1;
}

.hero-title {
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  color: var(--paper);
  margin: 0 0 10px;
  line-height: 1.15;
}

.trrr {
  display: block;
  color: var(--green-bright);
  font-size: clamp(2rem, 8vw, 4rem);
  text-shadow: 0 0 20px rgba(125,255,176,0.6);
  animation: trrr-shake 0.15s infinite;
  animation-play-state: paused;
}

.trrr.active { animation-play-state: running; }

@keyframes trrr-shake {
  0%   { transform: translate(0,0) rotate(0deg); }
  25%  { transform: translate(-1px,1px) rotate(-0.5deg); }
  50%  { transform: translate(1px,-1px) rotate(0.5deg); }
  75%  { transform: translate(-1px,-1px) rotate(-0.3deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}

.hero-sub {
  color: #b9e8c8;
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto 28px;
}

/* ---------- machine stage ---------- */
.machine-stage {
  position: relative;
  margin: 0 auto 30px;
  max-width: 560px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.machine-wrap {
  position: relative;
  z-index: 2;
  animation: bob 2.4s ease-in-out infinite;
}

.machine-wrap.counting { animation-duration: 0.5s; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(-0.6deg); }
}

.machine-img {
  width: 440px;
  max-width: 88vw;
  display: block;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
}

.feed-bills, .out-bills {
  position: absolute;
  left: 50%;
  width: 280px;
  height: 160px;
  pointer-events: none;
  z-index: 1;
}
.feed-bills { top: -50px; transform: translateX(-50%); }
.out-bills  { bottom: -20px; transform: translateX(-50%); }

.mini-bill {
  position: absolute;
  width: 34px;
  height: 16px;
  background: linear-gradient(135deg, #3fb96a, #1c6b39);
  border: 1px solid var(--paper);
  border-radius: 2px;
  left: 50%;
  opacity: 0;
}

.feed-bills .mini-bill { animation: feed-drop 0.9s linear infinite; }
.out-bills .mini-bill  { animation: spit-out 0.9s ease-out infinite; }

@keyframes feed-drop {
  0%   { opacity: 0; transform: translate(-50%, -40px) rotate(-6deg); }
  15%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 90px) rotate(4deg); }
}

@keyframes spit-out {
  0%   { opacity: 0; transform: translate(-50%, -10px) rotate(0deg); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 20px)), 110px) rotate(var(--dr, 20deg)); }
}

.display-panel {
  position: relative;
  z-index: 3;
  margin-top: -18px;
  background: var(--display-bg);
  border: 2px solid var(--green-dim);
  border-radius: 10px;
  padding: 12px 20px;
  display: flex;
  gap: 24px;
  box-shadow: 0 0 24px rgba(51,224,122,0.25) inset, 0 8px 20px rgba(0,0,0,0.4);
}

.display-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.display-label {
  font-size: 0.65rem;
  color: var(--green-dim);
  letter-spacing: 0.1em;
}

.display-num {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--green-bright);
  text-shadow: 0 0 10px rgba(125,255,176,0.7);
  font-variant-numeric: tabular-nums;
}

/* ---------- CTA ---------- */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-buy {
  background: var(--green-bright);
  color: var(--ink);
  box-shadow: 0 0 20px rgba(125,255,176,0.5);
}
.btn-buy:hover { background: var(--paper); }

.btn-ghost {
  background: transparent;
  border-color: var(--green-dim);
  color: var(--green-bright);
}
.btn-ghost:hover { border-color: var(--green-bright); }

.cta-note {
  text-align: center;
  color: var(--green-dim);
  font-size: 0.75rem;
  margin: 4px 0 0;
}

/* ---------- lore ---------- */
.lore {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 40px auto;
  padding: 28px 22px;
  background: rgba(13, 42, 23, 0.55);
  border: 1px solid var(--green-dim);
  border-radius: 14px;
}

.lore h2 {
  color: var(--green-bright);
  font-size: 1.1rem;
  margin-top: 0;
  text-align: center;
}

.lore p {
  color: #d6f5e1;
  line-height: 1.7;
  font-size: 0.92rem;
}

.trrr-inline {
  color: var(--green-bright);
  font-weight: bold;
}

/* ---------- stats ---------- */
.stats {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.stats h2 {
  text-align: center;
  color: var(--green-bright);
  font-size: 1.1rem;
}

.stats-note {
  display: block;
  color: var(--green-dim);
  font-size: 0.65rem;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.stat-card {
  background: var(--display-bg);
  border: 1px solid var(--green-dim);
  border-radius: 10px;
  padding: 18px 14px;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  color: var(--green-bright);
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: #9fd6b4;
  font-size: 0.72rem;
  margin-top: 4px;
}

/* ---------- how to ---------- */
.howto {
  max-width: 700px;
  margin: 40px auto;
  padding: 0 20px 20px;
  position: relative;
  z-index: 1;
}

.howto h2 {
  text-align: center;
  color: var(--green-bright);
  font-size: 1.1rem;
}

.howto-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.howto-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(13, 42, 23, 0.4);
  border: 1px solid var(--green-dim);
  border-radius: 10px;
  padding: 14px 16px;
}

.howto-step {
  color: var(--accent-gold);
  font-weight: bold;
  font-size: 1.1rem;
  min-width: 32px;
}

.howto-list strong {
  color: var(--green-bright);
  display: block;
  margin-bottom: 2px;
}

.howto-list div {
  color: #d6f5e1;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ---------- footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 30px 20px 50px;
  color: var(--green-dim);
  font-size: 0.7rem;
  line-height: 1.6;
}

.footer-trrr {
  margin-top: 10px;
  color: var(--green-bright);
  font-weight: bold;
  letter-spacing: 0.2em;
}

@media (max-width: 480px) {
  .ca-pill { order: 3; max-width: 100%; }
}
