/* Visual alegre: cores vivas, botões "fofinhos" com relevo e fonte arredondada */
@font-face {
  font-family: 'Fredoka';
  src: url('fonts/fredoka.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --pink: #ff4d6d;
  --yellow: #ffd23f;
  --cyan: #3ec1ff;
  --purple: #7c5cff;
  --green: #36d07a;
  --orange: #ff9f43;
  --ink: #24305e;
  --ink-soft: #66709a;
  --paper: #ffffff;
  --cloud: #f2f5ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #58ccf0;
  font-family: 'Fredoka', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

button { font-family: inherit; }

#game { display: block; position: fixed; inset: 0; }

/* botão com relevo: a sombra de baixo é a "lateral" do botão */
.chunky {
  border: 0;
  border-radius: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--edge, rgba(36, 48, 94, .25));
  transition: transform .08s, box-shadow .08s;
}

.chunky:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge, rgba(36, 48, 94, .25)); }

/* ---------- Placar ---------- */
#hud {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 66px); /* abaixo dos botões do topo */
  left: 0;
  right: 0;
  text-align: center;
  pointer-events: none;
}

#score {
  font-size: 74px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 5px 0 rgba(36, 48, 94, .22);
  line-height: 1;
}

#best {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 0 rgba(36, 48, 94, .2);
}

#combo {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 4px 0 #c9244a;
  opacity: 0;
  transform: scale(.5) rotate(-6deg);
  transition: opacity .2s, transform .25s cubic-bezier(.3, 1.8, .5, 1);
}

#combo.show { opacity: 1; transform: scale(1) rotate(-3deg); }

#shells {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 18px);
  left: 16px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 4px 0 rgba(36, 48, 94, .18);
  pointer-events: none;
}

.corner-buttons {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 14px);
  right: 14px;
  display: flex;
  gap: 8px;
  z-index: 15;
}

.corner-buttons button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(36, 48, 94, .18);
}

.corner-buttons button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(36, 48, 94, .18); }

#music.off { opacity: .5; }

/* na demonstração da tela inicial o placar fica escondido */
body.demo #hud { visibility: hidden; }

/* ---------- Telas por cima do jogo ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  color: #fff;
  transition: opacity .25s;
}

.overlay.hidden { opacity: 0; pointer-events: none; }
.hidden { display: none; }
.overlay.hidden { display: flex; }

.overlay p { font-size: 18px; line-height: 1.4; text-shadow: 0 2px 0 rgba(36, 48, 94, .25); }
.overlay .hint { font-size: 16px; }

/* logo com uma cor por letra */
.logo {
  display: flex;
  gap: 2px;
  font-size: 76px;
  font-weight: 700;
  line-height: 1;
}

.logo span {
  display: inline-block;
  -webkit-text-stroke: 7px #fff;
  paint-order: stroke fill;
  text-shadow: 0 7px 0 rgba(36, 48, 94, .25);
  animation: hop 2.4s ease-in-out infinite;
}

.logo span:nth-child(1) { color: var(--pink); transform: rotate(-8deg); }
.logo span:nth-child(2) { color: var(--yellow); transform: rotate(5deg); animation-delay: .15s; }
.logo span:nth-child(3) { color: var(--cyan); transform: rotate(-4deg); animation-delay: .3s; }
.logo span:nth-child(4) { color: var(--purple); transform: rotate(7deg); animation-delay: .45s; }

@keyframes hop {
  0%, 70%, 100% { translate: 0 0; }
  80% { translate: 0 -12px; }
  90% { translate: 0 2px; }
}

.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  max-width: 380px;
}

.menu button {
  pointer-events: auto;
  padding: 11px 16px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .15);
  cursor: pointer;
  background: var(--bg);
  box-shadow: 0 5px 0 var(--edge);
  transition: transform .08s, box-shadow .08s;
}

.menu button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--edge); }

