/* Bolhas por Ordem — só o que o /assets/base.css do hub não traz. Tudo num ecrã, sem scroll. */

#stage canvas { touch-action: none; }
.stage-overlay .row { justify-content: center; margin-top: 14px; }
.side .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* O número que vem a seguir: é o que uma criança precisa de ver sem procurar */
.proxima {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 10px; padding: 6px 12px; border-radius: 14px;
  background: var(--surface-2); border: 2px solid var(--line-strong);
}
.proxima span { font: 700 var(--fs-2xs)/1 var(--font); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.proxima b { font: 400 clamp(26px, 5vmin, 40px)/1 var(--display); color: var(--mint-edge); font-variant-numeric: tabular-nums; }

/* Relógio do nível */
.tempo {
  position: relative; margin: 10px 0 2px; height: 22px;
  border-radius: 11px; overflow: hidden;
  background: var(--surface-2); border: 2px solid var(--line-strong);
}
.tempo.hidden { display: none; }
.tempo-cheia { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--mint); transition: width .12s linear; }
.tempo-cheia.pouco { background: var(--pink); animation: aperta .6s ease-in-out infinite; }
@keyframes aperta { 50% { filter: brightness(1.35); } }
.tempo-txt {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 var(--fs-2xs)/1 var(--font); color: var(--ink); font-variant-numeric: tabular-nums;
}

.obra { margin: 8px 0 0; text-align: center; font: 700 var(--fs-sm)/1.2 var(--display); color: var(--ink-2); }
.obra.contrario { color: var(--pink-edge); }

.acoes { margin-top: 10px; gap: 8px; }
.acoes .btn { flex: 1; }

/* Escolha do modo, no ecrã de início */
.modos { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 6px 0 2px; }
.modos .modo { border-width: 2px; }
.modos .modo.escolhido { background: var(--mint); border-color: var(--mint-edge); box-shadow: 0 3px 0 var(--mint-edge); color: var(--ink); }

/* A Comissão das Bolhas comenta por cima do palco */
.aviso {
  position: absolute; z-index: 3; left: 8px; right: 8px; top: 8px; margin: 0;
  padding: 7px 12px; border-radius: 12px; text-align: center;
  background: var(--yellow); color: var(--ink);
  border: 2px solid var(--yellow-edge); box-shadow: 0 3px 0 var(--yellow-edge);
  font: 700 var(--fs-sm)/1.25 var(--font);
  pointer-events: none;
  animation: aviso-entra .22s ease-out;
}
@keyframes aviso-entra { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Pontos a voar por cima das bolhas */
.fx { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.fx .pop {
  position: absolute;
  transform: translate(-50%, -50%);
  font: 700 clamp(14px, 2.4vmin, 20px)/1 var(--display);
  color: var(--mint-edge);
  text-shadow: 0 2px 0 #fff, 0 0 10px #fff;
  white-space: nowrap;
  animation: sobe 1s ease-out forwards;
}
.fx .pop.grande { font-size: clamp(18px, 3.2vmin, 26px); }
.fx .pop.mau { color: var(--pink-edge); }
@keyframes sobe {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.7); }
  22% { opacity: 1; transform: translate(-50%, -60%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -190%) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .fx .pop { animation: none; opacity: 0; }
  .tempo-cheia.pouco { animation: none; }
}

/* Telemóvel de pé: painel estreito ao lado, para o campo ficar com a altura toda */
@media (orientation: portrait) and (max-width: 900px) {
  .game-page .game-layout {
    grid-template-columns: minmax(0, 1fr) clamp(104px, 29vw, 158px);
    grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "stage side";
  }
  .game-page .side { max-height: none; }
  .side .stats { grid-template-columns: 1fr; gap: 4px; }
  .game-page .stat { padding: 4px 7px; }
  .proxima { flex-direction: column; gap: 2px; padding: 4px 8px; margin-bottom: 6px; }
  .proxima b { font-size: clamp(22px, 7vw, 32px); }
  .obra { margin-top: 6px; font-size: var(--fs-2xs); }
  .acoes { display: grid; grid-template-columns: 1fr; margin-top: 6px; }
}

/* Telemóvel deitado */
@media (max-height: 560px) and (orientation: landscape) {
  .game-page .game-layout { grid-template-columns: minmax(0, 1fr) clamp(150px, 23vw, 230px); }
  .side .stats { grid-template-columns: 1fr 1fr; }
  .proxima { padding: 3px 8px; margin-bottom: 6px; }
  .proxima b { font-size: clamp(20px, 4vmin, 28px); }
  .obra { margin-top: 4px; font-size: var(--fs-2xs); }
  .acoes { margin-top: 6px; }
}
