/* SessionList.module.css */

._container_upchf_3 {
  max-width: 640px;
  margin: 0 auto;
}

._container_upchf_3._mobile_upchf_8 {
  padding: 20px 16px;
}

._container_upchf_3._desktop_upchf_12 {
  padding: 32px 24px;
}

._header_upchf_16 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(var(--theme-border-rgb), 0.12);
}

._headerTitle_upchf_25 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--theme-accent);
  background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-accent-mid) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

._newStoryButton_upchf_36 {
  background: rgba(var(--theme-border-rgb), 0.08);
  border: 1px solid rgba(var(--theme-border-rgb), 0.2);
  border-radius: 8px;
  color: #e2e0f0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  touch-action: manipulation;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

._newStoryButton_upchf_36:hover {
  background: rgba(var(--theme-border-rgb), 0.14);
  border-color: rgba(var(--theme-border-rgb), 0.38);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--theme-border-rgb), 0.15);
}

._newStoryButton_upchf_36:active {
  transform: scale(0.97);
  box-shadow: none;
}

._newStoryButton_upchf_36._mobile_upchf_8 {
  padding: 12px 22px;
  min-height: 44px;
  margin-bottom: 16px;
}

._newStoryButton_upchf_36._desktop_upchf_12 {
  padding: 12px 22px;
  margin-bottom: 16px;
}

._emptyState_upchf_72 {
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  text-align: center;
  padding: 60px 20px;
  line-height: 1.7;
  background: rgba(var(--theme-border-rgb), 0.04);
  border: 1px dashed rgba(var(--theme-border-rgb), 0.2);
  border-radius: 12px;
}

._emptyStateIcon_upchf_83 {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.4;
}

._sessionList_upchf_89 {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

._sessionItem_upchf_98 {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 14px 16px;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

._sessionItem_upchf_98._active_upchf_108 {
  background: rgba(var(--theme-border-rgb), 0.12);
  border: 1px solid rgba(var(--theme-border-rgb), 0.5);
  box-shadow: 0 2px 12px rgba(var(--theme-border-rgb), 0.15), inset 0 1px 0 rgba(var(--theme-border-rgb), 0.1);
}

._sessionItem_upchf_98._active_upchf_108:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(var(--theme-border-rgb), 0.2), inset 0 1px 0 rgba(var(--theme-border-rgb), 0.15);
  border-color: rgba(var(--theme-border-rgb), 0.6);
}

._sessionItem_upchf_98._active_upchf_108:active {
  transform: scale(0.99);
}

._sessionItem_upchf_98._inactive_upchf_124 {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(var(--theme-border-rgb), 0.15);
}

._sessionItem_upchf_98._inactive_upchf_124:hover {
  transform: translateY(-1px);
  background: rgba(var(--theme-border-rgb), 0.06);
  border-color: rgba(var(--theme-border-rgb), 0.3);
  box-shadow: 0 2px 12px rgba(var(--theme-border-rgb), 0.1);
}

._sessionItem_upchf_98._inactive_upchf_124:active {
  transform: scale(0.99);
}

._sessionItem_upchf_98._mobile_upchf_8 {
  flex-direction: column;
  gap: 12px;
}

._sessionItem_upchf_98._mobile_upchf_8 ._sessionActions_upchf_145 {
  justify-content: flex-start;
}

._sessionItem_upchf_98:nth-child(1) { animation-delay: 0.04s; }
._sessionItem_upchf_98:nth-child(2) { animation-delay: 0.08s; }
._sessionItem_upchf_98:nth-child(3) { animation-delay: 0.12s; }
._sessionItem_upchf_98:nth-child(4) { animation-delay: 0.16s; }
._sessionItem_upchf_98:nth-child(5) { animation-delay: 0.20s; }
._sessionItem_upchf_98:nth-child(n+6) { animation-delay: 0.24s; }

._sessionInfo_upchf_156 {
  flex: 1;
  min-width: 0;
}

._sessionTitleRow_upchf_161 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

._sessionTitle_upchf_161 {
  font-size: 15px;
  font-weight: 600;
  color: #e2e0f0;
  margin-bottom: 4px;
}

._engineBadge_upchf_175 {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 999px;
}

._engineBadge_upchf_175._narrative_upchf_182 {
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.1);
}

._engineBadge_upchf_175._survival_upchf_188 {
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.1);
}

._engineBadge_upchf_175._bible_upchf_194 {
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.4);
  background: rgba(192, 132, 252, 0.1);
}

._activeBadge_upchf_200 {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--theme-accent);
  border: 1px solid rgba(var(--theme-accent-rgb), 0.4);
  padding: 2px 6px;
  border-radius: 999px;
}

._sessionGenre_upchf_209 {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
  overflow-wrap: break-word;
  word-break: break-word;
}

._sessionMeta_upchf_217 {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  overflow-wrap: break-word;
  word-break: break-word;
}

._sessionActions_upchf_145 {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

._actionButton_upchf_231 {
  padding: 10px 16px;
  margin: 4px;
  background: rgba(var(--theme-border-rgb), 0.08);
  border: 1px solid rgba(var(--theme-border-rgb), 0.28);
  border-radius: 8px;
  color: #e2e0f0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

._actionButton_upchf_231:hover {
  background: rgba(var(--theme-border-rgb), 0.14);
  border-color: rgba(var(--theme-border-rgb), 0.38);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--theme-border-rgb), 0.15);
}

._actionButton_upchf_231:active {
  transform: scale(0.97);
}

._actionButton_upchf_231._mobile_upchf_8 {
  padding: 10px 16px;
  min-height: 44px;
  touch-action: manipulation;
}

._dangerButton_upchf_262 {
  padding: 10px 16px;
  margin: 4px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  color: #fca5a5;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

._dangerButton_upchf_262:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.12);
}

._dangerButton_upchf_262:active {
  transform: scale(0.97);
}

._dangerButton_upchf_262._mobile_upchf_8 {
  padding: 10px 16px;
  min-height: 44px;
  touch-action: manipulation;
  border-color: rgba(239, 68, 68, 0.35);
}
/* SessionSetup.module.css */

