/* =========================================
NeoWeaver Character Creator CSS
Cleaned + unified version for current shortcode/JS
Scoped to: #tw-char-creator-wrapper
========================================= */

:root {
  --tw-acid: #adff00;
  --tw-acid-soft: rgba(173, 255, 0, 0.08);
  --tw-acid-mid: rgba(173, 255, 0, 0.18);
  --tw-neon-glow: rgba(173, 255, 0, 0.4);
  --tw-cyan: #00e5ff;
  --tw-cyan-soft: rgba(0, 229, 255, 0.14);
  --tw-red: #ff4d6d;
  --tw-red-soft: rgba(255, 77, 109, 0.12);
  --tw-bg: #050805;
  --tw-bg-2: #0b1108;
  --tw-panel: rgba(10, 18, 10, 0.82);
  --tw-panel-strong: rgba(12, 22, 11, 0.94);
  --tw-panel-soft: rgba(255, 255, 255, 0.025);
  --tw-border: rgba(173, 255, 0, 0.18);
  --tw-border-strong: rgba(173, 255, 0, 0.42);
  --tw-text: #f5ffe8;
  --tw-text-dim: rgba(245, 255, 232, 0.72);
  --tw-text-faint: rgba(245, 255, 232, 0.48);
  --tw-shadow: 0 0 0 1px rgba(173,255,0,0.05), 0 18px 48px rgba(0,0,0,0.42);
  --tw-radius-xl: 28px;
  --tw-radius-lg: 22px;
  --tw-radius-md: 16px;
  --tw-radius-sm: 12px;
}

#tw-char-creator-wrapper,
#tw-char-creator-wrapper * {
  box-sizing: border-box;
}

/* KROKI: jednoznaczny override */
#tw-char-creator-wrapper .tw-char-step,
#tw-char-creator-wrapper .tw-step {
  display: none !important;
}

#tw-char-creator-wrapper .tw-char-step.active,
#tw-char-creator-wrapper .tw-step.active {
  display: block !important;
}

#tw-char-creator-wrapper .tw-char-step[hidden]:not(.active),
#tw-char-creator-wrapper .tw-step[hidden]:not(.active) {
  display: none !important;
}

#tw-char-creator-wrapper {
  font-family: 'Chakra Petch', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--tw-text);
  background:
    radial-gradient(circle at top, rgba(173,255,0,0.08), transparent 34%),
    linear-gradient(180deg, rgba(6,10,6,0.96) 0%, rgba(4,7,4,1) 100%);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius-xl);
  padding: 28px;
  box-shadow: var(--tw-shadow);
  position: relative;
  overflow: visible;
  overflow-x: clip;
}

#tw-char-creator-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0%, rgba(173,255,0,0.03) 50%, transparent 100%),
    repeating-linear-gradient(
      180deg,
      rgba(173,255,0,0.02) 0,
      rgba(173,255,0,0.02) 1px,
      transparent 1px,
      transparent 24px
    );
  opacity: 0.7;
  mix-blend-mode: soft-light;
  border-radius: var(--tw-radius-xl);
}

.tw-progress-bar,
.tw-step,
.tw-char-status,
.tw-success,
.tw-nav-row {
  position: relative;
  z-index: 1;
}

/* ===== TYPOGRAPHY ===== */

.tw-progress-label,
.tw-progress-counter,
.tw-progress-phase,
.tw-attr-presets__label,
.tw-field-label,
.tw-pronoun-fieldset legend,
.tw-subrace-heading,
.tw-skill-cat-label,
.tw-summary-key,
.tw-race-select-hint {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.tw-step h2 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  line-height: 1.05;
  color: var(--tw-acid);
}

.tw-question-text {
  margin: 0 0 22px;
  color: var(--tw-text-dim);
  max-width: 78ch;
  line-height: 1.6;
}

.tw-required {
  color: var(--tw-acid);
}

.tw-field-label,
.tw-pronoun-fieldset legend {
  display: block;
  margin-bottom: 10px;
  color: var(--tw-text);
  font-size: 0.86rem;
}

.tw-field-label span:first-child {
  display: inline-block;
  margin-bottom: 8px;
}

/* ===== PROGRESS ===== */

.tw-progress-bar {
  margin-bottom: 24px;
}

