/* 划消测试 · 样式（.g-cancel 前缀） */

.g-cancel {
  padding-left: 12px;
  padding-right: 12px;
  gap: 10px;
}

.g-cancel .cg-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ---------------- 初始界面 ---------------- */
.g-cancel .cg-idle {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  padding: 20px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  text-align: center;
  overflow-y: auto;
}
.g-cancel .cg-idle-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  font-size: 32px;
  font-weight: 900;
  color: #0b2812;
  background: linear-gradient(150deg, var(--accent), var(--accent2));
  box-shadow: 0 12px 30px -12px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.g-cancel .cg-idle-title { font-size: 21px; font-weight: 800; }
.g-cancel .cg-idle-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
  max-width: 30em;
  margin: 0 auto;
}
.g-cancel .cg-label { font-size: 10.5px; letter-spacing: 0.12em; color: var(--faint); margin-top: 2px; }
.g-cancel .cg-seg .seg { width: 100%; }
.g-cancel .cg-diff-desc { font-size: 11.5px; color: var(--dim); min-height: 17px; }
.g-cancel .cg-bests { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 7px; }
.g-cancel .cg-best-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 10px;
  font-variant-numeric: tabular-nums;
}
.g-cancel .cg-best-chip.on {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.g-cancel .cg-rule { font-size: 11px; line-height: 1.6; color: var(--faint); }
.g-cancel .cg-rule b { color: var(--accent); font-weight: 700; }
.g-cancel .cg-resume { margin-top: 0; }

/* ---------------- 进行中 ---------------- */
.g-cancel .cg-play {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.g-cancel .cg-target {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  background:
    radial-gradient(120% 180% at 10% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 62%),
    rgba(255, 255, 255, 0.03);
  flex: none;
}
.g-cancel .cg-target-sym {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  background: rgba(126, 231, 135, 0.1);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 0 20px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  flex: none;
}
.g-cancel .cg-target-text { min-width: 0; text-align: left; }
.g-cancel .cg-target-line { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.g-cancel .cg-target-line b { color: var(--accent); font-size: 16px; }
.g-cancel .cg-target-sub { font-size: 10.5px; color: var(--faint); margin-top: 2px; }

.g-cancel .cg-stats { grid-template-columns: repeat(3, 1fr); }
.g-cancel .cg-stats .stat { padding: 6px 6px; }
.g-cancel .stat-v.low { color: var(--err); animation: cgPulse 0.9s ease-in-out infinite; }
@keyframes cgPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.g-cancel .cg-progress { height: 6px; flex: none; }
.g-cancel .cg-progress > i { transition: width 0.12s linear; }

.g-cancel .cg-grid {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 0 auto;
  flex: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  font-size: 28px;
}
.g-cancel .cg-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.03));
  color: var(--text);
  line-height: 1;
  font-size: inherit;
  transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease, transform 0.12s ease;
}
.g-cancel .cg-sym { display: block; font-size: inherit; line-height: 1; }
.g-cancel .cg-cell.crossed {
  opacity: 0.24;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.015);
  border-color: rgba(255, 255, 255, 0.04);
}
.g-cancel .cg-cell.crossed .cg-sym { text-decoration: line-through; text-decoration-color: rgba(62, 207, 142, 0.65); }
.g-cancel .cg-cell.just { animation: cgCross 0.12s ease both; }
.g-cancel .cg-cell.wrong {
  background: rgba(255, 92, 108, 0.26);
  border-color: rgba(255, 92, 108, 0.8);
  animation: cgWrong 0.28s ease;
}
@keyframes cgCross {
  0% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 0.4; }
  100% { transform: scale(1); opacity: 0.24; }
}
@keyframes cgWrong {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-3px); }
  70% { transform: translateX(3px); }
}

.g-cancel .cg-hint { text-align: center; font-size: 10.5px; }

/* ---------------- 结算 ---------------- */
.g-cancel .cg-result {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 18px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(110% 70% at 50% 0%, color-mix(in srgb, var(--accent) 15%, transparent), transparent 60%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  text-align: center;
  overflow-y: auto;
}
.g-cancel .cg-result-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--dim);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 12px;
}
.g-cancel .cg-result-badge.record {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: 0 0 20px -8px var(--accent);
}
.g-cancel .cg-result-k { font-size: 11.5px; color: var(--faint); }
.g-cancel .cg-result-score { display: flex; align-items: baseline; gap: 4px; margin-top: -2px; }
.g-cancel .cg-score-n {
  font-size: 62px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(130deg, #dcffe4, var(--accent) 55%, var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent));
}
.g-cancel .cg-score-k { font-size: 14px; color: var(--faint); }
.g-cancel .cg-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.g-cancel .cg-result-grid .stat { background: rgba(255, 255, 255, 0.04); }
.g-cancel .cg-result-actions { display: flex; gap: 8px; width: 100%; margin-top: 2px; }
.g-cancel .cg-result-actions .btn { flex: 1; min-height: 46px; }

@media (max-height: 700px) {
  .g-cancel .cg-idle-icon { width: 52px; height: 52px; font-size: 26px; border-radius: 16px; }
  .g-cancel .cg-rule { display: none; }
  .g-cancel .cg-play { gap: 6px; }
  .g-cancel .cg-target { padding: 6px 10px; }
  .g-cancel .cg-target-sym { width: 48px; height: 48px; font-size: 36px; }
  .g-cancel .cg-hint { display: none; }
  .g-cancel .cg-grid { gap: 3px; }
  .g-cancel .cg-score-n { font-size: 52px; }
}
