.raids-white-theme {
  background: linear-gradient(180deg, var(--color-modal-shell-start) 0%, var(--color-modal-shell-end) 100%) !important;
  color: var(--color-text) !important;
  border: 2px solid var(--color-modal-shell-border) !important;
  box-shadow: var(--shadow-lg) !important;
}

.raids-white-theme .modal-header {
  background: var(--color-modal-shell-header) !important;
  border-bottom: 1px solid var(--color-modal-shell-border) !important;
}

.raids-white-theme .modal-header h2 {
  color: var(--color-text) !important;
  font-weight: 800;
}

.raids-white-theme .modal-header h2 i {
  color: var(--color-primary) !important;
}

.raids-white-theme .modal-close-btn {
  color: var(--color-text-secondary) !important;
}

.raids-white-theme .modal-close-btn:hover {
  color: var(--color-text) !important;
}

.raids-white-theme .modal-tabs {
  background: var(--color-background-secondary) !important;
  border-bottom: 1px solid var(--color-border) !important;
}

.raids-white-theme .tab-btn {
  color: var(--color-text-secondary) !important;
}

.raids-white-theme .tab-btn:hover {
  color: var(--color-text) !important;
  background: var(--color-brand-hover-bg);
}

.raids-white-theme .tab-btn.active {
  color: var(--color-primary) !important;
  border-bottom-color: var(--color-primary) !important;
  background: var(--color-surface);
}

.raids-white-theme .modal-content,
.raids-white-theme .form-section,
.raids-white-theme .curse-card,
.raids-white-theme .damage-card {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-modal-shell-border) !important;
}

.raids-white-theme .form-section {
  border: 1px solid rgba(124, 115, 255, 0.2) !important;
}

.raids-white-theme .form-section h3,
.raids-white-theme .form-section h4,
.raids-white-theme .curse-card h4,
.raids-white-theme .damage-title h4,
.raids-white-theme p,
.raids-white-theme strong,
.raids-white-theme label {
  color: var(--color-text) !important;
}

.raids-white-theme .curse-description,
.raids-white-theme .damage-description {
  color: var(--color-text-secondary) !important;
}

.raids-white-theme .damage-stats {
  background: rgba(124, 115, 255, 0.08) !important;
}

.raids-white-theme .damage-stats .stat-label {
  color: var(--color-text-secondary) !important;
}

.raids-white-theme .damage-stats .stat-value {
  color: var(--color-primary) !important;
}

.raids-white-theme .empty-state {
  color: var(--color-text-secondary) !important;
}

.raids-white-theme .empty-state i {
  color: var(--color-primary) !important;
}

.raids-white-theme .form-group input[type="text"],
.raids-white-theme .form-group input[type="number"],
.raids-white-theme .form-group input,
.raids-white-theme .form-group select,
.raids-white-theme .form-group textarea,
.raids-white-theme textarea,
.raids-white-theme select {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border) !important;
}

.raids-white-theme .form-group input::placeholder,
.raids-white-theme .form-group textarea::placeholder,
.raids-white-theme input::placeholder,
.raids-white-theme textarea::placeholder {
  color: var(--color-text-secondary) !important;
}

.raids-white-theme .form-group input:focus,
.raids-white-theme .form-group select:focus,
.raids-white-theme .form-group textarea:focus,
.raids-white-theme input:focus,
.raids-white-theme select:focus,
.raids-white-theme textarea:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px var(--color-brand-hover-bg) !important;
  outline: none !important;
}

.raids-white-theme .toggle-label {
  color: var(--color-text) !important;
}

.raids-white-theme .toggle-slider {
  background: var(--color-background-alt) !important;
  border: 1px solid var(--color-border) !important;
}

.raids-white-theme .toggle-slider::after {
  background: var(--color-surface) !important;
}

.raids-white-theme .toggle-checkbox:checked + .toggle-slider {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

.raids-white-theme .btn-secondary {
  background: var(--color-background-alt) !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border) !important;
}

.raids-white-theme .btn-secondary:hover {
  background: var(--color-brand-hover-bg) !important;
  color: var(--color-primary-light) !important;
  border-color: var(--color-primary) !important;
}

.raids-white-theme .btn-danger {
  color: #ffffff !important;
}

.raids-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 0.25rem;
}

.raids-white-theme .modal-content {
  padding: 1.25rem 1.5rem 1.5rem;
}

.raids-white-theme .curses-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.raids-white-theme .damage-card {
  padding: 1.15rem 1.25rem;
  border-radius: 12px;
}

.raids-white-theme .damage-card-header {
  margin-bottom: 0.65rem;
  gap: 1rem;
}

.raids-white-theme .damage-title h4 {
  margin-bottom: 0.35rem !important;
}

.raids-white-theme .raid-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.raids-white-theme .raid-card-badges .badge {
  margin-right: 0;
  padding: 0.3rem 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.raids-white-theme .badge-default {
  background: var(--color-accent-chip-bg) !important;
  color: var(--color-accent-chip-text) !important;
  border: 1px solid var(--color-border);
}

.raids-white-theme .badge-multi {
  background: rgba(124, 115, 255, 0.14) !important;
  color: var(--color-primary-light) !important;
  border: 1px solid rgba(124, 115, 255, 0.28);
}

.raids-white-theme .badge-all-classrooms {
  background: rgba(245, 158, 11, 0.14) !important;
  color: var(--color-warning-banner-text) !important;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.raids-white-theme .damage-description {
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.raids-white-theme .public-card-actions {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top-color: var(--color-border);
}

.raids-white-theme .damage-status .edit-btn,
.raids-white-theme .damage-status .delete-btn {
  color: var(--color-text-secondary);
}

.raids-white-theme .damage-status .edit-btn:hover {
  color: var(--color-primary-light);
}

.raids-white-theme .damage-status .delete-btn:hover {
  color: var(--color-danger, #ef4444);
}

.raids-create-chooser-modal {
  width: min(100%, 32rem);
  background: linear-gradient(180deg, var(--color-modal-shell-start) 0%, var(--color-modal-shell-end) 100%);
  border: 2px solid var(--color-modal-shell-border);
  border-radius: 14px;
  overflow: hidden;
}

.raids-create-chooser-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--color-modal-shell-header);
  border-bottom: 1px solid var(--color-modal-shell-border);
}

.raids-create-chooser-modal .modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-text);
}

.raids-create-chooser-modal .modal-close-btn {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: 0.35rem;
  line-height: 1;
}

.raids-create-chooser-modal .modal-close-btn:hover {
  color: var(--color-text);
}

.raids-create-chooser-modal .modal-body {
  padding: 1.15rem 1.25rem 1.35rem;
}

.raids-create-chooser-lead {
  margin: 0 0 1rem;
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
}

.raids-create-chooser-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.raids-create-option {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  width: 100%;
  padding: 0.9rem 1rem;
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.raids-create-option:hover {
  border-color: var(--color-primary);
  background: var(--color-brand-hover-bg);
}

.raids-create-option:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.raids-create-option-icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(124, 115, 255, 0.14);
  color: var(--color-primary-light);
  font-size: 1rem;
}

.raids-create-option-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.raids-create-option-text strong {
  color: var(--color-text);
  font-size: 0.95rem;
}

.raids-create-option-text span {
  color: var(--color-text-secondary);
  font-size: 0.82rem;
  line-height: 1.4;
}

.raid-builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.75rem 0;
}

.raid-question-bank,
.raid-asset-gallery,
.raid-monster-list,
.raid-boss-q-list {
  display: grid;
  gap: 0.5rem;
}

.raid-question-bank {
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.5rem;
  background: var(--color-background-alt);
}

.raid-question-chip {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  cursor: grab;
  background: var(--color-surface);
  color: var(--color-text);
}

.raid-question-chip:active {
  cursor: grabbing;
}

