/* ===== Ko-fi floating button ===== */
.kofi-btn {
  position:fixed; bottom:18px; right:18px; z-index:9999;
  display:inline-flex; align-items:center; gap:6px;
  background:#1a1a2e; color:rgba(255,255,255,.75);
  border:1px solid rgba(255,255,255,.12);
  padding:7px 14px; border-radius:20px;
  font-family:'Poppins',sans-serif; font-size:12px; font-weight:600;
  text-decoration:none;
  box-shadow:0 2px 12px rgba(0,0,0,.4);
  transition:all .2s;
}
.kofi-btn:hover { background:#29abe0; border-color:#29abe0; color:#fff; box-shadow:0 4px 18px rgba(41,171,224,.35); }

/* ===== print.css — Planche d'impression ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Poppins',sans-serif; background:#0f0f1a; color:#fff; min-height:100vh; overflow-x:hidden; }

/* ===== Header ===== */
.print-header {
  display:flex; align-items:center; gap:16px;
  padding:12px 24px;
  background:#1a1a2e;
  border-bottom:1px solid rgba(255,255,255,.06);
  flex-wrap:wrap;
}
.back-btn {
  display:inline-flex; align-items:center; gap:6px;
  color:rgba(255,255,255,.6); text-decoration:none;
  font-size:13px; font-weight:500;
  padding:6px 12px; border-radius:6px;
  border:1px solid rgba(255,255,255,.12);
  transition:all .15s;
  white-space:nowrap;
}
.back-btn:hover { color:#fff; border-color:rgba(255,255,255,.3); background:rgba(255,255,255,.05); }
.print-header-info { flex:1; }
.print-header-info h1 { font-size:16px; font-weight:700; letter-spacing:.5px; }
.print-header-info p { font-size:11px; color:rgba(255,255,255,.4); margin-top:1px; }
.export-btn {
  background:linear-gradient(135deg,#667eea,#764ba2);
  color:#fff; border:none; border-radius:8px;
  padding:9px 20px; font-size:13px; font-weight:600;
  cursor:pointer; transition:opacity .15s;
  font-family:'Poppins',sans-serif;
  white-space:nowrap;
}
.export-btn:hover:not(:disabled) { opacity:.85; }
.export-btn:disabled { opacity:.4; cursor:default; }

/* ===== Toolbar ===== */
.print-toolbar {
  display:flex; align-items:center; gap:12px;
  padding:8px 24px;
  background:rgba(255,255,255,.02);
  border-bottom:1px solid rgba(255,255,255,.04);
  flex-wrap:wrap;
}
.toolbar-btn {
  background:rgba(255,255,255,.06); color:rgba(255,255,255,.7);
  border:1px solid rgba(255,255,255,.1); border-radius:6px;
  padding:5px 12px; font-size:11px; font-weight:500;
  cursor:pointer; font-family:'Poppins',sans-serif;
  transition:all .15s;
}
.toolbar-btn:hover { background:rgba(255,255,255,.1); color:#fff; }
.upload-multi-btn {
  background:rgba(102,126,234,.15); color:#a0aeff;
  border:1px solid rgba(102,126,234,.3); border-radius:6px;
  padding:5px 14px; font-size:11px; font-weight:600;
  cursor:pointer; font-family:'Poppins',sans-serif;
  transition:all .15s;
}
.upload-multi-btn:hover { background:rgba(102,126,234,.25); color:#c0c8ff; }
.slot-count {
  font-size:11px; color:rgba(255,255,255,.45); margin-left:auto;
}
.slot-count strong { color:rgba(255,255,255,.8); }

/* ===== Sheet Wrapper ===== */
.print-sheet-outer {
  padding:20px 24px 28px;
  display:flex; justify-content:center;
}

/* Container maintains 9150:6930 aspect ratio */
.print-sheet-container {
  position:relative;
  /* max width = available area; height auto from aspect-ratio */
  width:100%;
  max-width:min(calc(100vw - 48px), calc((100vh - 130px) * 9150 / 6930));
  aspect-ratio:9150 / 6930;
  box-shadow:0 8px 40px rgba(0,0,0,.5);
}

.print-sheet {
  position:absolute; inset:0;
  background:#fff;
}

/* ===== Card Slots ===== */
/* Positions and sizes are set inline via JS (percentage-based) */
.card-slot {
  position:absolute;
  cursor:pointer;
  outline:2px dashed rgba(180,180,200,.35);
  outline-offset:-1px;
  transition:outline-color .15s, background .15s;
  overflow:hidden;
}
.card-slot:hover { outline-color:rgba(102,126,234,.6); background:rgba(102,126,234,.04); }
.card-slot.drag-over { outline:2px solid #667eea; background:rgba(102,126,234,.1); }
.card-slot.has-image { outline:none; cursor:grab; }
.card-slot.has-image:active { cursor:grabbing; }
.card-slot.dragging { opacity:.4; outline:2px dashed rgba(255,255,255,.3); }

.slot-img {
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  pointer-events:none;
  display:block;
}

.slot-placeholder {
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:6px; pointer-events:none;
  user-select:none;
}
.slot-num {
  font-size:clamp(10px, 2.5vw, 22px);
  font-weight:800; color:rgba(100,100,140,.5);
  line-height:1;
}
.slot-hint {
  font-size:clamp(6px, 1vw, 10px);
  color:rgba(100,100,140,.4); text-align:center;
  padding:0 8px;
}

.slot-clear {
  position:absolute; top:4px; right:4px;
  width:clamp(16px, 2vw, 22px); height:clamp(16px, 2vw, 22px);
  background:rgba(0,0,0,.55); color:#fff;
  border:none; border-radius:50%; cursor:pointer;
  font-size:clamp(9px, 1.2vw, 14px); line-height:1;
  display:flex; align-items:center; justify-content:center;
  font-family:'Poppins',sans-serif; font-weight:700;
  transition:background .15s; z-index:10;
}
.slot-clear:hover { background:rgba(200,50,50,.8); }

/* ===== Export group (double mode) ===== */
.export-group { display:flex; gap:8px; align-items:center; }
.export-btn-sm {
  background:rgba(102,126,234,.25); color:#a0aeff;
  border:1px solid rgba(102,126,234,.4);
  font-size:12px; padding:7px 14px;
}
.export-btn-sm:hover { background:rgba(102,126,234,.4); color:#fff; border-color:rgba(102,126,234,.6); }

/* ===== Mode button ===== */
.mode-btn { border-color:rgba(118,75,162,.4); color:#c084fc; }
.mode-btn:hover { background:rgba(118,75,162,.15); color:#e0b4ff; }

/* ===== Tabs ===== */
.tab-btns { display:flex; gap:4px; background:rgba(0,0,0,.3); padding:3px; border-radius:8px; }
.tab-btn {
  background:transparent; color:rgba(255,255,255,.5);
  border:none; border-radius:6px;
  padding:5px 16px; font-size:12px; font-weight:600;
  cursor:pointer; font-family:'Poppins',sans-serif;
  transition:all .15s;
}
.tab-btn.active { background:rgba(255,255,255,.1); color:#fff; }
.tab-btn:hover:not(.active) { color:rgba(255,255,255,.8); }

/* ===== Split modal ===== */
.split-modal {
  position:fixed; inset:0;
  background:rgba(5,5,15,.8);
  display:flex; align-items:center; justify-content:center;
  z-index:200; padding:20px;
}
.split-modal.hidden { display:none; }
.split-modal-box {
  background:#1a1a2e; border:1px solid rgba(255,255,255,.1);
  border-radius:14px; padding:24px; width:100%; max-width:520px;
  display:flex; flex-direction:column; gap:16px;
}
.split-modal-header {
  display:flex; align-items:center; justify-content:space-between;
  font-size:14px; font-weight:700; color:#fff;
}
.split-cancel-btn {
  background:none; border:none; color:rgba(255,255,255,.4);
  font-size:20px; cursor:pointer; line-height:1; padding:0 4px;
}
.split-cancel-btn:hover { color:#fff; }
.split-preview-img {
  width:100%; height:auto; max-height:160px;
  object-fit:contain; border-radius:6px;
  background:rgba(0,0,0,.3);
}
.split-modal-hint { font-size:12px; color:rgba(255,255,255,.45); }
.split-modal-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.split-choice-btn {
  background:rgba(255,255,255,.05); color:rgba(255,255,255,.8);
  border:1px solid rgba(255,255,255,.1); border-radius:8px;
  padding:12px 10px; font-size:12px; font-weight:600;
  cursor:pointer; font-family:'Poppins',sans-serif;
  display:flex; flex-direction:column; align-items:center; gap:4px;
  transition:all .15s;
}
.split-choice-btn:hover { background:rgba(102,126,234,.2); border-color:rgba(102,126,234,.4); color:#fff; }
.split-icon { font-size:18px; color:rgba(102,126,234,.8); }
.split-choice-btn small { font-size:9px; color:rgba(255,255,255,.35); font-weight:400; }
.split-both-btn { background:rgba(102,126,234,.1); border-color:rgba(102,126,234,.3); color:#c0c8ff; grid-column:1/-1; }
.split-both-btn:hover { background:rgba(102,126,234,.25); }
.split-full-btn { color:rgba(255,255,255,.4); grid-column:1/-1; font-size:11px; padding:8px; }

/* Queue info + apply-all row */
.split-queue-info {
  font-size:10px; color:#f0a050; font-weight:600;
  background:rgba(240,160,80,.15); padding:2px 8px; border-radius:20px;
  margin-left:auto; margin-right:8px;
}
.split-apply-all-row {
  display:flex; align-items:center; gap:6px; flex-wrap:wrap;
  padding:10px 12px; background:rgba(240,160,80,.07);
  border:1px solid rgba(240,160,80,.2); border-radius:8px;
}
.applyall-label { font-size:11px; color:rgba(240,160,80,.8); font-weight:600; margin-right:2px; }
.applyall-btn {
  background:rgba(255,255,255,.06); color:rgba(255,255,255,.7);
  border:1px solid rgba(255,255,255,.1); border-radius:6px;
  padding:4px 12px; font-size:11px; font-weight:600;
  cursor:pointer; font-family:'Poppins',sans-serif;
  transition:all .15s;
}
.applyall-btn:hover { background:rgba(240,160,80,.2); border-color:rgba(240,160,80,.4); color:#fff; }
.applyall-both { background:rgba(102,126,234,.1); border-color:rgba(102,126,234,.25); color:#a0aeff; }
.applyall-both:hover { background:rgba(102,126,234,.25); }
.applyall-skip { color:rgba(255,255,255,.3); font-weight:400; }

/* ===== Export overlay ===== */
.export-overlay {
  position:fixed; inset:0;
  background:rgba(10,10,20,.75);
  display:flex; align-items:center; justify-content:center;
  z-index:100;
  font-size:16px; font-weight:600; color:#fff;
  gap:12px;
}
.export-overlay.hidden { display:none; }

/* ===== Responsive ===== */
@media (max-width:600px) {
  .print-header { padding:10px 14px; }
  .print-toolbar { padding:6px 14px; }
  .print-sheet-outer { padding:12px 14px 20px; }
}
