/* Remparts — une cité la nuit : ciel violet, pierre des remparts, parchemin et feuille d'or */
body[data-theme="remparts"] {
  --bg: #15112a;
  --bg-glow: #3a2944;
  --surface: #241c3a;
  --fg: #f1e8d8;
  --muted: #b3a7c2;
  --line: rgba(241, 232, 216, .15);
  --glass: rgba(241, 232, 216, .06);
  --accent: #e2b44f;
  --accent-ink: #2b1d00;
  --hot: #c9473b;
  --hot-ink: #ffffff;
  --paper: #f4e9d1;
  --ink: #22180f;
  --ink-soft: #5d4c3c;
  --night: rgba(15, 11, 30, .68);
  --stone: #3a3046;
  --f-display: "Grenze Gotisch", "Palatino Linotype", Georgia, serif;
  --f-body: "Alegreya Sans", "Gill Sans", system-ui, sans-serif;
  background: #0b0a1f url("/games/remparts/fond.svg") center bottom / cover no-repeat fixed;
}
body[data-theme="remparts"] h2 { font-weight: 700; }
body[data-theme="remparts"] .topbar .title { font-weight: 700; font-size: 30px; }
body[data-theme="remparts"] .hero h1 { font-weight: 700; }
body[data-theme="remparts"] #app { position: relative; z-index: 1; }
body[data-theme="remparts"] .tb-bar { background: rgba(11, 9, 26, .78); border-bottom-color: rgba(226, 180, 79, .2); backdrop-filter: blur(6px); }
body[data-theme="remparts"] .tb-title { color: var(--accent); font-weight: 700; font-size: 26px; }

