@import url("../../assets/css/tokens.css");

html,
body {
  margin: 0;
  background: transparent;
  color: #1d2129;
}

.e26-smp,
.e26-smp * {
  box-sizing: border-box;
}

.e26-smp {
  --smp-coal: #df3232;
  --smp-opp: #0361fc;
  --smp-other: #696c75;
  --smp-text: #1d2129;
  --smp-muted: #696c75;
  --smp-warn: #fb6300;
  --smp-ok: #009ffb;
  --smp-on: rgba(0, 159, 251, 0.15);
  --smp-chip: #f2f6fa;
  --smp-seat-empty: #000;
  --smp-seat-empty-opacity: 0.3;
  --smp-track: 36px;
  width: 100%;
  min-height: 0;
  padding: 0 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  color: var(--smp-text);
  font-family: var(--e26-font);
  direction: rtl;
}

.e26-smp--boot .e26-smp__chart,
.e26-smp--boot .e26-smp__legend,
.e26-smp--boot .e26-smp__game,
.e26-smp--boot .e26-smp__filters {
  visibility: hidden;
}

.e26-smp__top {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.e26-smp__brandline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 22px;
}

.e26-smp__brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.e26-smp__brand > img {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.e26-smp__brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: -0.16px;
}

.e26-smp__title-d {
  display: none;
}

.e26-smp__updated {
  margin: 0;
  color: var(--smp-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 16px;
  white-space: nowrap;
}

.e26-smp__info {
  display: inline-flex;
  flex: 0 0 auto;
}

.e26-smp__info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.e26-smp__info-btn img {
  display: block;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  object-fit: contain;
}

.e26-smp__info-btn:focus-visible,
.e26-smp__tip-x:focus-visible {
  outline: 1px solid #0361fc;
  outline-offset: 2px;
}

.e26-smp__tip {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  inset-inline-start: 0;
  z-index: 3;
  align-items: flex-start;
  gap: 8px;
  width: 270px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  background: #f2f6fa;
  border: 1px solid #dde3ed;
  border-radius: 4px;
  box-shadow: 0 8px 10px -4px rgba(0, 0, 0, 0.15);
}

.e26-smp__info.is-open .e26-smp__tip,
.e26-smp__info:hover:not(.is-dismissed) .e26-smp__tip,
.e26-smp__info:not(.is-dismissed) .e26-smp__info-btn:focus-visible + .e26-smp__tip {
  display: flex;
}

.e26-smp__tip p {
  flex: 1 1 auto;
  margin: 0;
  color: #000;
  font-size: 12px;
  font-weight: 400;
  line-height: 15px;
  text-align: right;
}

.e26-smp__tip-x {
  display: inline-flex;
  flex: 0 0 12px;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1d2129;
  cursor: pointer;
}

.e26-smp__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 0;
}

.e26-smp__filter-label {
  color: #000;
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  white-space: nowrap;
}

.e26-smp__chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 4px 4px 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--smp-chip);
  color: #000;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  white-space: nowrap;
  cursor: pointer;
}

.e26-smp__chip.is-on {
  border-color: #696c75;
}

.e26-smp__chip:focus-visible {
  outline: 2px solid var(--smp-opp);
  outline-offset: 1px;
}

.e26-smp__marks {
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
}

.e26-smp__marks i {
  display: block;
  width: 6px;
  height: 12px;
  border-radius: 2px 2px 0 0;
}

.e26-smp__marks--one i {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.e26-smp__chart {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px 2px;
  min-width: 0;
  margin-block: 2px;
}

.e26-smp__party {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  width: calc((100% - 8px) / 5);
  margin: 0;
  padding: 16px 1px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.e26-smp__party.is-on {
  background: var(--smp-on);
}

.e26-smp__party:focus-visible {
  outline: 2px solid var(--smp-opp);
  outline-offset: 1px;
}

.e26-smp--all .e26-smp__party,
.e26-smp__party.is-disabled {
  cursor: default;
}

.e26-smp__party.is-disabled {
  opacity: 0.3;
}

.e26-smp__party.is-disabled .e26-smp__seats,
.e26-smp__col.is-disabled .e26-smp__seats {
  color: var(--smp-muted);
}

.e26-smp__party.is-disabled .e26-smp__fill,
.e26-smp__col.is-disabled .e26-smp__fill {
  background: var(--smp-muted);
}

.e26-smp__party:not(.is-disabled) .e26-smp__col.is-disabled {
  opacity: 0.3;
}

.e26-smp__party[data-bloc="A"] { --bar: var(--smp-coal); }
.e26-smp__party[data-bloc="B"] { --bar: var(--smp-opp); }
.e26-smp__party[data-bloc="other"] { --bar: var(--smp-other); }

.e26-smp__cols {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  width: 100%;
}

.e26-smp__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  width: 16px;
  flex: 0 0 16px;
}

.e26-smp__track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: var(--smp-track);
  overflow: visible;
}

