:root {
  color-scheme: light;
  --ink: #28251f;
  --muted: #777064;
  --paper: #f4ecdf;
  --paper-deep: #e9ddca;
  --board: #cfc1ac;
  --cell: rgba(255, 255, 255, 0.36);
  --vermillion: #df5b3f;
  --vermillion-dark: #bb402b;
  --gold: #dba945;
  --cream: #fffaf0;
  --shadow: 0 12px 30px rgba(75, 56, 32, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.85), transparent 31rem),
    linear-gradient(155deg, #f7f0e5 0%, var(--paper) 52%, #eee3d3 100%);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg width='140' height='140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

button {
  font: inherit;
}

.app {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px max(36px, env(safe-area-inset-bottom));
}

.topbar,
.score-row,
.section-heading {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--vermillion);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.19em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.9rem, 9vw, 2.55rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 1;
}

h1 span {
  margin-left: 0.16em;
  color: var(--vermillion);
  font-size: 0.62em;
  letter-spacing: -0.04em;
}

.icon-button,
.dialog-close {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(54, 45, 34, 0.12);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.7);
  box-shadow: 0 6px 18px rgba(75, 56, 32, 0.08);
  font-weight: 800;
  place-items: center;
}

.sound-button {
  font-size: 1.05rem;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.sound-button.is-muted {
  opacity: 0.46;
  transform: scale(0.92);
}

.score-row {
  gap: 8px;
  margin-bottom: 12px;
}

.score-card {
  min-width: 68px;
  padding: 8px 11px 7px;
  border: 1px solid rgba(59, 46, 31, 0.09);
  border-radius: 12px;
  background: rgba(255, 250, 240, 0.74);
  text-align: center;
}

.score-card span {
  display: block;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 700;
}

.score-card strong {
  display: block;
  margin-top: 1px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.08rem;
}

.score-card--main {
  min-width: 80px;
  color: var(--cream);
  border-color: var(--vermillion-dark);
  background: var(--vermillion);
}

.score-card--main span {
  color: rgba(255, 255, 255, 0.78);
}

.new-game-button {
  align-self: stretch;
  margin-left: auto;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 800;
}

.new-game-button span {
  display: inline-block;
  margin-right: 3px;
  color: var(--vermillion);
  font-size: 1.1rem;
}

.mission-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(121, 88, 35, 0.13);
  border-radius: 15px;
  background: rgba(255, 250, 240, 0.72);
  box-shadow: 0 6px 22px rgba(75, 56, 32, 0.07);
}

.growth-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  margin-bottom: 10px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid rgba(75, 70, 43, 0.12);
  border-radius: 14px;
  background: rgba(255, 250, 240, 0.58);
  transition:
    background 800ms ease,
    border-color 800ms ease;
}

.growth-symbol {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50% 50% 45% 45%;
  color: #fffaf0;
  background: #a59b72;
  box-shadow: inset 0 -3px 0 rgba(50, 44, 29, 0.1);
  font-family: "Yu Mincho", serif;
  font-size: 1rem;
  font-weight: 900;
  place-items: center;
  transition:
    background 800ms ease,
    transform 500ms cubic-bezier(0.2, 0.85, 0.25, 1.25);
}

.growth-card.is-level-up .growth-symbol {
  animation: growth-pop 720ms cubic-bezier(0.2, 0.85, 0.25, 1.25);
}

.growth-status {
  min-width: 0;
  flex: 1;
}

.growth-copy {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.growth-copy span {
  flex: 0 0 auto;
  font-family: "Yu Mincho", serif;
  font-size: 0.75rem;
  font-weight: 900;
}

.growth-copy strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-track {
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(94, 83, 61, 0.13);
}

.growth-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #a59b72;
  transition:
    width 550ms ease,
    background 800ms ease;
}

.rush-badge {
  position: relative;
  width: 78px;
  flex: 0 0 auto;
  padding: 4px 7px 7px;
  overflow: hidden;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, #df5b3f, #f0a43c);
  box-shadow: 0 4px 12px rgba(188, 70, 40, 0.2);
  line-height: 1;
  text-align: right;
  animation: rush-enter 280ms ease-out;
}

.rush-badge[hidden] {
  display: none;
}

.rush-badge span {
  display: block;
  margin-bottom: 1px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.43rem;
  font-weight: 800;
}

.rush-badge strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
}

.rush-badge small {
  margin-left: 2px;
  color: rgba(255, 255, 255, 0.88);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.45rem;
}

.rush-badge > i {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.75);
  transform-origin: left;
}

body[data-growth-level="1"] .board {
  --board: #c8c4a7;
}

body[data-growth-level="1"] .growth-symbol,
body[data-growth-level="1"] .growth-track i {
  background: #91a66f;
}

body[data-growth-level="2"] .board {
  --board: #aeb797;
}