.tw-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tw-progress-label {
  color: var(--tw-acid);
  font-size: 0.92rem;
}

.tw-progress-counter {
  color: var(--tw-text-dim);
  font-size: 0.92rem;
}

.tw-blink {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-left: 8px;
  background: var(--tw-acid);
  box-shadow: 0 0 12px rgba(173,255,0,0.88);
  animation: twBlink 1.4s infinite;
}

@keyframes twBlink {
  0%, 100% { opacity: 0.25; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

.tw-progress-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--tw-border);
  overflow: hidden;
}

.tw-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, rgba(173,255,0,0.4), rgba(173,255,0,0.95));
  box-shadow: 0 0 24px rgba(173,255,0,0.36);
  transition: width 260ms ease;
}

.tw-progress-tick {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  transform: translate(-50%, -50%);
  transition: background 220ms ease, box-shadow 220ms ease;
}

.tw-progress-tick.active,
.tw-progress-tick.current {
  background: var(--tw-acid);
  box-shadow: 0 0 10px rgba(173,255,0,0.86);
}

.tw-progress-phase {
  margin-top: 10px;
  color: var(--tw-text-faint);
  font-size: 0.82rem;
}

/* ===== STEPS ===== */

.tw-step {
  display: none;
  background: var(--tw-panel);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius-lg);
  padding: 26px;
  backdrop-filter: blur(10px);
}

.tw-step.active {
  display: block;
  animation: twFadeIn 0.24s ease;
}

@keyframes twFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== INPUTS ===== */

#tw-char-creator-wrapper input[type="text"],
#tw-char-creator-wrapper input[type="number"],
#tw-char-creator-wrapper textarea,
#tw-char-creator-wrapper select {
  width: 100%;
  background: rgba(0,0,0,0.22);
  color: var(--tw-text);
  border: 1px solid rgba(173,255,0,0.14);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

#tw-char-creator-wrapper input::placeholder,
#tw-char-creator-wrapper textarea::placeholder {
  color: var(--tw-text-faint);
}

#tw-char-creator-wrapper input:focus,
#tw-char-creator-wrapper textarea:focus,
#tw-char-creator-wrapper select:focus {
  border-color: var(--tw-border-strong);
  box-shadow: 0 0 0 3px rgba(173,255,0,0.12);
  background: rgba(173,255,0,0.04);
}

.tw-input--error,
input.tw-input--error,
textarea.tw-input--error,
select.tw-input--error {
  border-color: rgba(255,77,109,0.72) !important;
  box-shadow: 0 0 0 3px rgba(255,77,109,0.14) !important;
  background: rgba(255,77,109,0.06) !important;
}

#tw-char-creator-wrapper textarea {
  min-height: 120px;
  resize: vertical;
}

/* ===== PRONOUNS ===== */

.tw-pronoun-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tw-pronoun-option {
  position: relative;
}

.tw-pronoun-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.tw-pronoun-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--tw-border);
  background: rgba(255,255,255,0.03);
  color: var(--tw-text-dim);
  cursor: pointer;
  transition: all 180ms ease;
}

.tw-pronoun-option input:checked + .tw-pronoun-label {
  color: var(--tw-bg);
  background: var(--tw-acid);
  border-color: var(--tw-acid);
  box-shadow: 0 0 18px rgba(173,255,0,0.28);
}

/* ===== GRIDS ===== */

.tw-dynamic-grid,
.tw-skill-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  overflow: visible;
  max-height: none;
  padding: 0;
}

/* ===== CARD BASE ===== */

.tw-grid-card,
.tw-class-card,
.tw-lore-card,
.tw-skill-card,
.tw-package-card,
.tw-race-card,
.tw-subrace-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--tw-border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(14,22,12,0.88), rgba(8,12,8,0.88));
  overflow: hidden;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  position: relative;
}

.tw-grid-card:hover,
.tw-class-card:hover,
.tw-lore-card:hover,
.tw-skill-card:hover,
.tw-package-card:hover,
.tw-race-card:hover,
.tw-subrace-card:hover,
.tw-grid-card:focus-visible,
.tw-class-card:focus-visible,
.tw-lore-card:focus-visible,
.tw-skill-card:focus-visible,
.tw-package-card:focus-visible,
.tw-race-card:focus-visible,
.tw-subrace-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--tw-border-strong);
  box-shadow: 0 18px 30px rgba(0,0,0,0.28), 0 0 0 1px rgba(173,255,0,0.14);
}

