:root {
  color-scheme: dark;
  --bg: #0d1320;
  --bg2: #141c2c;
  --panel: rgba(25, 34, 52, 0.78);
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2f8;
  --muted: #8b98ad;
  --gold: #f5b83d;
  --teal: #2ec4b6;
  --coral: #ff6b6b;
  --cream: #f7e7c6;
  --radius: 18px;
  --font: "Bricolage Grotesque", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 50% -10%, #23314d 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, #1d2a1f 0%, transparent 60%),
    var(--bg);
  overflow-x: hidden;
}
.bg-stars {
  position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .5;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 70%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 70% 30%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 80%, #fff5 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 50%, #fff4 50%, transparent 51%);
  background-size: 400px 400px;
}

button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--coral); }
.empty { color: var(--muted); font-style: italic; list-style: none; }
h1, h2 { margin: 0; }
h2 { font-size: 1.05rem; letter-spacing: .02em; text-transform: uppercase; color: var(--cream); }

/* ---------- Boutons & champs ---------- */
.btn {
  border: 0; border-radius: 12px; padding: .65rem 1.1rem; cursor: pointer;
  font-weight: 600; transition: transform .12s, background .2s, opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(180deg, #ffcd5c, var(--gold));
  color: #2a1a00; box-shadow: 0 6px 0 #b9821a, 0 10px 24px rgba(245, 184, 61, .3);
}
.btn.primary:active { box-shadow: 0 2px 0 #b9821a; transform: translateY(4px); }
.btn.ghost { background: rgba(255, 255, 255, .07); }
.btn.ghost:hover { background: rgba(255, 255, 255, .13); }
.btn.small { padding: .4rem .7rem; font-size: .88rem; border-radius: 10px; }
.btn.big { padding: 1rem 1.6rem; font-size: 1.2rem; font-weight: 800; }
.btn.danger:hover { background: rgba(255, 107, 107, .25); }

input, select, textarea {
  width: 100%; background: rgba(0, 0, 0, .25); border: 1px solid var(--line);
  border-radius: 12px; padding: .65rem .8rem; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
select option { background: var(--bg2); }
textarea { resize: vertical; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem; backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, .25);
}
.panel > h2, .panel-head { margin-bottom: .8rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

/* ---------- Accueil ---------- */
#home { max-width: 1000px; margin: 0 auto; padding: 3rem 1rem; }
.hero { text-align: center; margin-bottom: 2.5rem; }
.hero-moose { font-size: 5rem; animation: bob 3s ease-in-out infinite; }
.hero h1 { font-size: clamp(2.8rem, 8vw, 5rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.hero h1 span { color: var(--gold); }
.tagline { color: var(--muted); font-size: 1.1rem; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-4deg); } }

.home-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 760px) { .home-grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1rem; }
.field > span { font-weight: 600; font-size: .92rem; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: .6rem; }
.field.inline input { width: 5rem; text-align: center; }
.add-row { display: flex; gap: .5rem; }
.add-row input { flex: 1; }
#new-form .btn.big { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .3rem 0 0; list-style: none; }
.chip {
  background: rgba(46, 196, 182, .18); border: 1px solid rgba(46, 196, 182, .4);
  border-radius: 999px; padding: .25rem .4rem .25rem .8rem; display: flex; align-items: center; gap: .3rem;
  animation: pop .2s ease-out;
}
.chip button { background: none; border: 0; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--muted); }
.chip button:hover { color: var(--coral); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

.session-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.session-list li { display: flex; gap: .4rem; }
.session {
  flex: 1; text-align: left; background: rgba(255, 255, 255, .05); border: 1px solid var(--line);
  border-radius: 12px; padding: .7rem .9rem; cursor: pointer; display: flex; flex-direction: column; gap: .15rem;
  transition: background .2s, border-color .2s;
}
.session:hover { background: rgba(245, 184, 61, .1); border-color: rgba(245, 184, 61, .4); }
.session .muted { font-size: .85rem; }

/* ---------- Jeu ---------- */
#game { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); background: rgba(13, 19, 32, .6);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5;
}
.topbar-title { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.save-status { font-size: .8rem; color: var(--muted); margin-right: .4rem; }
.save-status::before { content: "● "; color: var(--teal); }
.save-status.error::before { color: var(--coral); }

.game-grid {
  flex: 1; display: grid; grid-template-columns: minmax(260px, 320px) 1fr minmax(260px, 320px);
  gap: 1.2rem; padding: 1.2rem; align-items: start;
}
.side { display: flex; flex-direction: column; gap: 1.2rem; }
@media (max-width: 1100px) {
  .game-grid { grid-template-columns: 1fr 1fr; }
  .center { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 680px) {
  .game-grid { grid-template-columns: 1fr; padding: 1rem; }
  .topbar { flex-wrap: wrap; }
}

.center { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.turn-banner { font-size: 1.4rem; text-align: center; }
.turn-banner strong { color: var(--gold); }

.wheel-wrap { position: relative; width: min(78vh, 100%, 640px); aspect-ratio: 1; }
.wheel-wrap canvas {
  width: 100%; height: 100%; border-radius: 50%;
  filter: drop-shadow(0 25px 50px rgba(0, 0, 0, .5));
}
.pointer {
  position: absolute; left: 50%; top: -8px; z-index: 2; width: 44px; height: 56px;
  transform: translateX(-50%); transform-origin: 50% 20%;
  background: linear-gradient(180deg, #fff, var(--cream));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5));
}
.pointer.flick { animation: flick .12s ease-out; }
@keyframes flick { 40% { transform: translateX(-50%) rotate(-18deg); } }
.hub {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 22%; aspect-ratio: 1; border-radius: 50%; border: 6px solid var(--cream);
  background: radial-gradient(circle at 35% 30%, #34445f, #141c2c);
  font-size: clamp(2rem, 6vw, 3.6rem); cursor: pointer; transition: transform .2s;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .5), inset 0 2px 6px rgba(255, 255, 255, .15);
}
.hub:hover { transform: translate(-50%, -50%) scale(1.06); }
.wheel-wrap.spinning .hub { animation: wobble .5s ease-in-out infinite; cursor: default; }
@keyframes wobble { 50% { transform: translate(-50%, -50%) rotate(-10deg) scale(1.04); } }

.spin-btn { min-width: 260px; }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; font-size: .9rem; }
.legend span { display: flex; align-items: center; gap: .35rem; }
.legend i { width: .8rem; height: .8rem; border-radius: 4px; display: inline-block; }

/* Joueurs */
.players { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-direction: column; gap: .5rem; }
.player {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: .2rem .5rem; align-items: center;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 14px; padding: .6rem .7rem;
  transition: border-color .2s, background .2s;
}
.player.turn { border-color: var(--gold); background: rgba(245, 184, 61, .1); }
.player.turn .player-name::before { content: "▶ "; color: var(--gold); }
.player.out { opacity: .45; }
.player.out .player-name { text-decoration: line-through; }
.player.bump { animation: bump .45s ease-out; }
@keyframes bump { 30% { transform: scale(1.04); background: rgba(255, 107, 107, .25); } }
.player-name { background: none; border: 0; padding: 0; text-align: left; font-weight: 700; font-size: 1.05rem; cursor: pointer; }
.player-badges { grid-column: 1; display: flex; flex-wrap: wrap; gap: .25rem; }
.player-badges:empty { display: none; }
.badge { font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; background: rgba(245, 184, 61, .2); color: var(--gold); font-weight: 600; }
.badge.out { background: rgba(255, 107, 107, .2); color: var(--coral); }
.pen { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: .3rem; margin-right: 1rem; }
.pen-btn {
  width: 30px; height: 30px; border-radius: 9px; border: 0; cursor: pointer; font-weight: 800; font-size: 1.1rem;
  background: rgba(255, 255, 255, .08);
}
.pen-btn.plus { background: rgba(255, 107, 107, .25); color: #ffd0d0; }
.pen-btn:hover { filter: brightness(1.3); }
.pen-count { min-width: 1.6rem; text-align: center; font-weight: 800; font-size: 1.2rem; }
.pen-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.pen-bar div { height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold), var(--coral)); transition: width .3s; }
.remove {
  position: absolute; top: 4px; right: 6px; background: none; border: 0; cursor: pointer;
  color: var(--muted); opacity: 0; transition: opacity .2s;
}
.player:hover .remove { opacity: 1; }
.remove:hover { color: var(--coral); }

/* Règles / masters / historique */
.rules, .masters, .history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.rules li:not(.empty) {
  padding: .55rem .75rem; border-radius: 10px; background: rgba(46, 196, 182, .12);
  border-left: 3px solid var(--teal);
}
.masters li:not(.empty) { display: grid; grid-template-columns: 1fr 1fr auto; gap: .4rem; align-items: center; }
.master-name { font-weight: 700; font-size: .92rem; }
.masters select { padding: .35rem .5rem; font-size: .88rem; }
.history { max-height: 300px; overflow-y: auto; font-size: .92rem; }
.history li { display: flex; align-items: center; gap: .4rem; }
.dot { width: .7rem; height: .7rem; border-radius: 50%; flex: none; }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1.5rem; padding: 1rem;
  background: rgba(5, 8, 14, .72); backdrop-filter: blur(6px);
  animation: fade .2s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem;
  display: flex; flex-direction: column; gap: .8rem; box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
}

/* Carte tirée */
/* Carte au ratio 5/7, dimensionnée par la hauteur de l'écran (place laissée aux boutons dessous).
   Le conteneur porte la taille : les unités cqw de la carte suivent sa largeur. */
.card-flip {
  perspective: 1200px; container-type: inline-size;
  width: min(90vw, calc((100dvh - 6.5rem) * 5 / 7));
}
.card-flip.in .card { animation: flipIn .7s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes flipIn {
  from { transform: rotateY(180deg) scale(.4); opacity: 0; }
  60% { opacity: 1; }
}
.card {
  width: 100%; aspect-ratio: 5 / 7;
  border-radius: 5cqw; padding: 5cqw 6cqw 4.5cqw;
  background: linear-gradient(160deg, var(--c1), var(--c2)); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3cqw;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 0 0 8px rgba(255, 255, 255, .25);
  position: relative; overflow: hidden;
}
.card::after {
  content: "🫎"; position: absolute; font-size: 55cqw; opacity: .12; bottom: -8cqw; right: -8cqw; transform: rotate(-15deg);
}
.card-type {
  font-size: 3.8cqw; font-weight: 800; letter-spacing: .15em; text-transform: uppercase;
  padding: .3em .9em; border-radius: 999px; background: rgba(0, 0, 0, .15);
}
.card-name { font-size: 12cqw; font-weight: 800; line-height: 1.02; }
.card-text {
  font-size: 5.6cqw; line-height: 1.3; font-weight: 600; z-index: 1;
  flex: 1; min-height: 0; display: flex; align-items: center; overflow-y: auto;
}
.card-for { font-size: 5cqw; padding-top: 3cqw; border-top: 2px dashed rgba(0, 0, 0, .2); width: 100%; z-index: 1; }

#reveal { gap: .8rem; padding: .6rem; }
.reveal-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem; max-width: 700px; }
.reveal-actions .given { background: rgba(255, 107, 107, .35); }
.reveal-actions .btn.primary { margin-left: .5rem; }

/* Cartes */
.card-form { display: grid; grid-template-columns: 1fr 150px; gap: .5rem; }
.card-form textarea, .card-form .btn { grid-column: 1 / -1; }
.card-tools { display: flex; justify-content: space-between; align-items: center; }
.card-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.card-list li {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: .5rem; align-items: center;
  padding: .5rem .6rem; border-radius: 10px; background: rgba(255, 255, 255, .04);
}
.card-list li.drawn { opacity: .5; }
.card-list p { margin: .2rem 0 0; font-size: .85rem; color: var(--muted); }

/* Fin */
.end-modal { text-align: center; align-items: center; }
.end-moose { font-size: 4rem; animation: bob 2s ease-in-out infinite; }
.ranking { list-style: none; padding: 0; margin: 0; width: 100%; counter-reset: r; display: flex; flex-direction: column; gap: .4rem; }
.ranking li {
  counter-increment: r; display: flex; justify-content: space-between; padding: .6rem .9rem;
  border-radius: 10px; background: rgba(255, 255, 255, .05);
}
.ranking li span:first-child::before { content: counter(r) ". "; color: var(--muted); }
.ranking li:first-child { background: rgba(245, 184, 61, .2); font-weight: 800; }
.ranking li.out { opacity: .5; }
.end-actions { display: flex; gap: .6rem; }

/* Toast & confettis */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 40; transform: translate(-50%, calc(100% + 2rem));
  background: var(--cream); color: #2a1a00; padding: .7rem 1.2rem; border-radius: 12px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: transform .3s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.show { transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
#confetti i {
  position: absolute; top: 95%; width: 10px; height: 14px; border-radius: 2px;
  animation: confetti 1.6s cubic-bezier(.15, .6, .4, 1) forwards;
}
@keyframes confetti {
  40% { transform: translate(calc(var(--dx) * .6), var(--dy)) rotate(calc(var(--r) * .5)); }
  to { transform: translate(var(--dx), calc(var(--dy) + 900px)) rotate(var(--r)); opacity: 0; }
}

/* Explosion de la Bombe */
#boom { position: fixed; inset: 0; pointer-events: none; z-index: 31; overflow: hidden; }
.boom-flash {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, #fff 0%, #ffd166 25%, rgba(255, 107, 53, .6) 50%, transparent 75%);
  animation: boomFlash .6s ease-out forwards;
}
@keyframes boomFlash { 0% { opacity: 1; } 100% { opacity: 0; } }
.boom-ring {
  position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  border: 14px solid #ffd166; box-shadow: 0 0 40px #ff9f1c, inset 0 0 30px #ff6b35;
  animation: boomRing .7s cubic-bezier(.1, .7, .3, 1) forwards;
}
.boom-ring.late { border-color: #ff6b35; animation-delay: .08s; animation-duration: .9s; opacity: 0; }
@keyframes boomRing {
  0% { transform: scale(.2); opacity: 1; border-width: 30px; }
  100% { transform: scale(40); opacity: 0; border-width: 1px; }
}
.boom-word {
  position: absolute; left: 50%; top: 50%; font-size: min(40vw, 40vh); line-height: 1;
  transform: translate(-50%, -50%) scale(0); filter: drop-shadow(0 0 40px #ff9f1c);
  animation: boomWord .75s cubic-bezier(.2, 1.6, .4, 1) forwards;
}
@keyframes boomWord {
  0% { transform: translate(-50%, -50%) scale(0) rotate(-20deg); opacity: 1; }
  45% { transform: translate(-50%, -50%) scale(1.15) rotate(6deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.6) rotate(0); opacity: 0; }
}
#boom i {
  position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border-radius: 50%;
}
#boom i.spark { box-shadow: 0 0 10px currentColor; animation: spark .9s cubic-bezier(.1, .8, .3, 1) forwards; }
#boom i.smoke {
  background: radial-gradient(circle, rgba(90, 90, 100, .45), rgba(60, 60, 70, 0) 70%);
  animation: smoke 1s ease-out forwards;
}
@keyframes spark {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), calc(var(--dy) + 60px)) scale(.2); opacity: 0; }
}
@keyframes smoke {
  0% { transform: translate(0, 0) scale(.3); opacity: .8; }
  60% { opacity: .25; }
  100% { transform: translate(var(--dx), calc(var(--dy) - 80px)) scale(2.2); opacity: 0; }
}
#game.shake { animation: shake .6s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translate(-3px, 2px); }
  20%, 80% { transform: translate(6px, -4px); }
  30%, 50%, 70% { transform: translate(-12px, 6px) rotate(-.6deg); }
  40%, 60% { transform: translate(12px, -6px) rotate(.6deg); }
}
/* La carte Bombe surgit après le souffle */
.card-flip.boom .card { animation: boomIn .6s cubic-bezier(.2, 1.6, .4, 1) .28s both; }
@keyframes boomIn {
  0% { transform: scale(.1) rotate(-25deg); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; }
}

