@import url('https://fonts.googleapis.com/css2?family=Chewy&family=Griffy&family=Mountains+of+Christmas:wght@700&family=Nunito:wght@400;600;800&display=swap');

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; min-height: 100%;
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-deep);
  overflow-x: hidden;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  background-attachment: fixed;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* --------------------------- LAYOUT SHELL -------------------------------- */
.arcade-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem;
  padding: .8rem 1rem;
  background: rgba(11, 7, 19, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--accent);
}
.arcade-header .brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: .5px;
  color: var(--accent-3);
  text-shadow: var(--glow);
  white-space: nowrap;
}
.arcade-header .back-link {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem .8rem;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid rgba(255,255,255,.12);
  font-weight: 800;
  font-size: .85rem;
}
.arcade-header .back-link:active { transform: scale(.96); }

main.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.hero {
  text-align: center;
  padding: 1.5rem 1rem 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.2rem);
  margin: 0 0 .35rem;
  color: var(--accent-3);
  text-shadow: var(--glow);
}
.hero p {
  color: var(--text-muted);
  margin: 0;
  font-weight: 600;
}

/* ----------------------------- GAME GRID --------------------------------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.game-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .5rem;
  padding: 1.4rem .8rem;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--bg-panel), var(--bg-mid));
  border: 2px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.game-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent), transparent 60%);
  opacity: 0.12;
  pointer-events: none;
}
.game-card:active { transform: scale(.96); }
.game-card:hover { border-color: var(--accent); box-shadow: 0 10px 30px rgba(0,0,0,.5), var(--glow); }
.game-card .icon { font-size: 2.6rem; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.game-card .title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-main);
}
.game-card .tag {
  font-size: .68rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bg-deep);
  background: var(--accent-3);
  padding: .15rem .5rem;
  border-radius: 999px;
}
.game-card.coming-soon { opacity: .5; filter: grayscale(.4); }
.game-card.coming-soon .tag { background: var(--text-muted); }

/* ------------------------------ BUTTONS ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .7rem 1.2rem;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #1a1027;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
  transition: transform .1s ease;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn.secondary { background: var(--bg-panel); color: var(--text-main); border: 1px solid rgba(255,255,255,.15); }
.btn.ghost { background: transparent; color: var(--text-main); border: 1px solid rgba(255,255,255,.2); box-shadow: none; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* ------------------------------ TOASTS ------------------------------------ */
.toast-stack {
  position: fixed; top: 4.2rem; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: .5rem;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  padding: .8rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  animation: toast-in .25s ease, toast-out .4s ease 2.2s forwards;
  font-family: var(--font-display);
  letter-spacing: .02em;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.9);} to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(.95); } }

/* ------------------------------ MODAL -------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  display: none; align-items: center; justify-content: center; z-index: 300;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-panel);
  border: 2px solid var(--accent);
  border-radius: 20px;
  padding: 1.6rem;
  max-width: 360px; width: 100%;
  text-align: center;
  box-shadow: var(--glow), 0 20px 50px rgba(0,0,0,.6);
}
.modal h2 { font-family: var(--font-display); margin-top: 0; color: var(--accent-3); font-size: 1.6rem; }
.modal p { color: var(--text-muted); font-weight: 600; }
.modal .modal-actions { display: flex; gap: .6rem; margin-top: 1.2rem; }

/* ---------------------------- DECORATIONS ---------------------------------- */
.deco-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.deco-item { position: absolute; top: -10%; font-size: 1.4rem; opacity: .55; animation: fall linear infinite; }
@keyframes fall {
  to { transform: translateY(115vh) rotate(360deg); }
}

footer.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: .78rem;
  padding: 1.5rem 1rem 2rem;
}

/* --------------------------- RESPONSIVE / DESKTOP --------------------------- */
@media (min-width: 700px) {
  main.container { padding: 2rem 1.5rem 4rem; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.4rem; }
}

/* Utility */
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: .6rem; }
.row { display: flex; align-items: center; gap: .6rem; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.small { font-size: .8rem; color: var(--text-muted); }
.hidden { display: none !important; }

/* section headings on the home screen */
.section-title { font-family: var(--font-display); color: var(--accent-3); text-shadow: var(--glow); font-size: 1.25rem; margin: 1.6rem 0 .7rem; letter-spacing: .02em; }
