/**
 * @file public/css/sanctuary.css
 * High-Craft 9:16 (1080x1920) 2.5D Buddhist Sanctuary for Traders ("Chánh Điện Trader").
 * Supports:
 * - Split-Screen Web Workspace (`/` on Desktop: 9:16 Stage on left + Quick Control Dock on right).
 * - Portrait / Mobile / 1080x1920 Web View (9:16 Stage + sleek floating quick bar).
 * - Clean OBS Browser Source (`/?obs=1` at exact 1080x1920 full bleed, zero dock).
 * License: MIT
 */

:root {
  --bg-deep: #0b0504;
  --lacquer-red: #5c0d0d;
  --lacquer-dark: #2c0706;
  --gold-bright: #fbbf24;
  --gold-light: #fef08a;
  --gold-soft: #fde68a;
  --jade-green: #10b981;
  --crimson-bear: #ef4444;
  --panel-bg: rgba(20, 9, 8, 0.92);
  --font-sans: 'Be Vietnam Pro', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: 'Noto Serif', Georgia, serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 38% 35%, #2a100c 0%, #090404 75%);
  color: #fef3c7;
  font-family: var(--font-sans);
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

/* ============================================================================
 * 1. WORKSPACE LAYOUT (9:16 Stage + Side Quick Dock on Landscape Screens)
 * ============================================================================ */
.app-workspace {
  position: fixed;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 12px 24px;
  overflow: hidden;
}

.stage-wrapper {
  position: relative;
  width: 360px;
  height: 640px;
  flex-shrink: 0;
  overflow: hidden;
}

/* 9:16 Logical Coordinate Stage (Always 1080x1920 internal coordinates, scaled via top-left origin) */
.sanctuary-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 1080px;
  height: 1920px;
  background: #1a0706;
  border-radius: 24px;
  border: 3px solid rgba(251, 191, 36, 0.58);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.92),
    0 0 42px rgba(245, 158, 11, 0.18);
  overflow: hidden;
  transform-origin: top left;
}

/* Clean OBS 9:16 Mode (?obs=1): hides interactive dock, scales cleanly to ANY viewport (1080x1920 OBS is scale=1.0) */
body.obs-mode {
  background: transparent;
}

body.obs-mode .app-workspace {
  padding: 0;
  gap: 0;
}

body.obs-mode .sanctuary-viewport {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

body.obs-mode .interactive-dock {
  display: none !important;
}

/* ============================================================================
 * 2. LAYER 1-3: 2.5D TEMPLE ARTWORK, ROTATING DHARMA HALO & SACRED LIGHT BEAM
 * ============================================================================ */
.hall-backdrop-layer {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 21%, rgba(251, 191, 36, 0.16) 0%, transparent 45%),
    linear-gradient(180deg, rgba(12, 4, 4, 0.28) 0%, rgba(12, 4, 4, 0.04) 48%, rgba(12, 4, 4, 0.35) 100%),
    url('../assets/sanctuary-hall-9x16.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  z-index: 1;
}

/* Multi-layer Dharma Halo behind Buddha's head (Center: x=50%, y=645px in 1080x1920) */
.buddha-halo-system {
  position: absolute;
  top: 470px;
  left: 50%;
  margin-left: -175px;
  width: 350px;
  height: 350px;
  pointer-events: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Mask out the center so the Buddha's face remains 100% sharp */
  -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.25) 28%, rgba(0, 0, 0, 1) 48%);
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.25) 28%, rgba(0, 0, 0, 1) 48%);
}

.halo-sunburst {
  position: absolute;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from 0deg,
    rgba(255, 215, 0, 0.28) 0deg 4deg,
    rgba(255, 160, 0, 0.05) 4deg 9deg,
    transparent 9deg 15deg
  );
  -webkit-mask-image: radial-gradient(circle, black 22%, rgba(0, 0, 0, 0.5) 50%, transparent 72%);
  mask-image: radial-gradient(circle, black 22%, rgba(0, 0, 0, 0.5) 50%, transparent 72%);
  animation: rotateHaloCw 48s linear infinite;
}

.halo-breath-core {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 250, 220, 0.48) 0%,
    rgba(251, 191, 36, 0.28) 42%,
    rgba(245, 158, 11, 0.08) 68%,
    transparent 82%
  );
  animation: haloBreathe 4.5s ease-in-out infinite;
}

.halo-wheel-outer {
  position: absolute;
  width: 310px;
  height: 310px;
  opacity: 0.78;
  animation: rotateHaloCw 36s linear infinite;
}

