/* ==========================================================================
   "Điện tĩnh" (18/11/2026) — Đại Điện yên hơn, gọn hơn. Nạp SAU temple.css.
   Đợt 1: sửa lỗi bố cục nặng. Đợt 2–3: một tiêu điểm, ba nghi thức + "Thêm",
   màu đồng bộ Hồ Sen. Chuẩn: vùng chạm ≥ 44px, chữ ≥ 12.5px, không phần tử nào
   nằm ngoài màn hình. Cổng kiểm: npm run check:layout.
   ========================================================================== */
:root {
  --dt-ink: #f3ede2;
  --dt-moon: #f3d58a;
  --dt-line: rgba(243, 213, 138, 0.3);
  --dt-line-soft: rgba(243, 237, 226, 0.16);
  --dt-panel: rgba(9, 14, 30, 0.97);
}

/* ── Vùng chạm & cỡ chữ ────────────────────────────────────────────────── */
.top-hud .icon-btn, .top-hud .stat-chip { min-height: 44px; min-width: 44px; font-size: 13px; justify-content: center; white-space: nowrap; }
.top-hud .quiet-mode-button { position: static; inset: auto; z-index: auto; padding: 0 12px; color: inherit; }
.orb-btn { min-height: 44px; }
.orb-label { font-size: 13px; }
.cam-btn { min-height: 44px; min-width: 44px; font-size: 13px; }
.modal-close-btn, .drawer-close { min-width: 44px; min-height: 44px; }
.drawer-tab { min-height: 44px; font-size: 13px; }
.emote-btn { min-height: 44px; min-width: 44px; }
.quick-prayer-form button, .quick-prayer-form input { min-height: 44px; font-size: 14px; }
.quick-prayer-form input { font-size: 16px; } /* < 16px thì Safari iPhone tự phóng to trang khi gõ */
.dock-sub { font-size: 12.5px; }
.practice-session-banner { font-size: 12.5px; }
.brand-sub { font-size: 12.5px; }
.empty-note { padding: 28px 18px; text-align: center; color: #cbd5e1; font-size: 15px; line-height: 1.6; }
.crisis-note { text-align: left; color: var(--dt-ink); }
.crisis-note strong { display: block; margin-bottom: 6px; color: var(--dt-moon); font-size: 16px; }
.crisis-note small { display: block; margin-top: 8px; color: #cbd5e1; }
@media (max-width: 400px) { .empty-note { padding: 14px 12px; font-size: 14px; line-height: 1.5; } }

/* ── Một tiêu điểm: bỏ cột nút nổi ─────────────────────────────────────────
   Hồ Sen lên thanh trên; Sớ khấn & Tu tập vào "Thêm"; Bảng Vàng bỏ hẳn.
   Bảng Radar & Đám Đông chỉ hiện khi Cửa sổ thị trường đang mở. */
.floating-feature-orbs .orb-btn { display: none; }
html.market-open #btnOpenLeftDrawer, html.market-open #btnOpenRightCrowd { display: flex; }
html:not(.market-open) #rightWallDrawer [data-right-tab="crowd"] { display: none; }
#rightWallDrawer .drawer-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
html:not(.market-open) #rightWallDrawer .drawer-tabs { grid-template-columns: 1fr; }
html:not(.market-open) .prayer-ticker-tag { display: none; }
.hud-ho-sen { border-color: rgba(244, 166, 193, 0.55) !important; }

/* ── Thanh nghi lễ: 3 nghi thức + Thêm (mọi khổ màn) ──────────────────── */
.bottom-dock {
  display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); grid-auto-rows: minmax(56px, auto); align-items: stretch;
  background: var(--dt-panel); border: 1px solid var(--dt-line); box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}
.bottom-dock .dock-btn { min-width: 0; min-height: 56px; border-color: var(--dt-line-soft); }
.bottom-dock .dock-btn:hover { border-color: var(--dt-moon); background: rgba(243, 213, 138, 0.1); }
.bottom-dock .dock-btn.is-busy { opacity: 0.6; }
#dockBtnWoodfish { order: 1; }
#dockBtnBell { order: 2; }
#dockBtnOffering { order: 3; }
.dock-more, #dockBtnMore { order: 4; display: flex; justify-content: center; }
#dockBtnEnter, #dockBtnFortune, #dockBtnSoKhan, #dockBtnTuTap, #dockBtnCert { display: none; }
/* Trong "Thêm": việc tĩnh tâm (Sớ khấn, Tu tập) trước, việc liên quan cổ phiếu sau */
#dockBtnSoKhan { order: 5; } #dockBtnTuTap { order: 6; } #dockBtnEnter { order: 7; } #dockBtnFortune { order: 8; } #dockBtnCert { order: 9; }
#templeStage:has(.bottom-dock.more-open) .camera-controls { visibility: hidden; }
.bottom-dock.more-open #dockBtnEnter, .bottom-dock.more-open #dockBtnFortune, .bottom-dock.more-open #dockBtnSoKhan,
.bottom-dock.more-open #dockBtnTuTap, .bottom-dock.more-open #dockBtnCert { display: flex; }

/* ── Bảng nhịp nghi lễ (vòng mõ, ba hồi chuông) ────────────────────────── */
.ritual-panel {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(520px, calc(100vw - 24px));
  padding: 8px 8px 8px 14px; border-radius: 18px; background: var(--dt-panel); border: 1px solid var(--dt-line);
  color: var(--dt-ink); font: 600 14.5px/1.35 var(--font-vn); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.ritual-panel[hidden] { display: none; }
body:has(.bottom-dock.more-open) .ritual-panel { display: none; } /* không đè lên phần "Thêm" */
.rp-ring { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--dt-moon); opacity: 0.8; }
.ritual-panel.breathing .rp-ring { animation: dt-breathe 5s ease-in-out infinite; }
@keyframes dt-breathe { 0%, 100% { transform: scale(0.6); opacity: 0.5; } 45% { transform: scale(1.25); opacity: 1; } }
.rp-text { flex: 1; }
.rp-stop { flex: none; min-height: 44px; min-width: 64px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--dt-line-soft);
  background: transparent; color: var(--dt-ink); font: 600 14px var(--font-vn); cursor: pointer; }