.e26-smp__fill {
  position: relative;
  display: block;
  width: 28px;
  height: 4px;
  flex: 0 0 auto;
  background: var(--bar, var(--smp-other));
  border-radius: 4px 4px 0 0;
}

.e26-smp__col .e26-smp__fill {
  width: 16px;
}

.e26-smp__seats {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  z-index: 1;
  transform: translateX(-50%);
  color: var(--bar, var(--smp-other));
  font-size: 13px;
  font-weight: 700;
  line-height: 14px;
  letter-spacing: -0.5px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.e26-smp__col .e26-smp__seats {
  font-size: 11px;
  line-height: 12px;
}

.e26-smp__name {
  width: 100%;
  height: 26px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 400;
  line-height: 13px;
  text-align: center;
}

.e26-smp__party.is-on .e26-smp__name {
  font-weight: 700;
}

.e26-smp__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-height: 22px;
}

.e26-smp--all .e26-smp__legend {
  display: none;
}

.e26-smp__key {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  margin: 0;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: 4px;
  background: var(--smp-chip);
  color: var(--smp-text);
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 13px;
  cursor: pointer;
}

.e26-smp__key[data-bloc="A"] { --key-color: var(--smp-coal); }
.e26-smp__key[data-bloc="B"] { --key-color: var(--smp-opp); }
.e26-smp__key[data-bloc="other"] { --key-color: var(--smp-other); }

.e26-smp__key.is-on {
  box-shadow: inset 0 0 0 1px var(--key-color);
}

.e26-smp__key:focus-visible {
  outline: 2px solid var(--smp-opp);
  outline-offset: 1px;
}

.e26-smp__key-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 14px;
  padding: 0 2px;
  direction: ltr;
  background: var(--key-color);
  color: #f2f6fa;
  border-radius: 4px 4px 0 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.e26-smp__game {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  grid-template-areas:
    "plenum copy"
    "plenum foot";
  column-gap: 16px;
  row-gap: 4px;
  align-items: center;
  direction: ltr;
  min-height: 114px;
}

.e26-smp__copy,
.e26-smp__foot {
  direction: rtl;
  text-align: right;
}

.e26-smp__copy {
  grid-area: copy;
  align-self: end;
}

.e26-smp__foot {
  grid-area: foot;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.e26-smp__copy h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
}

.e26-smp__hint {
  margin: 4px 0 0;
  min-height: 36px;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
}

.e26-smp__plenum {
  grid-area: plenum;
  position: relative;
  width: 122px;
  height: 114px;
}

.e26-smp__art,
.e26-smp__art svg {
  display: block;
  width: 122px;
  height: 114px;
}

.e26-smp__count {
  position: absolute;
  left: 0;
  right: 0;
  top: 54%;
  margin: 0;
  transform: translateY(-50%);
  color: var(--smp-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-smp__count.is-zero {
  color: var(--smp-muted);
}

.e26-smp__status {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--smp-warn);
  font-size: 14px;
  font-weight: 500;
  line-height: 17px;
  white-space: nowrap;
}

.e26-smp__status.is-ok {
  color: var(--smp-ok);
}

.e26-smp__status-icon {
  display: block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  fill: currentColor;
}

.e26-smp__status-icon[hidden] {
  display: none !important;
}

.e26-smp__reset {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--smp-ok);
  transform: translateX(-50%);
  cursor: pointer;
}

.e26-smp__reset[hidden] {
  display: none !important;
}

.e26-smp__reset-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.e26-smp__error {
  margin: 0;
  color: var(--smp-muted);
  font-size: 14px;
  line-height: 18px;
}

