:root {
  --night-1: #150b34;
  --night-2: #241356;
  --night-3: #3a1f7a;
  --gold-1: #fff6cf;
  --gold-2: #ffd76a;
  --gold-3: #f2ad33;
  --gold-4: #a86410;
  --ink: #fff6e0;
  --muted: #c9b8f0;
  --violet: #8b6bff;
  --pink: #ff6fae;
  --teal: #3ee0c8;
  --red: #ff5c7a;
  --line: rgba(255, 215, 106, 0.28);
  --shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(139, 107, 255, 0.5), transparent 62%),
    radial-gradient(800px 500px at 108% 102%, rgba(255, 111, 174, 0.24), transparent 60%),
    radial-gradient(720px 520px at -10% 78%, rgba(62, 224, 200, 0.18), transparent 60%),
    linear-gradient(180deg, #1a0f3f 0%, #241356 46%, #150b34 100%);
  background-attachment: fixed;
}

body {
  overscroll-behavior: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 18% 12%, rgba(255, 255, 255, 0.95) 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 72% 26%, rgba(255, 240, 190, 0.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 42% 64%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 88% 78%, rgba(255, 215, 106, 0.85) 50%, transparent 51%),
    radial-gradient(1px 1px at 12% 88%, rgba(255, 255, 255, 0.65) 50%, transparent 51%);
  background-size: 340px 340px, 280px 280px, 420px 420px, 360px 360px, 300px 300px;
  opacity: 0.6;
  animation: twinkle 7s ease-in-out infinite alternate;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(260px 160px at 12% 18%, rgba(255, 215, 106, 0.12), transparent 70%),
    radial-gradient(240px 180px at 92% 40%, rgba(255, 111, 174, 0.12), transparent 70%);
}

@keyframes twinkle {
  from { opacity: 0.35; }
  to { opacity: 0.75; }
}

#app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
}

#screens {
  min-height: 100dvh;
}

.screen {
  display: none;
  min-height: 100dvh;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

/* ---------------- 首页 ---------------- */

.home {
  padding: 22px 18px 40px;
}

.hero {
  position: relative;
  text-align: center;
  padding: 6px 4px 2px;
}

.hero-crown {
  font-size: 40px;
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(255, 190, 80, 0.55));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-badge {
  display: inline-block;
  margin: 10px 0 12px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #3a2400;
  font-weight: 800;
  background: linear-gradient(180deg, #fff1b8, #ffd76a 55%, #f2ad33);
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid #fff6cf;
  box-shadow: 0 3px 0 #a86410, 0 6px 14px rgba(255, 170, 60, 0.35);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 31px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.05em;
  background: linear-gradient(180deg, #fffbe6 0%, #ffd76a 42%, #f2a93b 72%, #c67b1c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(90, 40, 0, 0.35)) drop-shadow(0 8px 22px rgba(255, 190, 80, 0.35));
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 2px;
  color: rgba(255, 215, 106, 0.85);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.hero-divider::before,
.hero-divider::after {
  content: "";
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 106, 0.7), transparent);
}

.hero-spark {
  position: absolute;
  color: #ffe9a8;
  text-shadow: 0 0 12px rgba(255, 200, 90, 0.9);
  animation: sparkle 2.6s ease-in-out infinite;
  pointer-events: none;
}

.hero-spark.s1 { top: 4px; left: 12%; font-size: 15px; animation-delay: 0.2s; }
.hero-spark.s2 { top: 34px; right: 10%; font-size: 11px; animation-delay: 1.1s; }
.hero-spark.s3 { top: 96px; left: 6%; font-size: 9px; animation-delay: 1.8s; }

@keyframes sparkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(20deg); }
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.card {
  position: relative;
  appearance: none;
  border-radius: 22px;
  padding: 15px 14px 14px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border: 3px solid #ffd76a;
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.28), transparent 56%),
    linear-gradient(158deg, #7a5bff 0%, #4a2bb0 58%, #311681 100%);
  box-shadow:
    0 0 0 3px rgba(16, 7, 40, 0.55),
    0 7px 0 rgba(18, 8, 46, 0.55),
    0 14px 26px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 0 22px rgba(255, 215, 106, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card:nth-child(1) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #8b6bff 0%, #5636c8 58%, #33198f 100%);
}

.card:nth-child(2) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #ff7fb8 0%, #d33c85 58%, #8d1c59 100%);
}

.card:nth-child(3) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #4fe8d2 0%, #16a894 58%, #0b6a60 100%);
}

.card:nth-child(4) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.32), transparent 56%),
    linear-gradient(158deg, #ffc45c 0%, #ef9722 58%, #a95b08 100%);
}

.card:nth-child(5) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.32), transparent 56%),
    linear-gradient(158deg, #63b8ff 0%, #2a76d6 58%, #144a8f 100%);
}

.card:nth-child(6) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #ff9d6b 0%, #e0552e 58%, #8f2a10 100%);
}

.card:nth-child(7) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.32), transparent 56%),
    linear-gradient(158deg, #59dcff 0%, #1d86d8 58%, #0d4a8c 100%);
}

.card:nth-child(8) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #b8f07a 0%, #46a832 58%, #1d6b1a 100%);
}

.card:nth-child(9) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #ff8ad8 0%, #c23a9e 58%, #6a1358 100%);
}

.card:nth-child(10) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #ff8f8f 0%, #c83946 58%, #7a121c 100%);
}

.card:nth-child(11) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #7aa8ff 0%, #2f4fc8 58%, #14227a 100%);
}

.card:nth-child(12) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #8ef0a8 0%, #2f9e55 44%, #c23a6e 100%);
}

.card:nth-child(13) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #b98cff 0%, #6a3ad6 58%, #2b146e 100%);
}

.card:nth-child(14) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #6ff0e0 0%, #1a9a8a 58%, #0a4f4a 100%);
}

.card:nth-child(15) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #7be495 0%, #2f9e55 58%, #145a2a 100%);
}

.card:nth-child(16) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #7fd4ff 0%, #2a62c8 58%, #102a6b 100%);
}

.card:nth-child(17) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #f0c879 0%, #b07a1f 58%, #5a3208 100%);
}

.card:nth-child(18) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #6ad8ff 0%, #1a6fd6 58%, #0b3a7a 100%);
}

.card:nth-child(19) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #ffb06b 0%, #d65a1f 58%, #7a2a08 100%);
}

.card:nth-child(20) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #ff9fd0 0%, #c23a8f 58%, #6a1350 100%);
}

.card:nth-child(21) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #7ce8ff 0%, #2a7fd6 58%, #0b3a7a 100%);
}