.raid-question-type {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
}

.raid-question-title {
  display: block;
  font-size: 0.9rem;
}

.raid-asset-gallery {
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.5rem;
  background: var(--color-background-alt);
}

.raid-asset-thumb,
.raid-image-card {
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  height: 76px;
  background: var(--color-surface);
}

.raid-asset-thumb img,
.raid-image-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.raid-monster-preview img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.raid-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.raid-image-card {
  cursor: pointer;
  padding: 0;
  height: 88px;
}

.raid-image-card--active {
  border-color: var(--color-primary);
  background: var(--color-selection-bg);
  box-shadow: 0 0 0 2px var(--color-selection-muted);
}

.raid-image-upload-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  border-color: var(--color-border);
  cursor: pointer;
  margin: 0;
  background: var(--color-surface);
}

.raid-image-upload-card:hover {
  border-color: var(--color-primary);
  background: var(--color-brand-hover-bg);
}

.raid-image-upload-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.raid-image-upload-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  text-align: center;
  padding: 0.35rem;
}

.raid-image-upload-icon i {
  font-size: 1.15rem;
  color: var(--color-primary);
}

.raid-mob-picker-grid .raid-image-upload-card {
  min-height: 140px;
}

.raid-monster-list {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.raid-monster-count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.raid-monster-count-field {
  min-width: 180px;
  margin-bottom: 0;
}

.raid-monster-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.75rem;
  background: var(--color-surface);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.raid-monster-card--ready {
  border-color: #86efac;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15);
}

.raid-monster-card--incomplete {
  border-color: #fcd34d;
}

.raid-monster-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.raid-monster-card-number {
  font-weight: 700;
  color: var(--color-text);
}

.raid-monster-card-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
}

.raid-monster-card-badge--pending {
  background: #fef3c7;
  color: #92400e;
}

.raid-monster-damage-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-size: 0.8rem;
  color: #991b1b;
}

.raid-monster-damage-field label {
  font-weight: 600;
  color: #991b1b;
}

.raid-monster-damage-input-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.raid-monster-damage-input-row input {
  width: 4.5rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
  color: #7f1d1d;
}

.raid-monster-damage-suffix {
  font-weight: 700;
  color: #991b1b;
}

.raid-monster-damage-help {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  color: #b91c1c;
}

.raid-monster-damage-crit {
  margin: 0;
  font-size: 0.74rem;
  color: #b45309;
}

.raid-monster-preview-btn,
.raid-monster-image-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

.raid-monster-preview {
  height: 160px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px dashed var(--color-border);
  background: var(--color-background-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  box-sizing: border-box;
}

.raid-monster-preview--empty {
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-background-alt));
}

.raid-monster-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  padding: 0.5rem;
}

.raid-monster-preview-placeholder i {
  font-size: 2rem;
  color: var(--color-text-secondary);
}

.raid-monster-image-hint,
.raid-monster-preview-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--color-brand-hover-bg);
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
}

.raid-monster-image-btn:hover .raid-monster-image-hint,
.raid-monster-preview-btn:hover .raid-monster-preview-label {
  background: var(--color-selection-bg);
}

.raid-monster-image-btn:hover .raid-monster-preview {
  border-color: var(--color-primary);
  background: var(--color-brand-hover-bg);
}

.raid-monster-name-input {
  width: 100%;
}

.raid-monster-question-btn {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
  color: var(--color-text);
}

.raid-monster-question-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-brand-hover-bg);
}

.raid-monster-card-question {
  border-top: none;
  padding-top: 0;
  font-size: 0.85rem;
}

.raid-monster-card-question-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  margin-bottom: 0.2rem;
}

.raid-monster-card-question-value {
  display: block;
  color: var(--color-text);
  line-height: 1.35;
}

.raid-monster-question-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--color-primary);
  font-weight: 600;
}

.raid-monster-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 1rem;
}

.raid-monster-picker {
  width: min(920px, 100%);
  max-height: min(90dvh, 860px);
  overflow: auto;
  background: var(--color-surface);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}

.raid-monster-picker-header,
.raid-monster-picker-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.raid-monster-picker-footer {
  border-bottom: none;
  border-top: 1px solid #e5e7eb;
  justify-content: flex-end;
}

.raid-monster-picker-header h3 {
  margin: 0;
}

.raid-monster-picker-body {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.raid-monster-picker-section h4 {
  margin: 0 0 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.raid-monster-picker-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.raid-monster-picker-section-head h4 {
  margin: 0;
}

.raid-monster-picker-gallery {
  margin-bottom: 0.5rem;
}

.raid-monster-picker-random {
  margin-bottom: 0.65rem;
}

.raid-mob-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.raid-mob-picker-card {
  border: 2px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  padding: 0.45rem;
  cursor: pointer;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.raid-mob-picker-card img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  object-position: center;
  display: block;
}

.raid-mob-picker-card:hover {
  border-color: var(--color-primary);
  background: var(--color-brand-hover-bg);
}

.raid-mob-picker-card--active {
  border-color: var(--color-primary);
  background: var(--color-selection-bg);
  box-shadow: 0 0 0 2px var(--color-selection-muted);
}

.raid-mob-picker-upload {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 0.85rem;
  text-align: center;
  background: var(--color-surface);
}

.raid-mob-picker-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: var(--color-brand-hover-bg);
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 600;
}

.raid-mob-picker-upload-btn:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.raid-mob-picker-upload-btn i {
  font-size: 1.1rem;
}

.raid-boss-questions-step .raid-help {
  margin-bottom: 1rem;
}

.raid-boss-panel {
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.raid-boss-panel--lineup {
  border: 2px solid color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  /* Use surface (proven theme-aware) - color-mix with background-alt can resolve light in dark mode */
  background: var(--color-surface);
  box-shadow: none;
  color: var(--color-text);
}

.raid-boss-panel--bank {
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  margin-bottom: 0;
  color: var(--color-text);
}

.raid-boss-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.raid-boss-panel--lineup .raid-boss-panel-header {
  border-bottom-color: color-mix(in srgb, var(--color-primary) 28%, var(--color-border));
}

.raid-boss-panel--bank .raid-boss-panel-header {
  border-bottom-color: var(--color-border);
}

.raid-boss-panel-title {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
}

.raid-boss-panel-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #4338ca;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.raid-boss-panel-icon--bank {
  background: #0f766e;
}

.raid-boss-panel-title h4 {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  color: var(--color-text);
}

.raid-boss-panel-subtitle {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.35;
}

.raid-boss-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.raid-boss-random-toggle {
  font-size: 0.88rem;
  white-space: nowrap;
  color: var(--color-text);
}

.raid-boss-damage-progress {
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.85rem;
  background: var(--color-background-secondary);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.raid-boss-damage-progress--warn {
  border-color: var(--color-warning-banner-border);
  background: var(--color-warning-banner-bg);
  color: var(--color-warning-banner-text);
}

.raid-boss-damage-progress--ok {
  border-color: var(--color-tool-status-success);
  background: var(--color-tool-status-success-bg);
  color: var(--color-tool-status-success);
}

.raid-boss-damage-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.raid-boss-damage-progress-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: inherit;
}

.raid-boss-damage-progress-stats {
  font-size: 0.88rem;
  color: inherit;
  opacity: 0.92;
}

.raid-boss-damage-progress-stats strong {
  color: inherit;
  font-size: 1rem;
  opacity: 1;
}

.raid-boss-damage-progress-track {
  height: 12px;
  border-radius: 999px;
  background: var(--color-border);
  overflow: hidden;
}

.raid-boss-damage-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1 0%, #4338ca 100%);
  transition: width 0.2s ease;
}