body[data-growth-level="2"] .growth-symbol,
body[data-growth-level="2"] .growth-track i {
  background: #729360;
}

body[data-growth-level="3"] .board {
  --board: #8da98b;
}

body[data-growth-level="3"] .growth-symbol,
body[data-growth-level="3"] .growth-track i {
  background: #dd8a86;
}

body[data-growth-level="4"] .board {
  --board: #6e9179;
}

body[data-growth-level="4"] .growth-symbol,
body[data-growth-level="4"] .growth-track i {
  background: #4f765e;
}

body[data-growth-level="5"] .board {
  --board: #577d6c;
}

body[data-growth-level="5"] .growth-symbol,
body[data-growth-level="5"] .growth-track i {
  background: #3f6d57;
}

body[data-growth-level="6"] .board {
  --board: #45695c;
}

body[data-growth-level="6"] .growth-symbol,
body[data-growth-level="6"] .growth-track i {
  background: #315943;
}

body[data-growth-level="1"] .growth-card,
body[data-growth-level="2"] .growth-card,
body[data-growth-level="3"] .growth-card,
body[data-growth-level="4"] .growth-card,
body[data-growth-level="5"] .growth-card,
body[data-growth-level="6"] .growth-card {
  border-color: rgba(74, 107, 67, 0.18);
  background: rgba(245, 250, 235, 0.65);
}

.mission-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  color: #fff8e8;
  background: var(--gold);
  font-family: "Yu Mincho", serif;
  font-size: 1.24rem;
  font-weight: 900;
  place-items: center;
}

.mission-card > div:nth-child(2) {
  min-width: 0;
}

.mission-card span,
.mission-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-card span {
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 700;
}

.mission-card strong {
  margin-top: 2px;
  font-family: "Yu Mincho", serif;
  font-size: 0.83rem;
}

.combo-badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 5px 8px;
  border-radius: 9px;
  color: #fff;
  background: var(--vermillion);
  font-size: 0.65rem;
  font-weight: 800;
  text-align: center;
  animation: bounce-in 320ms ease-out;
}

.combo-badge span {
  display: inline;
  color: inherit;
  font-size: 0.9rem;
}

.game-shell {
  position: relative;
}

.word-effect {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  overflow: hidden;
  border-radius: 19px;
  opacity: 0;
  pointer-events: none;
  place-items: center;
}

.word-effect.is-active {
  animation: effect-stage 1560ms ease-out both;
}

.effect-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(255, 250, 224, 0.92) 0%,
    rgba(239, 180, 72, 0.33) 28%,
    transparent 67%
  );
  opacity: 0;
}

.word-effect.is-active .effect-flash {
  animation: effect-flash 1100ms ease-out;
}

.effect-ring {
  position: absolute;
  width: 100px;
  aspect-ratio: 1;
  border: 5px solid rgba(255, 244, 199, 0.88);
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(223, 91, 63, 0.35),
    0 0 25px rgba(255, 211, 106, 0.7);
  opacity: 0;
}

.word-effect.is-active .effect-ring {
  animation: effect-ring 1250ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.word-stamp {
  position: relative;
  display: grid;
  width: 132px;
  aspect-ratio: 1;
  border: 4px double rgba(255, 248, 225, 0.88);
  border-radius: 50%;
  color: #fffaf0;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.18), transparent 25%),
    var(--vermillion);
  box-shadow:
    0 12px 30px rgba(76, 35, 24, 0.28),
    inset 0 0 0 4px rgba(157, 40, 25, 0.14);
  opacity: 0;
  text-align: center;
  transform: rotate(-7deg) scale(0.2);
  place-content: center;
}

.word-stamp::before,
.word-stamp::after {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 245, 218, 0.2);
  content: "";
}

.word-stamp::before {
  top: 17px;
  right: 20px;
  width: 7px;
  height: 7px;
}

.word-stamp::after {
  bottom: 24px;
  left: 17px;
  width: 5px;
  height: 5px;
}

.word-effect.is-active .word-stamp {
  animation: stamp-pop 1480ms cubic-bezier(0.18, 0.8, 0.25, 1.22) both;
}

.word-stamp span,
.word-stamp small {
  display: block;
  font-family: "Hiragino Sans", sans-serif;
  font-weight: 800;
}

.word-stamp span {
  margin-bottom: -2px;
  font-size: 0.6rem;
  letter-spacing: 0.13em;
}

.word-stamp strong {
  display: block;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 2.7rem;
  line-height: 1.06;
  letter-spacing: -0.07em;
}

.word-stamp strong.is-dual {
  font-size: 1.65rem;
  letter-spacing: -0.09em;
}

.word-stamp small {
  margin-top: 2px;
  color: #ffe3a0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.73rem;
}

