/* ThePit · Copyright (C) 2026 abel0x
   SPDX-License-Identifier: AGPL-3.0-or-later
   Free software with ABSOLUTELY NO WARRANTY; see LICENSE for the terms. */
/* =========================================================
   ThePit: the look every table shares
   Loaded after shared/css/pit.css and before the table's own
   stylesheet: sound control and mixer, rule profiles, switches,
   chips and buttons that every table draws the same way. The same
   rule as pit.css decides what may move here. Chips take their colours
   from the pit's one palette in shared/js/chips.js, never from CSS.
   ========================================================= */
:root {
  --tray-top: rgba(10, 25, 18, .9);
  --tray-bottom: rgba(4, 14, 10, .92);
  --action-top: rgba(15, 50, 36, .95);
  --action-bottom: rgba(8, 32, 22, .95);
  --action-hover-top: rgba(22, 70, 50, .95);
  --action-hover-bottom: rgba(12, 44, 30, .95);
  --ink: #0b1310;
}

body[data-theme="midnight"] {
  --tray-top: rgba(10, 29, 47, .92);
  --tray-bottom: rgba(3, 13, 23, .94);
  --action-top: rgba(21, 59, 88, .95);
  --action-bottom: rgba(10, 34, 56, .95);
  --action-hover-top: rgba(31, 79, 114, .95);
  --action-hover-bottom: rgba(15, 47, 75, .95);
}

body[data-theme="bordeaux"] {
  --tray-top: rgba(50, 19, 27, .92);
  --tray-bottom: rgba(24, 8, 13, .94);
  --action-top: rgba(84, 32, 45, .95);
  --action-bottom: rgba(51, 16, 27, .95);
  --action-hover-top: rgba(111, 42, 57, .95);
  --action-hover-bottom: rgba(69, 21, 35, .95);
}

body[data-theme="onyx"] {
  --tray-top: rgba(26, 28, 31, .92);
  --tray-bottom: rgba(9, 10, 12, .94);
  --action-top: rgba(52, 56, 61, .95);
  --action-bottom: rgba(31, 33, 37, .95);
  --action-hover-top: rgba(70, 75, 81, .95);
  --action-hover-bottom: rgba(42, 45, 50, .95);
}

body[data-theme="amethyst"] {
  --tray-top: rgba(38, 22, 58, .92);
  --tray-bottom: rgba(17, 9, 28, .94);
  --action-top: rgba(73, 44, 108, .95);
  --action-bottom: rgba(43, 25, 68, .95);
  --action-hover-top: rgba(95, 59, 138, .95);
  --action-hover-bottom: rgba(56, 33, 88, .95);
}

/* ----------------------- The table fills the window ----------------------- */
html, body { height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--cream);
  background:
    radial-gradient(120% 120% at 50% -10%, var(--page-highlight) 0%, var(--page-mid) 45%, var(--page-edge) 100%);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* ----------------------- Top bar ----------------------- */
.brand-number {
  min-width: 32px;
  display: inline-grid;
  place-items: center;
  padding: 2px 7px 3px;
  border: 1px solid rgba(217, 182, 95, .46);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(217,182,95,.14), rgba(217,182,95,.035));
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 3px 10px rgba(0,0,0,.2);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 1.04em;
  font-weight: 700;
  letter-spacing: 0;
}
/* The way back to the rest of the pit, at the left of the top bar. */
.lobby-link { flex: 0 0 auto; text-decoration: none; }
.lobby-glyph {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#soundToggle.sound-control {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 50%;
  color: var(--gold-bright);
  background:
    radial-gradient(circle at 35% 27%, rgba(255,255,255,.12), transparent 28%),
    linear-gradient(145deg, rgba(217,182,95,.14), rgba(5,14,10,.72));
  border-color: rgba(217, 182, 95, .34);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.035), 0 5px 12px rgba(0,0,0,.25);
}
#soundToggle.sound-control::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  border: 1px solid rgba(217,182,95,.15);
  border-radius: inherit;
}
.sound-glyph {
  position: relative;
  z-index: 1;
  display: block;
  width: 24px;
  height: 24px;
  overflow: visible;
  transition: transform .16s ease;
}
.sound-cone {
  fill: rgba(217,182,95,.13);
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linejoin: round;
}
.sound-wave,
.sound-slash {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.sound-wave {
  stroke-width: 1.55;
  transition: opacity .18s ease, transform .18s ease;
  transform-origin: 14px 14px;
}
.sound-wave-near { opacity: .9; }
.sound-wave-far { opacity: .62; }
.sound-slash {
  opacity: 0;
  stroke: var(--bad);
  stroke-width: 1.9;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.55));
  transition: opacity .18s ease;
}
.sound-led {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 2;
  width: 5px;
  height: 5px;
  border: 1px solid rgba(4,16,10,.82);
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 6px rgba(65,209,138,.65);
  transition: background .18s ease, box-shadow .18s ease;
}
#soundToggle[aria-pressed="false"] {
  color: rgba(244,239,226,.55);
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(5,14,10,.72));
}
#soundToggle[aria-pressed="false"] .sound-wave { opacity: 0; transform: translateX(-1.5px) scale(.9); }
#soundToggle[aria-pressed="false"] .sound-slash { opacity: .92; }
#soundToggle[aria-pressed="false"] .sound-led { background: var(--bad); box-shadow: 0 0 5px rgba(226,104,95,.45); }
#soundToggle:active .sound-glyph { transform: scale(.9); }