.raid-boss-damage-progress--ok .raid-boss-damage-progress-fill {
  background: linear-gradient(90deg, #34d399 0%, #059669 100%);
}

.raid-boss-damage-progress--warn .raid-boss-damage-progress-fill {
  background: linear-gradient(90deg, #fbbf24 0%, #d97706 100%);
}

.raid-boss-damage-progress-help {
  margin: 0.45rem 0 0.35rem;
  font-size: 0.78rem;
  color: inherit;
  opacity: 0.9;
}

.raid-boss-damage-status {
  margin: 0;
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  line-height: 1.4;
  color: inherit;
}

.raid-boss-damage-status--ok {
  color: var(--color-tool-status-success);
  font-weight: 600;
}

.raid-boss-damage-status--warn {
  color: var(--color-warning-banner-text);
  font-weight: 600;
}

.raid-boss-damage-status i {
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.raid-boss-panel--bank .question-filter-bar {
  margin-bottom: 0.65rem;
}

.raid-boss-assigned {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.85rem;
  background: var(--color-background-alt);
  margin-bottom: 1rem;
  color: var(--color-text);
}

.raid-boss-assigned-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.raid-boss-assigned-header h4 {
  margin: 0;
}

.raid-boss-q-count {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}

.raid-boss-q-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 0.65rem;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: var(--color-surface);
}

.raid-boss-q-number {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--color-brand-hover-bg);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.raid-boss-q-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.raid-boss-q-text {
  font-weight: 600;
  color: var(--color-text);
}

.raid-boss-q-meta {
  font-size: 0.78rem;
}

.raid-boss-q-missing {
  color: #b45309;
  font-size: 0.9rem;
}

.raid-boss-q-damage {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.raid-boss-q-damage label {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  margin: 0;
}

.raid-boss-q-damage input {
  width: 72px;
  min-height: 36px;
  text-align: center;
}

.raid-boss-q-remove {
  min-width: 36px;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.raid-boss-q-empty-state {
  text-align: center;
  color: var(--color-text-secondary);
  padding: 1.25rem 0.75rem;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: var(--color-surface);
}

.raid-boss-q-empty-state i {
  font-size: 1.4rem;
  margin-bottom: 0.35rem;
  display: block;
  color: #94a3b8;
}

.raid-boss-q-empty-state p {
  margin: 0;
  line-height: 1.45;
}

.raid-boss-panel--bank .raid-question-bank {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-background-alt);
}

.raid-question-bank--clickable {
  max-height: 280px;
}

.raid-bank-question-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: var(--color-surface);
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
}

.raid-bank-question-btn:hover {
  border-color: var(--color-primary);
  background: var(--color-brand-hover-bg);
}

.raid-bank-question-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.raid-bank-add-hint {
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--color-primary);
  font-weight: 600;
}

.raid-question-picker-list {
  display: grid;
  gap: 0.45rem;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.5rem;
  background: var(--color-background-alt);
}

.raid-question-picker-list--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.raid-question-picker-item {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.raid-question-picker-item:hover {
  border-color: var(--color-primary);
  background: var(--color-brand-hover-bg);
}

.raid-question-picker-item--active {
  border-color: var(--color-primary);
  background: var(--color-selection-bg);
  box-shadow: 0 0 0 2px var(--color-selection-muted);
}

.raid-monster-slot,
.raid-boss-q-slot {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.6rem;
  background: var(--color-surface);
}

.raid-drop-question {
  border: 2px dashed var(--color-border);
  border-radius: 8px;
  padding: 0.55rem;
  background: var(--color-background-alt);
  min-height: 42px;
  margin-top: 0.45rem;
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.raid-review {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.75rem;
  background: var(--color-background-alt);
  color: var(--color-text);
}

.raid-review-layout {
  display: grid;
  gap: 1rem;
}

.raid-review-card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.85rem;
  background: var(--color-surface);
}

.raid-review-card--hero {
  padding: 0;
  overflow: hidden;
}

.raid-review-card h4 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.raid-review-banner {
  min-height: 140px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.raid-review-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.82) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  color: #fff;
}

.raid-review-banner-overlay h4 {
  margin: 0 0 0.25rem;
  color: #fff;
  font-size: 1.25rem;
}

.raid-review-banner-overlay p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.92;
}

.raid-review-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.88rem;
  color: var(--color-text-secondary);
}

.raid-review-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.raid-review-monster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.65rem;
}

.raid-review-monster {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-background-alt);
}

.raid-review-monster img {
  width: 100%;
  height: 90px;
  object-fit: contain;
  background: var(--color-surface);
  display: block;
}

.raid-review-monster-meta {
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
}

.raid-review-monster-meta strong {
  display: block;
  color: var(--color-text);
  margin-bottom: 0.15rem;
}

.raid-review-boss {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.raid-review-boss img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-background-alt);
  flex-shrink: 0;
}

.raid-review-boss-meta p {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--color-text);
}

.raid-review-ok {
  color: #047857;
}

.raid-review-warn {
  color: #b45309;
}

.raid-review-note {
  color: var(--color-text-secondary);
  font-size: 0.82rem !important;
}

.raid-review-boss-q-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.raid-review-boss-q {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  background: var(--color-background-alt);
  font-size: 0.85rem;
  color: var(--color-text);
}

.raid-review-boss-q-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--color-brand-hover-bg);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.raid-review-boss-q-text {
  color: var(--color-text);
  min-width: 0;
}

.raid-review-boss-q-damage {
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

.raid-help {
  color: var(--color-text-secondary);
}

.raid-inline-row {
  align-items: center;
}

/* Multiple-choice option rows (question form, raids, campaigns, question bank) */
.data-management-modal .raid-choice-row,
.raids-white-theme .raid-choice-row,
.campaigns-white-theme .raid-choice-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 44px;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.data-management-modal .raid-choice-row input[data-mcq-option],
.raids-white-theme .raid-choice-row input[data-mcq-option],
.campaigns-white-theme .raid-choice-row input[data-mcq-option] {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  margin: 0;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid var(--color-input-border, #cbd5e1);
  background: var(--color-input-bg, #fff);
  color: var(--color-input-text, #1f2937);
}

.data-management-modal .raid-choice-row input[data-mcq-option]::placeholder,
.raids-white-theme .raid-choice-row input[data-mcq-option]::placeholder,
.campaigns-white-theme .raid-choice-row input[data-mcq-option]::placeholder {
  color: var(--color-text-light, #94a3b8);
  opacity: 1;
}

.data-management-modal .raid-choice-row input[data-mcq-option]:focus,
.raids-white-theme .raid-choice-row input[data-mcq-option]:focus,
.campaigns-white-theme .raid-choice-row input[data-mcq-option]:focus {
  outline: none;
  border-color: var(--color-primary, #7c73ff);
  box-shadow: 0 0 0 2px rgba(124, 115, 255, 0.25);
}

.data-management-modal .raid-choice-radio,
.raid-choice-radio {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 42px;
  cursor: pointer;
}

.data-management-modal .raid-choice-radio input[type='radio'],
.raids-white-theme .raid-choice-radio input[type='radio'],
.campaigns-white-theme .raid-choice-radio input[type='radio'] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-primary, #7c73ff);
  cursor: pointer;
  flex-shrink: 0;
}

.data-management-modal .raid-choice-remove,
.raid-choice-remove {
  width: 40px;
  height: 40px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #dc2626;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  align-self: center;
}

.data-management-modal .raid-choice-remove:hover,
.raid-choice-remove:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.data-management-modal #add-mcq-option {
  margin-top: 0.35rem;
}

.raid-attachment-preview {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.raid-attachment-preview img,
.raid-run-attachment img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: var(--color-surface);
}

.raid-run-attachment {
  margin: 0.35rem 0 0.75rem;
}

@media (max-width: 980px) {
  .raid-builder-grid {
    grid-template-columns: 1fr;
  }

  .question-filter-row {
    grid-template-columns: 1fr;
  }
}

.question-filter-bar {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.75rem;
  background: var(--color-background-alt);
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.question-filter-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 0.65rem;
  align-items: end;
}

.question-filter-search input {
  width: 100%;
}

.question-filter-unused {
  margin-top: 0.65rem;
}

.question-filter-count {
  margin: 0.35rem 0 0.75rem;
}

.question-picker-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}

.question-tag-chip {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--color-brand-hover-bg);
  color: var(--color-primary-light);
}
/* Fullscreen raid battle, loaded with raids.css or appended */

#modal-container:has(.raid-battle-overlay) {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: #000;
  backdrop-filter: none;
}

.raid-battle-overlay {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}

.raid-battle-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center 70%, transparent 0%, rgba(0, 0, 0, 0.45) 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, transparent 22%, transparent 62%, rgba(0, 0, 0, 0.65) 100%);
}

