/* breakout.css */
/* 打砖块 */
.gcanvas.breakout-cv {
  max-width: 560px;
}
@media (max-width: 420px) {
  .gcanvas.breakout-cv {
    max-width: 100%;
  }
}

/* breath.css */
/* 4-7-8 呼吸放松 */
.breath-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 30px 0;
}
.breath-orb {
  width: min(62vw, 250px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.55);
  transition-property: transform, box-shadow;
  transition-timing-function: cubic-bezier(0.42, 0, 0.2, 1);
  background: radial-gradient(circle at 50% 38%, rgba(31, 111, 235, 0.34) 0%, rgba(31, 111, 235, 0.12) 58%, rgba(31, 111, 235, 0) 100%);
  border: 1px solid var(--line);
  box-shadow: 0 0 34px var(--acc-soft), inset 0 0 42px rgba(31, 111, 235, 0.18);
}
.breath-core {
  text-align: center;
  color: var(--ink);
  user-select: none;
  pointer-events: none;
}
.breath-label {
  font-size: 1.15rem;
  letter-spacing: 0.32em;
  margin-bottom: 6px;
  color: var(--acc);
}
.breath-count {
  font-size: 2.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.breath-hint {
  margin-top: 2px;
  font-size: 0.85rem;
  color: var(--sub);
}

/* cps.css */
/* 手速连点测试 */
.cps-read {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: baseline;
  margin: 4px 0 14px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}
.cps-left {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.2s, transform 0.2s;
}
.cps-left.cps-hot {
  color: #e5484d;
  animation: cps-hot 0.5s ease-in-out infinite;
}
@keyframes cps-hot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.cps-hits {
  font-size: 1.05rem;
}
.cps-pad {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  color: #fff;
  background: radial-gradient(circle at 40% 32%, #4a90ff 0%, var(--acc) 55%, #1450b3 100%);
  box-shadow: 0 10px 24px var(--acc-soft), inset 0 -6px 14px rgba(0, 0, 0, 0.22);
  transition: transform 0.08s, box-shadow 0.12s;
}
.cps-pad:active {
  transform: scale(0.94);
  box-shadow: 0 4px 12px var(--acc-soft), inset 0 -3px 10px rgba(0, 0, 0, 0.28);
}
.cps-pad-label {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.cps-pad.cps-boing {
  animation: cps-boing 0.16s ease-out;
}
@keyframes cps-boing {
  0% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.cps-pad.cps-urgent {
  background: radial-gradient(circle at 40% 32%, #ff6b6b 0%, #e5484d 55%, #b3282d 100%);
  animation: cps-urgent 0.55s ease-in-out infinite;
}
@keyframes cps-urgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.cps-graph {
  max-width: 320px;
  margin-top: 16px;
  opacity: 0.92;
}

/* g2048.css */
/* 2048 数字合成 */
.g2048-wrap {
  position: relative;
  width: min(92vw, 420px);
  touch-action: none; /* 棋盘上的滑动只用于游戏，不带页面滚动 */
}
.g2048-board {
  width: 100%;
  max-width: none;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  background: #e6eaf1;
}
.g2048-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(28, 32, 36, 0.07);
}
.g2048-tile {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #2b3646;
  background: transparent;
  font-size: clamp(18px, 7.6vw, 34px);
  line-height: 1;
}
/* 数字位数越多字越小，保证 4 位数在 360px 屏内不溢出 */
.g2048-tile.d3 { font-size: clamp(16px, 6.4vw, 29px); }
.g2048-tile.d4 { font-size: clamp(14px, 5.2vw, 24px); }

/* 浅色档：2-64 */
.g2048-tile.v2 { background: #f0f3f9; }
.g2048-tile.v4 { background: #e4ebf6; }
.g2048-tile.v8 { background: #d2e2f4; }
.g2048-tile.v16 { background: #bad5ef; }
.g2048-tile.v32 { background: #9fc6e9; }
.g2048-tile.v64 { background: #82b5e1; }

/* 高亮档：128 起，白字 + 微光 */
.g2048-tile.v128,
.g2048-tile.v256,
.g2048-tile.v512,
.g2048-tile.v1024,
.g2048-tile.v2048,
.g2048-tile.vbig {
  color: #fff;
  text-shadow: 0 1px 2px rgba(20, 40, 80, 0.25);
}
.g2048-tile.v128 { background: #f2a93b; }
.g2048-tile.v256 { background: #ef8f2f; }
.g2048-tile.v512 { background: #e8672e; }
.g2048-tile.v1024 { background: #d94f3d; }
.g2048-tile.v2048 { background: #1f6feb; box-shadow: 0 0 12px rgba(31, 111, 235, 0.55); }
.g2048-tile.vbig { background: #b3261e; box-shadow: 0 0 14px rgba(179, 38, 30, 0.5); }

/* 动画：新方块淡入放大，合并方块弹一下 */
.g2048-pop { animation: g2048-in 0.16s ease-out; }
.g2048-merge { animation: g2048-bump 0.18s ease-out; }
@keyframes g2048-in {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes g2048-bump {
  0% { transform: scale(1); }
  50% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* 未开始的遮罩层（隐藏时靠全局 [hidden] 规则） */
.g2048-over {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(246, 247, 249, 0.86);
  backdrop-filter: blur(1px);
}
.g2048-start { font-size: 16px; padding: 12px 26px; border-radius: 12px; }

/* 撤销按钮禁用态（只限定自己的按钮，不动公共 .gbtn） */
.g2048-undo:disabled { opacity: 0.45; cursor: not-allowed; }
.g2048-undo:disabled:hover { border-color: var(--line); color: var(--ink); background: #fff; }

/* memory.css */
/* 翻牌记忆配对 */
.memory-stats {
  width: 100%;
  max-width: 430px;
  text-align: center;
  font-size: 13px;
  color: var(--sub);
}
.memory-board {
  max-width: 430px;
  gap: 8px;
}
.memory-locked .memory-card {
  pointer-events: none;
  opacity: 0.55;
  filter: saturate(0.6);
}
.memory-card {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 520px;
}
.memory-card:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
  border-radius: 12px;
}
.memory-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}
.memory-card.memory-flipped .memory-inner,
.memory-card.memory-matched .memory-inner {
  transform: rotateY(180deg);
}
.memory-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-weight: 700;
  font-size: clamp(15px, 4.6vw, 24px);
}
.memory-back {
  background: linear-gradient(145deg, var(--acc-soft), #d9e8fb);
  border: 1px solid var(--line);
  color: var(--acc);
}
.memory-card:hover .memory-back {
  border-color: var(--acc);
}
.memory-front {
  background: var(--card);
  border: 1px solid var(--acc);
  color: var(--ink);
  transform: rotateY(180deg);
}
.memory-card.memory-on .memory-front {
  border-color: var(--ok);
  background: #eafaf2;
  color: var(--ok);
  animation: memory-land 0.32s ease-out;
}
@keyframes memory-land {
  0% { transform: rotateY(180deg) scale(1.12); }
  100% { transform: rotateY(180deg) scale(1); }
}
@media (max-width: 420px) {
  .memory-board { gap: 6px; }
}

/* mines.css */
/* 扫雷 */
.mines-stats {
  width: min(92vw, 520px);
  text-align: center;
  font-size: 13px;
  color: var(--sub);
}
.mines-board {
  width: min(92vw, 520px);
  max-width: 520px;
  gap: 4px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.mines-cell {
  aspect-ratio: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: linear-gradient(160deg, #e9f0f9, #d3e1f2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(11px, 2.6vw, 15px);
  line-height: 1;
  cursor: pointer;
}
.mines-cell:hover:not(.mines-open) {
  border-color: var(--acc);
  background: var(--acc-soft);
}
.mines-cell:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 1px;
}
.mines-cell.mines-open {
  background: #f3f5f8;
  border-color: #e2e6eb;
  box-shadow: none;
  cursor: pointer;
}
.mines-cell.mines-flag {
  color: var(--warn);
}
.mines-n1 { color: #1f6feb; }
.mines-n2 { color: #0f7b4f; }
.mines-n3 { color: #b3261e; }
.mines-n4 { color: #1e3a8a; }
.mines-n5 { color: #7c2d12; }
.mines-n6 { color: #0e7490; }
.mines-n7 { color: #1c2024; }
.mines-n8 { color: #666e78; }
.mines-cell.mines-boom {
  background: #fde8e6;
  border-color: #b3261e;
  color: #b3261e;
}
.mines-cell.mines-revealed {
  background: #f6d7d3;
  border-color: #e2b4ae;
  color: #8a1f1a;
}
.mines-cell.mines-hint {
  box-shadow: 0 0 0 2px var(--acc);
  animation: mines-pulse 1s ease-in-out infinite;
}
@keyframes mines-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--acc); }
  50% { box-shadow: 0 0 0 2px var(--acc), 0 0 10px 2px var(--acc-soft); }
}
@media (min-width: 560px) {
  .mines-board { gap: 5px; }
}

/* popit.css */
/* 泡泡纸捏捏乐 */
.gpop { max-width: 430px; gap: 10px; }
.bubble {
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid #d6e1f0;
  border-radius: 50%;
  cursor: pointer;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.09s, box-shadow 0.12s, background 0.12s;
  background: radial-gradient(circle at 33% 27%, #fff 0 16%, #eaf1fb 44%, #c9dbf3 100%);
  box-shadow: inset 0 -5px 9px rgba(120, 150, 190, 0.3), 0 1px 2px rgba(20, 40, 80, 0.12);
}
.bubble:hover { transform: rotate(var(--tilt, 0deg)) scale(1.07); }
.bubble:active { transform: rotate(var(--tilt, 0deg)) scale(0.97); }
.bubble.burst {
  background: radial-gradient(circle at 50% 46%, #f0f4fa 0 38%, #dae4f1 100%);
  box-shadow: inset 0 4px 9px rgba(120, 150, 190, 0.4);
  transform: rotate(var(--tilt, 0deg)) scale(0.93);
  animation: popit-burst 0.22s ease-out;
}
@keyframes popit-burst {
  0% { transform: rotate(var(--tilt, 0deg)) scale(1.12); }
  100% { transform: rotate(var(--tilt, 0deg)) scale(0.93); }
}

/* react.css */
/* 反应速度测试 */
.react-panel {
  width: 100%;
  max-width: min(92vw, 440px);
  min-height: clamp(150px, 40vw, 210px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #eaeff7;
  color: #1c2024;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s, transform 0.09s;
}
.react-panel:active { transform: scale(0.99); }
.react-panel:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.react-title { font-size: clamp(22px, 7vw, 34px); font-weight: 800; line-height: 1.25; text-align: center; }
.react-tip { font-size: 12.5px; opacity: 0.82; text-align: center; }
.react-panel.react-s-wait {
  background: #c8302b;
  border-color: #a5251f;
  color: #fff;
}
.react-panel.react-s-foul {
  background: #8c2018;
  border-color: #6d1811;
  color: #fff;
  animation: react-shake 0.3s ease-out;
}
.react-panel.react-s-go {
  background: #17a25b;
  border-color: #10753f;
  color: #fff;
}
.react-panel.react-s-go .react-title { animation: react-pulse 0.5s ease-out; }
.react-panel.react-s-result,
.react-panel.react-s-done {
  background: #f2f6fb;
  border-color: #cfe0fb;
  color: #1c2024;
}
@keyframes react-shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}
@keyframes react-pulse {
  0% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.react-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  font-size: 12.5px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}
.react-slots {
  max-width: 440px;
  gap: 6px;
}
.react-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.react-slot-i { font-size: 11px; color: var(--sub); }
.react-slot-v {
  font-size: clamp(12px, 3.6vw, 15px);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.react-slot.react-hit { border-color: #b9d4f7; background: var(--acc-soft); }
.react-slot.react-best { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc) inset; }
.react-slot.react-best .react-slot-v { color: var(--acc); }

/* snake.css */
/* 贪吃蛇 */
.gcanvas.snake-cv {
  max-width: 400px;
}
@media (max-width: 420px) {
  .gcanvas.snake-cv {
    max-width: 100%;
  }
}

/* stroop.css */
/* 颜色干扰挑战 */
.stroop-wordbox {
  width: 100%;
  max-width: min(92vw, 440px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.stroop-ask { font-size: 12.5px; color: var(--sub); text-align: center; }
.stroop-word {
  font-size: clamp(64px, 22vw, 132px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
  transition: color 0.1s;
}
.stroop-wordbox.stroop-flash { animation: stroop-shake 0.26s ease-out; border-color: #c8302b; }
@keyframes stroop-shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
.stroop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  font-size: 12.5px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}
.stroop-time.stroop-low { color: #c8302b; font-weight: 700; }
.stroop-answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: min(92vw, 440px);
}
@media (min-width: 520px) {
  .stroop-answers { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stroop-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s, background 0.12s, transform 0.09s;
}
.stroop-btn:hover:not(:disabled) { border-color: var(--acc); background: var(--acc-soft); }
.stroop-btn:active:not(:disabled) { transform: scale(0.97); }
.stroop-btn:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.stroop-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.stroop-dot {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
}
.stroop-bname { line-height: 1; }
.stroop-bkey {
  font-size: 11px;
  font-weight: 600;
  color: var(--sub);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 4px;
  line-height: 1.2;
}
