/* ============================================================================
   Luck Vantelo — the board
   ========================================================================== */

.screen--game .screen__body,
.screen--game {
  display: flex;
  flex-direction: column;
}

.screen--game {
  max-width: 520px;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 8px) var(--pad) calc(var(--safe-bottom) + 12px);
  gap: 10px;
  min-height: 100%;
}

.game__head { display: flex; align-items: center; gap: 12px; }
.game__headtext { flex: 1; min-width: 0; text-align: center; }
.game__title { margin: 0; font-size: 17px; font-weight: 800; }
.game__sub { margin: 1px 0 0; font-size: 11.5px; color: var(--muted); }

/* --- HUD -------------------------------------------------------------------- */

.hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hud__box {
  position: relative;
  padding: 10px 8px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--stroke-soft);
  text-align: center;
}
.hud__value { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; }
.hud__value.is-urgent { color: var(--bad); }
.hud__label { font-size: 10px; color: var(--dim); margin-top: 1px; }

.gain {
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--good);
  opacity: 0;
}
.gain.is-pop { animation: gainPop 0.85s ease-out forwards; }
@keyframes gainPop {
  0% { opacity: 0; transform: translateY(6px); }
  22% { opacity: 1; transform: translateY(-2px); }
  100% { opacity: 0; transform: translateY(-16px); }
}

/* --- objectives -------------------------------------------------------------- */

.goals { display: flex; flex-direction: column; gap: 6px; }
.goal {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--stroke-soft);
  font-size: 12.5px;
}
.goal.is-done { border-color: rgba(86, 224, 180, 0.45); color: var(--good); }
.goal__ico { color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.goal.is-done .goal__ico { color: var(--good); }
.goal__text { flex: 1; min-width: 0; }
.goal__count { font-weight: 800; font-size: 12px; }
.goals__free {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--stroke-soft);
  font-size: 12.5px; color: var(--muted);
}
.goals__free span:first-child { color: var(--accent); display: grid; place-items: center; }

/* --- surge meter --------------------------------------------------------------- */

.surge { display: flex; align-items: center; gap: 9px; }
.surge__ico { color: var(--accent); display: grid; place-items: center; flex: 0 0 auto; }
.surge__track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
}
.surge__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.32s cubic-bezier(0.22, 0.8, 0.3, 1);
}
.surge__combo {
  flex: 0 0 auto;
  min-width: 62px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.surge__combo.is-on { opacity: 1; }

/* --- board ---------------------------------------------------------------------- */

.board__wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 0;
  padding: 2px 0;
}

.board {
  position: relative;
  width: 100%;
  max-width: min(94vw, 460px, calc(100vh - 380px));
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  background: linear-gradient(180deg, #1B1140, #150C33);
  border: 1px solid var(--stroke-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.board.is-bump { animation: bump 0.24s ease; }
@keyframes bump {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  65% { transform: translateX(4px); }
}
.board.is-picking { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }

.board__grid {
  position: absolute;
  inset: 3%;
  display: grid;
  gap: 2.3%;
}
.board__cell {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 800;
  font-size: 14px;
}
.board__cell.is-stone {
  background: #3A2C68;
  color: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}
.board__cell.is-locked {
  background: #4A2E6E;
  box-shadow: inset 0 0 0 2px rgba(200, 107, 255, 0.55);
  color: #F0DFFF;
}

.board__tiles { position: absolute; inset: 0; pointer-events: none; }

.tile {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -0.02em;
  transition: transform 0.13s cubic-bezier(0.25, 0.75, 0.35, 1);
  will-change: transform;
  box-shadow: 0 4px 12px rgba(8, 4, 24, 0.34);
}
.tile__label { pointer-events: none; }
.tile.is-new { animation: tileIn 0.19s cubic-bezier(0.25, 0.9, 0.35, 1); }
@keyframes tileIn { from { opacity: 0; } to { opacity: 1; } }
.tile.is-merged { animation: tilePop 0.22s cubic-bezier(0.3, 0.9, 0.35, 1); }
@keyframes tilePop {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.35); }
  100% { filter: brightness(1); }
}
.tile.is-gone { opacity: 0; transition: opacity 0.14s ease; }
.tile.is-contrast { box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(8, 4, 24, 0.34); }
.tile.is-frozen { box-shadow: 0 0 0 2px rgba(63, 208, 232, 0.85), 0 4px 12px rgba(8, 4, 24, 0.34); }
.tile.is-frozen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: rgba(190, 235, 255, 0.42);
  pointer-events: none;
}
.tile.is-wild { box-shadow: 0 0 0 2px var(--warm), 0 4px 14px rgba(255, 179, 92, 0.35); }
.tile.is-bomb { box-shadow: 0 0 0 2px var(--bad), 0 4px 14px rgba(255, 107, 196, 0.32); }
.tile.is-mult { box-shadow: 0 0 0 2px var(--gold), 0 4px 14px rgba(255, 224, 138, 0.32); }

.tile__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 9.5px;
  font-weight: 900;
  color: #14092C;
  z-index: 1;
}
.tile__badge--wild { background: var(--warm); }
.tile__badge--bomb { background: var(--bad); color: #fff; }
.tile__badge--ice { background: #3FD0E8; }
.tile__badge--mult { background: var(--gold); }

/* --- booster bar ------------------------------------------------------------------ */

.boosts {
  width: 100%;
  /* Matches the board so the bar lines up with it instead of spanning wider. */
  max-width: min(94vw, 460px, calc(100vh - 380px));
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}
.boost {
  --boost: var(--brand);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 2px 5px;
  border-radius: 12px;
  border: 1px solid var(--stroke-soft);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  color: var(--boost);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.boost:active { transform: scale(0.94); }
.boost__ico { display: grid; place-items: center; }
.boost__n { font-size: 10px; font-weight: 800; color: var(--muted); }
.boost.is-empty { opacity: 0.42; }
.boost.is-armed {
  border-color: var(--boost);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--boost) 32%, transparent);
}

/* --- pause screen ------------------------------------------------------------------ */

.pause .card { text-align: left; }

@media (max-height: 700px) {
  .hud__value { font-size: 17px; }
  .goal { padding: 6px 10px; font-size: 12px; }
  .boost { padding: 6px 2px 4px; }
}
