/* ── 俄罗斯方块2 · 赛博霓虹 ─────────────────────────────────────────
   竖屏移动优先。整屏是一台悬浮在霓虹城市里的街机：
   左侧 HOLD + SCORE / LEVEL / LINES，中间是发光棋盘，右侧是 NEXT 队列，
   底部是斜切霓虹操作台。所有发光、描边、网格均由 CSS / Canvas 绘制。 */

:root {
  --orange: #ff8a3d;
  --orange-hot: #ffc48a;
  --cyan: #35e7ff;
  --cyan-soft: #9ef4ff;
  --magenta: #c95cff;
  --pink: #ff4d9d;
  --ink: #05030f;
  --panel-top: rgba(25, 17, 58, 0.94);
  --panel-bottom: rgba(6, 4, 18, 0.97);
  --line: rgba(126, 92, 210, 0.34);
  --label: #b8b0dd;
  --muted: #6d6698;
  --rail-w: clamp(58px, 17vw, 74px);
  --arena-gap: clamp(5px, 1.6vw, 8px);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: #eef8ff;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  overscroll-behavior: none;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── 霓虹城市背景 ─────────────────────────────────────────────── */
.bg-city {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("images/gen/city-bg.jpg") center / cover no-repeat;
  opacity: 0.92;
  filter: saturate(1.1) brightness(0.96);
}

.bg-city::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(44% 36% at 50% 48%, rgba(4, 2, 12, 0.5) 0%, rgba(4, 2, 12, 0.16) 62%, transparent 100%),
    linear-gradient(180deg, rgba(4, 2, 12, 0.56) 0%, rgba(4, 2, 12, 0.04) 24%, rgba(4, 2, 12, 0.02) 68%, rgba(4, 2, 12, 0.76) 100%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(34% 22% at 8% 20%, rgba(201, 92, 255, 0.22), transparent 72%),
    radial-gradient(36% 24% at 94% 30%, rgba(53, 231, 255, 0.18), transparent 72%),
    radial-gradient(52% 30% at 50% 104%, rgba(255, 138, 61, 0.2), transparent 72%);
  mix-blend-mode: screen;
}

.bg-floor {
  position: fixed;
  left: -30%;
  right: -30%;
  bottom: -13%;
  height: 44%;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(53, 231, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 92, 255, 0.11) 1px, transparent 1px);
  background-size: 38px 38px;
  transform: perspective(300px) rotateX(62deg);
  transform-origin: center bottom;
  opacity: 0.52;
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.5) 40%, transparent 100%);
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.5) 40%, transparent 100%);
}

.bg-scan {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.026) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
  opacity: 0.55;
}

/* ── 页面骨架 ─────────────────────────────────────────────────── */
.app {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 6px) 12px calc(var(--safe-bottom) + 8px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── 中央舞台 ─────────────────────────────────────────────────── */
.arena {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--arena-gap);
}

.rail {
  flex: 0 0 var(--rail-w);
  width: var(--rail-w);
  height: var(--board-h, auto);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rail-left { justify-content: stretch; }
.rail-right { justify-content: stretch; }

/* ── 霓虹面板 ─────────────────────────────────────────────────── */
.panel {
  position: relative;
  min-height: 0;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  border-radius: 11px;
  border: 1px solid transparent;
  background:
    linear-gradient(158deg, var(--panel-top) 0%, rgba(13, 8, 32, 0.95) 52%, var(--panel-bottom) 100%) padding-box,
    linear-gradient(140deg, rgba(53, 231, 255, 0.55) 0%, rgba(201, 92, 255, 0.42) 48%, rgba(255, 138, 61, 0.6) 100%) border-box;
  box-shadow:
    inset 0 0 20px rgba(84, 44, 180, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 14px rgba(53, 231, 255, 0.06),
    0 7px 18px rgba(0, 0, 0, 0.38);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 190, 130, 0.8), transparent);
  box-shadow: 0 0 8px rgba(255, 138, 61, 0.6);
  pointer-events: none;
}

