:root {
  --bg-0: #07110d;
  --bg-1: #0c1612;
  --bg-2: #15211b;

  --panel: rgba(14, 27, 21, 0.78);
  --panel-2: rgba(20, 34, 27, 0.88);
  --panel-3: rgba(10, 19, 15, 0.82);

  --stroke: rgba(122, 179, 145, 0.22);
  --stroke-strong: rgba(162, 207, 178, 0.34);

  --text: #e8e3d7;
  --text-dim: rgba(174, 183, 173, 0.88);
  --text-muted: rgba(157, 170, 161, 0.74);

  --emerald: #4aa57d;
  --emerald-2: #74c3a0;
  --emerald-soft: rgba(116, 195, 160, 0.28);

  --gold: #d7b26a;
  --gold-2: #b88e4f;

  --danger: #d98181;
  --danger-soft: rgba(217, 129, 129, 0.24);

  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --shadow-deep: 0 26px 60px rgba(0, 0, 0, 0.52);
  --shadow-soft: 0 14px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 0 1px rgba(142, 197, 166, 0.22), 0 0 32px rgba(78, 155, 121, 0.2);

  --font-main: "Space Grotesk", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-display: "Sora", "Space Grotesk", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  color: var(--text);
  background: var(--bg-0);
  overflow: hidden;
  font-family: var(--font-main);
  letter-spacing: 0.02em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  background-image:
    radial-gradient(rgba(230, 210, 173, 0.24) 0.45px, transparent 0.45px),
    radial-gradient(rgba(122, 179, 145, 0.18) 0.45px, transparent 0.45px);
  background-size: 5px 5px, 7px 7px;
  z-index: -1;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(980px 620px at 8% 10%, rgba(116, 195, 160, 0.16), transparent 64%),
    radial-gradient(880px 540px at 85% 14%, rgba(215, 178, 106, 0.1), transparent 66%),
    radial-gradient(1200px 700px at 50% -10%, rgba(38, 64, 51, 0.4), transparent 72%),
    linear-gradient(165deg, #182720 0%, #111d17 44%, #09120f 100%);
}

.wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.8vw, 22px);
}

.card {
  position: relative;
  width: min(1320px, 100%);
  height: min(96vh, 100%);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-xl);
  border: 1px solid var(--stroke);
  background:
    linear-gradient(180deg, rgba(30, 49, 40, 0.52) 0%, rgba(16, 27, 22, 0.82) 34%, rgba(10, 17, 14, 0.94) 100%),
    var(--panel);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(228, 217, 195, 0.08);
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(1.25);
  animation: cardIn 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.card::before {
  content: "";
  position: absolute;
  left: -15%;
  right: -15%;
  top: -140px;
  height: 260px;
  background:
    radial-gradient(closest-side, rgba(215, 178, 106, 0.16), transparent 72%),
    radial-gradient(closest-side, rgba(109, 171, 139, 0.18), transparent 78%);
  pointer-events: none;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.top {
  position: relative;
  z-index: 2;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(139, 184, 157, 0.18);
  background: linear-gradient(180deg, rgba(24, 40, 32, 0.9), rgba(14, 23, 19, 0.72));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 22px;
}

.title {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}

.h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.32rem, 1.75vw, 1.68rem);
  line-height: 1.08;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #f4ecdc 0%, #deceb1 68%, #cab794 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-dim);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 500;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  max-width: min(100%, 920px);
}

.controlsPrimary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.inlineDetails {
  position: relative;
  display: flex;
  align-items: center;
}

.inlineDetails > summary {
  list-style: none;
}

.inlineDetails > summary::-webkit-details-marker {
  display: none;
}

.inlineDetails > summary::after {
  content: "v";
  margin-left: 8px;
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.78;
  transition: transform 140ms ease;
}

.inlineDetails[open] > summary::after {
  transform: rotate(180deg);
}

.inlineDetails[open] > summary {
  border-color: rgba(185, 151, 93, 0.38);
  background: rgba(31, 39, 31, 0.88);
}

.inlinePanel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  width: max-content;
  max-width: min(90vw, 440px);
  padding: 9px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(147, 175, 152, 0.28);
  background: linear-gradient(180deg, rgba(26, 37, 30, 0.96), rgba(16, 24, 20, 0.94));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(216, 179, 106, 0.08);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(141, 176, 152, 0.28);
  background: linear-gradient(180deg, rgba(30, 47, 38, 0.84), rgba(16, 26, 22, 0.9));
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(235, 221, 194, 0.08);
  user-select: none;
}