.tile-remparts { background: linear-gradient(180deg, rgba(11, 10, 31, .2), rgba(11, 10, 31, .1) 50%, rgba(11, 10, 31, .6)), #0b0a1f url("/games/remparts/fond.svg") 78% 100% / cover no-repeat; color: #f1e8d8; }
.tile-remparts h2 { font-family: "Grenze Gotisch", Georgia, serif; font-weight: 700; color: #e2b44f; font-size: 34px; }
.tile-remparts .btn.primary { background: #e2b44f; color: #2b1d00; }

/* ---------- Le ciel : étoiles qui scintillent, étoile filante ---------- */
.rp-scene { display: none; }
body[data-theme="remparts"] .rp-scene { display: block; position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.rp-scene i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #fff6d8; box-shadow: 0 0 6px 1px rgba(255, 240, 200, .75);
  opacity: .2; animation: rp-tw 3.8s ease-in-out var(--d) infinite; }
.rp-scene .shoot { position: absolute; top: 9%; left: 8%; width: 150px; height: 2px; border-radius: 2px; transform-origin: 100% 50%;
  background: linear-gradient(90deg, rgba(255, 246, 216, 0), #fff6d8); opacity: 0; animation: rp-shoot 21s linear 6s infinite; }
@keyframes rp-tw { 0%, 100% { opacity: .15; transform: scale(.6); } 50% { opacity: 1; transform: scale(1); } }
@keyframes rp-shoot {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(14deg); }
  1% { opacity: 1; }
  5% { opacity: 0; transform: translate3d(48vw, 12vw, 0) rotate(14deg); }
  100% { opacity: 0; transform: translate3d(48vw, 12vw, 0) rotate(14deg); }
}

/* ---------- Pièces communes ---------- */
.rp-coin { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #ffe08f, #d9a23a 60%, #a8751c); color: #3a2600; font: 800 12px/1 var(--f-body);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(90, 55, 0, .35); font-variant-numeric: tabular-nums; flex: none; }
.rp-coin.big { min-width: 30px; height: 30px; font-size: 15px; }
.rp-purse { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; color: var(--paper); font-variant-numeric: tabular-nums; }
.rp-purse svg { width: 18px; height: 18px; flex: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .5)); }
.rp-purse.big svg { width: 30px; height: 30px; }
.rp-purse.big b { font: 800 24px/1 var(--f-body); }
.rp-crown { width: 24px; height: 18px; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.crownslot { display: inline-flex; }
.rp-med svg { width: 22px; height: 29px; display: block; }
.rp-med.dead svg { filter: grayscale(1) brightness(.5); }
.rp-med.cur svg { filter: drop-shadow(0 0 4px var(--accent)); }

/* ---------- La table ---------- */
.rp-table {
  flex: 1; min-height: 0; overflow: auto; display: grid; gap: 10px 14px; padding: 8px 14px 10px;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "court side" "stage side" "mine side" "hand hand";
  color: var(--fg); font-family: var(--f-body);
}
.rp-table.watch { grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "court side" "stage side"; }
.rp-side { grid-area: side; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.rp-table h2, .rp-table h3 { margin: 0; }

/* La cour : ordre d'appel des personnages */
.rp-court { grid-area: court; display: flex; align-items: flex-end; gap: 14px; min-width: 0; }
.rp-court .meta { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 18px; }
.rp-court .round { font: 700 24px/1 var(--f-display); color: var(--accent); white-space: nowrap; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.rp-court .last { font-size: 12px; font-weight: 800; color: #fff; background: var(--hot); border-radius: 4px; padding: 3px 7px; white-space: nowrap; }
.cc-row { flex: 1; min-width: 0; max-width: 820px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.rp-cc { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.rp-cc .pt { position: relative; display: block; width: 100%; max-width: 62px; aspect-ratio: 100 / 130; transition: transform .35s cubic-bezier(.3, .7, .3, 1), filter .35s; }
.rp-cc .pt .rp-pt { width: 100%; height: 100%; display: block; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .55)); }
.rp-cc .no { position: absolute; top: -3px; left: max(0px, calc(50% - 38px)); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font: 700 13px/1 var(--f-display); color: #2b1d00; background: radial-gradient(circle at 35% 30%, #ffe08f, #d9a23a 65%, #a8751c); box-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.rp-cc .nm { font: 700 14px/1.05 var(--f-display); margin-top: 2px; color: var(--paper); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.rp-cc .who { font-size: 12px; line-height: 1.2; color: var(--muted); min-height: 15px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.rp-cc.wait .pt { filter: saturate(.7) brightness(.82); }
.rp-cc.up .pt { filter: grayscale(1) brightness(.45); }
.rp-cc.up .who { font-style: italic; }
.rp-cc.none .pt { filter: grayscale(.9) brightness(.5); }
.rp-cc.done .who { color: var(--paper); font-weight: 700; }
.rp-cc.mine .who { color: var(--accent); font-weight: 800; }
.rp-cc.cur .pt { transform: translateY(-5px) scale(1.07); filter: drop-shadow(0 0 12px rgba(226, 180, 79, .8)); }
.rp-cc.cur .who { color: var(--accent); font-weight: 800; }
.rp-cc.dead .pt { filter: grayscale(.6) brightness(.55) sepia(.5); }
.rp-cc .mk { position: absolute; display: block; pointer-events: none; }
.rp-cc .mk svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .7)); }
.rp-cc .mk.kill { width: 70%; right: -8%; bottom: 8%; }
.rp-cc .mk.rob { width: 52%; left: -6%; bottom: 2%; }
.rp-cc.flip-in .pt { animation: rp-flip .75s cubic-bezier(.3, .7, .3, 1) backwards; }
/* la dague et la bourse arrivent en vol (≈ .42 s et .5 s) : la marque apparaît à l'impact */
.rp-cc.slain .mk.kill { animation: rp-stab .4s cubic-bezier(.5, 0, .3, 1.3) .4s backwards; }
.rp-cc.slain .pt { animation: rp-hit .45s ease-out .42s; }
.rp-cc.slain .pt::after { content: ""; position: absolute; inset: 0; border-radius: 45% 45% 6% 6%; background: #c9473b; mix-blend-mode: multiply; opacity: 0; animation: rp-blood 1s ease-out .42s both; }
.rp-cc.robbing .mk.rob { animation: rp-drop .45s cubic-bezier(.4, 0, .3, 1.4) .48s backwards; }
.rp-cc.robbing .pt { animation: rp-hit .4s ease-out .5s; }
@keyframes rp-hit { 30% { transform: translateX(-4px) rotate(-4deg); } 60% { transform: translateX(3px) rotate(3deg); } }
@keyframes rp-flip {
  0% { transform: perspective(500px) rotateY(90deg) scale(1.2); filter: brightness(2.4) drop-shadow(0 0 16px #ffe08f); }
  55% { transform: perspective(500px) rotateY(-10deg) scale(1.12); filter: brightness(1.3) drop-shadow(0 0 14px #ffe08f); }
}
@keyframes rp-stab { 0% { transform: translate(60%, -90%) rotate(-30deg) scale(1.5); opacity: 0; } 60% { opacity: 1; } }
@keyframes rp-blood { 0% { opacity: 0; } 2% { opacity: .95; } 100% { opacity: 0; } }
@keyframes rp-drop { 0% { transform: translateY(-120%) scale(1.3); opacity: 0; } }

/* Cités rivales */
.rp-rivals { grid-area: rivals; flex: 0 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.rp-seat { position: relative; flex: none; display: flex; flex-direction: column; gap: 6px; padding: 9px 12px 0 15px; border-radius: 12px 12px 6px 6px; overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 15, 38, .86), rgba(20, 15, 38, .62)); border: 1px solid rgba(226, 180, 79, .16); }
.rp-seat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--pc); }
.rp-seat.act { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, 0 0 24px rgba(226, 180, 79, .22); }
.rp-seat .hd { display: flex; align-items: center; gap: 7px; min-width: 0; }
.rp-seat .nm { font: 700 20px/1.05 var(--f-display); color: var(--paper); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rp-seat .meds { margin-left: auto; display: flex; gap: 3px; flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #6fd08c; flex: none; box-shadow: 0 0 6px #6fd08c; }
.dot.off { background: #6b6378; box-shadow: none; }
.rp-seat .st { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: var(--muted); min-width: 0; }
.rp-backs { display: inline-flex; align-items: center; gap: 5px; color: var(--paper); font-weight: 800; }
.rp-backs .fan { display: inline-flex; padding-left: 6px; }
.rp-backs .rp-cb { width: 14px; height: 20px; margin-left: -6px; filter: drop-shadow(1px 0 1px rgba(0, 0, 0, .6)); }
.rp-seat .score { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-seat .flags { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; font-weight: 700; color: var(--accent); }
.rp-seat .flags span { padding: 1px 0; }

/* Les cités posées sur leur rempart */
.rp-sky { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 40px; margin: 0 -12px 0 -15px; padding: 4px 10px 13px; }
.rp-sky::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 13px; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(90deg, #463a55 0 15px, #3a3046 15px 16px), #3a3046;
  -webkit-mask: linear-gradient(#000 0 0) 0 4px / 100% 9px no-repeat, repeating-linear-gradient(90deg, #000 0 12px, transparent 12px 20px) 0 0 / 100% 5px no-repeat;
          mask: linear-gradient(#000 0 0) 0 4px / 100% 9px no-repeat, repeating-linear-gradient(90deg, #000 0 12px, transparent 12px 20px) 0 0 / 100% 5px no-repeat; }
.rp-b { appearance: none; border: 0; background: none; padding: 0; margin: 0 -2px; font: inherit; color: inherit;
  position: relative; display: block; flex: 0 1 50px; min-width: 0; transform-origin: 50% 100%; }
.rp-b > svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 -1px 4px rgba(255, 207, 115, .12)); }
button.rp-b { cursor: crosshair; }
.rp-b.can > svg { filter: drop-shadow(0 0 3px rgba(201, 71, 59, .9)); }
.rp-b.can:hover > svg, .rp-b.can:focus-visible > svg { filter: drop-shadow(0 0 7px #ff5a45) brightness(1.15); }
.rp-b.chosen > svg { filter: drop-shadow(0 0 9px #ff5a45) brightness(1.2); animation: rp-quake .5s ease-in-out infinite; }
@keyframes rp-quake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }

/* Ma cité : grand rempart, torches, bourse, personnages */
.rp-mine { grid-area: mine; position: relative; display: flex; flex-direction: column; min-width: 0; }
.rp-sky.big { margin: 0; padding: 4px 18px 0; min-height: 60px; gap: 4px; }
.rp-sky.big::after { display: none; }
.rp-sky.big .rp-b { flex: 0 1 100px; margin: 0; }
.rp-sky.big .rp-b .tag { z-index: 3; position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); z-index: 3; display: flex; }
.rp-sky.big .rp-b .tag .rp-coin { min-width: 20px; height: 20px; font-size: 11px; box-shadow: 0 0 0 2px var(--cc), 0 2px 4px rgba(0, 0, 0, .5); }
.rp-b.free > svg { stroke: rgba(222, 205, 170, .32); stroke-width: 2; filter: none; }
.rp-wall { position: relative; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; padding: 14px 44px 9px;
  border-radius: 0 0 12px 12px; color: var(--paper);
  background-color: #3a3046;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(0, 0, 0, .35)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28'%3E%3Cpath d='M0 .5H56M0 14.5H56M.5 0V14M28.5 0V14M14.5 14V28M42.5 14V28' stroke='%23271f31' fill='none'/%3E%3Cpath d='M1 1.5H27M29 1.5H55M15 15.5H41M43 15.5H56M0 15.5H13' stroke='%234b405a' fill='none'/%3E%3C/svg%3E");
  box-shadow: inset 0 -14px 20px rgba(0, 0, 0, .35), 0 8px 18px rgba(0, 0, 0, .35); }
.rp-wall::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
  background: repeating-linear-gradient(90deg, #463a55 0 26px, transparent 26px 40px); }
.rp-mine.act .rp-wall { box-shadow: inset 0 -14px 20px rgba(0, 0, 0, .35), 0 0 0 1px rgba(226, 180, 79, .5), 0 8px 26px rgba(226, 180, 79, .18); }
.rp-wall .plate { display: flex; align-items: center; gap: 8px; }
.rp-wall .plate .nm { font: 700 25px/1 var(--f-display); color: var(--paper); text-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.rp-wall .rp-crown { width: 30px; height: 22px; }
.rp-wall .mychars { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-mc { display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px 3px 4px; border-radius: 999px; background: rgba(11, 9, 26, .6); font: 700 16px/1 var(--f-display); color: var(--paper); }
.rp-mc svg { width: 26px; height: 34px; }
.rp-mc.cur { box-shadow: 0 0 0 2px var(--accent), 0 0 14px rgba(226, 180, 79, .4); color: var(--accent); }
.rp-mc.dead { opacity: .55; text-decoration: line-through; text-decoration-color: var(--hot); }
.rp-mc.secret span::after { content: " · secret"; font: 500 12px var(--f-body); color: var(--muted); }
.rp-wall .score { margin-left: auto; font-size: 14px; color: #d8cde4; font-variant-numeric: tabular-nums; }
.torch { position: absolute; left: 14px; top: -6px; width: 7px; height: 26px; border-radius: 2px; background: linear-gradient(90deg, #6b4426, #3a2516); z-index: 3; }
.torch.r { left: auto; right: 14px; }
.torch::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 14px; height: 22px; margin-left: -7px; transform-origin: 50% 100%;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%; background: radial-gradient(circle at 50% 72%, #fff4b8 0 22%, #ffb347 44%, #e2572b 72%, rgba(226, 87, 43, 0) 74%);
  animation: rp-flame 1.3s ease-in-out infinite alternate; }
.torch::after { content: ""; position: absolute; left: 50%; bottom: 40%; width: 150px; height: 150px; margin-left: -75px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(rgba(255, 176, 80, .32), rgba(255, 176, 80, 0) 65%); animation: rp-glow 2.1s ease-in-out infinite alternate; }
@keyframes rp-flame { 0% { transform: scale(1, 1) rotate(-3deg); } 40% { transform: scale(.92, 1.08) rotate(2deg); } 100% { transform: scale(1.06, .94) rotate(-1deg); } }
@keyframes rp-glow { 0% { opacity: .75; transform: scale(.94); } 100% { opacity: 1; transform: scale(1.04); } }

/* Ma main */
.rp-hand { grid-area: hand; min-width: 0; display: flex; flex-direction: column; gap: 0; margin-top: 2px; }
.rp-hand .hh { display: flex; align-items: baseline; gap: 12px; padding: 0 2px; }
.rp-hand h3 { font: 700 20px/1 var(--f-display); color: var(--paper); text-shadow: 0 2px 4px rgba(0, 0, 0, .7); }
.rp-hand h3 span { font: 700 14px var(--f-body); color: var(--muted); margin-left: 4px; }
.rp-hand .hint { font-size: 13.5px; font-weight: 700; color: var(--accent); }
.rp-hand .row { display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; padding: 14px 4px 4px; scrollbar-width: thin; }
.rp-hand .empty { color: var(--muted); margin: 6px 0; }

/* Carte quartier */
.rp-dc { appearance: none; border: 0; padding: 0; margin: 0; font: inherit; text-align: left; color: var(--ink);
  position: relative; flex: none; width: 124px; height: 186px; border-radius: 10px; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #fbf3e0, #efe0bf); box-shadow: 0 0 0 1px rgba(34, 24, 15, .55), 0 6px 14px rgba(0, 0, 0, .45);
  transition: transform .18s cubic-bezier(.3, .7, .3, 1), box-shadow .18s, filter .18s; }
.rp-dc .ill { display: block; margin: 5px 5px 0; height: 66px; border-radius: 6px 6px 3px 3px; overflow: hidden; box-shadow: 0 0 0 1.5px #9a7428; }
.rp-dc .ill svg { display: block; width: 100%; height: 100%; }
.rp-dc > .rp-coin { position: absolute; top: 2px; left: 2px; min-width: 26px; height: 26px; font-size: 14px; box-shadow: 0 0 0 2px #fbf3e0, 0 2px 4px rgba(0, 0, 0, .5); }
.rp-dc .body { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 6px 8px 8px; margin-top: 5px; border-top: 4px solid var(--cc); min-height: 0; }
.rp-dc .nm { font: 700 18px/1 var(--f-display); }
.rp-dc .fam { font-size: 11px; font-weight: 800; color: color-mix(in srgb, var(--cc) 70%, #22180f); }
.rp-dc .pw { margin-top: 3px; font-size: 10.5px; line-height: 1.22; color: var(--ink-soft); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 7; }
.rp-dc .pw.long { font-size: 9.8px; line-height: 1.18; }
button.rp-dc { cursor: pointer; }
button.rp-dc:hover:not(.sel) { transform: translateY(-5px); box-shadow: 0 0 0 1px rgba(34, 24, 15, .55), 0 12px 20px rgba(0, 0, 0, .5); }
button.rp-dc:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.rp-dc.sel { transform: translateY(-10px); box-shadow: 0 0 0 3px var(--accent), 0 14px 24px rgba(0, 0, 0, .55); }
.rp-dc.dim { filter: saturate(.55) brightness(.78); }

/* La scène */
.rp-stage { grid-area: stage; display: flex; gap: 16px; min-width: 0; min-height: 0; overflow: auto; padding: 12px 14px; border-radius: 14px; scrollbar-width: thin;
  background: var(--night); border: 1px solid rgba(226, 180, 79, .16); backdrop-filter: blur(3px); }
.rp-board { flex: none; width: 80px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 24px; padding-top: 6px; }
.rp-deck { position: relative; width: 62px; height: 86px; }
.rp-deck .rp-cb { position: absolute; left: 0; top: 0; width: 58px; height: 81px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.rp-deck .rp-cb:nth-child(2) { left: 2px; top: 2px; }
.rp-deck .rp-cb:nth-child(3) { left: 4px; top: 4px; }
.rp-deck .vide { position: absolute; inset: 0 4px 5px 0; border-radius: 6px; border: 2px dashed rgba(244, 233, 209, .25); }
.rp-deck b { position: absolute; right: -10px; bottom: -8px; min-width: 26px; padding: 3px 6px; border-radius: 999px; text-align: center; font: 800 13px/1 var(--f-body);
  color: var(--paper); background: #2a1f3a; box-shadow: 0 0 0 1.5px var(--accent); font-variant-numeric: tabular-nums; }
.rp-bank { position: relative; width: 70px; height: 52px; }
.rp-bank .rp-coin-i { position: absolute; width: 26px; height: 26px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.rp-bank .rp-coin-i:nth-child(1) { left: 6px; top: 20px; }
.rp-bank .rp-coin-i:nth-child(2) { left: 22px; top: 22px; }
.rp-bank .rp-coin-i:nth-child(3) { left: 38px; top: 19px; }
.rp-bank .rp-coin-i:nth-child(4) { left: 14px; top: 7px; }
.rp-bank .rp-coin-i:nth-child(5) { left: 31px; top: 5px; }
.rp-bank span { position: absolute; left: 0; right: 0; bottom: -14px; text-align: center; font: 700 13px var(--f-display); color: var(--muted); }
.rp-act { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.rp-banner { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rp-banner .txt { min-width: 0; }
.rp-banner h2 { font: 700 25px/1.05 var(--f-display); color: var(--paper); }
.rp-banner h2 b { color: var(--accent); font-weight: 700; }
.rp-banner p { margin: 3px 0 0; color: var(--muted); font-size: 14px; line-height: 1.3; max-width: 70ch; }
.rp-banner .step { font-weight: 800; font-variant-numeric: tabular-nums; opacity: .8; white-space: nowrap; }
.rp-banner .big-pt { position: relative; flex: none; width: 50px; }
.rp-banner .big-pt .rp-pt { width: 50px; height: 65px; display: block; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.rp-banner:not(.mine) .big-pt { width: 68px; }
.rp-banner:not(.mine) .big-pt .rp-pt { width: 68px; height: 88px; }
.rp-banner .big-pt .no { position: absolute; top: -4px; left: -4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font: 700 14px/1 var(--f-display); color: #2b1d00; background: radial-gradient(circle at 35% 30%, #ffe08f, #d9a23a 65%, #a8751c); }
.rp-banner.mine { background: radial-gradient(120% 140% at 0% 0%, #fbf3e0, #ecdcb8); color: var(--ink); border-radius: 12px; padding: 8px 16px 8px 10px; box-shadow: 0 0 0 1.5px #9a7428, 0 6px 18px rgba(0, 0, 0, .45); }
.rp-banner.mine h2 { color: var(--ink); }
.rp-banner.mine p { color: var(--ink-soft); }
.rp-banner.in { animation: rp-unfurl .55s cubic-bezier(.2, .8, .3, 1) backwards; transform-origin: 50% 0; }
.rp-banner.mine { position: relative; overflow: hidden; }
.rp-banner.mine.in::after { content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-110%);
  background: linear-gradient(105deg, transparent 35%, rgba(255, 250, 230, .75) 50%, transparent 65%); animation: rp-shine 1.2s .35s ease-out forwards; }
@keyframes rp-shine { to { transform: translateX(110%); } }
@keyframes rp-unfurl { 0% { opacity: 0; transform: translateY(-10px) scaleY(.85); } }
.aside-up { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); flex: none; }
.aside-up > span:first-child { max-width: 70px; text-align: right; line-height: 1.15; margin-right: 4px; }
.aside-up .rp-med svg { width: 30px; height: 39px; filter: grayscale(1) brightness(.75); }
.rp-cpile { position: relative; flex: none; width: 60px; height: 78px; }
.rp-cpile .rp-pt { position: absolute; width: 54px; height: 70px; left: 0; top: 0; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.rp-cpile .rp-pt:nth-child(2) { left: 2px; top: 2px; }
.rp-cpile .rp-pt:nth-child(3) { left: 4px; top: 4px; }
.rp-cpile .rp-pt:nth-child(4) { left: 6px; top: 6px; }
.rp-cpile b { position: absolute; right: -6px; bottom: -6px; min-width: 22px; padding: 3px 5px; border-radius: 999px; text-align: center; font: 800 12px/1 var(--f-body); color: var(--paper); background: #2a1f3a; box-shadow: 0 0 0 1.5px var(--accent); }

/* Ce que fait le joueur en cours */
.rp-feed { list-style: none; margin: 0; padding: 0 0 0 64px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; color: #d8cde4; }
.rp-feed li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 9px 2px 0; border-radius: 50%; background: var(--accent); }
.rp-feed li b { color: var(--paper); }
.rp-feed li.in { animation: rp-unfurl .45s cubic-bezier(.2, .8, .3, 1) backwards; }

/* Choix d'un personnage */
.rp-picks { display: flex; gap: 10px; overflow-x: auto; padding: 8px 4px 8px; }
.rp-pc { appearance: none; border: 0; font: inherit; cursor: pointer; flex: none; position: relative; width: 124px; padding: 7px 7px 9px; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; color: var(--ink);
  background: radial-gradient(120% 80% at 50% 0%, #fbf3e0, #efe0bf); box-shadow: 0 0 0 1px rgba(34, 24, 15, .55), 0 6px 16px rgba(0, 0, 0, .45);
  transition: transform .18s cubic-bezier(.3, .7, .3, 1), box-shadow .18s; }
.rp-pc .pt .rp-pt { width: 80px; height: 104px; display: block; }
.rp-pc .no { position: absolute; top: 6px; left: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font: 700 15px/1 var(--f-display); color: #2b1d00; background: radial-gradient(circle at 35% 30%, #ffe08f, #d9a23a 65%, #a8751c); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.rp-pc .nm { font: 700 19px/1 var(--f-display); margin-top: 2px; }
.rp-pc .p { font-size: 11px; line-height: 1.22; color: var(--ink-soft); }
.rp-pc.deal { animation: rp-deal .5s cubic-bezier(.2, .8, .3, 1.15) backwards; animation-delay: calc(var(--i) * 70ms + 140ms); }
@keyframes rp-deal { 0% { transform: translate(-90px, -20px) rotate(-14deg) scale(.55); opacity: 0; } 40% { opacity: 1; } }
.rp-pc:hover, .rp-pc:focus-visible { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--accent), 0 14px 26px rgba(0, 0, 0, .55); outline: none; }
.rp-pc.x:hover, .rp-pc.x:focus-visible { box-shadow: 0 0 0 3px var(--hot), 0 14px 26px rgba(0, 0, 0, .55); }

/* Commandes du tour */
.rp-ctl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; align-items: start; }
.rp-ctl .main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rp-ctl .side { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 190px; }
.rp-ctl .side .btn { text-align: left; }
.rp-ctl .side .end-btn { text-align: center; }
.rp-ctl .end-btn.ready { background: var(--paper); color: var(--ink); border-color: transparent; }
.rp-ctl .end-btn.ready:hover:not(:disabled) { background: #fff6e3; }
.rp-ctl .step-l { font: 700 18px/1.1 var(--f-display); color: var(--accent); }
.rp-ctl .note-s { margin: 0; font-size: 14px; color: var(--muted); }
.rp-ctl .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rp-ctl .why { font-size: 13.5px; color: #ffb4a8; }
.rp-ctl .btn .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--cc); margin-right: 7px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .5); }
.rp-big2 { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-big { appearance: none; font: inherit; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 12px; border-radius: 12px; text-align: left;
  border: 1.5px solid rgba(226, 180, 79, .6); background: rgba(226, 180, 79, .12); color: var(--paper); transition: background .15s, transform .15s; }
.rp-big b { display: block; font: 700 21px/1 var(--f-display); }
.rp-big small { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.rp-big:hover:not(:disabled) { background: rgba(226, 180, 79, .26); transform: translateY(-2px); }
.rp-big:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.rp-big:disabled { opacity: .45; cursor: not-allowed; }
.rp-big .ico { display: flex; align-items: center; }
.rp-big .ico svg { width: 30px; height: 30px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.rp-big .ico svg + svg { margin-left: -14px; margin-top: 8px; }
.rp-big .ico.cards svg { width: 25px; height: 35px; }
.rp-big .ico.cards svg + svg { margin-left: -12px; margin-top: 0; transform: rotate(10deg); }
.rp-choice { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.rp-choice.others { align-items: center; }
.rp-choice.others .rp-cb { width: 58px; height: 81px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); display: block; }
.rp-choice.others p { margin: 0 0 0 6px; color: var(--muted); }
.rp-tgs { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-tg { appearance: none; font: 700 14px/1.05 var(--f-display); cursor: pointer; width: 70px; padding: 5px 4px 7px; border-radius: 10px; color: var(--paper);
  display: flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(244, 233, 209, .07); border: 1px solid rgba(244, 233, 209, .16); transition: background .15s, border-color .15s, transform .15s; }
.rp-tg .rp-pt { width: 46px; height: 60px; }
.rp-tg:hover, .rp-tg:focus-visible { background: rgba(226, 180, 79, .2); border-color: var(--accent); transform: translateY(-3px); outline: none; }
.rp-tg.kill:hover, .rp-tg.kill:focus-visible { background: rgba(201, 71, 59, .3); border-color: var(--hot); }
.watching { margin: 0; color: var(--muted); }

/* Fin de partie */
.rp-result { display: flex; flex-direction: column; gap: 12px; }
.rp-result .crowned { display: flex; align-items: center; gap: 14px; }
.rp-result .rp-crown.big { width: 60px; height: 45px; animation: rp-crown-in .8s cubic-bezier(.3, .8, .3, 1.3) backwards; }
.rp-result h2 { font: 700 32px/1.05 var(--f-display); color: var(--accent); }
.rp-result p { margin: 2px 0 0; color: var(--muted); }
.rp-result tr.win td { color: var(--accent); font-weight: 800; }
@keyframes rp-crown-in { 0% { transform: translateY(-30px) rotate(-20deg) scale(.4); opacity: 0; } }

/* Chronique */
.rp-chron { grid-area: chron; flex: 1 1 140px; min-height: 120px; overflow: auto; padding: 10px 14px; border-radius: 12px; background: var(--night); border: 1px solid rgba(226, 180, 79, .12); scrollbar-width: thin; }
.rp-chron h3 { font: 700 19px/1 var(--f-display); color: var(--accent); margin-bottom: 8px; }
.rp-chron .log { font-size: 13.5px; }
.rp-chron .log div:first-child { color: var(--paper); }

/* Règles */
.rp-ref .rp-ref-pt .rp-pt { width: 36px; height: 47px; display: block; }

/* ---------- Animations (copies volantes) ---------- */
.rp-fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.rp-ghost { position: absolute; left: 0; top: 0; transform-style: preserve-3d; will-change: transform; }
.rp-ghost .gf { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.rp-ghost .gf.back { transform: rotateY(180deg); }
.rp-ghost .gf > .rp-dc { width: 100%; height: 100%; }
.rp-ghost .gf > svg { width: 100%; height: 100%; display: block; }
.rp-ghost.coin, .rp-ghost.crown, .rp-ghost.pt { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .55)); }
.rp-ghost.coin svg, .rp-ghost.crown svg, .rp-ghost.pt svg { width: 100%; height: 100%; display: block; }
.rp-ghost.ruin { transform-origin: 50% 100%; }
.rp-ghost.ruin svg { width: 100%; height: auto; display: block; }
.rp-ghost.pt.call { filter: drop-shadow(0 0 14px rgba(255, 217, 119, .85)); }
.rp-ghost.throw svg { width: 100%; height: 100%; display: block; }
.rp-ghost.throw.dagger, .rp-ghost.throw.purse { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6)); }
.rp-ghost.throw.boulder { filter: drop-shadow(0 0 10px rgba(255, 140, 50, .9)); }
.rp-ember { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #ffb347; box-shadow: 0 0 6px 2px rgba(255, 140, 50, .8); }
.rp-rocket { position: absolute; left: -2px; top: -2px; width: 4px; height: 12px; border-radius: 2px; background: linear-gradient(#fff6d8, rgba(255, 210, 120, 0)); }
.rp-spark { position: absolute; left: 0; top: -1.5px; width: 16px; height: 3px; border-radius: 2px; transform-origin: 0 50%; opacity: 0; }
.rp-flash { position: absolute; left: -30px; top: -30px; width: 60px; height: 60px; border-radius: 50%; opacity: 0; }
.rp-title { position: absolute; transform: translate(-50%, -50%); pointer-events: none; animation: rp-title 2.3s cubic-bezier(.2, .8, .3, 1) both; }
.rp-title span { display: block; padding: 10px 46px 12px; font: 700 54px/1 var(--f-display); color: #2b1d00; white-space: nowrap;
  background: linear-gradient(180deg, #fbe7a6, #e2b44f 55%, #c6922c); box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 0 0 2px #9a7428, 0 0 40px rgba(226, 180, 79, .45);
  clip-path: polygon(0 0, 100% 0, 96% 50%, 100% 100%, 0 100%, 4% 50%); }
.rp-title.small span { font-size: 34px; padding: 8px 34px 10px; background: linear-gradient(180deg, #ff8a74, #c9473b 60%, #9c2e25); color: #fff; }
@keyframes rp-title {
  0% { opacity: 0; transform: translate(-50%, -50%) scaleX(.2); }
  14% { opacity: 1; transform: translate(-50%, -50%) scaleX(1.04); }
  20% { transform: translate(-50%, -50%) scaleX(1); }
  78% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -64%); }
}
@media (max-width: 560px) { .rp-title span { font-size: 38px; padding: 8px 30px 10px; } .rp-title.small span { font-size: 26px; } }
.rp-dust { position: absolute; width: 6px; height: 6px; border-radius: 1px; background: #8d8191; }
.rp-b.rp-rise { animation: rp-rise .7s cubic-bezier(.25, .85, .3, 1.15) backwards; }
.rp-b.rp-rise::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: -2px; height: 30%; border-radius: 50%; background: radial-gradient(rgba(214, 196, 170, .7), rgba(214, 196, 170, 0) 70%); animation: rp-puff .8s ease-out forwards; pointer-events: none; }
@keyframes rp-rise { 0% { transform: translateY(35%) scaleY(.15); opacity: 0; filter: brightness(2); } 55% { opacity: 1; } }
@keyframes rp-puff { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.6, 1.1); opacity: 0; } }
.rp-bump { animation: rp-bump .32s cubic-bezier(.3, .7, .3, 1.5); }
@keyframes rp-bump { 40% { transform: scale(1.22); } }
.rp-land { animation: rp-land .35s ease-out; }
@keyframes rp-land { 0% { transform: scale(1.08); filter: brightness(1.3); } }

/* ---------- Écrans moyens : une seule colonne ---------- */
/* Ordinateurs peu hauts : la cour passe dans la colonne de droite, au-dessus des cités rivales */
@media (min-width: 1000px) and (max-height: 820px) {
  .rp-table { grid-template-rows: auto minmax(0, 1fr) auto auto; grid-template-areas: "stage court" "stage side" "mine side" "hand side"; }
  .rp-table.watch { grid-template-areas: "stage court" "stage side"; }
  .rp-court { flex-direction: column; align-items: stretch; gap: 4px; }
  .rp-court .meta { flex-direction: row; align-items: center; padding: 0; }
  .cc-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px 6px; }
  .rp-cc .pt { max-width: 44px; }
  .rp-cc .no { left: max(0px, calc(50% - 30px)); width: 18px; height: 18px; font-size: 12px; }
  .rp-cc .nm { font-size: 13px; }
  .rp-cc .who { font-size: 11.5px; min-height: 14px; }
  .rp-court .round { font-size: 21px; }
  .rp-seat { padding: 7px 10px 0 13px; gap: 4px; }
  .rp-seat .nm { font-size: 18px; }
  .rp-seat .st { font-size: 13px; }
  .rp-sky { min-height: 30px; }
  .rp-chron { min-height: 70px; flex-basis: 90px; }
  .rp-banner:not(.mine) .big-pt { width: 50px; }
  .rp-banner:not(.mine) .big-pt .rp-pt { width: 50px; height: 65px; }
  .rp-sky.big { min-height: 50px; }
  .rp-sky.big .rp-b { flex-basis: 84px; }
  .rp-wall { padding: 12px 44px 7px; }
  .rp-wall .plate .nm { font-size: 22px; }
  .rp-purse.big svg { width: 26px; height: 26px; }
  .rp-purse.big b { font-size: 21px; }
  .rp-hand h3 { font-size: 17px; }
  .rp-dc { width: 112px; height: 168px; }
  .rp-dc .ill { height: 52px; }
  .rp-dc .nm { font-size: 16.5px; }
  .rp-dc .pw { font-size: 9.6px; line-height: 1.16; }
  .rp-dc .pw.long { font-size: 9px; }
  .rp-pc { width: 112px; }
  .rp-pc .pt .rp-pt { width: 66px; height: 86px; }
  .rp-pc .p { font-size: 10.5px; }
}
@media (min-width: 1000px) and (max-height: 700px) {
  .rp-chron { display: none; }
  .rp-banner p { font-size: 13px; }
  .rp-pc .pt .rp-pt { width: 54px; height: 70px; }
  .rp-pc .nm { font-size: 17px; }
  .rp-pc .p { font-size: 10px; line-height: 1.18; }
  .rp-picks { padding-top: 4px; }
}

/* ---------- Écrans moyens : une seule colonne qui défile ---------- */
@media (max-width: 999px) {
  .rp-table, .rp-table.watch { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: max-content;
    grid-template-areas: "court" "rivals" "stage" "mine" "hand" "chron"; }
  .rp-table.watch { grid-template-areas: "court" "rivals" "stage" "chron"; }
  .rp-side { display: contents; }
  .rp-stage { overflow: visible; }
  .rp-rivals { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  .rp-seat { flex: 0 0 min(290px, 80vw); }
  .rp-chron { max-height: 220px; }
  .cc-row { max-width: none; }
  .rp-cc .pt { max-width: 70px; }
}

/* ---------- Téléphones ---------- */
@media (max-width: 560px) {
  .rp-table { padding: 8px 10px 12px; gap: 10px; }
  .rp-court { flex-direction: column; align-items: stretch; gap: 4px; }
  .rp-court .meta { flex-direction: row; align-items: center; padding: 0; }
  .rp-court .round { font-size: 20px; }
  .cc-row { gap: 3px; }
  .rp-cc .nm { display: none; }
  .rp-cc .who { font-size: 10.5px; }
  .rp-cc .no { width: 16px; height: 16px; font-size: 11px; left: -2px; top: -3px; }
  .rp-seat .nm { font-size: 18px; }
  .rp-stage { padding: 10px; gap: 10px; }
  .rp-board { width: 46px; gap: 18px; justify-content: flex-start; padding-top: 4px; }
  .rp-bank span { display: none; }
  .rp-stage.over .rp-board { display: none; }
  .rp-result h2 { font-size: 25px; }
  .rp-result .rp-crown.big { width: 44px; height: 33px; }
  .rp-result table { font-size: 13px; }
  .rp-result th, .rp-result td { padding: 7px 4px; }
  .rp-result th { font-size: 10px; letter-spacing: .03em; }
  .rp-ctl { grid-template-columns: minmax(0, 1fr); }
  .rp-ctl .side { min-width: 0; flex-direction: row; flex-wrap: wrap; }
  .rp-ctl .side .end-btn { margin-left: auto; }
  .rp-feed { padding-left: 0; font-size: 14px; }
  .rp-sky.big .rp-b .tag { display: none; }
  .rp-deck { width: 44px; height: 62px; }
  .rp-deck .rp-cb { width: 41px; height: 57px; }
  .rp-bank { width: 50px; height: 40px; transform: scale(.78); transform-origin: 0 0; }
  .rp-banner { gap: 10px; }
  .rp-banner h2 { font-size: 21px; }
  .rp-banner p { font-size: 13px; }
  .rp-banner .big-pt, .rp-banner:not(.mine) .big-pt { width: 44px; }
  .rp-banner .big-pt .rp-pt, .rp-banner:not(.mine) .big-pt .rp-pt { width: 44px; height: 57px; }
  .rp-banner.mine { padding: 7px 10px 7px 7px; }
  .aside-up > span:first-child { display: none; }
  .rp-pc { width: 116px; }
  .rp-pc .pt .rp-pt { width: 84px; height: 109px; }
  .rp-pc .nm { font-size: 18px; }
  .rp-pc .p { font-size: 11px; }
  .rp-big { padding: 8px 14px 8px 10px; flex: 1 1 140px; }
  .rp-big b { font-size: 18px; }
  .rp-tg { width: 64px; font-size: 12.5px; }
  .rp-tg .rp-pt { width: 44px; height: 57px; }
  .rp-sky.big { padding: 4px 8px 0; min-height: 44px; gap: 2px; }
  .rp-wall { padding: 16px 30px 10px; gap: 8px 12px; }
  .rp-wall .plate .nm { font-size: 21px; }
  .rp-wall .score { margin-left: 0; width: 100%; font-size: 13px; }
  .rp-mc { font-size: 14px; }
  .rp-mc svg { width: 22px; height: 29px; }
  .torch { left: 8px; }
  .torch.r { right: 8px; }
  .rp-hand .row { flex-wrap: wrap; overflow: visible; justify-content: flex-start; gap: 10px 8px; }
  .rp-dc { width: calc((100% - 16px) / 3); max-width: 118px; height: 186px; }
  .rp-dc .ill { height: 60px; }
  .rp-dc .nm { font-size: 16.5px; }
  .rp-dc .pw { font-size: 9.8px; }
  .rp-dc .pw.long { font-size: 9.2px; }
}
