/* ==========================================================================
   HOODTAX design tokens
   Reference: approved avatar.png / banner.png (thermal receipt, wood desk,
   coffee-ring stain, thumb, flash glare). Palette pulled from that photo.
   Type: Roboto Condensed (bureaucratic receipt sans) + JetBrains Mono
   (ledger / reference-number readout). Spacing: 8px grid. Motion: one
   idiom, a paper slide-in (translate + slight rotate, ease-out ~380ms).
   ========================================================================== */
:root {
  --wood-dark: #23150a;
  --wood-mid: #4a2e17;
  --wood-light: #7a4e26;
  --paper: #f3ede0;
  --paper-shadow: #d6cbae;
  --ink: #201a12;
  --tax-red: #a13a2c;
  --kept-green: #2f5d3f;
  --coffee: #6b4126;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;

  --radius: 3px;
  --ease-paper: cubic-bezier(.19, 1, .22, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--wood-dark);
}

body {
  font-family: "Roboto Condensed", "Arial Narrow", Arial, sans-serif;
  color: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 220, 170, .06), transparent 55%),
    linear-gradient(180deg, var(--wood-dark) 0%, #170d05 100%);
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image:
    repeating-linear-gradient(0deg, #fff 0px, transparent 1px, transparent 2px),
    repeating-linear-gradient(90deg, #000 0px, transparent 1px, transparent 2px);
}

/* ---------- chrome ---------- */
.chrome {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid rgba(243, 237, 224, .12);
  background: rgba(15, 9, 4, .55);
  backdrop-filter: blur(6px);
  position: relative;
  z-index: 3;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}

.brand-mark {
  font-weight: 700;
  font-size: clamp(18px, 2.4vw, 26px);
  letter-spacing: .01em;
  color: var(--paper);
  border-bottom: 3px solid var(--tax-red);
  line-height: 1.2;
  white-space: nowrap;
}

.brand-tag {
  font-size: 11px;
  letter-spacing: .12em;
  color: #c9bfa8;
  text-transform: uppercase;
  white-space: nowrap;
  display: none;
}

@media (min-width: 480px) {
  .brand-tag { display: inline; }
}

.chrome-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.status-pill {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .06em;
  color: #d9cfb6;
  border: 1px solid rgba(243, 237, 224, .25);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
  display: none;
}

@media (min-width: 700px) {
  .status-pill { display: inline-block; }
}

.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(243, 237, 224, .3);
  transition: border-color .2s ease, transform .2s ease;
  flex: 0 0 auto;
}

.icon-link:hover {
  border-color: var(--paper);
  transform: translateY(-1px);
}

/* custom themed X mark: two crossed torn receipt-paper strips, CSS only
   (Higgsfield gen was unavailable this session, see LAUNCH_MANIFEST) */
.x-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: block;
}

.x-strip {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 4px;
  background: var(--paper);
  background-image: repeating-linear-gradient(90deg, transparent 0 2px, rgba(32,26,18,.35) 2px 3px);
  border-radius: 1px;
}

.x-strip-a { transform: translate(-50%, -50%) rotate(45deg); }
.x-strip-b { transform: translate(-50%, -50%) rotate(-45deg); }

.buy-btn {
  font-family: "JetBrains Mono", monospace;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--wood-dark);
  background: var(--paper);
  padding: 9px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--paper-shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}

.buy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 0 var(--paper-shadow);
}

.buy-btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--paper-shadow);
}

/* ---------- stage ---------- */
.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

@media (min-width: 920px) {
  .stage {
    flex-direction: row;
  }
}

.desk {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: var(--space-2);
  position: relative;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 235, 200, .08), transparent 45%),
    repeating-linear-gradient(100deg, var(--wood-mid) 0px, var(--wood-light) 2px, var(--wood-mid) 60px),
    var(--wood-dark);
}

@media (min-width: 920px) {
  .desk {
    flex: 1 1 62%;
    padding: var(--space-4);
  }
}

.pile {
  position: relative;
  width: clamp(150px, 34vh, 220px);
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
}

@media (min-width: 920px) {
  .pile { width: clamp(220px, 22vw, 300px); }
}

.receipt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .55));
}

.receipt-base {
  z-index: 50;
  transform: translate(0, 0) rotate(0deg);
}

.receipt-extra {
  z-index: 1;
  opacity: 0;
  transform: translate(0, 24px) rotate(0deg) scale(.98);
  transition: transform .45s var(--ease-paper), opacity .3s ease;
  will-change: transform, opacity;
}

.receipt-extra.is-in {
  opacity: 1;
}

.ref-tab {
  flex: 0 0 auto;
  background: var(--paper);
  color: var(--ink);
  padding: 5px 10px;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .35);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  display: flex;
  gap: 6px;
  align-items: baseline;
  max-width: min(90vw, 320px);
  transform: translateY(-2px);
}

@media (min-width: 920px) {
  .ref-tab { font-size: 11px; max-width: 300px; }
}

.ref-label {
  color: var(--tax-red);
  font-weight: 600;
  letter-spacing: .05em;
}

.ref-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- tape (the live "you kept" mechanic) ---------- */
.tape {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3) var(--space-3);
  background: linear-gradient(180deg, rgba(15, 9, 4, .2), rgba(10, 6, 3, .75) 40%);
  border-top: 1px dashed rgba(243, 237, 224, .25);
  position: relative;
  z-index: 3;
  text-align: center;
}

@media (min-width: 920px) {
  .tape {
    flex: 0 0 340px;
    justify-content: center;
    border-top: none;
    border-left: 1px dashed rgba(243, 237, 224, .25);
    padding: var(--space-4);
  }
}

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

.tape-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: .18em;
  color: #cabf9f;
}

.tape-value {
  font-weight: 700;
  font-size: clamp(34px, 8vw, 54px);
  color: var(--kept-green);
  line-height: 1;
  transition: transform .18s ease;
}

.tape-value.is-pulsing {
  transform: scale(1.08);
}

.tape-value.is-zero {
  color: var(--tax-red);
}

.tape-sub {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: .04em;
  color: #d9cfb6;
  max-width: 260px;
}

.tape-row-mini {
  display: flex;
  gap: var(--space-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #c9bfa8;
  margin-top: var(--space-1);
  flex-wrap: wrap;
  justify-content: center;
}

.mini-label {
  letter-spacing: .08em;
  opacity: .75;
  margin-right: 4px;
}

.mini-value {
  color: var(--paper);
  font-weight: 500;
}

.add-trade-btn {
  margin-top: var(--space-2);
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--tax-red);
  border: none;
  padding: 13px 26px;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 3px 0 #6f2419;
  transition: transform .12s ease, box-shadow .12s ease;
}

.add-trade-btn:hover { transform: translateY(-1px); }

.add-trade-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #6f2419;
}

.add-trade-btn.is-shaken {
  animation: shake .32s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

.canary {
  margin-top: var(--space-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: #8a7f68;
  letter-spacing: .05em;
}

@media (prefers-reduced-motion: reduce) {
  .receipt-extra,
  .tape-value,
  .add-trade-btn,
  .buy-btn,
  .icon-link {
    transition: none !important;
    animation: none !important;
  }
}
