/* Table de jeu : habillage des marges du plateau (docs/BOARD_DECOR.md).
   Phaser est transparent (board.js) : ce fond fixe se voit partout où la carte ne couvre pas le cadre.
   Il ne bouge pas avec la caméra, n'intercepte aucun clic et ne change ni la taille ni la projection de la carte.
   Choix du joueur (réglage « Table de jeu », table-skin.js) : html[data-table] = paper (défaut), felt, wood, steel.
   --table-rim et --table-rim-width règlent le rebord dessiné par Phaser autour de la carte. */
.board-phaser{
 --table-rim:#3b2f22;--table-rim-width:3;
 --decor-contours:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='420' fill='none' stroke='%23856a3f' stroke-width='1.1'%3E%3Cpath d='M70 110c40-55 150-60 190-10s-10 120-90 125-140-60-100-115z'/%3E%3Cpath d='M98 118c30-36 108-38 134-4s-8 82-64 85-98-42-70-81z'/%3E%3Cpath d='M126 126c18-20 62-21 78-2s-6 46-38 47-56-24-40-45z'/%3E%3Cpath d='M330 260c55-45 170-30 190 30s-60 110-140 100-105-85-50-130z'/%3E%3Cpath d='M362 276c38-30 116-20 130 20s-40 74-96 67-72-58-34-87z'/%3E%3Cpath d='M395 292c20-15 62-10 70 11s-22 39-51 35-38-31-19-46z'/%3E%3Cpath d='M-20 360c60-30 140-10 180 40'/%3E%3Cpath d='M380 -10c-10 50 40 90 110 95s90 30 90 30'/%3E%3C/svg%3E");
 background-color:#e6d6b3;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E"),radial-gradient(ellipse at 50% 45%,#f2e6c900 40%,#a98a5733 100%);
 background-size:160px 160px,100% 100%;
}
/* Papier sable : courbes de niveau à peine visibles, le grain porte la matière, la carte reste le sujet. */
.board-phaser::before{content:'';position:absolute;inset:0;pointer-events:none;z-index:0;
 background:var(--decor-contours) 0 0/560px 420px;opacity:.18}
.board-phaser canvas{position:relative;z-index:1}

/* Feutre bleu ardoise : grain atténué, couture fine à quelques pixels du bord. */
html[data-table=felt] .board-phaser{
 --table-rim:#16263a;
 background-color:#2d475c;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .78 0 0 0 0 .86 0 0 0 0 .95 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23f)'/%3E%3C/svg%3E"),radial-gradient(ellipse at 50% 45%,#3a597200 35%,#14243466 100%);
 background-size:140px 140px,100% 100%;
}
html[data-table=felt] .board-phaser::before{background:none;opacity:1;inset:9px;border:1px dashed #c9d6e266;border-radius:4px}

/* Bois clair : lames de pin horizontales, veinage étiré, liseré crème autour de la carte. */
html[data-table=wood] .board-phaser{
 --table-rim:#fbf3df;--table-rim-width:7;
 background-color:#e3bf88;
 background-image:
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='96'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .32' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .3 0 0 0 0 .1 0 0 0 .9 -.12'/%3E%3C/filter%3E%3Crect width='480' height='96' filter='url(%23w)'/%3E%3C/svg%3E"),
  repeating-linear-gradient(180deg,#00000000 0 45px,#7a4c2099 45px 47px,#fff2d455 47px 48px),
  linear-gradient(180deg,#f1d3a0,#dcb27a 50%,#e8c48e);
 background-size:480px 96px,100% 48px,100% 100%;
}
html[data-table=wood] .board-phaser::before{background:none;opacity:1;box-shadow:inset 0 0 0 2px #b9894f,inset 0 0 18px #6b40172e}

/* Plaque d'acier : bleu marine biseauté, rivets aux quatre coins. */
html[data-table=steel] .board-phaser{
 --table-rim:#0f1c29;
 background-color:#22364a;
 background-image:
  radial-gradient(circle at 16px 16px,#d9e2ea 0 2px,#7d8fa0 3px,#2a3e52 5px,#0000 6px),
  radial-gradient(circle at calc(100% - 16px) 16px,#d9e2ea 0 2px,#7d8fa0 3px,#2a3e52 5px,#0000 6px),
  radial-gradient(circle at 16px calc(100% - 16px),#d9e2ea 0 2px,#7d8fa0 3px,#2a3e52 5px,#0000 6px),
  radial-gradient(circle at calc(100% - 16px) calc(100% - 16px),#d9e2ea 0 2px,#7d8fa0 3px,#2a3e52 5px,#0000 6px),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.004 .9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .8 0 0 0 0 .88 0 0 0 0 .95 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23s)'/%3E%3C/svg%3E"),
  linear-gradient(180deg,#2c4459,#1d3044);
 background-size:auto,auto,auto,auto,200px 200px,100% 100%;
}
html[data-table=steel] .board-phaser::before{background:none;opacity:1;inset:5px;border-radius:12px;border:2px solid #4d6680;box-shadow:inset 0 2px 0 #ffffff1f,inset 0 -2px 0 #0000004d,inset 0 0 24px #0a14204d,0 0 0 1px #0b1622}

/* Lumière sur le plateau (25 novembre 2026, lot « plus vivant ») : bords légèrement assombris et lumière chaude venue du
   coin haut gauche, au-dessus du canevas Phaser, pour sortir de l'effet « feuille plate ». Ne capte aucun clic et ne
   cache rien : l'assombrissement reste sous 30 % au bord, nul au centre. */
.board-phaser::after{content:'';position:absolute;inset:0;z-index:2;pointer-events:none;border-radius:inherit;
 background:radial-gradient(ellipse 75% 70% at 50% 48%,transparent 58%,#0f1c3038 82%,#0f1c3059 100%),linear-gradient(135deg,#fff0c81f 0,transparent 42%)}
@media(forced-colors:active){.board-phaser::after{display:none}}

/* À vous de jouer (lot 11) : le plateau s'éclaire un instant quand l'ordinateur rend la main. */
#board-phaser.turn-back canvas{animation:turn-back .9s ease-out}
@keyframes turn-back{0%{filter:brightness(1.18) saturate(1.1)}100%{filter:none}}
@media(prefers-reduced-motion:reduce){#board-phaser.turn-back canvas{animation:none}}
