:root {
  --cell: 40px;
  --gap: 2px;
  --tcell: 22px;
  --mgap: 1px;
  --bev: 3px;
  --tbev: 2px;
  --ink: #ffffff;
  --done: max(0px, env(safe-area-inset-bottom));
  --gold-hi: #ffe8a8;
  --gold: #ffb52e;
  --gold-lo: #ef7f0c;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #2b3c82;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

body {
  background:
    radial-gradient(130% 85% at 50% -15%, #7492ee 0%, #5066c2 26%, #3a4d9c 58%, #25336f 100%);
}

/* мягкие цветные пятна света, медленно дышат */
body::before {
  content: "";
  position: fixed;
  left: -25%;
  top: -22%;
  width: 150%;
  height: 145%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(110, 240, 255, 0.22), transparent 72%) 16% 10% / 48% 36% no-repeat,
    radial-gradient(closest-side, rgba(255, 200, 90, 0.16), transparent 72%) 86% 20% / 46% 34% no-repeat,
    radial-gradient(closest-side, rgba(170, 120, 255, 0.22), transparent 72%) 52% 98% / 68% 44% no-repeat;
  animation: glowDrift 18s ease-in-out infinite alternate;
  will-change: transform;
}

/* затемнение по краям, чтобы центр читался */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(125% 95% at 50% 34%, rgba(0, 0, 0, 0) 46%, rgba(6, 10, 28, 0.42) 100%);
}

.app {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px 12px calc(6px + var(--done));
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- верхняя панель ---------- */

.hud { flex: none; }

.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
}

.best-box {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px 4px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(10, 20, 52, 0.42), rgba(10, 20, 52, 0.16));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 3px 10px rgba(6, 12, 32, 0.28);
}

.crown {
  font-size: 19px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(120, 60, 0, 0.45));
}

.best-val {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: var(--gold);
  filter: drop-shadow(0 1px 0 rgba(90, 45, 0, 0.55));
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .best-val {
    background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-lo) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.hud-btns { display: flex; gap: 8px; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
  color: #fff;
  font-size: 17px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.18),
    0 4px 10px rgba(6, 14, 34, 0.3);
  transition: transform 0.1s ease, filter 0.15s ease;
}
.icon-btn:active { transform: translateY(1px) scale(0.95); filter: brightness(1.15); }

.gear { font-size: 22px; }

.mute-badge {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff6d5f, #c8241f 70%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  font-size: 9px;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(90, 10, 10, 0.5);
}
.mute-badge.hidden { display: none; }

.score-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  margin: 2px 0 4px;
}

.diamond {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  transform: rotate(45deg);
  border-radius: 10px;
  background: linear-gradient(135deg, #6ef0ff, #2f8fff);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.18),
    inset 0 0 20px rgba(255, 255, 255, 0.30),
    0 8px 22px rgba(8, 18, 50, 0.45),
    0 0 26px rgba(120, 220, 255, 0.28);
  opacity: 0.92;
  transition: background 0.25s ease, transform 0.16s ease, box-shadow 0.25s ease;
}

/* блик по ромбу */
.diamond::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.10) 46%, rgba(255, 255, 255, 0) 62%);
  mix-blend-mode: screen;
}

.diamond.pop { transform: rotate(45deg) scale(1.16); }
.diamond.pop::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.25) 52%, rgba(255, 255, 255, 0) 70%);
}

.score-val {
  position: relative;
  text-align: center;
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #ffffff;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35),
    0 3px 0 rgba(22, 40, 90, 0.35),
    0 8px 18px rgba(8, 20, 60, 0.55);
  transition: transform 0.12s ease;
  line-height: 1;
}
.score-val.pop { transform: scale(1.09); }

/* ---------- поле ---------- */

.play {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding-top: 4px;
}

.board-shell { position: relative; margin-top: 2px; }

.board-shell::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 22px;
  box-shadow:
    0 0 22px 4px var(--glow, rgba(120, 240, 255, 0.55)),
    0 0 52px 16px var(--glow, rgba(120, 240, 255, 0.35));
  opacity: 0;
  transition: opacity 0.45s ease-out;
  pointer-events: none;
}
.board-shell.glow::before { opacity: 1; transition-duration: 0.08s; }
.board-shell.pulse { animation: boardPulse 0.42s ease-out; }

/* стеклянный отблеск поверх поля */
.board-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 14px;
  pointer-events: none;
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.04) 36%, rgba(255, 255, 255, 0) 52%);
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, var(--cell));
  grid-template-rows: repeat(8, var(--cell));
  gap: var(--gap);
  padding: 5px;
  border-radius: 14px;
  background:
    radial-gradient(120% 100% at 50% 0%, #1e2b5b 0%, #131c3f 52%, #0c1230 100%);
  border: 2px solid #2a3f7d;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.10),
    inset 0 -4px 10px rgba(0, 0, 0, 0.45),
    inset 0 0 34px rgba(70, 130, 255, 0.12),
    0 0 0 1px rgba(8, 16, 38, 0.7),
    0 16px 32px rgba(5, 10, 28, 0.5);
}

