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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #07090e;
  color: #e2e8f0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#app-layout {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

/* TOP BAR — OFFICIAL GW CORE RULES (ENG 24.09) DEEP IMPERIAL SLATE-TEAL & BURNISHED GOLD PALETTE */
#top-bar {
  height: 54px;
  background: linear-gradient(180deg, #0b2530 0%, #071820 100%);
  border-bottom: 2.5px solid #c59b27;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 20;
}

.aquila-tag {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #e6c65a;
  font-weight: bold;
}

#sector-header {
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: bold;
  color: #f4efe6;
  letter-spacing: 1px;
}

.terrain-key-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #091d26;
  border: 1px solid #234b5c;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 11px;
  color: #e2e8f0;
}

.tk-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tk-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.tk-dot.green {
  background: #22c55e;
  border: 1px solid #86efac;
}

.tk-dot.yellow {
  background: #eab308;
  border: 1px solid #fef08a;
}

.tk-dot.slate {
  background: #64748b;
  border: 1px solid #cbd5e1;
}

/* OFFICIAL GW CORE RULES (24.09) "THE BATTLE ROUND" CHEVRON PHASE ORDER DIAGRAM */
.phase-list-card {
  border: 1.5px solid #c59b27;
  background: linear-gradient(180deg, #0b1e28 0%, #07131a 100%);
  box-shadow: inset 0 0 18px rgba(197, 155, 39, 0.10);
}

.turn-owner-banner {
  text-align: center;
  font-family: Georgia, serif;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 5px 8px;
  margin-bottom: 7px;
  clip-path: polygon(8px 0%, calc(100% - 8px) 0%, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0% 50%);
}

.turn-owner-banner.player-turn {
  background: linear-gradient(90deg, #0d2b3a 0%, #14445a 50%, #0d2b3a 100%);
  border: 1px solid #c59b27;
  color: #f4efe6;
}

.turn-owner-banner.chaos-turn {
  background: linear-gradient(90deg, #5c1111 0%, #8b1e1e 50%, #5c1111 100%);
  border: 1px solid #f87171;
  color: #fef2f2;
}

.phase-list-vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.phase-step {
  position: relative;
  padding: 7px 10px 9px 10px;
  background: linear-gradient(180deg, #0c1f29 0%, #08151d 100%);
  border: 1px solid #1f3d4d;
  border-left: 4px solid #355f73;
  border-radius: 4px;
  color: #94a3b8;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

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

.ps-num-diamond {
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f2c3a;
  border: 1.5px solid #c59b27;
  color: #f5eedc;
  font-family: Georgia, serif;
  font-size: 10.5px;
  font-weight: 900;
  transform: rotate(45deg);
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

.ps-num-diamond::before {
  content: none;
}

.ps-title {
  flex: 1;
  font-family: Georgia, serif;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: #cbd5e1;
}

.ps-badge {
  display: none;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 4px;
  background: linear-gradient(180deg, #fde047 0%, #c59b27 100%);
  border: 1.5px solid #fffbeb;
  color: #07131a;
  letter-spacing: 1px;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.55);
  flex-shrink: 0;
}

.ps-sub {
  font-size: 10px;
  line-height: 1.3;
  color: #8da4b2;
  margin-top: 4px;
  padding: 2px 6px;
  border-left: 2px solid rgba(197, 155, 39, 0.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps-chevron-arrow {
  text-align: center;
  font-size: 8.5px;
  line-height: 1;
  color: #c59b27;
  margin-top: 4px;
  margin-bottom: -5px;
  opacity: 0.65;
  letter-spacing: 1px;
}

/* ACTIVE PHASE IN HARMONIOUS IMPERIAL SLATE-TEAL & BURNISHED GOLD PALETTE */
.phase-step.active {
  background: linear-gradient(90deg, #103242 0%, #15455a 55%, #0d2b38 100%);
  border: 1.5px solid #c59b27;
  border-left: 5px solid #e6c65a;
  color: #f8f4eb;
  box-shadow: 0 0 12px rgba(197, 155, 39, 0.30);
}

/* FIXED-SIZE NON-MINIMIZABLE UNIT / TERRAIN DATASHEET BOX (NEVER CHANGES SIZE BETWEEN MINIATURE & TERRAIN) */
.unit-hover-popout {
  position: absolute;
  top: 14px;
  left: 14px;
  right: auto;
  width: 338px;
  min-width: 338px;
  max-width: 338px;
  height: 642px;
  min-height: 642px;
  max-height: 642px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(11, 35, 45, 0.97) 0%, rgba(7, 19, 26, 0.98) 100%);
  border: 2px solid #c59b27;
  border-radius: 6px;
  padding: 9px 11px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.92), 0 0 18px rgba(197, 155, 39, 0.32);
  z-index: 65;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit-hover-popout.chaos-hover-card {
  border-color: #f87171;
  background: linear-gradient(180deg, rgba(48, 12, 17, 0.97) 0%, rgba(22, 7, 10, 0.98) 100%);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.92), 0 0 18px rgba(239, 68, 68, 0.38);
}

.uhp-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#datasheet-panel {
  flex: 1 1 0;
  min-height: 0;
  height: 468px;
  max-height: 468px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}

.uhp-roster-section {
  flex: 0 0 144px;
  height: 144px;
  min-height: 144px;
  max-height: 144px;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1.5px solid rgba(197, 155, 39, 0.4);
  padding-top: 6px;
}

.uhp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: Georgia, serif;
  font-size: 10.5px;
  font-weight: 900;
  color: #e6c65a;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(197, 155, 39, 0.35);
  padding-bottom: 3px;
  flex-shrink: 0;
}

.phase-step.active .ps-num-diamond {
  background: #c59b27;
  border-color: #fffbeb;
  color: #07131a;
}

.phase-step.active .ps-title {
  color: #f5eedc;
}

.phase-step.active .ps-badge {
  display: inline-block;
}

.phase-step.active .ps-sub {
  background: rgba(7, 20, 28, 0.78);
  color: #dbeafe;
  border-left: 2.5px solid #e6c65a;
  border-radius: 2px;
  padding: 3px 7px;
  font-weight: 600;
}

.phase-step.active .ps-sub strong {
  color: #fde047;
}

.phase-step.enemy-turn {
  background: linear-gradient(90deg, #6b1515 0%, #450a0a 100%);
  border-color: #f87171;
  border-left: 5px solid #ef4444;
  color: #fecaca;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

.phase-step.enemy-turn .ps-num-diamond {
  background: #991b1b;
  border-color: #fca5a5;
  color: #ffffff;
}

.phase-step.enemy-turn .ps-badge {
  display: inline-block;
  background: #ef4444;
  color: #ffffff;
}

.phase-step.enemy-turn .ps-sub {
  color: #fca5a5;
}

/* SOLIDIFIED COMMAND ACTION LIST (LEFT COMMAND BAR) */
.command-list-card {
  border-color: #c59b27;
  background: linear-gradient(180deg, #0b1e28 0%, #07131a 100%);
}

.command-action-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cmd-list-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 11px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.clb-main {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.clb-sub {
  font-size: 9.5px;
  opacity: 0.88;
  margin-top: 2px;
}

.primary-cmd-btn {
  background: linear-gradient(180deg, #ca8a04 0%, #854d0e 100%);
  border: 2px solid #fef08a;
  color: #fffbeb;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.35);
}

.primary-cmd-btn:hover {
  background: linear-gradient(180deg, #eab308 0%, #a16207 100%);
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.55);
  transform: translateY(-1px);
}

.undo-cmd-btn {
  background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
  border: 1.5px solid #60a5fa;
  color: #eff6ff;
}

.undo-cmd-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  border-color: #fde047;
  color: #ffffff;
}

.undo-cmd-btn:disabled {
  opacity: 0.38;
  background: #0f172a;
  border-color: #334155;
  color: #64748b;
  cursor: not-allowed;
}

.deploy-cmd-btn {
  background: linear-gradient(180deg, #14532d 0%, #052e16 100%);
  border: 1.5px solid #4ade80;
  color: #dcfce7;
}

.deploy-cmd-btn:hover {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
  border-color: #fef08a;
}

.tray-cmd-btn {
  background: #172033;
  border: 1px solid #475569;
  color: #e2e8f0;
}

.tray-cmd-btn:hover {
  background: #1e293b;
  border-color: #facc15;
  color: #fef08a;
}

.turn-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-pill {
  background: #111827;
  border: 1px solid #334155;
  border-radius: 3px;
  padding: 5px 10px;
  font-size: 11px;
  color: #94a3b8;
}

.stat-pill strong {
  color: #facc15;
  font-size: 13px;
  margin-left: 3px;
}

.undo-btn {
  background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
  border: 1.5px solid #60a5fa;
  border-radius: 3px;
  color: #eff6ff;
  font-weight: 700;
  font-size: 11.5px;
  padding: 6px 13px;
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.undo-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #fde047;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.45);
  transform: translateY(-1px);
}

.undo-btn:disabled {
  opacity: 0.35;
  background: #111827;
  border-color: #334155;
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
}

.gold-btn {
  background: linear-gradient(180deg, #ca8a04 0%, #854d0e 100%);
  border: 1.5px solid #fef08a;
  border-radius: 3px;
  color: #fffbeb;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.8px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gold-btn:hover {
  background: linear-gradient(180deg, #eab308 0%, #a16207 100%);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.45);
}

/* MAIN 3-COLUMN WORKSPACE */
#main-area {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.side-panel {
  width: 312px;
  min-width: 312px;
  max-width: 312px;
  background: #08121a;
  border-right: 1.5px solid #1e3a4c;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  overflow-y: auto;
  transition: width 0.18s ease, min-width 0.18s ease, padding 0.18s ease;
}

.left-sidebar-bottom-footer {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid rgba(197, 155, 39, 0.35);
}

.exit-menu-cmd-btn {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.88) 0%, rgba(15, 23, 42, 0.96) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.32);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.exit-menu-cmd-btn:hover {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.88) 0%, rgba(69, 10, 10, 0.96) 100%);
  border-color: #f87171;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

/* UPPER-LEFT ACTIVE PHASE OPTIONS CARD & PHASE-SPECIFIC POPOUT MENUS */
.active-phase-options-card {
  border: 2px solid #c59b27;
  background: linear-gradient(180deg, #0d2b38 0%, #081a22 100%);
  box-shadow: 0 0 16px rgba(197, 155, 39, 0.22);
}

.active-phase-options-card > .card-header {
  color: #e6c65a;
  font-size: 11px;
  border-bottom-color: rgba(197, 155, 39, 0.38);
}

.phase-step-popouts {
  margin-top: 6px;
  margin-bottom: 2px;
}

.cmd-phase-stratagem-wrap {
  margin-top: 5px;
}

.popout-menu-item {
  position: relative;
  margin-bottom: 5px;
}

.popout-trigger-btn {
  width: 100%;
  height: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(148, 163, 184, 0.09) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-top: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 5px;
  padding: 0 8px;
  color: #ffffff;
  font-family: Georgia, serif;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.35px;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28), 0 4px 10px rgba(0, 0, 0, 0.45);
  transition: all 0.14s ease;
}

.ptb-label {
  flex: 1 1 auto;
  min-width: 0;
  color: #ffffff;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popout-trigger-btn:hover,
.popout-menu-item.popout-open > .popout-trigger-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0%, rgba(186, 230, 253, 0.16) 100%);
  border-color: rgba(255, 255, 255, 0.82);
  color: #ffffff;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.45), 0 0 12px rgba(255, 255, 255, 0.32);
}

.popout-arrow {
  flex: 0 0 66px;
  width: 66px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Courier New', monospace;
  font-size: 9px;
  font-weight: 900;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.popout-drawer {
  display: none;
  position: fixed;
  left: 312px;
  top: 150px;
  width: 355px;
  max-height: 75vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(11, 37, 48, 0.99) 0%, rgba(7, 20, 27, 0.99) 100%);
  border: 2.5px solid #c59b27;
  border-radius: 6px;
  padding: 11px 13px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.94), 0 0 20px rgba(197, 155, 39, 0.35);
  z-index: 95;
}

.popout-drawer::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 0;
  bottom: 0;
  width: 24px;
}

.popout-drawer.left-opening-drawer {
  left: auto;
  right: 298px;
  top: 190px;
  width: 350px;
}

.popout-menu-item:hover > .popout-drawer,
.popout-menu-item.popout-open > .popout-drawer {
  display: block;
}

.popout-drawer-header {
  font-family: Georgia, serif;
  font-size: 11.5px;
  font-weight: 900;
  color: #fef08a;
  letter-spacing: 0.8px;
  border-bottom: 1.5px solid rgba(212, 175, 55, 0.45);
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.popout-drawer-sub {
  font-size: 10px;
  color: #cbd5e1;
  margin-bottom: 7px;
}

.battleshock-cmd-btn {
  background: linear-gradient(180deg, #7c2d12 0%, #431407 100%);
  border: 1.5px solid #facc15;
  color: #fef08a;
  margin-top: 4px;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.28);
}

.battleshock-cmd-btn:hover {
  background: linear-gradient(180deg, #9a3412 0%, #7c2d12 100%);
  border-color: #ffffff;
  color: #ffffff;
}

.phase-opt-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.po-sub-title {
  font-size: 10px;
  font-weight: 800;
  color: #fde047;
  letter-spacing: 0.6px;
}

.po-hint {
  font-size: 10.5px;
  line-height: 1.38;
  color: #cbd5e1;
  background: rgba(9, 13, 22, 0.72);
  border: 1px solid #263552;
  border-radius: 3px;
  padding: 5px 7px;
}

.po-stack-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.po-big-opt-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  background: #131c2e;
  border: 1.5px solid #334155;
  border-left: 4px solid #60a5fa;
  border-radius: 4px;
  padding: 7px 9px;
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.14s ease;
}

.po-big-opt-btn:hover {
  background: #1e293b;
  border-color: #facc15;
  transform: translateX(2px);
}

.po-big-opt-btn.active {
  background: linear-gradient(90deg, #1e3a8a 0%, #172554 100%);
  border-color: #facc15;
  border-left: 5px solid #facc15;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
}

.po-big-opt-btn.doctrine-btn.active {
  background: linear-gradient(90deg, #854d0e 0%, #422006 100%);
  border-color: #fef08a;
  border-left: 5px solid #fef08a;
}

.pob-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 800;
  color: #fef08a;
  margin-bottom: 2px;
}

.pob-tag {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #60a5fa;
  color: #bfdbfe;
  padding: 1px 5px;
  border-radius: 3px;
}

.pob-desc {
  font-size: 10px;
  line-height: 1.32;
  color: #dbeafe;
}

.save-status-badge {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  font-weight: 800;
  color: #bbf7d0;
  background: #052e16;
  border: 1px solid #4ade80;
  border-radius: 3px;
  padding: 4px 8px;
}

.side-panel.sidebar-minimized {
  width: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

#right-panel {
  border-right: none;
  border-left: 1px solid #1e293b;
  width: 295px;
}

.panel-card {
  background: linear-gradient(180deg, #0c222c 0%, #08161d 100%);
  border: 1px solid #274d5e;
  border-top: 2px solid #c59b27;
  border-radius: 4px;
  padding: 8px 10px;
}

.card-header {
  font-family: Georgia, serif;
  font-size: 10.5px;
  font-weight: 800;
  color: #e6c65a;
  letter-spacing: 1px;
  border-bottom: 1px solid #244757;
  padding-bottom: 4px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.collapsible-header {
  cursor: pointer;
  user-select: none;
}

.collapsible-header:hover {
  color: #fef08a;
}

.header-right-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.collapse-toggle-btn {
  background: #1e293b;
  border: 1px solid #475569;
  color: #fef08a;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 900;
  width: 18px;
  height: 18px;
  line-height: 14px;
  text-align: center;
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
  transition: all 0.12s ease;
}

.collapse-toggle-btn:hover {
  background: #2563eb;
  border-color: #facc15;
  color: #ffffff;
}

.collapsible-card.minimized > .card-body {
  display: none !important;
}

.collapsible-card.minimized > .card-header,
.collapsible-card.minimized > .vml-title {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.log-body-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 140px;
}

/* Strike Force Roster & Point Cost Badges */
.roster-pts-header-badge {
  font-family: 'Courier New', monospace;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 3px;
  background: #1e3a8a;
  border: 1px solid #60a5fa;
  color: #fef08a;
}

.roster-points-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0b111d;
  border: 1px solid #263552;
  border-radius: 3px;
  padding: 4px 8px;
  margin-bottom: 6px;
  font-size: 10px;
  color: #cbd5e1;
}

.roster-points-bar strong {
  color: #facc15;
  font-family: 'Courier New', monospace;
}

.roster-pts-tag {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: 9.5px;
  font-weight: 800;
  color: #fde047;
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 3px;
  padding: 0 5px;
  margin-left: 4px;
}

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roster-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  background: #161f30;
  border: 1px solid #28354e;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11.5px;
  transition: all 0.12s;
}

.roster-item:hover {
  border-color: #60a5fa;
}

.roster-item.selected {
  background: #1e3a8a;
  border-color: #facc15;
}

.roster-status-dot {
  font-size: 10.5px;
  color: #93c5fd;
  font-family: 'Courier New', monospace;
  font-weight: bold;
}

.deploy-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  letter-spacing: 0.4px;
}

.deploy-badge.pending {
  background: #854d0e;
  border: 1px solid #facc15;
  color: #fef08a;
}

.deploy-badge.ready {
  background: #14532d;
  border: 1px solid #4ade80;
  color: #bbf7d0;
}

.deploy-helper-btn {
  border-color: #facc15 !important;
  color: #fef08a !important;
  font-weight: 700 !important;
}

/* Datasheet Card */
.ds-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.ds-unit-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tsd-portrait-canvas {
  background: radial-gradient(circle at center, #172554 0%, #090d16 100%);
  border: 1.5px solid #eab308;
  border-radius: 5px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.75);
}

.opponent-side .tsd-portrait-canvas {
  background: radial-gradient(circle at center, #450a0a 0%, #090d16 100%);
  border-color: #ef4444;
}

.ds-unit-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
}

.ds-unit-role {
  font-size: 10px;
  color: #93c5fd;
}

.cover-pill {
  background: #14532d;
  border: 1px solid #4ade80;
  color: #bbf7d0;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
}

.ds-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.stat-cell {
  background: #090d14;
  border: 1px solid #475569;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 2px;
  transition: all 0.18s ease;
  position: relative;
}

.sc-lbl {
  font-size: 9px;
  color: #eab308;
  font-weight: 800;
}

.sc-val {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  font-family: 'Courier New', monospace;
}

.sc-desc {
  font-size: 7.5px;
  color: #94a3b8;
  letter-spacing: 0.2px;
  margin-top: 1px;
}

/* GLOWING PULSING HIGHLIGHT FOR ACTIVE STAT NUMBERS IN DATASHEETS */
@keyframes statPulseGlow {
  0% {
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.65), inset 0 0 8px rgba(250, 204, 21, 0.35);
    transform: translateY(-1px) scale(1.04);
  }
  50% {
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.98), inset 0 0 12px rgba(250, 204, 21, 0.55);
    transform: translateY(-2px) scale(1.08);
  }
  100% {
    box-shadow: 0 0 6px rgba(250, 204, 21, 0.65), inset 0 0 8px rgba(250, 204, 21, 0.35);
    transform: translateY(-1px) scale(1.04);
  }
}

.stat-cell.stat-active-highlight,
.wstat-cell.stat-active-highlight {
  background: linear-gradient(180deg, #854d0e 0%, #422006 100%) !important;
  border: 2px solid #fef08a !important;
  animation: statPulseGlow 1.15s infinite ease-in-out;
  z-index: 4;
}

.stat-cell.stat-active-highlight .sc-lbl,
.wstat-cell.stat-active-highlight .ws-lbl {
  color: #fef08a !important;
  text-decoration: underline;
}

.stat-cell.stat-active-highlight .sc-val,
.wstat-cell.stat-active-highlight .ws-val {
  color: #ffffff !important;
  font-size: 14px;
  text-shadow: 0 0 8px #facc15;
}

.stat-cell.stat-active-highlight .sc-desc {
  color: #fde047 !important;
  font-weight: 800;
}

.stat-cell.stat-secondary-highlight,
.wstat-cell.stat-secondary-highlight {
  background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%) !important;
  border: 1.5px solid #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
}

.ds-phase-guide-hint {
  background: rgba(30, 58, 138, 0.38);
  border: 1px solid rgba(96, 165, 250, 0.5);
  border-left: 3px solid #facc15;
  border-radius: 3px;
  padding: 4px 7px;
  font-size: 9.5px;
  color: #e0f2fe;
  line-height: 1.35;
  margin-bottom: 5px;
}

.ds-phase-guide-hint strong {
  color: #fef08a;
}

/* 6-Column Weapon Profile Stat Cells (RNG | A | BS/WS | S | AP | D) */
.tsd-wstat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  margin-top: 4px;
  margin-bottom: 3px;
}

.wstat-cell {
  background: #090d16;
  border: 1px solid #334155;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 2px;
  transition: all 0.16s ease;
}

.ws-lbl {
  font-size: 8px;
  font-weight: 800;
  color: #93c5fd;
}

.ws-val {
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  font-family: 'Courier New', monospace;
}

.wc-type-tag {
  font-size: 9px;
  color: #fde047;
  font-family: 'Courier New', monospace;
}

.ds-sub-header {
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  margin: 5px 0 3px 0;
  letter-spacing: 0.5px;
}

.weapon-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weapon-card {
  background: #172033;
  border: 1px solid #2d3c59;
  border-radius: 3px;
  padding: 5px 7px;
  font-size: 10.5px;
  cursor: pointer;
}

.weapon-card.active {
  border-color: #38bdf8;
  background: #1e293b;
}

.wc-top {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 2px;
}

.wc-stats {
  color: #cbd5e1;
  font-size: 10px;
  font-family: 'Courier New', monospace;
}

.wc-kw {
  color: #38bdf8;
  font-size: 9px;
  margin-top: 2px;
  font-weight: 600;
}

.ds-ability-box {
  margin-top: 6px;
  background: #0c1018;
  border: 1px solid #222c40;
  border-radius: 3px;
  padding: 5px 7px;
  font-size: 10.5px;
  line-height: 1.35;
  color: #cbd5e1;
}

.oath-box {
  background: rgba(8, 22, 31, 0.85);
  border: 1px solid rgba(197, 155, 39, 0.55);
  border-left: 3px solid #c59b27;
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 10px;
  color: #f5eedc;
  margin-top: 3px;
  margin-bottom: 4px;
}

.enemy-auspex-box {
  background: #140d10;
  border: 1px solid #4c1d24;
  border-radius: 3px;
  padding: 5px 7px;
  font-size: 10.5px;
  line-height: 1.35;
  color: #e2e8f0;
}

/* CENTER BOARD */
#board-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #06080c;
  overflow: hidden;
}

#phase-banner {
  background: #111b30;
  border-bottom: 1px solid #2563eb;
  padding: 6px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: #fef08a;
  font-weight: 600;
}

.terrain-legend {
  display: flex;
  gap: 14px;
  font-size: 10.5px;
  color: #cbd5e1;
  font-weight: normal;
}

.camera-controls-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cam-hint {
  font-size: 10px;
  font-weight: 800;
  color: #93c5fd;
  letter-spacing: 0.8px;
}

.cam-btn {
  background: #1e293b;
  border: 1px solid #60a5fa;
  border-radius: 3px;
  color: #e0f2fe;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.cam-btn:hover {
  background: #2563eb;
  border-color: #facc15;
  color: #ffffff;
}

.fpv-los-btn {
  background: linear-gradient(180deg, #0e4f63 0%, #09303d 100%);
  border: 1.5px solid #38bdf8;
  color: #e0f2fe;
}

.fpv-los-btn.active {
  background: linear-gradient(180deg, #15803d 0%, #14532d 100%) !important;
  border-color: #fef08a !important;
  color: #fef08a !important;
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.65);
}

.cam-btn.active {
  background: #1d4ed8;
  border-color: #facc15;
  color: #fef08a;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.35);
}

.zoom-readout {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 800;
  color: #fef08a;
  background: #0b1120;
  border: 1px solid #334155;
  padding: 2px 6px;
  border-radius: 3px;
}

#canvas-viewport {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 6px;
}

.viewport-mouse-legend {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(9, 13, 22, 0.92);
  border: 1.5px solid #3b82f6;
  border-left: 4px solid #facc15;
  border-radius: 4px;
  padding: 7px 11px;
  font-size: 10.5px;
  color: #e2e8f0;
  line-height: 1.45;
  pointer-events: none;
  z-index: 35;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85);
}

.vml-title {
  font-size: 10px;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(96, 165, 250, 0.3);
  padding-bottom: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.viewport-mouse-legend {
  pointer-events: auto;
}

.vml-item strong {
  color: #93c5fd;
}

#tabletop-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border: 2px solid #334155;
  border-radius: 3px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.9);
  cursor: crosshair;
}

