/* 斯特鲁普 · 样式（.g-stroop 前缀） */

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

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

/* ---------------- 模式选择 ---------------- */
.g-stroop .s-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-stroop .s-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-stroop .s-idle-title { font-size: 21px; font-weight: 800; letter-spacing: 0.01em; }
.g-stroop .s-idle-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
  max-width: 30em;
  margin: 0 auto;
}
.g-stroop .s-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--faint);
  margin-top: 2px;
}
.g-stroop .s-seg .seg { width: 100%; }
.g-stroop .s-mode-desc { font-size: 11.5px; color: var(--dim); min-height: 17px; }
.g-stroop .s-bests {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}
.g-stroop .s-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-stroop .s-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-stroop .s-rule { font-size: 11px; line-height: 1.6; color: var(--faint); }
.g-stroop .s-rule b { color: var(--accent); font-weight: 700; }
.g-stroop .s-resume { margin-top: 0; }

/* ---------------- 游戏进行中 ---------------- */
.g-stroop .s-play {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.g-stroop .s-progress { height: 6px; flex: none; }
.g-stroop .s-progress > i { transition: width 0.12s linear; }
.g-stroop .stat-v.low { color: var(--err); animation: sPulse 0.9s ease-in-out infinite; }
.g-stroop .stat-v.hot { color: var(--accent); }

.g-stroop .s-word-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.g-stroop .s-tag-row { display: flex; align-items: center; justify-content: center; }
.g-stroop .s-tag {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
  background: var(--surface);
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.g-stroop .s-tag.is-color {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
}
.g-stroop .s-tag.is-word {
  color: #8fc2ff;
  border-color: rgba(121, 184, 255, 0.42);
  background: rgba(121, 184, 255, 0.1);
}
.g-stroop .s-tag.is-mix { box-shadow: 0 0 18px -6px currentColor; }

.g-stroop .s-word-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
}
.g-stroop .s-word-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(78vw, 300px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 42%, transparent 68%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 58%);
  border: 1px solid rgba(255, 255, 255, 0.045);
  pointer-events: none;
}
.g-stroop .s-word {
  position: relative;
  z-index: 1;
  font-size: clamp(64px, 23vw, 108px);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-indent: 0.06em;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
  transition: filter 0.12s ease;
  will-change: transform;
}
.g-stroop .s-word.ok { animation: sWordOk 0.3s cubic-bezier(0.3, 1.4, 0.4, 1); }
.g-stroop .s-word.bad { filter: brightness(1.25) saturate(1.2); }

@keyframes sWordOk {
  0% { transform: scale(1); }
  45% { transform: scale(1.09); }
  100% { transform: scale(1); }
}
@keyframes sPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.g-stroop .s-float-box {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  z-index: 2;
}
.g-stroop .s-float {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
  animation: sFloatUp 0.62s ease-out forwards;
  pointer-events: none;
}
.g-stroop .s-float.ok { color: var(--ok); text-shadow: 0 0 16px rgba(62, 207, 142, 0.55); }
.g-stroop .s-float.bad { color: #ff8b96; text-shadow: 0 0 16px rgba(255, 92, 108, 0.5); }
@keyframes sFloatUp {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(0.8); }
  25% { opacity: 1; transform: translate(-50%, -2px) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -42px) scale(1); }
}

.g-stroop .s-feedback {
  min-height: 19px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--faint);
  text-align: center;
  transition: color 0.16s;
}
.g-stroop .s-feedback.ok { color: var(--ok); font-weight: 600; }
.g-stroop .s-feedback.bad { color: #ff8b96; }

.g-stroop .s-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: none;
}
.g-stroop .s-ans {
  position: relative;
  height: clamp(66px, 19vw, 84px);
  min-height: 64px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  overflow: hidden;
  touch-action: manipulation;
  transition: transform 0.1s ease, box-shadow 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}
.g-stroop .s-ans:active { transform: scale(0.96); }
.g-stroop .s-swatch {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 -10px 24px rgba(0, 0, 0, 0.18);
}
.g-stroop .s-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(90% 70% at 30% 16%, rgba(255, 255, 255, 0.25), transparent 60%);
  pointer-events: none;
}
.g-stroop .s-name {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  color: var(--text);
}
.g-stroop .s-name-t {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
}
.g-stroop .s-ans.ok {
  border-color: rgba(62, 207, 142, 0.9);
  box-shadow: 0 0 0 3px rgba(62, 207, 142, 0.24), 0 0 26px -4px rgba(62, 207, 142, 0.55);
  transform: scale(1.03);
}
.g-stroop .s-ans.bad {
  border-color: rgba(255, 92, 108, 0.9);
  box-shadow: 0 0 0 3px rgba(255, 92, 108, 0.2);
  animation: sShakeX 0.28s ease;
}
.g-stroop .s-ans.right-hint {
  outline: 2px dashed rgba(62, 207, 142, 0.9);
  outline-offset: -6px;
}
@keyframes sShakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  55% { transform: translateX(4px); }
  80% { transform: translateX(-2px); }
}

/* ---------------- 结算 ---------------- */
.g-stroop .s-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-stroop .s-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-stroop .s-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-stroop .s-result-mode { font-size: 12px; color: var(--faint); }
.g-stroop .s-result-score { display: flex; align-items: baseline; gap: 5px; }
.g-stroop .s-score-n {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(130deg, #d8ffe2, 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) 32%, transparent));
}
.g-stroop .s-score-k { font-size: 14px; color: var(--faint); }
.g-stroop .s-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}
.g-stroop .s-result-grid .stat { background: rgba(255, 255, 255, 0.04); }
.g-stroop .s-result-best { font-size: 11px; color: var(--faint); line-height: 1.5; }
.g-stroop .s-result-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}
.g-stroop .s-result-actions .btn { flex: 1; min-height: 46px; }

@media (max-height: 700px) {
  .g-stroop .s-idle-icon { width: 52px; height: 52px; font-size: 26px; border-radius: 16px; }
  .g-stroop .s-rule { display: none; }
  .g-stroop .s-word-wrap { min-height: 96px; }
  .g-stroop .s-word-wrap::before { width: min(64vw, 230px); }
  .g-stroop .s-ans { height: 62px; min-height: 60px; }
  .g-stroop .s-score-n { font-size: 52px; }
}