.loginPill {
  margin-right: 0;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 2px rgba(217, 129, 129, 0.18), 0 0 8px rgba(217, 129, 129, 0.4);
  transition: all 160ms ease;
}

.dot.ok {
  background: var(--emerald-2);
  box-shadow: 0 0 0 2px rgba(116, 195, 160, 0.2), 0 0 10px rgba(116, 195, 160, 0.42);
}

.dot.warn {
  background: var(--gold);
  box-shadow: 0 0 0 2px rgba(215, 178, 106, 0.2), 0 0 8px rgba(215, 178, 106, 0.38);
}

.btn {
  height: 38px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(126, 160, 137, 0.3);
  background: linear-gradient(180deg, rgba(34, 53, 43, 0.88), rgba(19, 30, 24, 0.92));
  color: #e6dfd0;
  font-family: var(--font-main);
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(236, 224, 197, 0.08);
  transition: transform 150ms ease, border-color 150ms ease, filter 150ms ease, background 180ms ease, opacity 150ms ease;
}

.btn:hover {
  border-color: rgba(170, 199, 179, 0.42);
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
}

.btn:focus-visible {
  outline: none;
  border-color: rgba(214, 187, 135, 0.75);
  box-shadow: 0 0 0 2px rgba(180, 141, 78, 0.26), 0 0 0 4px rgba(53, 69, 55, 0.58);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  filter: none;
}

.btnGold {
  border-color: rgba(215, 178, 106, 0.82);
  background: linear-gradient(145deg, #e1c086 0%, #b88f50 100%);
  color: #2d2011;
  box-shadow: 0 10px 20px rgba(82, 60, 30, 0.34), inset 0 1px 0 rgba(249, 231, 191, 0.34);
}

.btnPine {
  border-color: rgba(103, 173, 136, 0.82);
  background: linear-gradient(145deg, #4e9f7a 0%, #326d54 100%);
  color: #edf3ea;
  box-shadow: 0 10px 20px rgba(24, 63, 46, 0.34), inset 0 1px 0 rgba(195, 228, 210, 0.2);
}

.btnGhost {
  background: rgba(20, 31, 25, 0.74);
  border-color: rgba(120, 148, 129, 0.28);
  color: #cfd7cc;
  box-shadow: none;
}

#btnResync,
#btnReload,
#btnCopyRoom,
#btnSlotsToggle,
#btnObs {
  background: linear-gradient(180deg, rgba(29, 44, 36, 0.88), rgba(17, 26, 22, 0.94));
  border-color: rgba(118, 144, 127, 0.32);
  color: #d4dbd1;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.24);
}

#btnAuto {
  box-shadow: 0 10px 20px rgba(82, 60, 30, 0.32), inset 0 1px 0 rgba(251, 234, 196, 0.36);
}

#btnJoin {
  border-color: rgba(132, 204, 165, 0.84);
  background: linear-gradient(145deg, #68b28d 0%, #3e7d5f 100%);
  color: #f4fbf6;
  box-shadow: 0 12px 24px rgba(31, 74, 55, 0.36), 0 0 0 1px rgba(146, 213, 181, 0.26);
}

.hiddenInline {
  display: none;
}

.body {
  flex: 1;
  min-height: 0;
  padding: 18px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.infoRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(129, 165, 141, 0.28);
  background: linear-gradient(105deg, rgba(41, 63, 51, 0.68), rgba(20, 31, 26, 0.84));
  box-shadow: inset 0 0 0 1px rgba(216, 179, 106, 0.09), var(--shadow-soft);
}

.infoText .headline {
  margin: 0 0 4px;
  color: #e4dccd;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: clamp(1.02rem, 1.3vw, 1.22rem);
  text-transform: none;
}

.infoText .desc {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.rightActions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.kpi {
  border: 1px solid rgba(127, 161, 139, 0.24);
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(34, 51, 42, 0.8), rgba(17, 26, 21, 0.9));
  padding: 10px 12px;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(236, 220, 191, 0.06);
}

