@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=DM+Sans:wght@400;500;600;700&family=Press+Start+2P&family=Righteous&family=Silkscreen:wght@400;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --paper: #f4f3eb;
  --ink: #191b19;
  --accent: #c0ff72;
  --panel: #202622;
  --line: #d5d7cc;
  --muted: #676b62;
  --display: 'Space Grotesk', sans-serif;
  --header-font: 'Space Grotesk', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  transition: background 0.3s, color 0.3s;
}

/* CRT Scanlines overlay */
.crt-lines::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  z-index: 9999;
  background-size: 100% 3px, 6px 100%;
  pointer-events: none;
  opacity: 0.7;
}

button, input, select { font: inherit; }
button, a, input, select { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #7854ee;
  outline-offset: 4px;
}

header {
  height: 100px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: auto;
  padding: 0 5%;
}

.brand {
  font-family: var(--header-font);
  font-size: 32px;
  letter-spacing: -2px;
  font-weight: 700;
  white-space: nowrap;
}
.brand span {
  background: var(--accent);
  padding: 0 3px;
  color: #000;
}
.brand sup {
  font-size: 12px;
  letter-spacing: 0;
  vertical-align: top;
  margin-left: 4px;
}

nav { display: flex; gap: 10px; }
nav a {
  padding: 12px 24px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: all 0.2s;
}
nav a.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--accent);
}

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

.chip-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.15s;
}
.chip-button:hover {
  background: var(--ink);
  color: var(--paper);
}
.chip-button.active {
  background: var(--accent);
  color: #000;
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: transparent;
}
.lang-btn {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.lang-btn:last-child {
  border-right: 0;
}
.lang-btn:hover {
  background: var(--ink);
  color: var(--paper);
}
.lang-btn.active {
  background: var(--accent);
  color: #000;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px var(--ink);
}

main {
  max-width: 1320px;
  margin: auto;
  padding: 44px 38px 60px;
}

.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.eyebrow {
  font-family: monospace;
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: bold;
  margin: 0 0 18px;
}

h1 {
  font-family: var(--header-font);
  font-size: clamp(34px, 4.2vw, 58px);
  line-height: 1.08;
  letter-spacing: -2.6px;
  margin: 0 0 16px;
}
h1 span { color: #70766a; }

#subtitle {
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}

.intro-number {
  font-family: 'Press Start 2P', monospace;
  font-size: 112px;
  line-height: 1;
  transform: rotate(-7deg);
  color: var(--ink);
  text-shadow: 7px 7px 0 var(--accent);
  margin-right: 48px;
  user-select: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.intro-number:hover {
  transform: rotate(-7deg) scale(1.06);
}
.intro-number:active {
  transform: rotate(-7deg) scale(0.96);
}
.intro-number span {
  display: block;
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 1px;
  margin-top: 18px;
  text-shadow: none;
  max-width: 280px;
  line-height: 1.5;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 52px;
}

.section-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 18px;
}
h2 {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: -.5px;
  margin: 0;
}
.section-line > span {
  font-family: monospace;
  font-size: 14px;
}
#counter {
  border: 1px solid var(--ink);
  padding: 6px 10px;
  background: var(--accent);
  font-weight: bold;
}

/* Poster Card Board */
.poster {
  background: var(--panel);
  padding: 20px;
  color: #f4f6ec;
  box-shadow: 7px 7px 0 #d8dccf;
  position: relative;
  transition: all 0.3s;
}

.poster-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.poster-top strong {
  font-family: monospace;
  font-size: 17px;
  letter-spacing: 1px;
}
.poster-top span {
  font-size: 12px;
  max-width: 45%;
  text-align: right;
  overflow-wrap: anywhere;
}

.board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 7px;
}

.slot {
  grid-column: span 2;
  position: relative;
  aspect-ratio: 2/2.7;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  background: #2e3730;
  color: #9aaa99;
  border: 1px dashed #53614f;
  padding: 0;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}
.slot:hover {
  border-color: var(--accent);
  transform: scale(1.02);
  z-index: 2;
}

.slot:nth-child(31) {
  grid-column: 4 / span 2;
}

.slot .num {
  position: absolute;
  left: 6px;
  top: 5px;
  font-family: monospace;
  font-size: 12px;
  z-index: 1;
}
.slot.empty .plus {
  font-size: 21px;
  color: #738770;
}
.slot.filled {
  border: 0;
  color: white;
}
.slot.filled .num {
  background: #000b;
  padding: 2px 4px;
  left: 3px;
  top: 3px;
  border-radius: 2px;
}
.slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.title-cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--display);
  padding: 10px;
  background: linear-gradient(145deg, #475648, #15261c);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.poster-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 1px;
}
.poster-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.poster-brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.poster-brand-text b {
  color: var(--accent);
  font-size: 16px;
  letter-spacing: 0.5px;
}
.poster-brand-text small {
  font-size: 10px;
  color: #fffa;
  font-family: 'DM Sans', sans-serif;
  text-transform: none;
  letter-spacing: 0;
}

