:root {
  --gold-bright: #ffd97d;
  --gold-mid: #e6b44c;
  --gold-deep: #9c6b19;
  --bg-glass: rgba(24, 15, 9, 0.78);
  --bg-glass-strong: rgba(20, 12, 7, 0.90);
  --border-gold: rgba(255, 214, 126, 0.34);
  --border-gold-strong: rgba(255, 217, 125, 0.72);
  --text-cream: #fff7e8;
  --text-muted: #d6c09d;
  --accent-crimson: #9e222e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #120a05;
  color: var(--text-cream);
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  user-select: none;
}

input,
textarea {
  user-select: text;
  font-family: inherit;
}

.is-hidden {
  display: none !important;
}

/* ==========================================================================
   3D CANVAS, VIGNETTE & PROJECTED WORLD OVERLAYS
   ========================================================================== */
#cathedral-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  display: block;
  z-index: 1;
  cursor: grab;
  touch-action: none;
}

#cathedral-canvas:active {
  cursor: grabbing;
}

.sacred-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    circle at 50% 42%,
    rgba(255, 214, 133, 0.03) 0%,
    rgba(16, 8, 3, 0.18) 72%,
    rgba(10, 5, 2, 0.52) 100%
  );
}

#world-overlay-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  contain: layout style paint;
  z-index: 3;
}

.p-nameplate {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, 0);
  will-change: transform;
  contain: layout style;
  pointer-events: none;
  white-space: nowrap;
}

.p-nameplate-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(20, 12, 7, 0.78);
  border: 1px solid rgba(255, 216, 132, 0.32);
  color: #fff5e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.p-nameplate-pill.is-self {
  background: linear-gradient(135deg, rgba(84, 52, 12, 0.92), rgba(45, 26, 7, 0.92));
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(255, 210, 105, 0.35);
}

.p-nameplate-pill.is-priest {
  background: linear-gradient(135deg, rgba(124, 24, 34, 0.92), rgba(66, 12, 18, 0.92));
  border-color: var(--gold-bright);
  color: #ffe8a6;
}

.p-nameplate-pill.is-lector {
  background: linear-gradient(135deg, rgba(30, 68, 124, 0.92), rgba(18, 38, 74, 0.92));
  border-color: #a3c8ff;
  color: #eef5ff;
}

.p-bubble {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  will-change: transform;
  contain: layout style;
  max-width: 240px;
  padding: 7px 12px;
  border-radius: 14px;
  background: rgba(255, 250, 238, 0.96);
  color: #2c190b;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.38;
  text-align: center;
  border: 1.5px solid #e7b95c;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
  animation: bubblePop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.p-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: rgba(255, 250, 238, 0.96);
  border-right: 1.5px solid #e7b95c;
  border-bottom: 1.5px solid #e7b95c;
}

