*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-1: #fff8fc;
  --bg-2: #f6f4ff;
  --card-bg: rgba(255, 255, 255, 0.92);
  --text: #2f2440;
  --muted: #786d8a;
  --pink: #ff78b2;
  --pink-dark: #e05597;
  --purple: #9f7dff;
  --shadow: 0 18px 46px rgba(86, 53, 116, 0.14);
  --shadow-soft: 0 10px 24px rgba(86, 53, 116, 0.1);
}

html {
  direction: rtl;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(255, 203, 227, 0.55), transparent 28%),
    radial-gradient(circle at bottom left, rgba(215, 223, 255, 0.72), transparent 34%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2));
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
}

.game-page {
  min-height: 100vh;
  padding: 20px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-shell {
  width: min(100%, 920px);
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.back-link,
.brand-badge {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-soft);
  font-weight: 700;
}

.back-link {
  color: var(--muted);
}

.brand-badge {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
}

.game-card {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  border-radius: 32px;
  padding: 24px;
}

.header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.game-kicker {
  margin: 0 0 8px;
  color: var(--pink-dark);
  font-size: 14px;
  font-weight: 800;
}

.title {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.1;
  margin-bottom: 10px;
}

.game-desc {
  color: var(--muted);
  line-height: 1.9;
  font-size: 15px;
  max-width: 620px;
}

.scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  font-size: 0.95rem;
}

.score-label,
.lives-label {
  background: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(120, 109, 138, 0.14);
  box-shadow: var(--shadow-soft);
}

.restart-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.restart-btn:hover {
  opacity: 0.92;
}

.restart-btn:active {
  transform: translateY(1px);
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

canvas {
  border-radius: 18px;
  border: 2px solid #0ff;
  background: #000016;
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.3);
  max-width: 100%;
  height: auto;
}

.hint {
  font-size: 0.9rem;
  opacity: 0.75;
  text-align: center;
  color: var(--muted);
}

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

  .scoreboard {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .game-page {
    padding: 14px 10px;
    align-items: flex-start;
  }

  .game-card {
    padding: 16px;
    border-radius: 24px;
  }

  .title {
    font-size: 1.9rem;
  }

  canvas {
    width: 100%;
  }

  .hint {
    font-size: 0.8rem;
  }
}