/* Equalizer for music */
.music-equalizer {
  display: none;
  gap: 2px;
  align-items: flex-end;
  height: 14px;
}
.music-equalizer i {
  width: 3px;
  background: var(--accent);
  border-radius: 1px;
  animation: eq-anim 0.8s ease-in-out infinite alternate;
}
.music-equalizer i:nth-child(2) { animation-delay: 0.2s; }
.music-equalizer i:nth-child(3) { animation-delay: 0.4s; }
.music-equalizer i:nth-child(4) { animation-delay: 0.1s; }

@keyframes eq-anim {
  0% { height: 3px; }
  100% { height: 14px; }
}

.board-help {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  margin: 18px 0 22px;
}
.board-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}
.text-button {
  border: 0;
  padding: 0;
  background: none;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--ink);
  cursor: pointer;
}
.text-button:hover {
  color: #000;
  font-weight: bold;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}
.name-row label {
  font-size: 14px;
  white-space: nowrap;
}
input:not([type=file]) {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 12px 14px;
  min-width: 0;
  border-radius: 0;
}
.name-row input {
  width: 100%;
  font-size: 14px;
}

.primary {
  display: block;
  background: var(--accent);
  color: #000;
  border: 1px solid var(--ink);
  padding: 15px 20px;
  font-weight: 700;
  text-align: center;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
}
.primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.export {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.export span {
  font-family: monospace;
  font-weight: 400;
  font-size: 12px;
  border: 1px solid currentColor;
  padding: 3px 6px;
}
.local-note {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}

/* Finder / Catalog */
.search {
  display: flex;
  border: 1px solid var(--ink);
  align-items: center;
  background: #fff9;
  padding-left: 16px;
  box-shadow: 3px 3px 0 var(--line);
}
.search > span { font-size: 28px; }
.search input {
  border: 0;
  width: 100%;
  padding: 15px !important;
  outline: none;
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  margin: 22px 0 16px;
  gap: 10px;
  font-size: 14px;
}
.search-status {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}
.search-status:empty { display: none; }

.catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 14px;
}
.catalog-card {
  background: none;
  border: 0;
  text-align: left;
  padding: 0;
  min-width: 0;
  position: relative;
  color: var(--ink);
}
.catalog-art {
  display: block;
  aspect-ratio: 2/2.7;
  background: #dde1d5;
  overflow: hidden;
  position: relative;
  box-shadow: 3px 3px 0 #d5d8cd;
  border: 1px solid var(--line);
}
.catalog-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s;
}
.catalog-card:hover img { transform: scale(1.05); }
.catalog-card .add-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--paper);
  border: 1px solid var(--ink);
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: 2px 2px 0 var(--ink);
}
.catalog-card.selected .add-badge {
  background: var(--accent);
  font-size: 16px;
}
.catalog-name {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  margin-top: 9px;
  overflow-wrap: anywhere;
}
.catalog-meta {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.secondary {
  background: none;
  border: 1px solid var(--line);
  padding: 12px 16px;
  color: var(--ink);
  font-weight: 600;
}
.secondary:hover {
  background: var(--ink);
  color: var(--paper);
}
#more { width: 100%; margin-top: 24px; }

.tip {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 28px;
  padding-top: 16px;
}
.tip > span { font-size: 36px; }
.tip p { font-size: 15px; line-height: 1.6; }
.credit { font-size: 12px; line-height: 1.5; color: var(--muted); }

footer {
  max-width: 1244px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
footer p { font-size: 14px; color: var(--muted); }
footer > span { font-size: 12px; font-family: monospace; }

/* Dialogs */
dialog {
  border: 1px solid var(--ink);
  padding: 28px;
  background: var(--paper);
  color: var(--ink);
  max-width: 580px;
  width: calc(100% - 32px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 8px 8px 0 #0005;
}
dialog::backdrop {
  background: #07150bd0;
  backdrop-filter: blur(5px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.close {
  border: 0;
  background: none;
  font-size: 30px;
  color: var(--ink);
  cursor: pointer;
}
dialog label {
  display: block;
  font-size: 14px;
  margin: 18px 0 8px;
}
dialog input { width: 100%; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}
.danger {
  background: #ffe6e1;
  color: #8e231b;
  border: 1px solid #8e231b;
  padding: 12px 20px;
  font-weight: 600;
}
.muted {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
#coverPreview {
  max-height: 150px;
  max-width: 100%;
  margin-top: 16px;
  border-radius: 4px;
}
.move-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

#resultImage {
  width: 100%;
  display: block;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  box-shadow: 4px 4px 0 var(--line);
}

.ratio-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.ratio-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--line);
  background: transparent;
  font-weight: 700;
  font-size: 12px;
  color: var(--ink);
  transition: all 0.15s;
}
.ratio-btn.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--accent);
}