/* PERSISTENT BOTTOM-CENTER STATUS INDICATOR ON THE VERY MIDDLE BOTTOM OF THE GAME BOARD SCREEN */
.turn-popup-container {
  position: absolute;
  bottom: 10px;
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 65;
  width: 66%;
  max-width: 620px;
}

.turn-popup-card {
  background: linear-gradient(180deg, rgba(15, 25, 48, 0.96) 0%, rgba(7, 11, 22, 0.98) 100%);
  border: 2px solid #facc15;
  outline: 1px solid #854d0e;
  border-radius: 6px;
  padding: 7px 18px;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.95),
    0 0 20px rgba(250, 204, 21, 0.35),
    inset 0 0 14px rgba(59, 130, 246, 0.22);
  text-align: center;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
  width: 100%;
}

.turn-popup-card.status-pulse {
  transform: translateY(-2px) scale(1.01);
}

.turn-popup-card.chaos-popup {
  background: linear-gradient(180deg, rgba(78, 12, 12, 0.96) 0%, rgba(30, 5, 5, 0.98) 100%);
  border-color: #ef4444;
  outline-color: #7f1d1d;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.96),
    0 0 22px rgba(239, 68, 68, 0.48),
    inset 0 0 14px rgba(220, 38, 38, 0.22);
}