.panel::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-right: 1px solid rgba(53, 231, 255, 0.65);
  border-bottom: 1px solid rgba(53, 231, 255, 0.65);
  pointer-events: none;
}

/* 左侧四个模块按棋盘高度分配 */
.hold-panel { flex: 1.35 1 0; }
.score-panel { flex: 2.2 1 0; }
.level-panel { flex: 1.2 1 0; }
.lines-panel { flex: 1.2 1 0; }

.p-label {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 10px;
  line-height: 1.1;
  letter-spacing: 0.1em;
  color: var(--label);
  text-align: center;
  white-space: nowrap;
}

.p-label em {
  font-style: normal;
  font-size: 6.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.p-value {
  min-width: 0;
  margin-top: auto;
  margin-bottom: auto;
  text-align: center;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.value-orange {
  font-size: clamp(18px, 5.4vw, 26px);
  color: #ffd9b8;
  text-shadow: 0 0 7px rgba(255, 138, 61, 0.95), 0 0 20px rgba(255, 92, 30, 0.6);
}

.value-cyan {
  font-size: clamp(19px, 5.4vw, 26px);
  color: #cdfbff;
  text-shadow: 0 0 7px rgba(53, 231, 255, 0.95), 0 0 18px rgba(37, 170, 255, 0.55);
}

.value-magenta {
  font-size: clamp(19px, 5.4vw, 26px);
  color: #f4d6ff;
  text-shadow: 0 0 7px rgba(201, 92, 255, 0.95), 0 0 18px rgba(176, 40, 255, 0.6);
}

#score.s1 { font-size: clamp(14px, 4.3vw, 20px); }
#score.s2 { font-size: clamp(12px, 3.7vw, 17px); }
#score.s3 { font-size: clamp(10px, 3.1vw, 14px); }
#score.s4 { font-size: clamp(9px, 2.7vw, 12px); }

/* 保留方块 */
.hold-panel {
  align-items: stretch;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.hold-panel canvas {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin: 3px 0;
  display: block;
}

.hold-hint {
  flex: 0 0 auto;
  display: block;
  font-size: 6.5px;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--muted);
  white-space: nowrap;
}

.hold-panel.is-locked .hold-hint { color: rgba(255, 138, 61, 0.72); }

.hold-panel:active,
.hold-panel.is-down {
  transform: scale(0.96);
  filter: brightness(1.15);
  box-shadow: inset 0 0 20px rgba(255, 138, 61, 0.28), 0 0 20px rgba(255, 138, 61, 0.34);
}

/* 下一个方块 */
.next-panel { flex: 1 1 auto; }

.next-slots {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.next-slots canvas {
  flex: 1 1 0;
  width: 100%;
  min-height: 0;
  display: block;
}

/* ── 棋盘外框 ─────────────────────────────────────────────────── */
.board-shell {
  position: relative;
  flex: 0 0 auto;
  width: 234px;
  height: 468px;
  padding: 4px;
  border-radius: 14px;
  background:
    linear-gradient(150deg, #ffbf7e 0%, #ff6a1f 15%, #a33cff 40%, #25e8ff 70%, #ff4d9d 100%);
  box-shadow:
    0 0 3px rgba(255, 255, 255, 0.55),
    0 0 20px rgba(255, 138, 61, 0.45),
    0 0 52px rgba(126, 44, 255, 0.48),
    0 0 94px rgba(37, 232, 255, 0.2),
    0 18px 42px rgba(0, 0, 0, 0.62);
  animation: frame-pulse 4.5s ease-in-out infinite;
}

.board-shell.shake {
  animation: board-shake 160ms ease-out, frame-pulse 4.5s ease-in-out infinite;
}

.board-shell::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 4;
  border-radius: 11px;
  border: 1px solid rgba(205, 244, 255, 0.28);
  box-shadow: inset 0 0 12px rgba(53, 231, 255, 0.12);
  pointer-events: none;
}

.board-shell::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 22%;
  right: 22%;
  z-index: 5;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d5fbff, transparent);
  box-shadow: 0 0 8px rgba(53, 231, 255, 0.9);
  opacity: 0.85;
  pointer-events: none;
}

#board {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  background: #070917;
  touch-action: none;
  cursor: pointer;
}