.effect-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2);
  border-radius: var(--radius);
  background: var(--color);
  box-shadow: 0 0 7px color-mix(in srgb, var(--color), transparent 35%);
  opacity: 0;
}

.word-effect.is-active .effect-particle {
  animation: particle-burst 1240ms var(--delay) cubic-bezier(0.1, 0.65, 0.3, 1) both;
}

.board {
  --gap: 8px;
  display: grid;
  aspect-ratio: 4 / 5;
  width: 100%;
  padding: var(--gap);
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: var(--gap);
  border: 1px solid rgba(67, 50, 30, 0.16);
  border-radius: 19px;
  background: var(--board);
  box-shadow: var(--shadow), inset 0 1px 1px rgba(255, 255, 255, 0.55);
  transition:
    background 900ms ease,
    box-shadow 900ms ease;
  touch-action: none;
  user-select: none;
}

.cell {
  position: relative;
  display: grid;
  min-width: 0;
  border-radius: 12px;
  background: var(--cell);
  place-items: center;
}

.tile {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(54, 41, 23, 0.08);
  border-radius: 12px;
  color: #302b23;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), transparent 45%),
    #f9f1e4;
  box-shadow:
    0 4px 8px rgba(65, 48, 26, 0.13),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(2rem, 12vw, 3.45rem);
  font-weight: 900;
  line-height: 1;
  place-items: center;
  animation: tile-arrive 180ms cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

.tile::after {
  position: absolute;
  right: 7px;
  bottom: 5px;
  color: rgba(75, 65, 52, 0.5);
  content: attr(data-reading);
  font-family: "Hiragino Sans", sans-serif;
  font-size: 0.5rem;
  font-weight: 700;
}

.tile--level-1 {
  color: #3a3126;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), transparent 48%),
    #f9f1e4;
}

.tile--level-2 {
  color: #7d4d20;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), transparent 48%),
    #f1d89b;
}

.tile--level-3 {
  color: #fff8ea;
  border-color: #bd432f;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 48%),
    var(--vermillion);
  text-shadow: 0 1px 1px rgba(91, 31, 21, 0.22);
}

.tile--level-3::after {
  color: rgba(255, 255, 255, 0.66);
}

.tile--merged {
  animation: tile-merge 300ms cubic-bezier(0.2, 0.8, 0.2, 1.25);
}

.tile--merged-combine {
  animation: tile-combine-feedback 520ms cubic-bezier(0.16, 0.8, 0.22, 1.2);
}

.tile--merged-same {
  animation: tile-same-feedback 420ms cubic-bezier(0.2, 0.8, 0.25, 1.15);
}

.merge-pop {
  position: absolute;
  top: 5px;
  left: 50%;
  z-index: 3;
  width: max-content;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
  font-family: "Hiragino Sans", sans-serif;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  pointer-events: none;
  transform: translateX(-50%);
  animation: merge-pop 700ms ease-out both;
}

.merge-pop--combine {
  background: rgba(205, 76, 48, 0.92);
  box-shadow: 0 3px 9px rgba(150, 48, 31, 0.24);
}

.merge-pop--same {
  background: rgba(91, 117, 78, 0.9);
  box-shadow: 0 3px 9px rgba(51, 78, 45, 0.2);
}

.tile--hint {
  box-shadow:
    0 0 0 3px rgba(223, 91, 63, 0.25),
    0 4px 8px rgba(65, 48, 26, 0.13);
}

.game-message {
  position: absolute;
  inset: 0;
  display: grid;
  padding: 24px;
  border-radius: 19px;
  background: rgba(49, 42, 33, 0.72);
  backdrop-filter: blur(5px);
  place-items: center;
  animation: fade-in 250ms ease;
}

.game-message[hidden] {
  display: none;
}

.message-card {
  width: min(100%, 300px);
  padding: 25px 22px;
  border-radius: 20px;
  background: var(--cream);
  box-shadow: 0 20px 44px rgba(34, 25, 17, 0.22);
  text-align: center;
}

.message-kicker {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.message-card > strong {
  display: block;
  margin: 2px 0 14px;
  color: var(--vermillion);
  font-family: ui-monospace, monospace;
  font-size: 2.2rem;
}

.message-card h2 {
  margin-bottom: 7px;
  font-family: "Yu Mincho", serif;
  font-size: 1.35rem;
}

.message-card p:not(.message-kicker) {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.message-card button,
.primary-button {
  width: 100%;
  padding: 13px 20px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--vermillion);
  box-shadow: 0 6px 0 var(--vermillion-dark);
  font-weight: 800;
}

.message-card button:active,
.primary-button:active {
  translate: 0 3px;
  box-shadow: 0 3px 0 var(--vermillion-dark);
}

.gesture-hint {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

.gesture-hint span {
  margin-right: 5px;
  color: var(--vermillion);
  font-size: 1rem;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 9px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-family: "Yu Mincho", serif;
  font-size: 1rem;
}

.section-heading > span {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 700;
}

.recipe-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.recipe {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 47px;
  padding: 7px 9px;
  border: 1px solid rgba(69, 52, 29, 0.09);
  border-radius: 11px;
  background: rgba(255, 250, 240, 0.62);
}

.recipe strong {
  flex: 0 0 auto;
  font-family: "Yu Mincho", serif;
  font-size: 0.87rem;
}

.recipe span {
  overflow: hidden;
  margin-left: 7px;
  color: var(--muted);
  font-size: 0.57rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipe--locked {
  color: #9c9488;
  background: rgba(255, 255, 255, 0.24);
}

.recipe--locked strong {
  filter: blur(4px);
  user-select: none;
}

.help-dialog {
  width: min(calc(100% - 32px), 440px);
  margin: auto;
  padding: 28px 24px 24px;
  border: 0;
  border-radius: 23px;
  color: var(--ink);
  background: var(--cream);
  box-shadow: 0 24px 70px rgba(38, 29, 18, 0.28);
}

.help-dialog::backdrop {
  background: rgba(44, 37, 29, 0.65);
  backdrop-filter: blur(4px);
}

.help-dialog h2 {
  margin-bottom: 21px;
  font-family: "Yu Mincho", serif;
  font-size: 1.72rem;
  line-height: 1.35;
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  background: var(--paper);
  box-shadow: none;
  font-size: 1.25rem;
}

.help-dialog ol {
  display: grid;
  gap: 16px;
  margin: 0 0 25px;
  padding: 0;
  list-style: none;
}

.help-dialog li {
  display: flex;
  gap: 12px;
}

.step-number {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--vermillion);
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 800;
  place-items: center;
}

.help-dialog li strong {
  font-size: 0.86rem;
}

.help-dialog li p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.55;
}

.help-dialog li b {
  color: var(--vermillion);
  font-family: "Yu Mincho", serif;
  font-size: 1rem;
}

@keyframes tile-arrive {
  from {
    opacity: 0;
    scale: 0.68;
  }
}

@keyframes tile-merge {
  50% {
    scale: 1.16;
  }
}

@keyframes tile-combine-feedback {
  0% {
    filter: brightness(1);
    scale: 0.76;
  }
  42% {
    filter: brightness(1.18) saturate(1.15);
    box-shadow:
      0 0 0 5px rgba(223, 91, 63, 0.2),
      0 8px 18px rgba(117, 59, 34, 0.2);
    scale: 1.13;
  }
  100% {
    filter: brightness(1);
    scale: 1;
  }
}

@keyframes tile-same-feedback {
  0% {
    opacity: 0.72;
    scale: 0.88;
  }
  48% {
    box-shadow:
      0 0 0 4px rgba(114, 147, 96, 0.18),
      0 6px 14px rgba(65, 92, 57, 0.16);
    scale: 1.08;
  }
  100% {
    opacity: 1;
    scale: 1;
  }
}

@keyframes merge-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 5px) scale(0.78);
  }
  24%,
  64% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.92);
  }
}

