:root {
  --ink: #0a0a0a;
  --bone: #f4f1e4;
  --toxic: #a7e34b;       /* Beetlejuice green */
  --royal: #6b2fa5;       /* his coat's purple */
  --blood: #c1272d;
  --stripe-w: 44px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Special Elite', 'Courier New', monospace;
  color: var(--ink);
  background: var(--bone);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Vertical stripe background — the signature. */
.stripes-bg {
  position: fixed; inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    var(--ink) 0 var(--stripe-w),
    var(--bone) var(--stripe-w) calc(var(--stripe-w) * 2)
  );
  opacity: 0.08;
  z-index: -1;
  pointer-events: none;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 28px;
  border-bottom: 3px solid var(--ink);
  background: var(--bone);
  position: relative;
}
.topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -10px; height: 7px;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 12px, transparent 12px 24px);
}
.logo {
  font-family: 'Creepster', cursive;
  font-size: 44px;
  letter-spacing: 3px;
  margin: 0;
  color: var(--ink);
  text-shadow: 3px 3px 0 var(--toxic), 6px 6px 0 var(--royal);
}
.logo span { color: var(--royal); }
.logo-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  transition: transform .1s;
}
.logo-link:hover { transform: rotate(-1deg) scale(1.02); }

nav { display: flex; gap: 14px; }
.ghost-link {
  background: transparent;
  border: 2px dashed var(--ink);
  color: var(--ink);
  padding: 6px 14px;
  font-family: 'Special Elite', monospace;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s, background .1s;
}
.ghost-link:hover { background: var(--toxic); transform: rotate(-1deg); }
select.ghost-link {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 24px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
                    linear-gradient(-45deg, transparent 50%, var(--ink) 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 7px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* ---------- records banner ---------- */
.records-banner {
  position: relative;
  margin: 0;
  background: var(--ink);
  color: var(--toxic);
  padding: 10px 0;
  overflow: hidden;
  border-bottom: 3px solid var(--toxic);
}
.records-label {
  position: absolute; left: 0; top: 0; bottom: 0;
  display: flex; align-items: center;
  padding: 0 18px;
  background: var(--blood);
  color: var(--bone);
  font-family: 'Rubik Mono One', sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  z-index: 2;
  box-shadow: 4px 0 0 var(--ink);
}
.records-track {
  display: flex; gap: 50px;
  padding-left: 180px;
  white-space: nowrap;
  animation: marquee 35s linear infinite;
  font-size: 18px;
}
.records-track .rec strong { color: var(--bone); }
.records-track .rec .score { color: var(--toxic); font-weight: bold; }
.records-track .rec .game { color: #ffb6ff; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- main grid ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 36px 24px 60px; }

.section-heading {
  font-family: 'Creepster', cursive;
  font-size: 36px;
  letter-spacing: 2px;
  margin: 0 0 24px;
  color: var(--royal);
  transform: rotate(-1.5deg);
  display: inline-block;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.empty { opacity: .7; font-size: 18px; }

.card {
  background: var(--bone);
  border: 3px solid var(--ink);
  position: relative;
  padding: 0;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 6px 6px 0 var(--ink);
}
.card:hover {
  transform: translate(-2px, -2px) rotate(-.5deg);
  box-shadow: 10px 10px 0 var(--royal);
}
.card:nth-child(3n) { transform: rotate(.6deg); }
.card:nth-child(3n):hover { transform: translate(-2px, -2px) rotate(-.5deg); }

.card-thumb {
  aspect-ratio: 16/10;
  background: repeating-linear-gradient(45deg,
    var(--ink) 0 10px, var(--bone) 10px 20px);
  border-bottom: 3px solid var(--ink);
  background-size: cover;
  background-position: center;
}
.card-body { padding: 14px 16px 18px; }
.card-title {
  font-family: 'Creepster', cursive;
  font-size: 26px;
  letter-spacing: 1px;
  margin: 0 0 6px;
  color: var(--ink);
}
.card-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  max-height: 3.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(10,10,10,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--bone);
  border: 4px solid var(--ink);
  box-shadow: 10px 10px 0 var(--royal);
  max-width: 720px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  padding: 26px 28px 30px;
  position: relative;
}
.modal-card h3 {
  font-family: 'Creepster', cursive;
  font-size: 34px;
  margin: 0 0 10px;
  color: var(--royal);
}
.modal-close {
  position: absolute; top: 8px; right: 14px;
  background: transparent; border: none;
  font-size: 34px; line-height: 1; cursor: pointer;
  color: var(--ink);
}
.screens { display: flex; gap: 10px; overflow-x: auto; padding: 8px 0 14px; }
.screens img {
  height: 160px;
  border: 2px solid var(--ink);
  flex-shrink: 0;
}
.scores-wrap h4 {
  font-family: 'Creepster', cursive;
  color: var(--blood);
  margin: 20px 0 6px;
  font-size: 22px;
  letter-spacing: 1px;
}
.scores {
  list-style: none; padding: 0; margin: 0 0 16px;
  border: 2px dashed var(--ink);
}
.scores li {
  display: flex; justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px dashed rgba(0,0,0,.3);
  font-size: 15px;
}
.scores li:last-child { border-bottom: none; }
.scores li:nth-child(odd) { background: rgba(167,227,75,.15); }
.scores .rank { width: 30px; font-weight: bold; }
.scores .name { flex: 1; padding: 0 10px; }
.scores .pts  { font-family: 'Rubik Mono One', sans-serif; color: var(--royal); }

.launch-btn {
  display: inline-block;
  background: var(--toxic);
  color: var(--ink);
  font-family: 'Rubik Mono One', sans-serif;
  padding: 14px 34px;
  font-size: 22px;
  letter-spacing: 3px;
  text-decoration: none;
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform .1s, box-shadow .1s;
}
.launch-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--royal);
}

/* Typewriter cursor while a translation is streaming in from the backend. */
.typing::after {
  content: '▍';
  color: var(--royal);
  margin-left: 2px;
  animation: caret 0.9s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

footer {
  text-align: center;
  padding: 30px 10px;
  font-size: 12px;
  opacity: .6;
  border-top: 2px dashed var(--ink);
  margin-top: 40px;
}
footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
}
footer a:hover { color: var(--royal); }