/* Progress bar */
._progressTrack_5xfjf_4 {
  height: 3px;
  background: rgba(var(--theme-border-rgb), 0.15);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}

._progressFill_5xfjf_12 {
  height: 100%;
  transition: width 0.35s ease;
  border-radius: 2px;
}

._progressFill_5xfjf_12._complete_5xfjf_18 {
  background: linear-gradient(90deg, var(--theme-accent-mid), #34d399);
}

._progressFill_5xfjf_12._incomplete_5xfjf_22 {
  background: linear-gradient(90deg, var(--theme-accent-mid), var(--theme-accent));
}

/* Preset card */
._presetCard_5xfjf_27 {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  position: relative;
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
}

._presetCard_5xfjf_27:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--theme-border-rgb), 0.55);
  box-shadow: 0 4px 16px rgba(var(--theme-border-rgb), 0.15);
}

._presetCard_5xfjf_27:active {
  transform: scale(0.97);
}

._presetCard_5xfjf_27._selected_5xfjf_52 {
  background: rgba(var(--theme-border-rgb), 0.22);
  border: 1px solid rgba(var(--theme-accent-mid), 0.8);
  box-shadow: 0 0 12px rgba(var(--theme-border-rgb), 0.25);
}

._presetCard_5xfjf_27._unselected_5xfjf_58 {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(var(--theme-border-rgb), 0.2);
}

._presetCheck_5xfjf_63 {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  color: var(--theme-accent-mid);
  letter-spacing: 0.5px;
}

._presetEmoji_5xfjf_72 {
  font-size: 22px;
  line-height: 1;
}

._presetLabel_5xfjf_77 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

._presetLabel_5xfjf_77._selected_5xfjf_52 {
  color: var(--theme-accent);
}

._presetLabel_5xfjf_77._unselected_5xfjf_58 {
  color: #e2e0f0;
}

._presetVibe_5xfjf_94 {
  font-size: 10px;
  color: rgba(var(--theme-accent-rgb), 0.7); /* WCAG AA fixed from 0.5 */
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

._presetAbility_5xfjf_103 {
  margin-top: 4px;
  padding: 5px 7px;
  background: rgba(var(--theme-border-rgb), 0.18);
  border: 1px solid rgba(var(--theme-border-rgb), 0.35);
  border-radius: 4px;
  font-size: 9px;
  color: #fbbf24;
  line-height: 1.4;
  letter-spacing: 0.3px;
}

/* Field label */
._fieldLabel_5xfjf_116 {
  font-size: 10px;
  color: rgba(var(--theme-accent-rgb), 0.7); /* WCAG AA fixed from 0.5 */
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

._fieldLabelOptional_5xfjf_126 {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 400;
  letter-spacing: 0;
}

/* Input style */
._input_5xfjf_133 {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(var(--theme-border-rgb), 0.3);
  border-radius: 4px;
  color: #e2e0f0;
  padding: 12px 10px;
  font-size: 16px;
  font-family: 'Courier New', Courier, monospace;
  width: 100%;
  box-sizing: border-box;
  touch-action: manipulation;
}

._input-resizable_5xfjf_146 {
  resize: vertical;
}

/* Main form */
._form_5xfjf_152 {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 720px;
  margin: 0 auto;
}

._form_5xfjf_152._mobile_5xfjf_160 {
  padding: 20px 16px;
}

._form_5xfjf_152._desktop_5xfjf_164 {
  padding: 32px 24px;
}

/* Header */
._header_5xfjf_169 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

._headerTitle_5xfjf_175 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--theme-accent);
  text-transform: uppercase;
}

._headerSubtitle_5xfjf_183 {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(var(--theme-accent-rgb), 0.65); /* WCAG AA fixed from 0.45 */
}

._levelBadge_5xfjf_189 {
  padding: 4px 10px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 20px;
  font-size: 10px;
  color: #fbbf24;
  letter-spacing: 1.5px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 12px;
}

/* Progress section */
._progressSection_5xfjf_203 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

