:root {
  --shell: #12352e;
  --ink: #10241f;
  --muted: #5c6b64;
  --bg: #e8ede9;
  --panel: #f7faf8;
  --line: #c5d0ca;
  --accent: #e85d04;
  --tip-bg: #ffe8d6;
  --pool-muted: #c5d9d3;
  --track: #d5ded9;
  --w: #2a9d8f;
  --p: #1d4e89;
  --q: #c9a227;
  --pq: #c44536;
  --phone: 390px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #dfe6e2;
  color: var(--ink);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

.phone {
  max-width: var(--phone);
  margin: 0 auto;
  min-height: 100vh;
  padding: 14px 16px 24px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shell-band {
  height: 4px;
  border-radius: 2px;
  background: var(--shell);
  flex-shrink: 0;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 2px 0 4px;
  flex-shrink: 0;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  line-height: 1.05;
  padding: 2px 0;
}

.brand-zh {
  font-size: 20px;
  font-weight: 700;
  color: var(--shell);
  letter-spacing: 0.08em;
}

.brand-en {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--shell);
  opacity: 0.72;
  letter-spacing: 0.14em;
}

.race-meta {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  min-width: 0;
  flex: 1;
}

.race-ctx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 12px;
  flex-shrink: 0;
  min-width: 0;
}

.race-ctx .legend {
  flex-shrink: 0;
}