.export-actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.export-actions-row > * {
  flex: 1;
  text-align: center;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.share-buttons button {
  background: none;
  border: 1px solid var(--line);
  padding: 9px 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.share-buttons button:hover {
  background: var(--ink);
  color: var(--paper);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 14px 24px;
  background: var(--ink);
  color: var(--paper);
  z-index: 100;
  box-shadow: 4px 4px 0 var(--accent);
  text-align: center;
  font-weight: 600;
}

/* ==========================================================================
   THEME 1: GAMES (8-BIT RETRO ARCADE)
   ========================================================================== */
body[data-theme="games"] {
  --paper: #0c0f17;
  --ink: #f0fdf4;
  --accent: #39ff14;
  --panel: #141926;
  --line: #222d42;
  --muted: #8493a8;
  --header-font: 'Press Start 2P', monospace;
}
body[data-theme="games"] h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.4;
  letter-spacing: -1px;
}
body[data-theme="games"] .poster {
  border: 4px solid var(--accent);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.2), 6px 6px 0 #000;
}
body[data-theme="games"] .poster-top strong {
  font-family: "Press Start 2P", monospace;
  font-size: 13px;
  color: var(--accent);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}
body[data-theme="games"] .slot {
  background: #171f30;
  border-color: #2b3954;
  color: #7287aa;
}
body[data-theme="games"] .slot.filled {
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.25);
}
body[data-theme="games"] .slot .num {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--accent);
}

/* ==========================================================================
   THEME 2: FILMS (35MM CLASSIC CINEMA)
   ========================================================================== */