@keyframes bubblePop {
  from {
    opacity: 0;
    transform: translate(-50%, -86%) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

/* ==========================================================================
   MINIMALIST SMOKED-GLASS HUD UTILITIES & SVG LINE ICONS
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ui-svg-icon {
  width: 16.5px;
  height: 16.5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.ui-svg-icon.is-gold {
  color: #e9d99a;
}

/* Clean View Mode (Hides all 2D HUD chrome so 100% of 3D Cathedral shines) */
body.is-hud-hidden #top-hud,
body.is-hud-hidden #right-action-dock,
body.is-hud-hidden #bottom-left-controls,
body.is-hud-hidden #bottom-interaction-dock,
body.is-hud-hidden #bottom-right-audio,
body.is-hud-hidden #chat-panel,
body.is-hud-hidden #honor-side-left-wrap,
body.is-hud-hidden #honor-side-right-wrap {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(4px);
}

.restore-hud-fab {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 38;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(15, 16, 20, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f3f1eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.restore-hud-fab:hover {
  background: rgba(28, 30, 36, 0.9);
  border-color: rgba(233, 217, 154, 0.48);
  color: #f5e6ad;
}

/* ==========================================================================
   TOP HUD BAR (3 FLOATING ISLANDS: BRAND • CENTER CAPSULE • QUICK ICONS)
   ========================================================================== */
#top-hud {
  position: fixed;
  top: 12px;
  left: 14px;
  right: 14px;
  z-index: 22;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.hud-left > *,
.hud-center > *,
.hud-right {
  pointer-events: auto;
}

.hud-left {
  position: relative;
  justify-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
  min-width: 0;
}

.brand-card-wrap {
  position: relative;
}

.church-brand-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px 7px 9px;
  border-radius: 13px;
  background: rgba(20, 15, 19, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
}

.brand-emblem {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(145deg, #e63b52, #b81f37);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(224, 52, 78, 0.35);
}

.brand-texts {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-title {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 13.8px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f6f4ef;
  line-height: 1.18;
  white-space: nowrap;
}

.brand-subline {
  font-size: 8.6px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(240, 236, 228, 0.48);
  white-space: nowrap;
}

/* Top-Center Status & Online Parishioners Capsule */
.hud-center {
  position: relative;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.top-status-capsule {
  pointer-events: auto;
  height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  background: rgba(15, 16, 20, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.capsule-live-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #eef0ea;
  white-space: nowrap;
}

.capsule-live-state.is-active {
  color: #f7e49c;
}

.capsule-live-state.is-active .online-dot {
  background: #f5c84c;
  box-shadow: 0 0 9px rgba(245, 200, 76, 0.9);
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #84e17b;
  box-shadow: 0 0 8px rgba(132, 225, 123, 0.85);
  flex-shrink: 0;
}

.capsule-divider {
  width: 1px;
  height: 19px;
  background: rgba(255, 255, 255, 0.11);
  flex-shrink: 0;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: rgba(242, 240, 234, 0.88);
  font-family: inherit;
  cursor: pointer;
  padding: 3px 2px;
  border-radius: 8px;
  transition: color 0.15s ease;
}

.online-pill:hover {
  color: #f5e6ad;
}

.online-metrics-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.18;
  text-align: left;
}

.om-primary {
  font-size: 11.4px;
  font-weight: 600;
  color: #f2f1ec;
  white-space: nowrap;
}

.om-secondary {
  font-size: 10.2px;
  font-weight: 500;
  color: rgba(235, 232, 224, 0.52);
  white-space: nowrap;
}

/* Online Parishioners Popover (Centered Underneath Status Capsule) */
.online-popover {
  pointer-events: auto;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 34;
  width: 288px;
  max-height: 316px;
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  background: rgba(16, 17, 22, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.58);
  overflow: hidden;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #f3e4aa;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.icon-close {
  background: transparent;
  border: none;
  color: rgba(240, 236, 228, 0.6);
  font-size: 13.5px;
  cursor: pointer;
  padding: 2px 4px;
}

.icon-close:hover {
  color: #ffffff;
}

.online-list {
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.online-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.2px;
  color: #f3f1eb;
}

.online-item.is-me {
  background: rgba(222, 235, 176, 0.13);
  border: 1px solid rgba(222, 235, 176, 0.30);
}

.online-item-pose {
  font-size: 10.8px;
  color: rgba(235, 232, 224, 0.56);
}

/* Top-Right Sleek Pill, Uniform 36x36 Icon Squares & Circular Avatar */
.hud-right {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.top-wallet-pill {
  height: 36px;
  padding: 0 13px;
  border-radius: 10px;
  background: rgba(34, 40, 26, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 228, 162, 0.24);
  color: #eef3df;
  font-family: inherit;
  font-size: 12.4px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.top-wallet-pill:hover {
  background: rgba(46, 54, 34, 0.88);
  border-color: rgba(226, 240, 178, 0.44);
}

.hud-icon-sq {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(16, 17, 22, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(242, 240, 234, 0.86);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.hud-icon-sq:hover {
  background: rgba(28, 30, 38, 0.88);
  border-color: rgba(255, 255, 255, 0.20);
  color: #ffffff;
}

.hud-icon-sq.is-active {
  background: rgba(224, 236, 178, 0.16);
  border-color: rgba(224, 236, 178, 0.42);
  color: #e8f2c2;
}

.my-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(140deg, #e2ecc0, #c4d694);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #191e11;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34);
  transition: transform 0.15s ease, filter 0.15s ease;
  flex-shrink: 0;
}

.my-avatar-circle:hover {
  transform: scale(1.04);
  filter: brightness(1.06);
}

/* ==========================================================================
   HOLY MASS LITURGICAL SUBTITLE CARD (CLEAN TOP-LEFT OVERLAY LIKE "TRÊN MÀN ẢNH")
   ========================================================================== */
.mass-liturgy-card {
  position: relative;
  width: min(326px, calc(100vw - 24px));
  padding: 10px 13px;
  border-radius: 14px;
  background: rgba(14, 15, 20, 0.68);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
  transition: padding 0.16s ease, background 0.16s ease;
}

.mass-liturgy-card:hover {
  background: rgba(16, 18, 24, 0.80);
}

.mlc-eyebrow {
  font-size: 9.2px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(235, 232, 224, 0.50);
  margin-bottom: 3px;
}

.mlc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  user-select: none;
}

.mass-liturgy-card.is-collapsed .mlc-header {
  margin-bottom: 0;
}

.mass-liturgy-card.is-collapsed .mlc-body {
  display: none;
}

.mlc-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mlc-heading {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.28;
  font-weight: 800;
  color: #f7f5ef;
}

.mlc-posture {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(224, 236, 178, 0.14);
  border: 1px solid rgba(224, 236, 178, 0.32);
  color: #e9f2c6;
  font-size: 10.2px;
  font-weight: 700;
  white-space: nowrap;
}

.mlc-toggle-btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #eae6dc;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}

.mlc-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.mlc-subtitle {
  font-size: 11.8px;
  line-height: 1.44;
  color: rgba(248, 246, 240, 0.92);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mlc-response {
  font-size: 11.2px;
  line-height: 1.36;
  font-weight: 600;
  color: #e8dfa6;
}

.mlc-progress-track {
  margin-top: 7px;
  height: 2.5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.11);
  overflow: hidden;
}

.mlc-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b8d273, #e7f1b5);
  transition: width 0.4s linear;
}

/* ==========================================================================
   TOP TOASTS (SUBTLE FLOATING PILL UNDER CENTER CAPSULE)
   ========================================================================== */
#center-toast-layer {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  max-width: min(440px, 86vw);
}

.sacred-toast {
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 16, 21, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f6f3ec;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
  animation: toastInOut 4.2s ease forwards;
}

@keyframes toastInOut {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  12% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  84% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

/* ==========================================================================
   RIGHT-SIDE VERTICAL FLOATING ACTION DOCK (SLEEK COLLAPSIBLE ICON RAIL)
   ========================================================================== */
.right-vertical-dock {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 23;
  width: 58px;
  padding: 8px 4px;
  border-radius: 18px;
  background: rgba(15, 16, 20, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.44);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: opacity 0.2s ease, padding 0.16s ease;
}

.dock-collapse-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(242, 240, 234, 0.88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, transform 0.2s ease;
}

.dock-collapse-circle:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.right-vertical-dock.is-collapsed {
  padding: 6px;
  border-radius: 999px;
  width: auto;
}

.right-vertical-dock.is-collapsed .right-dock-items {
  display: none;
}

.right-vertical-dock.is-collapsed #dock-chevron-svg {
  transform: rotate(180deg);
}

.right-dock-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 100%;
  max-height: calc(100dvh - 182px);
  overflow-y: auto;
  scrollbar-width: none;
}

.right-dock-items::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.dock-item-btn {
  width: 50px;
  padding: 6px 2px 5px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(242, 240, 234, 0.88);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
  flex-shrink: 0;
}

.dock-item-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.dock-item-btn.is-active {
  background: rgba(224, 236, 178, 0.15);
  border-color: rgba(224, 236, 178, 0.34);
  color: #e8f2c2;
}

.dock-item-btn.is-disabled,
.dock-item-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.dock-item-btn.is-mass-locked {
  opacity: 0.48;
  cursor: not-allowed;
}

.bl-room-pill.is-mass-locked {
  opacity: 0.56;
  cursor: not-allowed;
  background: rgba(42, 34, 22, 0.76);
  border-color: rgba(242, 199, 110, 0.28);
  color: rgba(255, 232, 186, 0.82);
}

.dock-svg {
  width: 18.5px;
  height: 18.5px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.dock-lbl {
  font-size: 9.5px;
  font-weight: 500;
  line-height: 1.15;
  color: rgba(235, 232, 224, 0.68);
  white-space: nowrap;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-item-btn:hover .dock-lbl,
.dock-item-btn.is-active .dock-lbl {
  color: currentColor;
}

.dock-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dock-badge {
  position: absolute;
  top: -6px;
  right: -9px;
  min-width: 16px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 9.2px;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.dock-badge.is-amber {
  background: #d5e698;
  color: #191f0f;
}

/* ==========================================================================
   BOTTOM BAR — ZONE 1: BOTTOM-LEFT QUICK VIEW CAPSULE & CONFESSIONAL ROOM PILL
   ========================================================================== */
.bottom-left-controls {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  transition: opacity 0.2s ease;
}

.bl-exit-sq {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(15, 16, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(240, 236, 228, 0.78);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.30);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bl-exit-sq:hover {
  background: rgba(128, 28, 38, 0.82);
  border-color: rgba(255, 164, 174, 0.42);
  color: #ffffff;
}

.bl-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bl-icon-capsule {
  height: 40px;
  padding: 0 5px;
  border-radius: 12px;
  background: rgba(15, 16, 20, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.bl-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: rgba(242, 240, 234, 0.84);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.bl-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.bl-icon-btn.is-active {
  background: rgba(224, 236, 178, 0.16);
  color: #e8f2c2;
}

.bl-room-pill {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(34, 40, 26, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 228, 162, 0.24);
  color: #eef3df;
  font-family: inherit;
  font-size: 12.4px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.bl-room-pill:hover,
.bl-room-pill.is-active {
  background: rgba(46, 55, 34, 0.90);
  border-color: rgba(226, 240, 178, 0.46);
}

/* ==========================================================================
   BOTTOM BAR — ZONE 2: BOTTOM-CENTER INLINE CHAT CAPSULE & PROXIMITY PROMPT
   ========================================================================== */
.bottom-dock {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: min(432px, calc(100vw - 472px));
  min-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.proximity-prompt {
  pointer-events: auto;
  padding: 6px 15px;
  border-radius: 999px;
  background: rgba(24, 28, 20, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(222, 236, 172, 0.45);
  color: #f3f7e6;
  font-family: inherit;
  font-size: 12.2px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.44);
  animation: pulsePrompt 2s infinite ease-in-out;
}

@keyframes pulsePrompt {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.controls-hint {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(14, 15, 20, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(235, 232, 224, 0.68);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: opacity 0.5s ease;
  white-space: nowrap;
}

.controls-hint.is-faded {
  opacity: 0;
  pointer-events: none;
}

.quick-prayers-popover {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  padding: 7px 9px;
  border-radius: 13px;
  background: rgba(16, 17, 22, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.48);
}

.qp-chip {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f2efe7;
  font-family: inherit;
  font-size: 11.4px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.qp-chip:hover {
  background: rgba(224, 236, 178, 0.16);
  border-color: rgba(224, 236, 178, 0.36);
  color: #f5f9e6;
}

.bottom-chat-capsule {
  pointer-events: auto;
  width: 100%;
  height: 40px;
  padding: 0 5px 0 7px;
  border-radius: 12px;
  background: rgba(15, 16, 20, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.bottom-chat-capsule:focus-within {
  background: rgba(18, 19, 25, 0.88);
  border-color: rgba(224, 236, 178, 0.38);
}

.chat-emoji-btn,
.chat-send-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: rgba(240, 236, 228, 0.68);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.14s ease, color 0.14s ease;
}

.chat-emoji-btn:hover,
.chat-emoji-btn.is-active,
.chat-send-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f3f1eb;
}

#chat-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 2px;
  background: transparent;
  border: none;
  color: #f5f3ed;
  font-size: 12.8px;
  outline: none;
}

#chat-input::placeholder {
  color: rgba(235, 232, 224, 0.40);
}

.chat-char-count {
  font-size: 10.4px;
  font-weight: 500;
  color: rgba(235, 232, 224, 0.34);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================================================
   BOTTOM BAR — ZONE 3: BOTTOM-RIGHT AUDIO & LOCAL VOLUME CAPSULE
   ========================================================================== */
.bottom-right-audio {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  transition: opacity 0.2s ease;
}

.br-audio-capsule {
  height: 40px;
  padding: 0 7px;
  border-radius: 12px;
  background: rgba(15, 16, 20, 0.76);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.br-icon-btn {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: rgba(242, 240, 234, 0.84);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.br-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.br-icon-btn.is-muted {
  color: #f87171;
}

.br-vol-pct {
  height: 30px;
  padding: 0 7px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #eef0ea;
  font-family: inherit;
  font-size: 11.8px;
  font-weight: 600;
  cursor: pointer;
  min-width: 44px;
  text-align: right;
  transition: background 0.14s ease, color 0.14s ease;
}

.br-vol-pct:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e8f2c2;
}

.local-vol-popover {
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(16, 17, 22, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.48);
  display: flex;
  align-items: center;
}

#inp-local-vol {
  width: 118px;
  accent-color: #d5e698;
  cursor: pointer;
}

/* ==========================================================================
   MOBILE VIRTUAL TOUCH JOYSTICK
   ========================================================================== */
.joystick-zone {
  position: fixed;
  left: 20px;
  bottom: 72px;
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  touch-action: none;
}

.joystick-base {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.10) 0%, rgba(15, 16, 20, 0.62) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42);
}

.joystick-stick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  margin-left: -21px;
  margin-top: -21px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #eef4d4, #aebf78);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.joystick-caption {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(240, 236, 228, 0.62);
}

/* ==========================================================================
   FLOATING CHAT HISTORY DRAWER (TOGGLED FROM RIGHT DOCK "TRÒ CHUYỆN")
   ========================================================================== */
.chat-panel {
  position: fixed;
  right: 84px;
  bottom: 64px;
  z-index: 24;
  width: 326px;
  height: min(334px, 45dvh);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: rgba(16, 17, 22, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.56);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-header-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f3f1eb;
}

.chat-min-btn {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(242, 240, 234, 0.78);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.chat-min-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 99px;
}

.chat-msg {
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 12.3px;
  line-height: 1.42;
  word-break: break-word;
}

.chat-msg.is-mine {
  background: rgba(224, 236, 178, 0.12);
  border: 1px solid rgba(224, 236, 178, 0.25);
}

.chat-msg.is-candle {
  background: rgba(255, 196, 92, 0.12);
  border-left: 2.5px solid #f3c868;
}

.chat-msg.is-system {
  background: rgba(224, 62, 82, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.chat-sender {
  font-weight: 700;
  color: #e7efc2;
}

.chat-time {
  font-size: 10.2px;
  color: rgba(240, 236, 228, 0.45);
}

.chat-text {
  color: #f6f4ef;
}

/* ==========================================================================
   ENTRY / ONBOARDING MODAL & CANDLE MODAL
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 5, 2, 0.62);
  backdrop-filter: blur(7px);
}

.entry-card {
  width: min(492px, 100%);
  max-height: calc(100dvh - 22px);
  overflow-y: auto;
  padding: 18px 20px 18px;
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(36, 22, 12, 0.96), rgba(18, 10, 5, 0.97));
  border: 1.5px solid rgba(255, 214, 124, 0.52);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.72), 0 0 40px rgba(255, 194, 82, 0.14);
  text-align: center;
}

.entry-card::-webkit-scrollbar {
  width: 5px;
}

.entry-card::-webkit-scrollbar-thumb {
  background: rgba(255, 214, 124, 0.28);
  border-radius: 99px;
}

.entry-crest {
  font-size: 28px;
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(255, 209, 102, 0.75);
  margin-bottom: 2px;
}

.entry-title {
  font-family: 'Cinzel', serif;
  font-size: 21px;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.entry-subtitle {
  font-size: 12.4px;
  line-height: 1.44;
  color: var(--text-muted);
  margin-bottom: 13px;
}

.form-field {
  text-align: left;
  margin-bottom: 11px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #ffe5aa;
  margin-bottom: 5px;
}

#inp-nickname,
#inp-candle-prayer {
  width: 100%;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(10, 6, 3, 0.78);
  border: 1.5px solid rgba(255, 214, 126, 0.34);
  color: #fff9ef;
  font-size: 13.8px;
  font-weight: 500;
  outline: none;
}

#inp-nickname:focus,
#inp-candle-prayer:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(255, 217, 125, 0.18);
}

.gender-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gender-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 214, 126, 0.22);
  color: var(--text-cream);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}

.gender-card:hover {
  background: rgba(255, 214, 126, 0.09);
}

.gender-card.is-selected {
  background: linear-gradient(145deg, rgba(138, 88, 18, 0.48), rgba(74, 44, 9, 0.62));
  border-color: var(--gold-bright);
  box-shadow: 0 0 16px rgba(255, 206, 98, 0.24);
}

.gender-avatar {
  font-size: 24px;
  flex-shrink: 0;
}

.gender-card-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.gender-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--gold-bright);
}

.gender-outfit-hint {
  font-size: 10.6px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outfit-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.outfit-label-row label {
  margin-bottom: 0;
}

.outfit-selected-name {
  font-size: 11.4px;
  font-weight: 700;
  color: #ffd982;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.look-chip-grid {
  display: grid;
  gap: 6px;
}

.body-type-grid,
.hair-style-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.accessory-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.look-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6.5px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 214, 126, 0.22);
  color: rgba(255, 245, 224, 0.88);
  font-family: inherit;
  font-size: 11.3px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.14s ease;
}

.accessory-grid .look-chip {
  flex: 1 1 auto;
  padding: 6px 9px;
}

.look-chip:hover {
  background: rgba(255, 214, 126, 0.12);
  border-color: rgba(255, 214, 126, 0.48);
}

.look-chip.is-selected {
  background: linear-gradient(145deg, rgba(164, 108, 22, 0.52), rgba(92, 56, 12, 0.68));
  border-color: var(--gold-bright);
  color: #fff9e8;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(255, 206, 98, 0.22);
}

.outfit-swatches {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  justify-items: center;
  gap: 9px 8px;
  padding: 4px 2px;
}

.swatch-btn {
  width: 33px;
  height: 33px;
  border-radius: 50%;
  border: 2.2px solid rgba(255, 255, 255, 0.30);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.swatch-btn:hover {
  transform: scale(1.09);
}

.swatch-btn.is-selected {
  border-color: var(--gold-bright);
  transform: scale(1.16);
  box-shadow: 0 0 0 3px rgba(255, 217, 125, 0.36);
}

@media (max-width: 460px) {
  .entry-card {
    padding: 15px 14px 15px;
  }

  .body-type-grid,
  .hair-style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gender-outfit-hint {
    display: none;
  }
}

.entry-error {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(180, 34, 48, 0.28);
  border: 1px solid rgba(255, 130, 142, 0.5);
  color: #ffd4d8;
  font-size: 12.5px;
  line-height: 1.45;
}

.entry-error.is-notice {
  background: rgba(212, 158, 53, 0.2);
  border: 1px solid rgba(255, 212, 122, 0.52);
  color: #ffefc6;
}

.entry-disclaimer-box {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 4px 0 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(245, 176, 65, 0.11);
  border: 1px solid rgba(255, 206, 108, 0.38);
  text-align: left;
}

.queue-disclaimer-box {
  margin-top: 10px;
}

.entry-disclaimer-icon {
  font-size: 14px;
  line-height: 1.35;
  flex-shrink: 0;
}

.entry-disclaimer-text {
  font-size: 11.8px;
  line-height: 1.46;
  color: rgba(255, 241, 210, 0.92);
}

.entry-disclaimer-text b {
  color: #ffd982;
  font-weight: 700;
}

.entry-actions,
.candle-dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.btn-primary {
  flex: 1;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f3c45c, #bd811b);
  border: none;
  color: #1f1103;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(204, 140, 28, 0.36);
  transition: transform 0.14s ease, filter 0.14s ease;
}

.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-secondary {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 214, 126, 0.30);
  color: var(--text-cream);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.entry-capacity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: -6px auto 15px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(110, 231, 183, 0.34);
  color: #d9ffe9;
  font-size: 12px;
  font-weight: 700;
}

.entry-capacity-pill.is-full {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(252, 211, 77, 0.48);
  color: #ffe59e;
}

.queue-waiting-box {
  padding-top: 4px;
  text-align: center;
}

.queue-hourglass-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 106, 0.24) 0%, rgba(120, 74, 12, 0.18) 100%);
  border: 1.5px solid rgba(255, 214, 124, 0.5);
  box-shadow: 0 0 22px rgba(255, 196, 76, 0.22);
}

.queue-hourglass {
  font-size: 27px;
  display: inline-block;
  animation: queueHourglassSway 2.4s ease-in-out infinite;
}

@keyframes queueHourglassSway {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.08); }
}

.queue-status-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--gold-bright);
  margin-bottom: 6px;
}

.queue-status-desc {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.queue-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 13px;
}

.queue-metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 214, 126, 0.25);
}

.qm-label {
  font-size: 11px;
  color: var(--text-muted);
}

.qm-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-cream);
}

.qm-value.qm-highlight {
  font-size: 18px;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.45);
}

.queue-live-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: rgba(255, 214, 126, 0.08);
  border: 1px solid rgba(255, 214, 126, 0.2);
  color: #ffeac0;
  font-size: 11.5px;
  font-weight: 600;
}

.queue-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  animation: queuePulseDot 1.5s ease-in-out infinite;
}

@keyframes queuePulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.82); }
}

.queue-leave-btn {
  flex: 1;
}

.candle-dialog {
  width: min(400px, 100%);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(36, 22, 12, 0.97), rgba(18, 10, 5, 0.98));
  border: 1.5px solid rgba(255, 214, 124, 0.52);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.7);
}

.candle-dialog-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--gold-bright);
  margin-bottom: 6px;
}

.candle-dialog-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

#inp-candle-prayer {
  margin-bottom: 12px;
}

/* ==========================================================================
   HONOR DONATION BOARDS (BẢNG CÔNG ÍCH Ở 2 BÊN TRÁI & PHẢI MÀN HÌNH)
   ========================================================================== */
.act-btn-honor {
  background: linear-gradient(135deg, rgba(168, 110, 22, 0.86), rgba(96, 56, 10, 0.86));
  border-color: rgba(255, 220, 130, 0.72);
  color: #fff6dc;
  box-shadow: 0 0 12px rgba(255, 200, 88, 0.22);
}

.act-btn-honor:hover {
  background: linear-gradient(135deg, rgba(196, 132, 30, 0.94), rgba(114, 68, 12, 0.94));
}

.honor-side-wrap {
  position: relative;
  z-index: 21;
}

.honor-right-wrap {
  position: fixed;
  top: 62px;
  right: 84px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: auto;
}

.honor-board-panel {
  width: 262px;
  max-height: min(352px, calc(100dvh - 180px));
  display: flex;
  flex-direction: column;
  border-radius: 15px;
  background: rgba(16, 17, 22, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

body.is-mass-active .honor-left-wrap .honor-board-panel {
  max-height: min(352px, calc(100dvh - 308px));
}

.honor-right-wrap .honor-board-panel {
  width: 264px;
  max-height: min(334px, calc(100dvh - 88px - min(334px, 45dvh)));
}

body.is-chat-minimized .honor-right-wrap .honor-board-panel {
  max-height: min(344px, calc(100dvh - 134px));
}

.hb-clickable-board {
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.hb-clickable-board:hover {
  border-color: rgba(255, 224, 145, 0.78);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.56), 0 0 18px rgba(255, 200, 92, 0.16);
}

.hb-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  background: linear-gradient(90deg, rgba(255, 206, 105, 0.14), rgba(255, 206, 105, 0.05));
  border-bottom: 1px solid rgba(255, 214, 126, 0.22);
}

.hb-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hb-expand-modal-btn {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid rgba(255, 214, 126, 0.30);
  background: rgba(255, 214, 126, 0.10);
  color: var(--gold-bright);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hb-expand-modal-btn:hover {
  background: rgba(255, 214, 126, 0.26);
}

.hb-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hb-title-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hb-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.hb-title {
  font-family: 'Cinzel', serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.025em;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb-sub-tag {
  font-size: 9.8px;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 226, 166, 0.78);
  margin-top: 1px;
}

.hb-collapse-btn {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 7px;
  border: 1px solid rgba(255, 214, 126, 0.30);
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.hb-collapse-btn:hover {
  background: rgba(255, 214, 126, 0.2);
}

.hb-purpose-note {
  flex-shrink: 0;
  padding: 4px 10px;
  background: rgba(255, 206, 105, 0.08);
  border-bottom: 1px solid rgba(255, 214, 126, 0.18);
  font-size: 10.4px;
  font-weight: 500;
  line-height: 1.3;
  color: #f4dfb8;
}

.hb-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hb-list::-webkit-scrollbar {
  width: 4px;
}

.hb-list::-webkit-scrollbar-thumb {
  background: rgba(255, 214, 126, 0.28);
  border-radius: 99px;
}

.hb-empty {
  padding: 12px 8px;
  text-align: center;
  font-size: 11.2px;
  line-height: 1.42;
  color: var(--text-muted);
}

.hb-item {
  padding: 5px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 214, 126, 0.16);
  transition: background 0.14s ease, border-color 0.14s ease;
}

.hb-clickable-board .hb-item:hover {
  background: rgba(255, 214, 126, 0.11);
  border-color: rgba(255, 216, 128, 0.36);
}

.hb-item.is-top-rank {
  background: linear-gradient(135deg, rgba(255, 200, 88, 0.14), rgba(145, 92, 18, 0.14));
  border-color: rgba(255, 216, 125, 0.42);
}

.hb-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.hb-item-who {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
}

.hb-rank-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--gold-bright);
}

.hb-item-name {
  font-size: 11.8px;
  font-weight: 700;
  color: #fff6e4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb-item-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.hb-item-time {
  font-size: 9.8px;
  font-weight: 600;
  color: rgba(235, 210, 165, 0.72);
  white-space: nowrap;
}

.hb-item-amt {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 212, 118, 0.16);
  border: 1px solid rgba(255, 212, 118, 0.34);
  font-size: 10.3px;
  font-weight: 800;
  color: #ffe08a;
}

.hb-item-msg {
  margin-top: 2px;
  font-size: 10.8px;
  line-height: 1.3;
  color: #e4cca5;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hb-pager-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 4px 8px;
  background: rgba(255, 206, 105, 0.06);
  border-top: 1px solid rgba(255, 214, 126, 0.16);
}

.hb-page-btn {
  padding: 3px 7px;
  border-radius: 7px;
  border: 1px solid rgba(255, 214, 126, 0.32);
  background: rgba(255, 214, 126, 0.12);
  color: #ffe8a8;
  font-size: 10.2px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, opacity 0.14s ease;
}

.hb-page-btn:hover:not(:disabled) {
  background: rgba(255, 214, 126, 0.26);
  color: #fff;
}

.hb-page-btn:disabled {
  opacity: 0.36;
  cursor: default;
}

.hb-page-info-btn {
  flex: 1;
  min-width: 0;
  padding: 2px 5px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 214, 126, 0.24);
  background: transparent;
  color: #f2d9a6;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.hb-page-info-btn:hover {
  background: rgba(255, 214, 126, 0.12);
  color: #fff4d8;
}

.hb-footer {
  flex-shrink: 0;
  padding: 6px 8px 7px;
  border-top: 1px solid rgba(255, 214, 126, 0.16);
}

.hb-donate-btn {
  width: 100%;
  padding: 6px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ecc05d, #b87c19);
  border: none;
  color: #201103;
  font-size: 11.8px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.hb-donate-btn:hover {
  filter: brightness(1.08);
}

.honor-edge-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(124, 78, 16, 0.92), rgba(58, 34, 7, 0.92));
  border: 1px solid var(--border-gold-strong);
  color: #ffe8a8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.honor-edge-tab:hover {
  filter: brightness(1.1);
}

/* ==========================================================================
   FULL ON-SCREEN HONOR BOARD POPUP MODAL (#honor-board-modal)
   ========================================================================== */
.honor-modal-dialog {
  width: min(640px, 100%);
  max-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(38, 23, 12, 0.98), rgba(16, 8, 4, 0.99));
  border: 1.5px solid rgba(255, 214, 124, 0.62);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.82), 0 0 46px rgba(255, 196, 84, 0.18);
  overflow: hidden;
}

.honor-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  margin-bottom: 11px;
  border-bottom: 1px solid rgba(255, 214, 126, 0.22);
}

.hbm-crest-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.hbm-crest {
  font-size: 20px;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(255, 212, 114, 0.55);
}

.hbm-title {
  margin: 0;
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--gold-bright);
}

.hbm-sub {
  margin: 0;
  font-size: 12.2px;
  line-height: 1.42;
  color: var(--text-muted);
}

.hbm-purpose-banner {
  flex-shrink: 0;
  margin-bottom: 12px;
}

.hbm-tabs {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 11px;
}

.hbm-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 214, 126, 0.26);
  background: rgba(255, 255, 255, 0.045);
  color: #ead3aa;
  font-size: 12.8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.hbm-tab:hover {
  background: rgba(255, 214, 126, 0.12);
  color: #fff6e2;
}

.hbm-tab.is-active {
  background: linear-gradient(135deg, rgba(212, 148, 36, 0.42), rgba(122, 74, 12, 0.56));
  border-color: var(--gold-bright);
  color: #fff9ec;
  box-shadow: 0 4px 16px rgba(255, 198, 86, 0.16);
}

.hbm-tab-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 214, 126, 0.20);
  border: 1px solid rgba(255, 214, 126, 0.35);
  font-size: 11px;
  font-weight: 800;
  color: #ffe5a0;
}

.hbm-list {
  flex: 1;
  min-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 3px;
}

.hbm-list::-webkit-scrollbar {
  width: 5px;
}

.hbm-list::-webkit-scrollbar-thumb {
  background: rgba(255, 214, 126, 0.32);
  border-radius: 99px;
}

.hbm-empty {
  padding: 34px 16px;
  text-align: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 214, 126, 0.24);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.hbm-card {
  padding: 10px 13px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.048);
  border: 1px solid rgba(255, 214, 126, 0.20);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hbm-card.is-top-rank {
  background: linear-gradient(135deg, rgba(255, 204, 92, 0.16), rgba(140, 88, 16, 0.16));
  border-color: rgba(255, 218, 128, 0.48);
}

.hbm-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.hbm-rank-medal {
  flex-shrink: 0;
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(255, 212, 118, 0.14);
  border: 1px solid rgba(255, 212, 118, 0.30);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.2px;
  font-weight: 800;
  color: var(--gold-bright);
}

.hbm-donor-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff8ea;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hbm-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.hbm-time-pill {
  font-size: 11.4px;
  font-weight: 600;
  color: rgba(240, 216, 174, 0.80);
  white-space: nowrap;
}

.hbm-amt-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 212, 118, 0.18);
  border: 1px solid rgba(255, 212, 118, 0.42);
  font-size: 12.2px;
  font-weight: 800;
  color: #ffe498;
  white-space: nowrap;
}

.hbm-msg {
  font-size: 12.6px;
  line-height: 1.42;
  color: #edd7b2;
  font-style: italic;
  word-break: break-word;
}

.hbm-pager-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(255, 206, 105, 0.07);
  border: 1px solid rgba(255, 214, 126, 0.22);
}

.hbm-nav-btn {
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255, 214, 126, 0.38);
  background: rgba(255, 214, 126, 0.14);
  color: #ffeab4;
  font-size: 12.2px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.hbm-nav-btn:hover:not(:disabled) {
  background: rgba(255, 214, 126, 0.28);
  color: #fff;
}

.hbm-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.hbm-page-info {
  font-size: 12.2px;
  font-weight: 700;
  color: #f4dfb8;
  text-align: center;
}

.hbm-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 214, 126, 0.18);
}

