/* QL monster combat sheet — dark GM theme (matches gm-quest / between-expeditions) */

.mcs-roster {
  background: rgba(14, 17, 22, 0.94);
  border: 1px solid rgba(255, 183, 0, 0.28);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  margin-bottom: 0.5rem;
  overflow: hidden;
  color: #f4f1ea;
}

.mcs-roster-head {
  background: rgba(0, 0, 0, 0.42);
  color: #ffb300;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  border-bottom: 1px solid rgba(255, 183, 0, 0.28);
}

.mcs-roster-head .mcs-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.68rem;
  color: #c8cbd1;
  opacity: 1;
}

.mcs-roster-body {
  display: block;
}

.mcs-roster-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.22rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  background: transparent;
  color: #f4f1ea;
}

.mcs-roster-name {
  font-weight: 700;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f4f1ea;
}

.mcs-roster-qty {
  color: #aeb3bc;
  font-size: 0.72rem;
  white-space: nowrap;
}

.mcs-roster-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.mcs-roster-empty {
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
  color: #aeb3bc;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 900px) {
  .mcs-roster-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .mcs-roster-body {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.mcs-combat-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 700px) {
  .mcs-combat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .mcs-combat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.mcs-card {
  position: relative;
  background: rgba(14, 17, 22, 0.94);
  border: 1px solid rgba(255, 183, 0, 0.28);
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  color: #f4f1ea;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.mcs-card.is-dead {
  opacity: 0.5;
  cursor: pointer;
  outline: 1px dashed rgba(255, 183, 0, 0.35);
}

.mcs-card.is-dead:hover {
  opacity: 0.72;
  outline-color: #4a8950;
}

.mcs-revive-hint {
  font-size: 0.72rem;
  color: #b8f4bd;
  font-weight: 600;
  text-align: center;
  padding: 0.2rem 0.35rem;
  background: rgba(42, 101, 49, 0.36);
  border-radius: 4px;
}

.mcs-portrait {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(255, 183, 0, 0.35);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
}

@media (min-width: 700px) {
  .mcs-portrait {
    width: 64px;
    height: 64px;
  }
}

.mcs-portrait-pop {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(33, 33, 33, 0.92);
  border-radius: 4px;
  padding: 0.5rem;
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
}

.mcs-card.img-open .mcs-portrait-pop {
  display: flex;
}

.mcs-portrait-pop img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.mcs-pop-hint {
  position: absolute;
  bottom: 0.45rem;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.85;
  pointer-events: none;
}

.mcs-head {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
}

.mcs-head-main {
  flex: 1;
  min-width: 0;
}

.mcs-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.mcs-name {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #f4f1ea;
}

.mcs-qty {
  background: #ffb500;
  color: #111;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
}

.mcs-stats {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 2px;
  font-size: 0.65rem;
}

.mcs-stat {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  text-align: center;
  overflow: hidden;
}

.mcs-stat .mcs-k {
  background: rgba(0, 0, 0, 0.42);
  color: #aeb3bc;
  padding: 1px 0;
  font-weight: 600;
}

.mcs-stat .mcs-v {
  padding: 2px 0;
  font-weight: 700;
  background: rgba(18, 22, 28, 0.92);
  color: #f4f1ea;
}

.mcs-stat .mcs-v.mcs-stat-up {
  background: rgba(42, 101, 49, 0.45);
  color: #b8f4bd;
}

.mcs-stat .mcs-v.mcs-stat-down {
  background: rgba(111, 42, 37, 0.45);
  color: #ffc0bc;
}

.mcs-matrix td.mcs-matrix-adjusted {
  background: rgba(42, 101, 49, 0.35);
}

.mcs-matrices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
}

@media (min-width: 400px) {
  .mcs-matrices {
    grid-template-columns: 1.4fr 1fr;
  }
}

.mcs-matrix {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  font-size: 0.6rem;
  min-width: 0;
}

.mcs-matrix .mcs-title {
  background: rgba(0, 0, 0, 0.42);
  color: #ffb300;
  text-align: center;
  font-weight: 700;
  padding: 2px 4px;
  text-transform: uppercase;
}

.mcs-matrix table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.mcs-matrix th,
.mcs-matrix td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  padding: 1px 0;
  background: rgba(18, 22, 28, 0.92);
  color: #f4f1ea;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  font-size: inherit;
  line-height: 1.2;
}

.mcs-matrix th {
  background: rgba(0, 0, 0, 0.35);
  font-weight: 600;
  color: #aeb3bc;
}

