@import url("./app.css");

/* Layout overrides to match the Figma-style spec */

.app {
  width: 100vw;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.nav {
  height: 80px;
  padding: 0 18px;
  backdrop-filter: blur(10px);
}

.logo {
  font-size: clamp(1.35rem, 2.2vw, 2.05rem);
  font-family: var(--font-display);
  line-height: 1.1;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 14px;
}

.logo:focus-visible {
  outline: 3px solid rgba(60, 255, 250, 0.55);
  outline-offset: 3px;
}

.nav-links {
  align-items: center;
}

.nav-link,
.icon-btn {
  min-width: 44px;
  min-height: 44px;
}

.nav-link {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--stroke);
  color: var(--text-color);
  /* Make <a.nav-link> look identical to <button.nav-link> */
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link:visited {
  color: var(--text-color);
}

body[data-theme="light"] .nav-link {
  background: rgba(2, 6, 23, 0.04);
}

.nav-link.active {
  border-color: var(--accent-glow);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-color);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

body[data-theme="light"] .icon-btn {
  border-color: rgba(15, 23, 42, 0.14);
  background: rgba(2, 6, 23, 0.04);
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(60, 255, 250, 0.14);
}

.main {
  padding: 20px clamp(16px, 4vw, 44px);
}

.view {
  inset: 20px clamp(16px, 4vw, 44px);
}

.view[data-view="play"] {
  grid-template-rows: auto 1fr;
  align-content: stretch;
  min-height: 0;
}

.cards {
  max-width: 1400px;
  margin: 0 auto;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .nav {
    height: auto;
    min-height: 76px;
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 700px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Reduce double-padding for small screens */
  .view {
    inset: 0;
  }
}

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

  .nav {
    height: auto;
    min-height: 74px;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .logo {
    font-size: 1.45rem;
    white-space: normal;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Reduce double-padding (main + view inset) on small screens */
  .view {
    inset: 0;
  }

  /* Let the game area size naturally with the footer present */
  .view[data-view="play"] .game-shell {
    height: auto;
  }
}

/* Card component spec */
.card {
  min-height: 220px;
  height: auto;
  padding: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: var(--card-bg);
  color: var(--text-color);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
}

.card:hover {
  transform: scale(1.05);
  border-color: var(--accent-glow);
  box-shadow: 0 0 22px var(--accent-glow-soft), var(--shadow);
}

.card:active {
  transform: scale(0.99);
}

.card-icon {
  font-size: 52px;
  line-height: 1;
}

.card-title {
  font-size: 1.35rem;
  line-height: 1.15;
}

.card-desc {
  font-size: 0.9rem;
  opacity: 0.75;
  margin: 0;
  flex: 1;
}

.play-pill {
  width: 100%;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--button-bg);
  color: var(--button-text);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  margin-top: auto;
}

/* Normalize shared buttons to theme variables */
.btn {
  background: var(--button-bg);
  color: var(--button-text);
}

/* Game container spec */
.game-shell {
  height: auto;
  max-width: 900px;
  margin: 0 auto;
  border-radius: 18px;
  padding: 24px;
  animation: gz-in 0.22s ease;
  min-height: 0;
}

.game-topbar.hidden {
  display: none;
}

.game-container {
  width: 100%;
  height: 100%;
}

/* Prevent long titles from being clipped in the play header */
.game-title {
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

/* Ensure theme variables win over legacy app.css body styling */
body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-body);
}

@keyframes gz-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