.hbm-donate-cta {
  flex: 1;
}

.donate-header-btns {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.donate-view-board-btn {
  height: 32px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 214, 126, 0.38);
  background: rgba(255, 214, 126, 0.13);
  color: #ffe7ab;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.donate-view-board-btn:hover {
  background: rgba(255, 214, 126, 0.26);
  color: #fff;
}

/* ==========================================================================
   DONATE VIA BANK TRANSFER & QR MODAL
   ========================================================================== */
.donate-dialog {
  width: min(760px, 100%);
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: 22px 24px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(36, 22, 12, 0.98), rgba(17, 9, 4, 0.99));
  border: 1.5px solid rgba(255, 214, 124, 0.56);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.78), 0 0 42px rgba(255, 194, 82, 0.16);
}

.donate-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 214, 126, 0.20);
}

.donate-dialog-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--gold-bright);
  margin-bottom: 4px;
}

.donate-dialog-sub {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

.donate-close-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 214, 126, 0.30);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-cream);
  font-size: 15px;
  cursor: pointer;
}

.donate-purpose-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 15px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 204, 96, 0.14), rgba(145, 92, 18, 0.16));
  border: 1px solid rgba(255, 216, 124, 0.44);
}

.dpb-icon {
  font-size: 17px;
  line-height: 1.3;
  flex-shrink: 0;
}

