/* hidden, not removed: each game's JS still writes to its old sound button */
#soundToggle { display: none !important; }

/* mounted after the game in grid layouts, so it supplies its own container edges */
.tc-bb-wrap.standalone {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-tile);
  overflow: hidden;
}
.tc-bb-wrap.standalone .tc-bb { border-top: none; }

.tc-bb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 20px 8px 28px;
  border-top: 1px solid var(--line);
  background: transparent;
  font-family: var(--font-body);
  position: relative;
}

.tc-bb-fair {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  border-radius: 10px;
  padding: 6px 8px 6px 0;
  color: var(--lime);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s;
}
.tc-bb-fair:hover { color: var(--text); }
.tc-bb-fair svg { width: 14px; height: 14px; color: var(--lime); flex: 0 0 auto; }
.tc-bb-fair[aria-expanded="true"] { color: var(--text); }

.tc-bb-tools { display: flex; align-items: center; gap: 4px; }

.tc-bb-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text-soft);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tc-bb-btn svg { width: 18px; height: 18px; }
.tc-bb-btn:hover:not(:disabled) { background: var(--panel-2); color: var(--text); }

.tc-bb-btn[aria-pressed="true"] { color: var(--violet-hover); }
.tc-bb-btn[aria-expanded="true"] { background: var(--panel-2); color: var(--text); }

/* disabled, not hidden, so the bar doesn't reflow when a round ends */
.tc-bb-btn:disabled { opacity: .35; cursor: not-allowed; }

.tc-bb-btn:focus-visible,
.tc-bb-fair:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.tc-bb-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--panel);
  border-radius: 0 0 var(--r-tile) var(--r-tile);
  padding: 14px 18px;
  max-height: 280px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.tc-bb-panel.open { display: block; }
.tc-bb-panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.tc-bb-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.tc-bb-row:last-child { border-bottom: none; }
.tc-bb-k { flex: 0 0 auto; }
.tc-bb-v {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
  text-align: right;
}

.tc-bb-note { margin-top: 10px; line-height: 1.5; opacity: .8; }
.tc-bb-link { color: var(--violet-hover); text-decoration: none; font-weight: 600; }
.tc-bb-link:hover { text-decoration: underline; }

.tc-bb-hist { width: 100%; border-collapse: collapse; }
.tc-bb-hist th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  padding: 0 10px 7px 0;
  color: var(--text-muted);
  opacity: .7;
}
.tc-bb-hist td {
  padding: 6px 10px 6px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}
.tc-bb-hist .win  { color: var(--lime); }
.tc-bb-hist .loss { color: var(--text-muted); }

.tc-bb-empty { padding: 14px 0; text-align: center; opacity: .65; }
.tc-bb-err   { padding: 12px 0; color: var(--pink); }

.tc-bb-toast {
  position: absolute;
  right: 18px;
  bottom: calc(100% + 8px);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 7px;
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 20px var(--shade-deep);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 5;
}
.tc-bb-toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 640px) {
  .tc-bb { padding: 8px 12px; gap: 8px; }
  /* collapse the label to the shield alone; the icons keep full hit targets */
  .tc-bb-fair-label { display: none; }
  .tc-bb-fair { padding-right: 0; }
  .tc-bb-panel { padding: 12px; }
  .tc-bb-v { font-size: 10px; }
}

.tc-bb-vol {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: 18px;
  transition: gap .2s cubic-bezier(.4,0,.2,1), padding .2s cubic-bezier(.4,0,.2,1), background .2s;
}
.tc-bb-vol:hover,
.tc-bb-vol:focus-within {
  gap: 9px;
  padding-right: 12px;
  background: var(--frost-faint);
}
.tc-bb-vol-slot {
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: width .2s cubic-bezier(.4,0,.2,1), opacity .16s;
}
.tc-bb-vol:hover .tc-bb-vol-slot,
.tc-bb-vol:focus-within .tc-bb-vol-slot { width: 82px; opacity: 1; }
.tc-bb-vol-slot input {
  width: 82px;
  height: 4px;
  display: block;
  -webkit-appearance: none;
  appearance: none;
  background: var(--frost-faint);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.tc-bb-vol-slot input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--violet-hover);
  box-shadow: 0 0 7px var(--glow-violet);
  cursor: pointer;
}
.tc-bb-vol-slot input::-moz-range-thumb {
  width: 12px; height: 12px;
  border: none; border-radius: 50%;
  background: var(--violet-hover);
  cursor: pointer;
}
@media (max-width: 640px) {
  /* no hover on touch: keep the slider permanently visible but compact */
  .tc-bb-vol { gap: 8px; }
  .tc-bb-vol-slot, .tc-bb-vol-slot input { width: 64px; opacity: 1; }
}

/* gold so music and sfx sliders are never confused; `off` stays visible so a muted playlist still shows */
.tc-bb-music .tc-bb-vol-slot input::-webkit-slider-thumb {
  background: var(--gold);
  box-shadow: 0 0 7px rgba(255,200,61,.85);
}
.tc-bb-music .tc-bb-vol-slot input::-moz-range-thumb { background: var(--gold); }
.tc-bb-music .tc-bb-btn[aria-pressed="true"] { color: var(--gold); }

.tc-bb-music .tc-bb-vol-slot { display: flex; align-items: center; gap: 6px; }
.tc-bb-music:hover .tc-bb-vol-slot,
.tc-bb-music:focus-within .tc-bb-vol-slot { width: 138px; }
.tc-bb-track {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: none; background: none;
  color: var(--text-muted);
  cursor: pointer;
}
.tc-bb-track:hover { color: var(--gold); }
.tc-bb-track svg { width: 13px; height: 13px; }
@media (max-width: 640px) {
  .tc-bb-music .tc-bb-vol-slot { width: 120px; opacity: 1; }
}
