/* Dark skin (button in the top bar): the previous palette. The light one lives in :root.
   Chosen by each visitor (localStorage «polla-skin»); the matrix theme, set in config.json, wins over it. */
html[data-skin="dark"] {
  --bg: #0d0d0f; --card: #17171b; --card-bg: #17171b; --nav-bg: #17171b; --line: #2a2a31; --txt: #ececf1; --mut: #9a9aa6;
  --btc: #f7931a; --accent2: #a993f5; --ok: #3ccf7a; --err: #ff5c5c; --res: #e2b93b; --in: #0f0f12;
  --on-accent: #111; --sec: #26262c; --sec-txt: #ececf1; --cell: #22222a; --cell-sold: #3a1717; --cell-sold-txt: #8a5555;
  --cell-res: #3a3014; --shadow: none;
  color-scheme: dark;
}
html[data-skin="dark"] body { background: var(--bg); color: var(--txt); }

/* POLLA themes. The default theme lives in :root of each page.
   The «matrix» theme is inspired by the classic terminal palette (almost black background,
   phosphor green, monospaced). CSS written from scratch, without copying third-party sheets. */

html[data-theme="matrix"] {
  --bg: #0d0208;
  --card: #051208;
  --line: #003b00;
  --txt: #00ff41;
  --mut: #80ce87;
  --btc: #00ff41;
  --ok: #b8ffc8;
  --err: #ff6b6b;
  --res: #c8f560;
  --in: #001a00;
  --on-accent: #0d0208;
  --accent2: #00ff41;
  --sec: #003b00;
  --sec-txt: #00ff41;
  --cell: #032003;
  --cell-sold: #1a0808;
  --cell-sold-txt: #8f5555;
  --cell-res: #1a2208;
  --shadow: none;
  --card-bg: #051208;
  --nav-bg: rgba(5,18,8,.92);
  color-scheme: dark;
}

html[data-theme="matrix"] body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at top, #001a00, #0d0208 62%);
  color: var(--txt);
  font-family: "Courier New", Courier, ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="matrix"] h1,
html[data-theme="matrix"] h2,
html[data-theme="matrix"] .navbar-brand {
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.55);
}

html[data-theme="matrix"] button {
  background: #00ff41;
  color: var(--on-accent);
  border: 1px solid #00ff41;
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.35);
  text-shadow: none;
}

html[data-theme="matrix"] button:hover:not(:disabled) {
  background: #b8ffc8;
  color: var(--on-accent);
  box-shadow: 0 0 18px rgba(0, 255, 65, 0.75);
}

html[data-theme="matrix"] button.sec {
  background: #003b00;
  color: var(--txt);
  border-color: #008f11;
  box-shadow: none;
}

html[data-theme="matrix"] button.on,
html[data-theme="matrix"] .tabs button.cur {
  background: #00ff41;
  color: var(--on-accent);
}

html[data-theme="matrix"] .card,
html[data-theme="matrix"] .sheet,
html[data-theme="matrix"] .sale,
html[data-theme="matrix"] .stat,
html[data-theme="matrix"] details {
  background: rgba(5, 18, 8, 0.92);
  border-color: #003b00;
  box-shadow: 0 0 16px rgba(0, 255, 65, 0.12);
}

html[data-theme="matrix"] input,
html[data-theme="matrix"] select,
html[data-theme="matrix"] textarea {
  background: #001a00;
  color: var(--txt);
  border-color: #008f11;
}

html[data-theme="matrix"] input:focus,
html[data-theme="matrix"] select:focus,
html[data-theme="matrix"] textarea:focus {
  outline: 2px solid #00ff41;
  border-color: transparent;
}

html[data-theme="matrix"] .cell { background: #032003; color: var(--txt); }
html[data-theme="matrix"] .cell.sold { background: #1a0808; color: #8f5555; }
html[data-theme="matrix"] .cell.res { background: #1a2208; color: var(--res); }
html[data-theme="matrix"] .cell.incart { background: #00ff41; color: var(--on-accent); }

html[data-theme="matrix"] .cartbar {
  background: #00ff41;
  color: var(--on-accent);
  text-shadow: none;
}

html[data-theme="matrix"] .qr {
  background: #fff;
  filter: hue-rotate(90deg) brightness(1.15) contrast(1.1);
}

html[data-theme="matrix"] a { color: #80ce87; }
html[data-theme="matrix"] a:hover { color: #b8ffc8; }

html[data-theme="matrix"] .banner {
  background: #1a2208;
  color: var(--res);
  border: 1px solid #3a4a10;
}

html[data-theme="matrix"] .wrap,
html[data-theme="matrix"] .cartbar,
html[data-theme="matrix"] .modal {
  position: relative;
  z-index: 1;
}
html[data-theme="matrix"] .cartbar { z-index: 5; }
html[data-theme="matrix"] .modal { z-index: 9; }

#lottobtc-matrix-rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.32;
}

@media (max-width: 640px) {
  #lottobtc-matrix-rain { opacity: 0.22; }
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="matrix"] h1,
  html[data-theme="matrix"] h2 {
    text-shadow: 0 0 4px rgba(0, 255, 65, 0.35);
  }
  #lottobtc-matrix-rain { display: none; }
}

html[data-theme="matrix"] {
  scrollbar-color: #008f11 #0d0208;
}
