/* Weird Little Games - shared theme system
   Overrides the site's existing CSS custom properties per [data-theme] on <html>.
   Each game keeps its own hand-built colors; this only reskins the shared shell
   (homepage, privacy/support pages, the feedback widget). */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root[data-theme="retro"] {
  --pink: #100e1a;
  --pink-deep: #1a1729;
  --ink: #eafbe0;
  --ink-dim: #7fa87a;
  --card-bg: #1c1930;
  --orange: #5ef2a0;
  --red: #ff4d7a;
  --navy: #0a0912;
  --gold: #ffe14d;
  --teal: #4de3ff;
  --violet: #b06bff;
  --olive: #8fdb4d;
  --venmo: #4de3ff;
  --venmo-dark: #2bb8d6;
}
:root[data-theme="retro"] .card,
:root[data-theme="retro"] .wrap,
:root[data-theme="retro"] .thumb,
:root[data-theme="retro"] .theme-picker-btn,
:root[data-theme="retro"] .theme-picker-panel,
:root[data-theme="retro"] .fb-panel,
:root[data-theme="retro"] .fb-btn {
  border-radius: 0 !important;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.5) !important;
  image-rendering: pixelated;
}
:root[data-theme="retro"] h1,
:root[data-theme="retro"] .display,
:root[data-theme="retro"] .theme-picker-title,
:root[data-theme="retro"] .theme-name {
  font-family: 'Press Start 2P', 'Bebas Neue', monospace;
  letter-spacing: 0;
}
/* Press Start 2P is much wider per-character than the regular script font,
   so the normal clamp() sizing overflows narrow screens; size it down and
   let it wrap instead of forcing a single line off the edges */
:root[data-theme="retro"] h1 {
  font-size: clamp(11px, 4.6vw, 32px) !important;
  white-space: normal;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: break-word;
}
:root[data-theme="retro"] .logo-row {
  flex-wrap: wrap;
  padding: 0 8px;
}
:root[data-theme="retro"] body {
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0px, rgba(255,255,255,0.025) 1px, transparent 1px, transparent 3px);
}
/* game thumbnails get a retro/CRT filter + scanline overlay, no per-card edits needed */
:root[data-theme="retro"] .thumb {
  position: relative;
  filter: saturate(1.6) contrast(1.2) hue-rotate(-8deg) brightness(0.92);
}
:root[data-theme="retro"] .thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(0,0,0,0.16) 0px, rgba(0,0,0,0.16) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: multiply;
}

:root[data-theme="mono"] .thumb {
  filter: grayscale(1) contrast(1.08);
}

:root[data-theme="mono"] {
  --pink: #efefed;
  --pink-deep: #dcdcd9;
  --ink: #161616;
  --ink-dim: #6e6e6e;
  --card-bg: #fcfcfb;
  --orange: #2a2a2a;
  --red: #000000;
  --navy: #0a0a0a;
  --gold: #4d4d4d;
  --teal: #333333;
  --violet: #1f1f1f;
  --olive: #3a3a3a;
  --venmo: #2a2a2a;
  --venmo-dark: #000000;
}

body { transition: background-color 0.3s ease, color 0.3s ease; }

/* ---------- theme picker widget ---------- */
.theme-picker-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 80;
  height: 40px;
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(35,32,29,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px 0 12px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  transition: transform 0.15s ease;
}
.theme-picker-btn:hover { transform: translateY(-1px); }
.theme-picker-btn svg { width: 17px; height: 17px; color: var(--ink); flex: 0 0 auto; }

.theme-picker-panel {
  position: fixed;
  top: 68px;
  left: 20px;
  z-index: 81;
  background: var(--card-bg);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 3px 3px 0 rgba(35,32,29,0.16);
  display: none;
  font-family: 'DM Mono', monospace;
  width: 232px;
}
.theme-picker-panel.open { display: block; }
.theme-picker-title {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 12px;
}
.theme-option-list { display: flex; flex-direction: column; gap: 12px; }
.theme-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  background: none;
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.theme-option:hover { background: rgba(0,0,0,0.04); }
.theme-option.active { border-color: var(--ink); }

.theme-preview {
  width: 100%;
  height: 62px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
  padding: 8px;
  box-sizing: border-box;
}
.theme-preview .tp-title {
  width: 55%;
  height: 7px;
  border-radius: 2px;
  margin: 0 auto 8px;
}
.theme-preview .tp-cards {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.theme-preview .tp-card {
  width: 22%;
  height: 24px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
}
.theme-preview .tp-card::after {
  content: '';
  position: absolute;
  left: 15%;
  top: 40%;
  width: 70%;
  height: 18%;
  border-radius: 1px;
  background: var(--tp-accent, currentColor);
}

.theme-name { font-size: 12px; color: var(--ink); }

@media (max-width: 500px) {
  .theme-picker-btn { top: 12px; left: 12px; height: 36px; padding: 0 13px 0 10px; font-size: 11px; }
  .theme-picker-panel { top: 56px; left: 12px; width: 200px; }
  /* keep the fixed Theme/feedback buttons from sitting on top of the title
     on narrow screens, where the header has less room to clear them */
  .logo-row { margin-top: 18px; }
}