.halo-lotus-inner {
  position: absolute;
  width: 240px;
  height: 240px;
  opacity: 0.85;
  animation: rotateHaloCcw 26s linear infinite;
}

@keyframes rotateHaloCw {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotateHaloCcw {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes haloBreathe {
  0%, 100% { transform: scale(0.95); opacity: 0.78; }
  50% { transform: scale(1.07); opacity: 1; }
}

/* Sacred Light Beam descending from Buddha to the Bronze Incense Burner */
.sacred-light-beam {
  position: absolute;
  top: 520px;
  left: 540px;
  width: 480px;
  height: 680px;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse 50% 70% at 50% 15%,
    rgba(254, 240, 138, 0.16) 0%,
    rgba(251, 191, 36, 0.07) 45%,
    transparent 80%
  );
  clip-path: polygon(32% 0%, 68% 0%, 100% 100%, 0% 100%);
  pointer-events: none;
  z-index: 2;
}

/* ============================================================================
 * 3. LAYER 4: VERTICAL CALLIGRAPHIC GOLD COUPLETS (`CÂU ĐỐI 8 CHỮ`)
 *    Left:  TÂM BẤT BIẾN GIỮA DÒNG NẾN VẠN BIẾN
 *    Right: GIỮ KỶ LUẬT BẢO TOÀN VỐN MUÔN ĐỜI
 * ============================================================================ */
.pillar-couplet {
  position: absolute;
  top: 235px;
  width: 74px;
  padding: 18px 8px;
  background: linear-gradient(180deg, rgba(88, 11, 11, 0.94) 0%, rgba(48, 6, 6, 0.96) 100%);
  border: 2.5px solid var(--gold-bright);
  border-radius: 14px;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.8),
    inset 0 0 12px rgba(251, 191, 36, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 4;
  pointer-events: none;
}

.pillar-couplet::before,
.pillar-couplet::after {
  content: '❖';
  color: var(--gold-bright);
  font-size: 15px;
  line-height: 1;
  opacity: 0.9;
}

.pillar-couplet-left {
  left: 20px;
}

.pillar-couplet-right {
  right: 20px;
}

.couplet-word {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7f1d1d 0%, #3b0707 100%);
  border: 1.8px solid rgba(251, 191, 36, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 16.5px;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95);
  letter-spacing: 0.5px;
}

/* ============================================================================
 * 4. LAYER 5: 9:16 30FPS 2.5D INTERACTIVE CANVAS (TRANSPARENT OVERLAY)
 * ============================================================================ */
#sanctuary-canvas {
  position: absolute;
  inset: 0;
  width: 1080px;
  height: 1920px;
  display: block;
  z-index: 3;
}

/* ============================================================================
 * 5. LAYER 6: TOP STATUS BAR & HOÀNH PHI ĐẠI HÙNG BẢO ĐIỆN
 * ============================================================================ */
.hud-top {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.minimal-top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: linear-gradient(90deg, rgba(16, 6, 5, 0.9) 0%, rgba(42, 12, 9, 0.88) 50%, rgba(16, 6, 5, 0.9) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.52);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.72);
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.top-title {
  font-size: 15px;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.7px;
}

.aura-inline-badge {
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: var(--gold-light);
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
}

.feed-mode-pill {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid #34d399;
  color: #a7f3d0;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.top-counters {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  color: #fef3c7;
}

.top-counters strong {
  color: var(--gold-bright);
  font-weight: 800;
}

.counter-sep {
  color: rgba(251, 191, 36, 0.4);
}

.temple-plaque {
  background: linear-gradient(180deg, #6d0f0f 0%, #360505 100%);
  border: 3px solid var(--gold-bright);
  border-radius: 16px;
  padding: 10px 42px;
  text-align: center;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.82),
    inset 0 0 18px rgba(251, 191, 36, 0.25);
}

.temple-plaque-title {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--gold-light);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.95);
}

.temple-plaque-sub {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 1.8px;
  margin-top: 3px;
}

/* ============================================================================
 * 6. LAYER 7 & 8: PRAYER BANNER (`SỚ CẦU AN`) & FORTUNE ORACLE MODAL (`24 QUẺ`)
 * ============================================================================ */
.prayer-banner {
  position: absolute;
  top: 175px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 520px;
  max-width: 760px;
  background: linear-gradient(135deg, rgba(104, 14, 14, 0.95), rgba(38, 7, 7, 0.96));
  border: 2.5px solid var(--gold-bright);
  border-radius: 16px;
  padding: 12px 24px;
  z-index: 8;
  text-align: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.82);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.prayer-banner.hidden {
  opacity: 0;
  transform: translate(-50%, -12px);
  pointer-events: none;
}

