/* Canonical base UI theme styles for the single-version theme system.
   Intentionally minimal; themed packages are expected to override appearance and layout. */

:root {
  --bb-font-ui: 'Segoe UI', Tahoma, sans-serif;
  --bb-font-ui-display: 'Segoe UI Semibold', 'Segoe UI', Tahoma, sans-serif;
  --bb-font-ui-mono: ui-monospace, Consolas, monospace;
  --bb-surface-panel: rgb(47, 79, 79);
  --bb-surface-panel-2: rgb(60, 90, 90);
  --bb-surface-panel-3: rgb(70, 70, 70);
  --bb-border-subtle: rgb(70, 70, 70);
  --bb-border-strong: rgb(100, 100, 100);
  --bb-text-primary: #f4f4f4;
  --bb-text-secondary: #d0d0d0;
  --bb-text-muted: #99a0ae;
  --bb-accent: #f2b233;
  --bb-danger: #e0604f;
  --bb-shadow-panel: 0 4px 12px rgba(0, 0, 0, 0.4);
  --bb-radius-sm: 5px;
  --bb-radius-md: 8px;
  --bb-radius-lg: 12px;
  --bb-select-color-scheme: dark;
  --bb-select-bg: rgba(255, 255, 255, 0.06);
  --bb-select-border: rgba(255, 255, 255, 0.12);
  --bb-select-text: #f4f4f4;
  --bb-select-focus-ring: rgba(242, 178, 51, 0.18);
  --bb-select-popup-bg: #13161c;
  --bb-select-popup-text: #f1f2f4;
  --bb-pocket-notification-gap: 40;
  --bb-pocket-notification-offset-x: 0;
  --bb-pocket-notification-offset-y: 0;
  --bb-pocket-notification-distance: 2;
  --bb-pocket-notification-scale: 1.2;
  --bb-pocket-notification-left-gap: 40;
  --bb-pocket-notification-right-gap: 40;
  --bb-pocket-notification-left-offset-x: 0;
  --bb-pocket-notification-right-offset-x: 0;
  --bb-pocket-notification-left-offset-y: 0;
  --bb-pocket-notification-right-offset-y: 0;
  --bb-pocket-notification-left-distance: 2;
  --bb-pocket-notification-right-distance: 2;
  --bb-pocket-notification-left-scale: 1.2;
  --bb-pocket-notification-right-scale: 1.2;
}

body .bb-hidden {
  display: none;
}

/* Select controls used by menu/settings panels */
.menuSelect,
.menuPanel select,
.npcPanel select {
  background: var(--bb-select-bg);
  border: 1px solid var(--bb-select-border);
  border-radius: 8px;
  color: var(--bb-select-text);
  padding: 8px 10px;
  min-height: 36px;
  color-scheme: var(--bb-select-color-scheme);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.menuSelect:focus,
.menuPanel select:focus,
.npcPanel select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--bb-select-border) 35%, var(--bb-accent) 65%);
  box-shadow:
    0 0 0 2px var(--bb-select-focus-ring),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.menuSelect option,
.menuPanel select option,
.npcPanel select option,
.menuSelect optgroup,
.menuPanel select optgroup,
.npcPanel select optgroup {
  background-color: var(--bb-select-popup-bg);
  color: var(--bb-select-popup-text);
}

.cueAimSettings__intro {
  padding: 10px 12px 6px;
  color: var(--bb-text-secondary);
  font-size: 13px;
}

.cueAimSettings__game {
  color: var(--bb-text-primary);
}

.cueAimSettings__info {
  padding: 4px 12px 8px;
  color: var(--bb-text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.cueAimSettings__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 10px;
  padding: 8px 12px;
}

.cueAimSettings__label {
  color: var(--bb-text-primary);
  font-size: 13px;
}

.cueAimSettings__value {
  color: var(--bb-text-muted);
  font-family: var(--bb-font-ui-mono);
  font-size: 11px;
  text-align: right;
}

.cueAimSettings__slider {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--bb-accent);
}

.cueAimSettings__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px 4px;
}

.cueAimSettings__status {
  min-height: 18px;
  padding: 6px 12px 2px;
  color: var(--bb-text-muted);
  font-size: 11px;
  line-height: 1.35;
}

.cueAimSettings__status.is-error {
  color: var(--bb-danger);
}

/* Base overlay / prompt surfaces (theme-overridable) */
.game-end-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bb-overlay-backdrop, rgba(0, 0, 0, 0.45));
  backdrop-filter: blur(2px);
}

.game-end-panel {
  width: min(520px, calc(100vw - 32px));
  background: var(--bb-game-end-panel-bg, linear-gradient(rgb(47, 79, 79), rgb(25, 47, 47)));
  border: 2px solid var(--bb-game-end-panel-border, rgba(255, 255, 255, 0.28));
  border-radius: 10px;
  box-shadow: var(--bb-game-end-panel-shadow, 0 10px 24px rgba(0, 0, 0, 0.5));
  padding: 16px;
}

