/* COMPONENTS: thành phần dùng ở nhiều nơi. Lớp layout và pages được chỉnh lại theo ngữ cảnh (nạp sau, thắng). */

/* ---- Nút chính: khối mực đặc ---- */
.btn-primary-cta {
  flex: 1;
  height: 52px;
  min-height: 64px;
  padding: 0 48px;
  font: 600 1.2rem var(--font-body);
  letter-spacing: 0.04em;
  color: var(--paper);
  background: var(--ink);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-raised);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.btn-primary-cta:hover:not(:disabled) {
  transform: translateY(-1px);
  background-color: var(--cinnabar);
  box-shadow: 0 10px 24px rgb(var(--ink-rgb) / 0.08);
}
.btn-primary-cta:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 3px; }
.btn-primary-cta:active:not(:disabled) { transform: translateY(0); }
.btn-primary-cta:disabled { cursor: not-allowed; }
@media (max-width: 760px) {
  .btn-primary-cta { width: 100%; }
}
@media (max-width: 599.98px) {
  .btn-primary-cta { height: 48px; min-height: 48px; }
}
@media (max-height: 720px) {
  .btn-primary-cta { height: 48px; min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary-cta:hover { transform: none; }
}

/* ---- Nút biểu tượng (âm thanh, mở và đóng ngăn kéo): vùng chạm 44px, không khung ---- */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.btn-icon:hover { color: var(--ink); }

/* ---- Liên kết hành động nhỏ (lịch sử): chữ mực gạch chân, hover son đậm ---- */
.btn-pill-sub {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 2px;
  font: 500 var(--fs-label)/var(--lh-ui) var(--font-body);
  letter-spacing: 0;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: 0.2s ease; transition-property: var(--transition-props);
}
.btn-pill-sub:hover { color: var(--cinnabar-deep); border-bottom-color: var(--cinnabar-deep); transform: translateY(-1px); }

/* ---- Vòng 64 quẻ: dùng ở trang chủ (.home-wheel-mount) và trang 64 quẻ (#view-wheel); app.js chuyển vòng giữa hai chỗ.
 * Vòng ngoài 64 thẻ quẻ, vòng giữa 8 quái, giữa là nút thái cực; bán kính theo --outer-radius, --mid-radius, --wheel-size.
 * Viết lại từ khai báo đang thắng (tools/css-effective.mjs --css: trang chủ, trang 64 quẻ, lọc theo quái; 7 bề rộng); trạng thái do app.js
 * đặt (.is-match, .is-dim, .is-active, data-active-tri) và rê chuột, tiêu điểm chép từ quy tắc nguồn. ---- */
.wheel-tooltip {
  align-items: center;
  background: var(--paper);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  /* Thanh đọc tên quẻ của #/64-que (người dùng 2026-11-09: chữ đầu trang lộn xộn). Trước: canh giữa dưới khối tiêu đề canh trái, câu
   * mặc định lặp hướng dẫn chọn cung của dòng dẫn và vỡ hai dòng. Nay: thẳng trục trái với tiêu đề, nhãn và chữ trên cùng đường chân
   * chữ, câu mặc định ngắn một dòng; chữ vẫn được xuống hàng (không cắt "…"), chiều cao tối thiểu giữ vòng không nhảy khi rê quẻ. */
  align-items: baseline;
  align-self: stretch;
  contain: layout paint;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  justify-content: flex-start;
  min-height: 40px;
  padding: 8px 0;
  text-align: left;
  width: 100%;
}
@media (max-width: 599.98px) {
  /* Điện thoại: nhãn trên, câu dưới (tên và nghĩa quẻ có thể hai dòng) */
  .wheel-tooltip { flex-direction: column; align-items: flex-start; gap: 2px; min-height: 84px; }
}
.home-wheel-mount .wheel-tooltip {
  align-items: center;
  background: var(--paper);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--ink);
  contain: strict;
  display: flex;
  gap: 8px;
  height: 36px;
  justify-content: center;
  max-width: 40rem;
  overflow: hidden;
  padding: 8px 12px;
  text-align: center;
  white-space: nowrap;
  width: 100%;
}
.wheel-tooltip-badge {
  background: none;
  border-radius: 0; /* không nền, không viền: bo góc viên thuốc vô nghĩa (critique 2026-11-07) */
  color: var(--ink-soft);
  flex-shrink: 0;
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: 600; /* typeset 2026-11-05: 600 như mọi nhãn đậm */
  letter-spacing: 0;
  line-height: var(--lh-ui);
  padding: 0; /* chữ nhãn bắt đầu đúng mép trái của tiêu đề */
  text-transform: none;
}
/* Thanh trống tới khi rê hoặc chạm một quẻ (giữ chiều cao tối thiểu nên vòng không nhảy) */
.wheel-tooltip-badge:empty,
.wheel-tooltip-text:empty { display: none; }
.wheel-tooltip-text {
  color: var(--ink-soft);
  font-family: Newsreader, "Noto Serif", Georgia, "Times New Roman", serif, "Noto Serif SC";
  font-size: var(--fs-label);
  letter-spacing: 0;
  line-height: var(--lh-ui);
  text-wrap: pretty;
}
.wheel-viewport {
  align-items: center;
  contain: layout paint;
  display: flex;
  justify-content: center;
  overflow: hidden;
  padding: 6px 0;
  width: 100%;
}
.hex-wheel {
  --mid-radius: 124px;
  --outer-radius: 236px;
  --wheel-meta: 0.75rem;
  --wheel-size: 560px;
  --wheel-tri-han: 1.375rem;
  align-items: center;
  border-radius: 50%;
  contain: layout paint;
  display: flex;
  flex-shrink: 0;
  height: var(--wheel-size);
  justify-content: center;
  position: relative;
  user-select: none;
  width: var(--wheel-size);
}
@media (max-width: 768px) { .hex-wheel {
    --mid-radius: min(21.5vw, 84px);
    --outer-radius: min(39vw, 150px);
    --wheel-size: min(92vw, 358px);
} }
/* Từ 900px vòng phóng 1,15 lần (644px; trước 1,3 lần = 728px, người dùng thấy to quá trên desktop 2026-11-08). Phần lề dưới bù
 * đúng phần phóng: 560px × 0,15 = 84px. */
