/*
 * MasonsLMS — Masonic Lodge Floor Plan Stylesheet
 * Architectural & Classical Styling for Emulation Craft Lodges
 * Language: English UK (British English)
 */

:root {
  --bg-primary: #070d19;
  --bg-secondary: #0c182c;
  --bg-card: rgba(12, 24, 44, 0.94);
  --bg-card-hover: #142542;
  --border-gold: rgba(212, 175, 55, 0.35);
  --border-gold-bright: #d4af37;
  --gold-primary: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --gold-bright: #f3ce5e;
  --gold-dim: #947a28;
  --blue-regal: #1a365d;
  --blue-accent: #2563eb;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-gold: #e2c068;
  --floor-wood: #1e130b;
  --pavement-white: #f1f5f9;
  --pavement-black: #0f172a;
  --shadow-deep: 0 20px 35px -5px rgba(0, 0, 0, 0.6), 0 10px 15px -5px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 25px rgba(212, 175, 55, 0.35);
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-serif: "Cinzel", "Trajan Pro", "Baskerville", "Georgia", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  line-height: 1.5;
  user-select: none;
}

/* App Main Body (Full-Screen Edge-to-Edge) */
.lodge-app-container {
  display: flex;
  position: relative;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

/* Floating Top-Left Controls Group (Menu Drawer + Zoom Tools) */
.top-controls-group {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 40;
}

.btn-top-menu {
  background: rgba(10, 19, 36, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65), 0 0 10px rgba(212, 175, 55, 0.2);
  transition: var(--transition-smooth);
  touch-action: manipulation;
}

.btn-top-menu:hover,
.btn-top-menu:active {
  background: rgba(212, 175, 55, 0.22);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(253, 224, 71, 0.5);
  transform: scale(1.05);
}

.zoom-controls {
  background: rgba(10, 19, 36, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  display: flex;
  flex-direction: row;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65), 0 0 10px rgba(212, 175, 55, 0.2);
  overflow: hidden;
}

.btn-zoom {
  background: transparent;
  border: none;
  color: var(--gold-bright);
  padding: 10px 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-zoom:hover,
.btn-zoom:active {
  background: rgba(212, 175, 55, 0.22);
  color: #fff;
}

.btn-zoom:not(:last-child) {
  border-right: 1px solid rgba(212, 175, 55, 0.2);
}

.btn-zoom svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

/* Floating Top-Right Live Ceremony Card (Ritual Direction at Top + Spoken Words Underneath) */
.ceremony-live-card {
  position: absolute !important;
  top: max(18px, env(safe-area-inset-top)) !important;
  right: max(20px, env(safe-area-inset-right)) !important;
  left: auto !important;
  width: 380px !important;
  max-width: calc(100vw - 32px) !important;
  z-index: 50 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  pointer-events: auto !important;
  user-select: none !important;
  animation: liveCardFadeIn 0.35s ease-out;
}

@keyframes liveCardFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 1. Ritual Direction (Rubric) at Top */
.live-rubric-card {
  background: rgba(26, 8, 12, 0.94);
  border: 1.5px solid #ef4444;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 14px rgba(239, 68, 68, 0.35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: all 0.25s ease;
}

.live-rubric-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.live-rubric-badge {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #f87171;
  text-transform: uppercase;
}

.live-act-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.live-rubric-text {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  font-style: italic;
  color: #fecaca;
  line-height: 1.38;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* 2. Words Being Spoken Underneath */
.live-speech-card {
  background: rgba(10, 19, 36, 0.95);
  border: 1.5px solid var(--border-gold);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: var(--shadow-deep), 0 0 18px rgba(212, 175, 55, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.live-speech-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.live-speaker-badge {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.live-speaking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fde047;
}

.live-speech-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-replay-speech {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #fde047;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-replay-speech:hover {
  background: rgba(212, 175, 55, 0.32);
  border-color: #fde047;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.btn-replay-speech:active {
  transform: translateY(0);
}

.speaking-dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fde047;
  box-shadow: 0 0 8px #fde047;
  animation: dot-pulse 1.2s infinite;
}

.speaking-dot-pulse.knock {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.speaking-dot-pulse.prompt {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.speaking-dot-pulse.reply {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.live-dialogue-text {
  font-family: var(--font-sans);
  font-size: 0.96rem;
  color: #ffffff;
  line-height: 1.45;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Slide-Out Navigation Drawer: Officers & Stations (Collapsed on All Screens By Default) */
.lodge-sidebar {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 320px !important;
  max-width: 86vw !important;
  background: rgba(7, 13, 25, 0.98) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-right: 1px solid var(--border-gold) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  z-index: 100 !important;
  box-shadow: 12px 0 35px rgba(0, 0, 0, 0.88) !important;
  transform: translateX(-100%) !important;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
  padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
}

.lodge-sidebar.open {
  transform: translateX(0) !important;
}

/* Sidebar Top Branding Header */
.sidebar-branding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px 16px 18px;
  background: rgba(10, 19, 36, 0.95);
  border-bottom: 1px solid var(--border-gold);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-branding-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.masonic-emblem-sidebar {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5));
  flex-shrink: 0;
}

.sidebar-brand-text h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: var(--gold-bright);
  line-height: 1.15;
  font-weight: 700;
}

.sidebar-brand-text p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.btn-close-sidebar {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: #94a3b8;
  font-size: 1.5rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: var(--transition-smooth);
}

.btn-close-sidebar:hover,
.btn-close-sidebar:active {
  color: #fff;
  border-color: var(--gold-bright);
  background: rgba(212, 175, 55, 0.2);
}

.sidebar-section-title {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
  padding: 16px 20px 8px 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.sidebar-footer-info {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid rgba(212, 175, 55, 0.15);
  background: rgba(4, 8, 16, 0.9);
}

.sidebar-orientation-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.officer-list {
  list-style: none;
  padding: 8px 12px;
}

.officer-item {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.officer-item:hover {
  background: rgba(212, 175, 55, 0.08);
  border-color: rgba(212, 175, 55, 0.3);
}

.officer-item.selected {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.2) 0%, rgba(12, 24, 44, 0.8) 100%);
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
}

.officer-item-info {
  display: flex;
  flex-direction: column;
}

.officer-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.officer-station {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.officer-badge {
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  font-family: monospace;
}

/* Floor Plan Viewport */
.lodge-viewport {
  flex: 1;
  position: relative;
  background: radial-gradient(circle at center, #0f1c32 0%, #060b14 100%);
  overflow: hidden;
  cursor: grab;
}

.lodge-viewport:active {
  cursor: grabbing;
}

/* SVG Styling */
#lodge-svg {
  width: 100%;
  height: 100%;
  user-select: none;
  display: block;
}

/* Compass & Wall Indicators */
.wall-label {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.25em;
  fill: #8b9bb4;
  text-anchor: middle;
  text-transform: uppercase;
}

.wall-indicator {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.15em;
  fill: var(--gold-bright);
  text-anchor: middle;
  opacity: 0.75;
}

/* Pedestals & Dais */
.dais-step {
  fill: #132238;
  stroke: rgba(212, 175, 55, 0.4);
  stroke-width: 1.5;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
}

.pedestal {
  fill: #221408;
  stroke: #c89d2d;
  stroke-width: 2;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.pedestal:hover {
  fill: #341e0c;
  stroke: #ffda66;
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.8));
}

/* Chequered Mosaic Pavement */
.mosaic-tile-white {
  fill: #f1f5f9;
}

.mosaic-tile-black {
  fill: #090e17;
}

.pavement-border {
  fill: none;
  stroke: #d4af37;
  stroke-width: 3;
}

.tessel-border {
  fill: #141f32;
  stroke: #8d7020;
  stroke-width: 1.5;
}

/* Ashlars & Ornaments */
.ashlar {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.ashlar:hover {
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.9));
}

.lesser-light {
  cursor: pointer;
}

.light-glow {
  fill: url(#flame-radial);
  animation: flicker 2.5s infinite ease-in-out alternate;
  pointer-events: none;
}

@keyframes flicker {
  0% { opacity: 0.6; filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.4)); }
  50% { opacity: 0.95; filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.8)); }
  100% { opacity: 0.7; filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.5)); }
}