.raid-battle-topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent);
}

.raid-battle-exit-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.raid-battle-exit-btn:hover {
  background: rgba(220, 38, 38, 0.75);
  border-color: rgba(255, 255, 255, 0.5);
}

.raid-battle-monster-progress {
  flex: 1;
  min-width: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.raid-battle-topbar-spacer {
  flex: 1;
  min-width: 0;
}

.raid-battle-boss-hp {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.raid-battle-boss-hp--under-boss {
  width: 100%;
  margin-top: 0.75rem;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
}

.raid-battle-boss-hp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.raid-battle-boss-hp--under-boss .raid-battle-boss-hp-bar {
  flex: none;
  width: 100%;
  height: 16px;
}

.raid-battle-boss-hp--under-boss .raid-battle-boss-hp-value {
  min-width: 0;
  text-align: right;
  font-size: 0.88rem;
}

.raid-battle-boss-hp-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.9;
}

.raid-battle-boss-hp-bar {
  flex: 1;
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.raid-battle-boss-hp-fill {
  height: 100%;
  background: linear-gradient(90deg, #dc2626, #f97316);
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.6);
}

.raid-battle-boss-hp-value {
  font-weight: 800;
  font-size: 0.95rem;
  min-width: 4.5rem;
  text-align: right;
}

.raid-battle-stage-badge {
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.75);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.raid-battle-overlay--boss .raid-battle-stage-badge {
  background: rgba(220, 38, 38, 0.8);
}

.raid-battle-question-panel {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 0.5rem 1.5rem 0.75rem;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.raid-battle-prompt-scrim {
  position: relative;
  z-index: 4;
  max-width: 920px;
  margin: 0 auto;
  width: calc(100% - 2rem);
  padding: 1rem 1.25rem 1.1rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.raid-battle-prompt-scrim .raid-battle-question-panel,
.raid-battle-prompt-scrim .raid-battle-answers {
  max-width: none;
  margin: 0;
  width: 100%;
}

.raid-battle-prompt-scrim .raid-battle-question-panel {
  padding: 0 0 0.35rem;
}

.raid-battle-prompt-scrim .raid-battle-answers {
  padding: 0.45rem 0 0;
}

.raid-battle-prompt-scrim .raid-help {
  color: rgba(255, 255, 255, 0.82);
  margin: 0.35rem 0 0;
}

.raid-battle-prompt-scrim .raid-battle-wrong-hint,
.raid-battle-prompt-scrim .raid-battle-targets {
  color: rgba(255, 255, 255, 0.88);
}

.raid-battle-question-text {
  margin: 0;
  font-size: clamp(1.25rem, 2.8vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.85);
}

.raid-battle-attachment {
  margin-top: 0.75rem;
}

.raid-battle-attachment img {
  max-height: 120px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.raid-battle-question-meta {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
}

.raid-battle-answers {
  position: relative;
  z-index: 4;
  padding: 0.5rem 1.25rem 0.75rem;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}

.raid-battle-answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.65rem;
}

.raid-battle-answer-btn {
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.raid-battle-answer-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: #a78bfa;
  background: rgba(67, 56, 202, 0.75);
}

.raid-battle-answer-btn--selected {
  border-color: #c4b5fd;
  background: rgba(109, 40, 217, 0.85);
}

.raid-battle-answer-grid--simple {
  grid-template-columns: 1fr 1fr;
  max-width: 28rem;
  margin: 0 auto;
}

.raid-battle-answer-btn--yes {
  border-color: rgba(72, 187, 120, 0.55);
  background: rgba(72, 187, 120, 0.12);
}

.raid-battle-answer-btn--yes:hover:not(:disabled) {
  background: rgba(72, 187, 120, 0.28);
}

.raid-battle-answer-btn--no {
  border-color: rgba(245, 101, 101, 0.55);
  background: rgba(245, 101, 101, 0.12);
}

.raid-battle-answer-btn--no:hover:not(:disabled) {
  background: rgba(245, 101, 101, 0.28);
}

/* Compact simple-raid judgment dock: monster owns the screen */
.raid-battle-overlay--simple .raid-battle-topbar {
  padding: 0.75rem 1rem;
  flex-shrink: 0;
}

.raid-battle-overlay--simple .raid-battle-vignette {
  background:
    radial-gradient(ellipse at center 58%, transparent 0%, rgba(0, 0, 0, 0.35) 72%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 18%, transparent 72%, rgba(0, 0, 0, 0.55) 100%);
}

.raid-battle-overlay--simple .raid-battle-arena {
  padding: 0.25rem 1rem 0.35rem;
  min-height: 0;
  overflow: hidden;
}

.raid-battle-overlay--simple .raid-battle-enemy-column {
  width: min(96vw, 900px);
  max-height: 100%;
  min-height: 0;
}

.raid-battle-overlay--simple .raid-battle-enemy-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
}

.raid-battle-overlay--simple .raid-battle-enemy {
  /* Reserve room for topbar + HP bar + judge dock on short screens */
  max-height: min(calc(100dvh - 13.5rem), 78vh, 820px);
  max-width: min(96vw, 900px);
}

/* Pin HP + controls below the arena so the bar never sits behind the dock */
.raid-battle-simple-chrome {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0 0 max(0.85rem, env(safe-area-inset-bottom, 0px));
}

.raid-battle-simple-chrome .raid-battle-boss-hp--under-boss {
  width: calc(100% - 2rem);
  max-width: min(96vw, 900px);
  margin: 0;
}

.raid-battle-judge-dock {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0 auto;
  width: calc(100% - 2rem);
  max-width: 36rem;
  padding: 0.7rem 1rem 0.8rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.raid-battle-judge-meta {
  width: 100%;
  min-width: 0;
}

.raid-battle-judge-dock .raid-battle-question-meta {
  margin-top: 0;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.85rem;
}

.raid-battle-judge-dock .raid-battle-targets {
  font-size: 0.92rem;
}

.raid-battle-judge-dock .raid-battle-wrong-hint {
  font-size: 0.85rem;
  opacity: 0.9;
}

.raid-battle-judge-dock .raid-battle-target-refresh {
  width: 1.55rem;
  height: 1.55rem;
}

.raid-battle-answers--judge {
  flex: 0 0 auto;
  padding: 0;
  max-width: none;
  width: 100%;
  margin: 0;
}

.raid-battle-answer-grid--judge {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  max-width: none;
  width: 100%;
  margin: 0;
}

.raid-battle-answer-btn--judge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex: 1 1 0;
  max-width: 11rem;
  min-width: 8rem;
  padding: 0.7rem 1.1rem;
  border-radius: 12px;
  font-size: 1.05rem;
}

.raid-battle-answer-btn--judge i {
  font-size: 1.05rem;
}

@media (max-width: 640px) {
  .raid-battle-simple-chrome {
    gap: 0.45rem;
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom, 0px));
  }

  .raid-battle-simple-chrome .raid-battle-boss-hp--under-boss {
    width: calc(100% - 1.3rem);
  }

  .raid-battle-judge-dock {
    width: calc(100% - 1.3rem);
    margin: 0 auto;
    padding: 0.65rem 0.75rem 0.75rem;
  }

  .raid-battle-answer-btn--judge {
    max-width: none;
    min-width: 0;
  }

  .raid-battle-overlay--simple .raid-battle-enemy {
    max-height: min(calc(100dvh - 14.5rem), 68vh, 640px);
  }
}

.simple-raid-wizard-modal .modal-content,
.simple-raid-wizard-modal #simple-raid-wizard-step-content,
.simple-raid-wizard-modal .simple-raid-wizard-step {
  width: 100%;
  box-sizing: border-box;
}

.simple-raid-wizard-modal .form-actions {
  width: 100%;
  box-sizing: border-box;
}

.simple-raid-wizard-step h3 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.simple-raid-wizard-intro {
  margin-bottom: 1rem;
}

.simple-raid-wizard-note {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-primary) 8%, var(--color-background-alt));
  color: var(--color-text-secondary);
}