.kpi .kLabel {
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.kpi .kValue {
  font-size: 0.98rem;
  line-height: 1.16;
  letter-spacing: 0.02em;
  font-weight: 700;
  color: var(--text);
}

.kpi.ok {
  border-color: rgba(114, 190, 153, 0.42);
  box-shadow: var(--shadow-glow);
}

.kpi.ok .kValue {
  color: #8fd2b0;
}

.kpi.warn .kValue {
  color: #e3c486;
}

.kpi.bad {
  border-color: rgba(207, 131, 131, 0.42);
  box-shadow: 0 0 0 1px rgba(207, 131, 131, 0.2), 0 0 24px rgba(181, 115, 115, 0.16);
}

.kpi.bad .kValue {
  color: #ffb0b0;
}

.camsStage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.camsScroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 177, 152, 0.56) rgba(10, 18, 14, 0.64);
}

.camsScroll::-webkit-scrollbar {
  width: 8px;
}

.camsScroll::-webkit-scrollbar-track {
  background: rgba(10, 18, 14, 0.62);
  border-radius: 999px;
}

.camsScroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(142, 182, 157, 0.78), rgba(66, 107, 85, 0.84));
  border-radius: 999px;
}

.sectionLabel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  padding: 0 2px 8px;
  border-bottom: 1px solid rgba(168, 146, 99, 0.2);
  color: #d8bc88;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
}

.sectionLabel small {
  color: var(--text-muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.playersGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.camBox,
.tile {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius-md) + 2px);
  overflow: hidden;
  border: 1px solid rgba(131, 163, 142, 0.28);
  background: linear-gradient(180deg, #17241e 0%, #0d1613 100%);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(236, 220, 191, 0.07);
  transition: transform 190ms ease, border-color 190ms ease, box-shadow 190ms ease;
  animation: tileIn 340ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.tile::before,
.camBox::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(216, 179, 106, 0.09), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 44%);
  z-index: 1;
}

@keyframes tileIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (hover: hover) {
  .tile:hover,
  .camBox:hover {
    transform: translateY(-1px);
    border-color: rgba(175, 198, 176, 0.42);
    box-shadow: 0 0 0 1px rgba(151, 180, 161, 0.24), 0 16px 28px rgba(0, 0, 0, 0.34);
  }
}

.tile.me {
  border-color: rgba(129, 202, 166, 0.78);
  box-shadow: 0 0 0 1px rgba(129, 202, 166, 0.42), 0 0 24px rgba(91, 157, 125, 0.2), 0 12px 24px rgba(0, 0, 0, 0.3);
}

.camBox iframe,
.tile iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #050908;
}

.camEmpty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
  background:
    radial-gradient(120% 85% at 50% 0%, rgba(215, 178, 106, 0.14), transparent 66%),
    linear-gradient(180deg, #1a2822 0%, #0f1714 100%);
  color: rgba(224, 218, 205, 0.72);
}

.camEmpty .t {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: rgba(219, 204, 175, 0.72);
}

.camEmpty .s {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: rgba(178, 183, 174, 0.72);
}

.tagBar {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.nameTag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(204, 169, 103, 0.45);
  background: linear-gradient(180deg, rgba(41, 34, 23, 0.9), rgba(24, 22, 17, 0.9));
  color: #e6cf9f;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.36);
}

.miniDot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.miniDot.live {
  background: #8eccad;
  box-shadow: 0 0 0 2px rgba(142, 204, 173, 0.2), 0 0 9px rgba(142, 204, 173, 0.42);
}

.miniDot.off {
  background: #d38e8e;
  box-shadow: 0 0 0 2px rgba(211, 142, 142, 0.2), 0 0 8px rgba(211, 142, 142, 0.36);
}

.rightTags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
}

