@import url("../../assets/css/tokens.css");

html,
body {
  margin: 0;
  background: transparent;
  color: #1d2129;
}

.e26-rbar {
  --rbar-coal: #df3232;
  --rbar-opp: #0361fc;
  --rbar-other: #696c75;
  --rbar-text: #1d2129;
  --rbar-muted: #696c75;
  --rbar-warn: #fb6300;
  --rbar-ok: #009ffb;
  --rbar-on: rgba(0, 159, 251, 0.15);
  --rbar-seat-empty: #000;
  --rbar-seat-empty-opacity: 0.3;
  box-sizing: border-box;
  width: 100%;
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  color: var(--rbar-text);
  font-family: var(--e26-font);
  direction: rtl;
}

.e26-rbar--boot .e26-rbar__chart,
.e26-rbar--boot .e26-rbar__legend,
.e26-rbar--boot .e26-rbar__game {
  visibility: hidden;
}

.e26-rbar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}

.e26-rbar__brand {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.e26-rbar__brand img {
  display: block;
  width: 20px;
  height: 20px;
}

.e26-rbar__brand h1 {
  margin: 0;
  font-family: var(--e26-font);
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: -0.16px;
}

.e26-rbar__meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  min-width: 0;
  color: var(--rbar-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 13px;
  white-space: nowrap;
}

.e26-rbar__chart {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.e26-rbar__party {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: right;
}

.e26-rbar__party.is-on {
  background: var(--rbar-on);
}

.e26-rbar__party.is-disabled {
  opacity: 0.3;
  cursor: default;
}

.e26-rbar__party.is-disabled .e26-rbar__seats {
  color: var(--rbar-muted);
}

.e26-rbar__party.is-disabled .e26-rbar__fill {
  background: var(--rbar-muted);
}

.e26-rbar__party:focus-visible {
  outline: 2px solid var(--rbar-opp);
  outline-offset: 1px;
}

.e26-rbar__party[data-bloc="A"] { --bar: var(--rbar-coal); }
.e26-rbar__party[data-bloc="B"] { --bar: var(--rbar-opp); }
.e26-rbar__party[data-bloc="other"] { --bar: var(--rbar-other); }

.e26-rbar__name {
  width: 100px;
  flex: 0 0 100px;
  color: var(--rbar-text);
  font-size: 13px;
  font-weight: 400;
  line-height: 14px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.e26-rbar__fill {
  display: block;
  width: var(--bar-size, 8px);
  height: 15px;
  flex: 0 0 auto;
  background: var(--bar, var(--rbar-other));
  border-radius: 4px 0 0 4px;
}

.e26-rbar__seats {
  flex: 0 0 auto;
  min-width: 16px;
  color: var(--bar, var(--rbar-other));
  font-size: 13px;
  font-weight: 700;
  line-height: 14px;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.e26-rbar__legend {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.e26-rbar__key {
  display: flex;
  align-items: center;
  gap: 2.45px;
  height: 22px;
  margin: 0;
  padding: 4px 4px 4px 8px;
  border: 0;
  box-sizing: border-box;
  background: #f2f6fa;
  border-radius: 4px;
  color: var(--rbar-text);
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 12px;
  cursor: pointer;
}

.e26-rbar__key[data-bloc="A"] { --key-color: #df3232; }
.e26-rbar__key[data-bloc="B"] { --key-color: #0361fc; }
.e26-rbar__key[data-bloc="other"] { --key-color: var(--rbar-other); }

.e26-rbar__key.is-on {
  box-shadow: inset 0 0 0 1px var(--key-color);
}

.e26-rbar__swatch { display: none; }

.e26-rbar__key-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 20px;
  height: 14px;
  margin: 0;
  padding: 0;
  direction: ltr;
  background: var(--key-color);
  color: #f2f6fa;
  border-radius: 4px 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
}

.e26-rbar__key-n[data-len="1"] {
  width: 14px;
}

.e26-rbar__key-n[data-len="3"] {
  width: auto;
  min-width: 20px;
  padding: 0 2px;
}

.e26-rbar__game {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  justify-items: start;
  gap: 16px;
  min-height: 114px;
}

.e26-rbar__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
}

.e26-rbar__lead h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
}

.e26-rbar__hint {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
}

.e26-rbar__status {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--rbar-warn);
  font-size: 14px;
  font-weight: 500;
  line-height: 17px;
  white-space: nowrap;
}

.e26-rbar__status.is-ok { color: var(--rbar-ok); }

.e26-rbar__foot {
  position: relative;
}

.e26-rbar__status-icon {
  display: block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  fill: currentColor;
}

.e26-rbar__status-icon[hidden] {
  display: none !important;
}

.e26-rbar__plenum {
  position: relative;
  width: 122px;
  height: 114px;
  flex: 0 0 122px;
}

.e26-rbar__art,
.e26-rbar__art svg {
  display: block;
  width: 122px;
  height: 114px;
}

.e26-rbar__count {
  position: absolute;
  left: 0;
  right: 0;
  top: 54%;
  margin: 0;
  transform: translateY(-50%);
  color: var(--rbar-opp);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -1px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.e26-rbar__count.is-zero { color: var(--rbar-muted); }

.e26-rbar__reset {
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-start: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rbar-ok);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
  cursor: pointer;
}

.e26-rbar__reset[hidden] {
  display: none !important;
}

.e26-rbar__reset-icon {
  display: block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

.e26-rbar__error {
  margin: 0;
  color: var(--rbar-muted);
  font-size: 14px;
  line-height: 18px;
}

@media (min-width: 720px) {
  .e26-rbar {
    direction: ltr;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: 22px minmax(0, 1fr);
    grid-template-areas:
      "game top"
      "game chart";
    align-items: stretch;
    width: 1240px;
    max-width: 100%;
    height: 210px;
    margin-inline-start: 0;
    margin-inline-end: auto;
    position: relative;
    padding: 0 2px;
    gap: 0 24px;
    overflow: hidden;
  }

  .e26-rbar::after {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 314px;
    width: 1px;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
  }

  .e26-rbar__top,
  .e26-rbar__chart,
  .e26-rbar__legend,
  .e26-rbar__game {
    direction: rtl;
  }

  .e26-rbar__top {
    grid-area: top;
    justify-self: end;
    align-self: center;
  }

  .e26-rbar__brand img {
    width: 15px;
    height: 15px;
  }

  .e26-rbar__brand h1 {
    font-size: 16px;
    line-height: 18px;
  }

  .e26-rbar__chart {
    grid-area: chart;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px;
    align-self: stretch;
    height: auto;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .e26-rbar__party {
    flex: 0 0 68px;
    align-self: flex-end;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    width: 68px;
    height: auto;
    gap: 4px;
    padding: 4px 0;
    border-radius: 8px;
  }

  .e26-rbar__seats {
    order: 1;
    min-width: 0;
    font-size: 16px;
    line-height: 18px;
    text-align: center;
  }

  .e26-rbar__fill {
    order: 2;
    width: 40px;
    height: var(--bar-size, 8px);
    border-radius: 8px 8px 0 0;
  }

  .e26-rbar__name {
    order: 3;
    width: 68px;
    height: 28px;
    flex-basis: auto;
    overflow: hidden;
    white-space: normal;
    text-overflow: clip;
    font-size: 12px;
    line-height: 14px;
    text-align: center;
  }

  .e26-rbar__party.is-on .e26-rbar__name {
    font-weight: 700;
  }

  .e26-rbar__legend {
    grid-area: top;
    justify-self: start;
    align-self: center;
    z-index: 1;
    gap: 8px;
  }

  .e26-rbar__game {
    grid-area: game;
    align-self: center;
    min-height: 114px;
    gap: 12px;
  }

  .e26-rbar__copy {
    width: 135px;
    flex: 0 0 135px;
  }

  .e26-rbar__lead h2 {
    font-size: 16px;
  }

  .e26-rbar__hint {
    font-size: 13px;
    line-height: 16px;
  }

  .e26-rbar__status {
    font-size: 13px;
  }
}

@media (max-width: 719px) and (prefers-color-scheme: dark) {
  .e26-rbar {
    background: #1c1c1e;
    color: #f2f6fa;
    --rbar-text: #f2f6fa;
    --rbar-muted: #a3a7b0;
    --rbar-other: #d3d9e6;
    --rbar-on: rgba(0, 159, 251, 0.15);
    --rbar-seat-empty: #fff;
    --rbar-seat-empty-opacity: 0.38;
  }

  .e26-rbar__key {
    background: #2c2c2e;
  }
}