/* cada botão do menu com uma cor */
[data-panel="loja"] { --bg: var(--pink); --edge: #c9244a; }
[data-panel="missoes"] { --bg: var(--cyan); --edge: #1c8fc9; }
[data-panel="conquistas"] { --bg: var(--orange); --edge: #d6721c; }
[data-panel="ranking"] { --bg: var(--purple); --edge: #5537d6; }
#shareBtn { --bg: #14b8a6; --edge: #0e8577; }
[data-panel="temporada"] { --bg: #ff7a59; --edge: #d4502f; }
[data-panel="album"] { --bg: var(--green); --edge: #1f9e58; }
[data-panel="porto"] { --bg: #00b894; --edge: #008a6e; }
[data-panel="roleta"] { --bg: #f783ac; --edge: #d6578a; }
[data-panel="numeros"] { --bg: #5b7cfa; --edge: #3b5bd6; }

/* tela inicial: título em cima, botões embaixo, demonstração livre no meio */
#start {
  pointer-events: none;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 78px) 20px calc(env(safe-area-inset-bottom) + 28px);
  background: linear-gradient(rgba(36, 48, 94, .28), rgba(36, 48, 94, 0) 34%, rgba(36, 48, 94, 0) 64%, rgba(36, 48, 94, .3));
}

.start-top, .start-bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.tap {
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  animation: bob 1.3s ease-in-out infinite;
}

@keyframes bob { 50% { transform: translateY(-4px) scale(1.03); } }
@keyframes pulse { 50% { opacity: .55; } }

/* ---------- Fim de jogo ---------- */
#over { background: linear-gradient(rgba(124, 92, 255, .45), rgba(255, 77, 109, .4)); }

#over h2 {
  font-size: 40px;
  font-weight: 700;
  text-shadow: 0 4px 0 rgba(36, 48, 94, .25);
}

.final { display: flex; flex-direction: column; line-height: 1; }

.final span {
  font-size: 104px;
  font-weight: 700;
  text-shadow: 0 6px 0 rgba(36, 48, 94, .25);
  animation: popin .45s cubic-bezier(.3, 1.8, .5, 1);
}

@keyframes popin { from { transform: scale(.4); opacity: 0; } }

.final small { font-size: 18px; font-weight: 600; }

#newBest {
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 4px 0 #d9a400;
  transform: rotate(-3deg);
}

.final-best { font-size: 18px; font-weight: 600; }
.final-shells { font-size: 18px; font-weight: 700; }

#restart {
  margin-top: 8px;
  padding: 16px 44px;
  border: 0;
  border-radius: 20px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 0 #d9a400;
  transition: transform .08s, box-shadow .08s;
}

#restart:active { transform: translateY(5px); box-shadow: 0 1px 0 #d9a400; }

/* ---------- Tutorial ---------- */
#tutorial {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 80px);
  transform: translateX(-50%) translateY(10px);
  padding: 12px 22px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 19px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 5px 0 rgba(36, 48, 94, .2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

#tutorial.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Painel (loja, missões, conquistas, ranking, ajustes) ---------- */
#panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(36, 48, 94, .4);
}

#panel.hidden { display: none; }

.sheet {
  width: 100%;
  max-width: 480px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  border-radius: 28px 28px 0 0;
  background: var(--cloud);
  color: var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
  animation: up .3s cubic-bezier(.3, 1.4, .5, 1);
}

@keyframes up { from { transform: translateY(60px); opacity: 0; } }

.sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px;
}

.sheet h3 { font-size: 26px; font-weight: 700; }

#panelClose {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(36, 48, 94, .15);
}

#panelBody { overflow-y: auto; padding: 4px 16px 20px; }

.wallet { margin-bottom: 12px; font-size: 17px; }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 5px; }

.tab {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(36, 48, 94, .12);
}

.tab.on { background: var(--pink); color: #fff; box-shadow: 0 3px 0 #c9244a; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px 12px;
  border: 3px solid transparent;
  border-radius: 20px;
  background: linear-gradient(160deg, #8f7dff, #3ec1ff);
  box-shadow: 0 5px 0 rgba(85, 55, 214, .35);
}

.card.on { border-color: var(--yellow); }
.card canvas { width: 100%; max-width: 92px; aspect-ratio: 1; }
.card-name { color: #fff; font-size: 14px; font-weight: 700; text-align: center; text-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.card.item { justify-content: space-between; text-align: center; }
.item-icon { font-size: 46px; line-height: 72px; }
.card-desc { color: rgba(255, 255, 255, .92); font-size: 12px; line-height: 1.3; }

.small {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(36, 48, 94, .2);
}

.small.buy { background: var(--yellow); box-shadow: 0 3px 0 #d9a400; }
.small:disabled { opacity: .55; cursor: default; }
.small:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 rgba(36, 48, 94, .2); }

.tag { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .3); color: #fff; font-size: 13px; font-weight: 700; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 3px 0 rgba(36, 48, 94, .08);
}

.row.done { background: #e3fbec; }
.row.locked { opacity: .6; }
.row-main { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.row-main b { font-weight: 600; }
.row-main small { color: var(--ink-soft); font-size: 14px; }
.reward { font-weight: 700; white-space: nowrap; }
.ach-icon { font-size: 30px; }

.bar { height: 10px; border-radius: 999px; background: #e6eaf8; overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--pink), var(--orange)); }

.note { margin: 6px 0 12px; color: var(--ink-soft); font-size: 15px; text-align: center; }

.name-form { display: flex; gap: 8px; margin-bottom: 14px; }

.name-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  border: 3px solid #e1e6f7;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.name-form input:focus { outline: none; border-color: var(--cyan); }

.rank-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  padding: 11px 14px;
  margin-bottom: 6px;
  border-radius: 14px;
  background: #fff;
}

.rank-row.me { background: #fff3bf; font-weight: 700; }

/* ---------- Avisos ---------- */
/* avisos embaixo, para não cobrir o placar; o mais novo fica mais perto da borda */
#toasts {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 86px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 380px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 5px 0 rgba(36, 48, 94, .15), 0 10px 24px rgba(36, 48, 94, .15);
  animation: drop .35s cubic-bezier(.3, 1.6, .5, 1);
  transition: opacity .4s, transform .4s;
}

.toast.out { opacity: 0; transform: translateY(10px); }
.toast-icon { font-size: 28px; }
.toast b { display: block; font-size: 16px; font-weight: 700; }
.toast small { font-size: 14px; color: var(--ink-soft); }

@keyframes drop { from { transform: translateY(18px) scale(.9); opacity: 0; } }

/* ---------- Itens (power-ups) durante o jogo ---------- */
#powerups {
  position: fixed;
  left: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 18px);
  z-index: 15;
  display: flex;
  gap: 10px;
}

.pu {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  font-size: 24px;
  box-shadow: 0 5px 0 rgba(36, 48, 94, .2);
  cursor: pointer;
}

.pu:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(36, 48, 94, .2); }

.pu b {
  position: absolute;
  right: -6px;
  top: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.pu.passive { background: rgba(255, 255, 255, .7); cursor: default; }
.pu.used { opacity: .4; }
.pu.active { background: var(--yellow); box-shadow: 0 5px 0 #d9a400; animation: bob 1s ease-in-out infinite; cursor: default; }
.pu.active b { background: var(--purple); }

/* ---------- Ajustes ---------- */
.setting { cursor: pointer; }

.setting select {
  padding: 8px 12px;
  border: 3px solid #e1e6f7;
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.switch {
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 32px;
  border-radius: 999px;
  background: #d9def0;
  cursor: pointer;
  transition: background .2s;
}

.switch::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 0 rgba(36, 48, 94, .2);
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1);
}

.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(22px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Meta da partida (no placar) ---------- */
#goal {
  display: none;
  width: max-content;
  max-width: 90vw;
  margin: 8px auto 0;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 3px 0 rgba(36, 48, 94, .15);
}

#goal.show { display: block; }
#goal.done { background: #e3fbec; }
body.demo #goal { display: none; }

/* ---------- Tela inicial: nível, sequência e presente ---------- */
.player-bar { display: flex; gap: 10px; margin-top: 6px; }

.chip {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(36, 48, 94, .18);
}

.chip.level b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
}

.chip.level i { display: block; width: 70px; height: 10px; border-radius: 999px; background: #e6eaf8; overflow: hidden; }
.chip.level i span { display: block; height: 100%; background: linear-gradient(90deg, var(--purple), var(--cyan)); }
.chip.streak { padding: 6px 14px; }
.chip.streak.off { opacity: .7; }

.gift-btn {
  pointer-events: auto;
  padding: 12px 22px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff4d6d, #ff9f43);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .15);
  cursor: pointer;
  box-shadow: 0 5px 0 #c9244a;
  animation: wiggle 1.6s ease-in-out infinite;
}

.gift-btn.hidden { display: none; }

@keyframes wiggle {
  0%, 60%, 100% { transform: rotate(0); }
  70% { transform: rotate(-5deg) scale(1.05); }
  80% { transform: rotate(5deg) scale(1.05); }
  90% { transform: rotate(-2deg); }
}

.grid-menu { display: grid; grid-template-columns: repeat(3, 1fr); width: min(100%, 380px); }
.grid-menu button { padding: 10px 6px; font-size: 14px; }

/* ---------- Fim de jogo: o quase, régua e XP ---------- */
.over-msg { display: flex; flex-direction: column; gap: 4px; font-size: 17px; font-weight: 600; text-shadow: 0 2px 0 rgba(36, 48, 94, .25); }
.over-msg:empty { display: none; }

.ruler {
  position: relative;
  width: min(80vw, 300px);
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .35);
}

.ruler.hidden { display: none; }
.ruler .zone { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--green); }