.dpb-text {
  font-size: 12.8px;
  line-height: 1.48;
  color: #fff3d6;
}

.dpb-text b {
  color: var(--gold-bright);
  font-weight: 700;
}

.donate-grid {
  display: grid;
  grid-template-columns: 266px 1fr;
  gap: 18px;
  align-items: start;
}

.donate-qr-col {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.donate-qr-frame {
  width: 100%;
  min-height: 238px;
  padding: 10px;
  border-radius: 16px;
  background: #fffdf8;
  border: 2px solid #e6b858;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.donate-qr-img {
  width: 100%;
  max-width: 242px;
  height: auto;
  border-radius: 10px;
  display: block;
  object-fit: contain;
}

.donate-qr-placeholder {
  padding: 16px 12px;
  text-align: center;
  color: #3d2410;
}

.qr-mock-icon {
  font-size: 46px;
  line-height: 1;
  color: #b87e1b;
  margin-bottom: 8px;
}

.qr-placeholder-text {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.bank-info-card {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 214, 126, 0.24);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bank-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.bi-label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.bi-val {
  font-weight: 700;
  color: #fff7e6;
  text-align: right;
  word-break: break-all;
}

.bi-highlight {
  color: var(--gold-bright);
  font-size: 13px;
}

.bi-code {
  color: #86efac;
  font-family: ui-monospace, Consolas, monospace;
}

.bi-copy-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-mini-btn {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 214, 126, 0.35);
  background: rgba(255, 214, 126, 0.14);
  color: #ffe5a3;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.copy-mini-btn:hover {
  background: rgba(255, 214, 126, 0.28);
}

#inp-don-name,
#inp-don-amount,
#inp-don-message {
  width: 100%;
  padding: 10px 13px;
  border-radius: 12px;
  background: rgba(10, 6, 3, 0.78);
  border: 1.5px solid rgba(255, 214, 126, 0.34);
  color: #fff9ef;
  font-size: 13.5px;
  font-weight: 500;
  outline: none;
}

