/* ── PALETTE identique à DungeonAndKitten.tsx ── */
    :root {
      --parchment:      #F2E8C8;
      --parchmentDark:  #E6D5A8;
      --ink:            #2C1A0E;
      --inkLight:       #6B4226;
      --inkFaded:       #9C7A5A;
      --border:         #8B5E3C;
      --gold:           #C8973A;
      --goldLight:      #E8C060;
      --roseAcc:        #C06070;
      --blueAcc:        #5A7A9C;
      --greenAcc:       #5A8C5A;
      --heartFill:      #D4956A;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      background: #1a0f07;
      background-image:
        radial-gradient(ellipse at 20% 20%, rgba(139,94,60,0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139,94,60,0.2)  0%, transparent 50%);
      min-height: 100vh;
      font-family: 'Kalam', cursive;
      color: var(--ink);
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 24px 16px 48px;
    }

    /* ── TITLE ── */
    .site-title {
      font-family: 'Special Elite', cursive;
      font-size: 2rem;
      color: var(--gold);
      letter-spacing: 6px;
      text-transform: uppercase;
      text-shadow: 0 2px 12px rgba(200,151,58,0.4);
      margin-bottom: 4px;
      text-align: center;
    }
    .site-subtitle {
      font-family: 'Kalam', cursive;
      font-size: 1rem;
      color: var(--inkFaded);
      font-style: italic;
      text-align: center;
      margin-bottom: 24px;
    }

    /* ── MAIN CARD ── */
    .app { width: 100%; max-width: 860px; position: relative; }

    .card {
      background: var(--parchment);
      background-image:
        radial-gradient(ellipse at 15% 10%, rgba(200,175,120,0.35) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 90%, rgba(180,150,100,0.3)  0%, transparent 45%),
        radial-gradient(ellipse at 85% 15%, rgba(210,185,130,0.2)  0%, transparent 35%),
        radial-gradient(ellipse at 15% 85%, rgba(190,160,110,0.2)  0%, transparent 35%);
      border: 2.5px solid var(--border);
      border-radius: 6px;
      padding: 36px 36px 28px;
      position: relative;
      box-shadow: 0 12px 40px rgba(0,0,0,0.7), inset 0 0 80px rgba(139,94,60,0.06);
    }

    /* Ornamental corners */
    .card-border {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }

    /* ── STEPS NAV ── */
    .steps-nav {
      display: flex;
      gap: 0;
      margin-bottom: 28px;
      border: 1.5px solid var(--border);
      border-radius: 6px;
      overflow: hidden;
    }
    .step-btn {
      flex: 1;
      padding: 9px 6px;
      background: transparent;
      border: none;
      border-right: 1px solid var(--border);
      color: var(--inkFaded);
      font-family: 'Special Elite', cursive;
      font-size: 0.72rem;
      letter-spacing: 1px;
      text-transform: uppercase;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
      text-align: center;
    }
    .step-btn:last-child { border-right: none; }
    .step-btn:hover { background: rgba(139,94,60,0.1); color: var(--inkLight); }
    .step-btn.active {
      background: var(--ink);
      color: var(--gold);
    }
    .step-btn.done {
      background: rgba(200,151,58,0.12);
      color: var(--border);
    }

    /* ── STEP PANELS ── */
    .step-panel { display: none; }
    .step-panel.active { display: block; }

    /* ── SECTION HEADER ── */
    .section-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 22px 0 14px;
    }
    .section-header-line {
      flex: 1;
      height: 1.5px;
      background: var(--border);
      opacity: 0.4;
    }
    .section-header-label {
      background: var(--parchmentDark);
      border: 1.5px solid var(--border);
      border-radius: 4px;
      padding: 4px 18px;
      font-family: 'Special Elite', cursive;
      font-size: 0.85rem;
      color: var(--inkLight);
      letter-spacing: 3px;
      text-transform: uppercase;
    }

    /* ── STEP INDICATOR ── */
    .step-indicator {
      text-align: center;
      margin-bottom: 22px;
    }
    .step-dots {
      display: flex;
      justify-content: center;
      gap: 6px;
      margin-bottom: 8px;
    }
    .step-dot {
      height: 8px;
      border-radius: 4px;
      background: rgba(139,94,60,0.25);
      transition: all 0.3s;
    }
    .step-dot.active { background: var(--gold); width: 28px !important; }
    .step-dot.done  { background: var(--border); }
    .step-number {
      font-family: 'Special Elite', cursive;
      font-size: 0.75rem;
      color: var(--inkFaded);
      letter-spacing: 4px;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .step-title {
      font-family: 'Special Elite', cursive;
      font-size: 1.7rem;
      color: var(--ink);
      letter-spacing: 1px;
    }

    /* ── FORM ── */
    label {
      display: block;
      font-family: 'Special Elite', cursive;
      font-size: 0.72rem;
      color: var(--inkFaded);
      letter-spacing: 2px;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    input[type="text"], input[type="number"], select, textarea {
      width: 100%;
      padding: 8px 12px;
      background: rgba(255,255,255,0.45);
      border: 1px solid rgba(139,94,60,0.5);
      border-radius: 4px;
      font-family: 'Kalam', cursive;
      font-size: 1rem;
      color: var(--ink);
      margin-bottom: 14px;
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    input:focus, select:focus, textarea:focus {
      outline: none;
      border-color: var(--gold);
      box-shadow: 0 0 0 2px rgba(200,151,58,0.2);
    }
    textarea { line-height: 1.6; }

    .field-row   { display: grid; grid-template-columns: 1fr 1fr;     gap: 14px; }
    .field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

    /* ── FIELD ROW DISPLAY (fiche) ── */
    .field-display {
      display: flex;
      align-items: baseline;
      gap: 12px;
      border-bottom: 1px solid rgba(139,94,60,0.25);
      padding-bottom: 8px;
      margin-bottom: 8px;
    }
    .field-display-label {
      font-family: 'Special Elite', cursive;
      font-size: 0.7rem;
      color: var(--inkFaded);
      letter-spacing: 2px;
      text-transform: uppercase;
      min-width: 110px;
      flex-shrink: 0;
    }
    .field-display-val {
      font-family: 'Kalam', cursive;
      font-size: 1.1rem;
      color: var(--ink);
    }
    .field-display-val.accent { color: var(--gold); font-weight: 700; }

    /* ── ENFANCE CARDS ── */
    .enfance-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
      gap: 10px;
      margin-top: 10px;
    }
    .enfance-card {
      background: rgba(255,255,255,0.3);
      border: 2px solid rgba(139,94,60,0.4);
      border-radius: 8px;
      padding: 14px 16px;
      cursor: pointer;
      transition: border-color 0.15s, background 0.15s;
    }
    .enfance-card:hover { border-color: var(--gold); background: rgba(255,255,255,0.5); }
    .enfance-card.selected {
      border-color: var(--gold);
      background: rgba(200,151,58,0.1);
      box-shadow: 0 0 0 2px rgba(200,151,58,0.2);
    }
    .enfance-name {
      font-family: 'Special Elite', cursive;
      font-size: 1.1rem;
      color: var(--inkLight);
      letter-spacing: 2px;
      text-transform: uppercase;
      margin-bottom: 6px;
    }
    .enfance-don {
      font-family: 'Kalam', cursive;
      font-size: 0.9rem;
      color: var(--gold);
      font-style: italic;
      margin-bottom: 6px;
    }
    .enfance-desc {
      font-family: 'Kalam', cursive;
      font-size: 0.85rem;
      color: var(--inkLight);
      line-height: 1.5;
    }
    .enfance-sac {
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid rgba(139,94,60,0.3);
    }
    .enfance-sac-title {
      font-family: 'Special Elite', cursive;
      font-size: 0.65rem;
      color: var(--inkFaded);
      letter-spacing: 2px;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .enfance-img-wrap {
      text-align: center;
      margin-bottom: 10px;
    }
    .enfance-img {
      height: 120px;
      width: auto;
      object-fit: contain;
      filter: drop-shadow(0 2px 6px rgba(0,0,0,0.18));
    }
    .enfance-sac-items {
      font-family: 'Kalam', cursive;
      font-size: 0.8rem;
      color: var(--inkLight);
      line-height: 1.6;
    }

    /* ── STATS ── */
    .stat-block { display: flex; flex-direction: column; align-items: center; gap: 8px; }
    .stat-label-top {
      font-family: 'Special Elite', cursive;
      font-size: 0.75rem;
      letter-spacing: 2px;
      text-transform: uppercase;
    }
    .stat-ring {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 80px;
    }
    .stat-ring-inner {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .stat-ring-val {
      font-family: 'Special Elite', cursive;
      font-size: 2.6rem;
      font-weight: 900;
      line-height: 1;
    }
    .stat-sub { font-family: 'Kalam', cursive; font-size: 0.75rem; color: var(--inkFaded); text-align: center; }

    .stat-controls { display: flex; align-items: center; gap: 8px; }
    .stat-btn {
      width: 30px; height: 30px;
      background: var(--parchmentDark);
      border: 1.5px solid var(--border);
      border-radius: 4px;
      font-size: 1.1rem;
      color: var(--inkLight);
      cursor: pointer;
      display: flex; align-items: center; justify-content: center;
      transition: background 0.1s;
    }
    .stat-btn:hover { background: rgba(139,94,60,0.2); }

    .points-info {
      text-align: center;
      font-family: 'Special Elite', cursive;
      font-size: 0.85rem;
      color: var(--inkFaded);
      margin-bottom: 20px;
      letter-spacing: 1px;
    }
    .points-info span {
      color: var(--gold);
      font-size: 1.3rem;
    }

    /* Derived stats */
    .derived-row {
      display: flex;
      gap: 16px;
      justify-content: center;
      margin-top: 20px;
    }
    .derived-box {
      background: rgba(200,151,58,0.08);
      border: 1.5px solid var(--gold);
      border-radius: 10px;
      padding: 12px 24px;
      text-align: center;
    }
    .derived-name {
      font-family: 'Special Elite', cursive;
      font-size: 0.72rem;
      color: var(--inkFaded);
      letter-spacing: 2px;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .derived-val {
      font-family: 'Special Elite', cursive;
      font-size: 2.2rem;
      font-weight: 900;
    }

    /* ── TRAIT ROLL ── */
    .roll-area {
      background: rgba(139,94,60,0.08);
      border: 1px dashed rgba(139,94,60,0.5);
      border-radius: 8px;
      padding: 18px 20px;
      margin-bottom: 18px;
    }
    .dice-row {
      display: flex;
      align-items: center;
      gap: 14px;
      margin-bottom: 14px;
    }
    .die {
      width: 68px; height: 68px;
      background: var(--parchmentDark);
      border: 2.5px solid var(--border);
      border-radius: 10px;
      display: flex; align-items: center; justify-content: center;
      font-size: 2rem;
      color: var(--ink);
      box-shadow: 2px 3px 0 rgba(139,94,60,0.3);
      transition: transform 0.1s;
      flex-shrink: 0;
    }
    .die.rolling { animation: dieShake 0.45s ease; }
    @keyframes dieShake {
      0%,100% { transform: rotate(0deg) scale(1); }
      20%      { transform: rotate(-18deg) scale(1.1); }
      40%      { transform: rotate(18deg) scale(1.12); }
      60%      { transform: rotate(-10deg) scale(1.05); }
      80%      { transform: rotate(8deg); }
    }
    .dice-sep {
      font-family: 'Special Elite', cursive;
      font-size: 1.6rem;
      color: var(--gold);
    }
    .dice-result {
      font-family: 'Special Elite', cursive;
      font-size: 1.3rem;
      color: var(--ink);
    }
    .dice-result .sum {
      color: var(--roseAcc);
      font-size: 1.8rem;
    }
    .trait-result-box {
      background: var(--ink);
      border: 2.5px solid var(--gold);
      border-radius: 10px;
      padding: 14px 20px;
      text-align: center;
      box-shadow: 0 4px 0 rgba(200,151,58,0.35);
    }
    .trait-result-name {
      font-family: 'Special Elite', cursive;
      font-size: 1.5rem;
      color: var(--gold);
      letter-spacing: 3px;
      margin-bottom: 6px;
    }
    .trait-result-desc {
      font-family: 'Kalam', cursive;
      font-size: 1rem;
      color: var(--parchment);
      line-height: 1.5;
    }
    .trait-result-empty {
      font-family: 'Kalam', cursive;
      font-size: 1rem;
      color: var(--inkFaded);
      font-style: italic;
      text-align: center;
      padding: 8px 0;
    }

    /* Trait table */
    .trait-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.82rem;
    }
    .trait-table th {
      background: var(--parchmentDark);
      font-family: 'Special Elite', cursive;
      font-size: 0.72rem;
      letter-spacing: 2px;
      text-transform: uppercase;
      padding: 7px 10px;
      border: 1px solid rgba(139,94,60,0.4);
      color: var(--inkLight);
    }
    .trait-table td {
      padding: 6px 10px;
      border: 1px solid rgba(139,94,60,0.2);
      font-family: 'Kalam', cursive;
      color: var(--inkLight);
    }
    .trait-table td:first-child {
      font-family: 'Special Elite', cursive;
      font-size: 1rem;
      color: var(--inkFaded);
      text-align: center;
      width: 40px;
    }
    .trait-table td:nth-child(2) {
      font-family: 'Special Elite', cursive;
      color: var(--inkLight);
      width: 120px;
    }
    .trait-table tr:nth-child(even) td { background: rgba(230,213,168,0.4); }
    .trait-table tr.highlight td {
      background: var(--gold);
      color: var(--ink);
    }
    .trait-table tr.highlight td:first-child,
    .trait-table tr.highlight td:nth-child(2) { color: var(--ink); }

    /* ── TALENTS ── */
    .talent-list { display: flex; flex-direction: column; gap: 8px; }
    .talent-item {
      display: flex;
      gap: 12px;
      align-items: flex-start;
      padding: 12px 14px;
      background: rgba(230,213,168,0.5);
      border: 2px solid rgba(139,94,60,0.3);
      border-radius: 8px;
      cursor: pointer;
      transition: border-color 0.15s, background 0.15s;
    }
    .talent-item:hover { border-color: var(--gold); }
    .talent-item.selected {
      background: rgba(200,151,58,0.12);
      border-color: var(--gold);
    }
    .talent-check {
      width: 22px; height: 22px;
      border-radius: 50%;
      border: 2px solid var(--border);
      flex-shrink: 0;
      margin-top: 3px;
      display: flex; align-items: center; justify-content: center;
      font-size: 0.75rem;
      color: var(--parchment);
      transition: background 0.15s, border-color 0.15s;
    }
    .talent-item.selected .talent-check {
      background: var(--gold);
      border-color: var(--gold);
    }
    .talent-name {
      font-family: 'Special Elite', cursive;
      font-size: 1rem;
      color: var(--ink);
      margin-bottom: 3px;
    }
    .talent-desc {
      font-family: 'Kalam', cursive;
      font-size: 0.85rem;
      color: var(--inkFaded);
      line-height: 1.4;
    }
    .talent-count {
      font-family: 'Special Elite', cursive;
      font-size: 0.8rem;
      color: var(--inkFaded);
      letter-spacing: 1px;
      margin-bottom: 10px;
    }
    .talent-count.complete { color: var(--gold); }

    /* ── SPELLS ── */
    .filter-bar {
      display: flex;
      gap: 8px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }
    .filter-btn {
      padding: 5px 14px;
      border: 1.5px solid rgba(139,94,60,0.4);
      background: transparent;
      border-radius: 20px;
      cursor: pointer;
      font-family: 'Special Elite', cursive;
      font-size: 0.72rem;
      letter-spacing: 1px;
      text-transform: uppercase;
      color: var(--inkFaded);
      transition: all 0.15s;
    }
    .filter-btn:hover { border-color: var(--gold); color: var(--inkLight); }
    .filter-btn.active { background: var(--ink); color: var(--gold); border-color: var(--ink); }

    .spell-count {
      font-family: 'Kalam', cursive;
      font-size: 0.85rem;
      color: var(--inkFaded);
      font-style: italic;
      margin-bottom: 8px;
    }
    .spell-grid {
      display: flex;
      flex-direction: column;
      gap: 7px;
    }
    .spell-card {
      background: rgba(230,213,168,0.55);
      border: 1.5px solid rgba(139,94,60,0.3);
      border-left: 4px solid transparent;
      border-radius: 8px;
      padding: 10px 14px;
      cursor: pointer;
      transition: border-color 0.15s, background 0.15s;
    }
    .spell-card:hover { border-color: var(--gold); background: rgba(255,255,255,0.5); }
    .spell-card.selected {
      background: rgba(200,151,58,0.1);
      border-color: var(--gold);
    }
    .spell-card-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 5px;
    }
    .spell-name {
      font-family: 'Special Elite', cursive;
      font-size: 0.95rem;
      color: var(--ink);
    }
    .spell-tags { display: flex; gap: 5px; flex-shrink: 0; }
    .spell-tag {
      font-family: 'Special Elite', cursive;
      font-size: 0.65rem;
      letter-spacing: 1px;
      text-transform: uppercase;
      padding: 2px 8px;
      border-radius: 12px;
    }
    .spell-tag.costaud { background: rgba(192,96,112,0.15); color: var(--roseAcc); border: 1px solid rgba(192,96,112,0.3); }
    .spell-tag.malin   { background: rgba(90,122,156,0.15); color: var(--blueAcc); border: 1px solid rgba(90,122,156,0.3); }
    .spell-tag.mignon  { background: rgba(90,140,90,0.15);  color: var(--greenAcc); border: 1px solid rgba(90,140,90,0.3); }
    .spell-tag.dif     { background: var(--ink); color: var(--gold); border: 1px solid var(--gold); }
    .spell-desc {
      font-family: 'Kalam', cursive;
      font-size: 0.82rem;
      color: var(--inkFaded);
      line-height: 1.45;
    }

    /* ── BACKPACK ── */
    .backpack-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 7px;
      margin-top: 10px;
    }
    .backpack-slot {
      aspect-ratio: 1;
      background: rgba(255,255,255,0.3);
      border: 1.5px dashed rgba(139,94,60,0.35);
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'Kalam', cursive;
      font-size: 0.72rem;
      text-align: center;
      color: rgba(139,94,60,0.4);
      padding: 6px;
      min-height: 66px;
    }
    .backpack-slot.filled {
      background: rgba(200,151,58,0.1);
      border: 1.5px solid var(--gold);
      color: var(--ink);
      font-size: 0.75rem;
    }

    /* ── BUTTONS ── */
    .btn {
      padding: 10px 22px;
      font-family: 'Special Elite', cursive;
      font-size: 0.85rem;
      letter-spacing: 1px;
      text-transform: uppercase;
      border-radius: 5px;
      cursor: pointer;
      transition: transform 0.1s, box-shadow 0.1s;
    }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary {
      background: var(--ink);
      color: var(--gold);
      border: 2px solid var(--gold);
      box-shadow: 0 3px 0 rgba(200,151,58,0.35);
    }
    .btn-primary:hover { box-shadow: 0 4px 0 rgba(200,151,58,0.4); }
    .btn-secondary {
      background: transparent;
      color: var(--inkLight);
      border: 1.5px solid rgba(139,94,60,0.45);
    }
    .btn-secondary:hover { background: rgba(139,94,60,0.08); }
    .btn-roll {
      background: var(--roseAcc);
      color: var(--parchment);
      border: none;
      box-shadow: 0 3px 0 rgba(192,96,112,0.35);
      margin-bottom: 12px;
    }
    .btn-roll:hover { box-shadow: 0 4px 0 rgba(192,96,112,0.4); }

    .nav-buttons {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 26px;
      padding-top: 16px;
      border-top: 1px solid rgba(139,94,60,0.25);
    }

    /* ── FINAL SHEET ── */
    .sheet-header {
      text-align: center;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 1.5px solid rgba(139,94,60,0.3);
    }
    .sheet-title {
      font-family: 'Special Elite', cursive;
      font-size: 1.2rem;
      color: var(--inkFaded);
      letter-spacing: 6px;
      text-transform: uppercase;
      margin-bottom: 4px;
    }
    .sheet-subtitle {
      font-family: 'Kalam', cursive;
      font-size: 1rem;
      color: var(--inkLight);
    }
    .cat-row {
      display: flex;
      justify-content: center;
      gap: 6px;
      margin-top: 8px;
    }
    .cat-icon {
      width: 24px; height: 24px;
      opacity: 0.3;
    }
    .cat-icon.filled { opacity: 1; }

    .sheet-name {
      font-family: 'Special Elite', cursive;
      font-size: 2.2rem;
      color: var(--ink);
      border-bottom: 2px solid var(--border);
      padding-bottom: 4px;
      margin-bottom: 14px;
      min-height: 42px;
    }

    .sheet-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 24px;
    }

    .stat-circles-row {
      display: flex;
      gap: 10px;
      justify-content: center;
      margin: 10px 0;
    }
    .stat-circ {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
    }
    .stat-circ-ring {
      width: 60px; height: 60px;
      position: relative;
    }
    .stat-circ-ring svg { position: absolute; inset: 0; }
    .stat-circ-inner {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: 'Special Elite', cursive;
      font-size: 1.5rem;
      font-weight: 900;
    }
    .stat-circ-label {
      font-family: 'Special Elite', cursive;
      font-size: 0.6rem;
      color: var(--inkFaded);
      letter-spacing: 1px;
      text-transform: uppercase;
    }

    .spell-entry {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 5px 10px;
      background: rgba(255,255,255,0.35);
      border-radius: 6px;
      margin-bottom: 4px;
      font-family: 'Kalam', cursive;
      font-size: 0.85rem;
      color: var(--ink);
      border-left: 3px solid var(--gold);
    }

    .print-row {
      display: flex;
      gap: 10px;
      justify-content: center;
      margin-top: 20px;
    }

    /* ── RESPONSIVE ── */

    /* Tablette (≤ 720px) */
    @media (max-width: 720px) {
      body { padding: 10px 8px; }
      .app { max-width: 100%; }
      .card { padding: 20px 16px 18px; }
      .site-title { font-size: 1.6rem; }
      .site-subtitle { font-size: 0.85rem; }

      /* Nav : scrollable sur une ligne sans scrollbar visible */
      .steps-nav {
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
      }
      .steps-nav::-webkit-scrollbar { display: none; }
      .step-btn { flex: 0 0 auto; min-width: 80px; font-size: 0.65rem; padding: 8px 6px; }

      /* Stats : 2 colonnes + 1 centré */
      .stats-row { flex-wrap: wrap; justify-content: center; gap: 14px; }
      .stat-block { width: 44%; }

      /* Enfances : grille 1 colonne */
      .enfance-grid { grid-template-columns: 1fr 1fr; }
      .enfance-img { height: 80px; }

      /* Fiche finale — grille 1 colonne */
      .sheet-grid { grid-template-columns: 1fr; }

      /* Backpack : 4 colonnes → 3 colonnes */
      .backpack-grid { grid-template-columns: repeat(3, 1fr); }

      /* Champs formulaire */
      .field-row   { grid-template-columns: 1fr; }
      .field-row-3 { grid-template-columns: 1fr 1fr; }

      /* Stat dérivée */
      .derived-row { gap: 8px; }
      .derived-box { padding: 10px 14px; }
      .derived-val { font-size: 1.8rem; }

      /* Filtres sorts */
      .filter-bar { flex-wrap: wrap; }

      /* Dés */
      .dice-row { flex-wrap: wrap; justify-content: center; }
      .die { width: 56px; height: 56px; font-size: 1.6rem; }

      /* Menu perso */
      .char-menu { gap: 6px; }
    }

    /* Mobile (≤ 540px) */
    @media (max-width: 540px) {
      body { padding: 6px 4px; }
      .card { padding: 16px 12px; border-radius: 4px; }
      .site-title { font-size: 1.3rem; letter-spacing: 2px; }
      .site-subtitle { font-size: 0.78rem; }

      /* Nav : réduit encore sur mobile */
      .step-btn { min-width: 70px; font-size: 0.6rem; padding: 7px 4px; letter-spacing: 0; }

      /* Stats : 1 colonne, affichage horizontal compact */
      .stats-row { flex-direction: column; gap: 0; }
      .stat-block {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 4px;
        border-bottom: 1px solid rgba(139,94,60,0.15);
      }
      .stat-ring { height: auto; }
      .stat-ring-val { font-size: 2rem; }
      .stat-sub { display: none; }
      .stat-label-top { min-width: 80px; }

      /* Enfances : 1 colonne */
      .enfance-grid { grid-template-columns: 1fr; }
      .enfance-img-wrap { float: left; margin: 0 12px 8px 0; }
      .enfance-img { height: 70px; }

      /* Formulaire */
      .field-row, .field-row-3 { grid-template-columns: 1fr; }

      /* Sac : 2 colonnes */
      .backpack-grid { grid-template-columns: repeat(2, 1fr); }

      /* Filtres sorts */
      .filter-bar { gap: 4px; }
      .filter-btn { padding: 5px 8px; font-size: 0.68rem; }

      /* Dés */
      .die { width: 48px; height: 48px; font-size: 1.4rem; }
      .roll-area { padding: 12px; }

      /* Dérivées */
      .derived-row { gap: 8px; flex-wrap: wrap; justify-content: center; }
      .derived-box { padding: 8px 12px; flex: 1; min-width: 110px; }
      .derived-val { font-size: 1.5rem; }
      .derived-name { font-size: 0.62rem; }

      /* Nav boutons */
      .nav-buttons { flex-direction: column; gap: 8px; }
      .nav-buttons .btn { width: 100%; text-align: center; }

      /* Table trait */
      .trait-table { font-size: 0.72rem; }
      .trait-table th, .trait-table td { padding: 4px 6px; }

      /* Fiche SVG — scroll horizontal sans scrollbar visible */
      #characterSheetWrap { 
        overflow-x: auto; 
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
      }
      #characterSheetWrap::-webkit-scrollbar { display: none; }
      #characterSheetSVG  { min-width: 480px; }

      /* Rangée impression */
      .print-row { flex-wrap: wrap; gap: 6px; padding: 8px; }
      .print-row-sep { display: none; }

      /* Fiche finale */
      .sheet-grid { grid-template-columns: 1fr; }

      /* Menu perso */
      .char-menu { padding: 8px 6px; gap: 6px; }
      .char-menu .btn, .char-menu .btn-danger { padding: 6px 10px; font-size: 0.75rem; }
      .char-select { font-size: 0.85rem; }
    }

    /* Ultra-petit (≤ 360px) */
    @media (max-width: 360px) {
      .site-title { font-size: 1.1rem; letter-spacing: 1px; }
      .card { padding: 12px 8px; }
      .step-btn { min-width: 60px; font-size: 0.55rem; padding: 6px 2px; }
      .steps-nav { gap: 0; }
      .stat-ring-val { font-size: 1.7rem; }
      .derived-box { padding: 6px 8px; }
      .derived-val { font-size: 1.3rem; }
      .step-title { font-size: 1.4rem; }
      .backpack-grid { grid-template-columns: repeat(2, 1fr); }
      .char-menu-label { opacity: 0.7; }
    }
    /* ── MENU PERSONNAGES ── */
    .char-menu {
      width: 100%;
      max-width: 860px;
      display: flex;
      margin-bottom: 20px;
    }
    /* Conteneur unifié : select + boutons dans la même boîte */
    .char-menu-bar {
      display: flex;
      flex: 1;
      height: 36px;
      border: 1.5px solid var(--border);
      border-radius: 6px;
      overflow: hidden;
      background: rgba(44,26,14,0.85);
    }
    .char-select {
      flex: 1;
      min-width: 0;
      height: 100%;
      -webkit-appearance: none;
      appearance: none;
      background: transparent
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23C8973A'/%3E%3C/svg%3E")
        no-repeat right 10px center;
      background-size: 10px 6px;
      border: none;
      color: var(--parchment);
      font-family: 'Kalam', cursive;
      font-size: 0.95rem;
      padding: 0 30px 0 12px;
      cursor: pointer;
      outline: none;
    }
    .char-select option { background: #2C1A0E; }
    .char-menu-sep {
      width: 1px;
      background: var(--border);
      opacity: 0.6;
      flex-shrink: 0;
    }
    .char-btn {
      background: transparent;
      border: none;
      border-left: 1px solid rgba(139,94,60,0.4);
      color: var(--gold);
      font-size: 1rem;
      width: 36px;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      padding: 0;
      transition: background 0.15s, color 0.15s;
      flex-shrink: 0;
    }
    .char-btn:first-of-type { border-left: none; }
    .char-btn:hover { background: rgba(200,151,58,0.15); }
    .char-btn-add { color: var(--goldLight); }
    .char-btn-add:hover { color: var(--gold); }
    .char-btn-del { color: var(--inkFaded); }
    .char-btn-del:hover { background: rgba(192,96,112,0.15); color: var(--roseAcc); }
    .btn-icon {
      background: rgba(44,26,14,0.7);
      border: none;
      border-right: 1px solid var(--border);
      color: var(--gold);
      font-size: 1rem;
      line-height: 1;
      width: 36px;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
      padding: 0;
    }
    .btn-icon:last-child { border-right: none; }
    .btn-icon:hover { background: rgba(200,151,58,0.18); }
    .btn-icon-add { color: var(--goldLight); }
    .btn-icon-add:hover { color: var(--gold); }
    .btn-icon-del { color: var(--inkFaded); }
    .btn-icon-del:hover { background: rgba(192,96,112,0.15); color: var(--roseAcc); }

    /* Taille compact pour les boutons de la print-row */
    .btn-sm {
      padding: 7px 14px;
      font-size: 0.78rem;
      letter-spacing: 0.5px;
    }
    /* Bouton fantome (danger discret) */
    .btn-ghost {
      background: transparent;
      border: 1.5px dashed rgba(139,94,60,0.35);
      color: var(--inkFaded);
      font-family: 'Special Elite', cursive;
      font-size: 0.78rem;
      border-radius: 5px;
      cursor: pointer;
      padding: 7px 14px;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      transition: border-color 0.15s, color 0.15s;
    }
    .btn-ghost:hover { border-color: var(--roseAcc); color: var(--roseAcc); }

    /* Groupes dans la print-row */
    .print-row {
      display: flex;
      align-items: center;
      gap: 6px;
      justify-content: flex-start;
      margin-top: 16px;
      padding: 10px 12px;
      background: rgba(139,94,60,0.06);
      border: 1px solid rgba(139,94,60,0.22);
      border-radius: 6px;
    }
    .print-row-group {
      display: flex;
      gap: 5px;
      align-items: center;
    }
    .print-row-sep {
      width: 1px;
      height: 24px;
      background: rgba(139,94,60,0.3);
      flex-shrink: 0;
      margin: 0 4px;
    }

    /* ── DROPDOWN ACTIONS ── */
    .print-more-wrap {
      position: relative;
      margin-left: auto;
    }
    .print-more-toggle {
      min-width: 38px;
      font-size: 1.1rem;
      letter-spacing: 2px;
      padding: 7px 10px;
    }
    .print-more-menu {
      display: none;
      position: absolute;
      top: calc(100% + 6px);
      right: 0;
      background: var(--parchment);
      background-image: radial-gradient(ellipse at 20% 20%, rgba(200,175,120,0.3) 0%, transparent 60%);
      border: 1.5px solid var(--border);
      border-radius: 6px;
      box-shadow: 0 8px 28px rgba(0,0,0,0.45);
      min-width: 190px;
      z-index: 200;
      overflow: hidden;
      padding: 4px 0;
    }
    .print-more-menu.open { display: block; }
    .print-more-item {
      display: block;
      width: 100%;
      text-align: left;
      background: transparent;
      border: none;
      padding: 9px 16px;
      font-family: 'Special Elite', cursive;
      font-size: 0.78rem;
      letter-spacing: 1px;
      color: var(--inkLight);
      cursor: pointer;
      transition: background 0.12s, color 0.12s;
      text-transform: uppercase;
    }
    .print-more-item:hover { background: rgba(139,94,60,0.1); color: var(--ink); }
    .print-more-danger { color: var(--roseAcc); }
    .print-more-danger:hover { background: rgba(192,96,112,0.1); color: var(--roseAcc); }
    .print-more-divider {
      height: 1px;
      background: rgba(139,94,60,0.2);
      margin: 4px 10px;
    }

    .btn-danger {
      background: transparent;
      border: 1.5px solid var(--roseAcc);
      color: var(--roseAcc);
      font-family: 'Special Elite', cursive;
      font-size: 0.75rem;
      letter-spacing: 1px;
      border-radius: 4px;
      cursor: pointer;
      padding: 6px 12px;
      transition: background 0.15s;
    }
    .btn-danger:hover { background: rgba(192,96,112,0.15); }

    @media print {
      body { background: white; padding: 0; }
      .no-print,
      .char-menu,
      .steps-nav, .nav-buttons, .print-row, .site-title, .site-subtitle { display: none !important; }
      .card { border: none; box-shadow: none; background: white; padding: 0; }
      #characterSheetWrap { max-width: 100%; margin: 0; }
      #characterSheetSVG  { width: 100%; height: auto; }
    }

    /* ── PANNEAU PERSONNAGES ── */
    dialog.char-panel {
      background: var(--parchment);
      background-image:
        radial-gradient(ellipse at 15% 10%, rgba(200,175,120,0.35) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 90%, rgba(180,150,100,0.3)  0%, transparent 45%);
      border: 2px solid var(--border);
      border-radius: 8px;
      width: calc(100vw - 32px);
      max-width: 620px;
      max-height: 90vh;
      overflow-y: auto;
      box-shadow: 0 20px 60px rgba(0,0,0,0.8);
      padding: 0;
      color: var(--ink);
      margin: auto;
    }
    dialog.char-panel::backdrop {
      background: rgba(10,5,2,0.75);
    }
    .char-panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 18px 20px 14px;
      border-bottom: 1.5px solid var(--border);
    }
    .char-panel-title {
      font-family: 'Special Elite', cursive;
      font-size: 1.1rem;
      color: var(--ink);
      letter-spacing: 3px;
      text-transform: uppercase;
    }
    .char-panel-close {
      background: transparent;
      border: none;
      font-size: 1.3rem;
      color: var(--inkLight);
      cursor: pointer;
      line-height: 1;
      padding: 2px 6px;
    }
    .char-panel-close:hover { color: var(--roseAcc); }
    .char-cards {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      padding: 18px;
    }
    @media (max-width: 480px) { .char-cards { grid-template-columns: 1fr; } }
    .char-card {
      background: rgba(44,26,14,0.06);
      border: 1.5px solid var(--border);
      border-radius: 6px;
      padding: 14px 16px;
      cursor: pointer;
      transition: background 0.15s, border-color 0.15s, transform 0.1s;
      position: relative;
    }
    .char-card:hover {
      background: rgba(200,151,58,0.12);
      border-color: var(--gold);
      transform: translateY(-1px);
    }
    .char-card.active-card {
      border-color: var(--gold);
      background: rgba(200,151,58,0.15);
    }
    .char-card.active-card .char-card-img {
      border-color: var(--gold);
      box-shadow: 0 0 8px rgba(200,151,58,0.5);
    }
    .char-card-active-badge {
      position: absolute;
      top: 8px;
      right: 8px;
      font-size: 0.6rem;
      font-family: 'Special Elite', cursive;
      letter-spacing: 1px;
      color: var(--gold);
      background: rgba(200,151,58,0.15);
      border: 1px solid var(--gold);
      border-radius: 3px;
      padding: 1px 5px;
    }
    .char-card-name {
      font-family: 'Special Elite', cursive;
      font-size: 1rem;
      color: var(--ink);
      margin-bottom: 3px;
      padding-right: 40px;
    }
    .char-card-player {
      font-size: 0.8rem;
      color: var(--inkLight);
      margin-bottom: 8px;
      font-style: italic;
    }
    .char-card-meta {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }
    .char-card-step {
      font-size: 0.7rem;
      font-family: 'Special Elite', cursive;
      letter-spacing: 1px;
      color: var(--inkFaded);
      background: rgba(139,94,60,0.1);
      border: 1px solid rgba(139,94,60,0.25);
      border-radius: 3px;
      padding: 2px 6px;
    }
    .char-card-date {
      font-size: 0.68rem;
      color: var(--inkFaded);
      font-style: italic;
    }
    .char-card-img {
      width: 54px;
      height: 54px;
      object-fit: cover;
      border-radius: 50%;
      border: 2px solid var(--border);
      flex-shrink: 0;
      background: rgba(139,94,60,0.12);
    }
    .char-card-img-placeholder {
      width: 54px;
      height: 54px;
      border-radius: 50%;
      border: 2px dashed var(--border);
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      opacity: 0.4;
    }
    .char-card-body {
      flex: 1;
      min-width: 0;
    }
    .char-card-inner {
      display: flex;
      gap: 12px;
      align-items: center;
      padding-left: 6px;
    }
    .char-card-print {
      position: absolute;
      bottom: 8px;
      right: 36px;
      background: transparent;
      border: none;
      color: var(--inkFaded);
      font-size: 0.85rem;
      cursor: pointer;
      padding: 2px 5px;
      border-radius: 3px;
      transition: color 0.15s, background 0.15s;
    }
    .char-card-print:hover {
      color: var(--gold);
      background: rgba(200,151,58,0.1);
    }
    .char-card-delete {
      position: absolute;
      bottom: 8px;
      right: 8px;
      background: transparent;
      border: none;
      color: var(--inkFaded);
      font-size: 0.75rem;
      cursor: pointer;
      padding: 2px 5px;
      border-radius: 3px;
      transition: color 0.15s, background 0.15s;
    }
    .char-card-delete:hover {
      color: var(--roseAcc);
      background: rgba(192,96,112,0.1);
    }
    .char-panel-footer {
      padding: 14px 18px 18px;
      border-top: 1.5px solid var(--border);
      display: flex;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
    }
    .char-card-check {
      position: absolute;
      top: 10px;
      left: 10px;
      width: 18px;
      height: 18px;
      accent-color: var(--gold);
      cursor: pointer;
    }
    .char-card.checked {
      border-color: var(--gold);
      background: rgba(200,151,58,0.18);
    }
    .btn-list {
      background: transparent;
      border: 1.5px solid var(--gold);
      color: var(--gold);
      font-family: 'Special Elite', cursive;
      font-size: 0.72rem;
      letter-spacing: 1.5px;
      border-radius: 4px;
      cursor: pointer;
      padding: 6px 12px;
      transition: background 0.15s;
      white-space: nowrap;
    }
    .btn-list:hover { background: rgba(200,151,58,0.12); }

    /* ── INFO BOX ── */
    .info-box {
      background: rgba(139,94,60,0.07);
      border: 1px solid rgba(139,94,60,0.3);
      border-radius: 6px;
      padding: 10px 14px;
      font-family: 'Kalam', cursive;
      font-size: 0.88rem;
      color: var(--inkFaded);
      font-style: italic;
      margin-bottom: 14px;
      text-align: center;
    }

    /* ── MODALE IMPRESSION ── */
    dialog.print-modal {
      background: var(--parchment);
      background-image: radial-gradient(ellipse at 20% 20%, rgba(200,175,120,0.3) 0%, transparent 60%);
      border: 2px solid var(--border);
      border-radius: 10px;
      padding: 28px 28px 22px;
      max-width: 340px;
      width: calc(100vw - 32px);
      box-shadow: 0 16px 48px rgba(0,0,0,0.65);
      color: var(--ink);
      margin: auto;
    }
    dialog.print-modal::backdrop {
      background: rgba(10,5,2,0.7);
      backdrop-filter: blur(2px);
    }
    .print-modal-title {
      font-family: 'Special Elite', cursive;
      font-size: 1.1rem;
      color: var(--ink);
      letter-spacing: 3px;
      text-transform: uppercase;
      margin-bottom: 20px;
      text-align: center;
    }
    .print-modal-option {
      display: flex;
      align-items: center;
      gap: 12px;
      background: rgba(139,94,60,0.07);
      border: 1.5px solid rgba(139,94,60,0.25);
      border-radius: 8px;
      padding: 12px 16px;
      margin-bottom: 20px;
      cursor: pointer;
      transition: border-color 0.15s, background 0.15s;
    }
    .print-modal-option:hover { border-color: var(--gold); background: rgba(200,151,58,0.08); }
    .print-modal-option input[type="checkbox"] {
      width: 18px;
      height: 18px;
      accent-color: var(--gold);
      flex-shrink: 0;
      cursor: pointer;
    }
    .print-modal-option-text {
      flex: 1;
    }
    .print-modal-option-label {
      font-family: 'Special Elite', cursive;
      font-size: 0.85rem;
      color: var(--inkLight);
      letter-spacing: 1px;
      text-transform: uppercase;
      display: block;
      margin-bottom: 2px;
    }
    .print-modal-option-desc {
      font-family: 'Kalam', cursive;
      font-size: 0.78rem;
      color: var(--inkFaded);
      font-style: italic;
    }
    .print-modal-actions {
      display: flex;
      gap: 8px;
      justify-content: flex-end;
    }