/* Officer Tokens on Floor Plan */
.officer-token {
  cursor: pointer;
}

.officer-token:hover .officer-node-bg {
  stroke: #ffffff;
  stroke-width: 3px;
  filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.95));
}

.officer-sublabel {
  display: none !important;
}

.officer-halo {
  fill: none;
  stroke: var(--gold-bright);
  stroke-width: 2.5;
  stroke-dasharray: 6 3;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.officer-token.selected .officer-halo,
.officer-token:hover .officer-halo {
  opacity: 1;
  animation: dashHalo 5s linear infinite;
}

@keyframes dashHalo {
  to { stroke-dashoffset: 36; }
}

.officer-node-bg {
  fill: #0d1e38;
  stroke: #d4af37;
  stroke-width: 2;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.7));
}

.officer-node-bg.master {
  fill: #3b1111;
  stroke: #f5d061;
  stroke-width: 2.5;
}

.officer-node-bg.warden {
  fill: #132a48;
  stroke: #e2c068;
}

.officer-node-bg.deacon {
  fill: #0c332c;
  stroke: #72cca6;
}

.officer-node-bg.guard {
  fill: #331f0a;
  stroke: #e09953;
}

.officer-node-bg.candidate {
  fill: #f8fafc;
  stroke: #475569;
  stroke-width: 2;
}