@media (min-width: 900px) { .hex-wheel {
    --wheel-scale: 1.15;
    margin-bottom: 84px;
    transform: scale(var(--wheel-scale));
    transform-origin: top center;
} }
.wheel-ambient-glow {
  background: none;
  border-radius: 50%;
  display: none;
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}
.wheel-guide-outer.wheel-ring-guide {
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  height: calc(var(--outer-radius) * 2 + 64px);
  pointer-events: none;
  position: absolute;
  width: calc(var(--outer-radius) * 2 + 64px);
  z-index: 1;
}
@media (max-width: 768px) { .wheel-guide-outer.wheel-ring-guide {
    height: calc(var(--outer-radius) * 2 + 34px);
    width: calc(var(--outer-radius) * 2 + 34px);
} }
.wheel-guide-mid.wheel-ring-guide {
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  height: calc(var(--mid-radius) * 2 + 76px);
  pointer-events: none;
  position: absolute;
  width: calc(var(--mid-radius) * 2 + 76px);
  z-index: 1;
}
@media (max-width: 768px) { .wheel-guide-mid.wheel-ring-guide {
    height: calc(var(--mid-radius) * 2 + 44px);
    width: calc(var(--mid-radius) * 2 + 44px);
} }
.wheel-guide-inner.wheel-ring-guide {
  border: 1px solid var(--rule-soft);
  background: radial-gradient(circle at center, var(--paper) 0%, var(--paper) 100%);
  border-color: var(--rule-soft);
  border-radius: 50%;
  box-shadow: none;
  height: 112px;
  pointer-events: none;
  position: absolute;
  width: 112px;
  z-index: 1;
}
@media (max-width: 768px) { .wheel-guide-inner.wheel-ring-guide {
    height: 64px;
    width: 64px;
} }
.wheel-outer-ring {
  animation: wheel-spin-cw 180s linear infinite;
  animation-duration: 60s;
  border-radius: 50%;
  inset: 0;
  position: absolute;
  transition: opacity 0.22s ease;
  will-change: transform;
  z-index: 3;
}
.wheel-hex-slot {
  align-items: center;
  display: flex;
  height: 58px;
  justify-content: center;
  left: 50%;
  margin-left: -12px;
  margin-top: -29px;
  outline: none;
  position: absolute;
  text-decoration: none;
  top: 50%;
  transform: rotate(var(--slot-angle)) translateY(calc(-1 * var(--outer-radius)));
  transform-origin: center center;
  width: 24px;
  z-index: 2;
}
@media (max-width: 768px) { .wheel-hex-slot {
    height: 32px;
    margin-left: -6px;
    margin-top: -16px;
    width: 12px;
} }
.wheel-hex-card { /* ngữ cảnh khác: xem phần trạng thái */
  align-items: center;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  height: 56px;
  justify-content: space-between;
  padding: 4px 2px;
  position: relative;
  width: 18px;
}
@media (max-width: 768px) { .wheel-hex-card {
    height: 30px;
    justify-content: center;
    padding: 0;
    width: 11px;
} }
.wheel-hex-card::after { /* ngữ cảnh khác: xem phần trạng thái */
  background: rgb(var(--cinnabar-rgb) / 0.14);
  border: 1px solid var(--cinnabar-deep);
  border-radius: 2px;
  content: "";
  inset: -1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}
