@font-face {
  font-family: 'Orbitron';
  src: url('assets/fonts/orbitron-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Orbitron';
  src: url('assets/fonts/orbitron-900.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('assets/fonts/rajdhani-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('assets/fonts/rajdhani-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('assets/fonts/rajdhani-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #04030b;
  --cyan: #22e4ff;
  --pink: #ff2bd6;
  --violet: #7d5cff;
  --gold: #ffe23f;
  --ink: #f3f4ff;
  --muted: #8f8fbe;
  --display: 'Orbitron', 'Microsoft YaHei', sans-serif;
  --ui: 'Rajdhani', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
canvas { display: block; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.bg-veil {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 48%, transparent 18%, rgba(3, 2, 10, 0.14) 58%, rgba(2, 2, 8, 0.72) 100%),
    linear-gradient(180deg, rgba(2, 2, 8, 0.36), transparent 18%, transparent 80%, rgba(2, 2, 8, 0.55));
}
.flash {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: #eafcff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---------------------------------- top bar --------------------------------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: 92px;
  padding: 22px clamp(16px, 3vw, 38px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-cube {
  width: 32px;
  height: 36px;
  filter: drop-shadow(0 0 12px rgba(89, 215, 255, 0.35));
}
.brand-name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.2em;
  color: #f4f7ff;
  line-height: 1;
  text-shadow: 0 0 18px rgba(90, 230, 255, 0.22);
}
.brand-name span { color: var(--cyan); }
.brand-sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: rgba(180, 180, 220, 0.55);
  margin-top: 5px;
  white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: rgba(220, 224, 255, 0.82);
  background: linear-gradient(150deg, rgba(28, 24, 64, 0.62), rgba(8, 7, 22, 0.5));
  border: 1px solid rgba(133, 118, 255, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: 0.22s ease;
}
.icon-btn:hover {
  color: #fff;
  border-color: rgba(80, 230, 255, 0.6);
  box-shadow: 0 0 22px rgba(34, 228, 255, 0.2), 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
.icon-btn svg { width: 21px; height: 21px; }
.help-glyph {
  font-family: var(--display);
  font-weight: 900;
  font-size: 17px;
  color: var(--cyan);
}
.ink-glyph {
  font-family: var(--ui);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0;
  color: var(--cyan);
}
.ico-off { display: none; }
body.is-muted .ico-on { display: none; }
body.is-muted .ico-off { display: block; color: #73739e; }
body.is-muted #btn-sound { opacity: 0.66; }

/* ----------------------------------- HUD ----------------------------------- */
.hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(176px, 228px) 1fr minmax(176px, 228px);
  align-items: center;
  gap: clamp(20px, 3vw, 64px);
  padding: 100px clamp(16px, 2.4vw, 34px) 30px;
  pointer-events: none;
  transition: opacity 0.35s ease, filter 0.35s ease;
}
body[data-mode='title'] .hud,
body[data-mode='loading'] .hud {
  opacity: 0;
  visibility: hidden;
}
body[data-mode='paused'] .hud,
body[data-mode='over'] .hud { opacity: 0.25; filter: blur(3px); }
.rail { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 228px; }
.rail-left { grid-column: 1; justify-self: start; }
.rail-right { grid-column: 3; justify-self: end; }

.panel {
  position: relative;
  padding: 15px 17px;
  border-radius: 15px;
  background:
    linear-gradient(155deg, rgba(27, 23, 61, 0.74), rgba(8, 7, 21, 0.63));
  border: 1px solid rgba(131, 113, 255, 0.17);
  box-shadow:
    0 14px 44px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.055);
  overflow: hidden;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14%;
  width: 55%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(166, 236, 255, 0.7), transparent);
  opacity: 0.6;
}
.panel-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.27em;
  color: rgba(180, 181, 226, 0.62);
}
.panel-kicker i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(120, 110, 220, 0.28), transparent);
}
.panel-label {
  font-family: var(--display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: rgba(186, 187, 232, 0.68);
}
.score-value {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(31px, 3vw, 42px);
  line-height: 1;
  letter-spacing: 0.01em;
  margin: 14px 0 11px;
  color: #fbffff;
  text-shadow: 0 0 24px rgba(86, 231, 255, 0.38), 0 0 60px rgba(90, 110, 255, 0.2);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.score-value.bump { animation: scoreBump 0.28s ease; }
.best-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(130, 120, 220, 0.12);
  font-family: var(--display);
  font-size: 7.5px;
  letter-spacing: 0.17em;
  color: rgba(160, 160, 200, 0.48);
}
.best-row b {
  font-size: 12px;
  color: rgba(220, 222, 255, 0.85);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.stats-panel { padding-top: 14px; padding-bottom: 15px; }
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-family: var(--display);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.17em;
  color: rgba(166, 166, 212, 0.7);
}
.stat-row b {
  font-size: 17px;
  letter-spacing: 0.04em;
  color: #f2f6ff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(90, 210, 255, 0.25);
}
.level-track {
  height: 3px;
  margin: 3px 0 6px;
  border-radius: 99px;
  background: rgba(120, 110, 200, 0.15);
  overflow: hidden;
}
.level-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 55%, var(--pink));
  box-shadow: 0 0 10px rgba(34, 228, 255, 0.5);
  transition: width 0.35s ease;
}
.combo-panel { padding-top: 12px; padding-bottom: 12px; transition: border-color 0.3s, box-shadow 0.3s; }
.combo-panel.active {
  border-color: rgba(255, 60, 210, 0.4);
  box-shadow: 0 0 30px rgba(255, 43, 214, 0.13), 0 14px 44px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.combo-head { display: flex; justify-content: space-between; align-items: center; }
.combo-head span {
  font-family: var(--display);
  font-size: 8.5px;
  letter-spacing: 0.24em;
  color: rgba(180, 180, 220, 0.55);
}
.b2b-chip {
  font-family: var(--display);
  font-style: normal;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(150, 150, 200, 0.28);
  border: 1px solid rgba(150, 150, 200, 0.14);
  padding: 2px 5px;
  border-radius: 4px;
  transition: 0.25s;
}
.b2b-chip.active {
  color: #ffe56b;
  border-color: rgba(255, 222, 70, 0.5);
  background: rgba(255, 222, 70, 0.08);
  box-shadow: 0 0 12px rgba(255, 222, 70, 0.15);
}
.combo-panel > b {
  display: block;
  font-family: var(--display);
  font-weight: 900;
  font-size: 25px;
  line-height: 1;
  margin: 9px 0 5px;
  color: rgba(210, 212, 248, 0.45);
  font-variant-numeric: tabular-nums;
}
.combo-panel.active > b { color: var(--pink); text-shadow: 0 0 20px rgba(255, 43, 214, 0.55); }
.combo-hint { font-size: 10px; letter-spacing: 0.04em; color: rgba(155, 155, 195, 0.4); }

.mini-panel { padding: 12px 13px 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel-head kbd, .next-count {
  font-family: var(--display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(160, 165, 210, 0.55);
  border: 1px solid rgba(130, 120, 220, 0.18);
  border-radius: 4px;
  padding: 2px 5px;
}
.preview-canvas { width: 100%; display: block; }
.hold-panel { position: relative; }
.hold-canvas { height: 102px; margin-top: 3px; }
.hold-empty {
  position: absolute;
  left: 0;
  right: 0;
  top: 56%;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: rgba(155, 155, 200, 0.38);
  transition: opacity 0.2s;
  pointer-events: none;
}
.hold-panel.has-piece .hold-empty { opacity: 0; }
.next-panel { padding-bottom: 4px; }
.next-canvas { height: 218px; margin-top: 1px; }

.help-panel { padding: 13px 15px; }
.key-grid {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 5px 6px;
  align-items: center;
  margin-top: 9px;
  font-size: 10.5px;
  color: rgba(178, 180, 218, 0.65);
}
.key-grid span { letter-spacing: 0.05em; }
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 5px;
  border-radius: 4px;
  border: 1px solid rgba(145, 135, 255, 0.24);
  background: rgba(120, 110, 230, 0.08);
  font-family: var(--display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #c7c8ee;
  white-space: nowrap;
}
.help-foot {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(130, 120, 220, 0.1);
  font-size: 9px;
  letter-spacing: 0.05em;
  color: rgba(150, 150, 195, 0.4);
}

/* --------------------------------- mobile HUD ------------------------------- */
.mobile-hud {
  display: none;
  position: fixed;
  z-index: 25;
  top: calc(68px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  height: 62px;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.m-stat {
  min-width: 60px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(28, 24, 62, 0.72), rgba(7, 6, 20, 0.58));
  border: 1px solid rgba(135, 118, 255, 0.18);
}
.m-stat span {
  display: block;
  font-family: var(--display);
  font-size: 6.5px;
  letter-spacing: 0.18em;
  color: rgba(170, 170, 215, 0.55);
  margin-bottom: 3px;
}
.m-stat b {
  display: block;
  font-family: var(--display);
  font-size: 13px;
  color: #f3f7ff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.m-hold {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 44px;
  height: 62px;
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(28, 24, 62, 0.72), rgba(7, 6, 20, 0.58));
  border: 1px solid rgba(135, 118, 255, 0.18);
}
.m-hold span {
  font-family: var(--display);
  font-size: 6.5px;
  letter-spacing: 0.16em;
  color: rgba(170, 170, 215, 0.55);
}
.m-hold b {
  font-family: var(--display);
  font-size: 14px;
  line-height: 1;
  color: rgba(200, 205, 240, 0.5);
}
.m-next {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 62px;
  padding: 3px 4px 3px 9px;
  border-radius: 10px;
  background: linear-gradient(150deg, rgba(28, 24, 62, 0.72), rgba(7, 6, 20, 0.58));
  border: 1px solid rgba(135, 118, 255, 0.18);
}
.m-next span {
  font-family: var(--display);
  font-size: 6.5px;
  letter-spacing: 0.16em;
  color: rgba(170, 170, 215, 0.55);
}
#m-next-canvas { width: 54px; height: 54px; }

/* ------------------------------- touch controls ----------------------------- */
.touch-controls {
  display: none;
  position: fixed;
  z-index: 35;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
}
.touch-cluster { display: flex; gap: 7px; pointer-events: auto; }
.touch-btn {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 18px;
  color: #e8ebff;
  background: linear-gradient(155deg, rgba(30, 26, 66, 0.84), rgba(9, 8, 24, 0.72));
  border: 1px solid rgba(140, 122, 255, 0.26);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  touch-action: none;
  transition: transform 0.08s ease, background 0.12s ease;
}
.touch-btn:active { transform: scale(0.92); background: rgba(100, 82, 255, 0.35); }
.touch-btn.small { width: 58px; font-size: 8px; letter-spacing: 0.12em; }
.touch-btn.accent {
  width: 66px;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: #081019;
  background: linear-gradient(135deg, #51ecff, #b26cff 60%, #ff69e6);
  border-color: rgba(190, 245, 255, 0.5);
  box-shadow: 0 0 24px rgba(80, 210, 255, 0.26), 0 8px 22px rgba(0, 0, 0, 0.32);
}

/* --------------------------------- announce --------------------------------- */
.announce {
  position: fixed;
  z-index: 45;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%) scale(0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  width: min(92vw, 800px);
  opacity: 0;
  pointer-events: none;
}
.announce.show { animation: announcePop 1.45s cubic-bezier(0.22, 0.9, 0.25, 1) forwards; }
.announce b {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(28px, 4.5vw, 64px);
  letter-spacing: 0.06em;
  line-height: 1;
  color: #f5feff;
  background: linear-gradient(92deg, #74f6ff, #fff 45%, #ff7ee9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(80, 220, 255, 0.45)) drop-shadow(0 0 52px rgba(255, 60, 220, 0.25));
}
.announce span {
  font-family: var(--display);
  font-size: clamp(8px, 1vw, 11px);
  font-weight: 700;
  letter-spacing: 0.36em;
  color: rgba(218, 225, 255, 0.78);
  text-shadow: 0 0 16px rgba(120, 200, 255, 0.3);
}
.toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  top: 94px;
  transform: translate(-50%, -8px);
  padding: 8px 16px;
  border-radius: 99px;
  background: rgba(12, 10, 30, 0.78);
  border: 1px solid rgba(135, 118, 255, 0.28);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: rgba(225, 230, 255, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------- screens --------------------------------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.screen.is-active { display: flex; animation: fadeIn 0.35s ease both; }
.screen-title {
  z-index: 50;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 54%, rgba(76, 34, 160, 0.28), transparent 46%),
    radial-gradient(ellipse at 50% 100%, rgba(4, 2, 12, 0.92), transparent 68%),
    linear-gradient(180deg, rgba(3, 2, 10, 0.46), rgba(3, 2, 10, 0.32) 35%, rgba(3, 2, 10, 0.78) 100%);
}
.screen-title::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 79px, rgba(110, 84, 255, 0.035) 79px 80px);
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 10%, transparent 75%);
}
.title-inner {
  position: relative;
  z-index: 2;
  width: min(900px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: titleIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.title-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.38em;
  color: rgba(160, 218, 255, 0.58);
  margin-bottom: clamp(14px, 2.4vh, 26px);
}
.title-eyebrow i { width: clamp(28px, 6vw, 74px); height: 1px; background: linear-gradient(90deg, transparent, rgba(100, 220, 255, 0.5)); }
.title-eyebrow i:last-child { transform: scaleX(-1); }
.title-logo {
  position: relative;
  margin: 0;
  font-family: var(--display);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.035em;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 18px 48px rgba(40, 20, 120, 0.45));
}
.title-logo span { display: block; }
.logo-neon {
  font-size: clamp(58px, 10.6vw, 142px);
  background: linear-gradient(180deg, #ffffff 0%, #c7f8ff 42%, #3bd4ff 78%, #178cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 28px rgba(34, 228, 255, 0.3));
  transform: translateY(2%);
}
.logo-tetris {
  font-size: clamp(58px, 10.6vw, 142px);
  padding-top: 0.08em;
  background: linear-gradient(180deg, #ffe7ff 0%, #ff9af0 30%, #ff2bd6 70%, #8c20c9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(255, 43, 214, 0.32));
}
.title-cn {
  display: flex;
  gap: 0.46em;
  margin-top: clamp(16px, 2.8vh, 26px);
  font-size: clamp(15px, 1.7vw, 21px);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #eef5ff;
  text-shadow: 0 0 22px rgba(110, 200, 255, 0.35);
}
.title-cn span { opacity: 0; animation: charIn 0.55s ease forwards; }
.title-cn span:nth-child(1) { animation-delay: 0.5s; }
.title-cn span:nth-child(2) { animation-delay: 0.6s; }
.title-cn span:nth-child(3) { animation-delay: 0.7s; }
.title-cn span:nth-child(4) { animation-delay: 0.8s; }
.title-tagline {
  margin: clamp(8px, 1.4vh, 13px) 0 0;
  font-size: clamp(12px, 1.25vw, 14px);
  letter-spacing: 0.22em;
  color: rgba(196, 200, 238, 0.62);
}
.title-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: clamp(24px, 3.5vh, 38px);
}
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 13px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  transition: transform 0.18s ease, box-shadow 0.3s ease, border-color 0.2s, background 0.2s;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}
.btn:hover::after { left: 130%; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn-primary {
  color: #050710;
  background: linear-gradient(105deg, #67f1ff, #7d7bff 48%, #ff6ee4);
  box-shadow: 0 0 30px rgba(72, 196, 255, 0.28), 0 12px 30px rgba(0, 0, 0, 0.3);
  clip-path: polygon(13px 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%, 0 13px);
}
.btn-primary:hover { box-shadow: 0 0 46px rgba(80, 225, 255, 0.44), 0 14px 34px rgba(0, 0, 0, 0.34); }
.btn-label { font-size: 13px; letter-spacing: 0.2em; }
.btn-meta { font-size: 7px; letter-spacing: 0.14em; opacity: 0.55; }
.btn-ghost {
  color: rgba(226, 232, 255, 0.8);
  background: rgba(18, 15, 42, 0.72);
  border: 1px solid rgba(137, 119, 255, 0.28);
}
.btn-ghost:hover { border-color: rgba(90, 220, 255, 0.45); box-shadow: 0 0 24px rgba(70, 200, 255, 0.1); }
.btn-quiet {
  color: rgba(180, 183, 218, 0.58);
  min-height: 44px;
  font-size: 9px;
  padding: 0 18px;
  border: 1px solid rgba(120, 112, 190, 0.16);
}
.btn-quiet:hover { color: #e5e9ff; border-color: rgba(130, 120, 200, 0.35); }
.title-meta {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  margin-top: clamp(26px, 4vh, 42px);
}
.title-best { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.title-best span {
  font-family: var(--display);
  font-size: 7px;
  letter-spacing: 0.2em;
  color: rgba(160, 160, 205, 0.5);
}
.title-best b {
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: 0.03em;
  color: #f0f7ff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(90, 220, 255, 0.25);
}
.title-rule { width: 1px; height: 30px; background: linear-gradient(180deg, transparent, rgba(130, 120, 210, 0.35), transparent); }
.title-badges { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-start; }
.title-badges span {
  padding: 5px 8px;
  border: 1px solid rgba(130, 118, 220, 0.18);
  border-radius: 5px;
  font-family: var(--display);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(185, 190, 228, 0.6);
  background: rgba(20, 16, 48, 0.35);
}
.title-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: clamp(20px, 3vh, 32px);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: rgba(160, 160, 195, 0.42);
}
.title-hint kbd { opacity: 0.75; }
.title-version {
  position: absolute;
  z-index: 2;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--display);
  font-size: 7px;
  letter-spacing: 0.28em;
  color: rgba(140, 140, 185, 0.32);
  white-space: nowrap;
}
.title-corner {
  position: absolute;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-color: rgba(115, 217, 255, 0.25);
  border-style: solid;
  pointer-events: none;
}
.title-corner.tl { top: 104px; left: 28px; border-width: 1px 0 0 1px; }
.title-corner.tr { top: 104px; right: 28px; border-width: 1px 1px 0 0; }
.title-corner.bl { bottom: 52px; left: 28px; border-width: 0 0 1px 1px; border-color: rgba(255, 83, 220, 0.22); }
.title-corner.br { bottom: 52px; right: 28px; border-width: 0 1px 1px 0; border-color: rgba(255, 83, 220, 0.22); }
.title-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 78% 16%, rgba(130, 240, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 88% 68%, rgba(255, 160, 240, 0.4), transparent),
    radial-gradient(1px 1px at 22% 76%, rgba(255, 255, 255, 0.35), transparent);
  opacity: 0.7;
}

/* ---------------------------------- modals ---------------------------------- */
.screen-modal {
  z-index: 60;
  background: radial-gradient(ellipse at 50% 45%, rgba(28, 12, 60, 0.38), transparent 60%), rgba(3, 2, 9, 0.88);
}
.modal-card {
  position: relative;
  width: min(610px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(90, 55, 190, 0.2), transparent 46%),
    linear-gradient(155deg, rgba(24, 20, 56, 0.97), rgba(7, 6, 18, 0.985));
  border: 1px solid rgba(145, 124, 255, 0.27);
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.72),
    0 0 80px rgba(100, 60, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  scrollbar-width: none;
  animation: modalIn 0.4s cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
.modal-card::-webkit-scrollbar { display: none; }
.modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 18%;
  width: 64%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(130, 238, 255, 0.9), rgba(255, 100, 230, 0.7), transparent);
}
.modal-kicker {
  font-family: var(--display);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.4em;
  color: rgba(114, 235, 255, 0.62);
}
.modal-kicker.danger { color: rgba(255, 92, 190, 0.75); }
.modal-title {
  margin: 13px 0 9px;
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(34px, 5.2vw, 54px);
  letter-spacing: 0.06em;
  line-height: 1;
  color: #f6f9ff;
  text-shadow: 0 0 34px rgba(90, 220, 255, 0.22);
}
.modal-title span { color: var(--cyan); }
.over-title span { color: var(--pink); text-shadow: 0 0 34px rgba(255, 43, 214, 0.35); }
.modal-sub {
  margin: 0 auto;
  max-width: 390px;
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.65;
  color: rgba(182, 186, 224, 0.55);
}
.pause-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 25px 0 24px;
}
.pause-stats > div, .over-stats > div {
  padding: 12px 8px;
  border-radius: 10px;
  background: rgba(110, 96, 220, 0.06);
  border: 1px solid rgba(130, 118, 220, 0.12);
}
.pause-stats span, .over-stats span {
  display: block;
  font-family: var(--display);
  font-size: 6.5px;
  letter-spacing: 0.16em;
  color: rgba(160, 160, 205, 0.48);
  margin-bottom: 5px;
}
.pause-stats b, .over-stats b {
  font-family: var(--display);
  font-size: 17px;
  color: #eef5ff;
  font-variant-numeric: tabular-nums;
}
.modal-actions { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 23px; }
.new-best {
  display: none;
  width: fit-content;
  margin: 15px auto 0;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid rgba(255, 222, 70, 0.44);
  background: rgba(255, 222, 70, 0.08);
  font-family: var(--display);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--gold);
  box-shadow: 0 0 22px rgba(255, 222, 70, 0.13);
}
.new-best.show { display: block; animation: badgeIn 0.55s ease both; }
.over-score-wrap {
  margin: 22px 0 16px;
  padding: 16px 10px 18px;
  border-radius: 15px;
  background: radial-gradient(ellipse at 50% 20%, rgba(255, 43, 214, 0.12), transparent 70%);
  border: 1px solid rgba(255, 60, 200, 0.16);
}
.over-score-wrap span {
  display: block;
  font-family: var(--display);
  font-size: 7px;
  letter-spacing: 0.3em;
  color: rgba(200, 180, 235, 0.5);
  margin-bottom: 7px;
}
.over-score-wrap b {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(35px, 5vw, 46px);
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 28px rgba(255, 90, 220, 0.32);
}
.over-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: left;
}
.over-stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.over-stats span { margin-bottom: 0; }