.tw-grid-card.selected,
.tw-class-card.selected,
.tw-lore-card.selected,
.tw-skill-card.selected,
.tw-package-card.selected,
.tw-race-card.selected,
.tw-subrace-card.selected,
.tw-grid-card.is-selected,
.tw-class-card.is-selected,
.tw-lore-card.is-selected,
.tw-skill-card.is-selected,
.tw-package-card.is-selected,
.tw-race-card.is-selected,
.tw-subrace-card.is-selected,
.tw-grid-card[aria-pressed="true"],
.tw-class-card[aria-pressed="true"],
.tw-lore-card[aria-pressed="true"],
.tw-skill-card[aria-pressed="true"],
.tw-package-card[aria-pressed="true"],
.tw-race-card[aria-pressed="true"],
.tw-subrace-card[aria-pressed="true"],
.tw-grid-card[data-selected="true"],
.tw-class-card[data-selected="true"],
.tw-lore-card[data-selected="true"],
.tw-skill-card[data-selected="true"],
.tw-package-card[data-selected="true"],
.tw-race-card[data-selected="true"],
.tw-subrace-card[data-selected="true"] {
  border-color: rgba(173,255,0,0.82);
  box-shadow: 0 0 0 2px rgba(173,255,0,0.18), 0 18px 36px rgba(0,0,0,0.34), 0 0 22px rgba(173,255,0,0.16);
  background: linear-gradient(180deg, rgba(18,29,14,0.96), rgba(10,15,9,0.96));
}

.tw-grid-card.selected::after,
.tw-class-card.selected::after,
.tw-lore-card.selected::after,
.tw-skill-card.selected::after,
.tw-package-card.selected::after,
.tw-race-card.selected::after,
.tw-subrace-card.selected::after,
.tw-grid-card.is-selected::after,
.tw-class-card.is-selected::after,
.tw-lore-card.is-selected::after,
.tw-skill-card.is-selected::after,
.tw-package-card.is-selected::after,
.tw-race-card.is-selected::after,
.tw-subrace-card.is-selected::after,
.tw-grid-card[aria-pressed="true"]::after,
.tw-class-card[aria-pressed="true"]::after,
.tw-lore-card[aria-pressed="true"]::after,
.tw-skill-card[aria-pressed="true"]::after,
.tw-package-card[aria-pressed="true"]::after,
.tw-race-card[aria-pressed="true"]::after,
.tw-subrace-card[aria-pressed="true"]::after,
.tw-grid-card[data-selected="true"]::after,
.tw-class-card[data-selected="true"]::after,
.tw-lore-card[data-selected="true"]::after,
.tw-skill-card[data-selected="true"]::after,
.tw-package-card[data-selected="true"]::after,
.tw-race-card[data-selected="true"]::after,
.tw-subrace-card[data-selected="true"]::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tw-acid);
  color: #0a1208;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(173,255,0,0.42);
  z-index: 2;
}

/* ===== MEDIA BLOCKS ===== */

.tw-race-img,
.tw-class-cardimg-wrap,
.tw-skill-cardimg {
  min-height: 220px;
  max-height: 220px;
  background: linear-gradient(180deg, rgba(173,255,0,0.05), rgba(255,255,255,0.015));
  border-bottom: 1px solid rgba(173,255,0,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
}

.tw-skill-card .tw-race-img,
.tw-skill-cardimg {
  min-height: 170px;
  max-height: 170px;
  padding: 16px;
}

.tw-race-img img,
.tw-class-cardimg-wrap img,
.tw-skill-cardimg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  filter: drop-shadow(0 0 12px rgba(173,255,0,0.14));
}

.tw-race-img--placeholder,
.tw-class-cardimg-wrap--placeholder {
  color: rgba(173,255,0,0.72);
  font-size: 2rem;
}

/* ===== CARD BODIES ===== */