.simple-raid-wizard-stats {
  margin-bottom: 1rem;
}

.simple-raid-review {
  margin-top: 1.25rem;
}

.simple-raid-review-monster {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.simple-raid-review-monster img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.simple-raid-monster-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.simple-raid-monster-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-width: 88px;
  padding: 0.5rem;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.simple-raid-monster-slot img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.simple-raid-monster-slot span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.simple-raid-monster-slot:hover {
  border-color: rgba(124, 115, 255, 0.45);
  background: var(--color-selection-hover);
}

.simple-raid-monster-slot--active {
  border-color: var(--color-primary);
  background: var(--color-selection-bg);
  box-shadow: 0 0 0 2px var(--color-selection-muted);
}

.simple-raid-monster-slot--active span {
  color: var(--color-primary);
}

.simple-raid-monster-slot--picked:not(.simple-raid-monster-slot--active) {
  border-color: rgba(124, 115, 255, 0.35);
}

.simple-raid-review-monsters {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.simple-raid-review-monsters .simple-raid-review-monster {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.simple-raid-review-monsters .simple-raid-review-monster img {
  width: 56px;
  height: 56px;
}

.simple-raid-review-monsters-damage {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.simple-raid-review-bg {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.raid-review-card--scene {
  grid-column: 1 / -1;
}

.raid-image-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.5rem;
}

.raid-image-grid--compact .raid-image-card img {
  max-height: 64px;
  object-fit: contain;
}

.raid-battle-answer-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.raid-battle-text-answer {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: center;
}

.raid-battle-text-answer input[type="text"] {
  width: 100%;
  max-width: 520px;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  text-align: center;
}

.raid-battle-submit-btn {
  align-self: center;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #7c3aed, #4338ca);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.raid-battle-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.raid-battle-arena {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem 2rem;
  min-height: 280px;
}

.raid-battle-enemy-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(78vw, 520px);
  max-width: 100%;
}

.raid-battle-enemy-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.raid-battle-enemy {
  max-height: min(52vh, 480px);
  max-width: min(78vw, 520px);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.65));
  transition: transform 0.35s ease, filter 0.35s ease, opacity 0.5s ease;
  transform-origin: center center;
}

.raid-battle-enemy-glow {
  position: absolute;
  inset: -10% -5% -5%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.25), transparent 70%);
  pointer-events: none;
  transition: background 0.35s ease, opacity 0.5s ease;
}

.raid-battle-enemy--attacking {
  animation: raid-enemy-attack 1s ease;
}

.raid-battle-enemy-glow--attack {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.55), transparent 72%);
  animation: raid-glow-pulse 1s ease;
}

.raid-battle-enemy--hit {
  animation: raid-enemy-hit 0.45s ease;
}

.raid-battle-enemy-glow--hit {
  background: radial-gradient(circle, rgba(250, 204, 21, 0.45), transparent 70%);
}

.raid-battle-enemy--defeated {
  animation: raid-enemy-defeated 0.9s ease forwards;
}

.raid-battle-enemy-glow--fade {
  opacity: 0;
}

.raid-battle-slash {
  position: absolute;
  top: 15%;
  left: 50%;
  width: 140%;
  height: 8px;
  margin-left: -70%;
  background: linear-gradient(90deg, transparent, #fff, #fde047, #fff, transparent);
  box-shadow: 0 0 20px #fbbf24, 0 0 40px #ef4444;
  transform: rotate(-28deg) scaleX(0);
  opacity: 0;
  pointer-events: none;
}

.raid-battle-slash--active {
  animation: raid-slash 0.55s ease forwards;
}

.raid-battle-overlay--shake {
  animation: raid-screen-shake 0.45s ease;
}

.raid-battle-targets {
  font-size: 0.95rem;
}

.raid-battle-targets-label {
  font-weight: 800;
  margin-right: 0.35rem;
}

.raid-battle-wrong-hint {
  font-size: 0.88rem;
  opacity: 0.9;
}

.raid-battle-overlay--loading,
.raid-battle-overlay--complete {
  align-items: center;
  justify-content: center;
}

.raid-battle-loading {
  font-size: 1.25rem;
  font-weight: 700;
  z-index: 2;
}

.raid-battle-complete-card {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 2rem 2.5rem;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.82);
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  max-width: 420px;
  width: calc(100% - 2rem);
}

.raid-battle-overlay--victory .raid-battle-complete-icon {
  color: #fbbf24;
}

.raid-battle-overlay--defeat .raid-battle-complete-icon {
  color: #f87171;
}

.raid-battle-complete-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.raid-battle-complete-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.raid-battle-complete-result {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.raid-battle-complete-rewards {
  margin: 0 0 1rem;
  opacity: 0.9;
}

.raid-battle-complete-btn {
  min-width: 180px;
}

@keyframes raid-slash {
  0% {
    opacity: 0;
    transform: rotate(-28deg) scaleX(0);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: rotate(-28deg) scaleX(1);
  }
}

@keyframes raid-enemy-defeated {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.65));
  }
  40% {
    transform: scale(1.05) rotate(-4deg);
    filter: drop-shadow(0 0 24px rgba(239, 68, 68, 0.8));
  }
  100% {
    opacity: 0;
    transform: scale(0.2) rotate(18deg) translateY(40px);
    filter: blur(2px);
  }
}

@keyframes raid-enemy-attack {
  0%,
  100% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.18);
    filter: drop-shadow(0 0 28px rgba(239, 68, 68, 0.85));
  }
  70% {
    transform: scale(1.08);
  }
}

@keyframes raid-glow-pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  35% {
    opacity: 1;
  }
}

@keyframes raid-enemy-hit {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  50% {
    transform: translateX(8px);
  }
}

@keyframes raid-screen-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(4px);
  }
}

/* Step 1 music picker */
.raid-music-select-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.raid-music-select-row .raid-music-select {
  flex: 1;
  min-width: 0;
}

.raid-music-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  background: var(--color-brand-hover-bg);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

.raid-music-preview-btn:hover:not(:disabled) {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.raid-music-preview-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.raid-music-preview-btn--playing {
  background: #4338ca;
  border-color: #4338ca;
  color: #fff;
}

.raid-help--muted {
  color: #94a3b8 !important;
  font-style: italic;
}

/* Raid complete, dramatic victory / defeat overlay */
.raid-complete-overlay {
  position: fixed;
  inset: 0;
  z-index: 13100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: raidCompleteFadeIn 0.35s ease;
}

@keyframes raidCompleteFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.raid-complete-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  backdrop-filter: blur(10px);
}