/* ----------------------- Table plaque and banner ----------------------- */
.banner.flash-win { background: rgba(33, 110, 70, .55); border-color: var(--good); color: #d6ffe9; }
.table-spec + .table-spec { border-left: 1px solid rgba(205,169,82,.24); }
.table-spec small,
.table-spec strong { display: block; white-space: nowrap; }
.table-spec small {
  margin-bottom: 2px;
  color: rgba(226,194,109,.58);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 1.2px;
}
.table-spec strong {
  color: rgba(244,239,226,.84);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .55px;
  font-variant-numeric: tabular-nums;
}
.table-profile-spec strong { color: rgba(232,202,125,.95); }

/* ----------------------- Chips ----------------------- */
.chip-art {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}
.chip::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.11), inset 0 -5px 8px rgba(0,0,0,.13);
  pointer-events: none;
}
.chip:nth-child(1) { --chip-turn: -4deg; }
.chip:nth-child(2) { --chip-turn: 2.5deg; }
.chip:nth-child(3) { --chip-turn: -1.5deg; }
.chip:nth-child(4) { --chip-turn: 3.5deg; }
.chip:nth-child(5) { --chip-turn: -2.5deg; }
.chip:nth-child(6) { --chip-turn: 1.5deg; }
.chip-svg-base { fill: var(--body); stroke: rgba(0,0,0,.48); stroke-width: 1.5; }
.chip-svg-spots {
  fill: none;
  stroke-width: 17;
  stroke-dasharray: 15.32 45.94;
  transform: rotate(-7.5deg);
  transform-origin: 50% 50%;
}
.chip-svg-spots.spot-a { stroke: var(--spot); }
.chip-svg-spots.spot-b { stroke: var(--spot-alt, var(--spot)); stroke-dashoffset: -30.63; }
.chip-svg-body-ring { fill: var(--body); stroke: rgba(0,0,0,.2); stroke-width: 1; }
.chip-svg-inlay { fill: var(--inlay); stroke: rgba(255,255,255,.16); stroke-width: .8; }
.chip-svg-innerline { fill: none; stroke: rgba(0,0,0,.32); stroke-width: 1; }
.chip-svg-shade { fill: rgba(0,0,0,.11); }
.chip-svg-shine { fill: rgba(255,255,255,.13); }

/* A chip lying on the felt: the low cylinder drawn by ChipArt.cylinder.
   The table sizes it with --stack-w, --stack-face and --stack-t. */
