.retro-theme {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  color: #f4f7ff;
  background: radial-gradient(circle at top, #342d52 0%, #201a36 45%, #120f24 100%);
  overflow-x: hidden;
  position: relative;
  padding: 100px 12px 28px;
  box-sizing: border-box;
}

.retro-theme::before,
.retro-theme::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255, 123, 255, 0.08) 0, rgba(255, 123, 255, 0) 65%),
    radial-gradient(circle, rgba(86, 204, 242, 0.1) 0, rgba(86, 204, 242, 0) 55%);
  mix-blend-mode: screen;
  opacity: 0.75;
}

.bg-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(120deg, rgba(140, 0, 190, 0.25) 0%, rgba(15, 93, 255, 0.15) 50%, rgba(0, 196, 204, 0.2) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 100px);
  z-index: 0;
  animation: pulseGlow 18s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.95;
  }
}

.container {
  position: relative;
  z-index: 1;
  background: linear-gradient(160deg, rgba(32, 28, 46, 0.95), rgba(24, 20, 40, 0.95));
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(8, 6, 18, 0.6), 0 0 36px rgba(162, 105, 255, 0.16);
  border: 1px solid rgba(138, 105, 255, 0.25);
  padding: 28px 32px;
  max-width: 880px;
  width: 100%;
  overflow-y: hidden;
}

.heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.title-block {
  max-width: 60%;
}

.title {
  font-family: "Press Start 2P", "Space Grotesk", sans-serif;
  font-size: 44px;
  letter-spacing: 3px;
  color: #fff6ca;
  text-shadow: 0 0 12px rgba(255, 230, 150, 0.8), 0 0 20px rgba(255, 140, 70, 0.3);
  margin: 0 0 10px 0;
}

.subtitle {
  font-size: 15px;
  margin: 0;
  line-height: 1.5;
  color: rgba(241, 244, 255, 0.9);
}

.scores-container {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.06), 0 10px 25px rgba(8, 6, 18, 0.45);
}

.score-container,
.best-container {
  min-width: 108px;
  border-radius: 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(84, 49, 160, 0.95), rgba(143, 61, 255, 0.85));
  color: #ffffff;
  font-weight: 700;
  font-size: 18px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  position: relative;
}

.score-container::after,
.best-container::after {
  content: attr(class);
  display: block;
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-top: 4px;
  opacity: 0.78;
}

.score-container::after {
  content: "score";
}

.best-container::after {
  content: "best";
}

.info-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.info-card {
  background: rgba(20, 16, 32, 0.85);
  border: 1px solid rgba(137, 96, 255, 0.22);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 18px 36px rgba(10, 6, 20, 0.4);
}

.info-card h2 , .info-card h3{
  font-family: "Press Start 2P", "Space Grotesk", sans-serif;
  font-size: 15px;
  margin: 0 0 10px 0;
  color: #a0f3ff;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.info-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(234, 237, 255, 0.85);
}

.ai-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(21, 17, 36, 0.9);
  border: 1px solid rgba(122, 156, 255, 0.2);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 22px;
  box-shadow: 0 16px 24px rgba(12, 8, 24, 0.4);
}

.ai-menu .game-intro {
  font-family: "Press Start 2P", "Space Grotesk", sans-serif;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #f7e7ff;
  margin: 0;
}

.ai-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #ff7b89, #ffb86b);
  color: #1e1234;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.7px;
  box-shadow: 0 10px 20px rgba(255, 131, 137, 0.32);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ai-buttons:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px rgba(255, 134, 128, 0.45);
}

.ai-buttons:active {
  transform: translateY(1px);
  box-shadow: 0 8px 18px rgba(255, 134, 128, 0.4);
}

.game-container {
  border-radius: 22px;
  box-shadow: 0 14px 32px rgba(14, 10, 26, 0.45);
  padding: 18px;
  background: linear-gradient(145deg, rgba(18, 14, 30, 0.95), rgba(32, 26, 54, 0.95));
  border: 1px solid rgba(137, 96, 255, 0.2);
}