._progressHeader_5xfjf_209 {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: rgba(var(--theme-accent-rgb), 0.6); /* WCAG AA fixed from 0.35 */
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* Presets section */
._presetsSection_5xfjf_219 {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

._sectionHeading_5xfjf_225 {
  font-size: 10px;
  color: rgba(var(--theme-accent-rgb), 0.7); /* WCAG AA fixed from 0.5 */
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

._presetGrid_5xfjf_232 {
  display: grid;
  gap: 10px;
}

._presetGrid_5xfjf_232._mobile_5xfjf_160 {
  grid-template-columns: repeat(2, 1fr);
}

._presetGrid_5xfjf_232._desktop_5xfjf_164 {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

._togglePresetsButton_5xfjf_245 {
  align-self: flex-start;
  padding: 12px 18px;
  min-height: 44px;
  margin-top: 8px;
  background: rgba(var(--theme-border-rgb), 0.08);
  border: 1px solid rgba(var(--theme-border-rgb), 0.25);
  border-radius: 20px;
  color: rgba(var(--theme-accent-rgb), 0.7);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.5px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

._togglePresetsButton_5xfjf_245:hover {
  background: rgba(var(--theme-border-rgb), 0.14);
  border-color: rgba(var(--theme-border-rgb), 0.4);
  color: rgba(var(--theme-accent-rgb), 0.9);
}

._togglePresetsButton_5xfjf_245:active {
  transform: scale(0.97);
}

/* Engine selector */
._engineSection_5xfjf_272 {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

._engineGrid_5xfjf_278 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

._engineCard_5xfjf_284 {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  position: relative;
}

._engineCard_5xfjf_284:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--theme-border-rgb), 0.5);
  box-shadow: 0 4px 16px rgba(var(--theme-border-rgb), 0.15);
}

._engineCard_5xfjf_284:active {
  transform: scale(0.97);
}

._engineCard_5xfjf_284._selected_5xfjf_52 {
  background: rgba(var(--theme-border-rgb), 0.22);
  border: 1px solid rgba(var(--theme-accent-mid), 0.8);
  box-shadow: 0 0 12px rgba(var(--theme-border-rgb), 0.25);
}

._engineCard_5xfjf_284._unselected_5xfjf_58 {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(var(--theme-border-rgb), 0.2);
}

._engineCheck_5xfjf_317 {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 10px;
  color: var(--theme-accent-mid);
  letter-spacing: 0.5px;
}

._engineLabel_5xfjf_326 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

._engineLabel_5xfjf_326._selected_5xfjf_52 {
  color: var(--theme-accent);
}

._engineLabel_5xfjf_326._unselected_5xfjf_58 {
  color: #e2e0f0;
}

._engineDescription_5xfjf_340 {
  font-size: 10px;
  color: rgba(var(--theme-accent-rgb), 0.7); /* WCAG AA fixed from 0.5 */
  line-height: 1.4;
}

/* Character name section */
._characterSection_5xfjf_347 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

._worldInfo_5xfjf_353 {
  font-size: 10px;
  color: rgba(var(--theme-accent-rgb), 0.6); /* WCAG AA fixed from 0.35 */
  line-height: 1.5;
}

._worldName_5xfjf_359 {
  color: rgba(var(--theme-accent-rgb), 0.7);
}

._abilityHint_5xfjf_363 {
  color: rgba(251, 191, 36, 0.6);
}

._characterHint_5xfjf_367 {
  font-size: 10px;
  color: rgba(var(--theme-accent-rgb), 0.55); /* WCAG AA fixed from 0.25 */
}

/* Advanced section */
._advancedContainer_5xfjf_373 {
  border: 1px solid rgba(var(--theme-border-rgb), 0.15);
  border-radius: 6px;
  overflow: hidden;
}

._advancedToggle_5xfjf_379 {
  width: 100%;
  padding: 14px 16px;
  min-height: 44px;
  border: none;
  background: none;
  color: rgba(var(--theme-accent-rgb), 0.5);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.15s;
}

._advancedToggle_5xfjf_379:hover {
  color: rgba(var(--theme-accent-rgb), 0.75);
}

._advancedToggle_5xfjf_379:active {
  transform: scale(0.97);
}

._advancedToggle_5xfjf_379._expanded_5xfjf_405 {
  background: rgba(var(--theme-border-rgb), 0.1);
}

._advancedToggle_5xfjf_379._collapsed_5xfjf_409 {
  background: transparent;
}

._advancedToggleIcon_5xfjf_413 {
  font-size: 10px;
}

._advancedContent_5xfjf_417 {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-top: 1px solid rgba(var(--theme-border-rgb), 0.1);
}

/* Advanced field */
._advancedField_5xfjf_426 {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

._advancedFieldHeader_5xfjf_432 {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

._advancedFieldLabel_5xfjf_438 {
  font-size: 10px;
  color: rgba(var(--theme-accent-rgb), 0.7); /* WCAG AA fixed from 0.5 */
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

._advancedFieldOptional_5xfjf_445 {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.2);
}

._advancedFieldHint_5xfjf_450 {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.2);
  font-style: italic;
}

._blendToggleLabel_5xfjf_456 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(226, 224, 240, 0.85);
}

._blendContainer_5xfjf_464 {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

._inputsExplanation_5xfjf_470 {
  border: 1px solid rgba(var(--theme-border-rgb), 0.15);
  border-radius: 4px;
  background: rgba(var(--theme-border-rgb), 0.06);
  padding: 10px 12px;
  font-size: 10px;
  line-height: 1.6;
  color: rgba(var(--theme-accent-rgb), 0.75);
}

/* Intro preview */
._introPreview_5xfjf_481 {
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.06);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

._introPreviewHeader_5xfjf_491 {
  font-size: 10px;
  letter-spacing: 1.3px;
  color: rgba(110, 231, 183, 0.85);
}

._introPreviewStatus_5xfjf_497 {
  font-size: 11px;
  color: rgba(167, 243, 208, 0.8);
}

._introPreviewError_5xfjf_502 {
  font-size: 11px;
  color: rgba(254, 202, 202, 0.9);
}

._introPreviewContent_5xfjf_507 {
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.65;
  color: #d1fae5;
  border-top: 1px solid rgba(52, 211, 153, 0.2);
  padding-top: 8px;
}

/* Submit button */
._submitButton_5xfjf_517 {
  padding: 14px 28px;
  min-height: 48px;
  margin-top: 16px;
  border-radius: 6px;
  font-size: 13px;
  letter-spacing: 2.5px;
  font-family: inherit;
  font-weight: 500;
  text-transform: uppercase;
  transition: transform 0.1s, opacity 0.2s, background 0.2s, border-color 0.2s;
}

._submitButton_5xfjf_517._mobile_5xfjf_160 {
  margin-bottom: env(safe-area-inset-bottom, 0px);
}

._submitButton_5xfjf_517._enabled_5xfjf_534 {
  background: rgba(var(--theme-border-rgb), 0.18);
  border: 1px solid rgba(var(--theme-border-rgb), 0.45);
  color: #e2e0f0;
  cursor: pointer;
}

._submitButton_5xfjf_517._enabled_5xfjf_534:hover {
  background: rgba(var(--theme-border-rgb), 0.22);
  border-color: rgba(var(--theme-border-rgb), 0.5);
}

._submitButton_5xfjf_517._enabled_5xfjf_534:active {
  transform: scale(0.98);
}

._submitButton_5xfjf_517._disabled_5xfjf_550 {
  background: rgba(var(--theme-border-rgb), 0.06);
  border: 1px solid rgba(var(--theme-border-rgb), 0.18);
  color: rgba(255, 255, 255, 0.25);
  cursor: not-allowed;
}
._canvas_1pp8r_1 {
  min-height: 0;
  position: relative;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  touch-action: pan-y;
}

._canvas_1pp8r_1._mobile_1pp8r_15 {
  flex: 0 0 auto;
  overflow-y: visible;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  gap: 12px;
}

._canvas_1pp8r_1._desktop_1pp8r_22 {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  scrollbar-gutter: stable;
}

._pagination_1pp8r_29 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(var(--theme-border-rgb), 0.22);
  border-radius: 12px;
  background: rgba(var(--theme-surface-rgb), 0.62);
  animation: _glow_1pp8r_1 3s ease-in-out infinite;
}

._pagination_1pp8r_29._mobile_1pp8r_15 {
  gap: 10px;
  padding: 12px;
}

._pagination-controls_1pp8r_46 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

._pagination-controls_1pp8r_46._mobile_1pp8r_15 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

._pagination-button_1pp8r_60 {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(var(--theme-border-rgb), 0.3);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

._pagination-button_1pp8r_60._mobile_1pp8r_15 {
  padding: 14px 16px;
  font-size: 12px;
  min-height: 44px;
}

._pagination-button_1pp8r_60._enabled_1pp8r_76 {
  padding: 10px 16px;
  background: rgba(var(--theme-border-rgb), 0.12);
  color: #e2e0f0;
  cursor: pointer;
}

._pagination-button_1pp8r_60._enabled_1pp8r_76:hover {
  background: rgba(var(--theme-border-rgb), 0.18);
  border-color: rgba(var(--theme-border-rgb), 0.45);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(var(--theme-border-rgb), 0.15);
}

._pagination-button_1pp8r_60._enabled_1pp8r_76:active {
  transform: scale(0.95);
}

._pagination-button_1pp8r_60._disabled_1pp8r_94 {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(226, 224, 240, 0.5);
  cursor: not-allowed;
}

._jump-label_1pp8r_101 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(226, 224, 240, 0.78);
  font-size: 12px;
  min-width: 0;
}

._jump-label_1pp8r_101._mobile_1pp8r_15 {
  margin-left: 0;
  width: 100%;
  justify-content: space-between;
}

._jump-label_1pp8r_101._desktop_1pp8r_22 {
  margin-left: auto;
  width: auto;
}

._jump-select_1pp8r_121 {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(var(--theme-border-rgb), 0.32);
  background: rgba(var(--theme-bg-rgb), 0.92);
  color: #f5f3ff;
  font-family: inherit;
}

._jump-select_1pp8r_121._mobile_1pp8r_15 {
  min-width: 128px;
  width: 56%;
  font-size: 16px;
}

._jump-select_1pp8r_121._desktop_1pp8r_22 {
  min-width: 180px;
  width: auto;
}

._jump-select_1pp8r_121 {
  max-width: 100%;
}

._page-indicator_1pp8r_145 {
  width: 100%;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--theme-accent-rgb), 0.7); /* WCAG AA fixed from 0.68 */
}

._page-indicator_1pp8r_145._mobile_1pp8r_15 {
  font-size: 10px;
}

._turn-article_1pp8r_157 {
  line-height: 1.75;
  border: 1px solid rgba(var(--theme-border-rgb), 0.24);
  border-left: 3px solid rgba(var(--theme-border-rgb), 0.55);
  border-radius: 12px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(var(--theme-border-rgb), 0.1) 0%, rgba(var(--theme-border-rgb), 0.04) 100%);
  overflow-wrap: anywhere;
  animation: _fadeIn_1pp8r_1 0.4s ease-out both;
}