body[data-theme="films"] {
  --paper: #120e10;
  --ink: #fff1f2;
  --accent: #d4af37;
  --panel: #201317;
  --line: #3f272e;
  --muted: #a88d94;
  --header-font: 'Cinzel', serif;
}
body[data-theme="films"] h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(30px, 4vw, 52px);
  letter-spacing: 1px;
}
body[data-theme="films"] .poster {
  border-top: 10px double var(--accent);
  border-bottom: 10px double var(--accent);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.15), 6px 6px 0 #000;
}
body[data-theme="films"] .poster-filmstrip-top,
body[data-theme="films"] .poster-filmstrip-bottom {
  display: block;
  height: 14px;
  background-image: radial-gradient(circle, #000 40%, transparent 45%);
  background-size: 16px 14px;
  background-repeat: repeat-x;
  margin: -10px 0 10px 0;
  opacity: 0.6;
}
body[data-theme="films"] .poster-filmstrip-bottom {
  margin: 10px 0 -10px 0;
}
body[data-theme="films"] .poster-top strong {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 2px;
}
body[data-theme="films"] .slot {
  background: #2d181e;
  border-color: #5c323c;
  color: #ddb8b9;
}
body[data-theme="films"] .slot.filled {
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

/* ==========================================================================
   THEME 3: MUSIC (LIVE CONCERT & FESTIVAL)
   ========================================================================== */
body[data-theme="music"] {
  --paper: #0d0a17;
  --ink: #fdf4ff;
  --accent: #ec4899;
  --panel: #1b132e;
  --line: #3b285e;
  --muted: #a392c2;
  --header-font: 'Righteous', sans-serif;
}
body[data-theme="music"] h1 {
  font-family: 'Righteous', sans-serif;
  letter-spacing: 0;
}
body[data-theme="music"] .intro-number {
  color: #a855f7;
  text-shadow: 6px 6px 0 var(--accent);
}
body[data-theme="music"] .poster {
  border: 2px solid #a855f7;
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.25), 6px 6px 0 #000;
}
body[data-theme="music"] .music-equalizer {
  display: inline-flex;
}
body[data-theme="music"] .slot {
  aspect-ratio: 1;
  background: #24173d;
  border-color: #513685;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.25, 1), box-shadow 0.3s ease;
}
body[data-theme="music"] .slot.filled {
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
}

/* Vinyl disc hidden by default, visible in music catalog */
.vinyl-disc {
  display: none;
}
body[data-theme="music"] .catalog-card {
  position: relative;
  transition: transform 0.25s ease;
}
body[data-theme="music"] .catalog-card:hover {
  z-index: 25;
}
body[data-theme="music"] .catalog-art {
  aspect-ratio: 1;
  overflow: visible !important;
  position: relative;
  background: transparent;
  box-shadow: none;
  border: none;
}
body[data-theme="music"] .catalog-art img,
body[data-theme="music"] .catalog-art .title-cover {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 3px 3px 0 #120c24, 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.25, 1);
}
body[data-theme="music"] .catalog-card:hover img,
body[data-theme="music"] .catalog-card:hover .title-cover {
  transform: translateX(-6px) scale(1.02);
}
body[data-theme="music"] .vinyl-disc {
  display: block;
  position: absolute;
  top: 4%;
  left: 4%;
  width: 92%;
  height: 92%;
  border-radius: 50%;
  z-index: 2;
  background:
    radial-gradient(circle at center, #0a0a0a 0%, #0a0a0a 5%, transparent 6%),
    radial-gradient(circle at center, #ec4899 6%, #8b5cf6 16%, #120c24 17%, transparent 18%),
    repeating-radial-gradient(circle at center, #141414 0, #141414 2px, #2a2a2a 3px, #0a0a0a 4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), inset 0 0 5px rgba(255, 255, 255, 0.25);
  transform: translateX(0) rotate(0deg);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.15s ease;
  pointer-events: none;
}
body[data-theme="music"] .catalog-card:hover .vinyl-disc {
  opacity: 1;
  transform: translateX(45%) rotate(180deg);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 950px) {
  header { padding: 0 24px; }
  .workspace {
    gap: 28px;
    grid-template-columns: 1.15fr 1fr;
  }
  main { padding: 32px 24px; }
  .intro-number { font-size: 85px; margin-right: 10px; }
  .poster { padding: 13px; }
  .board { gap: 5px; }
  .catalog { gap: 16px 10px; }
  .catalog-name { font-size: 13px; }
  .poster-top strong { font-size: 14px; }
  .poster-top span { font-size: 12px; }
  footer { margin: 0 24px; }
  .name-row { display: block; }
  .name-row input { margin-top: 8px; }
}

@media (max-width: 700px) {
  header {
    height: auto;
    min-height: 112px;
    flex-wrap: wrap;
    padding: 16px 20px;
    gap: 16px;
  }
  .brand { font-size: 28px; }
  header nav {
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 6px;
  }
  nav a { flex: 1; text-align: center; padding: 10px 12px; }
  main { padding: 28px 18px 40px; }
  .intro { margin-bottom: 30px; }
  .intro-number { display: none; }
  h1 { font-size: 34px; }
  #subtitle { font-size: 14px; }
  .workspace { display: flex; flex-direction: column; gap: 38px; }
  .poster { padding: 16px; }
  .board { gap: 6px; }
  .catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 14px; }
  .catalog-name { font-size: 14px; }
  footer { flex-wrap: wrap; padding: 24px 0; }
  footer > span { display: none; }
  .name-row { display: flex; }
  .name-row input { margin: 0; }
  .board-help { font-size: 12px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .poster-top strong { font-size: 16px; }
  dialog { padding: 16px; }
}

/* ==========================================================================
   SLOT CARD PICKER & SEARCH DIALOG
   ========================================================================== */
.slot-picker-dialog {
  width: calc(100% - 32px);
  max-width: 680px;
  max-height: 88vh;
  padding: 24px;
  border: 2px solid var(--ink);
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.35);
  background: var(--paper);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  box-sizing: border-box;
}

.modal-head-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal-head-titles h2 {
  font-family: var(--header-font);
  font-size: 22px;
  margin: 0;
}
.modal-head-sub {
  font-size: 13px;
  color: var(--muted);
}

/* Current Selection Banner */
.slot-current-card {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.slot-current-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}
.slot-current-body {
  display: flex;
  align-items: center;
  gap: 14px;
}
.slot-current-thumb-wrap {
  width: 48px;
  height: 64px;
  flex-shrink: 0;
  background: #2e3730;
  border: 1px solid var(--ink);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.slot-current-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slot-current-thumb-wrap .title-cover {
  font-size: 10px;
  padding: 4px;
  text-align: center;
  color: #fff;
}
.slot-current-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.slot-current-info b {
  font-size: 16px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-current-info span {
  font-size: 13px;
  color: var(--muted);
}
.slot-current-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chip-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px;
}
.slot-replace-divider {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 8px;
  margin-top: 2px;
}

/* Modal Search Bar */
.slot-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slot-search-bar {
  display: flex;
  align-items: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 0 12px;
  gap: 8px;
}
.slot-search-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 4px 4px 0 var(--accent);
}
.slot-search-icon {
  font-size: 16px;
  color: var(--muted);
}
#slotSearchInput {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 4px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  font-family: inherit;
}
.slot-search-clear {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
}
.slot-search-clear:hover {
  color: var(--ink);
}
.slot-search-status {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  min-height: 16px;
}

/* Results / Suggestions Section */
.slot-results-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 8px;
}
.slot-results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.slot-results-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: normal;
}
.slot-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  overflow-y: auto;
  max-height: 44vh;
  padding: 4px 4px 12px;
  -webkit-overflow-scrolling: touch;
}
.slot-result-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 2px 2px 0 var(--line);
  padding: 8px;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
}
.slot-result-card:hover {
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translateY(-2px);
}
.slot-result-card:active {
  transform: scale(0.97);
}
.slot-result-card.selected {
  border-color: var(--accent);
  background: rgba(57, 255, 20, 0.06);
}
.slot-result-art {
  width: 100%;
  aspect-ratio: 2/2.7;
  background: #2e3730;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot-result-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slot-result-art .title-cover {
  font-size: 10px;
  padding: 6px;
  color: #fff;
  text-align: center;
  line-height: 1.2;
}
.slot-result-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--paper);
  border: 1px solid var(--ink);
  font-size: 14px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  box-shadow: 1px 1px 0 var(--ink);
}
.slot-result-card.selected .slot-result-badge {
  background: var(--accent);
}
.slot-result-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.slot-result-meta {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hidden Manual Add Form */
.manual-add-drawer {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 4px;
}
.manual-toggle-btn {
  background: none;
  border: 1px dashed var(--line);
  padding: 8px 12px;
  width: 100%;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}
.manual-toggle-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(0, 0, 0, 0.02);
}
.manual-form-body {
  margin-top: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--line);
}