.countdown {
  min-width: 56px;
  height: 30px;
  padding: 0 10px;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.tip-strip {
  border: 1.5px solid var(--accent);
  background: var(--tip-bg);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
  margin: 2px 0 4px;
}

.tip-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tip-lab {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.tip-cta {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.tip-status {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.tip-status.is-ok {
  color: var(--w);
}

.tip-status.is-warn {
  color: var(--pq);
}

.tip-strip.is-authed {
  cursor: default;
}

.tip-strip.is-settled {
  cursor: default;
  background: #f4f5f6;
  border-color: #d4a84b;
  gap: 8px;
}

.tip-settled-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.tip-settled-lab {
  flex: 0 0 28px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7580;
  line-height: 22px;
}

.tip-settled-balls,
.tip-settled-hits {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.tip-ball {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.tip-ball--result {
  background: #a67c52;
}

.tip-ball--pred {
  background: #3a4550;
}

.tip-settled-empty {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 22px;
}

.tip-hit-badge {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid #f5c542;
  border-radius: 3px;
  overflow: hidden;
  background: #c62828;
  min-height: 22px;
}

.tip-hit-rail {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  background: #f5c542;
  color: #c62828;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.tip-hit-body {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.tip-wait,
.tip-no-credit {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.tip-no-credit {
  color: var(--pq);
}

.tip-nos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tip-no {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tip-rates {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.tip-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.tip-trail-empty {
  color: var(--muted);
  font-size: 11px;
}

.trail-tag {
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  background: #d5ded9;
  color: var(--ink);
}

.trail-tag.trail-W {
  background: var(--w);
  color: #fff;
}

.trail-tag.trail-Q {
  background: var(--q);
  color: #1a1a1a;
}

.trail-tag.trail-PQ {
  background: var(--pq);
  color: #fff;
}

.trail-tag.trail-T {
  background: #5c4d7a;
  color: #fff;
}

.trail-tag.trail-F {
  background: var(--shell);
  color: #fff;
}

.trail-tag.trail-X {
  background: #d5ded9;
  color: var(--muted);
}

.pool-switch {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 2px;
}

.pool {
  border: 0;
  background: var(--shell);
  color: var(--pool-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.pool.is-on {
  background: var(--accent);
  color: #fff;
}

.race-dock {
  display: flex;
  align-items: center;
  gap: 0;
  height: 40px;
}

.race-rail {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 36px;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
}

.race-rail::-webkit-scrollbar {
  display: none;
}

.race-chip {
  flex: 1 1 0;
  min-width: 28px;
  max-width: 44px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.race-chip.is-on {
  background: var(--accent);
  color: #fff;
}

.legend {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.leg {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.leg-lab {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}

.tag-row {
  display: flex;
  gap: 3px;
  min-height: 14px;
  align-items: center;
}

.tag {
  box-sizing: border-box;
  width: 22px;
  min-width: 22px;
  height: 14px;
  padding: 0;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  color: #fff;
}

.tag.W {
  background: var(--w);
}
.tag.P {
  background: var(--p);
}
.tag.Q {
  background: var(--q);
}
.tag.PQ {
  background: var(--pq);
  font-size: 8px;
  letter-spacing: -0.04em;
}

.tag.hot {
  background: #d32f2f;
}

.list {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: 0;
}

.no {
  width: 28px;
  height: 40px;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mid {
  width: 120px;
  flex-shrink: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.name-odd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.odd {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.odd.is-hot {
  color: #fff;
  background: #d84343;
  border-radius: 3px;
  padding: 0 4px;
  font-weight: 800;
}

.meta {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bar-track {
  height: 14px;
  border-radius: 2px;
  background: var(--track);
  display: flex;
  overflow: hidden;
}

.seg {
  height: 100%;
}

.seg.W {
  background: var(--w);
}
.seg.P {
  background: var(--p);
}
.seg.Q {
  background: var(--q);
}
.seg.PQ {
  background: var(--pq);
}

.amt {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--muted);
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.amt.is-up {
  color: #d32f2f;
}

.amt.is-down {
  color: #2e7d32;
}

.amt.is-flat {
  color: #f9a825;
}

.disc {
  margin: 4px 0 0;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 53, 46, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  z-index: 40;
}

.modal[hidden] {
  display: none;
}

/* page10 · login-modal */
.login-modal {
  width: 100%;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: #f7faf8;
  border: 1.5px solid #12352e;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(18, 53, 46, 0.35);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
}

.modal-titles {
  min-width: 0;
  flex: 1;
}

.modal-titles h2 {
  margin: 0;
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: #10241f;
}

.modal-sub {
  margin: 0;
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: #5c6b64;
}

.btn-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #eef1ef;
  color: #5c6b64;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.hit-ad {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #ffe8d6;
  border: 1.5px solid #e85d04;
  border-radius: 6px;
}

.hit-ad-label {
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: #e85d04;
  letter-spacing: 0.01em;
}

.rate-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rate-tag {
  flex: 1;
  min-width: 0;
  height: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #c62828;
  border: 1px solid #f5c542;
  border-radius: 4px;
  line-height: 1.1;
}

.rate-pct {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.rate-name {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 9px;
  font-weight: 600;
  color: #ffe8d6;
}

/* page10：密碼框＋登入並排；4 碼輸入不必占滿寬 */
.field-password {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}

.input-password {
  flex: 0 0 112px;
  width: 112px;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1.5px solid #12352e;
  border-radius: 6px;
  background: #fff;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #10241f;
  letter-spacing: 0.35em;
  text-align: center;
  outline: none;
  box-sizing: border-box;
}

.input-password:focus {
  border-color: #e85d04;
}

.input-password::placeholder {
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  color: #5c6b64;
}

.btn-next {
  flex: 1 1 auto;
  min-width: 88px;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: #e85d04;
  color: #fff;
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-next:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* page10 method-open 風格：免費取碼獨立按鈕（TG Bot） */
.btn-get-pass {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: #12352e;
  color: #fff;
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  box-sizing: border-box;
  cursor: pointer;
}

.btn-get-pass:hover,
.btn-get-pass:focus-visible {
  filter: brightness(1.08);
  outline: none;
}

.btn-get-pass-em {
  color: #f5c542;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.login-error {
  margin: -4px 0 0;
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  color: #c62828;
}

.btn {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-ghost {
  margin-top: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  border: 1px solid #d5ddd9;
}

/* —— page8：近 10 次 —— */
.hot-range {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
  flex-shrink: 0;
}

.hot-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hot-title {
  font-size: 12px;
  font-weight: 700;
}

.hot-sub {
  font-size: 10px;
  color: #a8c5be;
}

.hot-nos {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.hot-no {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.row.is-click {
  cursor: pointer;
}

.row.is-click:active {
  background: #eef3ef;
}

.spark-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spark-10 {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 36px;
  flex: 1;
  min-width: 0;
}

.spark-bar {
  flex: 1;
  min-width: 4px;
  max-width: 10px;
  border-radius: 1px;
  background: #2e7d32;
  align-self: flex-end;
}

.spark-bar.is-hot {
  background: #d32f2f;
}

.spark-bar.is-cool {
  background: #2e7d32;
}

.spark-bar.is-flat {
  background: var(--track);
  opacity: 0.85;
}

.spark-bar.is-empty,
.trend-10.is-empty .spark-bar {
  height: 4px !important;
  background: var(--track);
  opacity: 0.7;
}

.empty-list {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* —— page11：馬詳 —— */
.header-horse {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.horse-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.btn-back {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: var(--shell);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.h-mid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.odd-win {
  color: var(--w);
  font-weight: 700;
  font-size: 12px;
}

.odd-pla {
  color: var(--p);
  font-weight: 700;
  font-size: 12px;
}

.pool-tip {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 2px 0;
}

.sec-pool {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line);
}

.sec-cap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.sec-cap .dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.sec-cap .dot.w {
  background: var(--w);
}
.sec-cap .dot.p {
  background: var(--p);
}

.trend-10 {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trend-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
}

.trend-bars .spark-bar {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

.trend-labs {
  display: flex;
  gap: 2px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.trend-labs span {
  flex: 1 1 0;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
}

.pair-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 32px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}

.pair-tog {
  border: 0;
  background: var(--shell);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.pair-tog.is-on {
  background: #c9a227;
}

.pair-table {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.pair-banker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}

.drag-tag {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 3px;
  padding: 2px 6px;
}

.pair-leg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 28px;
  border-bottom: 1px solid var(--line);
  min-height: 40px;
}

.pair-leg:last-child {
  border-bottom: 0;
}

.leg-no {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background: var(--shell);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.leg-name {
  width: 72px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leg-trend {
  flex: 1;
  min-width: 0;
}

.phone[data-view='horse'] .pool-switch,
.phone[data-view='horse'] .race-dock,
.phone[data-view='horse'] .legend,
.phone[data-view='horse'] .tip-strip {
  display: none;
}

