.c45-specials {
  display: none;
  width: 100%;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid rgba(199, 173, 114, 0.38);
  border-bottom: 1px solid rgba(199, 173, 114, 0.24);
}

.c45-specials.show {
  display: block;
}

.babelian-bp-control[hidden] {
  display: none;
}

.babelian-bp-control {
  margin: 0 0 12px;
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid rgba(199, 173, 114, 0.24);
  border-bottom: 1px solid rgba(199, 173, 114, 0.18);
}

.babelian-bp-control .c45-counter-row {
  margin: 0;
}

.babelian-bp-control .c45-action-row {
  margin: 0;
}

.babelian-bp-control .c45-action-row button {
  min-height: 32px;
  padding: 5px 12px;
}

.c45-specials-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.c45-specials-title {
  margin: 0;
  color: #f2e7cc;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.c45-roster-source {
  color: #aeb7b0;
  font-size: 12px;
  letter-spacing: 0;
}

.c45-specials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.c45-control,
.c45-status-card,
.c45-wish-view {
  min-width: 0;
  border: 1px solid rgba(199, 173, 114, 0.24);
  border-radius: 6px;
  background: #171918;
}

.c45-control {
  padding: 12px;
}

.c45-control.wide {
  grid-column: 1 / -1;
}

.c45-control.span-2 {
  grid-column: span 2;
}

.c45-control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.c45-control-title {
  color: #d9c28f;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.3;
}

.c45-control-note,
.c45-derived {
  color: #aeb7b0;
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.45;
}

.c45-derived {
  margin-top: 8px;
  color: #91c7ad;
}

.c45-derived.warning {
  color: #e6a078;
}

.c45-owner-row,
.c45-counter-row,
.c45-action-row,
.c45-roster-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.c45-owner-row + .c45-owner-row,
.c45-counter-row + .c45-counter-row,
.c45-roster-row + .c45-roster-row {
  margin-top: 7px;
}

.c45-owner-row label,
.c45-counter-label,
.c45-roster-row label {
  flex: 0 0 116px;
  min-width: 0;
  color: #e2e5df;
  font-size: 13px;
  letter-spacing: 0;
}

.c45-owner-row select,
.c45-roster-row input,
.c45-number-input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid rgba(199, 173, 114, 0.34);
  border-radius: 4px;
  background: #0f1110;
  color: #f2eee4;
  font: inherit;
  letter-spacing: 0;
}

.c45-owner-row select,
.c45-roster-row input {
  padding: 5px 8px;
}

.c45-number-input {
  max-width: 72px;
  padding: 4px 6px;
  text-align: center;
}

.c45-stepper {
  display: grid;
  grid-template-columns: 34px minmax(42px, 64px) 34px;
  align-items: stretch;
  gap: 5px;
}

.c45-stepper button,
.c45-icon-button {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 18px;
  line-height: 1;
}

.c45-stepper-output {
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 34px;
  border: 1px solid rgba(199, 173, 114, 0.22);
  border-radius: 4px;
  background: #0f1110;
  color: #f4ead3;
  font-variant-numeric: tabular-nums;
}

.c45-action-row {
  flex-wrap: wrap;
  margin-top: 10px;
}

.c45-action-row button {
  min-height: 34px;
}

.c45-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e2e5df;
  font-size: 13px;
}

.c45-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #ba9d5f;
}

.c45-track {
  width: 100%;
  margin: 9px 0 3px;
  accent-color: #72a98d;
}

.c45-track-scale {
  display: flex;
  justify-content: space-between;
  color: #89918d;
  font-size: 11px;
}

.c45-wish-layout {
  display: grid;
  grid-template-columns: minmax(130px, 180px) max-content minmax(0, 1fr);
  grid-template-areas:
    "head head copy"
    "view actions copy";
  grid-template-rows: auto 58px;
  gap: 10px 12px;
  align-items: start;
}

.c45-control.c45-wish-control {
  padding-top: 0;
  border-color: var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
}

.c45-wish-head {
  grid-area: head;
  justify-content: flex-start;
  align-items: baseline;
  flex-wrap: nowrap;
  margin-bottom: 0;
  padding-top: 12px;
}

.c45-wish-head .c45-control-title,
.c45-wish-head .c45-control-note {
  white-space: nowrap;
}