.ruler .mark {
  position: absolute;
  top: -6px;
  width: 6px;
  height: 30px;
  margin-left: -3px;
  border-radius: 3px;
  background: var(--pink);
  box-shadow: 0 0 0 2px #fff;
}

.xp-row { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.xpbar { width: min(46vw, 180px); height: 14px; border-radius: 999px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.xpbar span { display: block; width: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--yellow), var(--orange)); transition: width .9s cubic-bezier(.3, 1.2, .5, 1); }
.xp-row small { font-size: 15px; font-weight: 700; color: var(--yellow); }

.tap-again { margin-top: 2px; font-size: 14px; opacity: .85; animation: pulse 1.4s ease-in-out infinite; }

/* ---------- Presente do dia ---------- */
.note.big { font-size: 20px; font-weight: 700; color: var(--ink); }
.gift-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 8px 0 16px; }

.gift-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 2px;
  border-radius: 14px;
  background: #fff;
  font-size: 13px;
  box-shadow: 0 3px 0 rgba(36, 48, 94, .1);
}

.gift-day span { font-size: 20px; }
.gift-day.got { background: #e3fbec; opacity: .7; }
.gift-day.today { background: var(--yellow); transform: scale(1.08); box-shadow: 0 3px 0 #d9a400; }

.big-btn {
  display: block;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff4d6d, #ff9f43);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 0 #c9244a;
}

.big-btn.opening { animation: shake .45s ease-in-out; }

@keyframes shake {
  20% { transform: rotate(-4deg) scale(1.05); }
  40% { transform: rotate(4deg) scale(1.08); }
  60% { transform: rotate(-3deg) scale(1.1); }
  80% { transform: rotate(2deg) scale(1.12); }
}

/* ---------- Nível, temporada e álbum ---------- */
.level-head, .season-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: 20px;
  background: #fff;
}

.level-badge {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  box-shadow: 0 4px 0 #5537d6;
}

.season-head > span { font-size: 44px; }
.sub { margin: 14px 4px 8px; font-size: 17px; font-weight: 700; }
.sub small { font-weight: 500; color: var(--ink-soft); }
.row.special { background: linear-gradient(135deg, #fff3bf, #ffe0d1); }

.album-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.album-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 16px;
  background: #e6eaf8;
  text-align: center;
}

.album-cell span { font-size: 26px; color: var(--ink-soft); font-weight: 700; }
.album-cell small { font-size: 11px; line-height: 1.2; color: var(--ink-soft); }
.album-cell.got { background: #fff; box-shadow: 0 3px 0 rgba(36, 48, 94, .1); }
.album-cell.got small { color: var(--ink); }

/* no fim de jogo o placar do jogo sai de cena */
body.over #hud, body.over #powerups { visibility: hidden; }

/* celulares mais baixos: fim de jogo mais compacto */
@media (max-height: 760px) {
  #over { gap: 8px; }
  #over h2 { font-size: 32px; }
  .final span { font-size: 80px; }
  #restart { padding: 13px 40px; font-size: 20px; }
  .menu button { padding: 9px 12px; font-size: 14px; }
}

/* ---------- Continuar depois de cair ---------- */
#revive {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  background: rgba(36, 48, 94, .45);
}

#revive.hidden { display: none; }

.revive-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(86vw, 330px);
  padding: 24px 20px;
  border-radius: 28px;
  background: #fff;
  text-align: center;
  animation: popin .35s cubic-bezier(.3, 1.6, .5, 1);
}

.revive-card h2 { font-size: 30px; color: var(--ink); }
.revive-bar { width: 100%; height: 12px; border-radius: 999px; background: #e6eaf8; overflow: hidden; }
.revive-bar span { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, var(--pink), var(--orange)); }
.revive-bar span.run { animation: drain 5s linear forwards; }
@keyframes drain { to { width: 0; } }

#reviveGo {
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: 18px;
  background: var(--green);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 0 #1f9e58;
}

