/* RUSH TABLE G v7 — tables nappées (clé grecque) + sol pavés partout sous le plateau.
   Vue de haut légère. Textures webp tiny répétées — FPS-safe. VFX atterrissage inchangés. */
:root {
  --gblue: #1a3a6e; --gblue2: #12305a; --gblue3: #0c2244;
  --wood: #e8dcc4; --wood2: #d2c2a4; --wood3: #b9a888;
  --nappe: url("textures/nappe-meandre.webp");
  --paves: url("textures/floor-paves.webp");
}

/* ---------- Sol pavés : TOUT le fond de l’écran de combat ---------- */
.screen.game {
  background:
    radial-gradient(80% 55% at 50% 38%, rgba(255,255,255,.06), transparent 65%),
    #4a5560 var(--paves) repeat center top / 56px 56px !important;
}
/* plus de « dalle » en perspective partielle — le motif remplit l’espace */
.screen.game::before { display: none !important; }
.screen.game > * { position: relative; z-index: 1; }

/* barres UI lisibles sur les pavés */
.screen.game .ghead, .screen.game .oppbar {
  background: linear-gradient(180deg, rgba(28,18,22,.72), rgba(28,18,22,.35));
  backdrop-filter: none;
}
.screen.game .handbar, .screen.game .hand, .screen.game .status {
  background: linear-gradient(0deg, rgba(28,18,22,.78), rgba(28,18,22,.25));
}


/* ---------- Caméra : vue de haut, tables séparées pour voir la roche ---------- */
.screen.game .board {
  gap: 20px;
  padding: 10px 10px 44px;
  transform: perspective(1600px) rotateX(5deg);
  transform-origin: 50% 100%;
  background: transparent;
}

/* ---------- Une vraie table (dessus carré + épaisseur + nappe) ---------- */
.board .col {
  position: relative;
  border-radius: 3px;
  padding: 3px 4px 4px;
  margin: 4px 2px 10px;
  isolation: isolate;
  /* dessus de table = nappe */
  background:
    linear-gradient(180deg, rgba(255,255,255,.28), transparent 22%, transparent 78%, rgba(12,30,55,.07)),
    #fff var(--nappe) repeat center / 16px 16px;
  border: 2px solid var(--gblue);
  /* épaisseur du plateau (rebord) + ombre au sol */
  box-shadow:
    inset 0 0 0 1.5px rgba(255,255,255,.92),
    0 1px 0 #fff,
    0 3px 0 var(--gblue),
    0 5px 0 var(--gblue2),
    0 7px 0 var(--wood3),
    0 9px 0 var(--wood),
    0 11px 0 var(--wood2),
    0 13px 0 var(--wood3),
    0 20px 24px rgba(0,0,0,.55);
}

/* structure décorative : retombées + plis + pattes */
.board .tbl {
  position: absolute; inset: 0;
  pointer-events: none; z-index: -1;
  overflow: visible;
}
.board .tbl i { position: absolute; display: block; }

/* retombée de nappe sur les 4 côtés (overhang) */
.board .tbl .apron {
  background: #fff var(--nappe) repeat center / 14px 14px;
  border: 1.5px solid var(--gblue);
  box-shadow: 0 3px 5px rgba(0,0,0,.4);
}
.board .tbl .apron.l,
.board .tbl .apron.r {
  top: 4%; bottom: 4%; width: 13px;
}
.board .tbl .apron.l { left: -13px; border-radius: 0 0 0 2px; }
.board .tbl .apron.r { right: -13px; border-radius: 0 0 2px 0; }
.board .tbl .apron.t,
.board .tbl .apron.b {
  left: 2%; right: 2%; height: 12px;
}
.board .tbl .apron.t { top: -11px; }
.board .tbl .apron.b { bottom: -12px; }

/* plis pointus aux 4 coins (nappe) */
.board .tbl .fold {
  width: 28px; height: 32px;
  background: #fff var(--nappe) center / 14px 14px;
  clip-path: polygon(6% 0, 94% 0, 50% 100%);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.45));
  z-index: 1;
}
.board .tbl .fold.bl { left: -8px; bottom: -30px; }
.board .tbl .fold.br { right: -8px; bottom: -30px; }
.board .tbl .fold.tl { left: -8px; top: -14px; transform: scaleY(-.7); height: 18px; opacity: .9; }
.board .tbl .fold.tr { right: -8px; top: -14px; transform: scaleY(-.7); height: 18px; opacity: .9; }