.help-card { width: min(820px, calc(100vw - 24px)); text-align: left; }
.help-title { text-align: center; }
.help-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(18px, 3vw, 34px);
  margin-top: 24px;
}
.help-columns h3 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(130, 120, 220, 0.16);
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--cyan);
}
.help-list { display: flex; flex-direction: column; gap: 7px; }
.help-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 26px; }
.help-list span { display: flex; gap: 4px; align-items: center; }
.help-list b { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; color: rgba(200, 204, 238, 0.68); }
.score-table { display: flex; flex-direction: column; gap: 7px; }
.score-table > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: rgba(184, 188, 225, 0.56); }
.score-table b { font-family: var(--display); font-size: 9px; letter-spacing: 0.04em; color: rgba(240, 245, 255, 0.86); }
.help-tip {
  margin-top: 20px;
  padding: 12px 13px;
  border-left: 2px solid rgba(34, 228, 255, 0.5);
  background: rgba(34, 228, 255, 0.045);
  border-radius: 0 8px 8px 0;
  font-size: 11px;
  line-height: 1.65;
  color: rgba(184, 194, 228, 0.58);
}
.help-tip b { color: rgba(225, 245, 255, 0.88); }

/* --------------------------------- loading ---------------------------------- */
.loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: radial-gradient(ellipse at 50% 42%, #120d2c, #04030b 62%);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loading.is-done { opacity: 0; visibility: hidden; }
.loading-cube {
  position: relative;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(34, 228, 255, 0.45);
  border-radius: 9px;
  transform: rotate(45deg);
  box-shadow: 0 0 32px rgba(34, 228, 255, 0.22), inset 0 0 24px rgba(125, 92, 255, 0.18);
  animation: loadingSpin 2.2s ease-in-out infinite;
}
.loading-cube::before, .loading-cube::after {
  content: '';
  position: absolute;
  border: 1px solid rgba(255, 43, 214, 0.4);
  border-radius: 7px;
}
.loading-cube::before { inset: 8px; }
.loading-cube::after { inset: 17px; border-color: rgba(255, 226, 63, 0.4); }
.loading-cube span { display: none; }
.loading-text {
  font-family: var(--display);
  font-size: 9px;
  letter-spacing: 0.32em;
  color: rgba(170, 190, 235, 0.62);
}

/* --------------------------------- keyframes -------------------------------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes titleIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes charIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scoreBump { 0% { transform: scale(1); } 45% { transform: scale(1.045); } 100% { transform: scale(1); } }
@keyframes announcePop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72); filter: blur(8px); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); filter: blur(0); }
  24% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -52%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(0.98); }
}
@keyframes badgeIn { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }
@keyframes loadingSpin {
  0%, 100% { transform: rotate(45deg) scale(1); }
  50% { transform: rotate(225deg) scale(1.08); }
}


/* title: the title screen owns the stage; keep only utility actions above it */
body[data-mode='title'] .topbar { z-index: 55; }
body[data-mode='title'] .brand { opacity: 0; visibility: hidden; }
body[data-mode='title'] #btn-pause,
body[data-mode='over'] #btn-pause { display: none; }

/* -------------------------------- responsive -------------------------------- */
@media (max-height: 840px) and (min-width: 901px) {
  .hud { padding-top: 88px; gap: 22px; }
  .rail { gap: 9px; max-width: 206px; }
  .panel { padding-top: 12px; padding-bottom: 12px; }
  .score-value { font-size: 32px; margin: 10px 0 8px; }
  .hold-canvas { height: 82px; }
  .next-canvas { height: 178px; }
  .help-panel { display: none; }
  .combo-panel { display: none; }
  .title-logo { transform: scale(0.9); margin-bottom: -10px; }
}
@media (max-width: 1180px) and (min-width: 901px) {
  .hud { grid-template-columns: 188px 1fr 188px; gap: 22px; }
  .rail { max-width: 188px; }
  .score-value { font-size: 32px; }
  .next-canvas { height: 190px; }
}
@media (max-width: 900px) {
  .topbar { height: 64px; padding: 12px 14px; }
  .brand-cube { width: 25px; height: 28px; }
  .brand-name { font-size: 12px; }
  .brand-sub { display: none; }
  .top-actions { gap: 7px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 11px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .hud { display: none; }
  body[data-mode='playing'] .mobile-hud,
  body[data-mode='paused'] .mobile-hud,
  body[data-mode='over'] .mobile-hud { display: flex; }
  body[data-mode='playing'] .touch-controls { display: flex; }
  .title-logo { transform: scale(0.94); }
  .title-eyebrow { letter-spacing: 0.2em; font-size: 7px; }
  .title-tagline { letter-spacing: 0.12em; }
  .title-actions { flex-direction: column; width: min(310px, 88vw); }
  .btn { width: 100%; }
  .title-meta { gap: 18px; }
  .title-hint { display: none; }
  .title-corner { display: none; }
  .title-version { bottom: 16px; }
  .title-inner { padding-bottom: 34px; }
  .modal-card { padding: 24px 20px; border-radius: 20px; }
  .help-columns { grid-template-columns: 1fr; gap: 18px; }
  .help-list { gap: 5px; }
  .over-stats { grid-template-columns: repeat(2, 1fr); }
  .modal-actions { gap: 8px; }
  .modal-actions .btn { width: auto; flex: 1 1 150px; }
  .title-best { align-items: flex-start; }
  .title-meta { flex-wrap: wrap; justify-content: center; }
  .toast { top: 140px; }
  .announce { top: 31%; }
}
@media (max-width: 560px) {
  .title-logo { transform: scale(0.97); }
  .logo-neon, .logo-tetris { font-size: clamp(66px, 19vw, 84px); }
  .title-cn { margin-top: 14px; gap: 0.32em; }
  .title-tagline { font-size: 11px; max-width: 280px; }
  .title-meta { margin-top: 24px; }
  .m-stat { min-width: 54px; padding: 7px 8px; }
  .m-stat b { font-size: 11px; }
  .mobile-hud { gap: 5px; }
  .m-next { padding-left: 7px; }
  #m-next-canvas { width: 48px; height: 48px; }
  .touch-btn { width: 48px; height: 48px; border-radius: 13px; font-size: 16px; }
  .touch-btn.small { width: 53px; font-size: 7px; }
  .touch-btn.accent { width: 58px; font-size: 7.5px; }
  .touch-cluster { gap: 5px; }
  .title-inner { width: 100%; }
  .modal-title { font-size: 31px; }
  .over-score-wrap b { font-size: 33px; }
  .pause-stats { gap: 6px; }
  .pause-stats > div { padding: 10px 5px; }
  .pause-stats b { font-size: 14px; }
  .modal-sub { font-size: 11px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .topbar { height: 52px; padding: 8px 14px; }
  .mobile-hud {
    top: calc(6px + env(safe-area-inset-top));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    height: 48px;
    gap: 4px;
  }
  .m-stat { min-width: 44px; padding: 4px 7px; }
  .m-stat span { font-size: 5.5px; margin-bottom: 1px; }
  .m-stat b { font-size: 10px; }
  .m-next { height: 48px; padding: 2px 3px 2px 6px; gap: 3px; }
  .m-next span { font-size: 5.5px; }
  #m-next-canvas { width: 40px; height: 40px; }
  .brand-sub { display: none; }
  .title-logo { transform: scale(0.6); margin: -18px 0; }
  .title-cn, .title-tagline { display: none; }
  .title-actions { margin-top: 12px; }
  .title-meta { margin-top: 14px; }
  .title-hint { display: none; }
  .title-eyebrow { margin-bottom: 6px; }
  .title-inner { transform: scale(0.9); }
  .mobile-hud { top: calc(2px + env(safe-area-inset-top)); height: 48px; }
  .m-stat, .m-next, .m-hold { height: 48px; }
  .m-hold { width: 38px; }
  .m-hold b { font-size: 11px; }
  .touch-controls { bottom: 8px; }
  .touch-btn { width: 44px; height: 44px; }
  .touch-btn.small { width: 50px; }
  .touch-btn.accent { width: 54px; }
  .modal-card { padding: 18px 22px; }
  .modal-title { font-size: 30px; }
  .pause-stats, .over-score-wrap { margin: 12px 0; }
  .help-columns { grid-template-columns: 1fr 1fr; }
}

/* ============================================================================
   墨水屏模式（body[data-ink="1"]）
   针对汉王 Clear7 Turbo 这类 7 英寸 1680×1264 / 300PPI 的 Android 电纸书：
   纸白底、黑色描边、去掉所有光晕/渐变/动效，UI 放大，虚拟按键常驻。
   ========================================================================== */
body[data-ink='1'] {
  background: #ffffff;
  color: #141414;
}
body[data-ink='1'] .bg-veil,
body[data-ink='1'] .title-stars,
body[data-ink='1'] .flash,
body[data-ink='1'] .brand-cube { display: none !important; }

body[data-ink='1'] *,
body[data-ink='1'] *::before,
body[data-ink='1'] *::after {
  text-shadow: none !important;
  filter: none !important;
  box-shadow: none !important;
  transition: none !important;
  animation-duration: 0.001s !important;
}
body[data-ink='1'] .title-cn span { opacity: 1 !important; }
body[data-ink='1'] .announce.show { opacity: 1 !important; }

/* ---- 顶栏 ---- */
body[data-ink='1'] .topbar { background: #ffffff; border-bottom: 2px solid #111111; }
body[data-ink='1'] .brand-name,
body[data-ink='1'] .brand-name span { color: #111111; }
body[data-ink='1'] .brand-sub { color: #444444; }
body[data-ink='1'] .icon-btn {
  background: #ffffff;
  border: 2px solid #111111;
  border-radius: 10px;
  color: #111111;
}
body[data-ink='1'] .icon-btn svg path,
body[data-ink='1'] .icon-btn svg rect { fill: #111111; stroke: #111111; }
body[data-ink='1'] .ink-glyph { color: #111111; font-weight: 700; }

/* ---- 面板统一成白底黑框 ---- */
body[data-ink='1'] .panel,
body[data-ink='1'] .m-stat,
body[data-ink='1'] .m-hold,
body[data-ink='1'] .m-next,
body[data-ink='1'] .modal-card {
  background: #ffffff !important;
  border: 2px solid #111111 !important;
  border-radius: 12px !important;
}
body[data-ink='1'] .panel *,
body[data-ink='1'] .m-stat *,
body[data-ink='1'] .m-hold *,
body[data-ink='1'] .m-next *,
body[data-ink='1'] .modal-card * { color: #111111 !important; }
body[data-ink='1'] .panel-kicker i,
body[data-ink='1'] .title-rule { background: #111111 !important; }
body[data-ink='1'] .score-value { font-size: 34px; }
body[data-ink='1'] .level-track { background: #e3e3e3 !important; }
body[data-ink='1'] .level-track i { background: #111111 !important; }
body[data-ink='1'] .b2b-chip { background: #ffffff !important; border: 2px solid #111111 !important; }

/* ---- 小屏 HUD：在墨水屏上永远显示，字号加大 ---- */
body[data-ink='1'] .hud { display: none !important; }
body[data-ink='1'][data-mode='playing'] .mobile-hud,
body[data-ink='1'][data-mode='paused'] .mobile-hud,
body[data-ink='1'][data-mode='over'] .mobile-hud { display: flex !important; }
body[data-ink='1'] .mobile-hud { top: calc(78px + env(safe-area-inset-top)); height: 72px; }
body[data-ink='1'] .m-stat { min-width: 86px; padding: 9px 12px; }
body[data-ink='1'] .m-stat span { font-size: 10px; letter-spacing: 0.12em; }
body[data-ink='1'] .m-stat b { font-size: 20px; }
body[data-ink='1'] .m-hold { width: 64px; height: 72px; }
body[data-ink='1'] .m-hold span { font-size: 10px; }
body[data-ink='1'] .m-hold b { font-size: 18px; }
body[data-ink='1'] .m-next { height: 72px; padding: 4px 8px 4px 10px; }
body[data-ink='1'] .m-next span { font-size: 10px; }
body[data-ink='1'] #m-next-canvas { width: 62px; height: 62px; }

/* ---- 虚拟按键：常驻 + 大号高对比 ---- */
body[data-ink='1'] .touch-controls {
  display: none;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
}
body[data-ink='1'][data-mode='playing'] .touch-controls { display: flex; }
body[data-ink='1'] .touch-cluster { gap: 10px; }
body[data-ink='1'] .touch-btn {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  border: 3px solid #111111;
  background: #ffffff;
  color: #111111;
  font-size: 24px;
  font-weight: 700;
}
body[data-ink='1'] .touch-btn.small { width: 74px; font-size: 12px; letter-spacing: 0.08em; }
body[data-ink='1'] .touch-btn.accent {
  width: 86px;
  font-size: 12px;
  color: #ffffff;
  background: #111111;
  border-color: #111111;
}
body[data-ink='1'] .touch-btn:active { background: #d8d8d8; }
body[data-ink='1'] .touch-btn.accent:active { background: #333333; }

/* ---- 标题页 / 弹窗 ---- */
body[data-ink='1'] .screen-title {
  background: #ffffff;
}
body[data-ink='1'] .screen-title::before { display: none; }
body[data-ink='1'] .title-logo span {
  background: none !important;
  -webkit-text-fill-color: #111111 !important;
  color: #111111 !important;
}
body[data-ink='1'] .logo-neon,
body[data-ink='1'] .logo-tetris { color: #111111 !important; }
body[data-ink='1'] .title-eyebrow,
body[data-ink='1'] .title-tagline,
body[data-ink='1'] .title-hint,
body[data-ink='1'] .title-version,
body[data-ink='1'] .title-cn,
body[data-ink='1'] .modal-kicker,
body[data-ink='1'] .modal-sub { color: #333333 !important; }
body[data-ink='1'] .title-badges span {
  background: #ffffff !important;
  border: 2px solid #111111 !important;
  color: #111111 !important;
}
body[data-ink='1'] .screen-modal { background: rgba(255, 255, 255, 0.94); }
body[data-ink='1'] .btn {
  background: #ffffff !important;
  border: 3px solid #111111 !important;
  border-radius: 12px !important;
  color: #111111 !important;
  font-size: 17px;
}
body[data-ink='1'] .btn .btn-meta { color: #555555 !important; }
body[data-ink='1'] .btn-primary {
  background: #111111 !important;
  color: #ffffff !important;
}
body[data-ink='1'] .btn-primary * { color: #ffffff !important; }
body[data-ink='1'] .announce b { color: #111111 !important; -webkit-text-fill-color: #111111 !important; }
body[data-ink='1'] .announce span { color: #333333 !important; }
body[data-ink='1'] .toast {
  background: #ffffff !important;
  border: 2px solid #111111 !important;
  color: #111111 !important;
  font-size: 12px;
}
body[data-ink='1'] kbd {
  background: #ffffff !important;
  border: 2px solid #111111 !important;
  color: #111111 !important;
}
body[data-ink='1'] .ink-btn { border-color: #111111; }
body:not([data-ink='1']) .ink-btn { opacity: 0.55; }

/* ---- 墨水屏横屏（7 英寸 1680×1264 横过来） ---- */
@media (orientation: landscape) and (max-height: 760px) {
  body[data-ink='1'] .mobile-hud { top: calc(8px + env(safe-area-inset-top)); height: 58px; }
  body[data-ink='1'] .m-stat { min-width: 70px; padding: 6px 10px; }
  body[data-ink='1'] .m-stat b { font-size: 16px; }
  body[data-ink='1'] .touch-btn { width: 60px; height: 60px; font-size: 20px; }
  body[data-ink='1'] .touch-btn.small { width: 66px; font-size: 10px; }
  body[data-ink='1'] .touch-btn.accent { width: 76px; font-size: 10px; }
}

/* ---- 墨水屏补充：加载页 / 最佳分 / 版本号 ---- */
body[data-ink='1'] .loading { background: #ffffff; }
body[data-ink='1'] .loading-cube {
  border: 2px solid #111111;
  animation: none;
  transform: rotate(45deg) scale(0.9);
}
body[data-ink='1'] .loading-cube span { background: #111111 !important; }
body[data-ink='1'] .loading-text { color: #333333 !important; }
body[data-ink='1'] .title-best span,
body[data-ink='1'] .title-best b { color: #333333 !important; font-size: 13px; }
body[data-ink='1'] .title-rule { background: #111111 !important; }