.prayer-banner-header {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.prayer-banner-body {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.38;
  color: #fffbeb;
}

/* Fortune Oracle Scroll Modal (`Tờ Giải Quẻ Kỷ Luật`) */
.fortune-modal {
  position: absolute;
  top: 440px;
  left: 50%;
  transform: translateX(-50%);
  width: 720px;
  background:
    radial-gradient(circle at 50% 0%, #fffbeb 0%, #fef3c7 55%, #fde68a 100%);
  color: #451a03;
  border: 6px solid #881313;
  outline: 2px solid var(--gold-bright);
  border-radius: 20px;
  padding: 26px 34px;
  z-index: 12;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.92);
  transition: opacity 0.25s ease;
}

.fortune-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.fortune-modal-rank {
  display: inline-block;
  width: 100%;
  font-size: 18px;
  font-weight: 800;
  color: #991b1b;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 1.2px;
}

.fortune-modal-title {
  font-family: var(--font-serif);
  font-size: 31px;
  font-weight: 900;
  color: #78350f;
  text-align: center;
  margin: 8px 0 14px;
}

.fortune-modal-poem {
  background: rgba(153, 27, 27, 0.08);
  border-left: 5px solid #991b1b;
  border-radius: 8px;
  padding: 14px 20px;
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 14px;
  white-space: pre-line;
  color: #3b0707;
}

.fortune-modal-advice {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.48;
  color: #451a03;
  margin-bottom: 10px;
}

.fortune-modal-disclaimer {
  font-size: 12.5px;
  color: #78350f;
  font-style: italic;
  text-align: center;
  border-top: 1px dashed rgba(120, 53, 15, 0.35);
  padding-top: 8px;
}

/* ============================================================================
 * 7. LAYER 9: BOTTOM SPLIT HUD BAR (Inside 9:16 Stage — Zane-TV Style)
 * ============================================================================ */
.bottom-hud-bar {
  position: absolute;
  bottom: 30px;
  left: 20px;
  right: 20px;
  z-index: 6;
  display: grid;
  grid-template-columns: 1.22fr 0.98fr;
  gap: 14px;
  align-items: stretch;
}

.hud-left-col {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.active-worshipper-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  background: linear-gradient(90deg, rgba(64, 10, 10, 0.92), rgba(112, 18, 18, 0.94), rgba(64, 10, 10, 0.92));
  border: 1.8px solid rgba(251, 191, 36, 0.72);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.68);
  min-width: 0;
  overflow: hidden;
}

.notice-lotus {
  font-size: 16px;
  flex-shrink: 0;
}

.notice-text {
  font-size: 14px;
  font-weight: 700;
  color: #fef08a;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.gift-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.gift-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(20, 8, 7, 0.88);
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  border-radius: 12px;
  color: #fef3c7;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.gift-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-bright);
  background: rgba(58, 14, 12, 0.92);
}

.gift-emoji {
  font-size: 24px;
  flex-shrink: 0;
}

.gift-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.gift-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--gold-light);
}

.gift-desc {
  font-size: 12px;
  color: rgba(254, 243, 199, 0.78);
}

/* VIP Merit Leaderboard (`Bảng Vàng Kỷ Luật`) */
.vip-board {
  background: linear-gradient(180deg, rgba(32, 9, 8, 0.92) 0%, rgba(16, 5, 5, 0.94) 100%);
  border: 1.8px solid rgba(251, 191, 36, 0.65);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vip-board-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--gold-bright);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-align: center;
  border-bottom: 1px solid rgba(251, 191, 36, 0.28);
  padding-bottom: 4px;
}

.vip-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
}

.vip-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fef3c7;
  padding: 2px 4px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
}

.vip-item strong {
  color: var(--gold-light);
  font-size: 12.5px;
}

/* Mandatory Financial & Platform Compliance Footer */
.compliance-strip {
  position: absolute;
  bottom: 8px;
  left: 20px;
  right: 20px;
  text-align: center;
  font-size: 11.5px;
  color: rgba(253, 230, 138, 0.82);
  z-index: 6;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

/* ============================================================================
 * 8. SIDE QUICK CONTROL DOCK (Right Panel in Web Mode; Hidden in `?obs=1`)
 * ============================================================================ */
.interactive-dock {
  width: 380px;
  max-height: 94vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(28, 11, 9, 0.95) 0%, rgba(14, 6, 5, 0.96) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.48);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
  z-index: 15;
}

.dock-header {
  position: sticky;
  top: -18px;
  z-index: 10;
  background: rgba(24, 9, 8, 0.98);
  margin: -18px -18px 0 -18px;
  padding: 16px 18px 10px 18px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 20px 20px 0 0;
}