/* pattes bois pâle bien visibles */
.board .tbl .lg {
  width: 11px; height: 26px;
  border-radius: 1px 1px 2px 2px;
  background: linear-gradient(90deg, var(--wood3), var(--wood) 35%, var(--wood2) 70%, var(--wood3));
  box-shadow: 1px 3px 3px rgba(0,0,0,.45), inset 1px 0 0 rgba(255,255,255,.5);
  z-index: 0;
}
.board .tbl .lg.bl { left: 6%; bottom: -46px; }
.board .tbl .lg.br { right: 6%; bottom: -46px; }
.board .tbl .lg.tl { left: 7%; bottom: -18px; height: 12px; opacity: .7; }
.board .tbl .lg.tr { right: 7%; bottom: -18px; height: 12px; opacity: .7; }
.board .tbl .lg::after {
  content: ""; position: absolute; left: -6px; right: -6px; bottom: -4px; height: 5px;
  border-radius: 50%; background: rgba(0,0,0,.42);
}

/* zones de jeu sur la nappe */
.board .side { border-radius: 7px; }
.board .side.opp {
  background: linear-gradient(rgba(26,58,110,.14), rgba(26,58,110,.05));
  box-shadow: inset 0 0 0 1px rgba(26,58,110,.22);
}
.board .side.me {
  background: linear-gradient(rgba(212,175,55,.08), rgba(212,175,55,.18));
  box-shadow: inset 0 0 0 1px rgba(170,130,40,.3);
}
.board .side.ok { animation: okt 1s ease-in-out infinite alternate; }
@keyframes okt {
  from { background: rgba(255,196,0,.18); box-shadow: inset 0 0 0 2px rgba(224,168,0,.75); }
  to { background: rgba(255,196,0,.34); box-shadow: inset 0 0 0 2.5px #e0a800, 0 0 16px rgba(255,190,0,.7); }
}
.board .side.hover {
  animation: none; background: rgba(255,196,0,.45);
  box-shadow: inset 0 0 0 3px #c98f00, 0 0 22px rgba(255,190,0,.9);
}
.board .col.zwin .side.me {
  background: rgba(255,196,0,.30);
  box-shadow: inset 0 0 0 2px #e0a800, 0 0 22px rgba(255,190,0,.85);
}
.board .col.zlose .side.opp { background: rgba(230,60,60,.18); }

/* enseigne du lieu */
.board .loc {
  margin: 5px -3px; border-radius: 8px; border: 0;
  box-shadow: 0 3px 0 rgba(10,40,80,.55), 0 7px 10px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.85);
}
.board .loc.open:not(.photo) {
  color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.18), rgba(255,255,255,0) 40%, rgba(0,0,0,.12)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 6px, transparent 6px 12px),
    linear-gradient(#2a6fbd, var(--gblue));
}
.board .loc.open:not(.photo) .ln { color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.45); }
.board .loc.open:not(.photo) .le { color: #eaf2ff; text-shadow: 0 1px 0 rgba(0,0,0,.35); }
.board .loc::before {
  background: #fff var(--nappe) repeat-x center / 14px 14px; height: 7px;
  border-bottom: 1px solid rgba(26,58,110,.45); z-index: 3;
}
.board .loc::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
  background: #fff var(--nappe) repeat-x center / 14px 14px;
  border-top: 1px solid rgba(26,58,110,.45); z-index: 3; pointer-events: none;
}
.board .loc.photo { border: 0; }
.board .loc.closed {
  margin: 6px 4px;
  background: #fff var(--nappe) repeat center / 14px 14px;
  border: 2px dashed rgba(26,58,110,.55);
  box-shadow: 0 3px 6px rgba(0,0,0,.18); color: var(--gblue2);
}
.board .loc.closed::before, .board .loc.closed::after { display: none; }
.board .loc.closed .ln {
  color: var(--gblue2); background: rgba(255,255,255,.78);
  border-radius: 4px; padding: 0 4px;
}
.board .loc .tot { box-shadow: 0 2px 3px rgba(0,0,0,.45); }
.board .loc.open .tot.t { top: 9px; } .board .loc.open .tot.b { bottom: 8px; }
.board .loc.open { padding-top: 29px; padding-bottom: 28px; }

