/* Écran de table + rendu partagé avec l'aperçu de la régie (web/app/table/*).
   Tailles en cqw : relatives au cadre affiché (TV ou vignette), pas à la fenêtre. */

/* ---- rendu partagé (TableStage) ---- */
.ts-stage { position: absolute; inset: 0; overflow: hidden; container-type: size; }
.ts-map {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 30% 40%, rgba(127,176,105,.20), transparent 60%),
    radial-gradient(50% 60% at 75% 65%, rgba(122,166,207,.16), transparent 60%),
    linear-gradient(135deg, #241c12, #171009);
}
.ts-mapimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; user-select: none; }
.ts-map.ts-grid::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(242,200,90,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242,200,90,.16) 1px, transparent 1px);
  background-size: clamp(28px,4cqw,56px) clamp(28px,4cqw,56px);
}
.ts-scene { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 7% 7% 6%; }
.ts-eyebrow { font-family: var(--serif); text-transform: uppercase; letter-spacing: .4em; font-size: clamp(9px,1.4cqw,15px); }
.ts-title { font-family: var(--serif); font-weight: 600; line-height: 1.02; font-size: clamp(24px,6cqw,72px); margin: .1em 0; color: var(--ink); text-shadow: 0 3px 22px rgba(0,0,0,.9); text-wrap: balance; overflow-wrap: anywhere; }
.ts-title.ts-foe { background: linear-gradient(180deg, #ffd9c9, #d0603f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ts-desc { font-size: clamp(12px,2cqw,22px); max-width: 26ch; color: var(--ink); text-shadow: 0 2px 12px #000; }
.ts-plaque { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8%; }
.ts-box { text-align: center; border: 2px solid var(--gold-deep); border-radius: 16px; padding: clamp(16px,3.5cqw,42px); max-width: 82%; box-shadow: 0 0 60px -12px rgba(242,200,90,.5), inset 0 0 40px -18px var(--gold); }
.ts-rar { display: inline-block; font-family: var(--serif); text-transform: uppercase; letter-spacing: .2em; font-size: clamp(9px,1.4cqw,14px); color: #241705; background: linear-gradient(180deg, #f3cd63, #c99327); padding: 3px 14px; border-radius: 999px; margin-bottom: .5em; }
.ts-nm { font-family: var(--serif); font-weight: 600; font-size: clamp(24px,5.4cqw,56px); line-height: 1.03; color: var(--ink); text-wrap: balance; }
.ts-rule { width: 64px; height: 2px; margin: 16px auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.ts-ds { font-size: clamp(12px,2cqw,21px); color: var(--ink-dim); max-width: 30ch; margin: 0 auto; }
.ts-stt { font-family: var(--mono); color: var(--gold); font-size: clamp(11px,1.7cqw,18px); margin: .6em auto 0; max-width: 34ch; }
.ts-black { position: absolute; inset: 0; background: #050403; display: flex; align-items: center; justify-content: center; }
.ts-black span { font-family: var(--serif); letter-spacing: .24em; text-transform: uppercase; font-size: clamp(11px,1.4cqw,14px); color: var(--ink-faint); }
.ts-grain { position: absolute; inset: 0; pointer-events: none; opacity: .05; mix-blend-mode: overlay; background-image: radial-gradient(circle at 20% 30%, #fff .5px, transparent .6px); background-size: 3px 3px; }

.ts-loot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: clamp(18px,4cqw,54px); gap: clamp(6px,1cqw,12px); overflow: auto; background: radial-gradient(80% 70% at 50% 30%, rgba(242,200,90,.10), transparent 60%); }
.ts-loot-chest { font-size: clamp(40px,9cqw,110px); line-height: 1; filter: drop-shadow(0 0 30px rgba(242,200,90,.5)); animation: tsrise .5s ease both; }
.ts-gold { display: inline-flex; align-items: baseline; gap: .28em; font-family: var(--serif); color: var(--gold); text-shadow: 0 3px 24px rgba(242,200,90,.35); }
.ts-gold-n { font-weight: 700; font-size: clamp(34px,8cqw,96px); line-height: .9; }
.ts-gold-u { font-size: clamp(12px,1.7cqw,19px); text-transform: uppercase; letter-spacing: .2em; color: var(--gold-deep); }
.ts-fan { display: flex; gap: clamp(10px,1.6cqw,18px); justify-content: center; flex-wrap: wrap; margin-top: clamp(10px,2cqw,22px); }
.ts-card { border: 1px solid var(--line2); border-top-width: 3px; border-radius: 12px; background: linear-gradient(180deg, rgba(34,26,18,.7), rgba(12,9,6,.4)); padding: clamp(10px,1.5cqw,18px) clamp(12px,1.8cqw,22px); width: clamp(140px,18cqw,200px); animation: tsrise .5s ease both; }
.ts-card-img { height: clamp(52px,8cqw,92px); border-radius: 9px; border: 1px dashed var(--line2); display: grid; place-items: center; color: var(--ink-faint); font-size: 10px; margin-bottom: 10px; background: #0e0a06; overflow: hidden; }
.ts-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ts-card-nm { font-family: var(--serif); font-size: clamp(14px,1.9cqw,22px); line-height: 1.12; text-wrap: balance; }
.ts-card-rar { font-size: clamp(9px,1.1cqw,12px); text-transform: uppercase; letter-spacing: .12em; margin-top: 6px; }
.ts-card-fx { font-family: var(--mono); font-size: clamp(10px,1.2cqw,13px); color: var(--ink-dim); margin-top: 8px; line-height: 1.4; }
@keyframes tsrise { 0% { opacity: 0; transform: translateY(14px) scale(.97); } 100% { opacity: 1; transform: none; } }

.ts-tokens { position: absolute; inset: 0; pointer-events: none; }
.ts-tok { position: absolute; width: clamp(28px,4cqw,52px); height: clamp(28px,4cqw,52px); transform: translate(-50%,-50%); }
.ts-tok .ts-dot { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(20,10,5,.85); box-shadow: 0 6px 16px -4px rgba(0,0,0,.85); display: grid; place-items: center; font-family: var(--serif); font-weight: 700; color: #140e08; font-size: clamp(10px,1.4cqw,17px); }
.ts-tok.turn .ts-dot { box-shadow: 0 0 0 3px rgba(242,200,90,.75), 0 6px 16px -4px rgba(0,0,0,.85); }
.ts-facing { position: absolute; inset: 0; pointer-events: none; }
.ts-arrow { position: absolute; left: 50%; top: -16%; transform: translateX(-50%); width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 11px solid var(--gold); filter: drop-shadow(0 1px 2px rgba(0,0,0,.8)); }
.ts-lab { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); font-family: var(--serif); font-size: clamp(9px,1.2cqw,14px); letter-spacing: .03em; color: #ffe9d6; background: rgba(20,8,5,.82); border: 1px solid var(--line2); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .ts-stage * { transition: none !important; animation: none !important; } }

/* ---- écran de table (TV) ---- */
.tv-screen { position: fixed; inset: 0; overflow: hidden; background: #0b0805; color: var(--ink); }
.tv-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.tv-box { position: relative; overflow: hidden; max-height: 100dvh; transition: transform .5s ease-out; }
.tv-box.land { aspect-ratio: 16 / 9; width: min(100dvw, 177.78dvh); }
.tv-box.port { aspect-ratio: 9 / 16; width: min(100dvw, 56.25dvh); }
.tv-box.flip { transform: rotate(180deg); }

.ts-flash { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(242,200,90,.22), rgba(8,5,3,.6) 70%); animation: tsfade 2.6s ease forwards; }
.ts-flash span { font-family: var(--serif); font-weight: 600; letter-spacing: .06em; color: #f2c85a; font-size: clamp(28px,6vw,68px); text-shadow: 0 4px 30px rgba(0,0,0,.9); animation: tspop 2.6s ease forwards; }
@keyframes tsfade { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tspop { 0% { transform: scale(.8); opacity: 0; } 15% { transform: scale(1.05); opacity: 1; } 30% { transform: scale(1); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .ts-flash, .ts-flash span { animation: none; } }

.tv-foot { position: absolute; inset: auto 0 0 0; z-index: 30; display: flex; justify-content: center; pointer-events: none; }
.tv-foot-in {
  pointer-events: auto; margin: 12px; display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px;
  background: rgba(13,10,6,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: .25; transition: opacity .2s;
}
.tv-foot-in:hover, .tv-foot-in:focus-within { opacity: 1; }
.tv-foot-l { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); }
.tv-foot .net { width: 104px; }