.rp-stop[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .ritual-panel.breathing .rp-ring { animation: none; } }
.quiet-mode .ritual-panel.breathing .rp-ring { animation: none; }

/* Máy tính: mở "Thêm" thì thêm hàng thứ hai/ba, nút Thu gọn giữ chỗ cũ */
@media (min-width: 769px) {
  .bottom-dock { width: min(860px, 96vw); }
  .bottom-dock.more-open #dockBtnMore { order: 4; }
}

@media (max-width: 768px) {
  /* Biển tên trùng với chữ vẽ sẵn trong tranh → ẩn trên điện thoại, nhường chỗ cho tranh */
  .brand-plaque { display: none; }
  .top-hud-row { justify-content: flex-end; }

  /* Hàng camera: chụm hai ngón để phóng to/thu nhỏ nên bỏ ➖ ➕; đặt cao hơn thanh nghi lễ */
  #btnZoomOut, #btnZoomIn { display: none; }
  .camera-controls { bottom: 84px; }
  .floating-feature-orbs { top: 60px; gap: 4px; }
  /* Ngăn kéo dạng tấm trượt: đứng trên thanh nghi lễ (56px + đệm) */
  .side-drawer { bottom: 82px; max-height: min(440px, calc(100dvh - 150px)); }
  .ritual-panel { bottom: 140px; }

  .bottom-dock { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bottom-dock .dock-title { white-space: normal; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.2; text-align: center; }
  .bottom-dock .dock-sub { display: none; }
  .bottom-dock.more-open { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bottom-dock.more-open #dockBtnMore { order: 10; grid-column: 1 / -1; min-height: 44px; flex-direction: row; gap: 6px; }
}

@media (max-width: 430px) {
  /* Điện thoại: thanh trên có 7 nút → nút Thị trường chỉ còn biểu tượng (vẫn có aria-label) */
  .mw-toggle .mw-label { display: none; }
  .top-hud .hud-actions { gap: 4px; }
}
@media (max-width: 360px) {
  /* iPhone SE: bỏ thêm ô đếm số kết nối */
  .top-hud .stat-chip { display: none; }
}
