.processing-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 14px;
  background: rgba(15, 23, 42, 0.82);
  text-align: center;
}

.processing-overlay[hidden] { display: none; }

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 4px solid rgba(148, 163, 184, 0.25);
  border-top-color: #7dd3fc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.is-processing { overflow: hidden; }

.primary-button,
.intervention-button {
  cursor: pointer;
  background: #0ea5e9;
  color: #f8fafc;
}

.primary-button:disabled,
.intervention-button:disabled {
  cursor: not-allowed;
  background: #334155;
  color: #94a3b8;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.panel {
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  background: rgba(30, 41, 59, 0.68);
}

.history-panel { grid-column: 1 / -1; }

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 { margin-bottom: 0; }

.subtle,
.panel-description,
.cooldown-note { color: #94a3b8; }

.race-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.race-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.race-row--detailed {
  align-items: flex-start;
}

.race-identity,
.race-status {
  display: grid;
  gap: 3px;
}

.race-identity span,
.race-identity small,
.race-status small {
  color: #94a3b8;
}

.race-identity span {
  font-size: 0.86rem;
}

.race-identity small,
.race-status small {
  font-size: 0.76rem;
}

.race-status {
  justify-items: end;
  min-width: 72px;
  text-align: right;
}

.resource-block {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.34);
}

.resource-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resource-heading strong {
  font-size: 0.92rem;
}

.power-meter,
.faith-meter {
  height: 14px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
}

.power-meter {
  border: 1px solid rgba(125, 211, 252, 0.35);
}

.faith-meter {
  border: 1px solid rgba(250, 204, 21, 0.38);
}

.power-meter-fill,
.faith-meter-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.25s ease;
}

.power-meter-fill {
  background: linear-gradient(90deg, #38bdf8, #a78bfa);
}

.faith-meter-fill {
  background: linear-gradient(90deg, #f59e0b, #fde68a);
}

.resource-block .panel-description {
  margin: 0;
  font-size: 0.86rem;
}

.action-group-label {
  margin: 20px 0 9px;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.rain-actions {
  display: grid;
  gap: 10px;
}

.intervention-button {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 66px;
  text-align: left;
}

.intervention-button--major {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border-color: rgba(196, 181, 253, 0.45);
}

.intervention-button small { opacity: 0.8; }

.history-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.history-list span {
  color: #7dd3fc;
  font-size: 0.84rem;
}

.history-list p {
  margin: 0;
  line-height: 1.55;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .content-grid { grid-template-columns: 1fr; }
  .history-panel { grid-column: auto; }
  .history-list li { grid-template-columns: 68px minmax(0, 1fr); }
  .race-row--detailed { gap: 10px; }
  .race-identity { min-width: 0; }
  .race-identity span,
  .race-identity small { overflow-wrap: anywhere; }
}