.tpc-phase-badge {
  display: inline-block;
  font-family: 'Courier New', monospace;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.6px;
  padding: 2px 10px;
  border-radius: 3px;
  background: rgba(250, 204, 21, 0.22);
  border: 1px solid rgba(250, 204, 21, 0.55);
  color: #fef08a;
  margin-bottom: 3px;
}

.turn-popup-card.chaos-popup .tpc-phase-badge {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.tpc-title {
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}

.tpc-detail {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  line-height: 1.32;
}

@keyframes popupSlideIn {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ENLARGED CENTER-STAGE FOCUS BACKDROP WITH LEFT (PLAYER DATASHEET) + CENTER (ADVANCE WARS SPLIT + OCTAGONAL TRAY) + RIGHT (OPPONENT DATASHEET) */
.dice-focus-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(7, 22, 30, 0.82) 0%, rgba(3, 8, 12, 0.96) 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 80;
  padding: 6px 10px;
  animation: fadeInBackdrop 0.16s ease-out;
}

#canvas-viewport:has(#dice-focus-backdrop:not(.hidden)) #unit-hover-popout {
  display: none !important;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; }
  to { opacity: 1; }
}

.dice-encounter-layout {
  display: grid;
  grid-template-columns: minmax(390px, 1fr) minmax(660px, 740px) minmax(390px, 1fr);
  align-items: stretch;
  justify-content: center;
  gap: 0;
  width: 98.5%;
  max-width: 1920px;
  height: 95.5%;
  max-height: 96vh;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.98);
}

