/* GameAgro — barra superior e rodapé compartilhados por todos os jogos.
   Depende de css/tokens.css, carregado antes. */

.ga-game-shell {
  padding-top: 68px;
  min-height: 100vh;
  overflow-x: hidden;
}

.ga-topbar {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 100;
  width: min(var(--container), calc(100% - 20px));
  min-height: 48px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 254, 251, 0.92);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--font-sans);
}

.ga-brand,
.ga-back,
.ga-footer a {
  color: inherit;
  text-decoration: none;
}

.ga-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--forest-strong);
}

.ga-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  background: var(--forest);
  color: var(--paper);
  display: grid;
  place-items: center;
}

.ga-mark .icon {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.ga-brand strong,
.ga-brand small {
  display: block;
}

.ga-brand strong {
  font-family: var(--font-display);
  font-size: 0.96rem;
  line-height: 1;
}

.ga-brand small {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
}

.ga-back {
  min-height: 36px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.86rem;
  transition: border-color 150ms ease, color 150ms ease;
}

.ga-back:hover {
  border-color: var(--forest);
  color: var(--forest);
}

.ga-footer {
  display: none;
  width: min(var(--container), calc(100% - 20px));
  margin: 18px auto;
  padding: 16px;
  border-radius: var(--radius-sm);
  color: rgba(245, 243, 236, 0.88);
  background: var(--forest-strong);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 18px;
  font-family: var(--font-sans);
}

.ga-game-shell .app {
  min-height: calc(100vh - 76px);
  padding-top: 0;
}

.ga-game-shell .screen {
  min-height: calc(100vh - 76px);
  padding-top: 0;
  padding-bottom: 8px;
}

.ga-game-shell .screen-menu {
  align-items: center;
}

.ga-game-shell .menu-visual {
  min-height: min(440px, calc(100vh - 118px));
}

.ga-game-shell .screen-menu {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 16px;
}

.ga-game-shell .screen-menu h1 {
  font-family: var(--font-display);
  color: var(--forest-strong);
  font-size: clamp(2.2rem, 5.4vw, 3.6rem);
  line-height: 1.06;
}

.ga-game-shell .menu-content {
  padding: 18px;
}

.ga-game-shell .notice {
  margin: 12px 0;
  padding: 10px;
  font-size: 0.9rem;
}

.ga-game-shell .primary,
.ga-game-shell .secondary,
.ga-game-shell .danger,
.ga-game-shell .option {
  min-height: 40px;
  padding: 8px 12px;
}

.ga-game-shell .field {
  min-height: min(270px, calc(100vh - 340px));
}

.ga-game-shell .hero {
  min-height: 72px;
  padding: 12px 16px;
}

.ga-game-shell .hero h1 {
  font-family: var(--font-display);
  color: var(--forest-strong);
  font-size: clamp(1.8rem, 4.4vw, 3rem);
}

.ga-game-shell .scoreboard span {
  min-height: 44px;
}

.ga-game-shell .word-panel,
.ga-game-shell .keyboard,
.ga-game-shell .panel {
  padding: 10px;
}

.ga-game-shell .side,
.ga-game-shell .game {
  gap: 8px;
}

.ga-game-shell .panel h2 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  color: var(--forest-strong);
}

.ga-game-shell .difficulty button,
.ga-game-shell .primary,
.ga-game-shell .secondary {
  min-height: 34px;
}

.ga-game-shell .facts {
  gap: 6px;
}

.ga-game-shell .facts div {
  padding-bottom: 6px;
}

.ga-game-shell .message {
  margin-top: 8px;
  font-size: 0.88rem;
  line-height: 1.3;
}

.ga-game-shell .keyboard {
  gap: 6px;
}

.ga-game-shell .key {
  min-height: 34px;
}

.ga-footer strong {
  color: var(--surface);
}

.ga-footer a {
  color: var(--surface);
  font-weight: 600;
}

.ga-footer a:hover {
  color: var(--clay);
}

@media (max-width: 640px) {
  .ga-game-shell {
    padding-top: 62px;
  }

  .ga-topbar {
    top: 6px;
    left: 8px;
    right: 8px;
    width: auto;
    transform: none;
  }

  .ga-topbar .ga-brand {
    flex: 1 1 auto;
    overflow: hidden;
  }

  .ga-brand small {
    display: none;
  }

  .ga-back {
    display: none;
  }

  .ga-game-shell .screen,
  .ga-game-shell .app {
    min-height: calc(100vh - 68px);
  }

  .ga-game-shell .menu-visual {
    display: none;
  }

  .ga-game-shell .field {
    min-height: 220px;
  }

  .ga-game-shell .screen-menu {
    grid-template-columns: 1fr;
  }

  .ga-game-shell .screen-menu h1 {
    font-size: clamp(2rem, 12vw, 2.8rem);
  }

  .ga-game-shell .app {
    width: min(calc(100% - 16px), 540px) !important;
    max-width: calc(100% - 16px);
    gap: 8px;
    overflow: hidden;
  }

  .ga-game-shell .game,
  .ga-game-shell .side {
    min-width: 0;
  }

  .ga-game-shell .side {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    order: -1;
    gap: 6px;
    width: 100%;
  }

  .ga-game-shell .side .panel {
    min-width: 0;
    padding: 6px;
    overflow: hidden;
  }

  .ga-game-shell .side .panel h2 {
    font-size: 0.82rem;
    margin-bottom: 5px;
  }

  .ga-game-shell .difficulty {
    gap: 4px;
  }

  .ga-game-shell .difficulty button,
  .ga-game-shell .side .primary,
  .ga-game-shell .side .secondary {
    min-height: 28px;
    padding: 5px 6px;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .ga-game-shell .side .panel:nth-child(2) .facts,
  .ga-game-shell .side .message {
    display: none;
  }

  .ga-game-shell .side .panel:nth-child(2) {
    display: none;
  }

  .ga-game-shell .hero {
    min-height: 58px;
    padding: 8px 10px;
  }

  .ga-game-shell .hero h1 {
    font-size: clamp(1.4rem, 8vw, 2rem);
  }

  .ga-game-shell .scoreboard {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .ga-game-shell .scoreboard span {
    min-height: 34px;
    padding: 5px 8px;
    font-size: 0.72rem;
  }

  .ga-game-shell .field {
    min-height: 135px;
    max-height: 135px;
  }

  .ga-game-shell .gallows {
    top: -18px;
    transform: translateX(-50%) scale(0.54);
  }

  .ga-game-shell .word-panel {
    padding: 7px;
  }

  .ga-game-shell .word {
    min-height: 42px;
    gap: 5px;
    margin-bottom: 6px;
  }

  .ga-game-shell .letter {
    width: 22px;
    height: 30px;
    font-size: 1rem;
    border-bottom-width: 3px;
  }

  .ga-game-shell .hint {
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .ga-game-shell .keyboard {
    grid-template-columns: repeat(13, minmax(0, 1fr)) !important;
    gap: 4px;
    padding: 6px;
  }

  .ga-game-shell .key {
    min-height: 28px;
    aspect-ratio: auto;
    font-size: 0.72rem;
    border-radius: 6px;
  }
}
