:root {
  --paper: #f3efe6;
  --surface: #fbf9f4;
  --surface-alt: #e7e1d4;
  --ink: #111111;
  --muted: #524e47;
  --accent: #ff2e00;
  --accent-ink: #ffffff;
  --ok: #0a7f3f;
  --border: 2px solid var(--ink);
  --hairline: 1px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --font-display: "Arial Black", "Impact", "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-mono: "Courier New", Courier, ui-monospace, SFMono-Regular, monospace;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html[data-theme="dark"] {
  --paper: #0e0e0e;
  --surface: #161616;
  --surface-alt: #212121;
  --ink: #f0ece2;
  --muted: #a49e93;
  --accent: #ff3b14;
  --accent-ink: #0e0e0e;
  --ok: #3cd070;
}

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

html, body {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.45;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button, input, select {
  font: inherit;
  color: inherit;
  border-radius: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* ==========================================
   LIVING FLOPPA WALLPAPER & ANIMATION LAYER
   ========================================== */
.floppa-wall {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  opacity: 0.24;
  filter: contrast(1.08) saturate(0.85);
  transition: opacity 0.2s;
}

html[data-theme="dark"] .floppa-wall {
  opacity: 0.20;
}

body[data-bg-mode="dvd"] .floppa-wall {
  opacity: 0.06;
}

body[data-bg-mode="wall"] .floppa-wall {
  opacity: 0.34;
}

body[data-bg-mode="still"] .wall-track {
  animation-play-state: paused;
}

.wall-row {
  flex: 1 1 0;
  min-height: 110px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
}

.wall-track {
  display: flex;
  gap: 10px;
  width: max-content;
  will-change: transform;
}

.dir-left .wall-track {
  animation: scroll-left var(--dur, 52s) linear infinite;
}

.dir-right .wall-track {
  animation: scroll-right var(--dur, 56s) linear infinite;
}

@keyframes scroll-left {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@keyframes scroll-right {
  from { transform: translate3d(-50%, 0, 0); }
  to { transform: translate3d(0, 0, 0); }
}

.wall-tile {
  width: 155px;
  height: 100%;
  border: 2px solid var(--ink);
  background: var(--surface);
  overflow: hidden;
  flex: 0 0 auto;
}

.wall-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#floppa-fx {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ==========================================
   TOP TICKER & RAW BRUTALIST HEADER
   ========================================== */
.ticker {
  position: relative;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  border-bottom: var(--border);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 5px 0;
}

.ticker-track {
  display: inline-block;
  animation: ticker-move 34s linear infinite;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

@keyframes ticker-move {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  border-bottom: var(--border);
}

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

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-stamp {
  width: 38px;
  height: 38px;
  border: var(--border);
  overflow: hidden;
  flex: 0 0 auto;
  cursor: pointer;
  background: var(--ink);
}

.brand-stamp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-btn {
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: -0.02em;
  line-height: 1;
  text-transform: uppercase;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.nav-tabs {
  display: flex;
  border: var(--border);
  background: var(--paper);
}

.nav-tab {
  border: none;
  border-right: var(--hairline);
  background: transparent;
  padding: 7px 13px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-tab:last-child {
  border-right: none;
}

.nav-tab:hover {
  background: var(--surface-alt);
}

.nav-tab.on {
  background: var(--ink);
  color: var(--paper);
}

.topbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.bg-controls {
  display: flex;
  border: var(--border);
  background: var(--paper);
}

.bg-btn {
  border: none;
  border-right: var(--hairline);
  background: transparent;
  padding: 6px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.bg-btn:last-child {
  border-right: none;
}

.bg-btn:hover {
  background: var(--surface-alt);
}

.bg-btn.on {
  background: var(--accent);
  color: var(--accent-ink);
}

.raw-btn {
  border: var(--border);
  background: var(--surface);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s, box-shadow 0.08s, background 0.1s;
}

.raw-btn:hover {
  background: var(--surface-alt);
}

.raw-btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.raw-btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.raw-btn.primary:hover {
  filter: brightness(1.06);
}

.raw-btn.ink {
  background: var(--ink);
  color: var(--paper);
}

.cart-btn .count-box {
  display: inline-block;
  margin-left: 5px;
  padding: 0 5px;
  background: var(--accent);
  color: var(--accent-ink);
}

/* ==========================================
   MAIN SHELL & EDITORIAL HERO STRIP
   ========================================== */
.shell {
  position: relative;
  z-index: 10;
  max-width: 1180px;
  margin: 26px auto 96px;
  padding: 0 16px;
}

.hero-frame {
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.45fr 0.75fr;
  margin-bottom: 24px;
}

.hero-main {
  padding: 26px 28px;
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

.meta-line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  text-transform: uppercase;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.hero-title em {
  font-style: italic;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.hero-lead {
  font-size: 15px;
  max-width: 560px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.hero-floppa-box {
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.hero-floppa-frame {
  flex: 1;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--ink);
  border-bottom: var(--border);
}

.hero-floppa-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-floppa-stamp {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: var(--surface);
  color: var(--ink);
  border: var(--border);
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.hero-floppa-bar {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

/* ==========================================
   STORE PANEL
   ========================================== */
.panel {
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
}

.panel-head {
  padding: 14px 18px;
  border-bottom: var(--border);
  background: var(--surface-alt);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-head h2 {
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.panel-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.controls-bar {
  padding: 12px 18px;
  border-bottom: var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--paper);
}

.seg-group {
  display: flex;
  flex-wrap: wrap;
  border: var(--border);
  background: var(--surface);
}

.seg-btn {
  border: none;
  border-right: var(--hairline);
  background: transparent;
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn:hover {
  background: var(--surface-alt);
}

.seg-btn.on {
  background: var(--ink);
  color: var(--paper);
}

.controls-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.raw-input, .raw-select {
  border: var(--border);
  background: var(--surface);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
}

.raw-input:focus, .raw-select:focus {
  border-color: var(--accent);
}

.count-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* Catalog Grid */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.card {
  border-right: var(--border);
  border-bottom: var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  position: relative;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sku-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.price-tag {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  padding: 2px 8px;
  border: var(--border);
  background: var(--paper);
}

.price-tag.free {
  background: var(--ink);
  color: var(--paper);
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-thumb {
  width: 56px;
  height: 56px;
  border: var(--border);
  object-fit: cover;
  flex: 0 0 auto;
  background: var(--ink);
}

.card h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
}

.card-desc {
  font-size: 14px;
  color: var(--muted);
}

.spec-table {
  border-top: var(--hairline);
  border-bottom: var(--hairline);
  padding: 8px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 10px;
  color: var(--muted);
}

.spec-table strong {
  color: var(--ink);
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.card-actions .raw-btn {
  flex: 1;
  text-align: center;
}

.empty-box {
  padding: 40px 20px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  grid-column: 1 / -1;
}

/* ==========================================
   FLOPPA INDEX (43-MEME RAW CONTACT SHEET)
   ========================================== */
.meme-sheet {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--paper);
}

.meme-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meme-cell {
  border: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.08s;
}

.meme-cell:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow);
}

.meme-cell-img {
  position: relative;
  background: var(--ink);
  border-bottom: var(--border);
}

.meme-cell-img img {
  width: 100%;
  height: auto;
}

.gif-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--ink);
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.meme-cell-meta {
  padding: 7px 9px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.meme-cell-title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meme-cell-id {
  color: var(--muted);
  flex: 0 0 auto;
}

/* ==========================================
   CART DRAWER & CRYPTO CHECKOUT
   ========================================== */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  display: none;
}

.scrim.open {
  display: block;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  z-index: 70;
  background: var(--surface);
  border-left: var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  padding: 14px 18px;
  border-bottom: var(--border);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-head h2 {
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bag-row {
  border: var(--border);
  background: var(--paper);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.bag-row strong {
  display: block;
  font-size: 14px;
}

.bag-row .muted {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.qty-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn, .rm-btn {
  border: var(--hairline);
  background: var(--surface);
  width: 26px;
  height: 26px;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
}

.qty-btn:hover, .rm-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.mono-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.coins {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: var(--border);
  margin-bottom: 12px;
}

.coin {
  border: none;
  border-right: var(--hairline);
  background: var(--paper);
  padding: 7px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.coin:last-child {
  border-right: none;
}

.coin.on {
  background: var(--ink);
  color: var(--paper);
}

.invoice {
  border: var(--border);
  background: var(--paper);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inv-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: var(--hairline);
  padding-bottom: 8px;
}

.inv-head .muted {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.inv-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.addr-col {
  min-width: 0;
  flex: 1;
}

.mono-val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}

.addr {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  word-break: break-all;
  background: var(--surface);
  border: var(--hairline);
  padding: 6px;
}

.inv-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: var(--hairline);
  padding-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.wallet-link {
  text-decoration: underline;
  font-weight: 700;
}

.notice {
  border: var(--border);
  border-left: 6px solid var(--ok);
  background: var(--paper);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.drawer-foot {
  padding: 14px 18px;
  border-top: var(--border);
  background: var(--surface-alt);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.total-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 15px;
}

.drawer-foot .raw-btn {
  width: 100%;
  padding: 10px;
}

/* ==========================================
   MODALS (RELEASE DETAILS & FLOPPA VIEWER)
   ========================================== */
dialog.raw-modal {
  margin: auto;
  border: var(--border);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  padding: 0;
  width: min(640px, 94vw);
  max-height: 90vh;
  overflow: auto;
}

dialog.raw-modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.modal-bar {
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.modal-close {
  border: 1px solid var(--paper);
  background: transparent;
  color: var(--paper);
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
}

.modal-close:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.modal-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-notes {
  padding-left: 18px;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.viewer-img-box {
  background: #0a0a0a;
  border: var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 62vh;
  overflow: hidden;
}

.viewer-img-box img {
  max-height: 60vh;
  width: auto;
  object-fit: contain;
}

.viewer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

/* ==========================================
   CORNER PEEKER FLOPPA
   ========================================== */
.peeker {
  position: fixed;
  right: 18px;
  bottom: 0;
  z-index: 40;
  width: 92px;
  height: 76px;
  border: var(--border);
  border-bottom: none;
  background: var(--ink);
  cursor: pointer;
  transform: translateY(34px);
  transition: transform 0.16s ease;
  box-shadow: -3px -3px 0 rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.peeker:hover {
  transform: translateY(0);
}

.peeker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.peeker-tag {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  padding: 1px 0;
}

/* Footer */
.site-foot {
  margin-top: 22px;
  background: var(--surface);
  border: var(--border);
  padding: 12px 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.site-foot a {
  text-decoration: underline;
}

@media (max-width: 820px) {
  .hero-frame {
    grid-template-columns: 1fr;
  }
  .hero-main {
    border-right: none;
    border-bottom: var(--border);
  }
  .catalog {
    grid-template-columns: 1fr;
  }
  .card {
    border-right: none;
  }
}