.mcs-gear {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mcs-gear-table {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
  font-size: 0.7rem;
  width: 100%;
}

.mcs-gear-table .mcs-title {
  background: rgba(0, 0, 0, 0.42);
  color: #ffb300;
  text-align: center;
  font-weight: 700;
  padding: 3px 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.mcs-gear-table table {
  width: 100%;
  border-collapse: collapse;
}

.mcs-gear-table th,
.mcs-gear-table td {
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 5px;
  text-align: left;
  background: rgba(18, 22, 28, 0.92);
  color: #f4f1ea;
  vertical-align: middle;
}

.mcs-gear-table th {
  background: rgba(0, 0, 0, 0.35);
  font-weight: 600;
  color: #aeb3bc;
}

.mcs-gear-table td.mcs-num {
  text-align: center;
}

.mcs-gear-table tr.mcs-active td {
  background: rgba(255, 183, 0, 0.12);
}

.mcs-row-actions {
  display: flex;
  gap: 0.2rem;
  justify-content: flex-end;
  white-space: nowrap;
}

.mcs-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #aeb3bc;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mcs-abilities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.mcs-ability {
  position: relative;
  display: inline-block;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #f4f1ea;
  cursor: help;
}

.mcs-ability:hover,
.mcs-ability:focus {
  background: rgba(255, 183, 0, 0.14);
  border-color: #c98f00;
  outline: none;
}

.mcs-ability .mcs-tip {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 20;
  width: min(260px, 70vw);
  background: #212121;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  padding: 0.45rem 0.55rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  pointer-events: none;
}

.mcs-ability:hover .mcs-tip,
.mcs-ability:focus .mcs-tip {
  display: block;
}

.mcs-consumables,
.mcs-effects {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mcs-effect {
  background: rgba(255, 183, 0, 0.12);
  border: 1px solid rgba(255, 183, 0, 0.45);
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  color: #f4f1ea;
}

.mcs-consumable {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.25rem 0.35rem;
  background: rgba(0, 0, 0, 0.28);
  color: #f4f1ea;
}

.mcs-consumable .mcs-grow {
  flex: 1;
}

.mcs-spell-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.mcs-spell-pill {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.72rem;
  color: #f4f1ea;
}

.mcs-micro {
  border: 1px solid rgba(255, 183, 0, 0.35);
  background: rgba(14, 17, 22, 0.94);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  color: #f4f1ea;
  text-transform: none;
  min-width: 0;
  line-height: 1.4;
  font-family: inherit;
  box-shadow: none;
  height: auto;
}

.mcs-card button.mcs-micro.mud-button-root,
.mcs-card button.mcs-btn.mud-button-root {
  min-width: 0;
  padding: 0.1rem 0.4rem;
  text-transform: none;
  letter-spacing: 0.03em;
  box-shadow: none;
  height: auto;
  line-height: 1.4;
}

.mcs-micro:hover {
  background: rgba(255, 183, 0, 0.14);
  border-color: #c98f00;
}

.mcs-micro.mcs-primary {
  background: #ffb500;
  border-color: #c98f00;
  color: #111;
  font-weight: 700;
}

.mcs-micro.mcs-primary:hover {
  background: #c98f00;
  color: #fff;
}

.mcs-micro:disabled {
  opacity: 0.4;
  cursor: default;
}

.mcs-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 183, 0, 0.28);
}

.mcs-status {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-weight: 600;
  color: #f4f1ea;
}

.mcs-btn {
  border: 1px solid rgba(255, 183, 0, 0.35);
  background: rgba(14, 17, 22, 0.94);
  border-radius: 4px;
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 0;
  line-height: 1.4;
  font-family: inherit;
  box-shadow: none;
  height: auto;
  color: #f4f1ea;
}

.mcs-card button.mcs-btn.mud-button-root {
  padding: 0.22rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 0;
  height: auto;
  box-shadow: none;
  background: rgba(14, 17, 22, 0.94);
  color: #f4f1ea;
}

.mcs-btn.mcs-dead,
.mcs-card button.mcs-btn.mcs-dead {
  border-color: #c62828;
  color: #ffc0bc;
  background: rgba(111, 42, 37, 0.35);
}

.mcs-btn.mcs-alive,
.mcs-card button.mcs-btn.mcs-alive {
  border-color: #4a8950;
  color: #b8f4bd;
  background: rgba(42, 101, 49, 0.35);
}

.mcs-btn:disabled,
.mcs-card button.mcs-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.mcs-btn.mcs-dead:hover:not(:disabled),
.mcs-card button.mcs-btn.mcs-dead:hover:not(:disabled) {
  background: rgba(111, 42, 37, 0.55);
}

.mcs-btn.mcs-alive:hover:not(:disabled),
.mcs-card button.mcs-btn.mcs-alive:hover:not(:disabled) {
  background: rgba(42, 101, 49, 0.55);
}

.mcs-cast-component {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  background: rgba(0, 0, 0, 0.28);
  color: #f4f1ea;
}

.mcs-cast-component img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid rgba(255, 183, 0, 0.35);
  background: rgba(14, 17, 22, 0.94);
  flex-shrink: 0;
}

.mcs-cast-comp-name {
  font-weight: 700;
  font-size: 0.88rem;
}

.mcs-cast-comp-qty {
  color: #aeb3bc;
  font-size: 0.78rem;
}
