/* MtG Match Tracker - Single Player Page */

/* View Decks / View Matches buttons */
.mtgmt-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--30);
  justify-content: center;
  margin: var(--wp--preset--spacing--50) 0 var(--wp--preset--spacing--40);
}

.mtgmt-view-button {
  background-color: var(--mtgmt--color--white);
  border: 2px solid var(--mtgmt--color--blue);
  color: var(--mtgmt--color--gray-999);
  font-weight: 600;
  padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.mtgmt-view-button:hover {
  background-color: var(--mtgmt--color--white-hover);
  text-decoration: none;
}

.mtgmt-view-button:focus {
  outline: 2px dashed var(--mtgmt--color--blue-dark);
}

.mtgmt-view-button.is-active,
.mtgmt-view-button.is-active:hover,
.mtgmt-view-button.is-active:focus {
  background-color: var(--mtgmt--color--blue);
}

/* Panels: guard against theme styles overriding the hidden attribute */
.mtgmt-view-panel[hidden] {
  display: none;
}

/* Colors panel */
.mtgmt-colors-section {
  border: 4px solid var(--mtgmt--mana--red);
  margin-block: 1em;
  padding: 1em;

  @media screen and (max-width: 767px) {
    margin-inline: -1em;
    width: calc(100% + 2em);
  }
}

.mtgmt-colors-title {
  font-size: var(--wp--preset--font-size--large);
  margin-block: 0 var(--wp--preset--spacing--20);
  text-align: center;
}

/* Tabs within a Colors section */
.mtgmt-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--20);
  margin-block: 1em;
  justify-content: center;
}

.mtgmt-tab {
  background-color: var(--mtgmt--color--white);
  border: 2px solid var(--mtgmt--color--red);
  color: var(--wp--preset--color--contrast);
  cursor: pointer;
  font: inherit;
  font-size: var(--wp--preset--font-size--small);
  font-weight: 600;
  padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
}

.mtgmt-tab:hover {
  background-color: var(--mtgmt--color--white-hover);
}

.mtgmt-tab:focus {
  outline: 2px dashed var(--mtgmt--color--red-dark);
  outline-offset: 2px;
}

.mtgmt-tab[aria-selected="true"] {
  background-color: var(--mtgmt--mana--red);
}

/* Guard against theme styles overriding the hidden attribute */
.mtgmt-tab-panel[hidden] {
  display: none;
}

.mtgmt-colors-empty {
  color: var(--wp--preset--color--secondary);
  margin: 0;
}

/* Identity lists: icons, name, count */
.mtgmt-identity-list {
  display: grid;
  /* gap: var(--wp--preset--spacing--20); */
  list-style: none;
  margin: 0;
  padding: 0;
}

.mtgmt-identity-item {
  align-items: center;
  display: flex;
  gap: var(--wp--preset--spacing--20);
  padding-block: .25em;
}

.mtgmt-identity-item:nth-child(odd) {
  background-color: var(--wp--preset--color--neutral-light);
}

.mtgmt-identity-item .mtgmt-color-identity {
  font-size: var(--wp--preset--font-size--small);
  width: 6em;
  display: flex;
  justify-content: flex-end;

  @media screen and (min-width: 768px) {
    font-size: var(--wp--preset--font-size--large);
  }
}

.mtgmt-identity-label {
  font-weight: 600;
}

.mtgmt-identity-count {
  font-weight: 700;
  margin-inline-start: auto;
  padding-inline-end: 2em;
}

/* Horizontal bar chart: one row per color, WUBRG */
.mtgmt-bar-chart {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mtgmt-bar-row {
  align-items: center;
  display: grid;
  gap: var(--wp--preset--spacing--30);
  grid-template-columns: minmax(6.5em, max-content) 1fr;
  padding-block: var(--wp--preset--spacing--20);
}

.mtgmt-bar-label {
  align-items: center;
  display: flex;
  font-weight: 600;
  gap: var(--wp--preset--spacing--20);
}

.mtgmt-bar-track {
  align-items: center;
  display: flex;
  gap: var(--wp--preset--spacing--20);
  min-width: 0;
}

.mtgmt-bar {
  border: 1px solid var(--wp--preset--color--contrast);
  border-radius: 0 4px 4px 0;
  height: 1.25em;
  min-width: 2px;
}

.mtgmt-bar-value {
  color: var(--wp--preset--color--contrast);
  font-weight: 700;
}

/* Bar fills are the fixed Magic mana colors (see variables.css) */
.mtgmt-bar--w {
  background-color: var(--mtgmt--mana--white);
}

.mtgmt-bar--u {
  background-color: var(--mtgmt--mana--blue);
}

.mtgmt-bar--b {
  background-color: var(--mtgmt--mana--black);
}

.mtgmt-bar--r {
  background-color: var(--mtgmt--mana--red);
}

.mtgmt-bar--g {
  background-color: var(--mtgmt--mana--green);
}

.mtgmt-bar--c {
  background-color: var(--mtgmt--mana--colorless);
}