.tray-side-datasheet {
  width: 100%;
  background: linear-gradient(180deg, rgba(11, 37, 48, 0.99) 0%, rgba(7, 21, 28, 0.99) 100%);
  border: 2.5px solid #c59b27;
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  transition: width 0.16s ease, padding 0.16s ease;
}

.tray-side-datasheet.minimized {
  width: 215px;
  align-self: flex-start;
}

.tsd-header-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tsd-codex-guide-box {
  background: linear-gradient(180deg, #f2ece1 0%, #e5dcc8 100%);
  border: 2px solid #c59b27;
  border-left: 6px solid #0b2530;
  border-radius: 5px;
  padding: 9px 11px;
  margin-top: 2px;
  margin-bottom: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.opponent-side .tsd-codex-guide-box {
  background: linear-gradient(180deg, #f2ece1 0%, #e8ddd5 100%);
  border-left: 6px solid #8b1e1e;
}

.cg-badge {
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 900;
  color: #0b2530;
  letter-spacing: 0.7px;
  margin-bottom: 4px;
  border-bottom: 1.5px solid rgba(197, 155, 39, 0.55);
  padding-bottom: 3px;
}

.opponent-side .cg-badge {
  color: #7c1919;
}

.cg-body {
  font-size: 11.5px;
  line-height: 1.46;
  color: #101b22;
  font-weight: 600;
}

.cg-hl {
  display: inline-block;
  background: #0b2530;
  border: 1.5px solid #d4af37;
  color: #fef08a;
  font-family: 'Courier New', monospace;
  font-weight: 900;
  padding: 0 5px;
  border-radius: 3px;
}

.cg-mini-table {
  display: inline-block;
  background: #0b2530;
  border: 1px solid #c59b27;
  border-radius: 3px;
  padding: 3px 7px;
  margin-top: 3px;
  font-family: 'Courier New', monospace;
  font-size: 10.5px;
  color: #fef08a;
}

.tray-side-datasheet.player-side {
  border-right: none;
  border-radius: 8px 0 0 8px;
  box-shadow: inset 0 0 22px rgba(22, 78, 99, 0.35);
}

.tray-side-datasheet.opponent-side {
  border-color: #c59b27;
  border-left: none;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(180deg, rgba(44, 14, 18, 0.99) 0%, rgba(20, 7, 9, 0.99) 100%);
  box-shadow: inset 0 0 22px rgba(185, 28, 28, 0.28);
}

.tsd-RoleBanner {
  font-family: Georgia, serif;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 6px 10px;
  border-radius: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, #0b2530 0%, #164e63 50%, #0b2530 100%);
  border: 1.5px solid #d4af37;
  color: #fef08a;
}

.tsd-RoleBanner.chaos {
  background: linear-gradient(90deg, #5c1111 0%, #8b1e1e 50%, #5c1111 100%);
  border-color: #d4af37;
  color: #fef08a;
}

.tsd-unit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid rgba(197, 155, 39, 0.35);
  padding-bottom: 6px;
  margin-bottom: 5px;
}

.tsd-unit-title {
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 800;
  color: #f8f4eb;
}

.tsd-unit-sub {
  font-size: 10.5px;
  color: #7dd3fc;
  font-weight: 700;
}

.opponent-side .tsd-unit-sub {
  color: #fca5a5;
}

.tsd-wounds-pill {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 3px;
  background: #07171f;
  border: 1.5px solid #4ade80;
  color: #bbf7d0;
}

.tsd-section-lbl {
  font-family: Georgia, serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.9px;
  color: #e6c65a;
  margin-top: 6px;
  margin-bottom: 4px;
}

.tsd-weapon-box {
  background: rgba(9, 25, 34, 0.92);
  border: 1px solid #38bdf8;
  border-radius: 4px;
  padding: 7px 9px;
  font-size: 11px;
  margin-bottom: 5px;
}

.opponent-side .tsd-weapon-box {
  background: rgba(32, 10, 13, 0.92);
  border-color: #f87171;
}

.tsd-weapon-box.active-attack-weapon {
  border: 2px solid #facc15;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.45);
}

.tsd-breakdown-box {
  background: rgba(234, 179, 8, 0.14);
  border: 1.5px solid rgba(250, 204, 21, 0.65);
  border-radius: 4px;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.45;
  color: #fef9c3;
  margin-top: 5px;
}

.tsd-breakdown-box strong {
  color: #fde047;
}

.animated-dice-overlay {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #0b2530 0%, #07161d 100%);
  border: 3px solid #d4af37;
  border-radius: 0;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  box-shadow: 0 0 42px rgba(212, 175, 55, 0.45);
}

/* NINTENDO ADVANCE WARS-STYLE SPLIT BATTLE SCREEN */
.advance-wars-stage-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
  border: 2.5px solid #d4af37;
  border-radius: 6px;
  background: #061017;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.85), inset 0 0 16px rgba(212, 175, 55, 0.25);
  overflow: hidden;
}

#advance-wars-split-canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 22vh;
}

.ado-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ado-header-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ado-mini-btn {
  background: #1e293b;
  border: 1.5px solid #facc15;
  border-radius: 4px;
  color: #fef08a;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}

.ado-mini-btn:hover {
  background: #854d0e;
  color: #ffffff;
}

.ado-mini-btn.skip-btn {
  background: #1d4ed8;
  border-color: #93c5fd;
  color: #ffffff;
}

.ado-mini-btn.skip-btn:hover {
  background: #2563eb;
}

.ado-turn-tag {
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  font-weight: 800;
  color: #facc15;
  letter-spacing: 1.2px;
}

.ado-title {
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
}

.ado-subtitle {
  font-size: 11.5px;
  color: #93c5fd;
  font-family: 'Courier New', monospace;
  margin-bottom: 8px;
}

.octagon-canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}

#octagonal-tray-canvas {
  display: block;
  max-width: 100%;
  max-height: 37vh;
  width: auto;
  height: auto;
  cursor: pointer;
}