.tw-race-body,
.tw-class-cardbody,
.tw-skill-cardbody,
.tw-package-cardbody,
.tw-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.tw-race-name,
.tw-class-cardname,
.tw-skill-cardname,
.tw-package-cardtitle,
.tw-card-title {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.15;
  color: var(--tw-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tw-race-card.selected .tw-race-name,
.tw-subrace-card.selected .tw-race-name,
.tw-class-card.selected .tw-class-cardname,
.tw-skill-card.selected .tw-skill-cardname,
.tw-package-card.selected .tw-package-cardtitle,
.tw-race-card.is-selected .tw-race-name,
.tw-subrace-card.is-selected .tw-race-name,
.tw-class-card.is-selected .tw-class-cardname,
.tw-skill-card.is-selected .tw-skill-cardname,
.tw-package-card.is-selected .tw-package-cardtitle,
.tw-race-card[aria-pressed="true"] .tw-race-name,
.tw-subrace-card[aria-pressed="true"] .tw-race-name,
.tw-class-card[aria-pressed="true"] .tw-class-cardname,
.tw-skill-card[aria-pressed="true"] .tw-skill-cardname,
.tw-package-card[aria-pressed="true"] .tw-package-cardtitle {
  color: var(--tw-acid);
  text-shadow: 0 0 8px var(--tw-acid);
}

/* ===== DESCRIPTIONS / TAGS ===== */

/* Rasy i klasy: bez opisów, zgodnie z założeniem */
.tw-race-desc,
.tw-class-carddesc {
  display: none !important;
}

/* Bonus rasy ma być widoczny */
.tw-race-bonus {
  display: block !important;
  margin: 0;
  color: var(--tw-text-dim);
  line-height: 1.45;
  font-size: 0.9rem;
}

/* Skille mogą mieć krótki opis w obecnym flow */
.tw-skill-card .tw-race-desc {
  display: block !important;
  margin: 0;
  color: var(--tw-text-dim);
  line-height: 1.45;
  font-size: 0.92rem;
}

.tw-race-tags,
.tw-package-items,
.tw-class-tags,
.tw-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tw-race-tag,
.tw-class-tag,
.tw-card-tag,
.tw-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(173,255,0,0.18);
  background: rgba(173,255,0,0.06);
  color: var(--tw-text-dim);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.tw-subrace-card .tw-race-tag {
  border-color: rgba(0,229,255,0.18);
  background: rgba(0,229,255,0.08);
  color: rgba(220, 251, 255, 0.86);
}

.tw-race-select-hint {
  margin-top: auto;
  display: inline-flex;
  align-self: flex-start;
  color: var(--tw-acid);
  font-size: 0.72rem;
}

/* ===== SUBRACE SECTION ===== */

.tw-subrace-section,
#tw-subrace-section,
[data-role="subrace-section"] {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(173,255,0,0.12);
}

.tw-subrace-section[hidden],
#tw-subrace-section[hidden],
[data-role="subrace-section"][hidden],
.tw-subrace-section.is-hidden,
#tw-subrace-section.is-hidden,
[data-role="subrace-section"].is-hidden {
  display: none !important;
}

.tw-subrace-section:not([hidden]),
#tw-subrace-section:not([hidden]),
[data-role="subrace-section"]:not([hidden]),
.tw-subrace-section.is-visible,
#tw-subrace-section.is-visible,
[data-role="subrace-section"].is-visible {
  display: block !important;
}

.tw-subrace-heading {
  margin: 0 0 14px;
  color: var(--tw-cyan);
  font-size: 0.96rem;
}

/* ===== LORE ===== */

.tw-lore-card__effects,
.tw-lore-cardeffects {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.tw-lore-card__effect,
.tw-lore-cardeffect {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(173,255,0,0.10);
  background: rgba(255,255,255,0.03);
   color: var(--tw-text-dim);
}

.tw-lore-card__effect strong,
.tw-lore-cardeffect strong {
  color: var(--tw-acid);
}

/* ===== STATES ===== */

.tw-loading,
.tw-empty-state,
.tw-error-msg,
.tw-loading-state {
  margin: 0;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px dashed rgba(173,255,0,0.16);
  background: rgba(255,255,255,0.03);
  color: var(--tw-text-dim);
}

.tw-error-msg {
  color: #ffc2ce;
  border-color: rgba(255,77,109,0.30);
}

.tw-loading-state {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tw-loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--tw-acid);
  box-shadow: 0 0 12px rgba(173,255,0,0.72);
  animation: twPulse 1.1s infinite ease-in-out;
}

@keyframes twPulse {
  0%, 100% { transform: scale(0.78); opacity: 0.45; }
  50% { transform: scale(1.15); opacity: 1; }
}

/* ===== ATTRIBUTES ===== */

.tw-attr-remaining-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  color: var(--tw-text-faint);
  font-size: 0.9rem;
}

#tw-attr-remaining {
  color: var(--tw-acid);
  font-weight: 700;
}