@media (min-width: 720px) {
  .e26-smp {
    --smp-track: 96px;
    direction: ltr;
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    align-items: stretch;
    width: 1240px;
    max-width: 100%;
    height: 210px;
    min-height: 0;
    margin-inline-start: 0;
    margin-inline-end: auto;
    padding: 6px 8px 6px 4px;
    gap: 0 12px;
  }

  .e26-smp__main,
  .e26-smp__game {
    direction: rtl;
  }

  .e26-smp__main {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "brand filters legend"
      "chart chart chart";
    column-gap: 12px;
    row-gap: 4px;
    align-items: start;
    height: 100%;
    min-width: 0;
    min-height: 0;
  }

  .e26-smp__top {
    display: contents;
  }

  .e26-smp__brandline {
    grid-area: brand;
    width: auto;
    align-self: center;
  }

  .e26-smp__brand {
    z-index: 3;
  }

  .e26-smp__filters {
    grid-area: filters;
    width: auto;
    min-width: 0;
    min-height: 22px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-self: center;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .e26-smp__filters::-webkit-scrollbar {
    display: none;
  }

  .e26-smp__legend {
    grid-area: legend;
    flex-wrap: nowrap;
    min-height: 0;
    align-self: center;
  }

  .e26-smp__chart {
    grid-area: chart;
    align-self: stretch;
    margin-block: 0;
  }

  .e26-smp__title-m {
    display: none;
  }

  .e26-smp__title-d {
    display: inline;
  }

  .e26-smp__chart {
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 2px;
    height: 100%;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .e26-smp__party {
    flex: 1 1 0;
    justify-content: flex-start;
    gap: 4px;
    width: auto;
    height: 100%;
    min-width: 64px;
    max-width: 88px;
    padding: 4px 0;
  }

  .e26-smp__cols {
    flex: 1 1 auto;
    align-self: stretch;
    align-items: stretch;
    width: 100%;
    min-height: 0;
  }

  .e26-smp__col {
    align-self: stretch;
    justify-content: flex-start;
  }

  .e26-smp__track {
    margin-top: auto;
  }

  .e26-smp__party.is-on {
    background: transparent;
  }

  .e26-smp__party.is-on .e26-smp__fill {
    box-shadow: 0 0 0 6px var(--smp-on);
  }

  .e26-smp__fill {
    width: 40px;
  }

  .e26-smp__seats {
    font-size: 16px;
    line-height: 18px;
  }

  .e26-smp__name {
    height: 28px;
    font-size: 12px;
    line-height: 14px;
  }

  .e26-smp--all .e26-smp__party {
    flex: 0 0 80px;
    width: 80px;
    max-width: 80px;
  }

  .e26-smp--all .e26-smp__col {
    width: 20px;
    flex-basis: 20px;
  }

  .e26-smp--all .e26-smp__col .e26-smp__fill {
    width: 20px;
  }

  .e26-smp--all .e26-smp__col .e26-smp__seats {
    font-size: 13px;
    line-height: 15px;
  }

  .e26-smp__game {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 6px;
    min-height: 0;
    padding: 0 12px 0 4px;
    border-right: 1px solid rgba(0, 0, 0, 0.5);
    direction: rtl;
  }

  .e26-smp__copy,
  .e26-smp__foot,
  .e26-smp__plenum {
    grid-area: auto;
  }

  .e26-smp__copy,
  .e26-smp__foot,
  .e26-smp__hint,
  .e26-smp__status {
    text-align: center;
  }

  .e26-smp__copy {
    align-self: stretch;
  }

  .e26-smp__plenum {
    margin: 0 auto;
  }

  .e26-smp__hint,
  .e26-smp__status {
    font-size: 13px;
    line-height: 16px;
  }

  .e26-smp__hint {
    min-height: 32px;
  }

  .e26-smp__status {
    justify-content: center;
  }

  .e26-smp__foot {
    align-self: stretch;
    align-items: center;
  }
}

@media (max-width: 719px) and (prefers-color-scheme: dark) {
  .e26-smp {
    background: #1c1c1e;
    color: #f2f6fa;
    --smp-text: #f2f6fa;
    --smp-muted: #a3a7b0;
    --smp-other: #d3d9e6;
    --smp-on: rgba(0, 159, 251, 0.15);
    --smp-chip: #2c2c2e;
    --smp-seat-empty: #fff;
    --smp-seat-empty-opacity: 0.38;
  }

  .e26-smp__key {
    background: #2c2c2e;
  }

  .e26-smp__filter-label,
  .e26-smp__chip,
  .e26-smp__tip p,
  .e26-smp__tip-x {
    color: #f2f6fa;
  }

  .e26-smp__chip.is-on {
    border-color: #a3a7b0;
  }

  .e26-smp__tip {
    background: #2c2c2e;
    border-color: rgba(255, 255, 255, 0.16);
  }

  .e26-smp__info-btn img {
    filter: brightness(0) invert(1);
  }
}