.ado-stages {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}

.ado-stage-row {
  background: rgba(9, 13, 22, 0.9);
  border: 1px solid #263147;
  border-radius: 4px;
  padding: 5px 10px;
  transition: all 0.15s ease;
}

.ado-stage-row.active-stage {
  background: rgba(30, 58, 138, 0.55);
  border-color: #facc15;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
}

.ado-stage-row.done-stage {
  border-color: #22c55e;
}

.ado-stage-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: #f1f5f9;
}

.stage-result-text {
  color: #fde047;
  font-family: 'Courier New', monospace;
}

.ado-verdict {
  font-size: 13px;
  font-weight: 800;
  color: #fef08a;
  text-align: center;
  padding: 7px 10px;
  background: rgba(234, 179, 8, 0.18);
  border: 1.5px solid rgba(250, 204, 21, 0.55);
  border-radius: 4px;
  cursor: pointer;
}

.ado-verdict.ready-to-close {
  background: linear-gradient(90deg, rgba(20, 83, 45, 0.85) 0%, rgba(133, 77, 14, 0.88) 50%, rgba(20, 83, 45, 0.85) 100%);
  border: 2px solid #fef08a;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.65);
}

/* DICE CUBES & TUMBLE ANIMATION */
.die-cube {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  border-radius: 4px;
  border: 1.5px solid #64748b;
  background: #1e293b;
  color: #f8fafc;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.2), 0 2px 4px rgba(0,0,0,0.6);
  transition: transform 0.15s ease, background 0.15s ease;
}

