:root {
  --night: #17123a;
  --night-2: #241c56;
  --night-3: #33297a;
  --line: #4a3fa0;
  --ink: #f5f2ff;
  --muted: #b9b2e6;
  --gold: #ffc93c;
  --gold-deep: #e8930c;
  --pink: #ff5c8a;
  --green: #3ddc97;
  --danger: #ff7a7a;
  --paper: #fff9ec;
  --paper-ink: #2a2140;
  --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font: 600 16px/1.45 var(--body);
  background:
    radial-gradient(circle at 15% -5%, #4b2f9e 0, transparent 38%),
    radial-gradient(circle at 100% 30%, #7a2a7e55 0, transparent 34%),
    var(--night);
  background-attachment: fixed;
}
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px calc(104px + env(safe-area-inset-bottom));
  outline: none;
}
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.12; margin: 0; letter-spacing: .01em; }
h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); }
h2 { font-size: 1.35rem; }
p { margin: 0; }
a { color: inherit; }
.muted { color: var(--muted); }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.page-head { display: grid; gap: 6px; margin-bottom: 20px; }
.back { color: var(--muted); text-decoration: none; font-weight: 800; }

/* Navigation */
#tabs {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(520px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: #1d1648f2;
  box-shadow: 0 10px 30px #0008;
}
#tabs a {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 6px 2px;
  border-radius: 16px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-decoration: none;
}
#tabs a span { font-size: 1.35rem; line-height: 1.2; }
#tabs a.active { color: var(--night); background: var(--gold); }
body.no-tabs #tabs { display: none; }

