* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #173a24;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  z-index: 0;
  pointer-events: none;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8, 32, 20, 0.6) 0%, rgba(8, 32, 20, 0.18) 24%, rgba(8, 32, 20, 0.18) 52%, rgba(8, 32, 20, 0.72) 100%),
    radial-gradient(120% 72% at 50% 46%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.28) 100%);
}

.game {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding-top: calc(env(safe-area-inset-top) + 8px);
  padding-right: clamp(8px, 2.4vw, 12px);
  padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
  padding-left: clamp(8px, 2.4vw, 12px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.7vh, 9px);
}

/* ---------- 顶部：暂停 + 像素画进度 ---------- */
.top {
  flex: 0 0 auto;
  height: clamp(86px, 12.2vh, 104px);
  display: flex;
  gap: clamp(6px, 1.8vw, 9px);
  align-items: stretch;
}

.pause-btn {
  flex: 0 0 auto;
  width: clamp(42px, 12vw, 52px);
  align-self: center;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2.5px solid #ffc266;
  background: radial-gradient(circle at 35% 28%, #a9713f 0%, #6a3d1e 58%, #46250f 100%);
  color: #ffe9be;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #2f1809, 0 7px 14px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 230, 180, 0.4);
  cursor: pointer;
  padding: 0;
}

.pause-btn .mp-icon {
  width: 42%;
  height: 42%;
}

.pause-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #2f1809, 0 4px 8px rgba(0, 0, 0, 0.35);
}

.art-card {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  border: 2.5px solid #f0a53e;
  background: #2b6f9d;
  box-shadow: 0 5px 0 #72401c, 0 9px 20px rgba(0, 0, 0, 0.35);
}

.art-img-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.art-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
}

.art-tag {
  position: absolute;
  top: 5px;
  left: 7px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(69, 40, 20, 0.66);
  border: 1px solid rgba(255, 210, 135, 0.6);
  color: #fff4de;
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
}

.art-progress {
  flex: 0 0 auto;
  padding: 4px 9px 6px;
  background: linear-gradient(180deg, rgba(66, 39, 20, 0.95), rgba(45, 25, 11, 0.98));
  border-top: 1px solid rgba(255, 198, 112, 0.35);
}

.art-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 3px;
  color: #ffdaa4;
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.art-row b {
  color: #fff6e2;
  font-size: clamp(10px, 2.8vw, 12px);
}

.art-bar {
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 215, 150, 0.35);
}

.art-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffe06a, #ff8a3d);
  box-shadow: 0 0 8px rgba(255, 180, 70, 0.7);
  transition: width 0.35s ease;
}

/* ---------- 老鼠队列 ---------- */
.queue {
  flex: 0 0 auto;
  height: clamp(72px, 10.3vh, 88px);
  display: flex;
  gap: clamp(6px, 1.8vw, 9px);
  min-width: 0;
}

.queue-mouse {
  flex: 0 0 auto;
  width: clamp(92px, 28vw, 118px);
  min-width: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid rgba(255, 206, 125, 0.7);
  background: #2f6b3e;
  box-shadow: 0 4px 0 rgba(30, 15, 6, 0.35), 0 7px 14px rgba(0, 0, 0, 0.25);
}

.queue-mouse img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 38% 52%;
}

.queue-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 2px solid rgba(255, 198, 110, 0.45);
  background: linear-gradient(180deg, rgba(79, 47, 25, 0.94), rgba(51, 29, 14, 0.94));
  box-shadow: 0 4px 0 rgba(28, 14, 5, 0.3), inset 0 1px 0 rgba(255, 235, 200, 0.14);
}

