/* Tournament spell controls share the live theme's roles and API-backed markup. */
body.tournament-ui .tournament-spellbook-page,
body.tournament-ui .tournament-sorcery-page {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--panel-2);
  color: var(--text);
  font-size: 1rem;
}
body.tournament-ui .tournament-spellbook-page > header {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
body.tournament-ui .tournament-spellbook-page h2,
body.tournament-ui .tournament-sorcery-page h2 {
  margin: 0 0 .75rem;
  font-size: 1.5rem;
  color: var(--text);
}
body.tournament-ui .tournament-spell-resources {
  margin: .75rem 0;
  color: var(--text);
  font-size: 1rem;
}
body.tournament-ui .tournament-spell-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .75rem 0 1rem;
}
body.tournament-ui .tournament-spell-tabs button {
  flex: 1 1 8rem;
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  color: var(--text) !important;
  background: var(--panel) !important;
  font-size: 1rem;
}
body.tournament-ui .tournament-spell-tabs button.active {
  border-color: var(--accent);
  color: var(--bg) !important;
  background: var(--accent) !important;
}
body.tournament-ui .tournament-spell-actions,
body.tournament-ui .tournament-sorcery-page .spell-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: .5rem;
  min-width: 0;
}
body.tournament-ui .tournament-spell-actions > .tournament-spell-tile,
body.tournament-ui .tournament-sorcery-page [data-pill="arcc"] {
  display: grid;
  align-content: center;
  justify-content: center;
  gap: .3rem;
  min-width: 0;
  min-height: 4.5rem;
  width: 100%;
  padding: .6rem .35rem;
  border: 1px solid var(--accent) !important;
  border-radius: 1.4rem;
  background: var(--panel) !important;
  color: var(--text) !important;
  font: 400 1.2rem/1.25 var(--font);
  text-align: center;
  text-transform: none;
  overflow-wrap: anywhere;
  box-shadow: none;
}
body.tournament-ui .tournament-spell-tile b {
  font-weight: 400;
}
body.tournament-ui .tournament-spell-tile span,
body.tournament-ui .tournament-sorcery-page [data-pill="arcc"] span {
  color: inherit;
  font-size: 1rem;
  text-align: center;
}
body.tournament-ui .tournament-spell-actions > .tournament-spell-tile.active,
body.tournament-ui .tournament-sorcery-page [data-pill="arcc"].pill-asking {
  color: var(--bg) !important;
  background: var(--accent) !important;
}
body.tournament-ui .tournament-spell-detail,
body.tournament-ui .tournament-sorcery-page .spell-ask-slot {
  grid-column: 1 / -1;
  min-width: 0;
  margin: .25rem 0 .5rem;
  padding: .5rem .75rem;
  border-left: .2rem solid var(--accent);
  overflow-wrap: anywhere;
}
body.tournament-ui .tournament-sorcery-page .spell-ask-slot:empty {
  display: none;
}
body.tournament-ui .tournament-spell-detail h3,
body.tournament-ui .tournament-spell-detail h4 {
  margin: 0 0 .5rem;
  font-size: 1.25rem;
  color: var(--text);
}
body.tournament-ui .tournament-spell-detail p {
  margin: .4rem 0;
  font-size: 1rem;
  line-height: 1.45;
}
body.tournament-ui .tournament-spell-detail .spell-ask {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}
body.tournament-ui .tournament-spell-detail button,
body.tournament-ui .tournament-spellbook-page > [data-tournament-crystal-enemy],
body.tournament-ui .tournament-spell-section > button[data-tournament-cast] {
  width: auto;
  min-height: 2.75rem;
  margin-top: .5rem;
  padding: .6rem .85rem;
  border: 1px solid var(--accent) !important;
  border-radius: .4rem;
  background: var(--accent) !important;
  color: var(--bg) !important;
  font-size: 1rem;
  font-weight: 700;
}
body.tournament-ui .tournament-spell-detail button:disabled {
  opacity: .6;
  cursor: not-allowed;
}
body.tournament-ui .tournament-spell-detail [data-spell-ask-cancel] {
  color: var(--text) !important;
  background: var(--panel) !important;
}
body.tournament-ui .tournament-spellbook-page label {
  display: grid;
  gap: .35rem;
  margin: .75rem 0;
  font-size: 1rem;
}
body.tournament-ui .tournament-spellbook-page select,
body.tournament-ui .tournament-sorcery-page select,
body.tournament-ui .tournament-sorcery-page input {
  min-width: 0;
  min-height: 2.75rem;
  max-width: 100%;
  font-size: 16px;
}
body.tournament-ui .tournament-sorcery-page #arc-targets > div {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: .75rem 0;
}
body.tournament-ui .tournament-sorcery-page [data-bubble="arcc"] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .2rem;
  min-width: 0;
  min-height: 2.75rem;
  font-size: 1rem;
  text-align: left;
}
body.tournament-ui .tournament-sorcery-page [data-bubble="arcc"] > b,
body.tournament-ui .tournament-sorcery-page [data-bubble="arcc"] > span {
  grid-column: auto;
  grid-row: auto;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  text-align: left;
  overflow-wrap: break-word;
  word-break: normal;
}
body.tournament-ui .tournament-sorcery-page #arc-result {
  grid-column: 1 / -1;
  min-width: 0;
  margin: .75rem 0;
}
body.tournament-ui .tournament-spellbook-page summary,
body.tournament-ui .tournament-sorcery-page summary {
  min-height: 2.75rem;
  padding-block: .65rem;
  font-size: 1rem;
}
body.tournament-ui .tournament-spellbook-page :focus-visible,
body.tournament-ui .tournament-sorcery-page :focus-visible {
  outline: .2rem solid var(--accent);
  outline-offset: .2rem;
}
@media (min-width: 760px) {
  body.tournament-ui .tournament-spellbook-page,
  body.tournament-ui .tournament-sorcery-page {
    padding: 1.5rem;
  }
}