.officer-node-bg.scribe {
  fill: #0c2b48;
  stroke: #60a5fa;
  stroke-width: 2;
}

.officer-node-bg.director {
  fill: #2d123d;
  stroke: #c084fc;
  stroke-width: 2;
}

.officer-desk {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.officer-desk:hover rect:first-child {
  stroke: var(--gold-bright);
  filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.7));
}

.officer-label-text {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  fill: #f8fafc;
  text-anchor: middle;
  pointer-events: none;
}

/* Candidate Token */
.candidate-token {
  cursor: pointer;
}

.candidate-halo {
  fill: rgba(59, 130, 246, 0.2);
  stroke: #60a5fa;
  stroke-width: 2;
  animation: pulseCandidate 2.5s infinite ease-in-out;
}

@keyframes pulseCandidate {
  0% { opacity: 0.3; }
  50% { opacity: 0.85; }
  100% { opacity: 0.3; }
}

/* Floating Inspector Card / Drawer */
.lodge-inspector {
  position: absolute;
  top: max(68px, calc(env(safe-area-inset-top) + 52px));
  right: max(16px, env(safe-area-inset-right));
  width: 350px;
  max-width: calc(100vw - 32px);
  background: rgba(10, 19, 36, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-deep), var(--shadow-gold);
  z-index: 50;
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.lodge-inspector.hidden {
  transform: translateX(400px);
  opacity: 0;
  pointer-events: none;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.inspector-title-area h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--gold-bright);
  font-weight: 700;
}

.inspector-station-tag {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-close-inspector {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.btn-close-inspector:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.inspector-body {
  font-size: 0.88rem;
  color: #cbd5e1;
}

.inspector-card-section {
  margin-bottom: 16px;
}

.section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-dim);
  font-weight: 700;
  margin-bottom: 4px;
}

.section-content {
  color: #e2e8f0;
  line-height: 1.5;
}

.jewel-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--gold-bright);
  font-weight: 600;
  font-size: 0.84rem;
  margin-top: 4px;
}

/* Squaring Guide Overlay Lines */
.squaring-line {
  stroke: rgba(239, 68, 68, 0.75);
  stroke-width: 2.5;
  stroke-dasharray: 6 4;
  fill: none;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6));
}

.squaring-corner-marker {
  fill: #ef4444;
  stroke: #ffffff;
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.8));
}

/* Footer / Teleprompter Notification */
.lodge-status-bar {
  background: #060910;
  border-top: 1px solid var(--border-gold);
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  z-index: 40;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-bright);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .lodge-inspector {
    width: 320px;
    right: 12px;
  }
  .ceremony-player-dock {
    width: 95%;
    bottom: 8px;
    padding: 10px 14px;
  }
}

