.toolbar-text-btn{
  width:50px;
  height:50px;
  border:1px solid rgba(255,255,255,0.25);
  border-radius:8px;
  background:rgba(0,0,0,0.45);
  color:#fff;
  font-weight:700;
  letter-spacing:0.5px;
  cursor:pointer;
}

#toolbar-panel {
  position: fixed !important;
  left: 50vw !important;
  top: 0 !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  --toolbar-alpha: 0.72;
  --toolbar-button-alpha: 0.82;
  --toolbar-hud-alpha: 0.84;
  --toolbar-pattern-layer: none;
  --toolbar-header-pattern-layer: none;
  --toolbar-pattern-alpha: 0;
  --toolbar-header-pattern-alpha: 0;
  --toolbar-shell-rgb: 94,203,200;
  --toolbar-header-rgb: 67,143,255;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: fit-content;
  max-width: calc(100vw - 16px);
  height: auto;
  box-sizing: border-box;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.018) 9%, rgba(255,255,255,0.00) 16%),
    linear-gradient(180deg, rgba(var(--toolbar-shell-rgb), calc(var(--toolbar-alpha) * 0.98)) 0%, rgba(var(--toolbar-shell-rgb), calc(var(--toolbar-alpha) * 0.98)) 100%),
    var(--toolbar-pattern-layer),
    url("../assets/ui/toolbar_bg.png") repeat left top;
  background-size: auto, auto, 256px 256px, cover;
  border: 2px solid #415a77;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  z-index: 3000;
}

#toolbar-panel > .panel-header {
  display: none !important;
}

#toolbar-panel > .panel-body,
#toolbar-panel > .panel-body.toolbar-panel-body {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  padding: 5px;
  box-sizing: border-box;
  overflow: visible;
  background: none;
}

#toolbar-panel .toolbar-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  background: transparent;
  border-radius: 8px;
  padding: 0;
}

#toolbar-buttons {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  padding: 0;
}

/* Toolbar is icons-only; remove the embedded rings/time row from this strip. */
#toolbar-panel #toolbar-ringhud {
  display: none !important;
}

#toolbar-panel button {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 6px;
  background: rgb(27 38 59 / var(--toolbar-button-alpha));
  padding: 0;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#toolbar-panel button img,
#toolbar-panel .cursor-btn img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

#toolbar-panel button.active {
  outline: 2px solid #ffd60a;
  background: #415a77;
}

#toolbar-buttons > button {
  position: relative;
}

#toolbar-buttons > button[data-action="cursor-select"]::after,
#toolbar-buttons > button[data-action="cursor-pet"]::after,
#toolbar-buttons > button[data-action="cursor-pick"]::after,
#toolbar-buttons > button[data-action="cursor-decorate"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.52;
  pointer-events: none;
  z-index: 2;
}

#toolbar-buttons > button[data-action="cursor-select"]::after {
  background-image: url("../assets/font/let_1.png");
}

#toolbar-buttons > button[data-action="cursor-pet"]::after {
  background-image: url("../assets/font/let_2.png");
}

#toolbar-buttons > button[data-action="cursor-pick"]::after {
  background-image: url("../assets/font/let_3.png");
}

#toolbar-buttons > button[data-action="cursor-decorate"]::after {
  background-image: url("../assets/font/let_4.png");
}

/* ==== Cursor visibility hotfix ==== */
#cursor,
#cursor-wheel {
  display: block;
  visibility: visible !important;
  opacity: 1 !important;
}

/* ============================================================
   Migrated from 03-panel-contract.css — ringhud/cursor/selection overlays carve-out
   ============================================================ */

/* duplicate legacy toolbar shell trimmed; authoritative toolbar shell lives in the final display-conversion block near the end of style.css */

/* ============================
   Ring HUD
   ============================ */

#toolbar-ringhud img {
  width: 18px;
  height: 18px;
  margin-right: 4px;
  image-rendering: pixelated;
}

#ringhud-count {
  font-family: monospace;
  font-size: 15px;
  color: #ffd60a;
  text-shadow: 0 0 3px #ffd60a;
  letter-spacing: 0.5px;
  line-height: 1;
  text-align: center;
}

.hud-divider {
  margin: 0 8px;
  color: #ffd60a;
  font-family: monospace;
  font-size: 14px;
  line-height: 1;
}

#specialringhud-icon {
  width: 18px;
  height: 18px;
  margin-right: 4px;
  image-rendering: pixelated;
}