.game-end-title {
  margin-bottom: 12px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--bb-game-end-title-text, var(--bb-text-primary, #f4f4f4));
  text-align: center;
}

.game-end-subtitle {
  margin-bottom: 12px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  color: var(--bb-game-end-subtitle-text, var(--bb-text-secondary, #d7e6e6));
  text-align: center;
}

.game-end-actions {
  display: flex;
  gap: 10px;
}

.game-end-button {
  flex: 1;
  min-height: 42px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.game-end-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--bb-game-end-button-hover-shadow, 0 5px 10px rgba(0, 0, 0, 0.35));
}

.game-end-button:active {
  transform: translateY(0);
}

.game-end-button--rematch {
  background: var(--bb-game-end-primary-bg, linear-gradient(#4caf50, #3e9641));
  color: var(--bb-game-end-primary-text, #ffffff);
  border-color: var(--bb-game-end-primary-border, #2e7d32);
}

.game-end-button--idle-wait {
  background: var(--bb-game-end-primary-bg, linear-gradient(#4caf50, #3e9641));
  color: var(--bb-game-end-primary-text, #ffffff);
  border-color: var(--bb-game-end-primary-border, #2e7d32);
}

.game-end-button--lobby {
  background: var(--bb-game-end-secondary-bg, linear-gradient(#f1c40f, #d8a90e));
  color: var(--bb-game-end-secondary-text, #141414);
  border-color: var(--bb-game-end-secondary-border, #b48707);
}

.game-end-button--main-menu {
  background: var(--bb-game-end-tertiary-bg, linear-gradient(#2f6cb8, #245391));
  color: var(--bb-game-end-tertiary-text, #ffffff);
  border-color: var(--bb-game-end-tertiary-border, #173d70);
}

@media (max-width: 560px) {
  .game-end-panel {
    padding: 12px;
    border-radius: 8px;
  }

  .game-end-title {
    font-size: 15px;
    line-height: 1.3;
  }

  .game-end-actions {
    flex-direction: column;
  }

  .game-end-button {
    width: 100%;
  }
}

.scoreButton--solid {
  color: var(--bb-score-solid-text, #ffffff);
  background: var(
    --bb-score-solid-bg,
    radial-gradient(circle at 30% 30%, #d32f2f, #b71c1c)
  ) !important;
  text-shadow: var(--bb-score-solid-text-shadow, 1px 1px 2px #000);
  border: 1px solid var(--bb-score-solid-border, #000);
}

.scoreButton--stripe {
  color: var(--bb-score-stripe-text, #000);
  background: var(
    --bb-score-stripe-bg,
    linear-gradient(180deg, #fff 25%, #2e7d32 25%, #2e7d32 75%, #fff 75%)
  ) !important;
  text-shadow: var(--bb-score-stripe-text-shadow, 1px 1px 2px #fff);
  border: 1px solid var(--bb-score-stripe-border, #000);
}

/* Themeable overlay/prompt surfaces (non-3D UI) */
:root {
  --bb-overlay-backdrop: rgba(0, 0, 0, 0.78);
  --bb-surface-panel: #1e1e24;
  --bb-surface-panel-2: #151518;
  --bb-surface-panel-3: #26262b;
  --bb-border-subtle: rgba(255, 255, 255, 0.12);
  --bb-border-strong: rgba(255, 255, 255, 0.22);
  --bb-text-primary: #f5f7f8;
  --bb-text-secondary: #b7bcc4;
  --bb-text-muted: #888;
  --bb-accent: #00f0ff;
  --bb-danger: #ff5555;
  --bb-radius-lg: 12px;
  --bb-radius-md: 8px;
  --bb-radius-sm: 6px;
  --bb-shadow-overlay: 0 12px 32px rgba(0, 0, 0, 0.55);
  --bb-score-button-font-family: 'Segoe UI', Tahoma, sans-serif;
  --bb-score-button-font-size: 14px;
  --bb-score-button-line-height: 1.2;
  --bb-timeout-fallback-blur-filter: blur(2px);
  --bb-timeout-fallback-blur-transition: filter 180ms ease;
  --bb-select-color-scheme: dark;
  --bb-select-bg: rgba(255, 255, 255, 0.06);
  --bb-select-border: rgba(255, 255, 255, 0.16);
  --bb-select-text: #ffffff;
  --bb-select-focus-ring: rgba(125, 211, 252, 0.22);
  --bb-select-popup-bg: #18202b;
  --bb-select-popup-text: #edf4ff;
  --bb-corner-btn-bg: rgb(47, 79, 79);
  --bb-corner-btn-bg-hover: rgb(70, 110, 110);
  --bb-corner-btn-border: rgba(255, 255, 255, 0.3);
  --bb-corner-btn-border-hover: rgba(255, 255, 255, 0.5);
  --bb-corner-btn-text: #f4f4f4;
  --bb-corner-btn-active-bg: rgba(74, 144, 226, 0.14);
  --bb-corner-btn-active-border: rgba(74, 144, 226, 0.9);
  --bb-corner-btn-active-glow: rgba(74, 144, 226, 0.5);
  --bb-fov-degree-color: currentColor;
  --bb-score-btn-default-bg: linear-gradient(#888686, #b0b0b3);
  --bb-score-btn-default-text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  --bb-score-btn-white-text: #ffffff;
  --bb-score-btn-yellow-text: #f7d23e;
  --bb-spin-cueball-white-color: #d9d9d9;
  --bb-spin-cueball-grey-color: #909090;
  --bb-spin-white-grey-blend-multiplier: 1.2;
  --bb-spin-shot-dot-color: #00405e;
  --bb-spin-shot-dot-size-ratio: 0.021;
  --bb-score-solid-bg: radial-gradient(circle at 30% 30%, #d32f2f, #b71c1c);
  --bb-score-solid-text: #ffffff;
  --bb-score-solid-text-shadow: 1px 1px 2px #000;
  --bb-score-solid-border: #000000;
  --bb-score-stripe-bg: linear-gradient(180deg, #ffffff 25%, #2e7d32 25%, #2e7d32 75%, #ffffff 75%);
  --bb-score-stripe-text: #000000;
  --bb-score-stripe-text-shadow: 1px 1px 2px #ffffff;
  --bb-score-stripe-border: #000000;
  --bb-score-player-name-font-family: var(--bb-font-ui, 'Segoe UI', Tahoma, sans-serif);
  --bb-score-player-name-font-size: clamp(11px, 1.1vw, 15px);
  --bb-score-player-name-font-weight: 700;
  --bb-score-player-name-color: var(--bb-text-primary, #ffffff);
  --bb-score-player-name-text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 1px rgba(0, 0, 0, 0.6);
  --bb-score-player-name-max-width: clamp(70px, 13vw, 160px);
  --bb-score-player-name-gap: 8px;
  --bb-score-player-name-active-color: var(--bb-score-active-border, rgba(0, 174, 255, 1));
  --bb-score-player-name-active-text-shadow:
    0 0 8px var(--bb-score-active-shadow, 0 0 8px rgba(0, 174, 255, 0.5)),
    0 1px 3px rgba(0, 0, 0, 0.85);
  --bb-hud-cue-tip: rgb(72, 72, 158);
  --bb-hud-power-accent: rgb(255, 0, 0);
  --bb-power-shot-cooldown-track-width: 10px;
  --bb-power-shot-cooldown-thumb-size: 22px;
  --bb-power-shot-cooldown-radius: 6px;
  --bb-power-shot-cooldown-fill: var(--bb-hud-power-accent, rgb(255, 0, 0));
  --bb-power-shot-cooldown-fill-start: var(--bb-power-shot-cooldown-fill);
  --bb-power-shot-cooldown-fill-end: var(--bb-power-shot-cooldown-fill);
  --bb-power-shot-cooldown-empty: rgba(255, 255, 255, 0.18);
  --bb-power-shot-cooldown-empty-end: var(--bb-power-shot-cooldown-empty);
  --bb-power-shot-cooldown-empty-border: rgba(255, 255, 255, 0.28);
  --bb-power-shot-cooldown-track-shadow:
    inset 0 0 0 1px var(--bb-power-shot-cooldown-empty-border, rgba(255, 255, 255, 0.28)),
    inset 0 2px 6px rgba(0, 0, 0, 0.35);
  --bb-power-shot-cooldown-thumb-bg: radial-gradient(
    circle at 38% 32%,
    #555 0%,
    #111 60%,
    #000 100%
  );
  --bb-power-shot-cooldown-thumb-border: rgba(255, 255, 255, 0.22);
  --bb-power-shot-cooldown-thumb-shadow:
    0 2px 6px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.4);
  --bb-hud-hit-bg: rgb(255, 0, 0);
  --bb-hud-hit-border: rgb(200, 0, 0);
  --bb-hud-hit-text: #ffffff;
  --bb-hamburger-line: #f4f4f4;
  --bb-toggle-active-bg: #4a90e2;
  --bb-toggle-active-border: #357abd;
  --bb-toggle-active-text: #ffffff;
  --bb-toggle-active-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  --bb-toggle-active-bg-strong: #2566a8;
  --bb-toggle-active-border-strong: #1a4d85;
  --bb-toggle-active-shadow-strong: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  --bb-target-placeholder-border: rgba(255, 255, 255, 0.08);
  --bb-target-placeholder-active-border: rgba(74, 144, 226, 0.7);
  --bb-target-placeholder-active-bg: rgba(74, 144, 226, 0.08);
  --bb-chat-bg: rgba(0, 0, 0, 0.1);
  --bb-chat-history-bg: rgba(0, 0, 0, 0.12);
  --bb-chat-scrollbar-color: rgba(255, 255, 255, 0.6);
  --bb-chat-scrollbar-thumb: rgba(255, 255, 255, 0.5);
  --bb-pushout-bg: linear-gradient(#4caf50, #45a049);
  --bb-pushout-bg-hover: linear-gradient(#45a049, #4caf50);
  --bb-pushout-border: #2e7d32;
  --bb-pushout-text: #ffffff;
  --bb-pushout-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  --bb-position-text-bg: linear-gradient(#2c3e50, #34495e);
  --bb-position-text-border: #3498db;
  --bb-position-text-text: #ffffff;
  --bb-position-text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
  --bb-position-play-bg: linear-gradient(#4caf50, #45a049);
  --bb-position-play-bg-hover: linear-gradient(#45a049, #4caf50);
  --bb-position-play-border: #2e7d32;
  --bb-position-pass-bg: linear-gradient(#e74c3c, #c0392b);
  --bb-position-pass-bg-hover: linear-gradient(#c0392b, #e74c3c);
  --bb-position-pass-border: #a93226;
  --bb-position-button-text: #ffffff;
  --bb-position-button-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  --bb-score-highlight-bg: rgb(47, 79, 79);
  --bb-score-highlight-border: #0b0b0e;
  --bb-score-highlight-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  --bb-score-pill-bg: linear-gradient(#888686, #b0b0b3);
  --bb-score-pill-border: #ffffff;
  --bb-score-pill-text: #000000;
  --bb-score-active-border: rgba(0, 174, 255, 1);
  --bb-score-active-shadow: 0 0 8px rgba(0, 174, 255, 0.5);
  --bb-fastforward-active-bg: #3498db;
  --bb-fastforward-active-border: #2980b9;
  --bb-fastforward-opponent-border: #f1c40f;
  --bb-fastforward-opponent-shadow: 0 0 8px rgba(241, 196, 15, 0.7);
  --bb-fastforward-auto-border: #aaaaaa;
  --bb-fastforward-auto-shadow: 0 0 8px rgba(170, 170, 170, 0.7);
  --bb-fastforward-speed-text: #000000;
  --bb-hit-disabled-bg: #555555;
  --bb-hit-disabled-border: #444444;
  --bb-hit-disabled-text: #aaaaaa;
  --bb-rack-won-bg: linear-gradient(#f1c40f, #f39c12);
  --bb-rack-won-bg-hover: linear-gradient(#f39c12, #f1c40f);
  --bb-rack-won-border: #d35400;
  --bb-rack-won-text: #000000;
  --bb-rack-won-hover-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  --bb-shotclock-bg: linear-gradient(#e74c3c, #c0392b);
  --bb-shotclock-border: #922b21;
  --bb-game-end-panel-bg: linear-gradient(rgb(47, 79, 79), rgb(25, 47, 47));
  --bb-game-end-panel-border: rgba(255, 255, 255, 0.28);
  --bb-game-end-panel-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
  --bb-game-end-title-text: var(--bb-text-primary, #f4f4f4);
  --bb-game-end-subtitle-text: var(--bb-text-secondary, #d7e6e6);
  --bb-game-end-primary-bg: linear-gradient(#4caf50, #3e9641);
  --bb-game-end-primary-border: #2e7d32;
  --bb-game-end-primary-text: #ffffff;
  --bb-game-end-secondary-bg: linear-gradient(#f1c40f, #d8a90e);
  --bb-game-end-secondary-border: #b48707;
  --bb-game-end-secondary-text: #141414;
  --bb-game-end-tertiary-bg: linear-gradient(#2f6cb8, #245391);
  --bb-game-end-tertiary-border: #173d70;
  --bb-game-end-tertiary-text: #ffffff;
  --bb-game-end-button-hover-shadow: 0 5px 10px rgba(0, 0, 0, 0.35);
  --bb-link-color: lightblue;
  --bb-constants-panel-bg: linear-gradient(#495155, #0b0b0e);
  --bb-constants-panel-text: #ffffff;
  --bb-constants-panel-border: #2c2c2c;
  --bb-constants-section-border: #2c2c2c;
  --bb-constants-accent: #4caf50;
  --bb-constants-accent-alt: #2196f3;
  --bb-constants-label-text: #cccccc;
  --bb-center-notice-bg: linear-gradient(#2470c4, #165089);
  --bb-center-notice-border: #0e3f70;
  --bb-center-notice-text: var(--bb-text-primary, #f4f4f4);
  --bb-pushout-text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  --bb-pushout-press-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  --bb-position-button-text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  --bb-position-button-press-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  --bb-shotclock-bg-hover: linear-gradient(#e74c3c, #c0392b);
}

/* Base HUD / panel / chat / score / precision UI surfaces */
.panel.is-disabled .outerMenu {
  pointer-events: auto;
  opacity: 1;
}

.ballContainer {
  height: 70%;
  margin: auto;
  margin-left: 10px;
  margin-right: 10px;
  position: relative;
  overflow: visible;
  border-radius: 5px;
  aspect-ratio: 1;
  padding: 0 5px;
  z-index: 1;
}

.cueBall {
  height: 100%;
  margin: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  position: absolute;
  top: 0;
  z-index: 5;
  overflow: hidden;
}

#cueBallCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
}

.cueTip {
  height: 20%;
  width: 20%;
  background-color: var(--bb-hud-cue-tip, rgb(72, 72, 158));
  border-radius: 50%;
  top: 40%;
  left: 40%;
  z-index: 10;
  position: relative;
  pointer-events: none;
}

.elevationSlider {
  width: 20px;
  height: 70%;
  margin: auto;
  margin-right: 5px;
  margin-left: 5px;
  position: relative;
  z-index: 10;
}

input[type='range'].elevationSlider {
  writing-mode: vertical-lr;
  direction: rtl;
}

.powerSlider {
  width: 20px;
  height: 70%;
  margin: auto;
  margin-right: 10px;
  position: relative;
  z-index: 10;
  accent-color: var(--bb-hud-power-accent, rgb(255, 0, 0));
}

input[type='range'].powerSlider {
  writing-mode: vertical-lr;
  direction: rtl;
}

.powerSlider.power-shot-cooldown-slider,
.precisionPowerSlider.power-shot-cooldown-slider,
[data-bb-role='app-shell']
  [data-bb-slot='precision-panel']
  .precisionPowerSlider.power-shot-cooldown-slider {
  appearance: none !important;
  width: var(--bb-power-shot-cooldown-track-width, 10px) !important;
  padding: 0 !important;
  background: linear-gradient(
    to top,
    var(
        --bb-power-shot-cooldown-fill-start,
        var(--bb-power-shot-cooldown-fill, var(--bb-hud-power-accent, rgb(255, 0, 0)))
      )
      0%,
    var(
        --bb-power-shot-cooldown-fill-end,
        var(--bb-power-shot-cooldown-fill, var(--bb-hud-power-accent, rgb(255, 0, 0)))
      )
      var(--bb-power-shot-cooldown-available, 100%),
    var(--bb-power-shot-cooldown-empty, rgba(255, 255, 255, 0.18))
      var(--bb-power-shot-cooldown-available, 100%),
    var(
        --bb-power-shot-cooldown-empty-end,
        var(--bb-power-shot-cooldown-empty, rgba(255, 255, 255, 0.18))
      )
      100%
  ) !important;
  border: none !important;
  border-radius: var(--bb-power-shot-cooldown-radius, 6px) !important;
  box-shadow: var(--bb-power-shot-cooldown-track-shadow) !important;
  cursor: pointer !important;
}

.powerSlider.power-shot-cooldown-slider::-webkit-slider-runnable-track,
.precisionPowerSlider.power-shot-cooldown-slider::-webkit-slider-runnable-track,
[data-bb-role='app-shell']
  [data-bb-slot='precision-panel']
  .precisionPowerSlider.power-shot-cooldown-slider::-webkit-slider-runnable-track {
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.powerSlider.power-shot-cooldown-slider::-webkit-slider-thumb,
.precisionPowerSlider.power-shot-cooldown-slider::-webkit-slider-thumb,
[data-bb-role='app-shell']
  [data-bb-slot='precision-panel']
  .precisionPowerSlider.power-shot-cooldown-slider::-webkit-slider-thumb {
  appearance: none !important;
  width: var(--bb-power-shot-cooldown-thumb-size, 22px) !important;
  height: var(--bb-power-shot-cooldown-thumb-size, 22px) !important;
  border-radius: 50% !important;
  background: var(
    --bb-power-shot-cooldown-thumb-bg,
    radial-gradient(circle at 38% 32%, #555 0%, #111 60%, #000 100%)
  ) !important;
  border: 1.5px solid var(--bb-power-shot-cooldown-thumb-border, rgba(255, 255, 255, 0.22)) !important;
  box-shadow: var(--bb-power-shot-cooldown-thumb-shadow, 0 2px 6px rgba(0, 0, 0, 0.55)) !important;
  margin-left: calc(
    (
        var(--bb-power-shot-cooldown-track-width, 10px) -
          var(--bb-power-shot-cooldown-thumb-size, 22px)
      ) /
      2
  ) !important;
}

.powerSlider.power-shot-cooldown-slider::-moz-range-track,
.precisionPowerSlider.power-shot-cooldown-slider::-moz-range-track,
[data-bb-role='app-shell']
  [data-bb-slot='precision-panel']
  .precisionPowerSlider.power-shot-cooldown-slider::-moz-range-track {
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.powerSlider.power-shot-cooldown-slider::-moz-range-progress,
.precisionPowerSlider.power-shot-cooldown-slider::-moz-range-progress,
[data-bb-role='app-shell']
  [data-bb-slot='precision-panel']
  .precisionPowerSlider.power-shot-cooldown-slider::-moz-range-progress {
  background: transparent !important;
}

.powerSlider.power-shot-cooldown-slider::-moz-range-thumb,
.precisionPowerSlider.power-shot-cooldown-slider::-moz-range-thumb,
[data-bb-role='app-shell']
  [data-bb-slot='precision-panel']
  .precisionPowerSlider.power-shot-cooldown-slider::-moz-range-thumb {
  width: var(--bb-power-shot-cooldown-thumb-size, 22px) !important;
  height: var(--bb-power-shot-cooldown-thumb-size, 22px) !important;
  border-radius: 50% !important;
  background: var(
    --bb-power-shot-cooldown-thumb-bg,
    radial-gradient(circle at 38% 32%, #555 0%, #111 60%, #000 100%)
  ) !important;
  border: 1.5px solid var(--bb-power-shot-cooldown-thumb-border, rgba(255, 255, 255, 0.22)) !important;
  box-shadow: var(--bb-power-shot-cooldown-thumb-shadow, 0 2px 6px rgba(0, 0, 0, 0.55)) !important;
}

.powerSlider.power-shot-cooldown-slider:disabled,
.precisionPowerSlider.power-shot-cooldown-slider:disabled,
[data-bb-role='app-shell']
  [data-bb-slot='precision-panel']
  .precisionPowerSlider.power-shot-cooldown-slider:disabled {
  cursor: default !important;
  opacity: 0.6;
}

.shotButton,
.menuButton.mainMenuButton,
.menuPanel {
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

.menuPanel__identity {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 7px 12px 7px 20px;
  overflow: hidden;
  color: var(--bb-text-muted, rgba(220, 230, 240, 0.68));
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menuPanel__action--danger {
  color: var(--bb-danger-text, #ffbcbc) !important;
}

.shotButton {
  min-height: 45px;
  width: 100%;
  margin: 0;
  border-radius: 10px;
  border-width: 4px;
  font-size: large;
  font-weight: 600;
  min-width: 80px;
  max-width: 120px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  position: relative;
  z-index: 10;
  background-color: var(--bb-hud-hit-bg, rgb(255, 0, 0));
  border-color: var(--bb-hud-hit-border, rgb(200, 0, 0));
  color: var(--bb-hud-hit-text, #ffffff);
}

.cueControls {
  display: flex;
  align-items: stretch;
  justify-items: start;
  height: 70%;
  width: 80px;
  margin-left: 5px;
  margin-right: 0;
  max-width: 80px;
  flex: 0 0 auto;
}

.cueControls .shotButton {
  justify-self: start;
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  flex: 1;
}

.menuToggleContainer {
  position: relative;
  width: 80px;
  max-width: 80px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
}

/* Hamburger Menu Button */
.hamburgerMenuButton {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 32px;
  height: 32px;
  padding: 0;
  background-color: var(--bb-corner-btn-bg, rgb(47, 79, 79));
  border: 2px solid var(--bb-corner-btn-border, rgba(255, 255, 255, 0.3));
  border-radius: 5px;
  cursor: pointer;
  z-index: 150;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.hamburgerMenuButton:hover {
  background-color: var(--bb-corner-btn-bg-hover, rgb(70, 110, 110));
  border-color: var(--bb-corner-btn-border-hover, rgba(255, 255, 255, 0.5));
}

.hamburgerMenuButton:active {
  transform: scale(0.95);
}

.cornerActions {
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  gap: 4px;
  z-index: 150;
}

.cornerActionButton {
  width: 32px;
  height: 32px;
  padding: 0;
  background-color: var(--bb-corner-btn-bg);
  border: 2px solid var(--bb-corner-btn-border);
  border-radius: 5px;
  cursor: pointer;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.2s,
    transform 0.1s,
    border-color 0.2s;
  color: var(--bb-corner-btn-text);
  font-size: 16px;
  line-height: 1;
}

.cornerActionButton:hover {
  background-color: var(--bb-corner-btn-bg-hover);
  border-color: var(--bb-corner-btn-border-hover);
}

.cornerActionButton:active {
  transform: scale(0.95);
}

.cornerActionButton[hidden] {
  display: none !important;
}

.cameraResetButton__icon {
  display: block;
  width: 20px;
  height: 20px;
  background: url('../../images/camera_reset_cursor.svg') center / contain no-repeat;
  filter: drop-shadow(0 0 2px rgba(255, 240, 242, 0.9)) drop-shadow(0 0 4px rgba(255, 64, 85, 0.82));
}

.fullscreenButton.is-active {
  background-color: var(--bb-corner-btn-active-bg);
  border-color: var(--bb-corner-btn-active-border);
  box-shadow: 0 0 6px var(--bb-corner-btn-active-glow);
}

.fovButton {
  font-size: 13px;
  font-weight: 700;
  position: relative;
}

.fovToggleButton {
  width: 38px;
  padding-right: 6px;
  font-variant-numeric: tabular-nums;
}

.fovButton::after {
  content: '°';
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9px;
  font-weight: 600;
  color: var(--bb-fov-degree-color);
  opacity: 0.9;
  pointer-events: none;
}

.fovButton.is-active {
  background-color: var(--bb-corner-btn-active-bg);
  border-color: var(--bb-corner-btn-active-border);
  box-shadow: 0 0 6px var(--bb-corner-btn-active-glow);
}

.hamburger-line {
  width: 18px;
  height: 2px;
  background-color: var(--bb-hamburger-line, #f4f4f4);
  border-radius: 2px;
  transition: all 0.3s;
}

.hamburgerMenuButton[aria-expanded='true'] .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburgerMenuButton[aria-expanded='true'] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburgerMenuButton[aria-expanded='true'] .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.outerMenu {
  display: flex;
  flex: 1 1 auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  min-height: 0;
  z-index: 10;
}

.menuButton {
  height: 50%;
  width: 12.5%;
  margin-right: 4px;
  aspect-ratio: 0.4;
  border-radius: 4px;
  border-width: 2px;
  padding: 0;
  max-width: 40px;
  user-select: none;
}

.targetButton {
  height: 50%;
  width: 12.5%;
  margin-right: 4px;
  aspect-ratio: 0.4;
  border-radius: 4px;
  border-width: 2px;
  padding: 0;
  max-width: 40px;
  user-select: none;
  font-size: 16px;
  display: none;
  color: black;
}

.outerMenu .menuButton,
.outerMenu .targetButton {
  flex: 0 0 auto;
  width: 32px;
  max-width: 32px;
  height: 32px;
  max-height: 32px;
  margin-right: 0;
  aspect-ratio: auto;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
  position: relative; /* for spinner overlay */
}

.outerMenu .menuButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.outerMenu .targetButton {
  align-items: center;
  justify-content: center;
}

/* spinner overlay for busy state on npc button and score buttons */
.menuButton.is-busy::after,
.targetButton.is-busy::after,
.scoreButton.is-busy::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  margin-top: -16px;
  background-image: url('../../images/spinner.svg');
  background-size: 32px 32px;
  background-repeat: no-repeat;
  /* 50% transparent for softer look */
  opacity: 0.5;
  border-radius: 8px; /* yumuşak kenar */
  z-index: 2;
  pointer-events: none;
  transform-origin: 50% 50%;
  animation: busy-spin 0.9s linear infinite;
}

@keyframes busy-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ensure score buttons can host overlay */
.scoreButton {
  position: relative;
}

/* Active player highlight for score buttons */
.scoreButton--active {
  border: 2px solid var(--bb-score-active-border, rgba(0, 174, 255, 1)) !important;
  box-shadow: var(--bb-score-active-shadow, 0 0 8px rgba(0, 174, 255, 0.5));
}

/* ================================================================
   SCORE PLAYER NAME LABELS
   Labels injected next to score buttons (#customBtnLeft / #customBtnRight).
   Left label hugs the right edge of the left button; right label hugs
   the left edge of the right button. Each theme overrides color/font/shadow
   via the --bb-score-player-name-* tokens.
   ================================================================ */
.scorePlayerName {
  display: inline-flex;
  align-items: center;
  align-self: center;
  font-family: var(--bb-score-player-name-font-family);
  font-size: var(--bb-score-player-name-font-size);
  font-weight: var(--bb-score-player-name-font-weight);
  color: var(--bb-score-player-name-color);
  text-shadow: var(--bb-score-player-name-text-shadow);
  max-width: var(--bb-score-player-name-max-width);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  pointer-events: none;
  user-select: none;
  flex-shrink: 1;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

/* Left name sits to the left of #customBtnLeft, aligned to the right edge.
   margin-right adds to the score-main flex gap to widen the name<->button spacing. */
.scorePlayerName--left {
  text-align: right;
  justify-content: flex-end;
  margin-right: var(--bb-score-player-name-gap);
}

/* Right name sits to the right of #customBtnRight, aligned to the left edge. */
.scorePlayerName--right {
  text-align: left;
  justify-content: flex-start;
  margin-left: var(--bb-score-player-name-gap);
}

/* Active player: apply same accent color/glow as the score button border */
.scorePlayerName--active {
  color: var(--bb-score-player-name-active-color);
  text-shadow: var(--bb-score-player-name-active-text-shadow);
}

/* Ensure score HUD containers vertically center their children (names + buttons) */
[data-bb-widget-host='score-hud'],
[data-bb-mount='hud.score.container'] {
  display: flex;
  align-items: center;
}

/* Compact glass score layouts render player names inside their score buttons. */
html[data-bb-theme='androglass'] .scorePlayerName,
html[data-bb-theme='greenglass'] .scorePlayerName,
html[data-bb-theme='midnight-arena'] .scorePlayerName {
  display: none !important;
}

/* Hide player name labels on narrow/mobile screens */
@media (max-width: 640px) {
  .scorePlayerName {
    display: none !important;
  }
}

/* Place target placeholder (and target button) to far right in outerMenu */
.outerMenu .targetButtonPlaceholder {
  margin-left: auto;
  order: 100;
}
.outerMenu .targetButton {
  order: 100;
}

.menuButton.mainMenuButton {
  height: 100%;
  min-height: 27.333px;
  max-height: 27.333px;
  width: 100%;
  /*max-width: 120px;*/
  min-width: 80px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: large;
  font-weight: 600;
  line-height: 1.1;
  border-radius: 10px;
  border-width: 4px;
  /*border-style: solid;
  border-color: rgb(200, 0, 0);
  background-color: rgb(255, 0, 0);
  color: white;*/
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

.toggleButton {
  height: 100%;
  width: 20%;
  margin-right: 4px;
  aspect-ratio: 0.4;
  border-radius: 10px;
  border-width: 4px;
  padding: 0;
  max-width: 80px;
}

.toggleButton:active,
.menuButton:active,
.shotButton:active,
.targetButton:active {
  transform: scale(0.97);
}

/* Toggle state for targetButton */
.targetButton.is-active {
  background-color: var(--bb-toggle-active-bg, #4a90e2);
  border-color: var(--bb-toggle-active-border, #357abd);
  color: var(--bb-toggle-active-text, #ffffff);
  box-shadow: var(--bb-toggle-active-shadow, inset 0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Toggle state for precisionButton */
.menuButton.is-active {
  background-color: var(--bb-toggle-active-bg, #4a90e2);
  border-color: var(--bb-toggle-active-border, #357abd);
  color: var(--bb-toggle-active-text, #ffffff);
  box-shadow: var(--bb-toggle-active-shadow, inset 0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Fast forward speed levels - progressively darker */

.menuButton.is-active-8x {
  background-color: var(--bb-toggle-active-bg-strong, #2566a8);
  border-color: var(--bb-toggle-active-border-strong, #1a4d85);
  color: var(--bb-toggle-active-text, #ffffff);
  box-shadow: var(--bb-toggle-active-shadow-strong, inset 0 2px 8px rgba(0, 0, 0, 0.4));
}

.targetButtonPlaceholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 27.333px;
  width: 40px;
  max-width: 40px;
  margin-right: 0;
  aspect-ratio: auto;
  border-radius: 4px;
  border: 2px dashed var(--bb-target-placeholder-border, rgba(255, 255, 255, 0.08));
  box-sizing: border-box;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
  flex: 0 0 auto;
}

.targetButtonPlaceholder.is-active {
  border-color: var(--bb-target-placeholder-active-border, rgba(74, 144, 226, 0.7));
  background-color: var(--bb-target-placeholder-active-bg, rgba(74, 144, 226, 0.08));
}

.chatarea {
  height: 70%;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 6px;
  margin-right: 5px;
  min-height: 0;
}

.chatoutput {
  --chat-line-height: 1.4;
  --chat-line-height-em: calc(var(--chat-line-height) * 1em);
  position: absolute;
  bottom: 12px;
  right: 12px;
  min-width: 220px;
  max-width: min(360px, calc(100% - 24px));
  padding: 8px 12px;
  margin: 0;
  border-radius: 6px;
  background-color: var(--bb-chat-bg, rgba(0, 0, 0, 0.1));
  backdrop-filter: blur(2px);
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 0.8em;
  line-height: var(--chat-line-height);
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 250;
}

.chatoutput.has-history.is-history-hover .chatoutput__historyPanel,
.chatoutput.is-history-visible .chatoutput__historyPanel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chatoutput__entry {
  display: none;
}

.chatoutput__entry.is-latest {
  display: block;
}

/* Foul notifications: use a slow, readable pulse, then settle on solid red. */
.chatoutput__entry.is-foul {
  color: #ff3b3b;
  font-weight: 700;
  animation: chatoutput-foul-pulse 1.15s ease-in-out 0s 2 forwards;
}

@keyframes chatoutput-foul-pulse {
  0%,
  100% {
    color: #ff3b3b;
    opacity: 1;
    text-shadow: 0 0 0 rgba(255, 59, 59, 0);
  }
  50% {
    color: #ff8585;
    opacity: 0.6;
    text-shadow: 0 0 8px rgba(255, 59, 59, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chatoutput__entry.is-foul {
    animation: none;
  }
}

.chatoutput__historyPanel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: var(--bb-chat-history-bg, rgba(0, 0, 0, 0.12));
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 0;
}

.chatoutput__historyList {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(var(--chat-line-height-em, 1.4em) * 5.5);
  overflow-y: auto;
  scrollbar-color: var(--bb-chat-scrollbar-color, rgba(255, 255, 255, 0.6)) transparent;
  scrollbar-width: thin;
  padding-left: 4px;
}

.chatoutput__historyList::-webkit-scrollbar {
  width: 6px;
}

.chatoutput__historyList::-webkit-scrollbar-track {
  background: transparent;
}

.chatoutput__historyList::-webkit-scrollbar-thumb {
  background-color: var(--bb-chat-scrollbar-thumb, rgba(255, 255, 255, 0.5));
  border-radius: 3px;
}

.chatoutput__historyEntry {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.pushOutButton {
  width: 100%;
  padding: 8px;
  background: var(--bb-pushout-bg, linear-gradient(#4caf50, #45a049));
  color: var(--bb-pushout-text, #ffffff);
  border: 2px solid var(--bb-pushout-border, #2e7d32);
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: var(--bb-pushout-text-shadow, 1px 1px 2px rgba(0, 0, 0, 0.5));
}

.pushOutButton:hover {
  background: var(--bb-pushout-bg-hover, linear-gradient(#45a049, #4caf50));
  transform: translateY(-2px);
  box-shadow: var(--bb-pushout-shadow, 0 4px 8px rgba(0, 0, 0, 0.3));
}

.pushOutButton:active {
  transform: translateY(0);
  box-shadow: var(--bb-pushout-press-shadow, 0 2px 4px rgba(0, 0, 0, 0.3));
}

.centerMatchTargetIndicator {
  box-sizing: border-box;
  cursor: default;
  pointer-events: none;
  user-select: none;
  text-align: center;
}

.positionChoiceText {
  width: calc(100% - 8px);
  margin: 4px;
  padding: 10px;
  background: var(--bb-position-text-bg, linear-gradient(#2c3e50, #34495e));
  border: 2px solid var(--bb-position-text-border, #3498db);
  border-radius: 5px;
  color: var(--bb-position-text-text, #ffffff);
  font-size: 13px;
  font-weight: bold;
  text-align: center;
  text-shadow: var(--bb-position-text-shadow, 1px 1px 2px rgba(0, 0, 0, 0.7));
  flex-shrink: 0;
}

.positionChoiceButtons {
  width: 100%;
  padding: 0;
  display: flex;
  gap: 8px;
  justify-content: center;
}

.positionChoiceButton {
  flex: 1;
  padding: 8px;
  border: 2px solid;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: var(--bb-position-button-text-shadow, 1px 1px 2px rgba(0, 0, 0, 0.5));
}

.positionChoiceButton--play {
  background: var(--bb-position-play-bg, linear-gradient(#4caf50, #45a049));
  color: var(--bb-position-button-text, #ffffff);
  border-color: var(--bb-position-play-border, #2e7d32);
}

.positionChoiceButton--play:hover {
  background: var(--bb-position-play-bg-hover, linear-gradient(#45a049, #4caf50));
  transform: translateY(-2px);
  box-shadow: var(--bb-position-button-shadow, 0 4px 8px rgba(0, 0, 0, 0.3));
}

.positionChoiceButton--pass {
  background: var(--bb-position-pass-bg, linear-gradient(#e74c3c, #c0392b));
  color: var(--bb-position-button-text, #ffffff);
  border-color: var(--bb-position-pass-border, #a93226);
}

.positionChoiceButton--pass:hover {
  background: var(--bb-position-pass-bg-hover, linear-gradient(#c0392b, #e74c3c));
  transform: translateY(-2px);
  box-shadow: var(--bb-position-button-shadow, 0 4px 8px rgba(0, 0, 0, 0.3));
}

.positionChoiceButton:active {
  transform: translateY(0);
  box-shadow: var(--bb-position-button-press-shadow, 0 2px 4px rgba(0, 0, 0, 0.3));
}

.chatoutput::-webkit-scrollbar {
  display: none;
}

a.pill {
  outline: none;
  background: var(--bb-score-pill-bg, linear-gradient(#888686, #b0b0b3));
  border-radius: 4px;
  text-decoration: none;
  border-color: var(--bb-score-pill-border, #ffffff);
  border-width: 1px;
  margin: 1px;
  padding: 1px;
  font-size: smaller;
  border-top-style: groove;
  display: inline-block;
}

a {
  color: var(--bb-link-color, lightblue);
}
.constants {
  background: var(--bb-constants-panel-bg, linear-gradient(#495155, #0b0b0e));
  border-radius: 5px;
  position: fixed;
  right: 0px;
  top: 0px;
  visibility: hidden;
  padding: 10px;
  border: double;
  border-color: var(--bb-constants-panel-border, #2c2c2c);
  max-width: 400px;
  min-width: 300px;
  max-height: 90vh;
  overflow-y: auto;
  font-size: small;
  z-index: 1000;
  color: var(--bb-constants-panel-text, #fff);
}

.constants p {
  color: var(--bb-constants-accent, #4caf50);
  margin: 5px 0;
  font-weight: bold;
}

.constants .constants-section {
  border-top: 1px solid var(--bb-constants-section-border, #2c2c2c);
  margin-top: 8px;
  padding-top: 6px;
}

.constants .constants-section:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.constants .constants-summary {
  color: var(--bb-constants-accent, #4caf50);
  cursor: pointer;
  font-weight: bold;
  font-size: 12px;
  padding: 2px 0;
}

.constants .constants-summary--blue {
  color: var(--bb-constants-accent-alt, #2196f3);
}

.constants .constants-section-content {
  margin-top: 6px;
}

.nw {
  display: flex;
  align-items: center;
  margin: 5px 0;
  gap: 10px;
}

.nw input[type='range'] {
  flex: 1;
  min-width: 120px;
}

label {
  display: inline-block;
  min-width: 120px;
  color: var(--bb-constants-label-text, #ccc);
  font-size: 13px;
}

.constants button {
  margin-top: 10px;
  padding: 8px 16px;
  width: 100%;
}

.chatoutput .menuButton {
  height: auto;
  width: auto;
  max-width: none;
  aspect-ratio: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  margin-bottom: 4px;
  padding: 0;
}

.view3d.is-timeout-fallback-blurred {
  transition: var(--bb-timeout-fallback-blur-transition);
  filter: var(--bb-timeout-fallback-blur-filter);
  pointer-events: none;
}

.scoreButton--white {
  color: var(--bb-score-btn-white-text);
  text-shadow: var(--bb-score-btn-default-text-shadow);
  background: var(--bb-score-btn-default-bg) !important;
}

.scoreButton--yellow {
  color: var(--bb-score-btn-yellow-text);
  text-shadow: var(--bb-score-btn-default-text-shadow);
  background: var(--bb-score-btn-default-bg) !important;
}
.menuButton--large {
  width: 32px;
  min-width: 32px;
  height: 32px;
  max-width: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  line-height: 1;
  aspect-ratio: auto;
  padding: 0;
}

.chatoutput .menuButton--large {
  width: 32px;
  min-width: 32px;
  height: 32px;
  font-size: 1.1rem;
  line-height: 1;
}

/* Precision Panel */
.precisionPanel {
  position: fixed;
  left: 0px;
  bottom: 17%;
  display: none;
  flex-direction: column;
  align-items: center;
  /* background: linear-gradient(rgb(0, 64, 94), #000214); */
  /* background-color: rgba(0, 64, 94, 0.4); */
  backdrop-filter: blur(2px);
  opacity: 0.6;
  border-radius: 0 8px 8px 0;
  padding: 30px;
  gap: 20px;
  z-index: 500;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); */
  /* max-height = viewport - scoreButtonsContainer (48px) - gap (2px) - panel (17vh) */
  max-height: calc(83vh - 50px);
  overflow: visible;
}

.precisionPanel.is-visible {
  display: flex;
}

.precisionBallContainer {
  /* Use explicit pixel dimensions to ensure proper canvas rendering */
  width: 336px;
  height: 336px;
  max-width: 336px;
  max-height: 336px;
  margin: 0;
  position: relative;
  overflow: visible;
  border-radius: 5px;
  aspect-ratio: 1;
  z-index: 1;
}

.precisionCueBall {
  height: 100%;
  margin: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  position: absolute;
  top: 0;
  z-index: 5;
  overflow: hidden;
}

#precisionCueBallCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
}

.precisionSliderRow {
  display: flex;
  flex-direction: row;
  gap: 40px;
  align-items: center;
  justify-content: center;
}

.precisionElevationSlider {
  width: 40px;
  height: 280px;
  max-height: 280px;
  margin: 0;
  position: relative;
  z-index: 10;
}

input[type='range'].precisionElevationSlider {
  writing-mode: vertical-lr;
  direction: rtl;
}

.precisionPowerSlider {
  width: 40px;
  height: 280px;
  max-height: 280px;
  margin: 0;
  position: relative;
  z-index: 10;
  accent-color: var(--bb-hud-power-accent, rgb(255, 0, 0));
}

input[type='range'].precisionPowerSlider {
  writing-mode: vertical-lr;
  direction: rtl;
}

/* Mobile responsive adjustments for precisionPanel */
@media screen and (max-height: 700px) {
  .precisionPanel {
    /* Calculate available height: 83vh (view3d) - scoreButtons (48px) - gap (2px) */
    max-height: calc(83vh - 50px);
    padding: 20px;
    gap: 15px;
  }

  .precisionBallContainer {
    /* Scale down proportionally when height is constrained */
    height: auto;
    width: auto;
    max-width: min(280px, calc(83vh - 50px - 40px - 280px - 35px));
    max-height: min(280px, calc(83vh - 50px - 40px - 280px - 35px));
  }

  .precisionElevationSlider,
  .precisionPowerSlider {
    height: auto;
    max-height: min(240px, calc(83vh - 50px - 40px - 35px - 150px));
  }

  .precisionSliderRow {
    gap: 30px;
  }
}

@media screen and (max-height: 600px) {
  .precisionPanel {
    max-height: calc(83vh - 50px);
    padding: 15px;
    gap: 10px;
  }

  .precisionBallContainer {
    max-width: min(200px, calc(83vh - 50px - 30px - 200px - 25px));
    max-height: min(200px, calc(83vh - 50px - 30px - 200px - 25px));
  }

  .precisionElevationSlider,
  .precisionPowerSlider {
    max-height: min(180px, calc(83vh - 50px - 30px - 25px - 120px));
  }

  .precisionSliderRow {
    gap: 20px;
  }
}

/* Portrait mode (narrow screens) - switch to horizontal layout within panel */
/* Only applies when width is too narrow for side-by-side layout outside panel */
@media screen and (max-height: 500px) and (max-width: 500px) {
  .precisionPanel {
    flex-direction: row;
    max-height: calc(83vh - 50px);
    padding: 10px 15px;
    gap: 15px;
  }

  .precisionBallContainer {
    /* Place ball container to the right of sliders inside the panel */
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    height: auto;
    width: auto;
    max-width: min(150px, calc(83vh - 50px - 20px));
    max-height: min(150px, calc(83vh - 50px - 20px));
    order: 2;
  }

  .precisionSliderRow {
    gap: 15px;
    order: 1;
    height: 100%;
  }

  .precisionElevationSlider,
  .precisionPowerSlider {
    max-height: calc(83vh - 50px - 20px);
  }
}

/* Very small portrait screens - more aggressive downscaling */
@media screen and (max-height: 420px) and (max-width: 500px) {
  .precisionPanel {
    flex-direction: row;
    max-height: calc(83vh - 50px);
    padding: 8px 12px;
    gap: 12px;
  }

  .precisionBallContainer {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    height: auto;
    width: auto;
    max-width: min(120px, calc(83vh - 50px - 16px));
    max-height: min(120px, calc(83vh - 50px - 16px));
    order: 2;
  }

  .precisionSliderRow {
    gap: 12px;
    order: 1;
    height: 100%;
  }

  .precisionElevationSlider,
  .precisionPowerSlider {
    width: 30px;
    max-height: calc(83vh - 50px - 16px);
  }
}

/* When height < 778px AND width >= 450px: keep precision controls inside panel */
@media screen and (max-height: 778px) and (min-width: 450px) {
  .precisionPanel.is-visible {
    padding: 20px;
    gap: 15px;
    align-items: center;
  }

  .precisionBallContainer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: min(200px, calc(83vh - 50px));
    height: min(200px, calc(83vh - 50px));
    max-width: min(200px, calc(83vh - 50px));
    max-height: min(200px, calc(83vh - 50px));
    margin: 0;
    order: 2;
  }

  .precisionSliderRow {
    position: relative;
    gap: 30px;
    order: 1;
  }

  .precisionElevationSlider,
  .precisionPowerSlider {
    max-height: calc(83vh - 50px - 40px - 30px);
  }
}

/* Narrow portrait screens with height < 778px: Use vertical stacking */
@media screen and (max-height: 778px) and (max-width: 449px) {
  .precisionPanel.is-visible {
    flex-direction: column;
    padding: 15px;
    gap: 10px;
    max-height: calc(83vh - 50px);
  }

  .precisionBallContainer {
    /* Keep ball container in panel, above sliders */
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: min(280px, calc(100vw - 81px - 40px));
    height: min(280px, calc(100vw - 81px - 40px));
    max-width: min(280px, calc(100vw - 81px - 40px));
    max-height: min(280px, calc(100vw - 81px - 40px));
    margin: 0 auto;
    order: 1;
  }

  .precisionSliderRow {
    position: relative;
    gap: 25px;
    order: 2;
  }

  .precisionElevationSlider,
  .precisionPowerSlider {
    max-height: min(200px, calc(83vh - 50px - 280px - 40px));
  }
}

/* For wider screens with height < 778px, allow ball container to be bigger */
@media screen and (max-height: 778px) and (min-width: 600px) {
  .precisionBallContainer {
    width: min(280px, calc(83vh - 50px)) !important;
    height: min(280px, calc(83vh - 50px)) !important;
    max-width: min(280px, calc(83vh - 50px)) !important;
    max-height: min(280px, calc(83vh - 50px)) !important;
  }
}

/* For very wide screens with height < 778px, allow full size */
@media screen and (max-height: 778px) and (min-width: 900px) {
  .precisionBallContainer {
    width: min(336px, calc(83vh - 50px)) !important;
    height: min(336px, calc(83vh - 50px)) !important;
    max-width: min(336px, calc(83vh - 50px)) !important;
    max-height: min(336px, calc(83vh - 50px)) !important;
  }
}

/* Very small height screens with enough width - more aggressive downscaling */
@media screen and (max-height: 500px) and (min-width: 450px) {
  .precisionBallContainer {
    width: min(150px, calc(83vh - 50px)) !important;
    height: min(150px, calc(83vh - 50px)) !important;
    max-width: min(150px, calc(83vh - 50px)) !important;
    max-height: min(150px, calc(83vh - 50px)) !important;
    bottom: auto !important;
  }
}

/* Target ball number display on Shot button (nineball mode) */
.shotButton {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.target-ball-number {
  font-size: 0.7em;
  font-weight: normal;
  opacity: 0.85;
}

/* Fast forward button overlay styles */
#fastForward {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 3px solid transparent;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease;
}

/* Active state - blue background when fast forward is on */
#fastForward.is-active-8x {
  background-color: var(--bb-fastforward-active-bg, #3498db) !important;
  border-color: var(--bb-fastforward-active-border, #2980b9);
}

/* Pending state - waiting for own request to be accepted */
#fastForward.is-pending {
  opacity: 0.6;
  cursor: wait;
}

/* Opponent request state - yellow border that blinks, then stays solid */
#fastForward.is-opponent-request {
  border-color: var(--bb-fastforward-opponent-border, #f1c40f);
  animation: ffBorderBlink 0.333s ease-in-out 3;
  box-shadow: var(--bb-fastforward-opponent-shadow, 0 0 8px rgba(241, 196, 15, 0.7));
}

/* When both pending AND opponent-request (both sides requested but no consensus yet) */
#fastForward.is-pending.is-opponent-request {
  border-color: var(--bb-fastforward-opponent-border, #f1c40f);
  box-shadow: var(--bb-fastforward-opponent-shadow, 0 0 8px rgba(241, 196, 15, 0.7));
  opacity: 1;
}

@keyframes ffBorderBlink {
  0%,
  100% {
    border-color: var(--bb-fastforward-opponent-border, #f1c40f);
    box-shadow: var(--bb-fastforward-opponent-shadow, 0 0 8px rgba(241, 196, 15, 0.7));
  }
  50% {
    border-color: transparent;
    box-shadow: none;
  }
}

/* Auto fast forward state - light gray border that blinks continuously */
#fastForward.is-auto-fastforward {
  border-color: var(--bb-fastforward-auto-border, #aaaaaa);
  animation: ffAutoBlinkGray 0.333s ease-in-out infinite;
  box-shadow: var(--bb-fastforward-auto-shadow, 0 0 8px rgba(170, 170, 170, 0.7));
}

@keyframes ffAutoBlinkGray {
  0%,
  100% {
    border-color: var(--bb-fastforward-auto-border, #aaaaaa);
    box-shadow: var(--bb-fastforward-auto-shadow, 0 0 8px rgba(170, 170, 170, 0.7));
  }
  50% {
    border-color: transparent;
    box-shadow: none;
  }
}

#fastForward .speed-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--bb-fastforward-speed-text, #000000);
  z-index: 2;
  pointer-events: none;
  text-shadow:
    0 0 3px black,
    0 0 1px black;
  opacity: 0.5;
}

#ghostWheelCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.shotButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--bb-hit-disabled-bg, #555);
  border-color: var(--bb-hit-disabled-border, #444);
  color: var(--bb-hit-disabled-text, #aaa);
}

.shotClockCountdownButton {
  background: var(--bb-shotclock-bg, linear-gradient(#e74c3c, #c0392b));
  border-color: var(--bb-shotclock-border, #922b21);
  cursor: default;
  pointer-events: none;
  text-shadow: none;
}

.shotClockCountdownButton:hover {
  background: var(
    --bb-shotclock-bg-hover,
    var(--bb-shotclock-bg, linear-gradient(#e74c3c, #c0392b))
  );
  transform: none;
  box-shadow: none;
}

.shotClockCountdownButton:active {
  transform: none;
  box-shadow: none;
}

.bb-auto-hide {
  opacity: 0 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transition: opacity 420ms ease;
  will-change: opacity;
}

.bb-auto-hide.bb-auto-visible,
.bb-auto-hide.bb-auto-interacting {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transition-delay: 0s;
}

.bb-auto-hide.bb-auto-hiding {
  pointer-events: auto !important;
}

.bb-auto-hide.bb-auto-external-pointer-down:not(.bb-auto-visible):not(.bb-auto-interacting),
.bb-auto-hide.bb-auto-external-pointer-down.bb-auto-hiding:not(.bb-auto-visible):not(
    .bb-auto-interacting
  ) {
  pointer-events: none !important;
}

.bb-critical-shot-clock-active.bb-auto-hide,
.bb-critical-shot-clock-active.bb-auto-hiding,
[data-bb-role='app-shell'].bb-critical-shot-clock-active
  [data-bb-source='hud.score.container'].bb-auto-hide,
[data-bb-role='app-shell'].bb-critical-shot-clock-active
  [data-bb-source='hud.score.container'].bb-auto-hiding {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.centerButtonsContainer.bb-critical-shot-clock-active,
[data-bb-role='app-shell'].bb-critical-shot-clock-active #centerButtonsContainer {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  .bb-auto-hide {
    transition: opacity 80ms linear;
  }
}