.game-message {
  border-radius: 16px;
  overflow: hidden;
  background: rgba(32, 28, 60, 0.85);
}

.tile-container,
.grid-container {
  border-radius: 20px;
}

.grid-container .grid-cell {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.04);
}

.game-extras {
  padding: 18px;
  border-radius: 16px;
  background: rgba(17, 14, 28, 0.9);
  border: 1px solid rgba(118, 82, 219, 0.2);
  box-shadow: 0 10px 28px rgba(10, 6, 20, 0.38);
}

.main-layout {
  display: flex;
  gap: 22px;
  margin-top: 22px;
}

.game-column {
  flex: 2;
  min-width: 0;
}

.info-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

@media screen and (max-width: 820px) {
  .main-layout {
    flex-direction: column;
  }
}

.game-extras p {
  margin: 0 0 12px 0;
  line-height: 1.6;
  color: rgba(226, 229, 255, 0.87);
  font-size: 14px;
}

.game-extras p:last-child {
  margin-bottom: 0;
}

.important {
  color: #ffb4fe;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
}

.credits a {
  color: #9fd9ff;
  text-decoration: none;
  font-weight: 600;
}

.credits a:hover {
  color: #f9f871;
}

.github-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  z-index: 10;
}

.github-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.github-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 18, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
  z-index: 9;
}

.github-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: linear-gradient(150deg, rgba(32, 24, 56, 1), rgba(56, 36, 92, 0.96));
  border-radius: 20px;
  padding: 26px 24px;
  max-width: 380px;
  width: calc(100% - 40px);
  border: 1px solid rgba(157, 118, 255, 0.35);
  box-shadow: 0 24px 60px rgba(8, 6, 18, 0.75), 0 0 60px rgba(159, 118, 255, 0.3);
  text-align: center;
  position: relative;
}

.modal-content h2,.modal-content h3 {
  font-family: "Press Start 2P", "Space Grotesk", sans-serif;
  font-size: 18px;
  color: #f9f871;
  margin: 0 0 14px 0;
  letter-spacing: 1.3px;
}

.modal-content p {
  color: rgba(233, 236, 255, 0.88);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.github-button-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.modal-link {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6c63ff, #8b5dff);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(129, 100, 255, 0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.modal-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(129, 100, 255, 0.5);
}

.close-modal {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: rgba(248, 249, 255, 0.75);
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.close-modal:hover {
  transform: scale(1.1);
  color: #ffffff;
}

@media screen and (max-width: 520px) {
  .container {
    padding: 28px 20px;
  }

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

  .title-block {
    max-width: none;
  }

  .title {
    font-size: 40px;
  }

  .info-panels {
    grid-template-columns: 1fr;
  }

  .ai-menu {
    flex-direction: column;
    align-items: stretch;
  }

  .ai-buttons {
    width: 100%;
    padding: 14px 16px;
    box-sizing: border-box;
    margin-top: 10px;
    margin-left: 0;
    margin-right: 0;
  }

  .game-intro {
    text-align: center;
  }

  .navbar {
    flex-direction: column;
    padding: 1rem;
  }

  .navbar-right {
    margin-top: 1rem;
  }

  .retro-theme {
    padding-top: 120px;
  }
}


.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

.navbar-left, .navbar-right {
  display: flex;
  align-items: center;
}

.navbar-link {
  color: #f4f7ff;
  text-decoration: none;
  margin: 0 1rem;
  font-weight: 600;
  transition: color 0.3s ease;
}

.navbar-link:hover {
  color: #ffb4fe;
}

@media screen and (max-width: 520px) {
  .navbar {
    flex-direction: column;
    padding: 1rem;
  }

  .navbar-right {
    margin-top: 1rem;
  }
}
