/* Tile Fusion — game-specific styles */
.tf-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 16px;
}
.tf-board {
  position: relative;
  width: min(100%, 500px, max(280px, calc(100svh - 400px)));
  aspect-ratio: 1 / 1;
  background: #0f1326;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  container-type: inline-size;
  outline: none;
}
.is-fs .tf-board,
.is-pseudo-fs .tf-board {
  width: min(94vw, calc(100dvh - 170px), 640px);
}
.tf-cell,
.tf-tile {
  position: absolute;
  width: 21.25%;
  height: 21.25%;
  border-radius: 12%;
}
.tf-cell {
  left: calc(3% + var(--c) * 24.25%);
  top: calc(3% + var(--r) * 24.25%);
  background: rgba(255, 255, 255, 0.045);
}
.tf-tiles {
  position: absolute;
  inset: 0;
}
.tf-tile {
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  transform: translate(calc(14.1176% + var(--c) * 114.1176%), calc(14.1176% + var(--r) * 114.1176%));
  transition: transform 110ms ease-out;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  font-size: 9.5cqi;
  line-height: 1;
  color: #0b0d17;
  z-index: 2;
}
.tf-tile[data-digits="3"] { font-size: 7.6cqi; }
.tf-tile[data-digits="4"] { font-size: 6.2cqi; }
.tf-tile[data-digits="5"] { font-size: 5cqi; }
.tf-gone { z-index: 1; }
.tf-new { animation: tf-appear 160ms ease-out both; animation-delay: 30ms; }
.tf-pop { animation: tf-pop 180ms ease-out both; z-index: 3; }
@keyframes tf-appear { from { scale: 0.2; opacity: 0; } to { scale: 1; opacity: 1; } }
@keyframes tf-pop { 0% { scale: 0.7; } 55% { scale: 1.14; } 100% { scale: 1; } }

/* Original Mekoplay palette: cool tones -> violet -> coral -> gold -> volt */
.tf-tile[data-v="2"]    { background: #262d4f; color: #e6e9ff; }
.tf-tile[data-v="4"]    { background: #323b68; color: #f2f4ff; }
.tf-tile[data-v="8"]    { background: #3dd9ff; }
.tf-tile[data-v="16"]   { background: #2fb4ff; }
.tf-tile[data-v="32"]   { background: #7c5cff; color: #fff; }
.tf-tile[data-v="64"]   { background: #a46bff; color: #fff; }
.tf-tile[data-v="128"]  { background: #ff5c7a; color: #fff; box-shadow: 0 0 18px rgba(255, 92, 122, 0.35); }
.tf-tile[data-v="256"]  { background: #ff7a4d; box-shadow: 0 0 20px rgba(255, 122, 77, 0.4); }
.tf-tile[data-v="512"]  { background: #ffb13d; box-shadow: 0 0 22px rgba(255, 177, 61, 0.45); }
.tf-tile[data-v="1024"] { background: #e9ff4d; box-shadow: 0 0 24px rgba(233, 255, 77, 0.5); }
.tf-tile[data-v="2048"] { background: #c6ff3d; box-shadow: 0 0 30px rgba(198, 255, 61, 0.65); }
.tf-tile[data-v="4096"], .tf-tile[data-v="8192"], .tf-tile[data-v="big"] {
  background: #ffffff; box-shadow: 0 0 32px rgba(255, 255, 255, 0.6);
}
.tf-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .tf-tile { transition: none; }
  .tf-new, .tf-pop { animation: none; }
}