.raid-complete-fireworks {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.raid-firework {
  position: absolute;
  width: 0;
  height: 0;
}

.raid-firework-flash {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: hsl(var(--hue), 100%, 78%);
  box-shadow:
    0 0 18px 6px hsla(var(--hue), 100%, 68%, 0.85),
    0 0 40px 12px hsla(var(--hue), 100%, 58%, 0.35);
  animation: raidFireworkFlash 0.45s ease-out forwards;
}

.raid-firework-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--size, 4px);
  height: var(--size, 4px);
  margin: calc(var(--size, 4px) / -2) 0 0 calc(var(--size, 4px) / -2);
  border-radius: 50%;
  background: hsl(var(--hue), 96%, 64%);
  box-shadow: 0 0 6px 1px hsla(var(--hue), 100%, 62%, 0.75);
  opacity: 0;
  animation: raidFireworkSpark 0.95s var(--delay, 0s) ease-out forwards;
}

@keyframes raidFireworkFlash {
  0% {
    transform: scale(0.2);
    opacity: 1;
  }
  40% {
    transform: scale(1.4);
    opacity: 1;
  }
  100% {
    transform: scale(0.6);
    opacity: 0;
  }
}

@keyframes raidFireworkSpark {
  0% {
    opacity: 1;
    transform: rotate(var(--a)) translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(var(--a)) translateX(var(--dist)) scale(0.15);
  }
}

.raid-complete-overlay--victory .raid-complete-backdrop {
  background: radial-gradient(ellipse 70% 55% at 50% 35%, rgba(124, 58, 237, 0.45) 0%, rgba(15, 10, 40, 0.92) 70%);
}

.raid-complete-overlay--defeat .raid-complete-backdrop {
  background: radial-gradient(ellipse 75% 60% at 50% 40%, rgba(127, 29, 29, 0.55) 0%, rgba(10, 5, 5, 0.94) 68%);
}

.raid-complete-stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(96vw, 520px);
}

.raid-complete-rays {
  position: absolute;
  width: 560px;
  height: 560px;
  pointer-events: none;
  animation: raidCompleteRaysSpin 10s linear infinite;
}

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

.raid-complete-ray {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 260px;
  transform-origin: top center;
  transform: translateX(-50%) rotate(var(--r));
  background: linear-gradient(to bottom, rgba(250, 204, 21, 0.55), transparent);
  border-radius: 2px;
}

.raid-complete-smoke {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 60%, rgba(239, 68, 68, 0.15), transparent 55%);
  animation: raidCompleteSmokePulse 2.5s ease-in-out infinite;
}

@keyframes raidCompleteSmokePulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}

.raid-complete-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.raid-complete-particle {
  --d: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  animation: raidCompleteParticle 2.4s calc(var(--d) * 0.07s) ease-out infinite;
}

.raid-complete-overlay--victory .raid-complete-particle {
  background: hsl(calc(var(--d) * 16deg + 42deg), 92%, 62%);
}

.raid-complete-overlay--defeat .raid-complete-particle {
  background: hsl(calc(var(--d) * 12deg + 350deg), 80%, 52%);
}

@keyframes raidCompleteParticle {
  0% { transform: translate(-50%, -50%) rotate(calc(var(--d) * 16deg)) translateX(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) rotate(calc(var(--d) * 16deg)) translateX(210px); opacity: 0; }
}

.raid-complete-burst {
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  animation: raidCompleteBurst 1.2s ease-out forwards;
}

.raid-complete-overlay--victory .raid-complete-burst {
  background: radial-gradient(circle, rgba(250, 204, 21, 0.35) 0%, transparent 70%);
}

.raid-complete-overlay--defeat .raid-complete-burst {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.35) 0%, transparent 70%);
}

@keyframes raidCompleteBurst {
  0% { transform: scale(0.2); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.raid-complete-card {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.75rem 1.75rem;
  border-radius: 24px;
  color: #fff;
  animation: raidCompleteCardPop 0.55s cubic-bezier(0.34, 1.4, 0.64, 1) 0.1s both;
}

.raid-complete-overlay--victory .raid-complete-card {
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 42%, #1e1b4b 100%);
  border: 3px solid #facc15;
  box-shadow:
    0 0 0 6px rgba(250, 204, 21, 0.18),
    0 32px 100px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.raid-complete-overlay--defeat .raid-complete-card {
  background: linear-gradient(180deg, #1c0a0a 0%, #450a0a 45%, #1c0a0a 100%);
  border: 3px solid #ef4444;
  box-shadow:
    0 0 0 6px rgba(239, 68, 68, 0.15),
    0 32px 100px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

@keyframes raidCompleteCardPop {
  0% { transform: scale(0.75) translateY(24px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.raid-complete-flash-ring {
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  pointer-events: none;
  animation: raidCompleteFlashRing 0.9s ease-out 0.15s forwards;
  opacity: 0;
}

.raid-complete-overlay--victory .raid-complete-flash-ring {
  border: 2px solid rgba(250, 204, 21, 0.8);
}

.raid-complete-overlay--defeat .raid-complete-flash-ring {
  border: 2px solid rgba(239, 68, 68, 0.7);
}

@keyframes raidCompleteFlashRing {
  0% { transform: scale(0.95); opacity: 0.9; }
  100% { transform: scale(1.08); opacity: 0; }
}

.raid-complete-icon-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 1rem;
}

.raid-complete-boss-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
  animation: raidCompleteBossReveal 0.6s ease 0.2s both;
}

.raid-complete-overlay--defeat .raid-complete-boss-img {
  filter: drop-shadow(0 0 18px rgba(239, 68, 68, 0.5)) grayscale(0.35);
}

@keyframes raidCompleteBossReveal {
  0% { transform: scale(0.5) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.raid-complete-icon-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.raid-complete-overlay--victory .raid-complete-icon-badge {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #422006;
}

.raid-complete-overlay--defeat .raid-complete-icon-badge {
  background: linear-gradient(135deg, #ef4444, #991b1b);
  color: #fff;
}

.raid-complete-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.9;
}

.raid-complete-overlay--victory .raid-complete-kicker {
  color: #fde68a;
}

.raid-complete-overlay--defeat .raid-complete-kicker {
  color: #fca5a5;
}

.raid-complete-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 800;
}

.raid-complete-headline {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
}

.raid-complete-overlay--victory .raid-complete-headline {
  color: #fde047;
  text-shadow: 0 0 24px rgba(250, 204, 21, 0.45);
}

.raid-complete-overlay--defeat .raid-complete-headline {
  color: #f87171;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.raid-complete-subtitle {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  line-height: 1.45;
  opacity: 0.88;
}

.raid-complete-rewards {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.raid-complete-reward {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  font-weight: 800;
  color: #fde68a;
}

.raid-complete-reward i {
  color: #facc15;
}

.raid-complete-actions {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 0.25rem;
}

.raid-complete-overlay .raid-complete-dismiss {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  max-width: calc(100% - 1rem);
  min-width: 200px;
  margin: 0;
  font-weight: 800;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .raid-complete-overlay .raid-complete-dismiss {
    width: fit-content;
    min-width: 180px;
  }
}

.raid-complete-overlay--victory .raid-complete-dismiss {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #422006;
  border: none;
}

.raid-complete-overlay--defeat .raid-complete-dismiss {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  border: none;
}

/* Pre-start targeting modal */
.raid-stealth-overlay {
  position: fixed;
  inset: 0;
  z-index: 13200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: raid-stealth-fade-in 0.25s ease;
}

.raid-stealth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.raid-stealth-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 420px);
  padding: 1.5rem 1.35rem 1.25rem;
  border-radius: 18px;
  background: linear-gradient(160deg, #1e1b4b 0%, #312e81 55%, #1e293b 100%);
  color: #f8fafc;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(167, 139, 250, 0.35);
}

.raid-stealth-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
  font-size: 1.5rem;
}

.raid-stealth-title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #ede9fe;
  width: 100%;
}

.raid-stealth-body,
.raid-stealth-new-target {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #e2e8f0;
  width: 100%;
}

.raid-stealth-new-target {
  font-weight: 700;
  color: #fcd34d;
}

.raid-stealth-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 0.75rem;
}

.raid-stealth-dismiss {
  margin: 0;
  min-width: 8rem;
}

@keyframes raid-stealth-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.raid-targeting-overlay {
  position: fixed;
  inset: 0;
  z-index: 13150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.raid-targeting-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
}

.raid-targeting-card {
  position: relative;
  z-index: 1;
  width: min(96vw, 640px);
  max-height: min(92vh, 820px);
  overflow: auto;
  border-radius: 18px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  padding: 1.5rem 1.5rem 1.25rem;
}

.raid-targeting-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.raid-targeting-header p {
  margin: 0 0 1rem;
  color: var(--color-text-secondary);
  line-height: 1.45;
}

.raid-targeting-options {
  display: grid;
  gap: 0.65rem;
}

.raid-targeting-option {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.raid-targeting-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.raid-targeting-option--selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.06);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

.raid-targeting-option-icon {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
}

.raid-targeting-option-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.raid-targeting-option-title {
  font-weight: 800;
  font-size: 1rem;
}

.raid-targeting-option-desc {
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.4;
}

.raid-targeting-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.raid-battle-targets-body {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
}

.raid-battle-targets-kind {
  font-weight: 800;
  color: #fde68a;
}

.raid-battle-target-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.raid-battle-target-refresh:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.55);
}

.raid-battle-target-refresh:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.raid-battle-target-refresh--spinning i {
  animation: raid-target-refresh-spin 0.65s linear infinite;
}

@keyframes raid-target-refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Auto-create raid modal */
.raid-auto-create-modal {
  width: min(580px, 94vw);
}

.raid-auto-create-modal .modal-content {
  padding: 1.25rem 1.5rem 1.5rem;
}

.raid-auto-form .form-group {
  margin-bottom: 0;
}

.raid-auto-form .form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2d2848;
  margin-bottom: 0.4rem;
}

.raid-auto-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin-bottom: 1.35rem;
}

