/* 数感小镇 · 本程序专用样式（不覆盖 shared styles.css 的既有 API） */

/* ---------------- 首页 ---------------- */
.hero {
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(160deg, #e5fff9, #fff8e8 70%);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -26px;
  top: -30px;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: rgba(47, 201, 180, 0.18);
  pointer-events: none;
}
.hero__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.hero__title {
  font-size: clamp(23px, 5.4vw, 34px);
  font-weight: 800;
  line-height: 1.25;
}
.hero__text { max-width: 44ch; }
.hero__actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.hero__tour { flex: 1 1 190px; }
.hero__help { flex: 0 0 auto; }
.hero__best {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.hero__best-stars { display: inline-flex; gap: 2px; }
.hero__best-stars .wf-star { font-size: 19px; }

.home-sec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 0 2px;
}
.home-sec__title { font-size: clamp(19px, 4.2vw, 24px); font-weight: 800; }

.station-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}
.station-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 9px solid var(--st, var(--key));
  padding: clamp(12px, 3vw, 20px);
  min-width: 0;
}
.station-card--door { --st: var(--orange); }
.station-card--station { --st: var(--teal); }
.station-card--diner { --st: #ffb3c7; }
.station-card--square { --st: var(--purple); }
.station-card__head { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.station-card__emoji { font-size: clamp(30px, 8vw, 42px); line-height: 1; flex: 0 0 auto; }
.station-card__info { min-width: 0; }
.station-card__name { font-size: clamp(18px, 4.4vw, 24px); line-height: 1.2; }
.station-card__blurb { font-size: 12px; line-height: 1.4; margin-top: 2px; }
.station-card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pill--tag { font-size: 11px; padding: 2px 8px; border-width: 2px; background: #fff; }
.station-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 2px;
}
.station-card__stars { display: inline-flex; gap: 1px; }
.station-card__stars .wf-star { font-size: 17px; }
.station-card__best { font-size: 12px; }
.station-card__btn { width: 100%; margin-top: 4px; min-height: 56px; font-size: 16px; padding: 8px 6px; }

.profile-card__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-card__note { margin-top: 4px; }
.dim-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.dim {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.dim__label { font-size: 14px; font-weight: 800; }
.dim__track {
  height: 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.dim__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--key), var(--teal));
  transition: width 300ms ease;
}
.dim:nth-child(2) .dim__fill { background: linear-gradient(90deg, #ffb35c, var(--orange)); }
.dim:nth-child(3) .dim__fill { background: linear-gradient(90deg, #a98bff, #7f63e8); }
.dim:nth-child(4) .dim__fill { background: linear-gradient(90deg, #ff9bb3, #ff6b8a); }
.dim__num { font-size: 12px; font-weight: 700; color: var(--ink-soft); text-align: right; white-space: nowrap; }
.dim.is-empty .dim__fill { background: #e5ebf5; }
.dim.is-empty .dim__num { font-size: 11px; }
.profile-card__top { margin-top: 10px; }
.home-foot { text-align: center; padding: 2px 8px 10px; line-height: 1.5; }

.help { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.help__line { font-size: 15px; line-height: 1.55; color: var(--ink); }

/* ---------------- 答题头 ---------------- */
.play-head__row { gap: 8px; }
.play-head__emoji { font-size: 26px; line-height: 1; }
.play-head__title { font-size: clamp(19px, 4.4vw, 24px); }
.play-head__note { margin-top: 2px; }

.hud-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 4px 0 rgba(32, 48, 79, 0.16);
}
.pill--station {
  background: var(--key-2);
  border-color: var(--ink);
  font-size: 13px;
  max-width: 100%;
  white-space: normal;
}
.hud-bar__hud { flex: 1 1 180px; min-width: 0; }
.hud-bar .hud { justify-content: flex-end; }
.hud-bar .dot { width: 14px; height: 14px; }
.hud-bar .btn.small { min-height: 44px; padding: 6px 10px; font-size: 13px; box-shadow: none; border-style: dashed; }

.play-card { padding: clamp(12px, 2.6vw, 20px); }
.q { display: flex; flex-direction: column; gap: 8px; }
.prompt--q {
  font-size: clamp(18px, 4.2vw, 24px);
  font-weight: 800;
  line-height: 1.55;
  text-align: center;
  padding: 2px 4px;
  text-wrap: balance;
}
.visual { margin: 2px 0; }
.hint { margin-top: 2px; }
.hint:empty { display: none; }
.q-tools {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.q-tools .btn {
  min-height: 48px;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
}
.choices--q { margin-top: 4px; }
.choices--q .choice { min-height: 60px; }
.choice__v { display: block; line-height: 1.1; }
.choice__sub { display: block; font-size: 0.62em; font-weight: 700; color: var(--ink-soft); margin-top: 2px; }
.choice--pair { font-size: clamp(17px, 4vw, 22px); padding: 6px 4px; }
.choices--pairs { max-width: 760px; }

/* ---------------- 提示卡 ---------------- */
.hint-card {
  border: 2px dashed var(--ink-soft);
  border-left: 6px solid var(--purple);
  border-radius: 14px;
  background: #fffdf3;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}
.hint-card__title { font-size: 16px; font-weight: 800; }
.hint-card__text { font-size: 14px; line-height: 1.5; color: var(--ink-soft); }

/* ---------------- 门牌 / 点数 ---------------- */
.doorplate {
  width: min(300px, 100%);
  margin: 0 auto;
  filter: drop-shadow(0 5px 0 rgba(32, 48, 79, 0.18));
}
.doorplate__roof {
  width: 76%;
  margin: 0 auto -6px;
  padding: 5px 8px;
  border: var(--bw) solid var(--ink);
  border-radius: 14px 14px 6px 6px;
  background: linear-gradient(180deg, #ffc98d, var(--orange));
  text-align: center;
}
.doorplate__roof-text { font-size: 13px; font-weight: 800; color: var(--ink); }
.doorplate__body {
  border: var(--bw) solid var(--ink);
  border-radius: 18px;
  background: #fff;
  padding: 12px 10px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dots-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 7px;
}
.dot-item {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: radial-gradient(circle at 34% 30%, #ffd9a0, var(--orange) 72%);
  position: relative;
  flex: 0 0 auto;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.dot-item.is-counted {
  box-shadow: 0 0 0 4px var(--key-2);
  transform: scale(1.08);
}
.dot-item.is-counted::after {
  content: attr(data-tag);
  position: absolute;
  right: -7px;
  top: -9px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
}
.dots-grid--door { gap: 8px; }
.dots-grid--door.is-five {
  display: grid;
  grid-template-columns: repeat(5, 27px);
  justify-content: center;
  gap: 8px;
}
.dots-grid--group { gap: 5px; }
.dots-grid--group .dot-item { width: 23px; height: 23px; }
.empty-note {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 6px 14px;
  border: 2px dashed var(--ink-soft);
  border-radius: 999px;
}

/* 十格阵并排 / 小棒 */
.tf-box { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tf-pair {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.tf-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tf-pair .tenframe {
  --cell: clamp(22px, 5.6vw, 30px);
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
}
.tf-label { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.tf-caption {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 2px;
  line-height: 1.4;
}
.place { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.place__box { width: 100%; }
.place__toggle { min-height: 44px; font-size: 13px; padding: 6px 12px; }
.bundle-box { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bundle-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(8px, 3vw, 20px);
  flex-wrap: wrap;
}
.bundle { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.bundle__svg { width: clamp(72px, 20vw, 92px); height: auto; }
.bundle__cap { font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.loose { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.loose__sticks { display: flex; gap: 4px; align-items: flex-end; min-height: 56px; }
.loose__stick {
  width: 8px;
  height: 52px;
  border-radius: 4px;
  border: 2px solid var(--ink);
  background: #f2a65a;
  display: block;
}

/* ---------------- 一排物体 / 序数 ---------------- */
.ord-wrap { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.dir-labels {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}
.dir-label.is-start {
  color: var(--ink);
  background: var(--key-2);
  border-radius: 999px;
  padding: 2px 8px;
}
.ord-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(6px, 1.6vw, 10px);
  padding: 8px 6px;
  border-radius: 16px;
  width: 100%;
  transition: background 160ms ease;
}
.animal-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  position: relative;
  flex: 0 0 auto;
  transition: transform 120ms ease;
}
.animal-item__emoji { font-size: clamp(28px, 7.4vw, 38px); line-height: 1.15; }
.animal-item__name { font-size: 10px; color: var(--ink-soft); font-weight: 700; }
.animal-item.is-counted {
  transform: translateY(-3px);
  outline: 3px solid var(--key);
  outline-offset: 3px;
  border-radius: 12px;
}
.animal-item.is-counted::after {
  content: attr(data-tag);
  position: absolute;
  top: -10px;
  right: -7px;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}
.ord-row.is-all {
  background: #eef7ff;
  outline: 3px dashed var(--purple);
  outline-offset: 2px;
}
.animal-item.is-target {
  outline: 4px solid var(--orange);
  outline-offset: 4px;
  border-radius: 12px;
  background: #fff3e3;
}

/* ---------------- 排队 ---------------- */
.queue-board { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.queue-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
.queue-label {
  flex: 0 0 auto;
  min-width: 44px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  background: var(--key-2);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 2px 6px;
  text-align: center;
}
.queue-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
}
.queue-item {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #fff;
  border: 2px solid #e1e9f4;
  flex: 0 0 auto;
  transition: box-shadow 120ms ease, background 120ms ease;
}
.queue-item__emoji { font-size: 21px; line-height: 1; }
.queue-item.is-paired { background: #e9fbef; border-color: var(--ok); }
.queue-item.is-leftover {
  border-color: var(--orange);
  background: #fff3e3;
  box-shadow: 0 0 0 3px #ffe0bd;
}
.queue-note { font-size: 13px; font-weight: 700; color: var(--ink-soft); text-align: center; }
.pair-btn { min-height: 44px; font-size: 13px; padding: 6px 12px; }

/* ---------------- 配餐配对 ---------------- */
.match-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.match-line { width: 100%; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.match-line__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  background: #fff;
  border: 2px solid var(--ink-soft);
  border-radius: 999px;
  padding: 1px 10px;
}
.match-line__items {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 44px));
  gap: 6px;
  justify-content: center;
}
.match-item {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 0 var(--ink);
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
  padding: 0;
}
.match-item:active { transform: translateY(2px); box-shadow: 0 0 0 var(--ink); }
.match-item__emoji { font-size: 24px; line-height: 1; }
.match-item.is-selected {
  background: var(--key-2);
  box-shadow: 0 0 0 4px var(--teal);
  transform: translateY(-2px);
}
.match-item.is-paired {
  background: #e9fbef;
  border-color: var(--ok);
  box-shadow: none;
  opacity: 0.9;
}
.match-item.is-leftover {
  border-color: var(--orange);
  background: #fff3e3;
  box-shadow: 0 0 0 3px #ffe0bd;
}
.match-note {
  min-height: 22px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  line-height: 1.4;
}
.match-tip { font-size: 11px; text-align: center; }

/* ---------------- 比较 / 两组点 ---------------- */
.cmp-board {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2.5vw, 18px);
  flex-wrap: wrap;
}
.cmp-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  border: 2px dashed var(--ink-soft);
  border-radius: 16px;
  background: #fff;
  min-width: 96px;
}
.cmp-group__label { font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.cmp-vs { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.cmp-group .dot-item.is-paired { box-shadow: 0 0 0 3px var(--ok); }
.cmp-group .dot-item.is-leftover { box-shadow: 0 0 0 3px var(--orange); }
.cmp-board.is-revealed .cmp-group { background: #f7fffb; }

/* ---------------- 门牌序列 ---------------- */
.door-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(4px, 2vw, 12px);
  flex-wrap: wrap;
}
.door-mini {
  width: clamp(68px, 19vw, 92px);
  border: var(--bw) solid var(--ink);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fff8e8);
  box-shadow: 0 4px 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px 8px;
  position: relative;
}
.door-mini__roof {
  width: 100%;
  height: 12px;
  border-radius: 8px 8px 2px 2px;
  background: var(--orange);
  border: 2px solid var(--ink);
  margin-bottom: 4px;
}
.door-mini__no { font-size: clamp(26px, 8vw, 36px); font-weight: 800; line-height: 1.1; }
.door-mini__tag { font-size: 10px; color: var(--ink-soft); font-weight: 700; }
.door-mini.is-empty { background: #fffdf3; border-style: dashed; box-shadow: none; }
.door-mini.is-empty .door-mini__roof { background: #e5ebf5; }
.door-mini.is-empty .door-mini__no { color: var(--ink-soft); }
.door-row__arrow { font-size: 24px; font-weight: 800; color: var(--ink-soft); padding-bottom: 22px; }
.door-row__gap { font-size: 30px; font-weight: 800; color: var(--ink-soft); padding-bottom: 20px; }

/* ---------------- 鳄鱼提示 ---------------- */
.croc-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
}
.croc-svg { width: min(240px, 82%); height: auto; }
.croc-num { font-family: var(--font); font-size: 30px; font-weight: 800; fill: var(--ink); }
.croc-sign { font-family: var(--font); font-size: 26px; font-weight: 800; fill: var(--ink-soft); }
.croc-hint__text { font-size: 14px; font-weight: 700; color: var(--ink-soft); text-align: center; line-height: 1.45; }

/* ---------------- 结算 ---------------- */
.done-card { padding: clamp(14px, 3.4vw, 24px); }
.report-stations {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  padding: 8px 10px;
}
.report-stations__title {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
  text-align: center;
}
.report-station {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 10px;
  min-height: 30px;
}
.report-station.is-current { background: #e4fff9; }
.report-station__emoji { font-size: 17px; line-height: 1; }
.report-station__name { font-size: 14px; font-weight: 800; }
.report-station__stars { display: inline-flex; gap: 1px; }
.report-station__stars .wf-star { font-size: 15px; }
.report-station__best { font-size: 11px; font-weight: 700; color: var(--ink-soft); min-width: 38px; text-align: right; }
.wf-bar.is-empty { opacity: 0.75; }
.wf-bar.is-empty .wf-bar__num { font-size: 11px; }
.done-card .wf-report__actions .btn { min-height: 56px; }

/* ---------------- 窄屏 ---------------- */
@media (max-width: 359px) {
  .station-grid { grid-template-columns: 1fr; }
  .tf-pair { gap: 8px; }
}
@media (max-width: 340px) {
  .tf-pair { flex-direction: column; align-items: center; }
}
@media (max-width: 380px) {
  .choices--q .choice { font-size: clamp(20px, 5.6vw, 26px); }
  .choice--pair { font-size: clamp(15px, 4.4vw, 19px); }
  .dim { grid-template-columns: 40px minmax(0, 1fr) 50px; }
  .station-card__tags .pill--tag { font-size: 10px; padding: 1px 6px; }
  .match-line__items { grid-template-columns: repeat(5, minmax(0, 42px)); }
  .match-item { width: 42px; height: 42px; }
  .animal-item__emoji { font-size: clamp(24px, 7vw, 30px); }
  .animal-item__name { display: none; }
  .queue-item { width: 28px; height: 28px; }
  .queue-item__emoji { font-size: 19px; }
  .queue-label { min-width: 40px; font-size: 11px; }
  .door-mini { width: 62px; }
  .report-station { grid-template-columns: 20px minmax(0, 1fr) auto auto; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .dot-item,
  .animal-item,
  .queue-item,
  .match-item,
  .dim__fill,
  .ord-row,
  .match-item,
  .station-card {
    transition: none !important;
  }
}