.c45-wish-view {
  grid-area: view;
  border-color: var(--line);
  border-radius: 0;
  background: var(--bg);
  position: relative;
  min-height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.c45-wish-actions {
  grid-area: actions;
  min-height: 58px;
  margin-top: 0;
  align-self: center;
}

.c45-wish-copy {
  grid-area: copy;
  min-width: 0;
  height: 100%;
  max-height: 108px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  align-items: start;
  padding: 7px 9px;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 10px;
  line-height: 1.3;
  scrollbar-width: thin;
}

.c45-wish-copy-column {
  min-width: 0;
  overflow-wrap: anywhere;
}

.c45-wish-copy-label {
  margin-bottom: 2px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
}

.c45-wish-name {
  padding: 12px 16px;
  color: var(--accent-strong);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.c45-wish-empty {
  padding: 6px 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.4;
}

.c45-wish-view:has(.c45-wish-empty) {
  width: fit-content;
  max-width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  align-self: center;
}

.c45-active-feint {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.c45-active-feint img {
  width: 82px;
  aspect-ratio: 0.72;
  object-fit: cover;
  border-radius: 4px;
  cursor: zoom-in;
}

.c45-condition-library {
  margin-top: 12px;
  border-top: 1px solid rgba(199, 173, 114, 0.2);
  padding-top: 10px;
}

.c45-condition-library summary,
.c45-roster-editor summary {
  cursor: pointer;
  color: #d9c28f;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.c45-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.c45-status-card {
  overflow: hidden;
}

.c45-status-card img {
  width: 100%;
  aspect-ratio: 0.66;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.c45-status-card-body {
  padding: 8px;
}

.c45-status-card-title {
  min-height: 32px;
  color: #e8e2d5;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
}

.c45-status-card select {
  width: 100%;
  min-height: 32px;
  margin-top: 6px;
  border: 1px solid rgba(199, 173, 114, 0.3);
  border-radius: 4px;
  background: #0f1110;
  color: #f2eee4;
  font: inherit;
  font-size: 12px;
}

.titan-group-panel {
  padding: 16px;
}

.titan-group-head,
.titan-group-target-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.titan-group-head {
  margin-bottom: 14px;
}

.titan-group-head .c45-control-title > span {
  margin-left: 8px;
  color: #aeb7b0;
  font-size: 12px;
  font-weight: 400;
}

.titan-group-panel button {
  font: inherit;
  cursor: pointer;
}

.titan-group-panel button:disabled {
  cursor: default;
}

.titan-group-exit {
  flex-shrink: 0;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: #aeb7b0;
  font-size: 12px !important;
}

.titan-group-targets,
.titan-group-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.titan-group-target {
  min-width: 0;
  padding: 12px;
  border: 1px solid #393d37;
  border-radius: 6px;
  background: #101311;
  color: #e2e5df;
  text-align: left;
}

.titan-group-target:hover:not(:disabled),
.titan-group-target.is-selected {
  border-color: #c7ad72;
  background: #26251e;
}

.titan-group-target-head {
  font-size: 13px;
  flex-wrap: wrap;
}

.titan-group-target-state {
  color: #89938b;
  font-size: 11px;
}

.is-selected .titan-group-target-state {
  color: #d9c28f;
}

.titan-group-target.is-defeated {
  opacity: 0.5;
}

.titan-group-wounds {
  display: block;
  margin-top: 9px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.titan-group-wounds small {
  margin-left: 6px;
  color: #aeb7b0;
  font-size: 12px;
  font-weight: 400;
}

.titan-group-stats {
  margin-top: 12px;
}

.titan-group-stat,
.titan-group-g6 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #30362f;
  border-radius: 6px;
  background: #131613;
  color: #aeb7b0;
  font-size: 12px;
  text-align: left;
}

.titan-group-stat strong,
.titan-group-g6 strong {
  color: #e2e5df;
  font-size: 13px;
  font-weight: 600;
}

.titan-group-stat small {
  color: #89938b;
  font-size: 11px;
  font-weight: 400;
}

.titan-group-progress {
  display: flex;
  gap: 4px;
}

.titan-group-progress i {
  width: 12px;
  height: 4px;
  border-radius: 2px;
  background: #3c423b;
}

.titan-group-progress i.is-filled {
  background: #c7ad72;
}

.titan-group-g6:hover,
.titan-group-g6.is-marked {
  border-color: #64765d;
}

.titan-group-g6.is-marked strong {
  color: #91c7ad;
}

.titan-group-panel button:focus-visible {
  outline: 2px solid #d9c28f;
  outline-offset: 3px;
}

.titan-group-turn {
  margin-top: 14px;
  color: #c8d2c8;
  font-size: 12px;
  line-height: 1.6;
}

.titan-group-rules {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #30362f;
  color: #89938b;
  font-size: 12px;
  line-height: 1.6;
}

.titan-group-rules summary {
  width: fit-content;
  cursor: pointer;
}

.titan-group-rules ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

@media (max-width: 600px) {
  .titan-group-panel { padding: 12px; }
  .titan-group-head .c45-control-title > span { display: block; margin: 4px 0 0; }
  .titan-group-targets { gap: 6px; }
  .titan-group-target { padding: 9px; }
  .titan-group-wounds small { display: block; margin: 4px 0 0; font-size: 11px; }
  .titan-group-stats { grid-template-columns: 1fr; gap: 6px; }
}

.c45-alert {
  border-color: rgba(212, 103, 72, 0.62);
  box-shadow: inset 3px 0 0 #d46748;
}

.c45-ok {
  border-color: rgba(79, 155, 118, 0.56);
  box-shadow: inset 3px 0 0 #4f9b76;
}

.c45-roster-editor {
  margin-bottom: 12px;
}

.c45-roster-rows {
  max-width: 520px;
  margin-top: 9px;
}

.c45-roster-row label {
  flex-basis: 72px;
}

@media (max-width: 1120px) {
  .c45-specials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .c45-control.span-2 {
    grid-column: 1 / -1;
  }

  .c45-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .c45-specials {
    margin: 12px 0;
    padding: 12px 0;
  }

  .c45-specials-head,
  .c45-owner-row,
  .c45-counter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .c45-specials-grid,
  .c45-status-grid {
    grid-template-columns: 1fr;
  }

  .babelian-bp-control {
    grid-template-columns: 1fr;
  }

  .c45-control.span-2,
  .c45-control.wide {
    grid-column: auto;
  }

  .c45-owner-row label,
  .c45-counter-label {
    flex-basis: auto;
  }

  .c45-wish-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "view"
      "actions"
      "copy";
    grid-template-rows: auto;
  }

  .c45-wish-copy {
    height: 72px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .c45-wish-view {
    min-height: 58px;
  }
}