#specialringhud-count {
  font-family: monospace;
  font-size: 15px;
  color: #e0e0ff;
  text-shadow: 0 0 3px #000;
  letter-spacing: 0.5px;
  line-height: 1;
  text-align: center;
  margin-right: 4px;
}
#hud-clock {
  font-size: 18px;
  color: #ffd700;
  margin-left: 12px;
  text-shadow: 1px 1px 2px #000;
  font-family: monospace;
}

/* ============================
   Cursor + Wheel
   ============================ */
#cursor {
  position: fixed;
  width: 48px;        /* unified size */
  height: 48px;       /* unified size */
  pointer-events: none;
   /* default only; JS overrides per-mode */
  image-rendering: pixelated;
  transform: translate(-50%, -90%);  /* center on pointer */
  z-index: 10050;
}

#cursor-wheel {
  display: none;
  position: fixed;
  width: 200px;       /* doubled from 100 */
  height: 200px;      /* doubled from 100 */
  background: url("../assets/icons/wheel1.png") no-repeat center center;
  background-size: contain;
  pointer-events: none;
  z-index: 10000;
}

#cursor-wheel .quadrant {
  position: absolute;
  width: 50%;
  height: 50%;
  pointer-events: auto;
}
#cursor-wheel .quadrant:nth-child(1) { left: 0; top: 0; }
#cursor-wheel .quadrant:nth-child(2) { left: 50%; top: 0; }
#cursor-wheel .quadrant:nth-child(3) { left: 0; top: 50%; }
#cursor-wheel .quadrant:nth-child(4) { left: 50%; top: 50%; }
#cursor-wheel .quadrant:hover { background: rgba(255, 214, 10, 0.2); }

/* ============================
   Entity Highlight + Selector (Hover/Focus)
   ============================ */

/* --- unified highlight visuals --- */
.entity-hover {
  outline: 2px solid #ffd60a;
  outline-offset: -2px;
  box-shadow: 0 0 8px rgba(255,214,10,0.6);
}

.entity-focus {
  outline: 2px solid #00ff88;
  outline-offset: -2px;
  box-shadow: 0 0 10px rgba(0,255,136,0.55);
}

/* overlay boxes that follow entities (singletons) */
#focus-outline,
#hover-outline {
  position: absolute;
  pointer-events: none;
  border-radius: 6px;
  image-rendering: pixelated;
  z-index: 2147483000; /* below cursor, above panels */
  display: none;
}

#hover-outline {
  border: 2px solid #ffd60a;
  box-shadow: 0 0 8px rgba(255,214,10,0.6);
}

#focus-outline {
  border: 2px solid #00ff88;
  box-shadow: 0 0 10px rgba(0,255,136,0.55);
}

/* selector sprite that floats above the focused entity */
#ui-selector {
  position: absolute;
  width: 24px;
  height: 24px;
  pointer-events: none;
  image-rendering: pixelated;
  z-index: 2147483001;
  display: none;
  transform: translate(-50%, -100%); /* center X, place above */
}

/* extracted from styles/03-panel-contract.css — pass28 */
/* ============================
   Toolbar: Mobile Controls toggle button
   ============================ */

.toolbar-text-btn:active{ transform: translateY(1px); }

/* ============================
   Mobile Controls HUD
   ============================ */
#mobile-controls-hud{
  position:absolute;
  left:0;
  bottom:0;
  width:var(--app-authored-width);
  max-width:var(--app-authored-width);
  box-sizing:border-box;
  padding:14px;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px;
  z-index:99999;
  pointer-events:none; /* enable only on buttons */
}

#mobile-controls-hud .mch-left,
#mobile-controls-hud .mch-right{
  display:flex;
  flex-direction:column;
  gap:10px;
  pointer-events:none;
}

#mobile-controls-hud .mch-mid{
  display:flex;
  gap:10px;
  align-items:flex-end;
  pointer-events:none;
}

#mobile-controls-hud .mch-mods{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  pointer-events:none;
}

#mobile-controls-hud .mch-btn{
  pointer-events:auto;
  user-select:none;
  -webkit-user-select:none;
  -webkit-touch-callout:none;
  touch-action:none;
  min-width:68px;
  min-height:58px;
  padding:8px 10px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.25);
  background:rgba(0,0,0,0.55);
  color:#fff;
  font-weight:700;
}

/* Toolbar boot/default placement: literal viewport top-center. JS portals it to <body> and owns drag persistence. */
#toolbar-panel,
#toolbar-panel.toolbar-screen-overlay {
  position: fixed !important;
  left: 50vw !important;
  top: 0 !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  visibility: visible !important;
}

#toolbar-panel.toolbar-hidden {
  display: none !important;
}