@keyframes bounce-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.8);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes growth-pop {
  0%,
  100% {
    transform: rotate(0) scale(1);
  }
  35% {
    transform: rotate(-8deg) scale(1.25);
  }
  60% {
    transform: rotate(6deg) scale(0.94);
  }
}

@keyframes rush-enter {
  from {
    opacity: 0;
    transform: translateX(8px) scale(0.88);
  }
}

@keyframes effect-stage {
  0%,
  100% {
    opacity: 0;
  }
  8%,
  82% {
    opacity: 1;
  }
}

@keyframes effect-flash {
  0% {
    opacity: 0;
    scale: 0.35;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    scale: 1.25;
  }
}

@keyframes effect-ring {
  0% {
    opacity: 0.95;
    scale: 0.55;
  }
  100% {
    opacity: 0;
    scale: 3.1;
  }
}

@keyframes stamp-pop {
  0% {
    opacity: 0;
    transform: rotate(-18deg) scale(0.18);
  }
  33% {
    opacity: 1;
    transform: rotate(4deg) scale(1.17);
  }
  52% {
    transform: rotate(-4deg) scale(0.96);
  }
  76% {
    opacity: 1;
    transform: rotate(-2deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(-2deg) scale(0.9) translateY(-9px);
  }
}

@keyframes particle-burst {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0) scale(0.4);
  }
  12% {
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--travel-x), var(--travel-y)) rotate(var(--spin)) scale(0.85);
  }
}

@media (min-width: 560px) {
  .app {
    padding-top: 32px;
  }

  .board {
    --gap: 10px;
  }
}

@media (max-height: 700px) and (orientation: landscape) {
  .app {
    width: min(100%, 900px);
  }

  .game-shell {
    width: min(55vh, 410px);
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