.wheel-section-wrap .wheel-hex-card {
}
@media (max-width: 768px) { .wheel-section-wrap .wheel-hex-card {
    height: 30px;
    justify-content: center;
    padding: 0;
    width: 11px;
} }
.wheel-section-wrap .wheel-hex-card::after {
}
.is-dim.is-tri-dim.wheel-hex-slot { pointer-events: none; } /* thẻ mờ không hoạt động (app.js bỏ khỏi Tab và trình đọc) */
.is-dim.is-tri-dim.wheel-hex-slot .wheel-hex-card {
  opacity: 0.25;
  transition: opacity 250ms ease, transform 250ms ease;
}
@media (max-width: 768px) { .is-dim.is-tri-dim.wheel-hex-slot .wheel-hex-card {
    height: 30px;
    justify-content: center;
    padding: 0;
    width: 11px;
} }
.is-dim.is-tri-dim.wheel-hex-slot .wheel-hex-card::after {
}
.is-match.is-tri-match.wheel-hex-slot .wheel-hex-card {
  opacity: 1;
  transform: scale(1.14) translateY(-2px);
  transition: opacity 250ms ease, transform 250ms ease;
}
@media (max-width: 768px) { .is-match.is-tri-match.wheel-hex-slot .wheel-hex-card {
    height: 30px;
    justify-content: center;
    padding: 0;
    width: 11px;
} }
.is-match.is-tri-match.wheel-hex-slot .wheel-hex-card::after {
  opacity: 1;
  transition: opacity 250ms ease;
}
.wheel-hex-num {
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}
@media (max-width: 768px) { .wheel-hex-num {
    display: none;
    font-size: 0.42rem;
} }
@media (max-width: 760px) { .wheel-hex-num {
    color: var(--ink);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0;
} }
@media (min-width: 769px) and (max-width: 899.98px) { .wheel-hex-num {
    font-size: var(--wheel-meta);
} }
@media (min-width: 900px) { .wheel-hex-num {
    font-size: calc(var(--wheel-meta) / var(--wheel-scale));
} }
.wheel-hex-han {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-orientation: upright;
  writing-mode: vertical-rl;
}
@media (max-width: 768px) { .wheel-hex-han {
    display: block;
    font-size: 10px;
    line-height: 1;
} }
@media (min-width: 769px) and (max-width: 899.98px) { .wheel-hex-han {
    font-size: var(--fs-label);
} }
@media (min-width: 900px) { .wheel-hex-han {
    font-size: calc(var(--fs-label) / var(--wheel-scale));
} }
.wheel-middle-ring {
  animation: wheel-spin-ccw 240s linear infinite;
  animation-duration: 80s;
  border-radius: 50%;
  inset: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 0.22s ease;
  will-change: transform;
  z-index: 20;
}
.wheel-tri-slot {
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  font-family: var(--font-body);
  height: 66px;
  justify-content: center;
  left: 50%;
  margin-left: -33px;
  margin-top: -33px;
  outline: none;
  padding: 0;
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: rotate(var(--tri-angle)) translateY(calc(-1 * var(--mid-radius)));
  width: 66px;
  z-index: 21;
}
@media (max-width: 768px) { .wheel-tri-slot {
    height: 44px;
    margin-left: -22px;
    margin-top: -22px;
    min-height: 42px;
    min-width: 42px;
    width: 44px;
} }
.wheel-tri-card { /* ngữ cảnh khác: xem phần trạng thái */
  align-items: center;
  background: none;
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  gap: 6px;
  height: 62px;
  justify-content: center;
  padding: 4px;
  position: relative;
  width: 62px;
}
@media (max-width: 768px) { .wheel-tri-card {
    gap: 4px;
    height: 42px;
    padding: 2px;
    width: 42px;
} }
.wheel-tri-card::after { /* ngữ cảnh khác: xem phần trạng thái */
  background: rgb(var(--cinnabar-rgb) / 0.14);
  border: 1px solid var(--cinnabar-deep);
  border-radius: 2px;
  content: "";
  inset: -1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
}
.wheel-section-wrap .wheel-tri-card {
}
@media (max-width: 768px) { .wheel-section-wrap .wheel-tri-card {
    gap: 4px;
    height: 42px;
    padding: 2px;
    width: 42px;
} }
.wheel-section-wrap .wheel-tri-card::after {
}
.is-active.wheel-tri-slot .wheel-tri-card {
  transform: scale(1.1);
}
@media (max-width: 768px) { .is-active.wheel-tri-slot .wheel-tri-card {
    gap: 4px;
    height: 42px;
    padding: 2px;
    width: 42px;
} }
.is-active.wheel-tri-slot .wheel-tri-card::after {
  opacity: 1;
}
.wheel-tri-han {
  color: var(--ink);
  font-weight: 700;
  line-height: 1;
}
@media (max-width: 768px) { .wheel-tri-han {
    font-size: var(--fs-label);
} }
@media (min-width: 769px) and (max-width: 899.98px) { .wheel-tri-han {
    font-size: var(--wheel-tri-han);
} }
@media (min-width: 900px) { .wheel-tri-han {
    font-size: calc(var(--wheel-tri-han) / var(--wheel-scale));
} }
.wheel-tri-name {
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
@media (max-width: 899.98px) { .wheel-tri-name {
    font-size: var(--wheel-meta);
    line-height: 1.2;
} }
@media (min-width: 900px) { .wheel-tri-name {
    display: block;
    font-size: calc(var(--wheel-meta) / var(--wheel-scale));
} }
.wheel-tri-pre {
  color: var(--ink);
}
@media (max-width: 899.98px) { .wheel-tri-pre {
    display: none;
} }
@media (min-width: 900px) { .wheel-tri-pre {
    display: block;
} }
.wheel-center-core {
  align-items: center;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 5;
}
.wheel-taiji-btn {
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  font-family: var(--font-body);
  height: 72px;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0;
  transition: transform 0.25s ease;
  width: 72px;
}
@media (max-width: 768px) { .wheel-taiji-btn {
    height: 46px;
    width: 46px;
} }
.wheel-taiji-svg {
  display: block;
  filter: grayscale(1);
}
@media (max-width: 768px) { .wheel-taiji-svg {
    height: 44px;
    width: 44px;
} }
.is-match.is-tri-match.wheel-hex-slot {
  z-index: 10;
}
@media (max-width: 768px) { .is-match.is-tri-match.wheel-hex-slot {
    height: 32px;
    margin-left: -6px;
    margin-top: -16px;
    width: 12px;
} }
.is-dim.is-tri-dim.wheel-hex-slot {
}
@media (max-width: 768px) { .is-dim.is-tri-dim.wheel-hex-slot {
    height: 32px;
    margin-left: -6px;
    margin-top: -16px;
    width: 12px;
} }
.is-active.wheel-tri-slot {
}
@media (max-width: 768px) { .is-active.wheel-tri-slot {
    height: 44px;
    margin-left: -22px;
    margin-top: -22px;
    min-height: 42px;
    min-width: 42px;
    width: 44px;
} }

/* Vòng: rê chuột */
.hex-wheel:hover .wheel-outer-ring {
  animation-play-state: paused;
}
.wheel-hex-slot:hover {
  z-index: 15;
}
.wheel-hex-slot:hover .wheel-hex-card {
  transform: scale(1.24) translateY(-3px);
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.wheel-hex-slot:hover .wheel-hex-card::after {
  opacity: 1;
  transition: opacity 0.16s ease;
}
.hex-wheel:hover .wheel-middle-ring {
  animation-play-state: paused;
}
.wheel-tri-slot:hover .wheel-tri-card {
  transform: scale(1.1);
}
.wheel-tri-slot:hover .wheel-tri-card::after {
  opacity: 1;
}
.wheel-taiji-btn:hover {
  transform: scale(1.08);
}

/* Vòng: tiêu điểm bàn phím */
/* Ô quẻ và ô cung khai báo outline: none ở trên (chữ và nét viền của thẻ là hình chính), nên tiêu điểm bàn phím phải vẽ lại ở đây:
   khung son đậm 2px (6:1 trở lên so với giấy), cách thẻ 2px, đè lên thẻ lân cận nhờ z-index. */
.wheel-hex-slot:focus-visible {
  outline: 2px solid var(--cinnabar-deep);
  outline-offset: 2px;
  z-index: 15;
}
.wheel-tri-slot:focus-visible {
  outline: 2px solid var(--cinnabar-deep);
  outline-offset: 1px;
}
.wheel-hex-slot:focus-visible .wheel-hex-card {
  transform: scale(1.24) translateY(-3px);
  transition: transform 0.16s ease, opacity 0.16s ease;
}
.wheel-hex-slot:focus-visible .wheel-hex-card::after {
  opacity: 1;
  transition: opacity 0.16s ease;
}
.wheel-tri-slot:focus-visible .wheel-tri-card {
  transform: scale(1.1);
}
.wheel-tri-slot:focus-visible .wheel-tri-card::after {
  opacity: 1;
}
@keyframes wheel-spin-cw { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes wheel-spin-ccw { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } }

/* Nền Tiên thiên đồ (đợt 4 mục 12, người dùng chọn hướng C 2026-11-08): vòng quay không còn nằm trơ trên mặt giấy.
   (1) Tám quái Phục Hy bằng nét mực nhạt ngoài vòng thẻ, xoay ngược chiều rất chậm (300 giây một vòng), dừng khi rê chuột như hai vòng kia.
   (2) Quầng mực loang nhẹ quanh thái cực (dùng lại lớp .wheel-ambient-glow vốn bị ẩn).
   Vòng tràn ra ngoài khung .hex-wheel nên .hex-wheel chỉ còn contain: layout (bỏ paint, vốn cắt mọi thứ ngoài khung), và khung nhìn
   .wheel-viewport có thêm đệm trên dưới để không cắt đầu vòng. Điện thoại: chỉ có nét quái, bỏ tên Hán (quá nhỏ để đọc). */
.hex-wheel { contain: layout; }
.wheel-ambient-glow {
  display: block;
  background: radial-gradient(circle, rgb(27 26 23 / 0.12) 0, rgb(27 26 23 / 0.05) 24%, transparent 60%);
}
.wheel-tienthien {
  --xt-gap: 38px;      /* từ bán kính vòng thẻ tới hào 1 */
  --xt-bar: 6px;
  --xt-step: 4px;
  --xt-width: 56px;
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  animation: wheel-spin-ccw 300s linear infinite;
}
.hex-wheel:hover .wheel-tienthien { animation-play-state: paused; }
.wheel-xt { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--xt-angle)); }
.xt-body {
  position: absolute;
  left: calc(var(--xt-width) / -2);
  bottom: calc(var(--outer-radius) + var(--xt-gap));
  width: var(--xt-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--xt-step);
}
.xt-body b { display: block; width: 100%; height: var(--xt-bar); }
.xt-y { background: rgb(94 90 81 / 0.34); }
.xt-n { background: linear-gradient(to right, rgb(94 90 81 / 0.34) 0 42%, transparent 42% 58%, rgb(94 90 81 / 0.34) 58% 100%); }
.xt-han { margin-bottom: var(--xt-step); color: rgb(94 90 81 / 0.5); font: 400 1.125rem/1 var(--font-han); }
@media (min-width: 769px) { .wheel-viewport { padding-block: 56px; } }
@media (min-width: 900px) { .wheel-viewport { padding-block: 66px; } } /* vòng phóng 1,15 lần từ mép trên: 56px × 1,15 ≈ 64px */
@media (max-width: 768px) {
  .wheel-tienthien { --xt-gap: 18px; --xt-bar: 2px; --xt-step: 1.5px; --xt-width: 22px; }
  .xt-han { display: none; }
}
/* Màn rất hẹp (dưới 381px): vòng thẻ chạm sát mép khung, nét quái mảnh lại để nằm gọn trong khung */
@media (max-width: 380px) {
  .wheel-tienthien { --xt-gap: 17px; --xt-bar: 1.5px; --xt-step: 1px; --xt-width: 20px; }
}