/* Active Speaking Officer Glow (Radiant Beacon Aura on Floor) */
.officer-token.speaking-active {
  z-index: 25;
}

.officer-token.speaking-active .officer-halo {
  display: block !important;
  opacity: 1 !important;
  stroke-dasharray: none !important;
  animation: speakingHaloPulse 1.35s infinite cubic-bezier(0.1, 0.8, 0.2, 1) !important;
}

@keyframes speakingHaloPulse {
  0% {
    r: 22;
    stroke: #ffffff;
    stroke-width: 4px;
    opacity: 1;
    filter: drop-shadow(0 0 10px #fde047);
  }
  45% {
    stroke: #fde047;
    stroke-width: 3.5px;
    opacity: 0.85;
    filter: drop-shadow(0 0 22px #eab308);
  }
  100% {
    r: 52;
    stroke: #ca8a04;
    stroke-width: 1px;
    opacity: 0;
    filter: drop-shadow(0 0 30px rgba(202, 138, 4, 0));
  }
}

.officer-token.speaking-active .officer-node-bg {
  stroke: #ffffff !important;
  stroke-width: 4px !important;
  filter: drop-shadow(0 0 24px rgba(254, 240, 138, 1)) drop-shadow(0 0 10px #eab308) !important;
  animation: speakingNodePulse 1.35s infinite ease-in-out alternate !important;
}

@keyframes speakingNodePulse {
  0% {
    filter: drop-shadow(0 0 14px rgba(254, 240, 138, 0.85)) drop-shadow(0 0 6px #eab308);
    stroke-width: 3.5px;
    stroke: #fde047;
  }
  100% {
    filter: drop-shadow(0 0 34px rgba(254, 240, 138, 1)) drop-shadow(0 0 16px #f59e0b);
    stroke-width: 5px;
    stroke: #ffffff;
  }
}

.officer-token.speaking-active .officer-label-text {
  fill: #ffffff !important;
  font-weight: 800 !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)) !important;
}

/* Ceremony Player Dock (Floating Mobile Rehearsal Suite) */
.ceremony-player-dock {
  position: absolute;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 680px;
  background: rgba(10, 19, 36, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: var(--shadow-deep), 0 0 30px rgba(0, 0, 0, 0.9);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 10px;
  user-select: none;
}

/* Row 1: Fast Interactive Scrubber & Quick Navigation */
.scrubber-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.scrubber-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  gap: 8px;
}

.btn-jd-skip {
  background: rgba(20, 83, 45, 0.85);
  border: 1px solid rgba(74, 222, 128, 0.6);
  color: #86efac;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.25);
  touch-action: manipulation;
}

.btn-jd-skip:hover,
.btn-jd-skip:active {
  background: rgba(22, 101, 52, 1);
  color: #fff;
  border-color: #86efac;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.6);
  transform: scale(1.03);
}

.step-jumper {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  font-family: monospace;
}

.step-jumper-label,
.step-jumper-total {
  color: #94a3b8;
}

.step-num-input {
  width: 44px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: 5px;
  color: #fde047;
  font-weight: 800;
  text-align: center;
  font-size: 0.86rem;
  padding: 3px 0;
  outline: none;
  font-family: monospace;
  transition: var(--transition-smooth);
}

.step-num-input:focus {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 8px rgba(253, 224, 71, 0.4);
}

/* Touch & Mouse Scrubber Bar */
.timeline-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  touch-action: none;
  transition: height 0.15s ease, border-color 0.2s ease;
}

.timeline-track:hover,
.timeline-track.dragging {
  height: 14px;
  border-color: var(--gold-bright);
}

.timeline-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #9a7318 0%, #fde047 100%);
  border-radius: 5px;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.6);
}

.timeline-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #ffffff 15%, #fde047 60%, #b48a1c 100%);
  border: 2px solid #070d19;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.9), 0 2px 5px rgba(0, 0, 0, 0.7);
  cursor: grab;
  pointer-events: auto;
  z-index: 10;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.timeline-track:hover .timeline-thumb,