._turn-article_1pp8r_157._mobile_1pp8r_15 {
  padding: 12px;
}

._turn-header_1pp8r_172 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--theme-accent-rgb), 0.7); /* WCAG AA fixed from 0.72 */
  font-weight: 700;
  text-wrap: balance;
}

._quality-separator_1pp8r_182 {
  height: 1px;
  margin: 10px 0 0;
  background: linear-gradient(90deg, rgba(var(--theme-border-rgb), 0) 0%, rgba(var(--theme-border-rgb), 0.38) 20%, rgba(var(--theme-border-rgb), 0.38) 80%, rgba(var(--theme-border-rgb), 0) 100%);
}

._quality-panel_1pp8r_188 {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(var(--theme-border-rgb), 0.26);
  border-radius: 12px;
  background: rgba(var(--theme-bg-rgb), 0.74);
  transition: box-shadow 0.2s ease;
}

._quality-panel_1pp8r_188._mobile_1pp8r_15 {
  padding: 10px;
}

._quality-header_1pp8r_201 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

._quality-title_1pp8r_208 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--theme-accent-rgb), 0.7); /* WCAG AA fixed from 0.72 */
  font-weight: 700;
  text-wrap: balance;
}

._quality-overall_1pp8r_218 {
  margin: 0;
  font-size: 12px;
  color: #f5f3ff;
}

._quality-metrics_1pp8r_224 {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 8px;
  margin-top: 8px;
  margin-bottom: 0;
  padding: 0;
}

._quality-metric-badge_1pp8r_234 {
  border-radius: 8px;
  border: 1px solid rgba(var(--theme-border-rgb), 0.28);
  padding: 5px 8px;
  font-size: 11px;
  color: rgba(226, 224, 240, 0.82);
  background: rgba(var(--theme-border-rgb), 0.08);
}

._quality-feedback_1pp8r_243 {
  margin: 10px 0 0;
  padding-left: 18px;
  color: rgba(226, 224, 240, 0.82);
  font-size: 12px;
  line-height: 1.6;
  text-wrap: pretty;
}

._turn-action_1pp8r_252 {
  margin-top: 8px;
  font-size: 12px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.65); /* WCAG AA fixed from 0.4 */
  text-wrap: pretty;
}

._error-section_1pp8r_260 {
  border: 1px solid rgba(248, 113, 113, 0.42);
  border-radius: 12px;
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  padding: 12px 14px;
  line-height: 1.6;
  font-size: 12px;
}

._error-section_1pp8r_260._mobile_1pp8r_15 {
  padding: 10px 12px;
}

._live-preview_1pp8r_274 {
  line-height: 1.75;
  border: 1px dashed rgba(var(--theme-border-rgb), 0.4);
  border-left: 2px solid rgba(var(--theme-border-rgb), 0.6);
  border-radius: 8px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(var(--theme-border-rgb), 0.05);
  transition: opacity 0.3s ease;
}

._live-preview_1pp8r_274._mobile_1pp8r_15 {
  padding: 10px 12px;
}

._live-preview-header_1pp8r_289 {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--theme-accent-rgb), 0.7); /* WCAG AA fixed from 0.72 */
  font-weight: 700;
  text-wrap: balance;
}