.tw-attr-presets,
.tw-attr-presets-wrap,
.tw-attr-preset-list,
[data-role="attr-presets"] {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
  align-items: center;
}

.tw-attr-preset-btn,
.tw-attr-presets button,
.tw-attr-presets [data-preset],
.tw-attr-presets [data-attr-preset] {
  appearance: none;
  border: 1px solid rgba(173,255,0,0.18);
  background: rgba(255,255,255,0.03);
  color: var(--tw-text-dim);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 180ms ease;
  font-family: inherit;
  font-size: 0.86rem;
  text-transform: uppercase;
}

.tw-attr-preset-btn:hover,
.tw-attr-preset-btn.active,
.tw-attr-presets button:hover,
.tw-attr-presets button.active,
.tw-attr-presets [data-preset]:hover,
.tw-attr-presets [data-preset].active,
.tw-attr-presets [data-attr-preset]:hover,
.tw-attr-presets [data-attr-preset].active {
  color: var(--tw-bg);
  background: var(--tw-acid);
  border-color: var(--tw-acid);
}

.tw-attr-grid {
  display: grid;
  gap: 14px;
}

.tw-attr-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(173,255,0,0.12);
  background: rgba(255,255,255,0.03);
}

.tw-attr-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(173,255,0,0.10);
  color: var(--tw-acid);
  font-size: 1.4rem;
}

.tw-attr-info {
  min-width: 0;
}

.tw-attr-info h4 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.tw-attr-info h4 small {
  display: inline-block;
  margin-left: 8px;
  color: var(--tw-text-faint);
  font-size: 0.78rem;
}

.tw-attr-info span {
  color: var(--tw-text-dim);
  font-size: 0.92rem;
  line-height: 1.5;
}

.tw-attr-controls,
[data-role="attr-stepper-wrap"] {
  display: flex !important;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  min-width: 150px;
}

.tw-attr-stepper,
[data-role="attr-stepper"] {
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.tw-attr-btn,
.tw-attr-stepper button,
[data-role="attr-stepper"] button,
button[data-action="minus"],
button[data-action="plus"] {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(173,255,0,0.18);
  background: rgba(255,255,255,0.03);
  color: var(--tw-acid);
  cursor: pointer;
  transition: all 180ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  opacity: 1;
  visibility: visible;
}

.tw-attr-btn:hover:not(:disabled),
.tw-attr-stepper button:hover:not(:disabled),
[data-role="attr-stepper"] button:hover:not(:disabled),
button[data-action="minus"]:hover:not(:disabled),
button[data-action="plus"]:hover:not(:disabled) {
  background: rgba(173,255,0,0.10);
  border-color: rgba(173,255,0,0.32);
}

.tw-attr-btn:disabled,
.tw-attr-stepper button:disabled,
[data-role="attr-stepper"] button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tw-attr-val,
.tw-attr-stepper input,
[data-role="attr-stepper"] input {
  width: 64px !important;
  text-align: center;
  padding-inline: 10px !important;
  display: inline-block !important;
}

.tw-attr-pips {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tw-pip {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(173,255,0,0.16);
  background: rgba(255,255,255,0.04);
}

.tw-pip.active {
  background: var(--tw-acid);
  border-color: var(--tw-acid);
  box-shadow: 0 0 12px rgba(173,255,0,0.46);
}

/* ===== AVATAR ===== */

.tw-upload-box {
  padding: 22px;
  border-radius: 20px;
  border: 1px dashed rgba(173,255,0,0.26);
  background: rgba(255,255,255,0.03);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.tw-upload-box--drag {
  border-color: rgba(173,255,0,0.66);
  background: rgba(173,255,0,0.06);
  box-shadow: 0 0 0 3px rgba(173,255,0,0.10);
}

.tw-upload-preview {
  text-align: center;
  color: var(--tw-text-dim);
}

.tw-upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: rgba(173,255,0,0.10);
  color: var(--tw-acid);
  font-size: 1.9rem;
}

.tw-avatar-selected {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

#tw-avatar-img {
  display: block;
  width: 96px !important;
  height: 96px !important;
  min-width: 96px !important;
  min-height: 96px !important;
  max-width: 96px !important;
  max-height: 96px !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 999px !important;
  border: 2px solid rgba(173,255,0,0.32);
  background: transparent;
  overflow: hidden;
}

/* ===== BUTTONS ===== */

.tw-link-btn,
.tw-avatar-clear,
.tw-summary-edit,
.tw-btn,
.tw-btn-nav,
.tw-attr-btn {
  font-family: inherit;
}

.tw-link-btn {
  appearance: none;
  border: 0;
  background: none;
  color: var(--tw-acid);
  cursor: pointer;
  padding: 0;
}

.tw-avatar-clear {
  width: fit-content;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,77,109,0.36);
  background: rgba(255,77,109,0.08);
  color: #ffd6de;
  cursor: pointer;
}

.tw-btn,
.tw-btn-nav {
  appearance: none;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid rgba(173,255,0,0.18);
  background: rgba(255,255,255,0.03);
  color: var(--tw-text);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 180ms ease;
}

.tw-btn:hover,
.tw-btn-nav:hover,
.tw-summary-edit:hover,
.tw-avatar-clear:hover,
.tw-link-btn:hover {
  filter: brightness(1.06);
}

.tw-btn--primary {
  color: var(--tw-bg);
  background: var(--tw-acid);
  border-color: var(--tw-acid);
  box-shadow: 0 0 18px rgba(173,255,0,0.22);
}

.tw-btn-review-return[hidden] {
  display: none !important;
}

/* ===== SUMMARY ===== */

.tw-summary-grid {
  display: grid;
  gap: 12px;
}

.tw-summary-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(173,255,0,0.10);
  background: rgba(255,255,255,0.03);
}

