:root, [data-theme="arcade"] {
  --bg: #0a0a18;
  --bg-2: #12122a;
  --fg: #f4f4ff;
  --muted: #8a8aaa;
  --accent: #ffd84d;
  --accent-2: #4ec0ca;
  --card: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Decorative animated background */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  animation: gridDrift 30s linear infinite;
  pointer-events: none;
}
@keyframes gridDrift {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 40px 40px, 40px 40px; }
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(255,216,77,0.10), transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(78,192,202,0.12), transparent 70%);
  pointer-events: none;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 56px) clamp(16px, 4vw, 40px) 40px;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 56px);
  animation: fadeUp 0.6s ease-out;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-logo-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}
.hero-logo {
  display: block;
  margin: 0 auto;
  width: clamp(220px, 50vw, 460px);
  height: auto;
  animation: heroIn 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) backwards;
  filter: drop-shadow(0 8px 30px rgba(255, 216, 77, 0.18));
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-sub {
  margin: 0 auto;
  max-width: 540px;
  font-size: clamp(14px, 2vw, 17px);
  color: var(--muted);
  line-height: 1.5;
  font-family: var(--font-body, inherit);
}

.hero-stats {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 8px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}
.hero-stats strong {
  color: var(--fg);
  font-weight: 700;
  transition: color 0.4s ease, text-shadow 0.4s ease, transform 0.3s ease;
}
.hero-stats .sep {
  color: var(--muted);
  opacity: 0.55;
  font-size: 14px;
  line-height: 1;
  user-select: none;
}

/* Card grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(14px, 2vw, 22px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transform-style: preserve-3d;
  transform: perspective(800px) rotateX(var(--tilt-x, 0)) rotateY(var(--tilt-y, 0));
  transition: transform 0.15s ease-out, border-color 0.2s ease, box-shadow 0.25s ease;
  animation: cardIn 0.55s ease-out backwards;
  will-change: transform;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.12s; }
.card:nth-child(3) { animation-delay: 0.19s; }
.card:nth-child(4) { animation-delay: 0.26s; }

.card:hover, .card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 14px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--accent), 0 0 30px -8px var(--accent);
  outline: none;
}
.card:active { transform: perspective(800px) rotateX(var(--tilt-x, 0)) rotateY(var(--tilt-y, 0)) scale(0.99); }

.card-art {
  position: relative;
  height: 140px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.85;
}
.card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--shine-x, 50%) var(--shine-y, 50%),
    rgba(255, 255, 255, 0.25) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 3;
}
.card:hover .card-art::after { opacity: 1; }
.card-emoji {
  position: relative;
  font-size: 64px;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.4));
  transition: transform 0.3s ease;
  z-index: 1;
}
.card:hover .card-emoji { transform: scale(1.12) rotate(-4deg); }

.card-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 1;
  transition: transform 0.4s ease;
}
.card:hover .card-art-img { transform: scale(1.06); }

.badge-new {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 2;
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.card-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.card-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  text-transform: uppercase;
  opacity: 0.9;
}
.card-blurb {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}

.card-stats {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.card-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 11px;
}
.card-stat span { color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.card-stat strong { font-size: 16px; font-weight: 800; color: var(--fg); }
.card-stat.empty strong { color: var(--muted); font-weight: 500; }

.card-cta {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-cta span { transition: transform 0.2s ease; }
.card:hover .card-cta span { transform: translateX(4px); }

/* Footer */
.foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  border-image: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent) 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.foot-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.foot-mark {
  width: 20px;
  height: 20px;
  opacity: 0.6;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
}
.foot a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.foot a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .card { transform: none !important; }
  .hero-logo { animation: none !important; }
}

@media (max-width: 540px) {
  .hero-stats { font-size: 12px; }
  .card-art { height: 120px; }
  .card-emoji { font-size: 52px; }
}

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

.arcade-fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  color: var(--fg, #fff);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.1s ease, background 0.15s ease;
}
.arcade-fab:hover {
  background: var(--accent, #ffd84d);
  color: #000;
}
.arcade-fab:active {
  transform: scale(0.92);
}

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: radial-gradient(ellipse at center, #1a1a3a 0%, #0a0a18 70%);
  animation: introBgIn 0.6s ease-out;
}
.intro-overlay.intro-fade-out {
  animation: introFadeOut 0.45s ease-in forwards;
  pointer-events: none;
}
.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.intro-mark {
  width: clamp(80px, 20vw, 160px);
  height: auto;
  filter: drop-shadow(0 0 30px rgba(255, 216, 77, 0.5));
  animation: introScaleIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) backwards;
  animation-delay: 0.1s;
}
.intro-wordmark {
  width: clamp(180px, 40vw, 360px);
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(255, 216, 77, 0.18));
  animation: introScaleIn 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) backwards;
  animation-delay: 0.25s;
}
@keyframes introBgIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes introScaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes introFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
body.intro-playing { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .intro-overlay { display: none !important; }
}
