/* ── Reset ─────────────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0a0a0f;
  color: #eee;
  font-family: 'Press Start 2P', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Arcade container ──────────────────────────────────────────────────────── */
#arcade {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
#header {
  text-align: center;
  margin-bottom: 44px;
  position: relative;
}

#header .title {
  font-size: 28px;
  color: #ffdd00;
  text-shadow: 0 0 24px rgba(255,220,0,0.45), 0 3px 0 #6a3800;
  letter-spacing: 3px;
  margin-bottom: 10px;
}

#header .subtitle {
  font-size: 10px;
  color: #888;
  letter-spacing: 2px;
}

#langToggle {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 6px 12px;
  background: #1a1a2e;
  color: #aaa;
  border: 1px solid #3a3a5a;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 1px;
}

#langToggle:hover {
  color: #ffdd00;
  border-color: #ffdd00;
}

/* ── Game grid ─────────────────────────────────────────────────────────────── */
#games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  justify-items: center;
}

/* ── Card ──────────────────────────────────────────────────────────────────── */
.card {
  display: block;
  width: 100%;
  max-width: 320px;
  background: #161620;
  border: 2px solid #2a2a3a;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
  text-decoration: none;
  color: inherit;
}

.card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #ffdd00;
  box-shadow: 0 8px 36px rgba(255,220,0,0.18), 0 0 0 1px #ffdd00;
}

.card canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.card-info {
  padding: 14px 16px 18px;
}

.card-info h2 {
  font-size: 14px;
  color: #fff;
  margin-bottom: 3px;
}

.card-en {
  font-size: 8px;
  color: #666;
  margin-bottom: 10px;
}

html[lang="en"] .card-en {
  display: none;
}

.card-desc {
  font-size: 7px;
  color: #aaa;
  line-height: 1.6;
  margin-bottom: 14px;
}

.tag {
  display: inline-block;
  font-size: 8px;
  padding: 5px 14px;
  border-radius: 4px;
  font-weight: bold;
}

.tag.play {
  background: #1b5e20;
  color: #66ff66;
  animation: pulse 1.4s ease-in-out infinite;
}

.tag.soon {
  background: #222;
  color: #555;
}

/* coming-soon: grey out */
.card.coming-soon {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.card.coming-soon canvas {
  filter: grayscale(0.7) brightness(0.5);
}

/* ── Donate ────────────────────────────────────────────────────────────────── */
#donate {
  text-align: center;
  margin-top: 36px;
  position: relative;
  display: inline-block;
  width: 100%;
}

.donate-trigger {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #ff6b6b;
  padding: 8px 20px;
  border: 1px solid #ff6b6b44;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 1px;
}

.donate-trigger:hover {
  color: #ffdd00;
  border-color: #ffdd00;
  box-shadow: 0 0 16px rgba(255,220,0,0.2);
  text-shadow: 0 0 8px rgba(255,220,0,0.4);
}

.donate-popup {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: #1a1a2e;
  border: 2px solid #ff6b6b55;
  border-radius: 12px;
  padding: 20px 24px 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 20px rgba(255,107,107,0.1);
  pointer-events: none;
}

.donate-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #ff6b6b55;
}

#donate:hover .donate-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.donate-title {
  font-size: 8px;
  color: #ffdd00;
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.8;
  max-width: 320px;
}

.qrcodes {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 12px;
}

.qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.qr-img {
  width: 140px;
  height: 140px;
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.qr-label {
  font-size: 8px;
  color: #aaa;
  letter-spacing: 1px;
}

.donate-hint {
  font-size: 7px;
  color: #ff6b6b;
  text-align: center;
  margin-top: 4px;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
#footer {
  text-align: center;
  margin-top: 48px;
  font-size: 7px;
  color: #444;
  letter-spacing: 1px;
}

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ── Scanline overlay (subtle CRT feel) ────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.06) 0px,
    rgba(0,0,0,0.06) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
}