._status-indicator_1pp8r_299 {
  font-size: 11px;
  letter-spacing: 1px;
  font-style: italic;
  margin: 0;
  padding-left: 16px;
  text-wrap: pretty;
}

._status-indicator_1pp8r_299._mobile_1pp8r_15 {
  padding-left: 12px;
}

._status-indicator_1pp8r_299._summarizing_1pp8r_312 {
  color: rgba(196, 181, 253, 0.5);
  border-left: 2px solid rgba(138, 92, 246, 0.2);
}

._status-indicator_1pp8r_299._guiding_1pp8r_317 {
  color: rgba(251, 191, 36, 0.45);
  border-left: 2px solid rgba(251, 191, 36, 0.2);
}

._witness-section_1pp8r_322 {
  padding: 12px 14px;
  border: 1px solid rgba(138, 92, 246, 0.22);
  border-radius: 10px;
  background: rgba(18, 14, 34, 0.52);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

._witness-section_1pp8r_322._mobile_1pp8r_15 {
  padding: 10px 12px;
}

._witness-header_1pp8r_336 {
  font-size: 10px;
  letter-spacing: 0.5px;
  color: rgba(196, 181, 253, 0.7);
  text-transform: uppercase;
  text-wrap: balance;
}

._witness-entry_1pp8r_344 {
  font-size: 11px;
  color: rgba(226, 224, 240, 0.78);
}
._choice-panel_mxug3_1,
._choicePanel_mxug3_2 {
  flex-shrink: 0;
}

._freeform-lane_mxug3_6,
._freeformLane_mxug3_7 {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

._section-label_mxug3_15,
._sectionLabel_mxug3_16 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(var(--theme-accent-rgb), 0.7); /* WCAG AA fixed from 0.5 */
  text-transform: uppercase;
  text-wrap: balance;
}

._textarea_mxug3_25 {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(var(--theme-border-rgb), 0.3);
  border-radius: 8px;
  color: #e2e0f0;
  padding: 10px;
  font-size: 16px;
  line-height: 1.5;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

._textarea_mxug3_25:disabled {
  opacity: 0.5;
}

._textarea_mxug3_25:focus {
  border-color: rgba(var(--theme-border-rgb), 0.55);
  box-shadow: 0 0 0 2px rgba(var(--theme-border-rgb), 0.1);
  outline: none;
}

._submit-button_mxug3_49,
._submitButton_mxug3_50 {
  background: rgba(var(--theme-border-rgb), 0.16);
  border: 1px solid rgba(var(--theme-border-rgb), 0.4);
  border-radius: 8px;
  color: #e2e0f0;
  padding: 12px 24px;
  min-height: 44px;
  margin-top: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.15s ease;
}

._submit-button_mxug3_49:hover:not(:disabled),
._submitButton_mxug3_50:hover:not(:disabled) {
  background: rgba(var(--theme-border-rgb), 0.2);
  border-color: rgba(var(--theme-border-rgb), 0.5);
}

._submit-button_mxug3_49:active:not(:disabled),
._submitButton_mxug3_50:active:not(:disabled) {
  transform: scale(0.97);
}

._submit-button_mxug3_49:disabled,
._submitButton_mxug3_50:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

._submit-button_mxug3_49:not(:disabled),
._submitButton_mxug3_50:not(:disabled) {
  cursor: pointer;
}

/* Mobile layout */
._mobile-container_mxug3_87,
._mobileContainer_mxug3_88 {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(var(--theme-border-rgb), 0.24);
  background: linear-gradient(180deg, rgba(var(--theme-bg-rgb), 0.94) 0%, rgba(var(--theme-surface-rgb), 0.98) 100%);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.28);
}

._mobile-header_mxug3_99,
._mobileHeader_mxug3_100 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

._mobile-subtitle_mxug3_107,
._mobileSubtitle_mxug3_108 {
  font-size: 12px;
  color: rgba(226, 224, 240, 0.78);
  margin-top: 2px;
  text-wrap: pretty;
}

._mobile-count_mxug3_115,
._mobileCount_mxug3_116 {
  font-size: 11px;
  color: rgba(var(--theme-accent-rgb), 0.56);
  white-space: nowrap;
}

._mobile-tablist_mxug3_122,
._mobileTablist_mxug3_123 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

._mobile-choice-lane_mxug3_129,
._mobileChoiceLane_mxug3_130 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

._mobile-choice-list_mxug3_137,
._mobileChoiceList_mxug3_138 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: visible;
  padding-right: 4px;
  overscroll-behavior-y: contain;
}

._directional-choice-list_mxug3_147,
._directionalChoiceList_mxug3_148 {
  gap: 14px;
  padding-block: 4px;
}