/* Quick Search button on mobile & poster toolbar */
.primary-chip-btn {
  background: var(--accent);
  color: var(--ink);
  border: 1px solid var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.primary-chip-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}
.primary-chip-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

/* Mobile Bottom Sheet Drawer for Slot Picker */
@media (max-width: 700px) {
  .slot-picker-dialog {
    position: fixed !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 92vh !important;
    max-height: 92vh !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 18px 14px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border-bottom: none !important;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45) !important;
  }
  .slot-search-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    max-height: 50vh !important;
  }
  .slot-result-card {
    padding: 6px !important;
  }
  .slot-result-title {
    font-size: 12px !important;
  }
  .slot-result-meta {
    font-size: 10px !important;
  }
}

[hidden] { display: none !important; }

/* ==========================================================================
   DRAG & DROP INTERACTIONS
   ========================================================================== */
.catalog-card[draggable="true"] {
  cursor: grab;
}
.catalog-card[draggable="true"]:active {
  cursor: grabbing;
}
.catalog-card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.4);
}
.slot.drag-over {
  border-color: var(--accent) !important;
  transform: scale(1.08) !important;
  box-shadow: 0 0 24px var(--accent) !important;
  z-index: 10 !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================================================
   INTERACTIVE EASTER EGGS & THEME ANIMATIONS
   ========================================================================== */


/* Games: Retro pop and Konami glow */
@keyframes retro-pop {
  0% { transform: scale(0.8); filter: brightness(2) contrast(1.4); }
  50% { transform: scale(1.08); filter: brightness(1.2); }
  100% { transform: scale(1); filter: brightness(1); }
}
body[data-theme="games"] .slot.filled {
  animation: retro-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
body[data-theme="games"] .slot:first-child.filled {
  box-shadow: 0 0 14px var(--accent), 0 0 24px rgba(57, 255, 20, 0.35) !important;
  border: 2px solid var(--accent) !important;
  animation: goat-pulse 2s ease-in-out infinite alternate !important;
}
@keyframes goat-pulse {
  0% { box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(57, 255, 20, 0.2); }
  100% { box-shadow: 0 0 22px var(--accent), 0 0 38px rgba(57, 255, 20, 0.7); }
}

@keyframes rainbow-glow {
  0% { border-color: #ff0055; box-shadow: 0 0 35px #ff0055; }
  25% { border-color: #ffaa00; box-shadow: 0 0 35px #ffaa00; }
  50% { border-color: #00ffaa; box-shadow: 0 0 35px #00ffaa; }
  75% { border-color: #0088ff; box-shadow: 0 0 35px #0088ff; }
  100% { border-color: #cc00ff; box-shadow: 0 0 35px #cc00ff; }
}
.rainbow-active {
  animation: rainbow-glow 0.8s linear infinite !important;
}

/* Films: Filmstrip roll, shutter flash, quotes and countdown */
@keyframes film-roll {
  0% { background-position-x: 0px; }
  100% { background-position-x: 32px; }
}
body[data-theme="films"] .poster:hover .poster-filmstrip-top,
body[data-theme="films"] .poster:hover .poster-filmstrip-bottom {
  animation: film-roll 1s linear infinite;
  cursor: pointer;
}
#filmstripTop, #filmstripBottom {
  cursor: pointer;
  transition: opacity 0.2s;
}
#filmstripTop:hover, #filmstripBottom:hover {
  opacity: 0.95;
}

@keyframes camera-flash {
  0% { opacity: 0.3; filter: brightness(3.5); }
  100% { opacity: 1; filter: brightness(1); }
}
body[data-theme="films"] .slot.filled {
  animation: camera-flash 0.35s ease-out;
}

.film-quote-banner {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 16px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  text-align: center;
  font-style: italic;
  margin-top: 14px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  animation: fadeInQuote 0.3s ease;
}
@keyframes fadeInQuote {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cinema Countdown Modal Overlay */
.cinema-countdown {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  font-family: 'Cinzel', serif;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.cinema-countdown.active {
  opacity: 1;
  pointer-events: auto;
}
.cinema-countdown .count-num {
  font-size: 130px;
  font-weight: 900;
  border: 6px solid #d4af37;
  border-radius: 50%;
  width: 200px;
  height: 200px;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 0 60px rgba(212, 175, 55, 0.5);
  animation: popNum 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popNum {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.cinema-countdown .clapper-text {
  font-size: 22px;
  letter-spacing: 3px;
  margin-top: 24px;
  color: #d4af37;
}

/* Music: Equalizer, Vinyl spin and Bass pulse */
.music-equalizer {
  cursor: pointer;
  transition: transform 0.15s;
}
.music-equalizer:hover {
  transform: scale(1.15);
}
.music-equalizer:hover i {
  animation-duration: 0.35s;
}

.music-equalizer.playing {
  filter: drop-shadow(0 0 8px #ec4899);
}
.music-equalizer.playing i {
  animation: eq-playing-anim 0.22s ease-in-out infinite alternate !important;
}
.music-equalizer.playing i:nth-child(1) { animation-duration: 0.16s !important; background: #ec4899 !important; }
.music-equalizer.playing i:nth-child(2) { animation-duration: 0.24s !important; background: #a855f7 !important; }
.music-equalizer.playing i:nth-child(3) { animation-duration: 0.14s !important; background: #c0ff72 !important; }
.music-equalizer.playing i:nth-child(4) { animation-duration: 0.21s !important; background: #38bdf8 !important; }
.music-equalizer.playing i:nth-child(5) { animation-duration: 0.18s !important; background: #f43f5e !important; }

@keyframes eq-playing-anim {
  0% { height: 3px; }
  100% { height: 22px; }
}

body.music-playing .poster {
  box-shadow: 0 0 35px rgba(236, 72, 153, 0.45), 6px 6px 0 #000;
  animation: poster-beat 0.44s ease-in-out infinite alternate;
}

@keyframes poster-beat {
  0% { transform: scale(1); }
  100% { transform: scale(1.008); }
}

/* Music: Low-frequency Bass Pulse Shockwave upon card placement */
@keyframes bass-wave-pulse {
  0% {
    transform: scale(0.88);
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.95), 0 0 30px #ec4899;
  }
  35% {
    transform: scale(1.15);
    box-shadow: 0 0 0 16px rgba(168, 85, 247, 0.5), 0 0 50px #a855f7;
  }
  70% {
    transform: scale(0.97);
    box-shadow: 0 0 0 8px rgba(236, 72, 153, 0.25), 0 0 25px #ec4899;
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
  }
}

body[data-theme="music"] .slot.bass-wave-active {
  animation: bass-wave-pulse 0.75s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
  border-color: #ec4899 !important;
  z-index: 25;
  position: relative;
}

body[data-theme="music"] .slot.bass-wave-active::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 8px;
  border: 3px solid #ec4899;
  animation: bass-ripple-wave 0.7s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  pointer-events: none;
  z-index: 26;
}

@keyframes bass-ripple-wave {
  0% { transform: scale(0.75); opacity: 1; box-shadow: 0 0 25px #ec4899; }
  100% { transform: scale(1.6); opacity: 0; box-shadow: 0 0 50px #a855f7; }
}

/* Vinyl spin on easter egg click */
@keyframes vinyl-spin-anim {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.vinyl-spin img,
.vinyl-spin .title-cover {
  animation: vinyl-spin-anim 0.4s cubic-bezier(0.2, 0.85, 0.35, 1) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.7) !important;
  will-change: transform;
}

body.laser-mode {
  background: radial-gradient(circle at 50% 50%, #210a3d 0%, #080314 100%) !important;
}
body.laser-mode .poster {
  box-shadow: 0 0 50px rgba(236, 72, 153, 0.5), 0 0 90px rgba(168, 85, 247, 0.3), 6px 6px 0 #000 !important;
}

/* Floating Particles (Coins, Stars, Notes) */
.floating-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-weight: 800;
  font-size: 18px;
  font-family: monospace;
  animation: floatUpFade 1.2s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
  user-select: none;
  text-shadow: 0 0 10px currentColor;
}
@keyframes floatUpFade {
  0% { opacity: 1; transform: translate(0, 0) scale(0.8); }
  50% { opacity: 0.9; transform: translate(var(--dx, 0px), -50px) scale(1.2); }
  100% { opacity: 0; transform: translate(var(--dx, 0px), -100px) scale(1.4); }
}

/* ==========================================================================
   RETRO ARCADE MACHINE & BIG COIN EASTER EGG (GAMES THEME)
   ========================================================================== */

.arcade-cabinet-section {
  display: none;
}

body[data-theme="games"] .arcade-cabinet-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px 40px;
  position: relative;
  background: radial-gradient(circle at 50% 15%, rgba(57, 255, 20, 0.08) 0%, transparent 65%);
}

.arcade-cabinet-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 440px;
  width: 100%;
}

/* Coin Drop and Landing Area */
.arcade-coin-drop-area {
  position: relative;
  height: 90px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 16px;
  pointer-events: none;
}

/* The Big Golden Arcade Coin */
.arcade-big-coin {
  display: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  cursor: grab;
  user-select: none;
  pointer-events: auto;
  position: relative;
  z-index: 40;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.arcade-big-coin:active {
  cursor: grabbing;
}
.arcade-big-coin.ready {
  display: block;
  animation: coinIdleFloat 2.2s ease-in-out infinite;
}

@keyframes coinIdleFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
    filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.75)) drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6));
  }
  50% {
    transform: translateY(-10px) rotate(4deg);
    filter: drop-shadow(0 0 28px rgba(245, 158, 11, 0.95)) drop-shadow(0 18px 22px rgba(0, 0, 0, 0.4));
  }
}

.coin-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7a1 0%, #f59e0b 45%, #b45309 85%, #78350f 100%);
  border: 4px solid #fef08a;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8), inset 0 -3px 6px rgba(0, 0, 0, 0.6), 0 0 0 2px #92400e;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.coin-rim {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 2px dashed rgba(254, 240, 138, 0.85);
  pointer-events: none;
}

.coin-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Press Start 2P', monospace;
  color: #78350f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 -1px 0 rgba(0, 0, 0, 0.3);
  line-height: 1.1;
  pointer-events: none;
}

.coin-star {
  font-size: 8px;
  color: #92400e;
}
.coin-title {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
}
.coin-sub {
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 1px;
}

.coin-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.45) 50%, transparent 60%);
  animation: coinShinePass 3.5s infinite;
  pointer-events: none;
}
@keyframes coinShinePass {
  0% { transform: translateX(-100%); }
  25%, 100% { transform: translateX(100%); }
}

/* Prompt badge above landed coin */
.coin-hint-badge {
  display: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #39ff14;
  background: #0d0a1a;
  border: 1px solid #39ff14;
  padding: 6px 12px;
  border-radius: 4px;
  margin-top: 8px;
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.4);
  animation: hintBlink 1.4s infinite alternate;
  pointer-events: none;
  white-space: nowrap;
}
.coin-hint-badge.visible {
  display: block;
}
@keyframes hintBlink {
  0% { transform: translateY(0); opacity: 0.85; }
  100% { transform: translateY(-4px); opacity: 1; box-shadow: 0 0 25px rgba(57, 255, 20, 0.8); }
}

/* Flying Coin during drop animation */
.flying-arcade-coin {
  position: fixed;
  z-index: 10001;
  width: 72px;
  height: 72px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 30px #f59e0b);
}

/* Arcade Cabinet Shell */
.arcade-cabinet {
  width: 320px;
  background: #110d21;
  border-radius: 14px 14px 4px 4px;
  border: 4px solid #231b40;
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.85), 0 0 30px rgba(57, 255, 20, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Top Marquee */
.arcade-marquee {
  background: #080512;
  border-bottom: 3px solid #281e4a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  box-shadow: inset 0 0 20px rgba(57, 255, 20, 0.2);
}
.marquee-sign {
  display: flex;
  align-items: center;
  gap: 6px;
}
.marquee-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #39ff14;
  text-shadow: 0 0 10px #39ff14, 0 0 20px rgba(57, 255, 20, 0.7);
  letter-spacing: 1px;
}
.marquee-star {
  font-size: 9px;
  color: #ff007f;
  text-shadow: 0 0 8px #ff007f;
  animation: pulseStar 0.8s infinite alternate;
}
@keyframes pulseStar {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.2); opacity: 1; }
}
.marquee-chase {
  display: flex;
  gap: 4px;
}
.marquee-chase i {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffcc00;
  box-shadow: 0 0 6px #ffcc00;
  animation: marqueeBlink 0.6s infinite alternate;
}
.marquee-chase i:nth-child(2) { animation-delay: 0.2s; background: #00f0ff; box-shadow: 0 0 6px #00f0ff; }
.marquee-chase i:nth-child(3) { animation-delay: 0.4s; background: #ff007f; box-shadow: 0 0 6px #ff007f; }
@keyframes marqueeBlink {
  0% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.1); }
}