/* Boutons et formulaires */
button, .button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 18px;
  border: 2px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--night-3);
  font: 800 1rem var(--body);
  text-decoration: none;
  cursor: pointer;
}
button.primary, .button.primary {
  color: #2b1a00;
  border-color: var(--gold-deep);
  background: linear-gradient(180deg, #ffe07a, var(--gold));
  box-shadow: 0 4px 0 var(--gold-deep);
}
button.primary:active, .button.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-deep); }
button.danger { color: var(--danger); border-color: #8a3a55; background: transparent; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: var(--night-2);
}
label { display: grid; gap: 5px; font-weight: 800; }
label small, .hint { color: var(--muted); font-weight: 600; font-size: .86rem; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--night);
  font: 600 1rem var(--body);
}
textarea { min-height: 76px; resize: vertical; }
.choice-group { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border: 0; margin: 0; padding: 0; }
.choice-group legend { padding: 0; margin-bottom: 8px; font-weight: 800; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; }
.choice input { width: 20px; min-height: 20px; margin: 2px 0 0; accent-color: var(--gold); }
.choice:has(input:checked) { border-color: var(--gold); background: #ffc93c1a; }
.choice span { display: grid; gap: 2px; }
.notice { padding: 12px 14px; border-radius: 14px; border: 2px solid #8a7a2a; background: #ffc93c14; }
.error { padding: 12px 14px; border-radius: 14px; border: 2px solid #8a3a55; background: #ff5c8a1c; color: #ffd0da; }

/* Collection */
.series-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }
.series-tile {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(150deg, var(--night-3), var(--night-2));
  color: inherit;
  text-decoration: none;
}
.series-tile:hover { border-color: var(--gold); }
.series-tile header { display: flex; gap: 12px; align-items: center; }
.series-emoji { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; font-size: 1.9rem; background: #ffffff14; }
.series-tile.done { border-color: var(--gold); box-shadow: 0 0 22px #ffc93c44; }
.progress { height: 12px; overflow: hidden; border-radius: 99px; background: #0005; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); transition: width .4s; }
.empty { display: grid; gap: 14px; justify-items: center; padding: 34px 18px; text-align: center; border: 2px dashed var(--line); border-radius: 22px; }
.empty .big { font-size: 3.4rem; line-height: 1; }

/* Grille de cartes */
.card-grid {
  --cw: clamp(150px, 44vw, 214px);
  display: grid;
  gap: 16px 12px;
  grid-template-columns: repeat(auto-fill, var(--cw));
  justify-content: center;
}
.card-slot { position: relative; width: var(--cw); }
.card-slot > button.open {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 5%;
}

/* La carte : toutes les tailles internes sont en em, donc elle s'adapte à --cw */
.tcg {
  --kind: #3f7be0;
  --kind-deep: #1f4aa8;
  --kind-soft: #dbe8ff;
  position: relative;
  width: var(--cw, 240px);
  aspect-ratio: 63 / 88;
  overflow: hidden;
  border-radius: .95em;
  font-family: var(--body);
  font-size: calc(var(--cw, 240px) / 15);
  line-height: 1.22;
  text-align: left;
  color: var(--paper-ink);
  background: linear-gradient(160deg, var(--kind), var(--kind-deep));
  padding: .48em;
  box-shadow: 0 .3em .9em #0007;
}
.kind-heros { --kind: #ef5b3a; --kind-deep: #a82416; --kind-soft: #ffe0d3; }
.kind-lieu { --kind: #33ad6b; --kind-deep: #146a3f; --kind-soft: #d8f6e3; }
.kind-epoque { --kind: #e9a521; --kind-deep: #a4630a; --kind-soft: #fff0c9; }
.kind-notion { --kind: #3f7be0; --kind-deep: #1f4aa8; --kind-soft: #dbe8ff; }
.kind-regle { --kind: #9458e6; --kind-deep: #5b25a8; --kind-soft: #ecdfff; }
.kind-lien { --kind: #17adb8; --kind-deep: #0b6a78; --kind-soft: #d3f5f6; }

.tcg-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: .55em;
  background: var(--paper);
}
.tcg-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3em;
  padding: .32em .5em;
  background: var(--kind-soft);
}
.tcg-name { font-family: var(--display); font-size: 1em; line-height: 1.05; overflow-wrap: anywhere; }
.tcg-xp { flex: none; font-family: var(--display); font-size: .82em; color: var(--kind-deep); white-space: nowrap; }
.tcg-art {
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  height: 31%;
  margin: 0 .36em;
  overflow: hidden;
  border: .1em solid var(--kind-deep);
  border-radius: .3em;
  background:
    repeating-conic-gradient(from 0deg at 50% 60%, #ffffff30 0 12deg, transparent 12deg 24deg),
    radial-gradient(circle at 50% 60%, #fff8 0, var(--kind) 72%);
}
.tcg-art span { font-size: 2.9em; line-height: 1; filter: drop-shadow(0 .06em .1em #0006); }
.tcg-type {
  flex: none;
  align-self: flex-start;
  margin: .3em .36em 0;
  padding: .06em .5em;
  border-radius: .3em;
  color: #fff;
  background: var(--kind-deep);
  font-size: .58em;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.tcg-body {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  padding: .3em .5em;
  font-size: calc(.88em * var(--fit, 1));
  font-weight: 800;
}
.tcg-move { display: block; margin-bottom: .1em; color: var(--kind-deep); font-family: var(--display); font-size: 1.04em; font-weight: 400; }
.tcg-section + .tcg-section { margin-top: .4em; padding-top: .35em; border-top: .08em dashed #2a214033; }
.tcg-section b { display: block; color: var(--kind-deep); font-family: var(--display); font-weight: 400; }
.tcg-section p { font-weight: 700; }
.tcg-answer p { font-weight: 900; }
.tcg-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4em;
  padding: .24em .5em;
  color: #5d5273;
  background: #2a21400d;
  font-size: .52em;
  font-weight: 800;
}
.tcg-foot span:first-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tcg-foot span:last-child { flex: none; }
.tcg.rarity-3 { background: linear-gradient(135deg, #f7f7ff, var(--kind) 28%, #fff 50%, var(--kind) 72%, #dfe3ff); }

.star-toggle {
  position: absolute;
  z-index: 3;
  top: 27%;
  right: 7%;
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--night-2);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
}
.star-toggle[aria-pressed="true"] { color: #5a3a00; border-color: var(--gold-deep); background: var(--gold); }

/* Retournement */
.flip { position: relative; width: var(--cw); aspect-ratio: 63 / 88; perspective: 1400px; }
.flip-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, 1.4, .5, 1); }
.flip.flipped .flip-inner { transform: rotateY(180deg); }
.flip .tcg { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .tcg.is-back { transform: rotateY(180deg); }
.flip-button { display: block; width: 100%; min-height: 0; padding: 0; border: 0; background: none; border-radius: 5%; }

/* Carte secrète */
.tcg-secret {
  --mx: 50%;
  --my: 50%;
  --rx: 0deg;
  --ry: 0deg;
  padding: .3em;
  color: #fff;
  background: conic-gradient(from 210deg, #ffe07a, #ff9a3c, #ff5c8a, #9458e6, #3f7be0, #3ddc97, #ffe07a);
  box-shadow: 0 0 1.6em #ffc93c88, 0 .4em 1em #0009;
}
.secret-inner { position: relative; height: 100%; overflow: hidden; border-radius: .7em; background: #1a1240; }
.secret-art { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #7a54d8, #1a1240 72%); }
.secret-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.secret-art .fallback { font-size: 6em; line-height: 1; }
.secret-art.loading { animation: pulse 1.2s ease-in-out infinite alternate; }
.holo, .holo-glare { position: absolute; inset: 0; pointer-events: none; }
.holo {
  inset: -60%;
  mix-blend-mode: color-dodge;
  opacity: .75;
  background:
    repeating-linear-gradient(115deg, #ff5c8a55 0, #ffc93c55 1.6em, #3ddc9755 3.2em, #3f7be055 4.8em, #9458e655 6.4em, #ff5c8a55 8em);
  translate: calc((var(--mx) - 50%) * .3) calc((var(--my) - 50%) * .3);
  animation: shimmer 5s ease-in-out infinite alternate;
}
.holo-glare {
  mix-blend-mode: soft-light;
  background:
    radial-gradient(circle at var(--mx) var(--my), #ffffffcc 0, transparent 46%),
    radial-gradient(circle at 18% 22%, #fff 0 .09em, transparent .1em),
    radial-gradient(circle at 78% 14%, #fff 0 .07em, transparent .08em),
    radial-gradient(circle at 64% 42%, #fff 0 .06em, transparent .07em),
    radial-gradient(circle at 28% 58%, #fff 0 .07em, transparent .08em);
}
.tilt { transform: perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .12s ease-out; }

/* Carte au premier plan : le doigt la fait bouger au lieu de faire défiler */
.card-tilt {
  will-change: transform;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.flip-button:has(.card-tilt) { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.card-tilt img { pointer-events: none; -webkit-user-drag: none; }
.card-tilt .tcg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: var(--shine, 0);
  mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), #ffffff 0, #ffffff66 22%, transparent 58%);
}
.card-tilt .tcg.rarity-2::before, .card-tilt .tcg.rarity-3::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: color-dodge;
  background-image: repeating-linear-gradient(115deg, #ff5c8a 0, #ffc93c 6%, #3ddc97 12%, #3f7be0 18%, #9458e6 24%, #ff5c8a 30%);
  background-size: 300% 300%;
  background-position: var(--mx, 50%) var(--my, 50%);
}
.card-tilt .tcg.rarity-2::before { opacity: calc(var(--shine, 0) * .12); }
.card-tilt .tcg.rarity-3::before { opacity: calc(var(--shine, 0) * .32); }
.secret-badge {
  position: absolute;
  z-index: 2;
  top: .4em;
  left: .4em;
  padding: .12em .55em;
  border-radius: .6em;
  color: #3a2400;
  background: linear-gradient(90deg, #ffe07a, var(--gold));
  font: 400 .62em var(--display);
  letter-spacing: .05em;
}
.secret-caption {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2em .6em .4em;
  background: linear-gradient(0deg, #0d0828f2 40%, transparent);
}
.secret-name { font: 400 1.32em/1.04 var(--display); text-shadow: 0 .06em .2em #000; }
.secret-title { color: var(--gold); font-size: .7em; font-weight: 900; }
.secret-credit { margin-top: .3em; color: #d9d4ef; font-size: .4em; font-weight: 600; line-height: 1.15; }
.secret-back {
  height: 100%;
  overflow: hidden;
  padding: .7em;
  border-radius: .7em;
  background: radial-gradient(circle at 50% 0, #4b2f9e, #17123a 75%);
  font-size: calc(.76em * var(--fit, 1));
}
.secret-back h3 { color: var(--gold); margin-bottom: .1em; }
.secret-back b { display: block; margin-top: .5em; color: var(--gold); font: 400 1em var(--display); }
.tcg-locked {
  display: grid;
  place-items: center;
  padding: .3em;
  color: var(--muted);
  text-align: center;
  background: repeating-linear-gradient(45deg, #2b2360 0 .4em, #241c56 .4em .8em);
  border: .12em dashed var(--gold-deep);
  box-shadow: none;
}
.tcg-locked .lock { font-size: 3em; line-height: 1.2; }
.tcg-locked b { display: block; color: var(--gold); font: 400 1.15em var(--display); }
.tcg-locked small { font-size: .68em; font-weight: 800; }

@keyframes shimmer { from { transform: translateX(-12%); } to { transform: translateX(12%); } }
@keyframes pulse { from { opacity: .55; } to { opacity: 1; } }

/* Fenêtre de détail */
.modal {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
  background: #0c0826f5;
}
/* La page reste figée derrière : sa position est gardée dans le « top » posé par app.js. */
html.scroll-locked { overflow-y: scroll; }
html.scroll-locked body { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
.modal-top { display: flex; align-items: center; justify-content: space-between; width: min(100%, 520px); }
.modal-card { --cw: min(calc(100vw - 32px), 340px, calc((100dvh - 250px) * 63 / 88)); }
.flip-hint { color: var(--muted); font-size: .86rem; text-align: center; }
.modal-actions { display: grid; gap: 10px; width: min(100%, 420px); }
.star-big { width: 100%; font-size: 1.05rem; }
.star-big[aria-pressed="true"] { color: #2b1a00; border-color: var(--gold-deep); background: var(--gold); }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.pager span { color: var(--muted); font-weight: 800; }
.form-modal { display: grid; gap: 12px; width: min(100%, 520px); }

/* Ouverture du booster */
.reveal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px 16px;
  text-align: center;
  background: radial-gradient(circle at 50% 45%, #5a2fb4, #0b0722 68%);
}
.reveal h2 { color: var(--gold); font-size: clamp(1.5rem, 6vw, 2.3rem); }
.booster {
  display: grid;
  place-items: center;
  width: min(62vw, 230px);
  min-height: 0;
  aspect-ratio: 63 / 92;
  border: 3px solid #fff5;
  border-radius: 12px;
  color: #2b1a00;
  background: linear-gradient(135deg, #ffe07a, #ff5c8a 45%, #9458e6 75%, #3f7be0);
  box-shadow: 0 0 44px #ffc93c88;
  font: 400 1.5rem/1.1 var(--display);
  animation: wobble .9s ease-in-out infinite;
}
.booster span { font-size: 3.4rem; display: block; }
.booster.opening { animation: burst .55s ease-in forwards; }
.reveal-card { --cw: min(calc(100vw - 40px), 320px, calc((100dvh - 190px) * 63 / 88)); animation: arrive .9s cubic-bezier(.2, 1.3, .4, 1) both; }
.confetti { position: fixed; top: -20px; z-index: 61; width: 10px; height: 16px; border-radius: 2px; pointer-events: none; animation: fall linear forwards; }
@keyframes wobble { 0%, 100% { transform: rotate(-3deg) scale(1); } 50% { transform: rotate(3deg) scale(1.04); } }
@keyframes burst { to { transform: scale(1.8); opacity: 0; filter: brightness(3); } }
@keyframes arrive { from { transform: rotateY(540deg) scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* Scanner */
.thumbs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.thumbs:empty { display: none; }
.thumb { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border: 2px solid var(--line); border-radius: 12px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { width: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: #000c; }
.thumb-remove { position: absolute; top: 4px; right: 4px; }
.thumb-move { position: absolute; left: 4px; right: 4px; bottom: 4px; display: flex; justify-content: space-between; }
.page-no {
  position: absolute;
  top: 4px;
  left: 4px;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 15px;
  color: #2b1a00;
  background: var(--gold);
  font: 400 1rem var(--display);
}
.lessons-panel { margin-bottom: 20px; }
.lesson-row { gap: 8px; }
.drop { display: grid; gap: 6px; justify-items: center; padding: 26px 14px; border: 3px dashed var(--gold); border-radius: 18px; background: #ffc93c10; text-align: center; font-weight: 800; cursor: pointer; }
.drop .big { font-size: 2.8rem; line-height: 1; }
.drop input { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; }
.drop:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.forge { display: grid; gap: 14px; justify-items: center; padding: 40px 12px; text-align: center; }
.forge .big { font-size: 4rem; line-height: 1; animation: wobble 1s ease-in-out infinite; }

/* Decks */
.picker-group { display: grid; gap: 10px; }
.picker-card { position: relative; width: var(--cw); min-height: 0; padding: 0; border: 0; background: none; border-radius: 5%; }
.picker-card[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #06301f;
  background: var(--green);
  font-weight: 900;
}
.picker-card[aria-pressed="false"] .tcg { filter: saturate(.55) brightness(.72); }
.sticky-bar {
  position: sticky;
  z-index: 10;
  bottom: calc(88px + env(safe-area-inset-bottom));
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #1d1648f2;
}

/* Impression */
#toast {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 96px;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: 12px;
  color: #2b1a00;
  background: var(--gold);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.print-sheets { display: grid; gap: 18px; justify-items: center; }
.sheet {
  display: grid;
  grid-template-columns: repeat(3, 63mm);
  grid-auto-rows: 88mm;
  justify-content: center;
  align-content: center;
  width: 210mm;
  max-width: 100%;
  min-height: 277mm;
  padding: 8mm 0;
  color: var(--paper-ink);
  background: #fff;
  overflow-x: auto;
}
.sheet > .print-cell { position: relative; width: 63mm; height: 88mm; outline: .2mm dashed #9992; outline-offset: -.1mm; }
.sheet .tcg { --cw: 63mm; box-shadow: none; }
.sheet-label { width: 100%; max-width: 210mm; color: var(--muted); font-weight: 800; }
.print-back {
  display: grid;
  place-items: center;
  width: 63mm;
  height: 88mm;
  border-radius: 4mm;
  color: #fff;
  background: repeating-linear-gradient(45deg, #33297a 0 3mm, #241c56 3mm 6mm);
  font: 400 20pt var(--display);
}
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  html, body { background: #fff !important; }
  body * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  #tabs, #toast, #modal-root, .no-print, .sheet-label { display: none !important; }
  main { max-width: none; padding: 0; }
  .print-sheets { display: block; }
  .sheet { width: auto; min-height: 0; padding: 0; overflow: visible; break-after: page; }
  .sheet:last-child { break-after: auto; }
  .sheet > .print-cell { break-inside: avoid; outline-color: #bbb; }
  .holo { display: none; }
  .holo-glare { mix-blend-mode: normal; opacity: .25; animation: none; }
  .tcg { filter: none !important; }
}

@media (min-width: 760px) {
  .card-grid { --cw: 214px; gap: 22px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Connexion */
.auth { display: grid; gap: 14px; justify-items: center; max-width: 440px; margin: 0 auto; padding-top: 12px; text-align: center; }
.auth > .panel, .auth > [data-install] { width: 100%; text-align: left; }
.auth-logo { border-radius: 22px; box-shadow: 0 10px 30px #0008; }
.auth-brand { font: 400 2.6rem/1 var(--display); letter-spacing: .01em; color: var(--gold); }
.auth-links { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; }
button.link-button {
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-weight: 800;
  text-decoration: underline;
}

/* Administration */
.code-box {
  padding: 12px;
  border-radius: 12px;
  background: var(--night);
  color: var(--gold);
  font: 800 1.5rem/1.2 ui-monospace, Consolas, monospace;
  letter-spacing: .08em;
  text-align: center;
  user-select: all;
  overflow-wrap: anywhere;
}
.account-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
.account-row > span:first-child { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.notice a.button { text-align: center; justify-content: center; }