#reviveNo { border: 0; background: none; color: var(--ink-soft); font-size: 15px; font-weight: 600; cursor: pointer; }

/* ---------- Tela inicial: próximo desbloqueio, fim de semana, avisos ---------- */
.next-chip { font-size: 15px; font-weight: 600; text-shadow: 0 2px 0 rgba(36, 48, 94, .25); }
.next-chip:empty { display: none; }
.chip.weekend { padding: 6px 12px; background: var(--yellow); pointer-events: none; }
.chip.weekend.hidden { display: none; }
body.veteran .start-top p { display: none; }

.menu button { position: relative; }

.menu button.dot::after {
  content: '';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--pink);
}

/* ---------- Fim de jogo ---------- */
.next-unlock { font-size: 14px; font-weight: 600; opacity: .95; }
.next-unlock:empty { display: none; }

.moment-btn {
  padding: 10px 18px;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(36, 48, 94, .2);
}

.moment-btn.hidden { display: none; }

/* ---------- Porto ---------- */
#portView { display: block; width: 100%; border-radius: 20px; margin-bottom: 10px; }
.port-info { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 4px 8px; }
.port-info b { font-size: 18px; }
.port-info small { color: var(--ink-soft); font-size: 15px; }
.small.wide { display: block; width: 100%; margin-top: 10px; padding: 11px; font-size: 15px; }