.timeline-track.dragging .timeline-thumb {
  transform: translate(-50%, -50%) scale(1.22);
  box-shadow: 0 0 18px rgba(253, 224, 71, 1), 0 2px 8px rgba(0, 0, 0, 0.9);
}

.timeline-track.dragging .timeline-thumb {
  cursor: grabbing;
}

/* Floating Scrubber Tooltip */
.scrubber-tooltip {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 23, 44, 0.97);
  border: 1px solid var(--gold-bright);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.76rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9), 0 0 12px rgba(212, 175, 55, 0.4);
  pointer-events: none;
  z-index: 60;
  min-width: 190px;
  max-width: 290px;
  text-align: left;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.15s ease;
}

.scrubber-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--gold-bright) transparent transparent transparent;
}

.scrubber-tooltip.hidden {
  display: none;
}

.tooltip-step {
  font-weight: 800;
  color: #fde047;
  font-size: 0.8rem;
  margin-bottom: 2px;
}

.tooltip-title {
  font-weight: 600;
  color: #94a3b8;
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.tooltip-preview {
  color: #f1f5f9;
  font-size: 0.75rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Row 2: Playback Controls Row */
.player-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.player-main-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-player {
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
  touch-action: manipulation;
}

.btn-player:hover,
.btn-player:active {
  background: var(--bg-card-hover);
  border-color: #fff;
  color: #fff;
}

.btn-player-round {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

.btn-player-nav {
  height: 36px;
  padding: 0 10px;
}

.btn-play-main {
  background: linear-gradient(135deg, #785a10 0%, #d4af37 100%);
  color: #070d19;
  border-color: #fde047;
  font-size: 0.88rem;
  font-weight: 800;
  height: 36px;
  min-width: 82px;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
}

.btn-play-main:hover,
.btn-play-main:active {
  background: linear-gradient(135deg, #9a7318 0%, #fde047 100%);
  color: #070d19;
  border-color: #fff;
  box-shadow: 0 0 18px rgba(253, 224, 71, 0.8);
  transform: scale(1.02);
}

.player-options-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.select-masonic {
  background: var(--bg-secondary);
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.select-act-mobile {
  max-width: 160px;
  text-overflow: ellipsis;
}

.select-masonic:focus {
  border-color: var(--gold-bright);
}

/* Backdrop Overlay for Slide-Out Drawer */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 90;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.sidebar-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Mobile Media Queries */
@media (max-width: 580px) {
  .top-controls-group {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
  }

  .btn-top-menu {
    width: 38px;
    height: 38px;
  }

  .btn-zoom {
    padding: 8px 10px;
  }

  .ceremony-live-card {
    top: max(58px, calc(env(safe-area-inset-top) + 48px)) !important;
    right: max(12px, env(safe-area-inset-right)) !important;
    left: max(12px, env(safe-area-inset-left)) !important;
    width: auto !important;
    max-width: none !important;
    gap: 6px;
  }

  .live-rubric-card {
    padding: 8px 12px;
  }

  .live-rubric-text {
    font-size: 0.78rem;
  }

  .live-speech-card {
    padding: 10px 12px;
  }

  .live-dialogue-text {
    font-size: 0.88rem;
  }

  .lodge-inspector {
    width: calc(100vw - 24px);
    right: 12px;
    left: 12px;
    top: max(60px, calc(env(safe-area-inset-top) + 50px));
  }

  .ceremony-player-dock {
    width: calc(100% - 16px);
    bottom: max(8px, env(safe-area-inset-bottom));
    padding: 8px 10px;
    gap: 6px;
  }

  .select-act-mobile {
    max-width: 110px;
  }
}

/* Standing officers posture highlight */
.brethren-standing .officer-node {
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

/* Gavel Strike Shockwave Ripple */
@keyframes gavel-ripple {
  0% {
    r: 12;
    opacity: 0.95;
    stroke-width: 4;
  }
  100% {
    r: 65;
    opacity: 0;
    stroke-width: 1;
  }
}

.gavel-shockwave {
  fill: none;
  stroke: #fde047;
  pointer-events: none;
  animation: gavel-ripple 0.85s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
  filter: drop-shadow(0 0 8px rgba(253, 224, 71, 0.8));
}