.board-scan {
  position: absolute;
  inset: 4px;
  z-index: 2;
  border-radius: 10px;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, rgba(255, 138, 61, 0.06), transparent 18%, transparent 82%, rgba(53, 231, 255, 0.06));
  mix-blend-mode: screen;
  opacity: 0.38;
}

.board-vignette {
  position: absolute;
  inset: 4px;
  z-index: 3;
  border-radius: 10px;
  pointer-events: none;
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.92), inset 0 0 3px rgba(53, 231, 255, 0.6);
}

/* 消行 / 升级弹字 */
.combo-flash {
  position: absolute;
  inset: 4px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  font-size: clamp(22px, 7.4vw, 34px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.04em;
  color: #fff;
  text-align: center;
  text-shadow:
    0 0 8px rgba(53, 231, 255, 1),
    0 0 22px rgba(201, 92, 255, 0.9),
    0 0 42px rgba(255, 138, 61, 0.55);
  opacity: 0;
  transform: scale(0.7);
}

.combo-flash.show { animation: combo-pop 0.82s cubic-bezier(0.18, 0.9, 0.24, 1) forwards; }

/* ── 底部操作台 ───────────────────────────────────────────────── */
.controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 8px);
  padding: 7px clamp(6px, 2vw, 10px);
  border-radius: 18px;
  border: 1px solid rgba(126, 92, 210, 0.4);
  background:
    linear-gradient(180deg, rgba(33, 23, 72, 0.92), rgba(7, 4, 20, 0.96)),
    rgba(11, 8, 30, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 0 24px rgba(97, 53, 205, 0.2),
    0 10px 28px rgba(0, 0, 0, 0.44),
    0 0 20px rgba(53, 231, 255, 0.06);
}

.ctrl {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: clamp(48px, 7.2vh, 62px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 0;
  clip-path: polygon(16% 0, 84% 0, 100% 18%, 100% 82%, 84% 100%, 16% 100%, 0 82%, 0 18%);
  background: linear-gradient(180deg, rgba(53, 231, 255, 0.78), rgba(53, 231, 255, 0.18));
  filter: drop-shadow(0 0 6px rgba(53, 231, 255, 0.26));
  color: #8ef4ff;
  transition: transform 0.1s ease, filter 0.1s ease, background 0.1s ease;
}

.ctrl::before {
  content: "";
  position: absolute;
  inset: 1.5px;
  z-index: 0;
  clip-path: polygon(16% 0, 84% 0, 100% 18%, 100% 82%, 84% 100%, 16% 100%, 0 82%, 0 18%);
  background:
    linear-gradient(180deg, rgba(37, 232, 255, 0.16), rgba(17, 12, 40, 0.82) 56%, rgba(7, 5, 18, 0.94));
}

.ctrl .mp-icon {
  position: relative;
  z-index: 1;
  width: 25px;
  height: 25px;
  filter: drop-shadow(0 0 5px currentColor);
}

.ctrl span {
  position: relative;
  z-index: 1;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: rgba(203, 240, 255, 0.74);
  white-space: nowrap;
}

.ctrl-magenta {
  background: linear-gradient(180deg, rgba(201, 92, 255, 0.8), rgba(201, 92, 255, 0.18));
  filter: drop-shadow(0 0 6px rgba(201, 92, 255, 0.3));
  color: #e2a2ff;
}

.ctrl-magenta::before {
  background: linear-gradient(180deg, rgba(201, 92, 255, 0.15), rgba(17, 12, 40, 0.82) 56%, rgba(7, 5, 18, 0.94));
}

.ctrl:active,
.ctrl.is-down {
  transform: translateY(1px) scale(0.94);
  filter: drop-shadow(0 0 12px rgba(53, 231, 255, 0.62)) brightness(1.2);
}

.ctrl-magenta:active,
.ctrl-magenta.is-down {
  filter: drop-shadow(0 0 12px rgba(201, 92, 255, 0.68)) brightness(1.2);
}

/* 旋转键：圆形霓虹核心 */
.ctrl-rotate {
  flex: 1.2 1 0;
  height: clamp(54px, 8vh, 70px);
  align-self: center;
  clip-path: none;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 180, 106, 0.9);
  background: linear-gradient(155deg, #ffc38a 0%, #ff7a2c 38%, #c12dff 100%);
  filter: drop-shadow(0 0 10px rgba(255, 138, 61, 0.5));
  color: #ffcf9f;
  box-shadow: none;
}

.ctrl-rotate::before {
  inset: 2px;
  border-radius: 50%;
  clip-path: none;
  background: radial-gradient(circle at 50% 36%, rgba(255, 180, 100, 0.3), rgba(255, 93, 22, 0.12) 42%, rgba(12, 6, 26, 0.95) 76%);
}

.ctrl-rotate .mp-icon { width: 29px; height: 29px; }
.ctrl-rotate span { color: rgba(255, 220, 188, 0.86); }

.ctrl-rotate:active,
.ctrl-rotate.is-down {
  transform: translateY(1px) scale(0.95);
  filter: drop-shadow(0 0 16px rgba(255, 138, 61, 0.8)) brightness(1.15);
}

/* ── 操作提示 ─────────────────────────────────────────────────── */
.hint-line {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 10px;
  font-size: 8px;
  letter-spacing: 0.07em;
  color: rgba(150, 142, 190, 0.72);
  white-space: nowrap;
}

.hint-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: rgba(53, 231, 255, 0.7);
  box-shadow: 0 0 4px rgba(53, 231, 255, 0.8);
}