#inp-don-name:focus,
#inp-don-amount:focus,
#inp-don-message:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(255, 217, 125, 0.18);
}

.donate-amount-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.amt-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 126, 0.28);
  background: rgba(255, 255, 255, 0.05);
  color: #ffe8b0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.amt-chip.is-selected,
.amt-chip:hover {
  background: linear-gradient(135deg, rgba(196, 134, 28, 0.65), rgba(114, 70, 12, 0.78));
  border-color: var(--gold-bright);
  color: #fff;
}

.don-label-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.don-label-flex label {
  margin-bottom: 0;
}

.don-char-counter {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.don-char-counter.is-near-limit {
  color: #fbbf24;
}

.don-char-counter.is-at-limit {
  color: #fb7185;
}

.don-quick-msgs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.don-msg-chip {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 126, 0.24);
  background: rgba(255, 214, 126, 0.09);
  color: #ffe6ab;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.don-msg-chip:hover {
  background: rgba(255, 214, 126, 0.22);
}

.donate-feedback {
  margin-bottom: 11px;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 12.5px;
  line-height: 1.42;
}

.donate-feedback.is-error {
  background: rgba(180, 34, 48, 0.28);
  border: 1px solid rgba(255, 130, 142, 0.52);
  color: #ffd6da;
}

.donate-feedback.is-success {
  background: rgba(26, 130, 74, 0.28);
  border: 1px solid rgba(110, 231, 160, 0.48);
  color: #d6ffe6;
}