/* cartes + impacts (inchangés) */
.board .mc { box-shadow: 0 1px 0 rgba(0,0,0,.25), 2px 5px 6px rgba(40,25,10,.38), 0 0 0 1px rgba(0,0,0,.06); }
.board .mc.slam, .board .mc.land { animation: land3d .46s cubic-bezier(.3,.1,.4,1) both; z-index: 6; }
@keyframes land3d {
  0% { transform: perspective(420px) translate3d(0, -26px, 150px) rotateX(-18deg) rotateZ(-5deg); box-shadow: 0 30px 26px rgba(0,0,0,.0); filter: brightness(1.25); }
  58% { transform: perspective(420px) translate3d(0, 0, 0) rotateX(0) rotateZ(0) scale(1.02, .94); box-shadow: 0 0 0 rgba(0,0,0,.6); filter: brightness(1.15); }
  74% { transform: perspective(420px) translate3d(0, -2px, 10px) scale(.98, 1.03); }
  100% { transform: none; filter: none; }
}
.board .mc.drop3d { animation: drop3d .5s cubic-bezier(.3,.1,.4,1) both; z-index: 6; }
.board .mc.dropin { animation: dropin3d .5s cubic-bezier(.3,.1,.4,1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes dropin3d {
  0% { transform: perspective(420px) translate3d(0, -36px, 170px) rotateX(-24deg) rotateZ(6deg); opacity: 0; }
  25% { opacity: 1; }
  60% { transform: perspective(420px) translate3d(0, 0, 0) scale(1.03, .93); }
  80% { transform: perspective(420px) translate3d(0, -2px, 8px) scale(.98, 1.03); }
  100% { transform: none; opacity: 1; }
}
@keyframes drop3d {
  0% { transform: perspective(420px) translate3d(0, -40px, 190px) rotateX(-30deg) rotateY(180deg); opacity: 0; }
  20% { opacity: 1; }
  60% { transform: perspective(420px) translate3d(0, 0, 0) rotateX(0) rotateY(0) scale(1.03, .93); }
  78% { transform: perspective(420px) translate3d(0, -2px, 8px) scale(.98, 1.03); }
  100% { transform: none; opacity: 1; }
}
.board .col.thud { animation: thud .34s ease-out; }
.board .col.thud2 { animation: thud2 .5s ease-out; }
@keyframes thud { 25% { transform: translateY(2px) scaleY(.995); } 55% { transform: translateY(-1px); } }
@keyframes thud2 { 15% { transform: translateY(4px) rotate(.6deg) scaleY(.99); } 35% { transform: translateY(-2px) rotate(-.5deg); } 60% { transform: translateY(1px) rotate(.25deg); } }

@media (max-height: 700px) {
  .screen.game .board { transform: perspective(1400px) rotateX(4deg); padding-bottom: 28px; gap: 14px; }
  .board .loc.open { padding-top: 26px; padding-bottom: 25px; }
  .board .tbl .lg.bl, .board .tbl .lg.br { height: 16px; bottom: -30px; }
  .board .tbl .fold.bl, .board .tbl .fold.br { height: 24px; bottom: -22px; }
}
@media (max-width: 370px) {
  .screen.game .board { gap: 12px; padding-left: 8px; padding-right: 8px; }
  .board .tbl .apron.l { left: -8px; width: 8px; }
  .board .tbl .apron.r { right: -8px; width: 8px; }
}

body.reduce .board .mc.slam, body.reduce .board .mc.land, body.reduce .board .mc.drop3d,
body.reduce .board .mc.dropin, body.reduce .board .col.thud, body.reduce .board .col.thud2,
body.reduce .board .side.ok { animation: none !important; }