.card:nth-child(22) {
  background:
    radial-gradient(130% 90% at 18% 0%, rgba(255, 255, 255, 0.3), transparent 56%),
    linear-gradient(158deg, #ffd76a 0%, #d68a1f 58%, #7a4a08 100%);
}

.card.soon {
  grid-column: span 2;
  background: rgba(255, 255, 255, 0.05);
  border-style: dashed;
  border-color: rgba(255, 215, 106, 0.45);
  box-shadow: none;
  opacity: 0.9;
}

.card.soon .ico {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 215, 106, 0.35);
  box-shadow: none;
}

.card.soon .cmeta {
  background: rgba(255, 255, 255, 0.12);
  color: #c9b8f0;
  box-shadow: none;
}

.card::before {
  content: "✦";
  position: absolute;
  top: 9px;
  right: 11px;
  font-size: 13px;
  color: rgba(255, 246, 207, 0.95);
  text-shadow: 0 0 10px rgba(255, 215, 106, 0.9);
  animation: sparkle 3s ease-in-out infinite;
}

.card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 17px;
  border: 1px solid rgba(255, 246, 207, 0.24);
  pointer-events: none;
}

.card:active {
  transform: translateY(4px);
  box-shadow:
    0 3px 0 rgba(18, 8, 46, 0.55),
    0 8px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.card .ico {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 23px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fffdf4, #ffe9a8 65%, #f5c45c);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 3px 0 rgba(120, 70, 10, 0.45),
    inset 0 2px 0 #ffffff,
    inset 0 -3px 6px rgba(180, 110, 20, 0.25);
}

.card .cname {
  font-size: 16.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
  color: #fffdf6;
  text-shadow: 0 2px 4px rgba(16, 7, 40, 0.65), 0 0 18px rgba(255, 255, 255, 0.18);
}

.card .cdesc {
  font-size: 11.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 2px rgba(20, 8, 50, 0.45);
}

.card .cmeta {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 800;
  color: #3a2400;
  background: linear-gradient(180deg, #fff1b8, #ffd76a);
  border-radius: 999px;
  padding: 4px 9px;
  display: inline-block;
  box-shadow: 0 2px 0 #a86410;
}

.home-note {
  position: relative;
  margin-top: 24px;
  padding: 15px 16px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  border: 2px dashed rgba(255, 215, 106, 0.45);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  box-shadow: inset 0 0 24px rgba(139, 107, 255, 0.18);
}

.home-note b {
  display: block;
  color: var(--gold-2);
  font-size: 12.5px;
  margin-bottom: 5px;
  letter-spacing: 0.08em;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(21, 11, 52, 0.96) 0%, rgba(21, 11, 52, 0.72) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(255, 215, 106, 0.32);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.topbar .back {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  border: 2px solid rgba(255, 215, 106, 0.6);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  color: var(--gold-2);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0 0 3px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.topbar h1 {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fffbe6, #ffd76a 55%, #f2ad33);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}

.topbar .stats {
  flex: 0 0 auto;
  min-width: 74px;
  text-align: right;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.topbar .sound-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 106, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-2);
  font-size: 14px;
  cursor: pointer;
}

.sound-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 16px;
}

.sound-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 106, 0.5);
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-1);
  font-size: 11.5px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.sound-pill.off {
  opacity: 0.45;
}

.body {
  flex: 1;
  padding: 6px 14px 18px;
  display: flex;
  flex-direction: column;
}

/* ---------------- 通用控件 ---------------- */

.seg {
  display: flex;
  gap: 6px;
  background: rgba(8, 4, 24, 0.42);
  border: 1px solid rgba(255, 215, 106, 0.28);
  padding: 5px;
  border-radius: 16px;
  margin-bottom: 14px;
  box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.4);
}