.donate-submit-row {
  display: flex;
  gap: 10px;
}

.donate-approval-note {
  margin-top: 9px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   RESPONSIVE SYSTEM: TABLET, MOBILE PORTRAIT, SMALL PHONES & MOBILE LANDSCAPE
   ========================================================================== */
@media (max-width: 1180px) {
  .bottom-dock {
    width: min(370px, calc(100vw - 440px));
    min-width: 240px;
  }

  .bl-room-pill span {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 980px) {
  #top-hud {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 8px;
  }

  .hud-center {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    align-items: flex-start;
  }

  .online-popover {
    left: 0;
    transform: none;
  }

  .bottom-left-controls {
    display: none !important;
  }

  .bottom-dock {
    left: 14px;
    transform: none;
    width: min(440px, calc(100vw - 156px));
    align-items: flex-start;
  }

  .honor-right-wrap {
    top: 102px;
    right: 76px;
  }
}

/* Mobile & Small Tablet Portrait / Narrow Viewports */
@media (max-width: 820px) {
  #top-hud {
    top: max(8px, env(safe-area-inset-top, 0px));
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 6px;
    row-gap: 6px;
  }

  .hud-left {
    display: contents;
  }

  .brand-card-wrap,
  .mass-liturgy-card,
  .honor-left-wrap {
    pointer-events: auto;
  }

  .brand-card-wrap {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
    max-width: 100%;
  }

  .hud-right {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    flex-wrap: nowrap;
    gap: 5px;
  }

  .hud-center {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    align-items: flex-start;
  }

  .top-status-capsule {
    height: 34px;
    padding: 0 11px;
    gap: 9px;
  }

  .capsule-live-state {
    font-size: 11px;
  }

  .om-secondary {
    display: none;
  }

  .church-brand-card {
    padding: 5px 10px 5px 7px;
    gap: 7px;
    border-radius: 11px;
    max-width: 100%;
  }

  .brand-emblem {
    width: 26px;
    height: 26px;
    font-size: 14px;
    border-radius: 7px;
  }

  .brand-title {
    font-size: 12.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-subline {
    font-size: 7.8px;
  }

  .top-wallet-pill {
    height: 34px;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .hud-icon-sq,
  .my-avatar-circle {
    width: 34px;
    height: 34px;
  }

  .online-popover {
    left: 0;
    transform: none;
    width: min(286px, calc(100vw - 16px));
    max-height: min(280px, 50dvh);
  }

  .mass-liturgy-card {
    grid-column: 1 / -1;
    grid-row: 3;
    width: min(350px, calc(100vw - 76px));
    padding: 8px 11px;
  }

  .mlc-subtitle {
    -webkit-line-clamp: 2;
    font-size: 11.4px;
  }

  .honor-left-wrap {
    grid-column: 1 / -1;
    grid-row: 4;
    justify-self: start;
  }

  .honor-right-wrap {
    top: calc(96px + env(safe-area-inset-top, 0px));
    right: calc(64px + env(safe-area-inset-right, 0px));
  }

  .honor-board-panel,
  .honor-right-wrap .honor-board-panel {
    width: min(268px, calc(100vw - 84px));
    max-height: min(240px, calc(100dvh - 224px));
    min-height: 0;
  }

  .right-vertical-dock {
    right: max(8px, env(safe-area-inset-right, 0px));
    width: 52px;
    padding: 6px 3px;
    border-radius: 16px;
  }

  .dock-item-btn {
    width: 44px;
    padding: 5px 2px 4px;
  }

  .dock-svg {
    width: 17px;
    height: 17px;
  }

  .dock-lbl {
    font-size: 8.8px;
    max-width: 42px;
  }

  #center-toast-layer {
    top: calc(92px + env(safe-area-inset-top, 0px));
    max-width: calc(100vw - 20px);
    width: max-content;
  }

  .sacred-toast {
    font-size: 11.4px;
    padding: 5px 12px;
    max-width: calc(100vw - 20px);
  }

  .controls-hint {
    display: none;
  }

  .bottom-left-controls {
    display: none !important;
  }

  .bottom-dock {
    left: max(8px, env(safe-area-inset-left, 0px));
    transform: none;
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    align-items: flex-start;
    width: calc(100vw - 122px);
    min-width: 0;
    gap: 6px;
  }

  .bottom-right-audio {
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .br-vol-pct {
    display: none;
  }

  .br-audio-capsule {
    padding: 0 5px;
    height: 38px;
  }

  .bottom-chat-capsule {
    height: 38px;
  }

  .proximity-prompt {
    font-size: 11.4px;
    padding: 5px 12px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .joystick-zone {
    left: max(12px, env(safe-area-inset-left, 0px));
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  .joystick-base {
    width: 88px;
    height: 88px;
  }

  .joystick-stick {
    width: 38px;
    height: 38px;
    margin-left: -19px;
    margin-top: -19px;
  }

  .chat-panel {
    right: calc(66px + env(safe-area-inset-right, 0px));
    left: max(8px, env(safe-area-inset-left, 0px));
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(236px, calc(100dvh - 188px));
  }

  .chat-header {
    padding: 8px 12px;
  }

  .chat-messages {
    padding: 8px 10px;
  }

  /* Prevent iOS Safari automatic zoom when focusing text inputs */
  #chat-input,
  #inp-nickname,
  #inp-candle-prayer,
  #inp-don-name,
  #inp-don-amount,
  #inp-don-message {
    font-size: 16px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .honor-modal-dialog {
    padding: 15px 14px calc(15px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }

  .hbm-title {
    font-size: 15.2px;
  }

  .hbm-tabs {
    gap: 6px;
  }

  .hbm-tab {
    padding: 8px 8px;
    font-size: 11.6px;
    gap: 5px;
  }

  .hbm-donor-name {
    font-size: 13px;
  }

  .hbm-nav-btn {
    padding: 6px 10px;
    font-size: 11.4px;
  }

  .hbm-page-info {
    font-size: 11.2px;
  }

  .donate-dialog {
    padding: 15px 15px calc(16px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }

  .donate-dialog-header {
    padding-bottom: 10px;
    margin-bottom: 12px;
  }

  .donate-dialog-title {
    font-size: 15px;
    line-height: 1.35;
  }

  .donate-dialog-sub {
    font-size: 11.5px;
  }

  .donate-purpose-banner {
    padding: 9px 11px;
    margin-bottom: 12px;
    gap: 8px;
  }

  .dpb-text {
    font-size: 11.8px;
  }

  .donate-grid {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .donate-qr-frame {
    min-height: 170px;
    max-width: 214px;
    margin: 0 auto;
    padding: 8px;
  }

  .donate-qr-img {
    max-width: 182px;
  }
}

/* Smartphones Portrait (<= 640px) */
@media (max-width: 640px) {
  .hide-mobile-xs {
    display: none !important;
  }

  .top-wallet-pill span {
    display: none;
  }

  .top-wallet-pill {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .p-nameplate-pill {
    font-size: 10.5px;
    padding: 2px 8px;
    gap: 4px;
  }

  .p-bubble {
    max-width: 185px;
    font-size: 11.5px;
    padding: 6px 10px;
  }

  .chat-char-count {
    display: none;
  }

  .bottom-dock {
    width: calc(100vw - 102px);
  }

  #btn-music-info {
    display: none;
  }

  .joystick-zone {
    left: max(10px, env(safe-area-inset-left, 0px));
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    gap: 3px;
  }

  .joystick-base {
    width: 82px;
    height: 82px;
  }

  .joystick-stick {
    width: 35px;
    height: 35px;
    margin-left: -17.5px;
    margin-top: -17.5px;
  }

  .joystick-caption {
    font-size: 9.8px;
  }
}

/* Narrow Smartphones (<= 480px) */
@media (max-width: 480px) {
  #btn-toggle-side-boards {
    display: none;
  }

  .hud-right {
    gap: 4px;
  }

  .hud-icon-sq,
  .my-avatar-circle,
  .top-wallet-pill {
    width: 32px;
    height: 32px;
  }

  .church-brand-card {
    padding: 4px 8px 4px 6px;
    gap: 6px;
  }

  .brand-subline {
    display: none;
  }

  .brand-title {
    font-size: 11.8px;
  }

  .entry-card {
    padding: 20px 16px 18px;
    border-radius: 20px;
  }

  .entry-crest {
    font-size: 26px;
  }

  .entry-title {
    font-size: 18.5px;
  }

  .entry-subtitle {
    font-size: 12px;
    margin-bottom: 14px;
  }

  .gender-card {
    padding: 10px 8px;
  }

  .gender-avatar {
    font-size: 24px;
  }

  .outfit-swatches {
    gap: 10px;
  }

  .swatch-btn {
    width: 31px;
    height: 31px;
  }

  .donate-submit-row,
  .hbm-footer {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .donate-submit-row .btn-primary,
  .donate-submit-row .btn-secondary,
  .hbm-footer .btn-primary,
  .hbm-footer .btn-secondary {
    width: 100%;
  }
}

/* Mobile Landscape Viewports (Phones Held Sideways) */
@media (max-width: 932px) and (max-height: 520px) {
  .controls-hint,
  .bottom-left-controls,
  .brand-subline,
  .om-secondary {
    display: none !important;
  }

  .top-status-capsule {
    height: 32px;
    padding: 0 10px;
  }

  .right-vertical-dock {
    top: 52%;
    right: max(8px, env(safe-area-inset-right, 0px));
    width: 48px;
    padding: 5px 3px;
  }

  .right-dock-items {
    max-height: calc(100dvh - 134px);
  }

  .dock-lbl {
    display: none;
  }

  .dock-item-btn {
    width: 38px;
    height: 34px;
    padding: 0;
  }

  .bottom-dock {
    left: 50%;
    transform: translateX(-50%);
    bottom: max(6px, env(safe-area-inset-bottom, 0px));
    width: min(360px, calc(100vw - 240px));
    min-width: 200px;
    align-items: center;
  }

  .bottom-right-audio {
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: max(6px, env(safe-area-inset-bottom, 0px));
  }

  .joystick-zone {
    left: max(12px, env(safe-area-inset-left, 0px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .joystick-base {
    width: 74px;
    height: 74px;
  }

  .joystick-stick {
    width: 32px;
    height: 32px;
    margin-left: -16px;
    margin-top: -16px;
  }

  .chat-panel {
    left: auto;
    right: calc(62px + env(safe-area-inset-right, 0px));
    bottom: max(50px, calc(46px + env(safe-area-inset-bottom, 0px)));
    width: min(310px, 48vw);
    height: calc(100dvh - 104px);
  }

  .entry-card {
    padding: 16px 18px;
  }

  .entry-crest {
    font-size: 22px;
    margin-bottom: 2px;
  }

  .entry-subtitle {
    margin-bottom: 10px;
  }

  .form-field {
    margin-bottom: 10px;
  }
}

/* ==========================================================================
   100% ANONYMOUS CONFESSIONAL BOOTH (BỤC XƯNG TỘI / TÒA GIẢI TỘI) & QUEUE UI
   ========================================================================== */
.act-btn-confess {
  background: linear-gradient(145deg, rgba(84, 24, 42, 0.88), rgba(46, 12, 24, 0.92));
  border-color: rgba(246, 198, 96, 0.56);
  color: #fff3d1;
}

.act-btn-confess:hover,
.act-btn-confess.is-active {
  background: linear-gradient(145deg, rgba(132, 34, 62, 0.94), rgba(76, 18, 36, 0.96));
  border-color: #ffe08a;
  box-shadow: 0 0 14px rgba(246, 198, 96, 0.35);
}

.p-nameplate-pill.is-anon-queue {
  background: rgba(34, 14, 22, 0.92);
  border-color: rgba(255, 212, 118, 0.65);
  color: #ffe6a4;
  font-style: italic;
}

.confess-queue-pill {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 56;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 214, 120, 0.72);
  background: linear-gradient(135deg, rgba(58, 18, 30, 0.95), rgba(28, 10, 16, 0.96));
  color: #fff2cb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.52), 0 0 18px rgba(255, 196, 86, 0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.confess-queue-pill:hover {
  transform: translateX(-50%) translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.62), 0 0 22px rgba(255, 206, 98, 0.38);
}

.cqp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
  animation: pulseConfessDot 1.4s infinite ease-in-out;
}

@keyframes pulseConfessDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.55; }
}

.confess-dialog {
  width: min(670px, calc(100vw - 24px));
  max-height: min(88dvh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1.5px solid rgba(246, 199, 104, 0.62);
  background:
    radial-gradient(circle at 50% 0%, rgba(132, 48, 68, 0.24), transparent 58%),
    linear-gradient(180deg, rgba(31, 13, 18, 0.97) 0%, rgba(17, 8, 10, 0.98) 100%);
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.78), 0 0 36px rgba(255, 194, 88, 0.16);
  overflow: hidden;
  color: #fff8eb;
}

.confess-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 13px;
  border-bottom: 1px solid rgba(255, 212, 122, 0.24);
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 204, 102, 0.035) 0px,
      rgba(255, 204, 102, 0.035) 2px,
      transparent 2px,
      transparent 12px
    ),
    rgba(24, 9, 14, 0.78);
}

.confess-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.confess-cross {
  font-size: 20px;
  color: #ffd875;
  text-shadow: 0 0 10px rgba(255, 212, 112, 0.55);
}

.confess-title {
  margin: 0;
  font-family: 'Cinzel', 'Be Vietnam Pro', serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffe39a;
}

.confess-anon-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.confess-badge-anon {
  display: inline-flex;
  align-items: center;
  padding: 3.5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(246, 192, 66, 0.26), rgba(188, 126, 20, 0.34));
  border: 1px solid rgba(255, 220, 128, 0.72);
  color: #fff6d6;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.confess-badge-mode {
  display: inline-flex;
  align-items: center;
  padding: 3.5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 212, 122, 0.32);
  color: #ebd0a0;
  font-size: 11.5px;
  font-weight: 700;
}