/* CRT Screen Housing & Glass */
.arcade-screen-housing {
  padding: 14px 14px 10px;
  background: #0d0a1a;
  border-bottom: 3px solid #231b40;
}
.arcade-crt-screen {
  position: relative;
  background: #030206;
  border: 3px solid #1a152e;
  border-radius: 10px;
  height: 180px;
  overflow: hidden;
  box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.95), 0 0 15px rgba(57, 255, 20, 0.1);
  display: flex;
  flex-direction: column;
}

.crt-scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 26, 0) 50%, rgba(0, 0, 0, 0.45) 50%);
  background-size: 100% 3px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.85;
}
.crt-glare {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 6;
}

/* Screen Content */
.screen-content {
  position: relative;
  z-index: 4;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 10px;
  font-family: 'Press Start 2P', monospace;
  color: #fff;
}
.screen-header {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  color: #ff0055;
  letter-spacing: 0.5px;
}
.screen-hiscore {
  color: #00f0ff;
}
.screen-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.pixel-invader-anim {
  font-size: 26px;
  animation: invaderBounce 0.8s infinite alternate;
}
@keyframes invaderBounce {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-5px) scale(1.1); filter: drop-shadow(0 0 8px #39ff14); }
}
.screen-status-text {
  font-size: 8px;
  color: #39ff14;
  text-shadow: 0 0 8px #39ff14;
  animation: statusFlicker 1.2s infinite;
}
@keyframes statusFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.screen-sub-text {
  font-size: 6px;
  color: #ffaa00;
  letter-spacing: 0.5px;
}
.screen-footer {
  display: flex;
  justify-content: space-between;
  font-size: 6.5px;
  color: #a855f7;
}