.seg button {
  flex: 1;
  border: none;
  background: transparent;
  color: #b9a6e8;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 0;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.seg button.on {
  color: #3a2400;
  background: linear-gradient(180deg, #fff1b8 0%, #ffd76a 55%, #f2ad33 100%);
  box-shadow: 0 3px 0 #a86410, inset 0 1px 0 #ffffff;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.row-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.btn {
  position: relative;
  overflow: hidden;
  flex: 1;
  border-radius: 15px;
  padding: 13px 14px;
  font-size: 14px;
  font-weight: 900;
  font-family: inherit;
  letter-spacing: 0.03em;
  cursor: pointer;
  color: var(--gold-1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  border: 2px solid rgba(255, 215, 106, 0.55);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn.primary {
  color: #3a2400;
  background: linear-gradient(180deg, #fff1b8 0%, #ffd76a 42%, #f7b53c 72%, #e59a22 100%);
  border-color: #fff6cf;
  box-shadow:
    0 6px 0 #a86410,
    0 10px 20px rgba(255, 170, 60, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn.primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  transform: skewX(-18deg);
  animation: shine 3.4s ease-in-out infinite;
}

@keyframes shine {
  0%, 55% { left: -60%; }
  85%, 100% { left: 130%; }
}

.btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn.primary:active {
  box-shadow: 0 2px 0 #a86410, inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.tip-line {
  margin: 13px 2px 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: #9d8cc9;
}

/* ---------------- 广告占位 ---------------- */

.ad-banner {
  position: relative;
  margin: 6px 14px 14px;
  height: 56px;
  border-radius: 16px;
  border: 2px dashed rgba(255, 215, 106, 0.42);
  background:
    radial-gradient(120px 60px at 20% 0%, rgba(255, 215, 106, 0.12), transparent 70%),
    rgba(8, 4, 24, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #a291cf;
  font-size: 11.5px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.3);
}

.ad-banner b {
  color: #3a2400;
  font-size: 10px;
  background: linear-gradient(180deg, #ffe9a8, #ffc94d);
  border-radius: 5px;
  padding: 2px 6px;
  font-weight: 900;
  box-shadow: 0 2px 0 #a86410;
}

/* ---------------- 数字华容道 ---------------- */

.p15-board {
  display: grid;
  gap: 9px;
  grid-auto-rows: 1fr;
  aspect-ratio: 1;
  border-radius: 24px;
  padding: 13px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 106, 0.055) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(-45deg, rgba(255, 215, 106, 0.055) 0 1px, transparent 1px 16px),
    radial-gradient(120% 80% at 50% 0%, rgba(139, 107, 255, 0.35), transparent 60%),
    linear-gradient(160deg, #3a2470 0%, #241453 60%, #1a0f3d 100%);
  border: 3px solid var(--gold-2);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5),
    inset 0 0 46px rgba(139, 107, 255, 0.35);
}

.p15-board button,
.p15-board .p15-blank {
  border-radius: 15px;
  font-family: inherit;
  font-size: clamp(18px, 6.4vw, 28px);
  font-weight: 900;
  padding: 0;
  position: relative;
}

.p15-tile {
  border: 2px solid rgba(24, 10, 56, 0.65);
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #b7a4ff 0%, #8b6bff 40%, #5a3ad6 100%);
  box-shadow:
    inset 0 0 0 3px rgba(255, 246, 207, 0.9),
    inset 0 3px 0 rgba(255, 255, 255, 0.55),
    inset 0 14px 18px -12px rgba(255, 255, 255, 0.75),
    inset 0 -6px 10px rgba(24, 10, 56, 0.45),
    0 6px 0 #3a2490,
    0 10px 16px rgba(0, 0, 0, 0.4);
  text-shadow: 0 2px 0 rgba(24, 10, 56, 0.5), 0 0 14px rgba(255, 255, 255, 0.35);
  transition: transform 0.08s ease;
}

.p15-board > :nth-child(4n + 2).p15-tile {
  background: linear-gradient(180deg, #ffb0d4 0%, #ff6fae 45%, #c12d75 100%);
}

.p15-board > :nth-child(4n + 3).p15-tile {
  background: linear-gradient(180deg, #9dffe9 0%, #3ee0c8 45%, #12907f 100%);
}

.p15-board > :nth-child(4n).p15-tile {
  background: linear-gradient(180deg, #ffe0a0 0%, #ffc45c 45%, #e08c14 100%);
  color: #3a2400;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.p15-board button:active {
  transform: translateY(3px);
}

.p15-blank {
  background:
    radial-gradient(circle at 50% 38%, rgba(139, 107, 255, 0.28), transparent 65%),
    rgba(0, 0, 0, 0.4);
  box-shadow:
    inset 0 4px 12px rgba(0, 0, 0, 0.65),
    inset 0 0 0 2px rgba(255, 215, 106, 0.16);
  border: 2px dashed rgba(255, 215, 106, 0.22);
  cursor: default;
}

/* ---------------- 2048 ---------------- */

.g2048-head {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.score-box {
  flex: 1;
  border-radius: 16px;
  padding: 9px 14px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 2px solid rgba(255, 215, 106, 0.42);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.score-box span {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold-2);
  letter-spacing: 0.1em;
}

.score-box b {
  font-size: 21px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.g2048-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 9px;
  aspect-ratio: 1;
  border-radius: 22px;
  padding: 11px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 106, 0.05) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(-45deg, rgba(255, 215, 106, 0.05) 0 1px, transparent 1px 16px),
    radial-gradient(120% 80% at 50% 0%, rgba(139, 107, 255, 0.32), transparent 60%),
    linear-gradient(160deg, #3a2470 0%, #241453 60%, #1a0f3d 100%);
  border: 3px solid var(--gold-2);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5),
    inset 0 0 46px rgba(139, 107, 255, 0.3);
  touch-action: none;
}

.g2048-board .cell {
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.26);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.tile {
  width: 100%;
  height: 100%;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: clamp(15px, 4.8vw, 24px);
  color: #fff;
  font-variant-numeric: tabular-nums;
  border: 2px solid rgba(24, 10, 56, 0.6);
  box-shadow:
    inset 0 0 0 3px rgba(255, 246, 207, 0.85),
    inset 0 3px 0 rgba(255, 255, 255, 0.5),
    inset 0 14px 18px -12px rgba(255, 255, 255, 0.75),
    inset 0 -5px 9px rgba(24, 10, 56, 0.4),
    0 5px 0 rgba(0, 0, 0, 0.35);
  text-shadow: 0 2px 0 rgba(24, 10, 56, 0.45), 0 0 12px rgba(255, 255, 255, 0.25);
}

.tile.new,
.tile.merged {
  animation: pop 0.18s ease;
}

@keyframes pop {
  0% { transform: scale(0.55); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.v2 { background: linear-gradient(180deg, #7d6bc4, #4c3a95); }
.v4 { background: linear-gradient(180deg, #9480dd, #5e46b0); }
.v8 { background: linear-gradient(180deg, #b49bff, #7550e0); }
.v16 { background: linear-gradient(180deg, #cf8bff, #8b3ad6); }
.v32 { background: linear-gradient(180deg, #ff9cc8, #d63c85); }
.v64 { background: linear-gradient(180deg, #ff9f7a, #e0521f); }
.v128 { background: linear-gradient(180deg, #ffd88a, #e89a12); color: #3a2400; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.v256 { background: linear-gradient(180deg, #ffe9a8, #f2ad33); color: #3a2400; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.v512 { background: linear-gradient(180deg, #8bffe9, #14a892); }
.v1024 { background: linear-gradient(180deg, #8ed8ff, #1f7fd6); }
.v2048 {
  background: linear-gradient(180deg, #fff6cf, #ffd76a 45%, #f2a93b);
  color: #3a2400;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 0 0 2px #fffdf2,
    inset 0 3px 0 #ffffff,
    0 0 18px rgba(255, 215, 106, 0.85),
    0 5px 0 #a86410;
}
.vsuper {
  background: linear-gradient(180deg, #fff6cf, #ff9f43 50%, #d63c85);
  color: #3a2400;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 0 0 2px #fffdf2,
    0 0 22px rgba(255, 160, 70, 0.9),
    0 5px 0 #a86410;
}

/* ---------------- 数独 ---------------- */

.sd-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  border: 3px solid var(--gold-2);
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 106, 0.045) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(-45deg, rgba(255, 215, 106, 0.045) 0 1px, transparent 1px 16px),
    radial-gradient(90% 70% at 50% 0%, rgba(139, 107, 255, 0.22), transparent 65%),
    linear-gradient(160deg, #2b1a5e, #170d38);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
}

.sd-cell {
  display: grid;
  place-items: center;
  font-size: clamp(13px, 4.6vw, 20px);
  font-weight: 700;
  color: #fff;
  border-right: 1px solid rgba(255, 215, 106, 0.16);
  border-bottom: 1px solid rgba(255, 215, 106, 0.16);
  cursor: pointer;
  user-select: none;
  font-variant-numeric: tabular-nums;
  transition: background 0.1s ease, color 0.1s ease;
}

.sd-cell.br { border-right: 2px solid rgba(255, 215, 106, 0.75); }
.sd-cell.bb { border-bottom: 2px solid rgba(255, 215, 106, 0.75); }
.sd-cell.given {
  color: var(--gold-2);
  font-weight: 900;
  text-shadow: 0 0 10px rgba(255, 190, 80, 0.45);
}
.sd-cell.user {
  color: #7ff0e2;
  font-weight: 800;
  text-shadow: 0 0 9px rgba(62, 224, 200, 0.55);
}
.sd-cell.selected {
  background: rgba(255, 215, 106, 0.26);
  box-shadow: inset 0 0 0 2px var(--gold-2), inset 0 0 18px rgba(255, 190, 80, 0.35);
}
.sd-cell.same {
  background: rgba(255, 215, 106, 0.09);
}
.sd-cell.conflict {
  color: #ff8098 !important;
  background: rgba(255, 92, 122, 0.2);
  text-shadow: 0 0 10px rgba(255, 92, 122, 0.6);
}

.sd-pad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.sd-pad button {
  border: 2px solid rgba(255, 215, 106, 0.42);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03));
  border-radius: 13px;
  padding: 11px 0;
  font-size: 19px;
  font-weight: 900;
  font-family: inherit;
  color: var(--gold-1);
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.sd-pad button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.32);
}

.sd-pad button.erase {
  font-size: 13px;
  color: #b9a6e8;
}

/* ---------------- 一笔画 ---------------- */

.os-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.os-level {
  font-weight: 900;
  color: var(--gold-2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.os-canvas {
  width: 100%;
  display: block;
  border-radius: 22px;
  border: 3px solid var(--gold-2);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
  touch-action: none;
  background: #170d38;
  cursor: crosshair;
}

/* ---------------- 弹窗 / 广告 ---------------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(8, 4, 24, 0.68);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 330px;
  border-radius: 22px;
  padding: 22px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(139, 107, 255, 0.35), transparent 60%),
    linear-gradient(160deg, #3a2470, #1d1046);
  border: 2px solid var(--gold-2);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 24px 60px rgba(0, 0, 0, 0.6),
    inset 0 0 40px rgba(139, 107, 255, 0.25);
}

.modal h3 {
  margin: 0 0 11px;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.06em;
  background: linear-gradient(180deg, #fffbe6, #ffd76a 55%, #f2ad33);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3));
}

.modal-body {
  font-size: 14px;
  line-height: 1.8;
  color: #e8defe;
}

.modal-body b {
  color: var(--gold-2);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.ad-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #0b0620;
}

.ad-video {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  text-align: center;
  padding: 20px;
  background:
    radial-gradient(420px 320px at 50% 28%, rgba(139, 107, 255, 0.45), transparent 70%),
    radial-gradient(300px 240px at 50% 90%, rgba(255, 111, 174, 0.22), transparent 70%),
    linear-gradient(180deg, #241356, #0b0620);
}

.ad-video::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(255, 215, 106, 0.35);
  border-radius: 18px;
  pointer-events: none;
}

.ad-badge {
  position: absolute;
  top: 30px;
  left: 32px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #3a2400;
  font-weight: 900;
  background: linear-gradient(180deg, #ffe9a8, #ffc94d);
  border-radius: 5px;
  padding: 3px 7px;
  box-shadow: 0 2px 0 #a86410;
}

.ad-play {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid var(--gold-2);
  display: grid;
  place-items: center;
  font-size: 26px;
  padding-left: 4px;
  color: var(--gold-2);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 26px rgba(255, 215, 106, 0.4), inset 0 0 18px rgba(255, 215, 106, 0.2);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 106, 0.3), inset 0 0 14px rgba(255, 215, 106, 0.15); }
  50% { box-shadow: 0 0 34px rgba(255, 215, 106, 0.55), inset 0 0 20px rgba(255, 215, 106, 0.3); }
}

.ad-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--gold-1);
}

.ad-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
}

.ad-foot {
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(11, 6, 32, 0), #0b0620 40%);
  border-top: 1px solid rgba(255, 215, 106, 0.18);
}

.ad-tip {
  flex: 1;
  color: #c9b8f0;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ad-foot .btn {
  flex: 0 0 auto;
  padding: 12px 20px;
}

.ad-close {
  position: absolute;
  top: 28px;
  right: 30px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 215, 106, 0.6);
  background: rgba(0, 0, 0, 0.3);
  color: var(--gold-2);
  font-size: 15px;
  cursor: pointer;
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%) translateY(8px);
  background: linear-gradient(180deg, #3a2470, #1d1046);
  border: 1px solid rgba(255, 215, 106, 0.55);
  color: var(--gold-1);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  z-index: 80;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 521px) {
  #app {
    box-shadow: 0 0 0 1px rgba(255, 215, 106, 0.12), 0 0 80px rgba(0, 0, 0, 0.5);
  }
}

@media (max-height: 720px) {
  .p15-board,
  .g2048-board {
    border-radius: 18px;
    padding: 9px;
    gap: 7px;
  }
  .sd-pad button {
    padding: 9px 0;
  }
}

/* ---------------- 方块拼图 ---------------- */

.bp-head {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.bp-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 4px;
  aspect-ratio: 1;
  padding: 10px;
  border-radius: 22px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 106, 0.05) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(-45deg, rgba(255, 215, 106, 0.05) 0 1px, transparent 1px 16px),
    radial-gradient(120% 80% at 50% 0%, rgba(139, 107, 255, 0.32), transparent 60%),
    linear-gradient(160deg, #3a2470 0%, #241453 60%, #1a0f3d 100%);
  border: 3px solid var(--gold-2);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5),
    inset 0 0 46px rgba(139, 107, 255, 0.3);
  touch-action: none;
}

.bp-cell {
  position: relative;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.26);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}

.bp-cell.hl {
  background: rgba(255, 215, 106, 0.22);
  box-shadow: inset 0 0 0 2px #ffd76a, inset 0 0 14px rgba(255, 215, 106, 0.45);
}

.bp-cell.bad {
  background: rgba(255, 92, 122, 0.16);
  box-shadow: inset 0 0 0 2px rgba(255, 92, 122, 0.75);
}

.bp-cell.clearing {
  animation: bpClear 0.2s ease forwards;
}

@keyframes bpClear {
  0% { transform: scale(1); }
  55% { transform: scale(1.12); filter: brightness(1.7); }
  100% { transform: scale(0.2); opacity: 0; }
}

.bp-block {
  position: absolute;
  inset: 1px;
  border-radius: 6px;
  border: 1px solid rgba(24, 10, 56, 0.6);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 246, 207, 0.7),
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -3px 7px rgba(0, 0, 0, 0.35);
}

.bp-tile {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

.bp-tile.on {
  border: 1px solid rgba(24, 10, 56, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 207, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

/* 方块配色 */
.bp-block.c1,
.bp-tile.on.c1 { background: linear-gradient(180deg, #c3b3ff, #6b47e8); }
.bp-block.c2,
.bp-tile.on.c2 { background: linear-gradient(180deg, #ffb0d4, #d63c85); }
.bp-block.c3,
.bp-tile.on.c3 { background: linear-gradient(180deg, #9dffe9, #14a892); }
.bp-block.c4,
.bp-tile.on.c4 { background: linear-gradient(180deg, #ffe0a0, #e08c14); }
.bp-block.c5,
.bp-tile.on.c5 { background: linear-gradient(180deg, #a8d8ff, #2a76d6); }
.bp-block.c6,
.bp-tile.on.c6 { background: linear-gradient(180deg, #ffc09a, #e0552e); }

.bp-tray {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  min-height: 88px;
  padding: 10px 8px;
  border-radius: 18px;
  border: 2px dashed rgba(255, 215, 106, 0.35);
  background: rgba(8, 4, 24, 0.32);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.35);
}

.bp-piece {
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 106, 0.25);
  background: rgba(255, 255, 255, 0.05);
  cursor: grab;
  touch-action: none;
}

.bp-piece:active {
  cursor: grabbing;
}

.bp-piece.empty {
  opacity: 0.22;
  border-style: dashed;
  min-width: 64px;
  min-height: 64px;
}

.bp-mini {
  display: grid;
  gap: 3px;
}

.bp-ghost {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  display: grid;
  opacity: 0.95;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.5));
}

.bp-ghost .bp-tile {
  border-radius: 7px;
}

/* ---------------- 水排序 ---------------- */

.ws-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.ws-level {
  font-weight: 900;
  color: var(--gold-2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.ws-moves {
  font-variant-numeric: tabular-nums;
}

.ws-tubes {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 14px 9px;
  padding: 14px 2px 6px;
}

.ws-tube {
  position: relative;
  width: 60px;
  height: 220px;
  padding: 4px;
  border-radius: 10px 10px 22px 22px;
  border: 2px solid rgba(255, 215, 106, 0.75);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(139, 107, 255, 0.1) 35%, rgba(0, 0, 0, 0.18));
  box-shadow:
    inset 0 0 16px rgba(255, 255, 255, 0.12),
    inset 0 -10px 20px rgba(0, 0, 0, 0.35),
    0 6px 0 rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ws-tube:empty {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(139, 107, 255, 0.14) 45%, rgba(0, 0, 0, 0.06));
}

.ws-tube::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 2px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(255, 246, 207, 0.4);
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 2;
}

.ws-tube::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 7px;
  height: 68%;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.ws-tube.sel {
  transform: translateY(-10px);
  border-color: #fff6cf;
  box-shadow:
    0 0 0 3px rgba(255, 215, 106, 0.25),
    0 0 22px rgba(255, 215, 106, 0.55),
    inset 0 0 16px rgba(255, 255, 255, 0.15);
}

.ws-tube.poured {
  animation: wsPour 0.22s ease;
}

@keyframes wsPour {
  0% { transform: translateY(0); }
  40% { transform: translateY(-7px); }
  100% { transform: translateY(0); }
}

.ws-tube.hint-src {
  border-color: #ffd76a;
  box-shadow: 0 0 0 3px rgba(255, 215, 106, 0.35), 0 0 24px rgba(255, 215, 106, 0.7);
  animation: wsPulse 1s ease-in-out infinite;
}

.ws-tube.hint-dst {
  border-color: #3ee0c8;
  box-shadow: 0 0 0 3px rgba(62, 224, 200, 0.3), 0 0 24px rgba(62, 224, 200, 0.65);
  animation: wsPulse 1s ease-in-out infinite;
}

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

.ws-seg {
  flex: 0 0 25%;
  width: 100%;
  border-radius: 3px;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.35),
    inset 0 -2px 5px rgba(0, 0, 0, 0.25);
}

.ws-seg.c1 { background: linear-gradient(180deg, #ff8fae, #f0447a); }
.ws-seg.c2 { background: linear-gradient(180deg, #ffbd7a, #f07a1f); }
.ws-seg.c3 { background: linear-gradient(180deg, #ffe98f, #e8b81c); }
.ws-seg.c4 { background: linear-gradient(180deg, #9df0b0, #2fae55); }
.ws-seg.c5 { background: linear-gradient(180deg, #7cf0de, #14a892); }
.ws-seg.c6 { background: linear-gradient(180deg, #8ec8ff, #2a76d6); }
.ws-seg.c7 { background: linear-gradient(180deg, #b9a8ff, #6b47e8); }
.ws-seg.c8 { background: linear-gradient(180deg, #dfa0ff, #a53ad6); }
.ws-seg.c9 { background: linear-gradient(180deg, #ffa6e2, #d63caf); }
.ws-seg.c10 { background: linear-gradient(180deg, #d9b18e, #9a6432); }

@media (max-width: 400px) {
  .ws-tube {
    width: 48px;
    height: 168px;
  }
  .bp-piece {
    padding: 6px;
  }
}

/* ---------------- 翻牌记忆 ---------------- */

.mem-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.mem-head span:last-child {
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.mem-board {
  display: grid;
  gap: 7px;
  width: 100%;
  margin: 0 auto;
  touch-action: manipulation;
}

.mem-card {
  position: relative;
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  aspect-ratio: 1;
  perspective: 700px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mem-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.38s cubic-bezier(0.3, 0.7, 0.4, 1);
}

.mem-card.flipped .mem-inner {
  transform: rotateY(180deg);
}

.mem-face {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.mem-back {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 215, 106, 0.28), transparent 62%),
    repeating-linear-gradient(45deg, rgba(255, 215, 106, 0.09) 0 1px, transparent 1px 12px),
    linear-gradient(160deg, #4a2b9a, #25124f);
  border: 2px solid rgba(255, 215, 106, 0.82);
  box-shadow:
    inset 0 0 0 3px rgba(255, 246, 207, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    0 4px 0 rgba(0, 0, 0, 0.35);
}

.mem-back::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 215, 106, 0.35);
}

.mem-back span {
  position: relative;
  color: #fff6cf;
  font-size: clamp(12px, 3.6vw, 20px);
  text-shadow: 0 0 12px rgba(255, 205, 95, 0.9);
}

.mem-front {
  transform: rotateY(180deg);
  border: 2px solid rgba(255, 246, 207, 0.85);
  font-size: clamp(17px, 5.4vw, 32px);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -3px 7px rgba(0, 0, 0, 0.3);
}

.mem-card.matched .mem-front {
  box-shadow:
    0 0 16px rgba(255, 215, 106, 0.85),
    inset 0 0 12px rgba(255, 255, 255, 0.35);
}

.mem-card.matched {
  animation: memPop 0.35s ease;
}

.mem-card.hint .mem-front {
  box-shadow: 0 0 0 3px #ffd76a, 0 0 22px rgba(255, 215, 106, 0.9);
}

@keyframes memPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.mem-front.c1 { background: linear-gradient(180deg, #ff9a8b, #e0432f); }
.mem-front.c2 { background: linear-gradient(180deg, #c7a0ff, #7a3ce0); }
.mem-front.c3 { background: linear-gradient(180deg, #ffe98f, #e8b81c); }
.mem-front.c4 { background: linear-gradient(180deg, #9df0b0, #2fae55); }
.mem-front.c5 { background: linear-gradient(180deg, #ff9cc8, #d63c85); }
.mem-front.c6 { background: linear-gradient(180deg, #ffbd7a, #e07a1f); }
.mem-front.c7 { background: linear-gradient(180deg, #9df5d8, #14a892); }
.mem-front.c8 { background: linear-gradient(180deg, #ffe0a0, #e08c14); }
.mem-front.c9 { background: linear-gradient(180deg, #d9b18e, #9a6432); }
.mem-front.c10 { background: linear-gradient(180deg, #ffa6e2, #d63caf); }
.mem-front.c11 { background: linear-gradient(180deg, #8ec8ff, #2a76d6); }
.mem-front.c12 { background: linear-gradient(180deg, #b9a8ff, #6b47e8); }

/* ---------------- 推箱子 ---------------- */

.sk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.sk-head span:last-child {
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.sk-board {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px;
  border-radius: 18px;
  border: 3px solid var(--gold-2);
  background: linear-gradient(160deg, #241453, #12092c);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(0, 0, 0, 0.35);
  touch-action: none;
}

.sk-cell {
  position: relative;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.16);
}

.sk-cell.floor {
  background: #1a0f38;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
}

.sk-cell.wall {
  background: linear-gradient(160deg, #6a4fb0 0%, #4a2f8c 55%, #33206b 100%);
  border: 1px solid rgba(255, 215, 106, 0.3);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.18),
    inset 0 -4px 8px rgba(0, 0, 0, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.4);
}

.sk-cell.target {
  background: radial-gradient(circle, rgba(255, 215, 106, 0.16), #1a0f38 72%);
}

.sk-cell.target::after {
  content: "◆";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffd76a;
  font-size: clamp(9px, 3vw, 18px);
  text-shadow: 0 0 10px rgba(255, 200, 80, 0.95);
  pointer-events: none;
}

.sk-box {
  position: absolute;
  inset: 9%;
  border-radius: 5px;
  background: linear-gradient(180deg, #b7a4ff, #6b47e8);
  border: 2px solid rgba(255, 246, 207, 0.85);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -3px 6px rgba(0, 0, 0, 0.35),
    0 3px 0 rgba(0, 0, 0, 0.4);
  display: grid;
  place-items: center;
  color: rgba(255, 246, 207, 0.85);
  font-size: clamp(8px, 2.2vw, 14px);
}

.sk-box::after {
  content: "✦";
}

.sk-box.on {
  background: linear-gradient(180deg, #ffe9a8, #f2ad33);
  border-color: #fff6cf;
  color: #8a5a0a;
  box-shadow:
    0 0 16px rgba(255, 215, 106, 0.85),
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    inset 0 -3px 6px rgba(120, 70, 10, 0.4);
}

.sk-player {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(15px, 4.8vw, 27px);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
  z-index: 2;
}

.sk-player::before {
  content: "";
  position: absolute;
  width: 74%;
  height: 74%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 106, 0.4), transparent 70%);
}

.sk-pad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(2, 54px);
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.sk-pad button {
  border: 2px solid rgba(255, 215, 106, 0.55);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  color: var(--gold-1);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.sk-pad button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.sk-pad [data-dir="up"] { grid-column: 2; grid-row: 1; }
.sk-pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.sk-pad [data-dir="down"] { grid-column: 2; grid-row: 2; }
.sk-pad [data-dir="right"] { grid-column: 3; grid-row: 2; }

@media (max-width: 400px) {
  .sk-pad {
    grid-template-columns: repeat(3, 56px);
    grid-template-rows: repeat(2, 48px);
  }
  .mem-board {
    gap: 5px;
  }
}

/* ---------------- 数织 ---------------- */

.ng-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.ng-level {
  color: var(--gold-2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.ng-grid {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 18px;
  border: 3px solid var(--gold-2);
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 106, 0.04) 0 1px, transparent 1px 14px),
    linear-gradient(160deg, #2b1a5e, #170d38);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
}

.ng-clue {
  display: flex;
  color: var(--gold-2);
  font-weight: 900;
  font-size: 11px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.ng-grid[data-size="8"] .ng-clue {
  font-size: 10px;
}

.ng-grid[data-size="10"] .ng-clue {
  font-size: 9.5px;
}

.ng-top {
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 1px;
  padding-bottom: 2px;
  min-height: var(--clue-h, 46px);
}

.ng-left {
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  gap: 3px;
  padding-right: 3px;
}

.ng-clue.done {
  color: rgba(255, 246, 207, 0.32);
}

.ng-cell {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(255, 215, 106, 0.14);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
  color: #b9a6e8;
  font-size: clamp(11px, 3.2vw, 16px);
  font-weight: 900;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ng-cell.fill {
  background: linear-gradient(180deg, #ffe9a8, #f2ad33);
  border-color: #fff6cf;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    inset 0 -3px 6px rgba(120, 70, 10, 0.35),
    0 0 8px rgba(255, 200, 80, 0.35);
}

.ng-cell.wrong {
  background: rgba(255, 92, 122, 0.45);
  border-color: #ff5c7a;
  animation: ngWrong 0.3s ease;
}

.ng-cell.hint {
  box-shadow: 0 0 0 2px #3ee0c8, 0 0 14px rgba(62, 224, 200, 0.85);
}

@keyframes ngWrong {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-2px); }
  70% { transform: translateX(2px); }
}

/* ---------------- 扫雷 ---------------- */

.ms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.ms-mines {
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.ms-board {
  display: grid;
  gap: 3px;
  padding: 8px;
  border-radius: 18px;
  border: 3px solid var(--gold-2);
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 106, 0.04) 0 1px, transparent 1px 14px),
    linear-gradient(160deg, #2b1a5e, #170d38);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
  touch-action: manipulation;
}

.ms-cell {
  aspect-ratio: 1;
  padding: 0;
  border-radius: 5px;
  border: 1px solid rgba(255, 215, 106, 0.22);
  background: linear-gradient(180deg, #4a3490, #2a1b57);
  color: #fff;
  font-weight: 900;
  font-size: clamp(10px, 3.2vw, 19px);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.18),
    0 2px 0 rgba(0, 0, 0, 0.35);
  font-variant-numeric: tabular-nums;
}

.ms-cell:active {
  transform: translateY(1px);
}

.ms-cell.open {
  background: #1a0f38;
  border-color: rgba(255, 215, 106, 0.08);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
  cursor: default;
}

.ms-cell.flag {
  background: linear-gradient(180deg, #ffe9a8, #f2ad33);
  border-color: #fff6cf;
  font-size: clamp(11px, 3.4vw, 18px);
}

.ms-cell.mine {
  background: rgba(255, 92, 122, 0.25);
  border-color: rgba(255, 92, 122, 0.6);
}

.ms-cell.boom {
  background: #ff5c7a;
  animation: msBoom 0.35s ease;
}

@keyframes msBoom {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.ms-cell.n1 { color: #8ec8ff; }
.ms-cell.n2 { color: #7be495; }
.ms-cell.n3 { color: #ff8098; }
.ms-cell.n4 { color: #c7a0ff; }
.ms-cell.n5 { color: #ffbd7a; }
.ms-cell.n6 { color: #7cf0de; }
.ms-cell.n7 { color: #ffa6e2; }
.ms-cell.n8 { color: #d8d2ea; }

@media (max-width: 400px) {
  .ng-grid,
  .ms-board {
    gap: 2px;
    padding: 6px;
  }
}

/* ---------------- 俄罗斯方块 ---------------- */

.tt-main {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: flex-start;
}

.tt-board-wrap {
  height: min(58vh, 600px);
  aspect-ratio: 1 / 2;
}

.tt-board {
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid var(--gold-2);
  border-radius: 14px;
  background: #12092c;
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 30px rgba(0, 0, 0, 0.5);
}

.tt-side {
  width: 104px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tt-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 9px;
  border-radius: 12px;
  border: 2px solid rgba(255, 215, 106, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

.tt-stat span {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-2);
  letter-spacing: 0.08em;
}

.tt-stat b {
  font-size: 16px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.tt-next {
  padding: 6px;
  border-radius: 12px;
  border: 2px solid rgba(255, 215, 106, 0.35);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
}

.tt-next span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-2);
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}

.tt-next-canvas {
  display: block;
  width: 100%;
  height: 118px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.tt-pad {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.tt-pad button {
  width: 58px;
  height: 52px;
  border-radius: 14px;
  border: 2px solid rgba(255, 215, 106, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  color: var(--gold-1);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.tt-pad button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

@media (max-width: 400px) {
  .tt-side {
    width: 90px;
  }
  .tt-pad button {
    width: 52px;
    height: 48px;
  }
}

/* ---------------- 合成大西瓜 ---------------- */

.su-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.su-head b {
  color: var(--gold-2);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.su-head i {
  font-style: normal;
  font-size: 18px;
}

.su-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 500 / 640;
  border: 3px solid var(--gold-2);
  border-radius: 20px;
  background: #140a30;
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
  touch-action: none;
  cursor: pointer;
}

/* ---------------- 三消 ---------------- */

.m3-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.m3-head b {
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.m3-level {
  color: var(--gold-2);
  font-weight: 900;
}

.m3-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #a291cf;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.m3-score b {
  font-size: 26px;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4), 0 0 14px rgba(255, 215, 106, 0.35);
}

.m3-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 18px;
  border: 3px solid var(--gold-2);
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 106, 0.04) 0 1px, transparent 1px 14px),
    linear-gradient(160deg, #2b1a5e, #170d38);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
  touch-action: manipulation;
}

.m3-cell {
  padding: 0;
  border: none;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 9px;
  aspect-ratio: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.m3-gem {
  width: 100%;
  height: 100%;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: clamp(10px, 3vw, 16px);
  border: 2px solid rgba(24, 10, 56, 0.55);
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.45),
    inset 0 -4px 8px rgba(0, 0, 0, 0.35),
    0 3px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.m3-gem.g1 { background: linear-gradient(180deg, #ffb3b3, #e83a3a); }
.m3-gem.g2 { background: linear-gradient(180deg, #a8d8ff, #2a76d6); }
.m3-gem.g3 { background: linear-gradient(180deg, #b3ffb8, #2fae55); }
.m3-gem.g4 { background: linear-gradient(180deg, #ffe9a8, #e08c14); }
.m3-gem.g5 { background: linear-gradient(180deg, #d9b3ff, #7a3ce0); }
.m3-gem.g6 { background: linear-gradient(180deg, #9dfff0, #14a892); }

.m3-gem.sel {
  transform: scale(0.9);
  box-shadow:
    0 0 0 3px #ffd76a,
    0 0 18px rgba(255, 215, 106, 0.85),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.m3-gem.hint {
  animation: m3Hint 0.8s ease-in-out infinite;
}

@keyframes m3Hint {
  0%, 100% { box-shadow: 0 0 0 2px #3ee0c8, 0 0 12px rgba(62, 224, 200, 0.7); }
  50% { box-shadow: 0 0 0 4px #3ee0c8, 0 0 22px rgba(62, 224, 200, 0.95); }
}

.m3-gem.pop {
  animation: m3Pop 0.2s ease forwards;
}

@keyframes m3Pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); filter: brightness(1.6); }
  100% { transform: scale(0.2); opacity: 0; }
}

@media (max-width: 400px) {
  .m3-board {
    gap: 3px;
    padding: 6px;
  }
}

/* ---------------- 拼图 ---------------- */

.jg-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.jg-preview {
  width: 56px;
  height: 56px;
  border: 2px solid var(--gold-2);
  border-radius: 10px;
  object-fit: cover;
  background: #12092c;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.jg-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.jg-info b {
  color: var(--gold-2);
  font-size: 13px;
}

.jg-board {
  display: grid;
  gap: 4px;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 18px;
  border: 3px solid var(--gold-2);
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 106, 0.04) 0 1px, transparent 1px 14px),
    linear-gradient(160deg, #2b1a5e, #170d38);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
}

.jg-tile {
  padding: 0;
  border: 1px solid rgba(255, 246, 207, 0.12);
  border-radius: 4px;
  background-color: #1a0f38;
  background-repeat: no-repeat;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.jg-tile.sel {
  outline: 3px solid #ffd76a;
  outline-offset: -3px;
  z-index: 1;
}

.jg-tile.ok {
  box-shadow: inset 0 0 0 2px rgba(62, 224, 200, 0.45);
}

@media (max-width: 400px) {
  .jg-board {
    gap: 3px;
    padding: 6px;
  }
  .jg-preview {
    width: 48px;
    height: 48px;
  }
}

/* ---------------- 贪吃蛇 ---------------- */

.sn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.sn-head b {
  color: var(--gold-2);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.sn-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid var(--gold-2);
  border-radius: 20px;
  background: #140a30;
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
  touch-action: none;
}

.sn-pad {
  display: grid;
  grid-template-columns: repeat(3, 62px);
  grid-template-rows: repeat(2, 52px);
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.sn-pad button {
  border: 2px solid rgba(255, 215, 106, 0.55);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  color: var(--gold-1);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.sn-pad button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.sn-pad [data-dir="up"] { grid-column: 2; grid-row: 1; }
.sn-pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.sn-pad [data-dir="down"] { grid-column: 2; grid-row: 2; }
.sn-pad [data-dir="right"] { grid-column: 3; grid-row: 2; }

@media (max-width: 400px) {
  .sn-pad {
    grid-template-columns: repeat(3, 54px);
    grid-template-rows: repeat(2, 46px);
  }
}

/* ---------------- 迷宫 ---------------- */

.mz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.mz-level {
  color: var(--gold-2);
  font-weight: 900;
}

.mz-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid var(--gold-2);
  border-radius: 20px;
  background: #140a30;
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
  touch-action: none;
}

.mz-pad {
  display: grid;
  grid-template-columns: repeat(3, 60px);
  grid-template-rows: repeat(2, 50px);
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.mz-pad button {
  border: 2px solid rgba(255, 215, 106, 0.55);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
  color: var(--gold-1);
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.mz-pad button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.mz-pad [data-dir="up"] { grid-column: 2; grid-row: 1; }
.mz-pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.mz-pad [data-dir="down"] { grid-column: 2; grid-row: 2; }
.mz-pad [data-dir="right"] { grid-column: 3; grid-row: 2; }

/* ---------------- 成语答题 ---------------- */

.cy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.cy-index {
  color: var(--gold-2);
  font-weight: 900;
}

.cy-card {
  padding: 18px 16px 16px;
  border-radius: 18px;
  border: 2px solid rgba(255, 215, 106, 0.55);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(139, 107, 255, 0.25), transparent 60%),
    linear-gradient(160deg, #3a2470, #1d1046);
  box-shadow:
    0 0 0 4px rgba(255, 215, 106, 0.1),
    0 12px 28px rgba(0, 0, 0, 0.4);
}

.cy-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--gold-2);
  font-weight: 800;
}

.cy-meaning {
  margin: 10px 0 18px;
  min-height: 62px;
  font-size: 17px;
  line-height: 1.8;
  color: #fff6e0;
  font-weight: 600;
}

.cy-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cy-option {
  padding: 14px 8px;
  border-radius: 12px;
  border: 2px solid rgba(255, 215, 106, 0.45);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  color: var(--gold-1);
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, background 0.12s ease;
}

.cy-option:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.cy-option.correct {
  background: rgba(62, 224, 200, 0.25);
  border-color: #3ee0c8;
  color: #ffffff;
}

.cy-option.wrong {
  background: rgba(255, 92, 122, 0.25);
  border-color: #ff5c7a;
  color: #ffffff;
}

.cy-option.removed {
  opacity: 0.28;
}

@media (max-width: 400px) {
  .cy-meaning {
    font-size: 15px;
  }
  .cy-option {
    font-size: 14px;
    padding: 12px 6px;
  }
  .mz-pad {
    grid-template-columns: repeat(3, 54px);
    grid-template-rows: repeat(2, 46px);
  }
}

/* ---------------- 连连看 ---------------- */

.lk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.lk-level {
  color: var(--gold-2);
  font-weight: 900;
}

.lk-wrap {
  position: relative;
}

.lk-board {
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 18px;
  border: 3px solid var(--gold-2);
  background:
    repeating-linear-gradient(45deg, rgba(255, 215, 106, 0.04) 0 1px, transparent 1px 14px),
    linear-gradient(160deg, #2b1a5e, #170d38);
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
}

.lk-cell {
  aspect-ratio: 1;
}

.lk-tile {
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 9px;
  border: 2px solid rgba(255, 215, 106, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  font-size: clamp(18px, 6vw, 36px);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow:
    0 3px 0 rgba(0, 0, 0, 0.35),
    inset 0 2px 0 rgba(255, 255, 255, 0.3);
  -webkit-tap-highlight-color: transparent;
}

.lk-tile.sel {
  transform: scale(0.9);
  border-color: #fff6cf;
  box-shadow:
    0 0 0 3px #ffd76a,
    0 0 18px rgba(255, 215, 106, 0.85);
}

.lk-tile.hint {
  animation: lkHint 0.8s ease-in-out infinite;
}

@keyframes lkHint {
  0%, 100% { box-shadow: 0 0 0 2px #3ee0c8, 0 0 12px rgba(62, 224, 200, 0.7); }
  50% { box-shadow: 0 0 0 4px #3ee0c8, 0 0 22px rgba(62, 224, 200, 0.95); }
}

.lk-path {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 3;
}

/* ---------------- 打砖块 ---------------- */

.br-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.br-head b {
  color: var(--gold-2);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.br-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 500 / 600;
  border: 3px solid var(--gold-2);
  border-radius: 20px;
  background: #12092c;
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
  touch-action: none;
}

/* ---------------- 找不同 ---------------- */

.sp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.sp-level {
  color: var(--gold-2);
  font-weight: 900;
}

.sp-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sp-panel {
  position: relative;
}

.sp-tag {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(180deg, #fff1b8, #ffd76a);
  color: #3a2400;
  font-size: 12px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 0 #a86410;
}

.sp-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 500 / 320;
  border: 3px solid var(--gold-2);
  border-radius: 14px;
  background: #140a30;
  box-shadow:
    0 0 0 4px rgba(255, 215, 106, 0.1),
    0 10px 26px rgba(0, 0, 0, 0.45);
  touch-action: manipulation;
}

.sp-canvas.sp-wrong {
  animation: spWrong 0.3s ease;
}

@keyframes spWrong {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  70% { transform: translateX(4px); }
}

@media (max-width: 400px) {
  .lk-board {
    gap: 3px;
    padding: 6px;
  }
}

/* ---------------- 泡泡龙 ---------------- */

.bb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.bb-head b {
  color: var(--gold-2);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.bb-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 500 / 620;
  border: 3px solid var(--gold-2);
  border-radius: 20px;
  background: #12092c;
  box-shadow:
    0 0 0 5px rgba(255, 215, 106, 0.12),
    0 14px 32px rgba(0, 0, 0, 0.5);
  touch-action: none;
}

/* ---------------- 24 点 ---------------- */

.m24-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #a291cf;
}

.m24-index {
  color: var(--gold-2);
  font-weight: 900;
}

.m24-card {
  padding: 16px;
  border-radius: 18px;
  border: 2px solid rgba(255, 215, 106, 0.55);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(139, 107, 255, 0.25), transparent 60%),
    linear-gradient(160deg, #3a2470, #1d1046);
  box-shadow:
    0 0 0 4px rgba(255, 215, 106, 0.1),
    0 12px 28px rgba(0, 0, 0, 0.4);
}

.m24-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold-2);
  font-weight: 800;
}

.m24-nums {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 16px;
}

.m24-chip {
  width: 54px;
  height: 54px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
  color: #3a2400;
  background: linear-gradient(180deg, #fff1b8, #ffd76a 55%, #f2ad33);
  border: 2px solid #fff6cf;
  box-shadow:
    0 4px 0 #a86410,
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
}

.m24-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.m24-option {
  padding: 13px 14px;
  border-radius: 11px;
  border: 2px solid rgba(255, 215, 106, 0.4);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  color: var(--gold-1);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

.m24-option:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

.m24-option.correct {
  background: rgba(62, 224, 200, 0.25);
  border-color: #3ee0c8;
  color: #fff;
}

.m24-option.wrong {
  background: rgba(255, 92, 122, 0.25);
  border-color: #ff5c7a;
  color: #fff;
}

.m24-option.removed {
  opacity: 0.28;
}

@media (max-width: 400px) {
  .m24-chip {
    width: 46px;
    height: 46px;
    font-size: 21px;
  }
  .m24-option {
    font-size: 13px;
    padding: 11px 10px;
  }
}