.queue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mice-label {
  color: #ffd9a3;
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.mice-num {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mice-num img {
  width: clamp(20px, 6vw, 26px);
  height: clamp(20px, 6vw, 26px);
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #ffc266;
}

.mice-num b {
  color: #fff;
  font-size: clamp(19px, 5.6vw, 25px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 #77380f, 0 0 8px rgba(255, 176, 76, 0.35);
}

.queue-bottom {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.combo-pill {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 99px;
  background: linear-gradient(180deg, #ffb144, #e96a16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 #a5400f;
  color: #fff6e0;
  font-size: clamp(10px, 2.8vw, 12px);
  font-weight: 900;
  white-space: nowrap;
}

.combo-pill.dim {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  color: #c9a57e;
}

.queue-hint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d9b58a;
  font-size: clamp(9px, 2.5vw, 11px);
}

/* ---------- 主玩法区 ---------- */
.play {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.board {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: url("images/gen/ui_board.png") center / 100% 100% no-repeat;
  box-shadow: 0 6px 0 rgba(37, 19, 7, 0.55), 0 12px 26px rgba(0, 0, 0, 0.35);
}

.board-inner {
  position: absolute;
  inset: 4.2% 4.5%;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 186, 92, 0.13), transparent 55%),
    linear-gradient(180deg, #5b3a22 0%, #4a2c18 48%, #3b2110 100%);
  box-shadow: inset 0 5px 14px rgba(0, 0, 0, 0.6), inset 0 -3px 8px rgba(0, 0, 0, 0.45);
}

.grid {
  position: absolute;
  top: 1.6%;
  right: 1.5%;
  bottom: 1.6%;
  left: 24%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: clamp(3px, 1vw, 5px);
}

/* 黑洞容器（压在木板上，左侧） */
.side {
  position: absolute;
  top: 1.5%;
  bottom: 1.5%;
  left: 0;
  width: 23.5%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  z-index: 3;
  pointer-events: none;
}

.well {
  position: relative;
  width: 100%;
  aspect-ratio: 350 / 400;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(255, 204, 120, 0.75);
  box-shadow: 0 5px 0 rgba(24, 12, 4, 0.55), 0 8px 18px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 138, 61, 0.18);
  background: #274b64;
}

.well-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.well-plate {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 45%;
  height: 34%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 2px solid #f4b04a;
  background: radial-gradient(circle at 50% 28%, #2f5473 0%, #16283a 55%, #0b141f 100%);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.45);
}

.well-plate b {
  display: block;
  color: #fff8e9;
  font-size: clamp(19px, 6vw, 28px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 #82450f, 0 0 8px rgba(255, 183, 83, 0.4);
}

.well-plate span {
  margin-top: 1px;
  color: #ffcf85;
  font-size: clamp(7px, 2vw, 9px);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.well-plate.bump {
  animation: platePulse 0.34s ease;
}

.well-meta {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #ffd9a3;
  font-size: clamp(8px, 2.2vw, 10px);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
}

.well-meta b {
  color: #fff2d8;
}

.mini-bar {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 205, 125, 0.35);
}

.mini-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffd75a, #ff6a24);
  transition: width 0.25s ease;
}

.combo-card {
  margin-top: auto;
  width: 100%;
  padding: 6px 2px 5px;
  border-radius: 13px;
  border: 2px solid #ffe0a3;
  background: linear-gradient(180deg, #ffb13f 0%, #f47a20 62%, #e05d10 100%);
  box-shadow: 0 4px 0 #a33c08, 0 7px 14px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  color: #5b2a08;
  text-align: center;
  transform: rotate(-2deg);
}

.combo-card span {
  display: block;
  color: #6b3109;
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 800;
  line-height: 1.1;
}

.combo-card b {
  display: block;
  color: #fff;
  font-size: clamp(19px, 5.6vw, 27px);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 2px 0 #a6420c, 0 0 8px rgba(255, 255, 255, 0.45);
}

.combo-card.bump {
  animation: comboBump 0.32s ease;
}

.combo-pill.bump {
  animation: pillBump 0.32s ease;
}

.btn[hidden] {
  display: none;
}

/* ---------- 数字方块 ---------- */
.tile {
  --edge: #7a3b10;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: clamp(9px, 2.6vw, 13px);
  background: linear-gradient(180deg, #e8d2ae, #b98a54);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.42),
    inset 0 -4px 0 rgba(0, 0, 0, 0.16),
    0 3px 0 var(--edge),
    0 5px 8px rgba(0, 0, 0, 0.28);
  color: #fff9e9;
  font-family: inherit;
  font-size: clamp(18px, 5.3vw, 27px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.24);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.12s ease, opacity 0.14s ease;
  -webkit-appearance: none;
  appearance: none;
}

.tile::after {
  content: "";
  position: absolute;
  top: 7%;
  left: 11%;
  right: 11%;
  height: 20%;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.tile:active {
  transform: translateY(2px) scale(0.96);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -3px 0 rgba(0, 0, 0, 0.16),
    0 1px 0 var(--edge),
    0 3px 5px rgba(0, 0, 0, 0.28);
}

.tile.two {
  font-size: clamp(15px, 4.4vw, 23px);
  letter-spacing: -0.02em;
}

.tile.used {
  transform: scale(0.25);
  opacity: 0;
}

.tile.shake {
  animation: tileShake 0.32s ease;
}

.tile.v1 {
  background: linear-gradient(180deg, #ffe37a 0%, #ffc93c 50%, #eaa812 100%);
  --edge: #a96b05;
}

.tile.v2 {
  background: linear-gradient(180deg, #ff978b 0%, #f4554c 52%, #d03535 100%);
  --edge: #941f1f;
}

.tile.v4 {
  background: linear-gradient(180deg, #93d0ff 0%, #4ba4f5 52%, #1f72c9 100%);
  --edge: #124e93;
}

.tile.v8 {
  background: linear-gradient(180deg, #a3e584 0%, #64c74c 52%, #319d2d 100%);
  --edge: #1d6d1c;
}

.tile.v16 {
  background: linear-gradient(180deg, #d8aaff 0%, #af64f5 52%, #7c32c8 100%);
  --edge: #521e8f;
}

/* ---------- 底部候选托盘 ---------- */
.tray {
  position: relative;
  flex: 0 0 auto;
  height: clamp(112px, 16.5vh, 140px);
  border-radius: 16px;
  background: url("images/gen/ui_tray.png") center / 100% 100% no-repeat;
  filter: drop-shadow(0 6px 0 rgba(34, 17, 5, 0.35)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.3));
}

.tray-inner {
  position: absolute;
  top: 20%;
  right: 4.5%;
  bottom: 12%;
  left: 4.5%;
  display: flex;
  align-items: stretch;
  gap: clamp(5px, 1.8vw, 9px);
  padding: 6px clamp(6px, 1.8vw, 9px);
  border-radius: 10px;
  background: linear-gradient(180deg, #5b3a22 0%, #4a2c18 55%, #3a2110 100%);
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.55), inset 0 -2px 6px rgba(0, 0, 0, 0.4);
}

.candidates {
  display: flex;
  align-items: stretch;
  gap: clamp(5px, 1.8vw, 9px);
  width: 100%;
  min-width: 0;
}

.candidates .tile {
  flex: 1 1 0;
  height: 100%;
  border-radius: clamp(10px, 2.8vw, 14px);
  font-size: clamp(21px, 6.6vw, 33px);
}

.candidates .tile.two {
  font-size: clamp(18px, 5.6vw, 28px);
}

/* ---------- 底部计分栏 ---------- */
.bottom {
  flex: 0 0 auto;
  height: clamp(40px, 5.7vh, 48px);
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 9px);
}

.score,
.steps {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  padding: 0 clamp(9px, 2.8vw, 13px);
  border-radius: 99px;
  border: 2px solid rgba(255, 209, 133, 0.7);
  background: linear-gradient(180deg, #6f4423 0%, #4a2a13 100%);
  box-shadow: 0 3px 0 rgba(27, 13, 4, 0.5), 0 5px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 231, 185, 0.25);
  white-space: nowrap;
}

.score .mp-icon {
  width: clamp(17px, 5vw, 22px);
  height: clamp(17px, 5vw, 22px);
  color: #ffd34d;
  filter: drop-shadow(0 1px 0 #8a4a08);
}

.score b {
  color: #fff8e6;
  font-size: clamp(15px, 4.4vw, 19px);
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.steps span {
  color: #ffd9a3;
  font-size: clamp(9px, 2.6vw, 11px);
  font-weight: 700;
}

.steps b {
  color: #fff;
  font-size: clamp(15px, 4.4vw, 19px);
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.steps.low {
  border-color: #ff8a6a;
  background: linear-gradient(180deg, #b24022, #7e1f10);
  animation: lowPulse 1.1s ease-in-out infinite;
}

.hint {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffe9c4;
  font-size: clamp(9px, 2.7vw, 11px);
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* ---------- 结算 / 暂停 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 25, 16, 0.74);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.overlay[hidden] {
  display: none;
}

.overlay-card {
  width: min(340px, 100%);
  padding: 14px;
  border-radius: 22px;
  border: 3px solid #f2a542;
  background: linear-gradient(180deg, #fff5de 0%, #f7ddb0 100%);
  box-shadow: 0 10px 0 rgba(60, 30, 10, 0.45), 0 22px 44px rgba(0, 0, 0, 0.45);
  color: #4a2a12;
  text-align: center;
}

.overlay-art {
  display: block;
  width: 100%;
  height: 106px;
  object-fit: cover;
  object-position: center 42%;
  border-radius: 14px;
  border: 2px solid #d68a32;
  margin-bottom: 10px;
}

.overlay-card h2 {
  margin: 0 0 4px;
  color: #5a2f10;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 #fff3d8;
}

.overlay-card p {
  margin: 0;
  color: #8a5a30;
  font-size: 13px;
  line-height: 1.55;
}

.overlay-score {
  margin: 10px 0 12px;
  color: #b4520f;
  font-size: 15px;
  font-weight: 900;
}

.overlay-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  padding: 0 14px;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(180deg, #ffab43 0%, #f2761c 60%, #df5b10 100%);
  box-shadow: 0 4px 0 #9e3b08, inset 0 2px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.btn.primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #9e3b08, inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

.btn.ghost {
  color: #8a5528;
  background: #f3dfbd;
  border: 2px solid #d8b077;
  box-shadow: 0 2px 0 #c29a60;
}

.btn.ghost:active {
  transform: translateY(1px);
}

/* ---------- 动态飞行 / 提示 ---------- */
.fly-tile {
  position: fixed;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff9e9;
  font-weight: 900;
  pointer-events: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), inset 0 -4px 0 rgba(0, 0, 0, 0.16);
}

.fly-mouse {
  position: fixed;
  z-index: 69;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #ffd28a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.score-pop {
  position: fixed;
  z-index: 72;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 2px 0 #a6420c, 0 0 12px rgba(255, 190, 80, 0.8);
  pointer-events: none;
  white-space: nowrap;
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  padding: 8px 18px;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 171, 67, 0.97), rgba(226, 90, 15, 0.97));
  border: 2px solid #ffe3a8;
  box-shadow: 0 6px 0 rgba(120, 45, 5, 0.5), 0 12px 26px rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(110, 40, 0, 0.35);
  pointer-events: none;
}

.toast span {
  display: block;
  margin-top: 1px;
  color: #fff0cf;
  font-size: 11px;
  font-weight: 700;
}

@keyframes pillBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes comboBump {
  0% { transform: rotate(-2deg) scale(1); }
  45% { transform: rotate(2deg) scale(1.14); }
  100% { transform: rotate(-2deg) scale(1); }
}

@keyframes platePulse {
  0% { transform: scale(1); box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.45); }
  45% { transform: scale(1.09); box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 0 18px rgba(255, 174, 63, 0.9); }
  100% { transform: scale(1); }
}

@keyframes tileShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-3deg); }
  40% { transform: translateX(4px) rotate(3deg); }
  60% { transform: translateX(-3px) rotate(-2deg); }
  80% { transform: translateX(3px) rotate(2deg); }
}

@keyframes lowPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.22); }
}

@media (max-height: 680px) {
  .game { gap: 5px; }
  .top { height: 82px; }
  .queue { height: 68px; }
  .tray { height: 106px; }
  .bottom { height: 38px; }
}

@media (max-width: 340px) {
  .side { width: 25%; }
  .grid { left: 25.5%; }
  .tile { font-size: 17px; }
  .tile.two { font-size: 14px; }
  .candidates .tile { font-size: 20px; }
  .candidates .tile.two { font-size: 17px; }
}