.die-cube.rolling {
  animation: diceTumble 0.14s infinite linear;
  background: #334155;
  border-color: #93c5fd;
  color: #ffffff;
}

@keyframes diceTumble {
  0%   { transform: rotate(0deg) scale(1.06); }
  25%  { transform: rotate(-14deg) scale(0.95); }
  50%  { transform: rotate(12deg) scale(1.08); }
  75%  { transform: rotate(-8deg) scale(0.96); }
  100% { transform: rotate(0deg) scale(1.06); }
}

.die-cube.crit {
  background: linear-gradient(180deg, #ca8a04 0%, #854d0e 100%);
  border-color: #fef08a;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.65);
}

.die-cube.pass {
  background: linear-gradient(180deg, #15803d 0%, #14532d 100%);
  border-color: #4ade80;
  color: #dcfce7;
}

.die-cube.fail {
  background: #3b0a0a;
  border-color: #ef4444;
  color: #fca5a5;
  opacity: 0.7;
}

/* BOTTOM ACTION BAR */
#bottom-action-bar {
  height: 46px;
  background: #0c111b;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 10px;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bar-label {
  font-size: 10px;
  font-weight: 700;
  color: #eab308;
  margin-right: 3px;
}

.order-btn, .doctrine-btn {
  background: #182234;
  border: 1px solid #334155;
  border-radius: 3px;
  color: #cbd5e1;
  padding: 5px 9px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s;
}

.order-btn:hover, .doctrine-btn:hover {
  border-color: #60a5fa;
  color: #ffffff;
}

.order-btn.active {
  background: #1d4ed8;
  border-color: #facc15;
  color: #fef08a;
  font-weight: 700;
}

.doctrine-btn.active {
  background: #854d0e;
  border-color: #fde047;
  color: #fef9c3;
  font-weight: 700;
}

.doctrine-btn.used {
  opacity: 0.35;
  text-decoration: line-through;
  pointer-events: none;
}

/* RIGHT PANEL: 2x2 Stratagem Grid, Dice Tray & Battle Log */
.stratagem-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.strat-btn {
  background: #161f30;
  border: 1px solid #2e3d59;
  border-radius: 3px;
  color: #e2e8f0;
  padding: 5px 6px;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s;
}

.strat-btn:hover {
  border-color: #facc15;
  background: #1e293b;
}

.strat-top {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  color: #facc15;
  margin-bottom: 2px;
}

.strat-desc {
  font-size: 9.5px;
  color: #cbd5e1;
  line-height: 1.2;
}

.dice-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dice-header {
  font-size: 10.5px;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 5px;
}

.dice-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px;
  background: #080b11;
  border: 1px solid #1e293b;
  border-radius: 3px;
  min-height: 44px;
  max-height: 92px;
  overflow-y: auto;
}

