/* Explora 3D — shared dark, eye-friendly theme */
:root {
  --bg-0: #080a18;
  --bg-1: #10142c;
  --bg-2: #1a1f45;
  --panel: rgba(24, 29, 64, 0.62);
  --panel-border: rgba(140, 160, 255, 0.16);
  --text: #e9ecff;
  --text-dim: #a3abd6;
  --accent: #8ea6ff;
  --accent-2: #ff9ec4;
  --yellow: #ffd479;
  --green: #7ee2b8;
  --radius: 18px;
  --font: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 75% -10%, rgba(120, 90, 255, 0.22), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(40, 160, 220, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Soft twinkling stars */
.stars, .stars::after {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 72%, #fff6 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 58% 28%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 81% 64%, #fff5 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 92% 12%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 47% 91%, #fff5 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 6% 55%, #fff6 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 45%, #fff4 50%, transparent 51%);
  background-size: 640px 640px;
}
.stars::after { content: ''; background-size: 420px 420px; background-position: 120px 80px; animation: twinkle 6s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .25; } to { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .stars::after { animation: none; } }

a { color: inherit; }

/* ---------- Top bar ---------- */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 14px;
  padding: 14px clamp(16px, 4vw, 40px);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: 1.35rem; letter-spacing: .3px; text-decoration: none;
}
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: conic-gradient(from 200deg, #8ea6ff, #ff9ec4, #ffd479, #7ee2b8, #8ea6ff);
  box-shadow: 0 0 22px rgba(142, 166, 255, .45);
  font-size: 1.2rem;
}
.brand-logo span { filter: drop-shadow(0 1px 1px #0006); }
.brand small { display: block; font-weight: 600; font-size: .72rem; color: var(--text-dim); letter-spacing: 0; }
.spacer { flex: 1; }

.lang-select {
  appearance: none; -webkit-appearance: none;
  font: inherit; font-weight: 700; color: var(--text);
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a3abd6' d='M6 8 0 0h12z'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--panel-border); border-radius: 999px;
  padding: 9px 34px 9px 16px; cursor: pointer;
  backdrop-filter: blur(10px);
}
.lang-wrap { position: relative; }
.lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-select option { background: var(--bg-2); color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  font: inherit; font-weight: 800; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer; text-decoration: none;
  background: var(--panel); border: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(160, 180, 255, .4); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary {
  background: linear-gradient(135deg, #7d8cff, #c78bff);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 24px rgba(125, 140, 255, .35);
}
.btn.primary:hover { box-shadow: 0 10px 30px rgba(160, 140, 255, .5); }

/* ---------- Home page ---------- */
.home-main { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 10px clamp(16px, 4vw, 40px) 60px; }
.hero { text-align: center; padding: clamp(30px, 7vw, 80px) 0 clamp(24px, 4vw, 44px); }
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.6rem); margin: 0 0 12px; font-weight: 900; line-height: 1.1;
  background: linear-gradient(90deg, #b9c6ff, #ffb3d4 50%, #ffe09a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--text-dim); font-size: clamp(1rem, 2.2vw, 1.25rem); margin: 0; }

.section-title { font-size: 1.3rem; font-weight: 900; margin: 10px 0 18px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.5px; }

.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }

.card {
  position: relative; overflow: hidden;
  border-radius: 26px; border: 1px solid var(--panel-border);
  background: linear-gradient(160deg, rgba(40, 46, 100, .75), rgba(20, 24, 54, .8));
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card.playable:hover { transform: translateY(-4px); box-shadow: 0 26px 60px rgba(60, 50, 160, .45); }
.card-art {
  height: 190px; display: grid; place-items: center; position: relative;
  background:
    radial-gradient(circle at 50% 60%, rgba(255, 140, 180, .35), transparent 60%),
    radial-gradient(circle at 30% 30%, rgba(120, 160, 255, .35), transparent 55%),
    linear-gradient(180deg, #1d2358, #141836);
}
.card-art .emoji-stack { font-size: 4.2rem; display: flex; gap: 6px; filter: drop-shadow(0 8px 16px #0008); }
.card-art .emoji-stack span { display: inline-block; animation: bob 3s ease-in-out infinite; }
.card-art .emoji-stack span:nth-child(2) { animation-delay: .4s; }
.card-art .emoji-stack span:nth-child(3) { animation-delay: .8s; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .card-art .emoji-stack span { animation: none; } }
.badge-3d {
  position: absolute; top: 14px; right: 14px; font-weight: 900; font-size: .8rem;
  padding: 4px 10px; border-radius: 999px; background: #0007; border: 1px solid #fff2;
}
.card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.45rem; font-weight: 900; }
.card-body p { margin: 0; color: var(--text-dim); line-height: 1.45; flex: 1; }
.card-body .btn { align-self: flex-start; margin-top: 6px; }
.card.soon { opacity: .6; }
.card.soon .card-art { filter: grayscale(.5); }
.card.soon .card-art .emoji-stack { font-size: 3.4rem; }

.footer { position: relative; z-index: 1; text-align: center; color: var(--text-dim); padding: 24px; font-size: .9rem; }