.confess-sub {
  margin: 7px 0 0;
  font-size: 12.2px;
  line-height: 1.42;
  color: #d8be96;
}

/* Queue View inside Confessional Modal */
.confess-queue-view {
  padding: 22px 22px 20px;
  text-align: center;
  overflow-y: auto;
}

.confess-queue-icon {
  font-size: 38px;
  margin-bottom: 6px;
}

.confess-queue-heading {
  font-size: 16.5px;
  font-weight: 800;
  color: #ffe39c;
  margin-bottom: 8px;
}

.confess-queue-desc {
  margin: 0 auto 16px;
  max-width: 530px;
  font-size: 13px;
  line-height: 1.52;
  color: #e2caa5;
}

.confess-queue-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.cqm-card {
  padding: 11px 10px;
  border-radius: 14px;
  background: rgba(255, 232, 184, 0.06);
  border: 1px solid rgba(255, 212, 122, 0.25);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cqm-label {
  font-size: 11.5px;
  color: #cbb089;
}

.cqm-val {
  font-size: 17px;
  font-weight: 800;
  color: #fff6e3;
}

.cqm-val.is-gold {
  font-size: 21px;
  color: #ffd76a;
}

.cqm-val.is-busy {
  font-size: 13.5px;
  color: #ff8e99;
}

.confess-queue-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-danger-outline {
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 118, 132, 0.55);
  background: rgba(175, 28, 46, 0.25);
  color: #ffd2d7;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger-outline:hover {
  background: rgba(198, 34, 54, 0.42);
}

/* Active 1-on-1 Confession Chat View */
.confess-chat-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px 16px 14px;
  gap: 9px;
}

.confess-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 214, 124, 0.08);
  border: 1px solid rgba(255, 214, 124, 0.22);
  font-size: 12px;
  font-weight: 600;
  color: #f3d7a3;
}

