/* 时钟识别 v2 · 表盘与答题区 */

.mode-seg { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.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; }

.clock-stage {
  width: min(100%, 520px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.8vh, 16px);
}
.clock-question {
  margin: 0;
  font-family: var(--font-hand);
  font-size: var(--fs-lg);
  color: var(--pumpkin-deep);
  text-align: center;
  line-height: 1.3;
}
.clock-face {
  width: min(100%, 400px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  filter: drop-shadow(0 7px 0 rgba(90, 74, 58, 0.18));
}
.clock-face svg { display: block; width: 100%; height: 100%; }

.clock-options {
  width: min(100%, 400px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.clock-option {
  min-height: 58px;
  padding: 8px 10px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 4px 0 var(--paper-deep), 0 5px 0 var(--ink);
  font-family: var(--font-num);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform var(--dur-fast), background var(--dur-fast), box-shadow var(--dur-fast);
}
.clock-option:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--paper-deep), 0 2px 0 var(--ink); }
.clock-option.is-correct { background: var(--mint); }
.clock-option.is-wrong { background: var(--cherry); }
.clock-option:disabled { pointer-events: none; }

.clock-adjust {
  width: min(100%, 400px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.clock-adjust-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--r-md);
  box-shadow: 0 4px 0 var(--paper-deep), 0 5px 0 var(--ink);
}
.clock-adjust-row .label {
  font-family: var(--font-hand);
  font-size: var(--fs-sm);
  color: var(--ink-soft);
}
.clock-adjust-btns { display: flex; gap: 7px; }
.clock-adjust-btn {
  width: 48px;
  height: 44px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--paper-warm);
  box-shadow: 0 3px 0 var(--paper-deep), 0 4px 0 var(--ink);
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}
.clock-adjust-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--paper-deep), 0 1px 0 var(--ink); }
.clock-adjust-btn.is-correct { background: var(--mint); }
.clock-adjust-btn.is-wrong { background: var(--cherry); }
.clock-confirm { margin-top: 2px; }

@media (max-width: 859px) {
  .clock-stage { width: min(100%, 430px); gap: 9px; }
  .clock-face { width: min(100%, 330px); }
  .clock-options, .clock-adjust { width: min(100%, 330px); }
  .clock-option { min-height: 52px; font-size: var(--fs-md); }
  .clock-question { font-size: var(--fs-md); }
  .clock-adjust-btn { width: 44px; height: 40px; font-size: 21px; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .clock-stage { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px; }
  .clock-question { width: 100%; }
  .clock-face { width: min(42vw, 250px); }
  .clock-options, .clock-adjust { width: min(50vw, 300px); }
  .clock-option { min-height: 42px; font-size: var(--fs-sm); }
}

.setup__block--mode {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

@media (min-width: 900px) {
  .screen--play .stage { justify-content: flex-start; padding-top: 32px; }
  .screen--play .stats { margin-top: 32px; }
}

@media (max-width: 760px) {
  .setup { gap: 8px; }
  .setup__block { padding: 10px; gap: 6px; }
  .diff { min-height: 54px; }
}

@media (max-width: 760px) {
  .setup__block--mode {
    display: flex;
    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-sm); }
}
@media (max-width: 380px) {
  .subtitle { display: none; }
}
@media (max-width: 340px) and (max-height: 620px) {
  .diff__meta { display: none; }
  .diff { min-height: 44px; }
}
@media (max-width: 760px) {
  .setup__block--mode { flex-direction: row; }
}
@media (max-width: 340px) and (max-height: 620px) {
  .btn--lg { min-height: 64px; }
}
@media (max-width: 340px) and (max-height: 620px) {
  .setup { gap: 4px; }
}

@media (min-width: 860px) and (max-height: 820px) {
  .clock-stage { gap: 8px; }
  .clock-face { width: min(100%, 330px); }
  .clock-options, .clock-adjust { width: min(100%, 330px); }
  .clock-option { min-height: 48px; font-size: var(--fs-md); }
}

/* 玩法切换：保留双色填充，选中恢复原来的描边 + 硬阴影 */
.mode-seg .seg__btn {
  position: relative;
  background-clip: padding-box;
  color: var(--ink);
  opacity: 1;
  filter: none;
  transition: transform var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.mode-seg .seg__btn[data-mode="read"] { background: var(--sky); }
.mode-seg .seg__btn[data-mode="set"] { background: var(--sunny); }
.mode-seg .seg__btn[aria-checked="true"] {
  background: var(--mode-bg, var(--sky));
  border-color: var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  transform: translateY(-1px);
}
.mode-seg .seg__btn[data-mode="read"][aria-checked="true"] { --mode-bg: var(--sky); }
.mode-seg .seg__btn[data-mode="set"][aria-checked="true"] { --mode-bg: var(--sunny); }

/* 极窄屏：压缩纵向间距，给左下角版本号腾出一行 */
@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; }
}