.tw-summary-key {
  color: var(--tw-acid);
  font-size: 0.76rem;
  padding-top: 3px;
}

.tw-summary-val {
  color: var(--tw-text);
  min-width: 0;
  word-break: break-word;
  line-height: 1.5;
}

.tw-summary-edit {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(173,255,0,0.18);
  background: rgba(173,255,0,0.08);
  color: var(--tw-acid);
  cursor: pointer;
}

/* ===== STATUS / ERRORS ===== */

.tw-char-status {
  margin-top: 16px;
  padding: 14px 16px;
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(173,255,0,0.12);
  background: rgba(255,255,255,0.03);
  color: var(--tw-text-dim);
}

.tw-char-status--error,
.tw-char-status.is-error {
  color: #ffd6de !important;
  border-color: rgba(255,77,109,0.28) !important;
  background: rgba(255,77,109,0.06) !important;
}

.tw-step-error {
  display: none !important;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,77,109,0.26);
  background: rgba(255,77,109,0.08);
  color: #ffe1e7;
  align-items: center;
  gap: 10px;
}

.tw-step-error.visible,
.tw-step-error.is-visible {
  display: flex !important;
}

.tw-step-error::before {
  content: '⚠';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--tw-red);
  color: #fff;
  font-size: 0.82rem;
  flex: 0 0 24px;
}

.tw-step-error-msg,
.tw-step-error__msg {
  font-size: 0.95rem;
}

.tw-step-error--shake {
  animation: twShake 260ms linear;
}

@keyframes twShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

/* ===== NAV ===== */

.tw-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ===== SUCCESS ===== */

.tw-success {
  display: grid;
  gap: 18px;
  justify-items: start;
  padding: 28px;
  border-radius: 22px;
  border: 1px solid rgba(173,255,0,0.18);
  background: linear-gradient(180deg, rgba(13,21,11,0.94), rgba(8,13,7,0.98));
}

.tw-success-msg,
.tw-successmsg {
  margin: 0;
  font-size: 1.06rem;
  color: var(--tw-text);
}

/* ===== SPINNER ===== */

#tw-char-spinner {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 4, 0.86);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  backdrop-filter: blur(8px);
}

#tw-char-spinner.active {
  display: flex;
}