.cell {
  position: relative;
  border-radius: 6px;
  background: linear-gradient(180deg, #1f2a56 0%, #141c3e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 2px rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(0, 0, 0, 0.16);
  transition: background 0.1s ease, transform 0.14s ease, opacity 0.1s ease;
}

/* плитка: скошенная фаска по краю и плоская грань внутри */
.cell.fill,
.blk {
  position: relative;
  border-radius: 6px;
  background-color: var(--lo);
  background-image:
    linear-gradient(158deg, var(--hi) 0%, var(--base) 40%, var(--lo) 100%);
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.28),
    0 5px 10px rgba(4, 10, 26, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -2px 4px rgba(0, 0, 0, 0.22);
}

.cell.fill::after,
.blk::after {
  content: "";
  position: absolute;
  inset: var(--bev);
  z-index: 1;
  border-radius: 3px;
  background-color: var(--base);
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.06) 32%, rgba(0, 0, 0, 0.12) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.10);
}

/* глянцевый блик поверх плитки */
.cell.fill::before,
.blk::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.07) 33%, rgba(255, 255, 255, 0) 52%);
}

.cell.place { animation: placePop 0.18s ease-out; }

.cell.preview {
  opacity: 0.52;
  background-color: var(--base);
  background-image: linear-gradient(180deg, var(--hi) 0%, var(--base) 60%, var(--lo) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 0 12px rgba(255, 255, 255, 0.10);
}
.cell.preview::before { opacity: 0.5; }
.cell.preview::after {
  inset: 1px;
  border-radius: 5px;
  background: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.cell.preview.willclear {
  opacity: 0.95;
}
.cell.preview.willclear::after {
  box-shadow:
    inset 0 0 0 2px #ffffff,
    0 0 12px rgba(255, 255, 255, 0.6);
}

.cell.clearing { animation: burn 0.26s ease-in forwards; }

/* палитра как в игре */
.c0 { --hi: #ff8d7f; --base: #d92b26; --lo: #8f110e; }
.c1 { --hi: #ffbb78; --base: #f07a15; --lo: #a84a05; }
.c2 { --hi: #ffe88f; --base: #f2b612; --lo: #b07a00; }
.c3 { --hi: #8ff06e; --base: #38b52a; --lo: #1a7413; }
.c4 { --hi: #96f2ff; --base: #23b6dd; --lo: #0d7396; }
.c5 { --hi: #8dbdff; --base: #2f6fe0; --lo: #17429c; }
.c6 { --hi: #cda6ff; --base: #8e4fd8; --lo: #5a279e; }
.c7 { --hi: #ffa8dc; --base: #e8469f; --lo: #a51f6a; }

/* ---------- фигуры ---------- */

.tray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  flex: none;
  margin-top: auto;
  height: auto;
  min-height: calc(var(--tcell) * 4.4);
  padding: 4px 6px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(10, 20, 50, 0.30), rgba(10, 20, 50, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -2px 8px rgba(0, 0, 0, 0.20);
}

.slot {
  flex: 1 1 0;
  max-width: calc(var(--tcell) * 5);
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.piece {
  display: grid;
  gap: var(--mgap);
  cursor: grab;
  touch-action: none;
  transition: opacity 0.1s ease;
}

.piece.picked { opacity: 0.18; }

.tray.fresh .piece { animation: pieceDrop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
.tray.fresh .slot:nth-child(2) .piece { animation-delay: 0.045s; }
.tray.fresh .slot:nth-child(3) .piece { animation-delay: 0.09s; }

.piece.floating {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  pointer-events: none;
  gap: var(--gap);
  filter: drop-shadow(0 14px 18px rgba(6, 16, 44, 0.45));
  will-change: transform;
}

.slot .blk { --bev: var(--tbev); }

.blank { background: none; box-shadow: none; }
.blank::after { content: none; }
.blank::before { content: none; }

/* ---------- эффекты ---------- */

.fx {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}

.popup {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  font-size: 42px;
  font-weight: 900;
  color: #ffe066;
  -webkit-text-stroke: 4px #d1790d;
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 rgba(120, 50, 0, 0.4),
    0 0 22px rgba(255, 200, 80, 0.65);
  animation: floatUp 0.9s ease-out forwards;
  white-space: nowrap;
}

.popup::after {
  content: "✦";
  margin-left: 7px;
  font-size: 0.55em;
  vertical-align: 0.35em;
  color: #8cff6a;
  -webkit-text-stroke: 0;
  text-shadow: 0 0 12px rgba(120, 255, 120, 0.85);
}

.banner {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  font-size: 38px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  color: #7ff06b;
  -webkit-text-stroke: 4px #2f8a27;
  paint-order: stroke fill;
  text-shadow:
    0 4px 0 rgba(20, 60, 20, 0.35),
    0 0 22px rgba(120, 255, 120, 0.55);
  animation: bannerIn 1s ease-out forwards;
  white-space: nowrap;
}

.combo-pop {
  position: absolute;
  left: 50%;
  top: 60%;
  transform: translate(-50%, -50%);
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  color: #ffffff;
  -webkit-text-stroke: 4px #2f6fe0;
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 rgba(15, 40, 100, 0.4),
    0 0 18px rgba(120, 190, 255, 0.6);
  animation: floatUp 1s ease-out forwards;
  white-space: nowrap;
}

.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.55);
  animation: sparkFly 0.8s ease-out forwards;
}

/* ---------- окна ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(10, 20, 50, 0.66);
  backdrop-filter: blur(9px) saturate(120%);
  -webkit-backdrop-filter: blur(9px) saturate(120%);
  transition: opacity 0.2s ease;
}

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

.panel {
  position: relative;
  width: 100%;
  max-width: 330px;
  padding: 22px 20px 20px;
  border-radius: 20px;
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, #4468bd 0%, #2c4790 100%) padding-box,
    linear-gradient(180deg, rgba(180, 220, 255, 0.6), rgba(90, 130, 210, 0.15)) border-box;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 26px 60px rgba(4, 10, 30, 0.6);
  text-align: center;
  animation: panelIn 0.25s ease-out;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 44%);
}

.panel > * { position: relative; }

.panel-title {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.final {
  font-size: 48px;
  font-weight: 900;
  margin: 4px 0 2px;
  letter-spacing: -0.01em;
  color: #ffffff;
  filter: drop-shadow(0 4px 10px rgba(6, 16, 44, 0.5));
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .final {
    background: linear-gradient(180deg, #ffffff, #cfe2ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

.badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: #4a2c00;
  background: linear-gradient(180deg, #ffe88f, #ffab16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 5px 14px rgba(255, 170, 43, 0.35);
}
.badge.hidden { display: none; }

.panel-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.panel-row.dim { color: rgba(255, 255, 255, 0.66); border-top: none; padding-top: 0; }

.btn {
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.10));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(0.985); }
.btn.primary {
  border-color: rgba(255, 235, 180, 0.5);
  color: #402300;
  background: linear-gradient(180deg, #ffe88f 0%, #ffc247 45%, #ff9f1c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -3px 6px rgba(180, 90, 0, 0.35),
    0 10px 24px rgba(255, 160, 30, 0.42);
}
.btn.primary::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -70%;
  width: 45%;
  height: 220%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.65) 50%, rgba(255, 255, 255, 0) 100%);
  transform: rotate(18deg);
  animation: shineSweep 3.4s ease-in-out infinite;
}

.top-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
  text-align: left;
}
.top-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 14px;
}
.top-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list li .val { font-weight: 900; color: #ffca4d; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.toggle-row:first-of-type { margin-top: 8px; }

.switch {
  width: 52px;
  height: 30px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(10, 20, 50, 0.42), rgba(10, 20, 50, 0.28));
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: background 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  align-items: center;
}
.switch .knob {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, #dbe6ff);
  box-shadow:
    0 2px 5px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.18s cubic-bezier(0.3, 0.9, 0.4, 1.2);
}
.switch.on {
  background: linear-gradient(180deg, #6ee089, #2fae52);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 0 14px rgba(80, 220, 120, 0.35);
}
.switch.on .knob { transform: translateX(22px); }

/* ---------- анимации ---------- */

@keyframes glowDrift {
  0% { transform: translate3d(-2%, 0, 0) scale(1); }
  50% { transform: translate3d(2%, -2%, 0) scale(1.04); }
  100% { transform: translate3d(-1%, 2%, 0) scale(1.02); }
}

@keyframes boardPulse {
  0% { transform: scale(1); }
  38% { transform: scale(1.012); }
  100% { transform: scale(1); }
}

@keyframes pieceDrop {
  0% { opacity: 0; transform: translateY(-10px) scale(0.88); }
  100% { opacity: 1; transform: none; }
}

@keyframes placePop {
  0% { transform: scale(0.72); box-shadow: 0 0 0 rgba(255, 255, 255, 0); }
  65% { transform: scale(1.06); box-shadow: 0 0 14px rgba(255, 255, 255, 0.35); }
  100% { transform: scale(1); }
}

@keyframes sparkFly {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.15); }
}

@keyframes burn {
  0% { transform: scale(1); filter: brightness(1); }
  35% { transform: scale(1.09); filter: brightness(2.2) saturate(1.3); }
  100% { transform: scale(0.14); opacity: 0; filter: brightness(3.2); }
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(0.78); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -155%) scale(1); }
}

@keyframes bannerIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  75% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -82%) scale(1); }
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes shineSweep {
  0%, 55% { transform: translateX(0) rotate(18deg); }
  85%, 100% { transform: translateX(560%) rotate(18deg); }
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  .tray.fresh .piece { animation: none; }
  .btn.primary::after { animation: none; }
  .board-shell.pulse { animation: none; }
}
