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

:root {
  --bg: #070a14;
  --card: #111827;
  --border: #29324a;
  --purple: #7657ff;
  --purple-dark: #5039c8;
  --green: #a7ff00;
  --text: #ffffff;
  --muted: #8f9ab8;
}

body {
  min-height: 100vh;

  background:
    radial-gradient(
      circle at 50% -10%,
      rgba(118, 87, 255, 0.18),
      transparent 38%
    ),
    #070a14;

  color: var(--text);

  font-family:
    Arial,
    Helvetica,
    sans-serif;
}


/* =========================
   HEADER
========================= */

.game-header {
  height: 72px;

  padding: 0 6%;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: rgba(7, 10, 20, 0.95);

  border-bottom: 1px solid #20273a;

  position: sticky;
  top: 0;

  z-index: 100;

  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  align-items: center;

  gap: 10px;

  text-decoration: none;

  color: white;

  font-size: 23px;
  font-weight: 900;
}

.logo-icon {
  width: 40px;
  height: 40px;

  display: grid;
  place-items: center;

  border-radius: 11px;

  background:
    linear-gradient(
      135deg,
      #7657ff,
      #4b35c5
    );

  box-shadow:
    0 8px 25px rgba(118, 87, 255, 0.25);
}

.back-btn {
  padding: 10px 16px;

  border-radius: 10px;

  border: 1px solid #303951;

  color: #aab4d0;

  text-decoration: none;

  font-size: 13px;

  font-weight: 700;

  transition: 0.25s ease;
}

.back-btn:hover {
  color: white;

  border-color: var(--purple);

  background: rgba(118, 87, 255, 0.12);
}


/* =========================
   PAGE
========================= */

.game-page {
  width: min(900px, 94%);

  margin: auto;

  padding: 55px 0 70px;
}


/* =========================
   HEADING
========================= */

.game-heading {
  text-align: center;

  margin-bottom: 28px;
}

.category-label {
  display: inline-block;

  padding: 8px 15px;

  border-radius: 50px;

  border: 1px solid rgba(118, 87, 255, 0.4);

  background: rgba(118, 87, 255, 0.08);

  color: #b7acff;

  font-size: 11px;

  font-weight: 900;

  letter-spacing: 1.3px;

  margin-bottom: 15px;
}

.game-heading h1 {
  font-size: clamp(42px, 6vw, 64px);

  font-weight: 950;

  letter-spacing: -2px;

  margin-bottom: 14px;

  background:
    linear-gradient(
      135deg,
      #ffffff,
      #a89aff
    );

  -webkit-background-clip: text;
  background-clip: text;

  color: transparent;
}

.game-heading p {
  color: var(--muted);

  font-size: 14px;

  line-height: 1.7;
}


/* =========================
   STATS
========================= */

.stats {
  display: flex;

  justify-content: center;

  gap: 12px;

  margin-bottom: 18px;
}

.stat-box {
  min-width: 115px;

  padding: 12px 18px;

  text-align: center;

  background: rgba(17, 24, 39, 0.9);

  border: 1px solid var(--border);

  border-radius: 12px;
}

.stat-box span {
  display: block;

  color: var(--muted);

  font-size: 10px;

  text-transform: uppercase;

  font-weight: 800;

  margin-bottom: 5px;
}

.stat-box strong {
  font-size: 20px;

  color: white;
}


/* =========================
   GAME CARD
========================= */

.game-card {
  padding: 22px;

  border-radius: 20px;

  border: 1px solid var(--border);

  background:
    linear-gradient(
      145deg,
      #0f1627,
      #090e1b
    );

  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.35);

  text-align: center;
}

.game-status {
  height: 35px;

  display: flex;

  align-items: center;
  justify-content: center;

  color: #aeb8d2;

  font-size: 13px;

  font-weight: 700;
}


/* =========================
   CANVAS
========================= */

#gameCanvas {
  display: block;

  width: min(420px, 100%);

  height: auto;

  margin: 0 auto;

  border-radius: 12px;

  border: 2px solid #293554;

  background: #101522;

  box-shadow:
    0 0 35px rgba(118, 87, 255, 0.12);
}


/* =========================
   ACTIONS
========================= */

.game-actions {
  display: flex;

  justify-content: center;

  gap: 10px;

  margin-top: 20px;
}

.start-btn,
.restart-btn {
  border: none;

  padding: 12px 20px;

  border-radius: 10px;

  color: white;

  font-weight: 850;

  cursor: pointer;

  transition: 0.2s ease;
}

.start-btn {
  background:
    linear-gradient(
      135deg,
      #7657ff,
      #553bd0
    );
}

.restart-btn {
  background: #1b2438;

  border: 1px solid #35405d;
}

.start-btn:hover,
.restart-btn:hover {
  transform: translateY(-2px);
}

.start-btn:hover {
  box-shadow:
    0 8px 25px rgba(118, 87, 255, 0.28);
}


/* =========================
   MOBILE CONTROLS
========================= */

.mobile-controls {
  display: none;

  justify-content: center;

  align-items: center;

  gap: 10px;

  margin-top: 18px;
}

.control-btn {
  width: 58px;
  height: 52px;

  border-radius: 12px;

  border: 1px solid #34405d;

  background: #151d31;

  color: white;

  font-size: 20px;

  font-weight: 900;

  cursor: pointer;

  touch-action: manipulation;
}

.control-btn:active {
  background: var(--purple);

  transform: scale(0.94);
}

.start-mobile {
  background:
    linear-gradient(
      135deg,
      #7657ff,
      #553bd0
    );
}


/* =========================
   INSTRUCTIONS
========================= */

.instructions {
  max-width: 650px;

  margin: 30px auto 0;

  padding-top: 25px;

  border-top: 1px solid #222b42;

  text-align: left;
}

.instructions h2 {
  font-size: 20px;

  margin-bottom: 14px;
}

.instructions p {
  color: #8994b1;

  font-size: 13px;

  line-height: 1.7;

  margin-bottom: 5px;
}

.instructions b {
  color: #dbe2f5;
}


/* =========================
   FOOTER
========================= */

.site-footer {
  padding: 25px;

  border-top: 1px solid #20273a;

  text-align: center;

  color: #68738f;

  font-size: 12px;
}


/* =========================
   TABLET
========================= */

@media (max-width: 700px) {

  .mobile-controls {
    display: flex;
  }

}


/* =========================
   MOBILE
========================= */

@media (max-width: 520px) {

  .game-header {
    height: 64px;

    padding: 0 18px;
  }

  .logo {
    font-size: 20px;
  }

  .logo-icon {
    width: 35px;
    height: 35px;

    font-size: 18px;
  }

  .back-btn {
    padding: 8px 11px;

    font-size: 11px;
  }

  .game-page {
    width: 94%;

    padding-top: 35px;
  }

  .game-heading h1 {
    font-size: 42px;
  }

  .game-heading p {
    font-size: 13px;
  }

  .stats {
    gap: 6px;
  }

  .stat-box {
    min-width: 0;

    flex: 1;

    padding: 10px 5px;
  }

  .stat-box strong {
    font-size: 17px;
  }

  .game-card {
    padding: 12px;

    border-radius: 15px;
  }

  .game-actions {
    flex-direction: column;
  }

  .start-btn,
  .restart-btn {
    width: 100%;
  }

}


/* =========================
   SMALL MOBILE
========================= */

@media (max-width: 360px) {

  .game-heading h1 {
    font-size: 36px;
  }

  .control-btn {
    width: 54px;
    height: 50px;
  }

}