.stack-chip {
  --stack-shift: 0px;
  --stack-chip-turn: 0deg;
  position: absolute;
  left: calc(50% + var(--stack-shift));
  bottom: calc(var(--stack-t) * var(--level, 0));
  width: var(--stack-w);
  height: calc(var(--stack-face) + var(--stack-t));
  transform: translateX(-50%) rotate(var(--stack-chip-turn));
  transform-origin: 50% 72%;
  pointer-events: none;
}
.stack-chip-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  shape-rendering: geometricPrecision;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.34));
}
.stack-chip.cap .stack-chip-art { filter: drop-shadow(0 2px 1.5px rgba(0,0,0,.38)); }
.stack-svg-side {
  fill: var(--body);
  stroke: rgba(0,0,0,.58);
  stroke-width: 1.5;
  stroke-linejoin: round;
}
.stack-svg-side-spot { fill: var(--spot); }
.stack-svg-side-spot.spot-b { fill: var(--spot-alt, var(--spot)); }
.stack-svg-side-shade { fill: rgba(0,0,0,.24); }
.stack-svg-side-glint {
  fill: none;
  stroke: rgba(255,255,255,.18);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.stack-svg-bottom-rim {
  fill: none;
  stroke: rgba(0,0,0,.62);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.stack-svg-top {
  fill: var(--body);
  stroke: rgba(0,0,0,.56);
  stroke-width: 1.8;
}
.stack-svg-spots {
  fill: none;
  stroke-width: 17;
  stroke-dasharray: 6.25 18.75;
}
.stack-svg-spots.spot-a { stroke: var(--spot); }
.stack-svg-spots.spot-b { stroke: var(--spot-alt, var(--spot)); stroke-dashoffset: -12.5; }
.stack-svg-body-ring {
  fill: var(--body);
  stroke: rgba(0,0,0,.22);
  stroke-width: 1;
}
.stack-svg-groove { fill: var(--ringline); }
.stack-svg-inlay {
  fill: var(--inlay);
  stroke: rgba(255,255,255,.16);
  stroke-width: .8;
}
.stack-svg-innerline {
  fill: none;
  stroke: rgba(0,0,0,.34);
  stroke-width: 1;
}
.stack-svg-face-shade { fill: rgba(0,0,0,.14); }
.stack-svg-face-shine { fill: rgba(255,255,255,.11); }

/* ----------------------- Buttons ----------------------- */
.btn {
  font-family: var(--font-ui);
  font-size: clamp(12px, 1.5vh, 14px);
  font-weight: 700;
  letter-spacing: .5px;
  padding: clamp(8px, 1.4vh, 12px) clamp(14px, 1.8vw, 22px);
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .16s;
  white-space: nowrap;
}
.btn:disabled { opacity: .32; cursor: not-allowed; }
.btn-ghost {
  background: rgba(255,255,255,.05);
  border-color: rgba(217,182,95,.3);
  color: var(--cream);
}
.btn-ghost:not(:disabled):hover { background: rgba(217,182,95,.16); }

/* ----------------------- Dialogs ----------------------- */
.modal-card::-webkit-scrollbar { width: 7px; }
.modal-card::-webkit-scrollbar-track { background: rgba(0,0,0,.22); border-radius: 0 18px 18px 0; }
.modal-card::-webkit-scrollbar-thumb { background: rgba(217,182,95,.62); border-radius: 999px; }

/* ----------------------- Rule profiles ----------------------- */
.rule-profile-setting {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-line);
}
.rule-profile-picker { display: grid; gap: 7px; }
.rule-profile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(217,182,95,.2);
  border-radius: 8px;
  background: rgba(255,255,255,.028);
  color: rgba(244,239,226,.72);
  text-align: left;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.rule-profile:hover:not(:disabled) { border-color: rgba(217,182,95,.48); background: rgba(255,255,255,.055); color: var(--cream); }
.rule-profile.active {
  border-color: rgba(217,182,95,.78);
  background: rgba(217,182,95,.09);
  color: var(--gold-bright);
  box-shadow: inset 3px 0 0 var(--gold-soft);
}
.rule-profile:disabled { opacity: .4; cursor: not-allowed; }
.rule-profile-code {
  flex: 0 0 34px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217,182,95,.34);
  border-radius: 4px;
  background: rgba(0,0,0,.26);
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}
.rule-profile-copy { min-width: 0; display: grid; gap: 3px; }
.rule-profile-copy strong { font-size: 12px; font-weight: 600; letter-spacing: .35px; }
.rule-profile-copy small { color: rgba(244,239,226,.5); font-size: 10px; line-height: 1.35; }
.rule-profile.active .rule-profile-copy small { color: rgba(244,239,226,.68); }

/* ----------------------- Pace ----------------------- */
.seg-btn:disabled { opacity: .38; cursor: not-allowed; }
.animation-seg .seg-btn { padding-inline: 11px; font-size: 12px; }

/* ----------------------- Switches ----------------------- */
.switch { position: relative; width: 48px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: rgba(255,255,255,.15); border-radius: 999px; transition: .2s;
}
.slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: var(--cream); border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--gold-soft); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:focus-visible + .slider { outline: 3px solid var(--gold-bright); outline-offset: 3px; }

/* ----------------------- Sound levels ----------------------- */
.sound-settings {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-line);
}
.audio-mixer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  padding: 12px 14px;
  border: 1px solid rgba(217,182,95,.18);
  border-radius: 12px;
  background: rgba(0,0,0,.2);
  transition: opacity .2s ease;
}
.audio-mixer.muted { opacity: .52; }
.volume-control { min-width: 0; display: grid; gap: 7px; cursor: pointer; }
.volume-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(244,239,226,.72);
  font-size: 11px;
  line-height: 1.2;
}
.volume-head .volume-value { flex: 0 0 auto; color: var(--gold-bright); font-size: 10px; font-variant-numeric: tabular-nums; }
.volume-slider {
  --fill: 100%;
  width: 100%;
  height: 16px;
  margin: 0;
  border: 0;
  outline-offset: 2px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.volume-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-soft) 0 var(--fill), rgba(255,255,255,.14) var(--fill) 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}
.volume-slider::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--gold-soft);
  box-shadow: 0 2px 5px rgba(0,0,0,.45);
}
.volume-slider::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--gold-soft); }
.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 2px 5px rgba(0,0,0,.45);
}

/* ----------------------- Hints, play money and the dialog foot ----------------------- */
.settings-hint {
  margin-top: -8px;
  padding-left: 10px;
  border-left: 2px solid rgba(217, 182, 95, .45);
  color: rgba(244, 239, 226, .58);
  font-size: 12px;
  line-height: 1.45;
}
.deposit-input {
  width: 96px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--cream);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .5px;
  -moz-appearance: textfield;
}
.deposit-input:disabled { color: rgba(244,239,226,.42); cursor: not-allowed; }
.preset-btn {
  flex: 1 1 0;
  min-width: 64px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(217,182,95,.3);
  color: var(--gold-bright);
  border-radius: 9px;
  padding: 8px 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  transition: .16s;
}
.preset-btn:not(:disabled):hover { background: rgba(217,182,95,.16); border-color: var(--gold); transform: translateY(-1px); }
.preset-btn:disabled { opacity: .42; cursor: not-allowed; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; }