/* Control Deck */
.arcade-control-deck {
  background: #181330;
  border-bottom: 3px solid #251e45;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 3px 6px rgba(255, 255, 255, 0.05);
}
.joystick-assembly {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.joystick-base {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #090714;
  border: 2px solid #2b224d;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8);
}
.joystick-stick {
  position: absolute;
  width: 8px;
  height: 24px;
  background: linear-gradient(to right, #71717a, #e4e4e7, #71717a);
  border-radius: 4px;
  bottom: 14px;
  transform-origin: bottom center;
  transition: transform 0.15s ease-out;
}
.joystick-ball {
  position: absolute;
  top: -14px;
  left: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff6b6b 0%, #dc2626 60%, #7f1d1d 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}
.joystick-assembly:hover .joystick-stick {
  transform: rotate(-12deg);
}

.deck-buttons {
  display: flex;
  gap: 8px;
}
.arcade-deck-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #000;
  cursor: pointer;
  box-shadow: 0 4px 0 #000, 0 5px 8px rgba(0, 0, 0, 0.5);
  transition: transform 0.08s, box-shadow 0.08s;
}
.arcade-deck-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #000;
}
.btn-blue {
  background: radial-gradient(circle at 35% 30%, #38bdf8 0%, #0284c7 70%, #0369a1 100%);
}
.btn-yellow {
  background: radial-gradient(circle at 35% 30%, #fef08a 0%, #eab308 70%, #a16207 100%);
}
.btn-red {
  background: radial-gradient(circle at 35% 30%, #f87171 0%, #ef4444 70%, #991b1b 100%);
}

/* Lower Cabinet: Coin Door */
.arcade-coin-door {
  background: #0f0c1c;
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.coin-door-bezel {
  width: 170px;
  background: #19142b;
  border: 2px solid #2f2552;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8);
}
.coin-slot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px dashed rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
}
.coin-slot-wrapper:hover,
.coin-slot-wrapper.slot-highlight {
  border-color: #39ff14;
  background: rgba(57, 255, 20, 0.1);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.5);
}
.coin-slot-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 5px;
  color: #ffaa00;
  letter-spacing: 0.5px;
}
.coin-slot-entry {
  width: 34px;
  height: 18px;
  background: #06040a;
  border: 2px solid #f59e0b;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
.slot-slit {
  width: 22px;
  height: 3px;
  background: #000;
  border-radius: 1px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 1);
}
.coin-slot-arrow {
  font-family: 'Press Start 2P', monospace;
  font-size: 5px;
  color: #39ff14;
  animation: slotArrowPulse 1s infinite alternate;
}
@keyframes slotArrowPulse {
  0% { transform: translateY(0); opacity: 0.5; }
  100% { transform: translateY(2px); opacity: 1; }
}

.coin-reject-pocket {
  width: 22px;
  height: 22px;
  background: #08060f;
  border: 2px solid #231b40;
  border-radius: 3px;
}
.coin-key-lock {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, #71717a 0%, #27272a 100%);
  border: 1px solid #52525b;
}
.coin-door-grille {
  display: flex;
  gap: 4px;
}
.coin-door-grille span {
  width: 18px;
  height: 3px;
  background: #1a152e;
  border-radius: 1px;
}

/* ==========================================================================
   RETRO ARCADE MINI-GAME MODAL DIALOG
   ========================================================================== */
.arcade-game-dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 620px;
  width: 95vw;
  border-radius: 14px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95), 0 0 50px rgba(57, 255, 20, 0.35);
}
.arcade-game-dialog::backdrop {
  background: rgba(4, 2, 10, 0.88);
  backdrop-filter: blur(6px);
}
.arcade-modal-inner {
  background: #0d0a1b;
  border: 4px solid #2e2354;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.arcade-modal-header {
  background: #150f2e;
  border-bottom: 2px solid #3d2f6e;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.arcade-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: #39ff14;
  text-shadow: 0 0 10px #39ff14;
}
.arcade-modal-controls {
  display: flex;
  gap: 8px;
}
.arcade-icon-btn {
  background: #251c47;
  border: 1px solid #4a3a80;
  color: #fff;
  border-radius: 4px;
  font-size: 13px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.arcade-icon-btn:hover {
  background: #382b68;
  border-color: #39ff14;
}
.arcade-icon-btn.close-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

.arcade-canvas-wrapper {
  position: relative;
  background: #020106;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-bottom: 2px solid #2e2354;
}
#arcadeCanvas {
  display: block;
  max-width: 100%;
  height: auto;
  aspect-ratio: 560 / 500;
  background: #020106;
}
.canvas-crt-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 26, 0) 50%, rgba(0, 0, 0, 0.4) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.85);
}

.arcade-touch-bar {
  background: #110d24;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.touch-nav-group, .touch-action-group {
  display: flex;
  gap: 8px;
}
.touch-btn {
  background: #231b40;
  border: 2px solid #403270;
  color: #fff;
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 3px 0 #000;
  transition: transform 0.05s, box-shadow 0.05s;
}
.touch-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #000;
}
.touch-fire-btn {
  background: #dc2626;
  border-color: #ef4444;
  color: #fff;
  font-size: 10px;
  box-shadow: 0 3px 0 #7f1d1d, 0 0 10px rgba(239, 68, 68, 0.5);
}
.touch-hint {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #a1a1aa;
  text-align: center;
  letter-spacing: 0.5px;
}

@media (max-width: 600px) {
  .arcade-modal-title {
    font-size: 8px;
  }
  .touch-hint {
    display: none;
  }
  .touch-btn {
    padding: 8px 10px;
    font-size: 10px;
  }
}