.confess-status-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.confess-badge-voice {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(74, 152, 238, 0.2);
  border: 1px solid rgba(132, 198, 255, 0.45);
  color: #cbe8ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.confess-voice-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 206, 98, 0.18);
  border: 1px solid rgba(255, 214, 118, 0.5);
  color: #ffe7a8;
  font-family: inherit;
  font-size: 11.6px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.confess-voice-pill:hover {
  background: rgba(255, 214, 118, 0.28);
  border-color: rgba(255, 226, 148, 0.78);
}

.confess-voice-pill.is-speaking {
  background: rgba(65, 190, 122, 0.24);
  border-color: rgba(118, 242, 168, 0.72);
  color: #c9ffe0;
  box-shadow: 0 0 10px rgba(82, 224, 142, 0.24);
}

.confess-voice-pill.is-muted {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(242, 240, 234, 0.58);
}

.confess-timer-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(65, 190, 122, 0.18);
  border: 1px solid rgba(112, 232, 166, 0.42);
  color: #b7f8d2;
  font-size: 11.8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.confess-timer-pill.is-warn {
  background: rgba(235, 162, 34, 0.24);
  border-color: rgba(255, 206, 98, 0.62);
  color: #ffe39e;
}

.confess-timer-pill.is-urgent {
  background: rgba(208, 36, 54, 0.34);
  border-color: rgba(255, 122, 138, 0.78);
  color: #ffd0d6;
  animation: queueDotPulse 1s infinite ease-in-out;
}

.confess-outside-waiters {
  color: #ffd875;
  font-weight: 700;
  white-space: nowrap;
}

.confess-messages {
  flex: 1 1 auto;
  min-height: 170px;
  max-height: 290px;
  overflow-y: auto;
  padding: 10px;
  border-radius: 14px;
  background: rgba(9, 4, 6, 0.66);
  border: 1px solid rgba(255, 212, 122, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.confess-turn {
  max-width: 91%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.2px;
  line-height: 1.52;
  white-space: pre-wrap;
  word-break: break-word;
}

.confess-turn.is-priest {
  align-self: flex-start;
  background: linear-gradient(145deg, rgba(64, 38, 16, 0.72), rgba(38, 22, 10, 0.84));
  border: 1px solid rgba(255, 212, 118, 0.42);
  color: #fff6e2;
}

.confess-turn.is-priest.is-absolution {
  background: linear-gradient(145deg, rgba(32, 92, 56, 0.56), rgba(22, 58, 36, 0.78));
  border-color: rgba(118, 242, 168, 0.65);
  box-shadow: 0 0 18px rgba(82, 224, 142, 0.18);
}

.confess-turn.is-penitent {
  align-self: flex-end;
  background: linear-gradient(145deg, rgba(96, 28, 48, 0.72), rgba(56, 16, 28, 0.85));
  border: 1px solid rgba(255, 186, 198, 0.34);
  color: #fff2f5;
}

.confess-turn.is-penitent.is-prayer {
  background: linear-gradient(145deg, rgba(112, 78, 22, 0.68), rgba(66, 44, 12, 0.82));
  border-color: rgba(255, 220, 128, 0.58);
  font-style: italic;
}

.confess-turn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.confess-turn-sender {
  font-size: 11.5px;
  font-weight: 800;
  color: #ffd97d;
}

.confess-turn.is-penitent .confess-turn-sender {
  color: #ffc8d4;
}

.confess-turn.is-speaking {
  border-color: rgba(255, 226, 134, 0.88);
  box-shadow: 0 0 16px rgba(255, 206, 98, 0.22);
}

.confess-turn-speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 214, 122, 0.14);
  border: 1px solid rgba(255, 214, 122, 0.36);
  color: #ffe6a8;
  font-family: inherit;
  font-size: 10.8px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.confess-turn-speak-btn:hover {
  background: rgba(255, 214, 122, 0.28);
  border-color: rgba(255, 228, 152, 0.72);
}

.confess-turn-speak-btn.is-speaking {
  background: rgba(65, 190, 122, 0.26);
  border-color: rgba(118, 242, 168, 0.72);
  color: #ccffe2;
}

/* Assigned Penance Prayer Card (Kinh Sám Hối) */
.penance-card {
  padding: 11px 13px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(74, 46, 14, 0.58), rgba(40, 23, 8, 0.78));
  border: 1.5px solid rgba(255, 216, 118, 0.62);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.penance-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.penance-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #ffd875;
}

.penance-title {
  font-size: 13.5px;
  color: #fff7dc;
}

.penance-prayer-text {
  max-height: 88px;
  overflow-y: auto;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(12, 6, 3, 0.56);
  border: 1px solid rgba(255, 216, 126, 0.22);
  font-size: 12.6px;
  line-height: 1.48;
  font-style: italic;
  color: #f8e5be;
  margin-bottom: 9px;
}

.penance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.btn-penance-listen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 11px;
  background: rgba(255, 214, 122, 0.14);
  border: 1px solid rgba(255, 214, 122, 0.45);
  color: #ffe8ad;
  font-family: inherit;
  font-size: 12.6px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-penance-listen:hover {
  background: rgba(255, 214, 122, 0.26);
  border-color: rgba(255, 228, 150, 0.8);
}

.btn-penance-recite {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid #ffe494;
  background: linear-gradient(135deg, #d89b28 0%, #9e6510 100%);
  color: #fffdf7;
  font-size: 13.2px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(216, 155, 40, 0.36);
  transition: filter 0.15s ease, transform 0.12s ease;
}

.btn-penance-recite:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-penance-recite:disabled {
  opacity: 0.6;
  cursor: wait;
}

.confess-absolved-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(24, 96, 56, 0.44), rgba(16, 60, 36, 0.62));
  border: 1px solid rgba(114, 240, 166, 0.56);
}

.cab-text {
  font-size: 12.5px;
  line-height: 1.42;
  color: #dcffe9;
}

.cab-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.confess-starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cfs-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 214, 126, 0.28);
  background: rgba(255, 214, 126, 0.09);
  color: #ffe7ad;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.cfs-chip:hover {
  background: rgba(255, 214, 126, 0.22);
}

.confess-input-bar {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

#inp-confess-msg {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(8, 4, 5, 0.85);
  border: 1.5px solid rgba(255, 214, 126, 0.34);
  color: #fff9ef;
  font-family: inherit;
  font-size: 13.2px;
  line-height: 1.4;
  resize: none;
  outline: none;
}

#inp-confess-msg:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(255, 217, 125, 0.16);
}

.confess-form-btns {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.confess-send-btn {
  padding: 8px 14px;
  font-size: 12.8px;
  white-space: nowrap;
}

.confess-leave-btn {
  padding: 6px 12px;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .confess-dialog {
    width: calc(100vw - 14px);
    max-height: 92dvh;
  }

  .confess-header {
    padding: 13px 14px 10px;
  }

  .confess-title {
    font-size: 15.5px;
  }

  .confess-queue-metrics {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .confess-absolved-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .confess-input-bar {
    flex-direction: column;
  }

  .confess-form-btns {
    flex-direction: row;
  }

  .confess-send-btn {
    flex: 1 1 auto;
  }
}

/* ==========================================================================
   BACKGROUND-TAB RESYNC CURTAIN (ZERO-JERK LOADING OVERLAY ON TAB RETURN)
   ========================================================================== */
.tab-sync-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 11, 15, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 1;
  transition: none;
  pointer-events: auto;
}

.tab-sync-overlay.is-fading-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-out;
}

.tab-sync-card {
  min-width: min(320px, calc(100vw - 36px));
  max-width: 390px;
  padding: 24px 28px 22px;
  border-radius: 20px;
  background: rgba(18, 20, 26, 0.90);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.tab-sync-spinner-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-sync-spinner {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid rgba(214, 226, 178, 0.16);
  border-top-color: #d6e2b2;
  border-right-color: rgba(214, 226, 178, 0.65);
  animation: tabSyncSpin 0.88s linear infinite;
}

.tab-sync-cross {
  font-size: 18px;
  color: #e2ebc7;
  line-height: 1;
}

.tab-sync-title {
  font-size: 15px;
  font-weight: 700;
  color: #f4f2ec;
  letter-spacing: 0.01em;
}

.tab-sync-sub {
  font-size: 12.2px;
  line-height: 1.45;
  color: rgba(235, 232, 224, 0.64);
}

@keyframes tabSyncSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile WebGL GPU Compositor Optimization: avoid multi-layer live backdrop-filter blur over 60fps 3D canvas */
@media (max-width: 820px) {
  .church-brand-card,
  .mass-liturgy-card,
  .hud-status-pill,
  .hud-icon-btn,
  .chat-panel,
  .honor-side-board,
  .action-dock-card,
  .bl-ctrl-btn,
  .audio-floating-pill,
  .proximity-prompt-btn {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}