.combat-log {
  flex: 1;
  overflow-y: auto;
  background: #080b11;
  border: 1px solid #1e293b;
  border-radius: 3px;
  padding: 6px;
  font-size: 10.5px;
  font-family: 'Courier New', monospace;
  line-height: 1.38;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-entry {
  border-bottom: 1px dashed #172033;
  padding-bottom: 3px;
}

.log-entry.player { color: #93c5fd; }
.log-entry.enemy { color: #fca5a5; }
.log-entry.gold { color: #fde047; font-weight: bold; }

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-box {
  width: 720px;
  max-width: 95vw;
  max-height: 92vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #111827 0%, #090d16 100%);
  border: 2px solid #ca8a04;
  border-radius: 5px;
  padding: 22px 26px;
  text-align: center;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.95);
}

.wide-modal-box {
  width: 980px;
}

/* PRE-START LEGAL & INTELLECTUAL PROPERTY DISCLAIMER SCREEN */
.legal-disclaimer-box {
  border-color: #eab308;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.96), 0 0 24px rgba(234, 179, 8, 0.18);
}

.legal-unofficial-banner {
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.85) 0%, rgba(153, 27, 27, 0.92) 50%, rgba(127, 29, 29, 0.85) 100%);
  border: 1px solid #f87171;
  border-radius: 4px;
  padding: 8px 14px;
  margin: 8px 0 14px 0;
  color: #fef2f2;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.legal-unofficial-banner strong {
  color: #fde047;
}

.legal-scroll-container {
  max-height: 48vh;
  overflow-y: auto;
  text-align: left;
  background: rgba(6, 9, 15, 0.88);
  border: 1px solid #334155;
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-section-card {
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(71, 85, 105, 0.65);
  border-left: 3px solid #ca8a04;
  border-radius: 4px;
  padding: 9px 12px;
}

.legal-section-card h3 {
  font-size: 11px;
  letter-spacing: 0.7px;
  color: #fde047;
  margin: 0 0 5px 0;
  text-transform: uppercase;
}

.legal-section-card p {
  font-size: 11.5px;
  line-height: 1.48;
  color: #cbd5e1;
  margin: 0;
}

.legal-section-card strong {
  color: #f8fafc;
}

.legal-section-card code {
  color: #93c5fd;
  background: rgba(30, 41, 59, 0.9);
  padding: 1px 5px;
  border-radius: 3px;
}

.legal-ack-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.legal-ack-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #475569;
  border-radius: 4px;
  padding: 8px 14px;
  width: 100%;
}

.legal-ack-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #eab308;
  cursor: pointer;
}

.legal-ack-checkbox-label strong {
  color: #fde047;
}

#accept-legal-disclaimer-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.saved-campaign-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, #052e16 0%, #14532d 50%, #052e16 100%);
  border: 2px solid #4ade80;
  border-radius: 5px;
  padding: 10px 14px;
  margin-bottom: 14px;
  text-align: left;
  gap: 12px;
}

.scb-info {
  font-size: 12px;
  color: #dcfce7;
}

.scb-info strong {
  color: #fef08a;
  margin-right: 6px;
}

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

.starter-list-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.starter-list-card {
  background: linear-gradient(180deg, #151f33 0%, #0d1322 100%);
  border: 2px solid #334155;
  border-radius: 6px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.16s ease;
}

.starter-list-card:hover {
  border-color: #60a5fa;
  transform: translateY(-2px);
}

.starter-list-card.selected {
  background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%);
  border-color: #facc15;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.45);
}