._mobile-choice-button_mxug3_153,
._mobileChoiceButton_mxug3_154 {
  padding: 14px 16px;
  min-height: 56px;
  background: rgba(var(--theme-border-rgb), 0.08);
  border: 1px solid rgba(var(--theme-border-rgb), 0.28);
  border-radius: 8px;
  color: #e2e0f0;
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  text-align: left;
  display: block;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

._directional-choice-button_mxug3_173,
._directionalChoiceButton_mxug3_174 {
  padding: 16px 18px;
  min-height: 68px;
  background: linear-gradient(180deg, rgba(var(--theme-border-rgb), 0.18) 0%, rgba(var(--theme-gradient-stop-rgb), 0.16) 100%);
  border: 1px solid rgba(var(--theme-border-rgb), 0.42);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(var(--theme-border-rgb), 0.08), 0 8px 18px rgba(0, 0, 0, 0.16);
  color: #f5f3ff;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

._mobile-choice-button_mxug3_153:hover:not(:disabled),
._mobileChoiceButton_mxug3_154:hover:not(:disabled) {
  background: rgba(var(--theme-border-rgb), 0.14);
  border-color: rgba(var(--theme-border-rgb), 0.38);
}

._mobile-choice-button_mxug3_153._directional-choice-button_mxug3_173:hover:not(:disabled),
._mobile-choice-button_mxug3_153._directionalChoiceButton_mxug3_174:hover:not(:disabled),
._mobileChoiceButton_mxug3_154._directional-choice-button_mxug3_173:hover:not(:disabled),
._mobileChoiceButton_mxug3_154._directionalChoiceButton_mxug3_174:hover:not(:disabled) {
  background: rgba(var(--theme-border-rgb), 0.2);
  border-color: rgba(var(--theme-border-rgb), 0.5);
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

._mobile-choice-button_mxug3_153:active:not(:disabled),
._mobileChoiceButton_mxug3_154:active:not(:disabled) {
  transform: scale(0.97);
}

._mobile-choice-button_mxug3_153:disabled,
._mobileChoiceButton_mxug3_154:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

._mobile-choice-button_mxug3_153:not(:disabled),
._mobileChoiceButton_mxug3_154:not(:disabled) {
  cursor: pointer;
}

._mobile-custom-lane_mxug3_220,
._mobileCustomLane_mxug3_221 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 42dvh;
}

/* Desktop layout */
._desktop-container_mxug3_229,
._desktopContainer_mxug3_230 {
  border-top: 1px solid rgba(var(--theme-border-rgb), 0.28);
}

._desktop-scroll-area_mxug3_234,
._desktopScrollArea_mxug3_235 {
  padding: 8px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: stretch;
  max-height: 42vh;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  scrollbar-gutter: stable;
}

._desktop-custom-lane_mxug3_251,
._desktopCustomLane_mxug3_252 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

._desktop-choice-lane_mxug3_259,
._desktopChoiceLane_mxug3_260 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}

._desktop-choice-list_mxug3_268,
._desktopChoiceList_mxug3_269 {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

._desktop-choice-list_mxug3_268._has-overflow_mxug3_276,
._desktopChoiceList_mxug3_269._hasOverflow_mxug3_277 {
  overflow-y: auto;
  max-height: 34vh;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

._desktop-choice-button_mxug3_284,
._desktopChoiceButton_mxug3_285 {
  padding: 12px 16px;
  min-height: 44px;
  background: rgba(var(--theme-border-rgb), 0.1);
  border: 1px solid rgba(var(--theme-border-rgb), 0.3);
  border-radius: 8px;
  color: #e2e0f0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.55;
  font-family: inherit;
  text-align: left;
  display: block;
  height: auto;
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

._desktop-choice-button_mxug3_284._directional-choice-button_mxug3_173,
._desktop-choice-button_mxug3_284._directionalChoiceButton_mxug3_174,
._desktopChoiceButton_mxug3_285._directional-choice-button_mxug3_173,
._desktopChoiceButton_mxug3_285._directionalChoiceButton_mxug3_174 {
  padding: 16px 18px;
  min-height: 60px;
  background: linear-gradient(180deg, rgba(var(--theme-border-rgb), 0.18) 0%, rgba(var(--theme-gradient-stop-rgb), 0.16) 100%);
  border: 1px solid rgba(var(--theme-border-rgb), 0.42);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(var(--theme-border-rgb), 0.08), 0 8px 18px rgba(0, 0, 0, 0.16);
  color: #f5f3ff;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease;
}

._desktop-choice-button_mxug3_284:hover:not(:disabled),
._desktopChoiceButton_mxug3_285:hover:not(:disabled) {
  background: rgba(var(--theme-border-rgb), 0.18);
  border-color: rgba(var(--theme-border-rgb), 0.45);
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 4px 16px rgba(var(--theme-border-rgb), 0.15);
}

._desktop-choice-button_mxug3_284._directional-choice-button_mxug3_173:hover:not(:disabled),
._desktop-choice-button_mxug3_284._directionalChoiceButton_mxug3_174:hover:not(:disabled),
._desktopChoiceButton_mxug3_285._directional-choice-button_mxug3_173:hover:not(:disabled),
._desktopChoiceButton_mxug3_285._directionalChoiceButton_mxug3_174:hover:not(:disabled) {
  background: rgba(var(--theme-border-rgb), 0.2);
  border-color: rgba(var(--theme-border-rgb), 0.5);
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

._desktop-choice-button_mxug3_284:active:not(:disabled),
._desktopChoiceButton_mxug3_285:active:not(:disabled) {
  transform: scale(0.99);
}

._desktop-choice-button_mxug3_284:disabled,
._desktopChoiceButton_mxug3_285:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Mobile action tab button */
._mobile-tab-button_mxug3_352,
._mobileTabButton_mxug3_353 {
  min-height: 44px;
  margin: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}

._mobile-tab-button_mxug3_352._active_mxug3_363,
._mobileTabButton_mxug3_353._active_mxug3_363 {
  border: 1px solid rgba(var(--theme-border-rgb), 0.45);
  background: rgba(var(--theme-border-rgb), 0.16);
  color: #f5f3ff;
  box-shadow: 0 0 8px rgba(var(--theme-border-rgb), 0.15);
}

._mobile-tab-button_mxug3_352._inactive_mxug3_371,
._mobileTabButton_mxug3_353._inactive_mxug3_371 {
  border: 1px solid rgba(var(--theme-border-rgb), 0.18);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(226, 224, 240, 0.6);
  transition: background 0.15s ease, border-color 0.15s ease;
}

._mobile-tab-button_mxug3_352._inactive_mxug3_371:hover,
._mobileTabButton_mxug3_353._inactive_mxug3_371:hover {
  background: rgba(var(--theme-border-rgb), 0.06);
  border-color: rgba(var(--theme-border-rgb), 0.28);
}

._mobile-tab-button_mxug3_352._inactive_mxug3_371:active,
._mobileTabButton_mxug3_353._inactive_mxug3_371:active {
  transform: scale(0.97);
}
/*
 * System: Undead — shared visual styling.
 *
 * Aligned with the CYOA design language: theme CSS variables, Courier
 * monospace, uppercase tracked headers, translucent border-rgb cards.
 *
 * Imported as a side-effect from SystemUndeadOverlays.jsx (CYOA survival
 * render path) and SystemUndeadApp.jsx (standalone bible-run shell), so
 * class-based components (HUD, ProseHistory, ProseStream, PartyPanel,
 * SystemMessage) inherit the theme without per-component CSS modules.
 */

[data-testid="system-undead-layout"],
.system-undead-wizard,
.system-undead-loading,
.system-undead-error,
.system-undead-play {
  font-family: 'Courier New', Courier, monospace;
  color: var(--theme-text);
}

/* ─── HUD ─────────────────────────────────────────────────────── */

.system-undead-hud {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  padding: 12px 16px;
  margin: 0 12px 12px;
  border: 1px solid rgba(var(--theme-border-rgb), 0.28);
  border-radius: 10px;
  background: rgba(var(--theme-border-rgb), 0.06);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.system-undead-hud > [data-hud-surface] {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(var(--theme-bg-rgb), 0.4);
  border: 1px solid rgba(var(--theme-border-rgb), 0.18);
  color: rgba(226, 224, 240, 0.92);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  line-height: 1.4;
}

.system-undead-hud > [data-hud-surface] > span {
  color: var(--theme-text);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 12px;
}

.system-undead-hud [data-hud-surface]::before {
  content: attr(data-hud-surface);
  color: rgba(var(--theme-accent-rgb), 0.7);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.system-undead-hud .health-bar {
  width: 100%;
  height: 6px;
  background: rgba(var(--theme-border-rgb), 0.18);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.system-undead-hud .health-bar-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(var(--theme-accent-rgb), 0.75),
    var(--theme-accent)
  );
  transition: width 0.25s ease;
}

.system-undead-hud .infection-bar {
  margin-top: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.28);
  color: #fecaca;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.system-undead-hud .notification-row {
  font-size: 11px;
  color: rgba(var(--theme-text), 0.85);
  text-transform: none;
  letter-spacing: 0.01em;
  line-height: 1.5;
  padding: 2px 0;
  border-bottom: 1px dashed rgba(var(--theme-border-rgb), 0.16);
}

.system-undead-hud .notification-row:last-child {
  border-bottom: none;
}

/* ─── Prose history & stream ─────────────────────────────────── */

[data-testid="prose-history"] {
  padding: 0 12px;
  scroll-behavior: smooth;
}

[data-testid="prose-history-entry"] {
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 1px solid rgba(var(--theme-border-rgb), 0.18);
  border-left: 3px solid rgba(var(--theme-border-rgb), 0.45);
  border-radius: 10px;
  background: rgba(var(--theme-border-rgb), 0.05);
}

.prose-history-narrative {
  color: var(--theme-text);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.prose-history-action {
  color: rgba(var(--theme-accent-rgb), 0.78);
  font-size: 12px;
  letter-spacing: 0.04em;
  margin: 8px 0 0;
}

.prose-stream {
  margin: 0 12px 12px;
  padding: 14px 16px;
  border: 1px solid rgba(var(--theme-border-rgb), 0.32);
  border-radius: 10px;
  background: linear-gradient(
    180deg,
    rgba(var(--theme-bg-rgb), 0.92) 0%,
    rgba(var(--theme-surface-rgb), 0.97) 100%
  );
  color: var(--theme-text);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}

.prose-action-layer {
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.prose-interiority-layer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(var(--theme-border-rgb), 0.2);
  color: rgba(var(--theme-accent-rgb), 0.85);
  font-size: 13px;
  line-height: 1.6;
}

.prose-stream[data-peak-mode="true"] {
  border-color: rgba(var(--theme-accent-rgb), 0.55);
  box-shadow: 0 0 0 1px rgba(var(--theme-accent-rgb), 0.2),
    0 12px 28px rgba(var(--theme-accent-rgb), 0.18);
}

.recap-header {
  margin: 0 0 8px;
  color: var(--theme-accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.recap-body {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(var(--theme-text), 0.92);
}

.prose-stream hr {
  border: none;
  border-top: 1px solid rgba(var(--theme-border-rgb), 0.24);
  margin: 8px 0;
}

/* ─── ChoiceScreen container is inline-styled; theme its buttons via hover */

[data-testid="choice-screen"] {
  margin: 0 12px;
}

[data-testid="choice-screen"] [data-testid="choice-button"]:hover:not(:disabled) {
  border-color: rgba(var(--theme-border-rgb), 0.6);
  background: rgba(var(--theme-border-rgb), 0.22);
}

[data-testid="choice-screen"] [data-testid="choice-button"]:active:not(:disabled) {
  transform: scale(0.98);
}

[data-testid="choice-screen"] [data-testid="choice-button"]:focus-visible {
  outline: 2px solid var(--theme-accent-mid);
  outline-offset: 2px;
}

/* ─── Party panel ─────────────────────────────────────────────── */

.party-panel {
  margin: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(var(--theme-border-rgb), 0.28);
  border-radius: 10px;
  background: rgba(var(--theme-border-rgb), 0.06);
  color: var(--theme-text);
  font-size: 12px;
  line-height: 1.55;
}

.party-section + .party-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(var(--theme-border-rgb), 0.2);
}

.party-section-title {
  margin: 0 0 8px;
  color: var(--theme-accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.party-panel-empty,
.party-panel-range,
.party-cap {
  margin: 4px 0;
  color: rgba(var(--theme-text), 0.78);
  font-size: 12px;
}

.party-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.party-member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(var(--theme-bg-rgb), 0.4);
  border: 1px solid rgba(var(--theme-border-rgb), 0.16);
  margin-bottom: 4px;
  font-size: 12px;
}

.party-member-entity {
  flex: 1;
  color: var(--theme-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-member-level {
  color: rgba(var(--theme-accent-rgb), 0.7);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.party-alpha-badge {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(248, 113, 113, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.party-panel button,
.party-panel input {
  font-family: inherit;
}

.party-panel button {
  padding: 8px 14px;
  margin: 4px 4px 4px 0;
  background: rgba(var(--theme-border-rgb), 0.12);
  border: 1px solid rgba(var(--theme-border-rgb), 0.32);
  border-radius: 6px;
  color: var(--theme-accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.party-panel button:hover:not(:disabled) {
  background: rgba(var(--theme-border-rgb), 0.22);
  border-color: rgba(var(--theme-border-rgb), 0.5);
}

.party-panel button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.party-panel input[type="text"] {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(var(--theme-bg-rgb), 0.55);
  border: 1px solid rgba(var(--theme-border-rgb), 0.28);
  border-radius: 6px;
  color: var(--theme-text);
  font-size: 12px;
}

.party-panel input[type="text"]:focus {
  outline: none;
  border-color: rgba(var(--theme-accent-rgb), 0.6);
}

.party-invite-pending,
.party-invite-response {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(var(--theme-text), 0.78);
}

/* ─── World tick digest ───────────────────────────────────────── */

[data-testid="world-tick-digest"] {
  margin: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(var(--theme-border-rgb), 0.22);
  border-left: 3px solid rgba(var(--theme-accent-rgb), 0.5);
  border-radius: 10px;
  background: rgba(var(--theme-border-rgb), 0.05);
  color: var(--theme-text);
  font-size: 12px;
  line-height: 1.55;
}

[data-testid="world-tick-digest-time-skip"] {
  margin-top: 6px;
  color: rgba(var(--theme-accent-rgb), 0.7);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ─── System: Undead wizard (NewRunWizard) ───────────────────── */

.system-undead-wizard {
  min-height: 100dvh;
  background: var(--theme-bg);
  color: var(--theme-text);
  padding: 24px 20px 40px;
  padding-top: max(24px, env(safe-area-inset-top, 0px));
  padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
  font-family: 'Courier New', Courier, monospace;
}

.system-undead-wizard fieldset {
  border: 1px solid rgba(var(--theme-border-rgb), 0.28);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 0 0 16px;
  background: rgba(var(--theme-border-rgb), 0.05);
}

.system-undead-wizard legend {
  padding: 0 8px;
  color: var(--theme-accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.system-undead-wizard label {
  font-size: 13px;
  color: var(--theme-text);
  cursor: pointer;
  line-height: 1.5;
}

.system-undead-wizard input[type="radio"] {
  accent-color: var(--theme-accent);
  margin-right: 4px;
}

.system-undead-wizard h3 {
  margin: 0 0 12px;
  color: var(--theme-accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.system-undead-wizard p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--theme-text);
}

.system-undead-wizard p strong {
  color: rgba(var(--theme-accent-rgb), 0.85);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
}

.system-undead-wizard button {
  font-family: inherit;
  padding: 10px 18px;
  background: rgba(var(--theme-border-rgb), 0.14);
  border: 1px solid rgba(var(--theme-border-rgb), 0.36);
  border-radius: 8px;
  color: var(--theme-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.system-undead-wizard button:hover:not(:disabled) {
  background: rgba(var(--theme-border-rgb), 0.24);
  border-color: rgba(var(--theme-border-rgb), 0.55);
}

.system-undead-wizard button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.system-undead-wizard [data-testid="btn-begin-run"] {
  background: rgba(var(--theme-accent-rgb), 0.18);
  border-color: rgba(var(--theme-accent-rgb), 0.55);
  color: var(--theme-accent);
}

.system-undead-wizard [data-testid="btn-begin-run"]:hover:not(:disabled) {
  background: rgba(var(--theme-accent-rgb), 0.28);
}

/* ─── SystemMessage / pending event chrome ────────────────────── */

[data-testid="system-message"] {
  display: block;
  margin: 12px auto;
  max-width: 640px;
  padding: 14px 18px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(var(--theme-accent-rgb), 0.45);
  box-shadow: 0 0 0 1px rgba(var(--theme-accent-rgb), 0.08) inset,
    0 2px 12px rgba(0, 0, 0, 0.35);
  color: var(--theme-accent);
  font-family: 'Courier New', Courier, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
  white-space: pre-wrap;
}

[data-testid="system-message-header"] {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--theme-accent);
  opacity: 0.85;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(var(--theme-accent-rgb), 0.35);
}

[data-testid="system-message-body"] {
  color: var(--theme-text);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

/* ─── Loading state: blur overlay + top bar ─────────────────── */

.su-content-blur-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 5;
  /* no border-radius — parent containers don't have matching radii */
}

.su-top-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(180deg, rgba(var(--theme-bg-rgb), 0.95) 0%, rgba(var(--theme-bg-rgb), 0.85) 100%);
  border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.3);
  color: var(--theme-accent);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
}

.su-top-loading-bar .spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(var(--theme-accent-rgb), 0.3);
  border-top-color: var(--theme-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
._headerAction_95fis_1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  margin: 4px;
  background: rgba(var(--theme-border-rgb), 0.1);
  border: 1px solid rgba(var(--theme-border-rgb), 0.3);
  border-radius: 8px;
  color: var(--theme-accent);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
  user-select: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

._headerAction_95fis_1:hover {
  background: rgba(var(--theme-border-rgb), 0.18);
  border-color: rgba(var(--theme-border-rgb), 0.45);
  box-shadow: 0 4px 12px rgba(var(--theme-border-rgb), 0.2);
}

._headerAction_95fis_1:active {
  transform: scale(0.97);
}

._headerDanger_95fis_34 {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

._headerDanger_95fis_34:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
}

._headerDanger_95fis_34:active {
  transform: scale(0.97);
}

._mobileHeaderAction_95fis_53 {
  padding: 12px 14px;
  min-height: 44px;
  font-size: 10px;
  letter-spacing: 0.04em;
}

._mobileHeaderDanger_95fis_60 {
  border-color: rgba(239, 68, 68, 0.4);
}

/* ─── Loading state: blur overlay + top bar ─────────────────── */

._cyoa-content-blur-overlay_95fis_67 {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 5;
}

._cyoa-top-loading-bar_95fis_77 {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(180deg, rgba(var(--theme-bg-rgb), 0.95) 0%, rgba(var(--theme-bg-rgb), 0.85) 100%);
  border-bottom: 1px solid rgba(var(--theme-accent-rgb), 0.3);
  color: var(--theme-accent);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  font-family: 'Courier New', Courier, monospace;
}

._cyoa-top-loading-bar_95fis_77 ._loading-spinner_95fis_97 {
  display: inline-block;
  animation: _spin_95fis_1 1.2s linear infinite;
  font-size: 14px;
  color: rgba(var(--theme-accent-rgb), 0.9);
}