/* ── 结束覆盖层 ───────────────────────────────────────────────── */
.over {
  position: absolute;
  inset: 4px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 10px;
  background: rgba(4, 3, 14, 0.86);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.over.show { opacity: 1; visibility: visible; }

.over-card {
  position: relative;
  width: 100%;
  text-align: center;
  padding: 15px 9px;
  border-radius: 12px;
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(48, 20, 52, 0.9), rgba(8, 6, 24, 0.96)) padding-box,
    linear-gradient(150deg, rgba(255, 138, 61, 0.9), rgba(201, 92, 255, 0.7), rgba(53, 231, 255, 0.8)) border-box;
  box-shadow: inset 0 0 26px rgba(255, 138, 61, 0.12), 0 0 30px rgba(201, 92, 255, 0.28);
  overflow: hidden;
}

.over-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px);
  pointer-events: none;
}

.over-kicker {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--pink);
  text-shadow: 0 0 8px rgba(255, 77, 157, 0.9);
}

.over h2 {
  margin: 5px 0 10px;
  font-size: clamp(21px, 6.4vw, 29px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.03em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 138, 61, 1), 0 0 26px rgba(255, 92, 30, 0.7);
}

.over-score-label {
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--label);
}

.over-score {
  margin: 3px 0 12px;
  font-size: clamp(21px, 6vw, 30px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #ffe0bd;
  text-shadow: 0 0 8px rgba(255, 138, 61, 0.9);
}

.restart-btn {
  position: relative;
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 9px;
  border: 1px solid rgba(255, 180, 106, 0.85);
  background: linear-gradient(180deg, rgba(255, 172, 100, 0.98), rgba(255, 92, 22, 0.98));
  color: #2a0d02;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 0 18px rgba(255, 138, 61, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.restart-btn .mp-icon { width: 18px; height: 18px; }
.restart-btn:active { transform: scale(0.97); filter: brightness(1.08); }

/* ── 动效 ─────────────────────────────────────────────────────── */
.p-value.bump,
.hold-panel.bump { animation: value-pop 0.22s ease-out; }

@keyframes value-pop {
  0% { transform: scale(1); }
  38% { transform: scale(1.16); filter: brightness(1.25); }
  100% { transform: scale(1); }
}

@keyframes combo-pop {
  0% { opacity: 0; transform: scale(0.6) rotate(-3deg); }
  16% { opacity: 1; transform: scale(1.08) rotate(1deg); }
  62% { opacity: 1; transform: scale(1) rotate(0); }
  100% { opacity: 0; transform: scale(1.14) rotate(0); }
}

@keyframes frame-pulse {
  0%, 100% {
    box-shadow:
      0 0 3px rgba(255, 255, 255, 0.55),
      0 0 20px rgba(255, 138, 61, 0.44),
      0 0 52px rgba(126, 44, 255, 0.46),
      0 0 94px rgba(37, 232, 255, 0.18),
      0 18px 42px rgba(0, 0, 0, 0.62);
  }
  50% {
    box-shadow:
      0 0 4px rgba(255, 255, 255, 0.65),
      0 0 26px rgba(255, 138, 61, 0.58),
      0 0 62px rgba(126, 44, 255, 0.58),
      0 0 110px rgba(37, 232, 255, 0.26),
      0 18px 42px rgba(0, 0, 0, 0.62);
  }
}

@keyframes board-shake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-2px, 1px); }
  40% { transform: translate(2px, -1px); }
  60% { transform: translate(-1px, 1px); }
  80% { transform: translate(1px, 0); }
  100% { transform: translate(0, 0); }
}