/* ---- Vòng 64 quẻ trên điện thoại: danh sách các quẻ có quái đang chọn (app.js renderWheelMatchList). Dưới 600px các thẻ quanh vòng
 * chỉ rộng khoảng 16px; danh sách là điều khiển tương đương, mỗi dòng cao 44px (B4). Màn rộng không hiện. ---- */
.wheel-match { display: none; }
/* Danh sách 8 quẻ của cung (trang chủ và trang 64 quẻ): thế của quẻ là chữ phụ, cách tên quẻ một khoảng (2026-11-08) */
.wheel-match-the { margin-left: 0.35em; color: var(--ink-soft); }
@media (max-width: 600px) {
  .wheel-viewport { flex-wrap: wrap; } /* vùng vòng quay là hàng flex: danh sách xuống dòng dưới vòng, đủ bề ngang */
  .wheel-match:not([hidden]) { display: block; flex: 0 0 100%; margin: var(--sp-4) 0 0; text-align: left; }
  .wheel-match-title { margin: 0 0 var(--sp-1); color: var(--ink-soft); font: 500 var(--fs-label)/var(--lh-ui) var(--font-body); }
  .wheel-match-list { display: grid; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
  .wheel-match-list a {
    display: flex;
    align-items: center;
    min-height: 44px;
    border-bottom: 1px solid var(--rule-soft);
    color: var(--ink);
    font: 400 var(--fs-body)/var(--lh-ui) var(--font-body);
    text-decoration: none;
  }
  .wheel-match-list a:hover { color: var(--cinnabar-deep); }
}

/* P25-1 KHUYẾN MÃI ngày rằm, mùng 1 (js/account.js dauKhuyenMai, noiDungGia; dùng ở Bảng giá, khối giá trang chủ, khung khóa, khung
 * thanh toán). Giá gốc gạch: nhỏ hơn số phải trả, mực phụ (đọc được, 9:1 trên giấy), một nét gạch mực 1px; số phải trả vẫn là chữ chính.
 * Dấu của đợt: con dấu son 28px nghiêng 4 độ như con dấu khép Đúc kết (son chỉ cho hào động và con dấu), vầng trăng khắc âm trong lòng
 * dấu, rồi một dòng chữ cỡ thân nhỏ: tên đợt đậm mực tàu, phần còn lại mực phụ. MỘT dòng như thế mỗi màn hình; ngày thường có đợt sắp
 * tới thì chỉ trang Bảng giá có một dòng báo trước, không dấu. */
.km-goc {
  margin-inline-end: 0.45em;
  color: var(--ink-soft);
  font-size: var(--fs-small);
  font-weight: 400;
  text-decoration: line-through;
  text-decoration-color: var(--ink);
  text-decoration-thickness: 1px;
  white-space: nowrap;
}
.km-dau {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-5) 0 0;
  color: var(--ink-soft);
  font: 400 var(--fs-small)/1.45 var(--font-body);
  text-wrap: pretty;
}
.km-dau.is-giua { justify-content: center; margin-inline: auto; max-width: 40rem; text-align: left; }
.km-an {
  display: block;
  flex: none;
  width: 28px;
  height: 28px;
  color: var(--cinnabar);
  transform: rotate(-4deg);
}
.km-ten { color: var(--ink); font-weight: 600; }
.km-dau .km-goc { margin-inline: 0.3em 0; }
.km-goc-dong { white-space: nowrap; }
/* P28-8 Tờ báo giảm giá trong ngày (js/account.js kmHienBao): một mảnh giấy sáng mép xé có bóng tờ giấy chồng, con dấu vầng trăng của đợt
 * 36px, tên đợt cỡ thân đậm 600, một dòng mức giảm và hạn, lối "Xem Bảng giá" (nút chữ), nút đóng 44px. Không chặn trang: vị trí cố định,
 * máy bàn ở góc dưới phải; điện thoại ngay dưới đầu trang (không che nút Gieo Quẻ ở nửa dưới màn đầu). Hiện êm (nổi lên 8px, 0,35 giây);
 * giảm chuyển động thì chỉ hiện dần. */