.readyTag {
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(140, 170, 149, 0.28);
  background: rgba(18, 27, 22, 0.86);
  color: rgba(193, 204, 194, 0.82);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.readyTag.on {
  border-color: rgba(124, 195, 160, 0.78);
  background: linear-gradient(180deg, rgba(78, 151, 117, 0.9), rgba(47, 96, 73, 0.92));
  color: #edf5ef;
  box-shadow: 0 0 0 1px rgba(124, 195, 160, 0.25), 0 0 14px rgba(88, 152, 121, 0.26);
}

.readyTag.off {
  color: rgba(190, 219, 203, 0.72);
}

.hintTag {
  min-height: 18px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(141, 171, 150, 0.24);
  background: rgba(18, 26, 22, 0.82);
  color: rgba(190, 198, 188, 0.82);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

#modBox {
  border-color: rgba(211, 178, 113, 0.54);
  box-shadow: 0 0 0 1px rgba(211, 178, 113, 0.24), 0 18px 34px rgba(0, 0, 0, 0.34), 0 0 30px rgba(154, 125, 74, 0.14);
}

#modBox .nameTag {
  border-color: rgba(143, 199, 169, 0.62);
  color: #dfe8dc;
  background: linear-gradient(180deg, rgba(31, 56, 45, 0.92), rgba(17, 31, 25, 0.92));
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 9999;
  transform: translateX(-50%);
  display: none;
  max-width: min(90vw, 760px);
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(175, 152, 108, 0.52);
  background: linear-gradient(180deg, rgba(39, 45, 34, 0.94), rgba(22, 25, 20, 0.96));
  color: #ece3d3;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.44), 0 0 24px rgba(170, 140, 89, 0.18);
  animation: toastIn 240ms ease-out;
  text-align: center;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

body.obs .wrap {
  padding: 0;
}

body.obs .card {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.obs .top,
body.obs .infoRow,
body.obs .sectionLabel,
body.obs .kpis {
  display: none;
}

body.obs .body {
  padding: 0;
  gap: 0;
}

body.obs .camsScroll {
  display: grid;
  grid-template-columns: 35% 65%;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

body.obs #modBox {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  margin: 0;
  border: 2px solid rgba(210, 177, 111, 0.86);
  box-shadow: none;
}

body.obs .playersGrid {
  margin: 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  align-content: start;
}

body.obs .tile {
  border: 2px solid rgba(151, 182, 161, 0.34);
  box-shadow: none;
}

.devPanel {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(127, 157, 138, 0.24);
  background: linear-gradient(180deg, rgba(25, 36, 30, 0.78), rgba(14, 21, 18, 0.84));
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  color: #d7d0c2;
}

body.debug .devPanel {
  display: block;
}

code {
  color: #ddbf85;
}

body:not(.obs) .camsStage {
  overflow: visible;
}

body:not(.obs) .camsScroll {
  display: grid;
  grid-template-columns: minmax(300px, 36%) minmax(0, 64%);
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  overflow: visible;
  padding: 6px;
}

body:not(.obs) #modLabel {
  grid-column: 1;
  grid-row: 1;
  margin: 0 0 8px;
}

body:not(.obs) #modBox {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  max-width: 560px;
  margin-inline: auto;
}

body:not(.obs) #playersLabel {
  grid-column: 2;
  grid-row: 1;
  margin: 0 0 8px;
}

body:not(.obs) #playersGrid {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  align-content: start;
}

body:not(.obs) .devPanel {
  grid-column: 2;
  grid-row: 3;
  max-height: 180px;
  overflow: auto;
}

@media (max-width: 1200px) {
  body:not(.obs) #playersGrid {
    grid-template-columns: repeat(auto-fit, minmax(174px, 1fr));
  }
}

@media (max-width: 1100px) {
  .top {
    flex-direction: column;
    align-items: stretch;
  }

  .controls,
  .controlsPrimary,
  .rightActions {
    justify-content: flex-start;
  }

  .inlineDetails {
    width: 100%;
  }

  .inlinePanel {
    left: 0;
    right: auto;
  }

  .infoRow {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 1000px) {
  body:not(.obs) .camsScroll {
    display: block;
    overflow-y: auto;
    padding-right: 8px;
  }

  body:not(.obs) #modBox {
    max-width: 760px;
  }

  body:not(.obs) #modLabel,
  body:not(.obs) #playersLabel {
    margin: 18px 0 9px;
  }

  body:not(.obs) #playersGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpis {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 8px;
  }

  .top {
    padding: 13px 14px;
  }

  .body {
    padding: 12px 14px 14px;
  }

  .btn {
    height: 35px;
    padding: 0 11px;
    font-size: 0.68rem;
  }

  .pill {
    height: 34px;
    font-size: 0.68rem;
    padding: 0 11px;
  }

  .h1 {
    font-size: 1.2rem;
  }

  .playersGrid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .inlineDetails {
    width: 100%;
  }

  .inlineDetails > summary {
    width: 100%;
  }

  .inlinePanel {
    position: static;
    width: 100%;
    max-width: none;
    margin-top: 8px;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .card {
    border-radius: 18px;
  }

  .sectionLabel {
    font-size: 0.68rem;
    letter-spacing: 0.11em;
  }

  .infoText .desc {
    font-size: 0.8rem;
  }

  #toast {
    font-size: 0.76rem;
    padding: 10px 14px;
  }
}