.raid-auto-field--name {
  grid-column: 1 / -1;
}

.raid-auto-grid input,
.raid-auto-grid select {
  width: 100%;
  box-sizing: border-box;
}

.raid-auto-tags {
  margin-bottom: 1.35rem;
}

.raid-auto-tags input {
  width: 100%;
  box-sizing: border-box;
}

.raid-auto-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  max-height: 132px;
  overflow-y: auto;
  background: var(--color-background-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.raid-auto-tag-chip {
  border: 1px solid color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.2;
}

.raid-auto-tag-chip:hover {
  background: var(--color-brand-hover-bg);
  border-color: var(--color-primary);
}

.raid-auto-tag-chip.active {
  background: #7c73ff;
  border-color: #6b63e0;
  color: #fff;
}

.raid-auto-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.35rem;
}

.raid-auto-create-modal .raid-auto-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0.75rem 0.85rem;
  background: var(--color-background-alt);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.raid-auto-create-modal .raid-auto-toggle .toggle-text {
  color: var(--color-text);
  white-space: normal;
}

.raid-auto-create-modal .raid-auto-toggle .toggle-slider {
  flex-shrink: 0;
  background: var(--color-border) !important;
  border: 1px solid var(--color-border) !important;
}

.raid-auto-create-modal .raid-auto-toggle .toggle-slider::after {
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(31, 26, 53, 0.18);
}

.raid-auto-create-modal .raid-auto-toggle .toggle-checkbox:checked + .toggle-slider {
  background: #7c73ff !important;
  border-color: #6b63e0 !important;
}

.raid-auto-actions {
  display: flex;
  gap: 0.85rem;
  margin: 0;
  padding-top: 1.1rem;
  border-top: 1px solid #ddd8ef;
}

.raid-auto-actions .btn {
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 480px) {
  .raid-auto-grid {
    grid-template-columns: 1fr;
  }
}

/* Raid / dungeon wizard - Step 1 grouped panels */
.raid-wizard-step1 {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 4px;
}

.raid-wizard-step1-header {
  margin-bottom: 2px;
}

.raid-wizard-step1-header h3 {
  margin: 0 0 6px;
}

.raid-wizard-step1-intro {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-text-secondary);
}

.raid-wizard-panel {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(124, 115, 255, 0.18);
  background: rgba(124, 115, 255, 0.04);
}

.raid-wizard-panel + .raid-wizard-panel {
  margin-top: 0;
}

.raid-wizard-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.raid-wizard-panel-title i {
  color: var(--color-primary);
  opacity: 0.9;
}

.raid-wizard-panel--rewards .raid-wizard-reward-row {
  margin-bottom: 0;
}

.raid-wizard-panel--dungeon-rules .raid-wizard-repeat-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(124, 115, 255, 0.2);
}

.raid-wizard-repeat-block .toggle-group {
  margin-bottom: 4px;
}

.raid-critical-options {
  gap: 8px;
}

.raid-critical-options .raid-help {
  margin: 0 0 6px 50px;
}

.raid-critical-options .toggle-label + .raid-help {
  margin-top: -2px;
}

.raid-repeat-options-row {
  margin-top: 10px;
  align-items: end;
}

.raids-white-theme .raid-wizard-panel {
  background: rgba(124, 115, 255, 0.05) !important;
  border-color: rgba(124, 115, 255, 0.2) !important;
}

html[data-theme="dark"] .raids-white-theme .raid-wizard-panel {
  background: rgba(124, 115, 255, 0.08) !important;
}

html[data-theme="dark"] .raids-white-theme .raid-wizard-step1-intro {
  color: var(--color-text-secondary);
  opacity: 1;
}