.tw-spinner-inner {
  width: min(92vw, 420px);
  text-align: center;
  padding: 34px 24px;
  border-radius: 24px;
  border: 1px solid rgba(173,255,0,0.18);
  background: rgba(10,18,10,0.94);
  box-shadow: 0 24px 60px rgba(0,0,0,0.44);
}

.tw-spinner-ring,
.tw-spinner-ring--2 {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 999px;
  border: 3px solid rgba(173,255,0,0.16);
  border-top-color: var(--tw-acid);
  animation: twSpin 1s linear infinite;
}

.tw-spinner-ring--2 {
  width: 54px;
  height: 54px;
  margin-top: -63px;
  border-top-color: rgba(245,255,232,0.86);
  animation-direction: reverse;
  animation-duration: 1.4s;
}

@keyframes twSpin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}

.tw-spinner-text {
  margin: 20px 0 8px;
  color: var(--tw-acid);
  font-size: 1.06rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tw-spinner-sub {
  margin: 0;
  color: var(--tw-text-dim);
  line-height: 1.5;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {
  #tw-char-creator-wrapper {
    padding: 20px;
    border-radius: 22px;
  }

  .tw-step {
    padding: 20px;
  }

  .tw-summary-row {
    grid-template-columns: 1fr;
  }

  .tw-attr-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .tw-attr-controls {
    width: 100%;
    align-items: flex-start;
    min-width: 0;
  }

  .tw-attr-stepper,
  .tw-attr-pips {
    justify-content: flex-start;
  }

  .tw-race-img,
  .tw-class-cardimg-wrap {
    min-height: 180px;
    max-height: 180px;
  }
}

@media (max-width: 640px) {
  #tw-char-creator-wrapper {
    padding: 14px;
    border-radius: 18px;
  }

  .tw-step {
    padding: 16px;
    border-radius: 18px;
  }

  .tw-step h2 {
    font-size: 1.15rem;
  }

  .tw-dynamic-grid,
  .tw-skill-cat-grid {
    grid-template-columns: 1fr;
  }

  .tw-nav-row {
    flex-direction: column;
    align-items: stretch;
  }

  .tw-btn,
  .tw-btn-nav,
  .tw-summary-edit,
  .tw-avatar-clear {
    width: 100%;
    justify-content: center;
  }

  .tw-progress-header {
    align-items: flex-start;
  }

  .tw-class-card,
  .tw-grid-card,
  .tw-skill-card {
    min-height: auto;
  }

  .tw-class-cardimg-wrap,
  .tw-race-img {
    min-height: 140px;
    max-height: 140px;
  }

  .tw-skill-card .tw-race-img,
  .tw-skill-cardimg {
    min-height: 130px;
    max-height: 130px;
  }

  .tw-summary-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 4px 10px;
    padding: 12px 14px;
  }

  .tw-summary-key {
    grid-column: 1;
    grid-row: 1;
  }

  .tw-summary-val {
    grid-column: 1;
    grid-row: 2;
    white-space: normal;
    font-size: 0.82rem;
  }

  .tw-summary-edit {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
  }
}

#tw-skill-grid,
.tw-skill-category,
.tw-skill-cat-grid {
  overflow: visible;
}

.tw-skill-cardimg,
.tw-skill-card .tw-race-img {
  min-height: 120px;
  max-height: none;
  aspect-ratio: 16 / 10;
}

.tw-skill-cardbody {
  min-height: auto;
}

/* ===== AVATAR GALLERY ===== */

.tw-avatar-gallery,
.tw-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 92px);
  gap: 8px;
  align-items: start;
  margin-bottom: 22px;
}

.tw-avatar-card {
  width: 92px;
  height: 92px;
  padding: 0;
  border-radius: 999px !important;
  overflow: hidden !important;
  border: 2px solid rgba(173,255,0,0.14);
  background: rgba(255,255,255,0.03);
  box-shadow: none;
  transform: none !important;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, opacity 180ms ease;
}

.tw-avatar-card:hover,
.tw-avatar-card:focus-visible {
  transform: none !important;
  border-color: rgba(173,255,0,0.42);
  box-shadow: 0 0 0 3px rgba(173,255,0,0.08);
}