.dock-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dock-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dock-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  border: 1.5px solid #fde047;
  color: #fffbeb;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.dock-btn-collapse-bottom {
  width: 100%;
  margin-top: 4px;
  padding: 11px 14px;
  background: linear-gradient(180deg, #7f1d1d 0%, #450a0a 100%);
  border: 1.5px solid var(--gold-bright);
  color: #fef08a;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
}

.mobile-dock-fab,
.mobile-dock-backdrop {
  display: none;
}

body.dock-collapsed .interactive-dock {
  display: none !important;
}

body.dock-collapsed .mobile-dock-fab {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 25;
  background: linear-gradient(180deg, rgba(146, 64, 14, 0.96) 0%, rgba(76, 13, 13, 0.98) 100%);
  border: 1.5px solid var(--gold-bright);
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

body.obs-mode .mobile-dock-fab,
body.obs-mode .mobile-dock-backdrop {
  display: none !important;
}

.dock-header h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--gold-light);
}

.rpc-pill {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid var(--gold-bright);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}

.dock-sub {
  font-size: 12.5px;
  color: rgba(254, 243, 199, 0.78);
  line-height: 1.4;
  margin-top: 4px;
}

.dock-card {
  background: rgba(0, 0, 0, 0.36);
  border: 1px solid rgba(251, 191, 36, 0.26);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dock-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.dock-label {
  font-size: 12px;
  font-weight: 700;
  color: #fde68a;
  margin-top: 2px;
}

.dock-input {
  width: 100%;
  background: rgba(12, 4, 4, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.42);
  color: #fef3c7;
  padding: 8px 11px;
  border-radius: 9px;
  font-family: var(--font-sans);
  font-size: 13.5px;
}

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

.dock-btn {
  background: linear-gradient(180deg, #92400e 0%, #5c2406 100%);
  border: 1px solid rgba(251, 191, 36, 0.65);
  color: #fffbeb;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease;
}

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

.dock-btn.span-2 {
  grid-column: 1 / -1;
}

.dock-btn.gold-btn {
  background: linear-gradient(180deg, #d97706 0%, #92400e 100%);
  border-color: #fde047;
}

.dock-btn.green {
  background: linear-gradient(180deg, #059669 0%, #065f46 100%);
  border-color: #6ee7b7;
}

.dock-btn.amber {
  background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
  border-color: #fcd34d;
}

.dock-btn.wood {
  background: linear-gradient(180deg, #78350f 0%, #451a03 100%);
  border-color: #fbbf24;
}

.dock-btn.red {
  background: linear-gradient(180deg, #b91c1c 0%, #7f1d1d 100%);
  border-color: #fca5a5;
}

.crowd-tier-row,
.aura-tier-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.tier-btn,
.aura-chip {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.38);
  color: #fde68a;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.tier-btn.active,
.tier-btn:hover,
.aura-chip:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: var(--gold-bright);
  color: #fffbeb;
}

.dock-footer-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

.dock-footer-links a {
  display: block;
  text-align: center;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  padding: 8px 10px;
  border-radius: 9px;
}

.dock-footer-links a:hover {
  background: rgba(251, 191, 36, 0.22);
}

/* Portrait / Mobile / Touch Viewport Adaptation:
 * Hide the side dock by default with `display: none` so it NEVER covers the 9:16 Sanctuary on iPhone/Safari!
 * Place the trigger bar cleanly below the 9:16 stage so 0 pixels of the temple are overlapped.
 */
@media (max-aspect-ratio: 10/11), (max-width: 1024px), (hover: none) and (pointer: coarse) {
  .app-workspace {
    flex-direction: column;
    padding: 4px 6px;
    gap: 6px;
  }

  .dock-input {
    font-size: 16px;
  }

  .mobile-dock-fab {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    top: auto;
    right: auto;
    z-index: 25;
    background: linear-gradient(180deg, rgba(146, 64, 14, 0.96) 0%, rgba(76, 13, 13, 0.98) 100%);
    border: 1.5px solid var(--gold-bright);
    color: var(--gold-light);
    font-family: var(--font-sans);
    font-size: 12.5px;
    font-weight: 800;
    padding: 7px 18px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85);
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-dock-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    z-index: 28;
  }

  .mobile-dock-backdrop.hidden {
    display: none !important;
  }

  .interactive-dock {
    display: none !important;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    top: auto;
    width: auto;
    max-height: 82dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 30;
    border: 2px solid var(--gold-bright);
    border-radius: 22px;
  }

  .interactive-dock.mobile-open {
    display: flex !important;
  }
}