/* Wrong-answer damage field: avoid light pink panel + theme label color clash */
html[data-theme="dark"] .raid-monster-damage-field,
:root:not([data-theme="light"]) .raid-monster-damage-field {
  background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

html[data-theme="dark"] .raid-monster-damage-field label,
html[data-theme="dark"] .raids-white-theme .raid-monster-damage-field label,
html[data-theme="dark"] .raid-monster-damage-suffix,
html[data-theme="dark"] .raids-white-theme .raid-monster-damage-suffix,
html[data-theme="dark"] .raid-monster-damage-help,
html[data-theme="dark"] .raids-white-theme .raid-monster-damage-help,
:root:not([data-theme="light"]) .raid-monster-damage-field label,
:root:not([data-theme="light"]) .raids-white-theme .raid-monster-damage-field label,
:root:not([data-theme="light"]) .raid-monster-damage-suffix,
:root:not([data-theme="light"]) .raids-white-theme .raid-monster-damage-suffix,
:root:not([data-theme="light"]) .raid-monster-damage-help,
:root:not([data-theme="light"]) .raids-white-theme .raid-monster-damage-help {
  color: #fecaca !important;
}

html[data-theme="dark"] .raid-monster-damage-crit,
html[data-theme="dark"] .raids-white-theme .raid-monster-damage-crit,
:root:not([data-theme="light"]) .raid-monster-damage-crit,
:root:not([data-theme="light"]) .raids-white-theme .raid-monster-damage-crit {
  color: #fbbf24 !important;
}

html[data-theme="dark"] .raid-monster-damage-input-row input,
html[data-theme="dark"] .raids-white-theme .raid-monster-damage-input-row input,
:root:not([data-theme="light"]) .raid-monster-damage-input-row input,
:root:not([data-theme="light"]) .raids-white-theme .raid-monster-damage-input-row input {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fff;
}

html[data-theme="dark"] .raid-boss-damage-progress--warn,
html[data-theme="dark"] .raids-white-theme .raid-boss-damage-progress--warn,
:root:not([data-theme="light"]) .raid-boss-damage-progress--warn,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-damage-progress--warn {
  background: rgba(120, 53, 15, 0.55) !important;
  border-color: rgba(251, 191, 36, 0.55) !important;
  color: #fcd34d !important;
}

html[data-theme="dark"] .raid-boss-damage-progress--ok,
html[data-theme="dark"] .raids-white-theme .raid-boss-damage-progress--ok,
:root:not([data-theme="light"]) .raid-boss-damage-progress--ok,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-damage-progress--ok {
  background: rgba(20, 83, 45, 0.55) !important;
  border-color: rgba(134, 239, 172, 0.5) !important;
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .raid-boss-damage-progress-label,
html[data-theme="dark"] .raids-white-theme .raid-boss-damage-progress-label,
html[data-theme="dark"] .raid-boss-damage-progress-stats,
html[data-theme="dark"] .raids-white-theme .raid-boss-damage-progress-stats,
html[data-theme="dark"] .raid-boss-damage-progress-stats strong,
html[data-theme="dark"] .raids-white-theme .raid-boss-damage-progress-stats strong,
html[data-theme="dark"] .raid-boss-damage-progress-help,
html[data-theme="dark"] .raids-white-theme .raid-boss-damage-progress-help,
:root:not([data-theme="light"]) .raid-boss-damage-progress-label,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-damage-progress-label,
:root:not([data-theme="light"]) .raid-boss-damage-progress-stats,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-damage-progress-stats,
:root:not([data-theme="light"]) .raid-boss-damage-progress-stats strong,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-damage-progress-stats strong,
:root:not([data-theme="light"]) .raid-boss-damage-progress-help,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-damage-progress-help {
  color: inherit !important;
  opacity: 1;
}

html[data-theme="dark"] .raid-boss-damage-status--ok,
html[data-theme="dark"] .raids-white-theme .raid-boss-damage-status--ok,
:root:not([data-theme="light"]) .raid-boss-damage-status--ok,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-damage-status--ok {
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .raid-boss-damage-status--warn,
html[data-theme="dark"] .raids-white-theme .raid-boss-damage-status--warn,
:root:not([data-theme="light"]) .raid-boss-damage-status--warn,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-damage-status--warn {
  color: #fbbf24 !important;
}

html[data-theme="dark"] .raid-boss-panel--lineup,
html[data-theme="dark"] .raids-white-theme .raid-boss-panel--lineup,
:root:not([data-theme="light"]) .raid-boss-panel--lineup,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-panel--lineup {
  background: var(--color-background-secondary) !important;
  border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border)) !important;
  color: var(--color-text) !important;
}

html[data-theme="dark"] .raid-boss-panel--lineup h4,
html[data-theme="dark"] .raids-white-theme .raid-boss-panel--lineup h4,
html[data-theme="dark"] .raid-boss-panel--lineup .toggle-label,
html[data-theme="dark"] .raids-white-theme .raid-boss-panel--lineup .toggle-label,
html[data-theme="dark"] .raid-boss-panel--lineup .raid-boss-panel-subtitle,
html[data-theme="dark"] .raids-white-theme .raid-boss-panel--lineup .raid-boss-panel-subtitle,
html[data-theme="dark"] .raid-boss-panel--lineup .raid-boss-random-toggle,
html[data-theme="dark"] .raids-white-theme .raid-boss-panel--lineup .raid-boss-random-toggle,
:root:not([data-theme="light"]) .raid-boss-panel--lineup h4,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-panel--lineup h4,
:root:not([data-theme="light"]) .raid-boss-panel--lineup .toggle-label,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-panel--lineup .toggle-label,
:root:not([data-theme="light"]) .raid-boss-panel--lineup .raid-boss-panel-subtitle,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-panel--lineup .raid-boss-panel-subtitle,
:root:not([data-theme="light"]) .raid-boss-panel--lineup .raid-boss-random-toggle,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-panel--lineup .raid-boss-random-toggle {
  color: var(--color-text) !important;
}

html[data-theme="dark"] .raid-boss-panel--lineup .raid-boss-panel-subtitle,
html[data-theme="dark"] .raids-white-theme .raid-boss-panel--lineup .raid-boss-panel-subtitle,
:root:not([data-theme="light"]) .raid-boss-panel--lineup .raid-boss-panel-subtitle,
:root:not([data-theme="light"]) .raids-white-theme .raid-boss-panel--lineup .raid-boss-panel-subtitle {
  color: var(--color-text-secondary) !important;
}

/* Review step: theme-aware cards (avoid light panels + light text) */
html[data-theme="dark"] .raid-review-monster,
html[data-theme="dark"] .raids-white-theme .raid-review-monster,
html[data-theme="dark"] .raid-review-boss-q,
html[data-theme="dark"] .raids-white-theme .raid-review-boss-q,
:root:not([data-theme="light"]) .raid-review-monster,
:root:not([data-theme="light"]) .raids-white-theme .raid-review-monster,
:root:not([data-theme="light"]) .raid-review-boss-q,
:root:not([data-theme="light"]) .raids-white-theme .raid-review-boss-q {
  background: var(--color-background-alt) !important;
  border-color: var(--color-border) !important;
  color: var(--color-text) !important;
}

html[data-theme="dark"] .raid-review-monster-meta,
html[data-theme="dark"] .raids-white-theme .raid-review-monster-meta,
html[data-theme="dark"] .raid-review-boss-q-text,
html[data-theme="dark"] .raids-white-theme .raid-review-boss-q-text,
:root:not([data-theme="light"]) .raid-review-monster-meta,
:root:not([data-theme="light"]) .raids-white-theme .raid-review-monster-meta,
:root:not([data-theme="light"]) .raid-review-boss-q-text,
:root:not([data-theme="light"]) .raids-white-theme .raid-review-boss-q-text {
  color: var(--color-text-secondary) !important;
}

html[data-theme="dark"] .raid-review-monster-meta strong,
html[data-theme="dark"] .raids-white-theme .raid-review-monster-meta strong,
html[data-theme="dark"] .raid-review-boss-meta p,
html[data-theme="dark"] .raids-white-theme .raid-review-boss-meta p,
html[data-theme="dark"] .raid-review-card h4,
html[data-theme="dark"] .raids-white-theme .raid-review-card h4,
:root:not([data-theme="light"]) .raid-review-monster-meta strong,
:root:not([data-theme="light"]) .raids-white-theme .raid-review-monster-meta strong,
:root:not([data-theme="light"]) .raid-review-boss-meta p,
:root:not([data-theme="light"]) .raids-white-theme .raid-review-boss-meta p,
:root:not([data-theme="light"]) .raid-review-card h4,
:root:not([data-theme="light"]) .raids-white-theme .raid-review-card h4 {
  color: var(--color-text) !important;
}

html[data-theme="dark"] .raid-review-boss img,
html[data-theme="dark"] .raids-white-theme .raid-review-boss img,
:root:not([data-theme="light"]) .raid-review-boss img,
:root:not([data-theme="light"]) .raids-white-theme .raid-review-boss img {
  background: var(--color-background-alt) !important;
  border-color: var(--color-border) !important;
}

html[data-theme="dark"] .raid-review-ok,
html[data-theme="dark"] .raids-white-theme .raid-review-ok,
:root:not([data-theme="light"]) .raid-review-ok,
:root:not([data-theme="light"]) .raids-white-theme .raid-review-ok {
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .raid-review-warn,
html[data-theme="dark"] .raids-white-theme .raid-review-warn,
:root:not([data-theme="light"]) .raid-review-warn,
:root:not([data-theme="light"]) .raids-white-theme .raid-review-warn {
  color: #fbbf24 !important;
}

@media (max-width: 640px) {
  .raid-repeat-options-row {
    grid-template-columns: 1fr;
  }
}
