/* 镜像对称 v2 · 折纸 / 卡片 / 镜像绘制 */

.mode-seg--three { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.mode-seg .seg__btn[data-mode="mirror"] { background: var(--sky); }
.mode-seg .seg__btn[data-mode="fold"] { background: var(--mint); }
.mode-seg .seg__btn[data-mode="card"] { background: var(--sunny); }
.mode-seg .seg__btn[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); transform: translateY(-1px); }
.side-label { margin-top: 2px; font-family: var(--font-hand); font-size: var(--fs-sm); color: var(--ink-soft); }
.side-actions--single { grid-template-columns: 1fr !important; }
.setup__block--mode { background: transparent; border: 0; box-shadow: none; padding: 0; }

.sym-stage {
  width: min(100%, 640px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(7px, 1.3vh, 12px);
}
.sym-badge {
  padding: 3px 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sky-soft, #E3F0FA);
  font-family: var(--font-hand);
  font-size: var(--fs-sm);
  color: var(--ink);
}
.sym-question {
  margin: 0;
  font-family: var(--font-hand);
  font-size: clamp(16px, 2.1vh, 20px);
  line-height: 1.45;
  color: var(--ink);
  text-align: center;
}
.sym-label { margin: 0; font-family: var(--font-hand); font-size: var(--fs-xs); color: var(--ink-soft); }
.sym-grid-box {
  width: min(100%, 460px);
  display: flex;
  justify-content: center;
  padding: 8px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 3px 0 var(--paper-deep), 0 4px 0 var(--ink);
}
.sym-grid-box svg { display: block; width: 100%; height: auto; max-width: 100%; }

.sym-fold-opts {
  width: min(100%, 500px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.sym-fold-opt {
  padding: 4px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: var(--r-sm);
  box-shadow: 0 3px 0 var(--paper-deep), 0 4px 0 var(--ink);
  cursor: pointer;
}
.sym-fold-opt svg { display: block; width: 100%; height: auto; }
.sym-fold-opt.is-correct, .sym-fold-opt.is-correct-hint { background: var(--mint); }
.sym-fold-opt.is-wrong { background: var(--cherry); }

.sym-card-layout {
  width: min(100%, 620px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sym-card-side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sym-card-side .sym-grid-box { width: 100%; padding: 5px; }
.sym-card-result { width: min(100%, 460px); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sym-card-opts {
  width: min(100%, 400px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.sym-opt {
  min-height: 52px;
  border: 2.5px solid var(--ink);
  border-radius: var(--r-sm);
  background: var(--paper);
  box-shadow: 0 3px 0 var(--paper-deep), 0 4px 0 var(--ink);
  font-family: var(--font-num);
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}
.sym-opt.is-correct, .sym-opt.is-correct-hint { background: var(--mint); }
.sym-opt.is-wrong { background: var(--cherry); }

.sym-mirror-grid {
  width: min(100%, 430px);
  display: flex;
  justify-content: center;
  padding: 7px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 3px 0 var(--paper-deep), 0 4px 0 var(--ink);
}
.sym-mirror-grid svg { display: block; width: 100%; height: auto; max-width: 100%; }
.sym-mirror-status { font-family: var(--font-hand); font-size: var(--fs-sm); color: var(--ink-soft); }
.sym-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sym-next { margin-top: 2px; }

@media (min-width: 900px) {
  .screen--play .stage { justify-content: flex-start; padding-top: 32px; }
  .screen--play .stats { margin-top: 32px; }
}
@media (max-width: 859px) {
  .sym-stage { width: min(100%, 430px); gap: 6px; }
  .sym-grid-box { width: min(100%, 360px); padding: 5px; }
  .sym-fold-opts { width: min(100%, 360px); gap: 5px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sym-card-layout { width: min(100%, 360px); gap: 6px; }
  .sym-card-result { width: min(100%, 340px); }
  .sym-card-opts { width: min(100%, 340px); }
  .sym-opt { min-height: 46px; font-size: var(--fs-md); }
  .sym-mirror-grid { width: min(100%, 360px); }
  .sym-question { font-size: var(--fs-sm); }
}
@media (max-width: 760px) {
  .setup__block--mode { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 0; }
  .setup__block--mode .setup__label { flex: 0 0 auto; margin: 0; }
  .setup__block--mode .seg { flex: 1; }
  .setup__block--mode .seg__btn { min-height: 38px; font-size: var(--fs-xs); }
  .setup { gap: 8px; }
  .setup__block { padding: 10px; gap: 6px; }
  .diff { min-height: 54px; }
}
@media (max-width: 380px) {
  .subtitle { display: none; }
  .setup__block--mode .setup__label { display: none; }
  .setup__block--mode .seg { padding: 3px; }
  .setup__block--mode .seg__btn { height: 36px; min-height: 36px; padding: 2px 3px; font-size: 11px; }
}
@media (max-width: 340px) and (max-height: 620px) {
  .diff__meta { display: none; }
  .diff { min-height: 44px; }
  .btn--lg { min-height: 64px; }
  .setup { gap: 4px; }
}
@media (max-width: 760px) {
  .setup__block--mode { padding: 0; }
}

/* 折纸 / 卡片尺寸适当缩小 */
.sym-grid-box { width: min(100%, 360px); }
.sym-fold-opts { width: min(100%, 400px); }
.sym-card-layout { width: min(100%, 520px); }
.sym-card-result { width: min(100%, 340px); }
.sym-card-result .sym-grid-box { width: 100%; }
.sym-card-opts { width: min(100%, 380px); }

@media (max-width: 859px) {
  .sym-grid-box { width: min(100%, 300px); }
  .sym-fold-opts { width: min(100%, 300px); }
  .sym-card-layout { width: min(100%, 300px); }
  .sym-card-result { width: min(100%, 280px); }
  .sym-card-opts { width: min(100%, 300px); }
}

/* 折纸动画 */
.sym-anim-btn { align-self: center; }
.sym-anim-overlay { z-index: 80; }
.sym-anim-modal {
  width: min(92vw, 680px);
  max-height: 92vh;
  overflow: auto;
  padding: clamp(12px, 2vh, 20px);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 0 var(--ink);
}
.sym-anim-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sym-anim-head h3 { margin: 0; font-family: var(--font-hand); font-size: var(--fs-lg); color: var(--ink); }
.sym-anim-head .icon-btn { width: 38px; height: 38px; flex: 0 0 38px; font-size: 22px; }
.sym-anim-tip { margin: 6px 0 10px; font-family: var(--font-hand); font-size: var(--fs-sm); color: var(--ink-soft); text-align: center; }
.sym-anim-stage { margin: 0 auto; width: 100%; max-width: 100%; }
.sym-anim-stage svg { display: block; width: 100%; height: 100%; }
.sym-anim-quad { transition: transform 1.6s cubic-bezier(0.4, 0, 0.2, 1); transform-origin: 0 0; }
.sym-anim-controls { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.sym-actions { align-items: center; }
.sym-actions { flex-wrap: nowrap; width: 100%; }
.sym-actions .btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }

/* 操作按钮缩小，总宽与折纸选项一致 */
.sym-actions { width: min(100%, 400px); margin: 0 auto; }
.sym-actions .btn {
  height: 52px;
  min-height: 52px;
  font-size: var(--fs-sm);
  padding-left: 7px;
  padding-right: 7px;
}
@media (max-width: 859px) {
  .sym-actions { width: min(100%, 300px); }
  .sym-actions .btn { height: 48px; min-height: 48px; font-size: var(--fs-xs); }
}

/* 卡片模式：卡片格与答案方块同尺寸 */
.sym-card-side .sym-grid-box,
.sym-card-result .sym-grid-box {
  width: auto;
  max-width: 100%;
}
.sym-card-side .sym-grid-box svg,
.sym-card-result .sym-grid-box svg {
  width: auto;
  max-width: 100%;
  height: auto;
}
.sym-card-opts {
  width: auto;
  justify-content: center;
  grid-template-columns: repeat(4, 56px);
}
.sym-card-opts .sym-opt {
  width: 56px;
  height: 56px;
  min-height: 56px;
  padding: 0;
}
.sym-stage[data-difficulty="normal"] .sym-card-opts { grid-template-columns: repeat(4, 48px); }
.sym-stage[data-difficulty="normal"] .sym-card-opts .sym-opt { width: 48px; height: 48px; min-height: 48px; font-size: var(--fs-md); }
.sym-stage[data-difficulty="hard"] .sym-card-opts { grid-template-columns: repeat(4, 42px); }
.sym-stage[data-difficulty="hard"] .sym-card-opts .sym-opt { width: 42px; height: 42px; min-height: 42px; font-size: var(--fs-sm); }

@media (max-width: 859px) {
  .sym-card-layout { width: auto; }
  .sym-card-opts { width: auto; }
}

/* 极窄屏：压缩纵向间距，给左下角版本号腾出一行 */
@media (max-width: 380px) {
  .screen--start { padding-bottom: 26px; }
  .app-version { left: 8px; bottom: 5px; font-size: 9px; padding: 1px 5px; }
  .setup { gap: 3px; }
  .setup__block { padding: 6px; gap: 4px; }
  .diff-list { gap: 5px; }
  .diff { min-height: 40px; padding: 4px 8px; }
  .diff__name small, .setup__label-note { display: none; }
  .app-title { font-size: clamp(26px, 8vw, 32px); }
  .btn--lg { min-height: 52px; }
  .hero__card { width: min(150px, 44vw); padding: 7px; }
  .hero__caption, .hero__float { display: none; }
  .subtitle { display: none; }
}

/* 极窄屏：难度卡进一步压缩 */
@media (max-width: 340px) {
  .diff { min-height: 40px; padding: 4px 8px; gap: 8px; }
  .diff__mini { width: 26px; height: 26px; border-radius: 7px; }
  .diff__name { font-size: var(--fs-sm); }
  .diff__best { font-size: 10px; }
}

/* 极窄屏：玩法切换与难度区再压一档 */
@media (max-width: 380px) {
  .setup__block--mode { margin: 0; }
  .setup__block--mode .seg { padding: 2px; }
  .setup__block--mode .seg__btn { height: 34px; min-height: 34px; font-size: 10.5px; }
  .setup__block { padding: 5px; gap: 3px; }
  .setup__label { font-size: 10px; }
  .diff { min-height: 38px; padding: 3px 7px; }
  .diff__mini { width: 24px; height: 24px; }
  .diff__best { display: none; }
  .btn--lg { min-height: 50px; }
  .screen--start { padding-bottom: 24px; }
}