/* ---------- Roleta ---------- */
.wheel-wrap { position: relative; width: min(78vw, 300px); margin: 6px auto 16px; }
.wheel-wrap canvas { display: block; width: 100%; height: auto; }
.wheel-pointer { position: absolute; top: -14px; left: 50%; z-index: 1; transform: translateX(-50%); color: var(--ink); font-size: 30px; text-shadow: 0 2px 0 #fff; }

/* ---------- Seus números ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 3px 0 rgba(36, 48, 94, .08);
}

.stat span { grid-row: span 2; font-size: 26px; }
.stat b { font-size: 20px; }
.stat small { color: var(--ink-soft); font-size: 13px; }

.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 150px;
  padding: 10px;
  border-radius: 18px;
  background: #fff;
}

.chart .col {
  position: relative;
  flex: 1;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(var(--purple), var(--cyan));
}

.chart .col small { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--ink-soft); }

/* na tela inicial os avisos ficam no alto, para não cobrir o menu */
body.demo #toasts { top: calc(env(safe-area-inset-top) + 74px); bottom: auto; }

/* ---------- Dica da primeira vez de cada base especial ---------- */
#tip {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 250px);
  left: 50%;
  z-index: 16;
  width: max-content;
  max-width: min(90vw, 380px);
  padding: 12px 18px;
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 5px 0 rgba(36, 48, 94, .18);
  opacity: 0;
  transform: translateX(-50%) translateY(-8px) scale(.95);
  pointer-events: none;
  transition: opacity .25s, transform .3s cubic-bezier(.3, 1.6, .5, 1);
}

#tip.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
body.over #tip, body.demo #tip { display: none; }