.km-bao {
  align-items: flex-start;
  bottom: var(--sp-5);
  color: var(--ink);
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: auto minmax(0, 1fr) auto;
  isolation: isolate;
  padding: var(--sp-4) var(--sp-2) var(--sp-3) var(--sp-4);
  position: fixed;
  right: var(--page-margin);
  width: min(25rem, calc(100vw - 2 * var(--page-margin)));
  z-index: 80;
}
.km-bao::before { background: var(--paper-sheet); box-shadow: 0 14px 30px -16px rgb(var(--ink-rgb) / 0.5); content: ""; filter: url(#dq-deckle); inset: 0; position: absolute; z-index: -1; }
.km-bao .km-an { height: 36px; margin-top: 2px; width: 36px; }
.km-bao-chu { min-width: 0; }
.km-bao-ten { font: 600 var(--fs-body)/1.3 var(--font-body); margin: 0; }
.km-bao-dong { color: var(--ink-soft); font: 400 var(--fs-small)/1.45 var(--font-body); margin: var(--sp-1) 0 0; }
.km-bao-nut { align-items: center; color: var(--ink); display: inline-flex; font: 600 var(--fs-label)/1.2 var(--font-body); min-height: 44px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.km-bao-nut:hover { color: var(--cinnabar-deep); }
.km-bao-dong-nut { align-items: center; background: none; border: 0; color: var(--ink-soft); cursor: pointer; display: inline-flex; height: 44px; justify-content: center; margin: -10px 0 0; padding: 0; width: 44px; }
.km-bao-dong-nut svg { fill: none; height: 18px; stroke: currentColor; stroke-linecap: round; stroke-width: 1.6; width: 18px; }
.km-bao-dong-nut:hover { color: var(--ink); }
.km-bao-nut:focus-visible, .km-bao-dong-nut:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; }
@media (max-width: 599.98px) {
  .km-bao { bottom: auto; left: var(--page-margin); right: var(--page-margin); top: 72px; width: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .km-bao { animation: km-bao-hien 0.35s cubic-bezier(0.16, 0.84, 0.3, 1) both; }
}
@media (prefers-reduced-motion: reduce) {
  .km-bao { animation: km-bao-mo 0.2s ease-out both; }
}
@keyframes km-bao-hien { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes km-bao-mo { from { opacity: 0; } to { opacity: 1; } }

/* Nút âm thanh đồng xu: hai biểu tượng, hiện theo html[data-sound] do js/app.js đặt (2026-11-05: rời khỏi đầu trang) */
[data-sound-toggle] .icon-sound-on { display: none; }
html[data-sound="on"] [data-sound-toggle] .icon-sound-on { display: block; }
html[data-sound="on"] [data-sound-toggle] .icon-sound-off { display: none; }
[data-sound-toggle]:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; }

/* P29-2 Nút gập (2026-11-16, trang chủ điện thoại): đứng NGAY SAU tiêu đề của phần nó gập, tên lấy từ tiêu đề (aria-labelledby), không chữ
 * riêng. Chỉ có dưới 900px: phủ lên hàng tiêu đề (cao 48px, kéo lên bằng lề âm), dấu cộng / trừ nét mực 1,5px ở mép phải; tiêu đề cao
 * tối thiểu 48px và chừa chỗ cho dấu (css của từng chỗ dùng). Từ 900px không có nút, nội dung luôn hiện. Phần bị gập ẩn bằng CSS theo
 * aria-expanded ở tệp của từng chỗ (pages/home.css, layout.css), nên vẫn có trong DOM. */
.gap-nut { display: none; }
@media (max-width: 899.98px) {
  .gap-nut {
    background: none;
    border: 0;
    color: var(--ink);
    cursor: pointer;
    display: block;
    height: 48px;
    margin: -48px 0 0;
    padding: 0;
    position: relative;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
  }
  .gap-nut::before,
  .gap-nut::after {
    background: currentColor;
    content: "";
    height: 1.5px;
    position: absolute;
    right: var(--sp-1);
    top: calc(50% - 0.75px);
    width: 12px;
  }
  .gap-nut::after { transform: rotate(90deg); transition: transform 0.18s ease; }
  .gap-nut[aria-expanded="true"]::after { transform: rotate(0deg); }
  .gap-nut:hover { color: var(--cinnabar-deep); }
  .gap-nut:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; }
}
@media (max-width: 899.98px) and (prefers-reduced-motion: reduce) {
  .gap-nut::after { transition: none; }
}