/* ── 屏幕适配 ─────────────────────────────────────────────────── */
@media (min-width: 430px) {
  :root { --arena-gap: 8px; }
  .app { padding-left: 14px; padding-right: 14px; }
  .panel { padding: 8px 7px; border-radius: 12px; }
  .p-label { font-size: 11px; }
  .p-label em { font-size: 7px; }
  .hold-hint { font-size: 7.5px; }
  .rail { gap: 8px; }
  .hint-line { font-size: 9px; }
}

@media (max-height: 740px) {
  .app { gap: 6px; padding-top: calc(var(--safe-top) + 5px); }
  .hint-line { display: none; }
  .ctrl { height: clamp(44px, 7.4vh, 54px); }
  .ctrl-rotate { height: clamp(50px, 8.4vh, 60px); }
  .controls { padding: 6px clamp(5px, 1.8vw, 9px); }
  .rail { gap: 6px; }
}

@media (max-height: 620px) {
  .panel { padding: 5px 4px; }
  .p-label { font-size: 9px; }
  .p-label em { font-size: 6px; }
  .hold-hint { display: none; }
  .ctrl { height: 42px; }
  .ctrl-rotate { height: 48px; }
  .ctrl .mp-icon { width: 21px; height: 21px; }
  .ctrl-rotate .mp-icon { width: 24px; height: 24px; }
  .ctrl span { font-size: 8px; }
  .rail { gap: 5px; }
}

@media (max-width: 359px) {
  .app { padding-left: 9px; padding-right: 9px; }
  .panel { padding: 6px 4px; }
  .p-label { font-size: 9px; letter-spacing: 0.05em; }
  .p-label em { font-size: 6px; }
  .hold-hint { font-size: 6px; }
  .controls { gap: 4px; padding: 6px 5px; }
  .ctrl { height: 46px; }
  .ctrl-rotate { height: 52px; }
  .ctrl .mp-icon { width: 22px; height: 22px; }
  .ctrl-rotate .mp-icon { width: 25px; height: 25px; }
  .ctrl span { font-size: 8px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .app { padding-top: 4px; padding-bottom: 4px; gap: 4px; }
  .hint-line { display: none; }
  .rail { gap: 4px; }
  .panel { padding: 4px; border-radius: 8px; }
  .p-label em { display: none; }
  .hold-hint { display: none; }
  .ctrl { height: 38px; }
  .ctrl-rotate { height: 42px; }
  .ctrl .mp-icon { width: 19px; height: 19px; }
  .ctrl-rotate .mp-icon { width: 21px; height: 21px; }
  .ctrl span { display: none; }
  .controls { padding: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .board-shell, .board-shell.shake, .combo-flash.show { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}