/* ---------- Decks ---------- */
.home-side { display: flex; flex-direction: column; gap: 1.2rem; }
.card-tools-btns { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }

.title-input {
  background: transparent; border: 1px solid transparent; font-size: 1.15rem; font-weight: 700;
  padding: .3rem .5rem; width: min(360px, 50vw);
}
.title-input:hover:not(:disabled) { border-color: var(--line); }
.title-input:disabled { opacity: 1; }

.deck-body { width: min(1200px, 100%); margin: 0 auto; padding: 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.readonly-note {
  margin: 0; padding: .8rem 1rem; border-radius: 12px; display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  background: rgba(245, 184, 61, .12); border: 1px solid rgba(245, 184, 61, .35);
}
.readonly-note code { background: rgba(0, 0, 0, .3); padding: .1rem .35rem; border-radius: 6px; }

.deck-toolbar { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.deck-toolbar input[type="search"] { width: 220px; }
.deck-toolbar .muted { margin-left: auto; font-size: .9rem; }
.type-filter { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-btn {
  display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); cursor: pointer;
  background: rgba(255, 255, 255, .05); border-radius: 999px; padding: .35rem .8rem; font-size: .88rem; font-weight: 600;
}
.chip-btn i { width: .65rem; height: .65rem; border-radius: 50%; background: var(--c1); }
.chip-btn.on { background: rgba(245, 184, 61, .2); border-color: var(--gold); }

.deck-add { display: grid; grid-template-columns: 1fr 160px 80px; gap: .5rem; padding: 1rem; }
.deck-add textarea { grid-column: 1 / -1; }
.deck-add .btn { grid-column: 1 / -1; justify-self: end; }

.deck-cards {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .8rem;
}
.deck-cards > .empty { grid-column: 1 / -1; text-align: center; padding: 2rem; }
.deck-card {
  display: flex; flex-direction: column; gap: .5rem; padding: .8rem; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--c1);
  animation: pop .2s ease-out;
}
.deck-card-head { display: grid; grid-template-columns: 1fr auto; gap: .4rem; align-items: center; }
.deck-card-head input[data-f="name"] { grid-column: 1 / -1; }
.deck-card-head input[data-f="name"] { font-weight: 700; }
.deck-card input, .deck-card select, .deck-card textarea { padding: .45rem .6rem; font-size: .92rem; }
.deck-card textarea { min-height: 4.2rem; resize: none; overflow: hidden; }
.deck-card :disabled { opacity: 1; cursor: default; }
.deck-count { display: flex; align-items: center; gap: .15rem; color: var(--muted); font-weight: 700; }
.deck-count input { width: 3.6rem; text-align: center; }
.deck-card-actions { display: flex; justify-content: flex-end; gap: .4rem; }

@media (max-width: 680px) {
  .deck-add { grid-template-columns: 1fr 1fr; }
  .deck-add input:first-child { grid-column: 1 / -1; }
  .deck-toolbar .muted { margin-left: 0; }
  .title-input { width: 100%; }
}

/* ---------- Spectateurs ---------- */
.watch-only { display: none; }
.spectator .watch-only { display: revert; }
.spectator .gm-only { display: none !important; }

.watch-badge {
  font-weight: 800; font-size: .9rem; padding: .35rem .8rem; border-radius: 999px;
  background: rgba(46, 196, 182, .18); border: 1px solid rgba(46, 196, 182, .45); color: var(--teal);
}
.count-pill {
  display: inline-block; min-width: 1.4em; padding: 0 .4em; margin-left: .25rem; border-radius: 999px;
  background: var(--teal); color: #00211e; font-size: .78rem; font-weight: 800; text-align: center;
}
.count-pill.hidden { display: none; }

/* Le spectateur voit tout mais ne touche à rien. */
.spectator #btn-spin,
.spectator #reveal-actions,
.spectator .pen-btn,
.spectator .remove,
.spectator #add-player,
.spectator #add-player-btn,
.spectator #btn-edit-rules,
.spectator [data-unmaster] { display: none !important; }
.spectator .side, .spectator .hub { pointer-events: none; }
.spectator .masters select { appearance: none; background: transparent; border-color: transparent; padding-left: 0; }
.spectator .pen { margin-right: .4rem; }
.spectator .pen-count { font-size: 1.5rem; }

.share-modal { text-align: center; align-items: stretch; }
.share-qr { display: grid; place-items: center; min-height: 120px; }
.share-qr svg { width: min(280px, 70vw); height: auto; background: #fff; border-radius: 14px; padding: 6px; }
.share-qr svg rect[fill="#ffffff"], .share-qr svg path { shape-rendering: crispEdges; }
#share-link { font-size: .85rem; }