.slc-tier {
  font-family: 'Courier New', monospace;
  font-size: 9.5px;
  font-weight: 900;
  color: #fef08a;
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(250, 204, 21, 0.55);
  border-radius: 3px;
  padding: 2px 6px;
  display: inline-block;
  align-self: flex-start;
}

.slc-title {
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: bold;
  color: #ffffff;
}

.slc-desc {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.36;
}

.slc-units-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  background: rgba(9, 13, 22, 0.78);
  border: 1px solid #263552;
  border-radius: 4px;
  padding: 6px 8px;
}

.slc-unit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #e2e8f0;
}

.modal-footer-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.modal-main-title {
  font-family: Georgia, serif;
  font-size: 28px;
  color: #facc15;
  letter-spacing: 1.5px;
  margin: 6px 0;
}

.modal-sub {
  font-size: 12px;
  color: #93c5fd;
  margin-bottom: 16px;
}

.modal-lore {
  text-align: left;
  background: #090c12;
  border: 1px solid #263147;
  border-radius: 4px;
  padding: 14px 18px;
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 18px;
}

.modal-lore ul {
  margin-top: 8px;
  padding-left: 20px;
}

.modal-lore li {
  margin-bottom: 6px;
}

.big-btn {
  font-size: 14px;
  padding: 11px 24px;
}

.recruit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.recruit-card {
  background: #151e30;
  border: 2px solid #3b82f6;
  border-radius: 4px;
  padding: 14px 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.recruit-card:hover {
  border-color: #facc15;
  background: #1e293b;
  transform: translateY(-2px);
}

.rc-name {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: bold;
  color: #fef08a;
  margin-bottom: 4px;
}

.rc-role {
  font-size: 10px;
  color: #93c5fd;
  margin-bottom: 8px;
}

.rc-desc {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.35;
}

/* ==================== DEPLOYMENT STEP 2 (UNIT COMPOSITION & WALL-FIT SHAPE) ==================== */
.deploy-step-tabs {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 5px;
  margin-bottom: 8px;
}

.deploy-step-tab {
  background: #0f172a;
  border: 1.5px solid #334155;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 800;
  padding: 6px 6px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.4px;
  transition: all 0.15s;
}

.deploy-step-tab:hover {
  border-color: #60a5fa;
  color: #e2e8f0;
}

.deploy-step-tab.active {
  background: linear-gradient(180deg, #1d4ed8 0%, #1e3a8a 100%);
  border-color: #facc15;
  color: #fef08a;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.35);
}

.composition-drag-callout {
  background: rgba(20, 83, 45, 0.45);
  border: 1.5px solid #4ade80;
  border-radius: 4px;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.38;
  color: #dcfce7;
}

.composition-drag-callout strong {
  color: #fef08a;
}

.shape-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 4px;
}

.shape-preset-btn {
  background: #172554;
  border: 1.5px solid #3b82f6;
  color: #e0f2fe;
  font-size: 10.5px;
  font-weight: 700;
  padding: 6px 7px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s;
}

.shape-preset-btn:hover {
  background: #1d4ed8;
  border-color: #facc15;
  color: #fef08a;
}

.shape-rot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 5px;
}

.shape-rot-btn {
  background: #1e293b;
  border: 1px solid #64748b;
  color: #fde047;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.shape-rot-btn:hover {
  background: #334155;
  border-color: #facc15;
}

/* ==================== 30s INACTIVITY TIMER & NO-MOVES END-PHASE PROMPT ==================== */
.inactivity-timer-badge {
  background: #1e293b;
  border: 1.5px solid #38bdf8;
  color: #bae6fd;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.inactivity-timer-badge.warning {
  background: #7c2d12;
  border-color: #facc15;
  color: #fef08a;
  animation: pulseReadyGlow 1.1s infinite alternate;
}

.no-moves-prompt-banner {
  position: absolute;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 42;
  background: linear-gradient(90deg, rgba(20, 83, 45, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
  border: 2.5px solid #facc15;
  border-radius: 6px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 0 28px rgba(250, 204, 21, 0.55);
  max-width: 92%;
}

.nmp-title {
  font-size: 13px;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.6px;
}

.nmp-sub {
  font-size: 11px;
  color: #dcfce7;
  margin-top: 2px;
}

.nmp-advance-btn {
  background: linear-gradient(180deg, #eab308 0%, #ca8a04 100%);
  border: 2px solid #fef08a;
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.6);
}

.nmp-advance-btn:hover {
  background: #facc15;
  transform: scale(1.03);
}

.inactivity-advisor-card {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 48;
  width: 540px;
  max-width: 92%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.99) 100%);
  border: 2.5px solid #facc15;
  border-radius: 6px;
  padding: 12px 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 26px rgba(234, 179, 8, 0.45);
}

.iac-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  font-weight: 800;
  color: #facc15;
  border-bottom: 1px solid #334155;
  padding-bottom: 6px;
  margin-bottom: 8px;
}

.iac-close-btn {
  background: transparent;
  border: 1px solid #64748b;
  color: #cbd5e1;
  border-radius: 3px;
  padding: 1px 6px;
  cursor: pointer;
}

.iac-hint-body {
  font-size: 12.5px;
  line-height: 1.48;
  color: #e2e8f0;
  background: rgba(30, 58, 138, 0.32);
  border-left: 3px solid #60a5fa;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.iac-hint-body strong {
  color: #fef08a;
}

.iac-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ready-to-advance {
  border-color: #fde047 !important;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.75) !important;
  animation: pulseReadyGlow 1s infinite alternate;
}

@keyframes pulseReadyGlow {
  0% { box-shadow: 0 0 8px rgba(250, 204, 21, 0.4); }
  100% { box-shadow: 0 0 22px rgba(250, 204, 21, 0.9); }
}

.hidden {
  display: none !important;
}