.tw-avatar-card.selected,
.tw-avatar-card.is-selected,
.tw-avatar-card[aria-pressed="true"],
.tw-avatar-card[data-selected="true"] {
  transform: none !important;
  border-color: rgba(173,255,0,0.92) !important;
  box-shadow: 0 0 0 3px rgba(173,255,0,0.16), 0 0 18px rgba(173,255,0,0.20) !important;
  background: rgba(173,255,0,0.05);
}

.tw-avatar-card::after {
  top: 6px;
  right: 6px;
}

.tw-avatar-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 999px;
  display: block;
}

.tw-avatar-card .tw-avatar-thumb,
.tw-avatar-card .tw-avatar-image,
.tw-avatar-card .tw-avatar-media {
  width: 100%;
  height: 100%;
  border-radius: 999px !important;
  overflow: hidden !important;
}

@media (max-width: 640px) {
  .tw-avatar-gallery,
  .tw-avatar-grid {
    grid-template-columns: repeat(auto-fill, 76px);
    gap: 8px;
    margin-bottom: 18px;
  }

  .tw-avatar-card {
    width: 76px;
    height: 76px;
  }
}

.tw-summary-value,
.tw-summary-val,
.tw-summary-text,
.tw-summary-bio,
#tw-char-summary,
#tw-char-summary * {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* ===== FIX: Pełna widoczność skilli ===== */

#tw-char-creator-wrapper {
  overflow: visible !important;
  /* usuń overflow: hidden */
}

.tw-step {
  overflow: visible !important;
  min-height: auto !important;
  height: auto !important;
}

#tw-skill-grid,
.tw-skill-category,
.tw-skill-cat-grid {
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
  min-height: 0 !important;
}

/* Nawigacja musi być PONIŻEJ skilli wizualnie, ale z z-index wyższym tylko przy hover */
.tw-nav-row {
  position: relative;
  z-index: 10;
  margin-top: 24px;
  background: var(--tw-bg);
  padding-top: 16px;
  border-top: 1px solid rgba(173,255,0,0.12);
}

/* Przyciski nawigacji ponad wszystkim tylko przy interakcji */
.tw-btn-nav,
.tw-btn {
  position: relative;
  z-index: 1;
}

.tw-btn-nav:hover,
.tw-btn:hover,
.tw-btn-nav:focus,
.tw-btn:focus {
  z-index: 20;
}

/* Status też nie może być sticky/fixed */
.tw-char-status {
  position: relative;
  z-index: 1;
  margin-top: 16px;
}

/* Kategorie skilli — flex column zamiast grid dla pewności */
.tw-skill-category {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  overflow: visible !important;
}

.tw-skill-cat-label {
  margin: 0 0 10px;
  color: var(--tw-acid);
  font-size: 0.96rem;
}

/* Grid skilli w kategorii */
.tw-skill-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  overflow: visible !important;
  grid-auto-rows: minmax(min-content, max-content);
}

/* Karty skilli */
.tw-skill-card {
  display: flex;
  flex-direction: column;
  min-height: auto !important;
  height: auto !important;
  overflow: visible !important;
}

.tw-skill-cardimg {
  min-height: 140px;
  max-height: 140px;
  aspect-ratio: 16 / 10;
  flex-shrink: 0;
}

.tw-skill-cardbody {
  min-height: auto !important;
  flex: 1;
  padding: 18px;
}

/* Wrapper całego kreatora nie może mieć fixed height */
#tw-char-creator-wrapper::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Wszystkie główne kontenery muszą rosnąć z contentem */
.tw-char-step,
.tw-step {
  display: none;
  overflow: visible !important;
  min-height: 0 !important;
  height: auto !important;
}

.tw-char-step.active,
.tw-step.active {
  display: block !important;
  overflow: visible !important;
}

/* Krok ze skillami konkretnie */
[data-step="4"],
.tw-step[data-step="4"],
#tw-step-skills,
.tw-char-step--skills {
  overflow: visible !important;
  min-height: 0 !important;
  height: auto !important;
  padding-bottom: 32px;
}

/* Mobile fix */
@media (max-width: 900px) {
  .tw-skill-cat-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .tw-skill-cardimg {
    min-height: 130px;
    max-height: 130px;
  }
}

@media (max-width: 640px) {
  .tw-skill-cat-grid {
    grid-template-columns: 1fr;
  }
  
  .tw-skill-cardimg {
    min-height: 120px;
    max-height: 120px;
  }
}
