:root {
  --bg: #07111f;
  --bg2: #0c1d33;
  --card: rgba(255, 255, 255, 0.08);
  --inner: rgba(255,255,255,0.06);
  --border: rgba(255, 255, 255, 0.16);
  --text: #f4f7fb;
  --muted: #b5c1d1;
  --accent: #67e8f9;
  --accent-2: #a78bfa;
  --danger: #ff4d6d;
  --gold: #ffd166;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, #12233f 0%, transparent 35%),
    radial-gradient(circle at bottom right, #1d1242 0%, transparent 30%),
    linear-gradient(135deg, var(--bg), var(--bg2));
  overflow-x: hidden;
}

button {
  font: inherit;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
  pointer-events: none;
}

.bg-orb {
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}

.orb-1 {
  top: -80px;
  left: -80px;
  background: #00d9ff;
}

.orb-2 {
  right: -100px;
  bottom: -100px;
  background: #7c3aed;
}

.app-shell {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 20px 56px;
}

.glass {
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.glass-inner {
  background: var(--inner);
  border: 1px solid rgba(255,255,255,0.12);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 20px;
  border-radius: 28px;
  padding: 24px 28px;
  margin-bottom: 18px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-text h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.95;
}

.subtext {
  margin-top: 16px;
  max-width: 650px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.made-by {
  margin-top: 16px;
  margin-bottom: 0;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-side {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.stat-box {
  border-radius: 22px;
  padding: 18px;
  text-align: center;
  min-height: 110px;
  display: grid;
  align-content: center;
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.value {
  font-size: 2rem;
  font-weight: 800;
}

.small-value {
  font-size: 1.1rem;
}

.nav-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border-radius: 22px;
  margin-bottom: 22px;
}

.nav-btn {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06111c;
}

.screen {
  display: none;
}

.active-screen {
  display: block;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.home-game-card {
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 26px;
  min-height: 280px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(103, 232, 249, 0.4);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.home-game-top h2 {
  margin: 12px 0 10px;
  font-size: 2rem;
}

.home-game-card p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}

.home-badge {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(103, 232, 249, 0.12);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.home-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--accent);
  font-weight: 700;
}

.game-card {
  border-radius: 28px;
  padding: 24px;
  width: 100%;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.top-bar h2 {
  margin: 0 0 6px;
}

.top-bar p {
  margin: 0;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.score-pill {
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  min-height: 46px;
  display: grid;
  align-content: center;
}

.btn {
  border: none;
  border-radius: 16px;
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover,
.nav-btn:hover,
.coin-button:hover {
  transform: translateY(-2px);
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06111c;
  box-shadow: 0 10px 30px rgba(103, 232, 249, 0.35);
}

.secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
}

.game-area,
.large-game-panel {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    radial-gradient(circle at center, rgba(103, 232, 249, 0.06), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

.game-area {
  position: relative;
  height: 560px;
}

.large-game-panel {
  min-height: 560px;
  padding: 26px;
}

.player,
.enemy,
.coin {
  position: absolute;
  border-radius: 14px;
}

.player {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #ffffff, var(--accent));
  box-shadow: 0 0 24px rgba(103, 232, 249, 0.85);
}

.enemy {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #ff7b93, var(--danger));
  box-shadow: 0 0 18px rgba(255, 77, 109, 0.7);
}

.coin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff3bf, var(--gold));
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.75);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 8, 18, 0.3);
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  padding: 24px 28px;
  border-radius: 24px;
  text-align: center;
  max-width: 320px;
}

.overlay-card h3 {
  margin-top: 0;
  font-size: 1.6rem;
}

.overlay-card p {
  color: var(--muted);
}

.tiny {
  font-size: 0.9rem;
}

.clicker-area {
  min-height: 430px;
  display: grid;
  place-items: center;
}

.coin-button {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  font-size: 4.5rem;
  cursor: pointer;
  background: radial-gradient(circle at 30% 30%, #fff3bf, var(--gold));
  box-shadow: 0 0 35px rgba(255, 209, 102, 0.55);
}

.coin-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.center-message {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 4px;
}

.memory-card {
  height: 140px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 2.4rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.memory-card:hover {
  transform: translateY(-2px);
}

.memory-card.revealed,
.memory-card.matched {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06111c;
}

@media (max-width: 1000px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .game-area,
  .large-game-panel {
    min-height: auto;
  }

  .game-area {
    height: 460px;
  }

  .memory-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding: 14px 14px 36px;
  }

  .hero-text h1 {
    font-size: 2.8rem;
  }

  .hero-side {
    grid-template-columns: 1fr;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .game-area {
    height: 400px;
  }

  .large-game-panel {
    min-height: 420px;
    padding: 18px;
  }

  .memory-card {
    height: 100px;
    font-size: 2rem;
  }

  .coin-button {
    width: 140px;
    height: 140px;
    font-size: 3.5rem;
  }

  .home-game-card {
    min-height: 220px;
  }
}
