.title, .stage {
  min-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  text-align: center;
  padding: 8px 14px 20px;
  gap: 8px;
}

.title h1, .brand {
  margin: 0;
  font-family: Fredoka, "Trebuchet MS", sans-serif;
  font-weight: 700;
  letter-spacing: .04em;
  text-shadow: 0 3px 0 #b86a12;
}

.title h1 { font-size: clamp(64px, 16vw, 104px); line-height: .86; }
.brand { font-size: 22px; letter-spacing: .16em; }

.tag, .how, .rec {
  margin: 0;
  font-weight: 800;
  color: #f3e0c8;
}

.how { max-width: 320px; line-height: 1.4; opacity: .9; }
.rec { color: var(--gold); min-height: 1.2em; }

.levels { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 320px; margin: 8px 0; }

.levels button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(240, 193, 74, .4);
  background: rgba(0, 0, 0, .2);
  color: #fff6e8;
  font-family: Fredoka, sans-serif;
  font-size: 18px;
  cursor: pointer;
}

.levels button.on { background: linear-gradient(180deg, #ffe7a3, #f0a31a); color: #3d2408; border-color: transparent; }
.levels button:disabled { opacity: .35; cursor: default; }

.hud {
  width: min(100%, 540px, max(280px, calc(100dvh - 180px)));
  display: grid;
  grid-template-columns: 92px 1fr 92px;
  gap: 8px;
  align-items: center;
}

.plaque {
  background: linear-gradient(180deg, rgba(255, 246, 232, .1), rgba(0, 0, 0, .22));
  border: 1px solid rgba(240, 193, 74, .4);
  border-radius: 16px;
  padding: 6px 4px 8px;
}

.plaque span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #e7c36a;
}

.plaque b {
  font-family: Fredoka, sans-serif;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.plaque b.low { color: #ff8d7a; }

.goal {
  position: relative;
  height: 42px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0, 0, 0, .28);
  border: 1px solid rgba(240, 193, 74, .35);
}

.goal-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #e23d8c, #f0a31a);
}

.goal span {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 100%;
  font-weight: 800;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

.frame {
  width: min(100%, 540px, max(280px, calc(100dvh - 180px)));
  padding: 10px;
  border-radius: 26px;
  background: linear-gradient(165deg, #6a4630, #24160f);
  box-shadow: 0 0 0 2px #f0d48a, 0 0 0 5px #6d4318, 0 18px 36px rgba(0, 0, 0, .42);
}

.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, #12382c, #0c241d);
  touch-action: none;
}

.cell {
  aspect-ratio: 1;
  border-radius: 22%;
  background: #071510;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .45);
  position: relative;
}

.candy {
  position: absolute;
  inset: 1px;
  border-radius: 22%;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -4px 0 rgba(0, 0, 0, .22);
}

.candy::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  top: 12%;
  height: 14%;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .4), transparent);
}

.candy[data-k="berry"] { background: linear-gradient(180deg, #ff8d98, #ff2d42 46%, #c00022); border-radius: 50%; }
.candy[data-k="corn"] { background: linear-gradient(180deg, #fff3a0, #ffe03a 46%, #e09400); border-radius: 16%; }
.candy[data-k="lime"] { background: linear-gradient(180deg, #8dff9e, #22c24a 46%, #0c7a28); border-radius: 46% 46% 38% 38%; }
.candy[data-k="grape"] { background: linear-gradient(180deg, #d7b0ff, #9a3dff 46%, #5c14b8); border-radius: 42% 42% 48% 48%; }
.candy[data-k="coco"] { background: linear-gradient(180deg, #9ec6ff, #2f7dff 46%, #143fb8); border-radius: 50% 50% 42% 42%; }

.cell.sel .candy { transform: translateY(-3px) scale(1.06); outline: 2px solid #fff6e8; outline-offset: 1px; }
.cell.shake { animation: shake .28s linear; }

.candy.pop { animation: burst .18s ease forwards; }
.candy.fall { animation: fall .2s cubic-bezier(.2, 1.3, .4, 1); }

.candy[data-s="row"]::before,
.candy[data-s="col"]::before {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, .8);
  border-radius: 99px;
  z-index: 1;
}
.candy[data-s="row"]::before { left: 8%; right: 8%; top: 42%; height: 16%; }
.candy[data-s="col"]::before { top: 8%; bottom: 8%; left: 42%; width: 16%; }
.candy[data-s="wrap"] { box-shadow: inset 0 0 0 3px #ffe08a, inset 0 2px 0 rgba(255, 255, 255, .7); }
.candy[data-s="bomb"] { outline: 2px solid #fff; animation: pulse 1s ease-in-out infinite; }

@keyframes burst { to { transform: scale(.2); opacity: 0; } }
@keyframes fall { from { transform: translateY(-24px) scale(.85); } }
@keyframes shake {
  20% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
}
@keyframes pulse {
  50% { filter: brightness(1.35); }
}

.card .btn { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .candy.pop, .candy.fall, .candy[data-s="bomb"], .cell.shake { animation: none; }
}
