/* SoundButtonsPro 3.3.3 - layout stability for all sound views.
   Sound UI is a self-contained component. Ezoic must exclude this container
   through its official dashboard (CSS alone cannot prevent ad injection).
*/

/* Preserve the arcade shape but move the name under it. Each area gets its
   own row, so long names and action icons never compete for horizontal space. */
.sbp-sound,
.sbp-sound-grid[data-view="grid"] > .sbp-sound,
.sbp-sound-grid[data-view="list"] > .sbp-sound,
.sbp-sound-grid[data-view="horizontal"] > .sbp-sound,
.sbp-sound-grid[data-view="masonry"] > .sbp-sound,
.sbp-sound-grid[data-view="tree"] .sbp-tree-children > .sbp-sound,
.sbp-sound-grid:not([data-view]) > .sbp-sound,
.sbp-featured .sbp-sound {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  height: auto;
  padding: 16px;
  overflow-wrap: anywhere;
  isolation: isolate;
  text-align: center;
}

/* The arcade pad remains the only clickable play/stop surface in each card. */
.sbp-sound .sbp-sound-play {
  order: 0;
  align-self: center;
  margin: 0 auto;
  flex-shrink: 0;
}
.sbp-sound .sbp-rank-index {
  order: -1;
  width: auto;
  max-width: 100%;
  text-align: center;
  line-height: 1.2;
}
.sbp-sound .sbp-sound-body {
  order: 1;
  flex: 0 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: center;
}
.sbp-sound .sbp-sound-title,
.sbp-sound-grid[data-sbp-view] .sbp-sound-title {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal;
  overflow: visible !important;
  text-overflow: clip !important;
  line-height: 1.42;
}
.sbp-sound .sbp-sound-sub {
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  max-width: 100%;
}
.sbp-sound .sbp-sound-actions,
.sbp-sound-grid[data-view="grid"] > .sbp-sound .sbp-sound-actions,
.sbp-sound-grid[data-view="masonry"] > .sbp-sound .sbp-sound-actions {
  display: flex;
  order: 2;
  flex: 0 0 auto;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.10);
  padding-top: 11px;
}
.sbp-sound .sbp-action,
.sbp-sound-grid[data-view="grid"] .sbp-action-add {
  flex: 0 0 auto;
  margin-left: 0;
}
.sbp-sound .sbp-fake-wave { display: none !important; }

/* A list contains one card per row. Sound pad, title, stats and actions are
   stacked within each row; no old two-column layout can force overflow. */
.sbp-sound-grid[data-view="list"],
.sbp-sound-grid[data-view="tree"] .sbp-tree-children,
.sbp-sound-grid--row {
  min-width: 0;
  max-width: 100%;
}
.sbp-sound-grid[data-view="list"] > .sbp-sound,
.sbp-sound-grid[data-view="tree"] .sbp-tree-children > .sbp-sound {
  padding: 20px 18px;
}
.sbp-sound-grid[data-view="list"] > .sbp-sound .sbp-sound-body,
.sbp-sound-grid[data-view="tree"] .sbp-tree-children > .sbp-sound .sbp-sound-body {
  max-width: 680px;
}
.sbp-sound-grid[data-view="list"] > .sbp-sound .sbp-sound-actions,
.sbp-sound-grid[data-view="tree"] .sbp-tree-children > .sbp-sound .sbp-sound-actions {
  justify-content: center;
}
.sbp-sound-grid[data-view="horizontal"] > .sbp-sound {
  flex: 0 0 clamp(275px, 34vw, 390px) !important;
  width: auto;
}
.sbp-sound-grid[data-view="masonry"] > .sbp-sound {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: 15px;
  width: 100%;
}
.sbp-sound-grid[data-view="tree"] .sbp-tree-children > .sbp-sound::after {
  top: 40px;
}
.sbp-sound--featured {
  max-width: 100%;
}
/* Guard the sound block's own children against unexpected content sizing.
   Do not hide or relocate injected ads in CSS. Configure Ezoic exclusion
   filters for .sbp-sound-grid and .sbp-sound instead. */
.sbp-sound > * {
  max-width: 100%;
}
.sbp-sound iframe,
.sbp-sound ins {
  max-width: 100%;
}

/* Global audio dock: all controls stay usable without affecting body layout. */
.sbp-dock-track strong {
  overflow-wrap: anywhere;
}
@media (max-width: 680px) {
  .sbp-sound,
  .sbp-sound-grid[data-view="list"] > .sbp-sound,
  .sbp-sound-grid[data-view="masonry"] > .sbp-sound {
    padding: 13px 11px;
  }
  .sbp-sound .sbp-sound-actions {
    gap: 7px;
    padding-top: 9px;
  }
  .sbp-sound-grid[data-view="horizontal"] > .sbp-sound {
    flex-basis: min(86vw, 360px) !important;
  }
}
@media (max-width: 370px) {
  .sbp-sound .sbp-sound-actions {
    gap: 5px;
  }
}


/*
 * AUDIO DOCK STABILITY
 * Ezoic exclusion MUST be configured in its dashboard: CSS cannot block
 * scripts from injecting placements. We never hide or relocate ad creatives.
 * The inner wrapper keeps the actual player controls in a single layout unit.
 */
#sbp-dock.sbp-ad-exclude {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100vw;
  box-sizing: border-box;
}
#sbp-dock .sbp-dock-inner {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.5vw, 20px);
}
#sbp-dock .sbp-dock-track {
  min-width: 0;
  flex: 0 1 250px;
  max-width: 32%;
}
#sbp-dock .sbp-dock-track strong {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
#sbp-dock .sbp-dock-main {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: clamp(4px, 1vw, 12px);
  flex-wrap: nowrap;
}
#sbp-dock .sbp-dock-time {
  min-width: 0;
  flex: 1 1 160px;
  max-width: 350px;
}
#sbp-dock .sbp-dock-volume,
#sbp-dock .sbp-mode-shell,
#sbp-dock .sbp-dock-play,
#sbp-dock .sbp-stop,
#sbp-dock .sbp-dock-full {
  flex-shrink: 0;
}
#sbp-dock .sbp-mode-menu {
  z-index: 101;
}
@media (max-width: 800px) {
  #sbp-dock .sbp-dock-inner {
    gap: 10px;
  }
  #sbp-dock .sbp-dock-track {
    flex-basis: 165px;
    max-width: 26%;
  }
  #sbp-dock .sbp-dock-main { gap: 5px; }
}
@media (max-width: 680px) {
  #sbp-dock { padding: 7px 11px; }
  #sbp-dock .sbp-dock-inner {
    flex-flow: column nowrap;
    align-items: stretch;
    gap: 5px;
  }
  #sbp-dock .sbp-dock-track {
    flex: none;
    width: 100%;
    max-width: 100%;
  }
  #sbp-dock .sbp-dock-main {
    flex: none;
    width: 100%;
    max-width: 100%;
    justify-content: space-between;
    gap: 4px;
  }
  #sbp-dock .sbp-dock-time {
    flex: 1 1 60px;
    min-width: 0;
    max-width: none;
  }
  #sbp-dock .sbp-mode-trigger {
    min-width: 72px;
    padding: 8px 5px;
  }
  #sbp-dock .sbp-dock-volume input {width: min(11vw, 48px);}
}
@media (max-width: 355px) {
  #sbp-dock .sbp-dock-full { display: none; }
  #sbp-dock .sbp-mode-trigger { min-width: 67px; font-size: 11px; }
  #sbp-dock .sbp-dock-volume input { width: 35px; }
}
