:root {
  color-scheme: dark;
  --bg: #071f1a;
  --bg-deep: #041510;
  --surface: rgba(255,255,255,.075);
  --surface-strong: rgba(255,255,255,.12);
  --line: rgba(255,255,255,.13);
  --text: #fffaf0;
  --muted: #a8bdb6;
  --accent: #efc967;
  --accent-2: #d9a93d;
  --green: #67cf9a;
  --red: #f0756c;
  --blue: #73a7ef;
  --shadow: 0 22px 70px rgba(0,0,0,.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --card-ratio: 372 / 520;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--text); overscroll-behavior: none; }
body { min-height: 100dvh; overflow-x: hidden; background:
  radial-gradient(circle at 50% -18%, rgba(66,139,112,.34), transparent 38%),
  radial-gradient(circle at 0 100%, rgba(221,174,68,.08), transparent 30%),
  linear-gradient(155deg, #0c342b 0%, #061d18 55%, #041510 100%);
}
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .2; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E"); }
button, input, select { font: inherit; color: inherit; }
button { -webkit-user-select: none; user-select: none; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(239,201,103,.55); outline-offset: 2px; }
button[hidden], [hidden] { display: none !important; }
img { display: block; max-width: 100%; }

.app-shell { min-height: 100dvh; }
.screen { width: min(100%, 720px); min-height: 100dvh; margin: 0 auto; padding: calc(18px + var(--safe-top)) 18px calc(20px + var(--safe-bottom)); }
.center-screen { display: grid; place-items: center; align-content: center; text-align: center; }
.full { width: 100%; }
.eyebrow { color: var(--accent); font-size: 11px; line-height: 1; letter-spacing: .18em; font-weight: 900; }

.btn { border: 0; border-radius: 17px; min-height: 54px; padding: 13px 18px; font-weight: 850; cursor: pointer; transition: transform .16s ease, filter .16s ease, opacity .16s ease, border-color .16s ease; }
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .4; cursor: default; transform: none; }
.btn-primary { color: #16251f; background: linear-gradient(145deg, #f7da82, #dcae43); box-shadow: 0 12px 30px rgba(220,174,67,.22), inset 0 1px rgba(255,255,255,.5); }
.btn-secondary { background: var(--surface-strong); border: 1px solid var(--line); }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-danger { color: #ffdcd8; background: rgba(240,117,108,.16); border: 1px solid rgba(240,117,108,.35); }
.btn-stop { color: white; background: linear-gradient(150deg, #f07168, #be3d36); box-shadow: 0 12px 28px rgba(190,61,54,.25); }
.btn.compact { min-height: 44px; border-radius: 14px; padding: 10px 15px; }

/* Identité */
.brand-lockup { display: grid; justify-items: center; gap: 26px; }
.brand-mark { position: relative; width: 128px; height: 105px; animation: brand-float 4s ease-in-out infinite; }
.play-card { position: absolute; width: 72px; aspect-ratio: var(--card-ratio); border-radius: 9px; background: #fffaf0; border: 2px solid rgba(15,38,30,.12); box-shadow: 0 15px 30px rgba(0,0,0,.3); }
.play-card::before { content: ""; position: absolute; inset: 6px; border: 2px solid #be514b; border-radius: 5px; background: repeating-linear-gradient(45deg, rgba(190,81,75,.18) 0 2px, transparent 2px 6px); }
.play-card.one { left: 5px; top: 9px; transform: rotate(-14deg); }
.play-card.two { right: 5px; top: 9px; transform: rotate(14deg); }
.play-card.front { left: 28px; top: 0; z-index: 2; transform: rotate(-1deg); }
.play-card.front::before { border-color: #1f5b49; background: none; }
.play-card.front::after { content: "T"; position: absolute; inset: 0; display: grid; place-items: center; color: #b84742; font: 800 47px Georgia, serif; }
.brand-title { margin: 0; font: 800 clamp(56px, 17vw, 86px)/.9 Georgia, "Times New Roman", serif; letter-spacing: -.055em; text-shadow: 0 10px 35px rgba(0,0,0,.25); }
.brand-subtitle { margin: 12px 0 0; color: var(--muted); font-size: 16px; }
.home-actions { width: min(100%, 380px); margin-top: 44px; display: grid; gap: 10px; }
.install-note { margin: 18px auto 10px; max-width: 340px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.home-admin { font-size: 13px; }
@keyframes brand-float { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-8px) rotate(1deg); } }

/* Chargement */
.loading { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 20px; color: var(--muted); font: 700 18px Georgia, serif; letter-spacing: .04em; }
.brand-loader { position: relative; width: 80px; height: 70px; }
.brand-loader span { position: absolute; left: 23px; width: 38px; aspect-ratio: var(--card-ratio); border-radius: 5px; background: #fff8e7; transform-origin: 50% 100%; animation: loader-cards 1.25s ease-in-out infinite; }
.brand-loader span:nth-child(1) { transform: rotate(-18deg); animation-delay: -.18s; }
.brand-loader span:nth-child(2) { transform: rotate(0); z-index: 2; }
.brand-loader span:nth-child(3) { transform: rotate(18deg); animation-delay: .18s; }
@keyframes loader-cards { 50% { translate: 0 -9px; } }

/* Administration */
.topbar, .compact-topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.topbar { margin-bottom: 22px; }
.wordmark { display: flex; align-items: center; gap: 11px; font: 800 25px Georgia, serif; }
.mini-mark { flex: 0 0 auto; width: 34px; aspect-ratio: var(--card-ratio); border-radius: 6px; background: #fff8e7; position: relative; transform: rotate(-4deg); box-shadow: 0 8px 18px rgba(0,0,0,.25); }
.mini-mark::before { content: ""; position: absolute; inset: 4px; border: 1.5px solid #26705a; border-radius: 3px; }
.mini-mark::after { content: "T"; position: absolute; inset: 0; display: grid; place-items: center; color: #b84742; font: 800 21px Georgia, serif; }
.icon-btn, .round-icon { width: 45px; height: 45px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.round-icon { border-radius: 50%; font-size: 30px; line-height: 1; }
.hero-panel { position: relative; overflow: hidden; min-height: 210px; padding: 26px; border-radius: 28px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.045)); box-shadow: var(--shadow); }
.hero-panel::after { content: ""; position: absolute; width: 220px; height: 220px; right: -90px; bottom: -100px; border-radius: 50%; border: 38px solid rgba(239,201,103,.07); }
.hero-panel h1 { margin: 12px 0 8px; max-width: 360px; font-size: clamp(30px, 8vw, 42px); line-height: 1.03; }
.hero-panel p { max-width: 430px; margin: 0; color: var(--muted); line-height: 1.5; }
.hero-cards { position: absolute; right: 25px; bottom: 16px; width: 124px; height: 104px; opacity: .75; }
.hero-cards i { position: absolute; bottom: 0; left: 42px; width: 58px; aspect-ratio: var(--card-ratio); border-radius: 7px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); }
.hero-cards i:nth-child(1) { transform: rotate(-18deg) translateX(-25px); }
.hero-cards i:nth-child(3) { transform: rotate(18deg) translateX(25px); }
.dashboard-actions { display: grid; grid-template-columns: 1.35fr 1fr; gap: 12px; margin: 16px 0 25px; }
.action-card { min-height: 135px; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); text-align: left; cursor: pointer; }
.action-card.primary-action { background: rgba(239,201,103,.12); border-color: rgba(239,201,103,.24); }
.action-card .action-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--surface-strong); color: var(--accent); font-size: 25px; }
.action-card strong { display: block; margin-top: 14px; font-size: 17px; }
.action-card > span:last-child { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.35; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11px; }
.section-heading h2 { margin: 0; font-size: 17px; }
.section-heading span { color: var(--muted); font-size: 11px; }
.game-list { display: grid; gap: 10px; }
.game-row { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line); border-radius: 19px; background: rgba(0,0,0,.16); overflow: hidden; }
.game-open { min-width: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 13px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.game-avatar { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: #173128; background: var(--accent); font-weight: 950; }
.game-main { min-width: 0; }
.game-main strong, .game-main small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.game-main strong { font-size: 14px; }
.game-main em { color: var(--muted); font: italic 600 12px Georgia, serif; }
.game-main small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.status-pill { padding: 6px 9px; border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 10px; font-weight: 850; white-space: nowrap; }
.status-pill.waiting { color: #ffe6a0; background: rgba(239,201,103,.12); }
.status-pill.active { color: #b8f3d3; background: rgba(103,207,154,.12); }
.row-delete { width: 42px; border: 0; border-left: 1px solid var(--line); background: rgba(240,117,108,.08); color: #ffc8c4; font-size: 24px; cursor: pointer; }
.empty-state { padding: 25px 18px; border: 1px dashed var(--line); border-radius: 19px; color: var(--muted); text-align: center; font-size: 13px; }

/* Fenêtres */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; align-items: end; background: rgba(1,10,8,.7); backdrop-filter: blur(12px); opacity: 0; transition: opacity .18s ease; }
.modal-backdrop.visible { opacity: 1; }
.sheet { width: min(100%, 650px); max-height: calc(100dvh - var(--safe-top) - 10px); overflow-y: auto; margin: 0 auto; padding: 15px 20px calc(22px + var(--safe-bottom)); border-radius: 30px 30px 0 0; border: 1px solid var(--line); border-bottom: 0; background: #0b2e26; box-shadow: 0 -30px 90px rgba(0,0,0,.45); transform: translateY(18px); animation: sheet-in .28s cubic-bezier(.2,.8,.2,1) forwards; }
.sheet-handle { width: 48px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.2); margin: 0 auto 18px; }
.sheet h2 { margin: 0 0 7px; font-size: 27px; }
.sheet .lead { margin: 0 0 20px; color: var(--muted); line-height: 1.48; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 20px; }
@keyframes sheet-in { to { transform: translateY(0); } }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field > span, .number-setting > span, .select-setting > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.field input, .field select, .number-setting input, .select-setting input { width: 100%; min-height: 51px; border: 1px solid var(--line); border-radius: 15px; padding: 0 14px; color: var(--text); background: rgba(0,0,0,.18); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 22px, calc(100% - 12px) 22px; background-size: 6px 6px; background-repeat: no-repeat; }
.setting-block { margin: 7px 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 19px; background: rgba(0,0,0,.1); }
.setting-block legend { padding: 0 7px; color: var(--accent); font-size: 12px; font-weight: 900; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: grid; place-items: center; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); text-align: center; font-size: 12px; font-weight: 800; }
.segmented input:checked + span { color: #1b2d26; border-color: transparent; background: var(--accent); }
.number-setting, .select-setting { display: grid; grid-template-columns: 1fr 92px auto; align-items: center; gap: 10px; }
.number-setting input, .select-setting input { text-align: center; }
.select-setting small { color: var(--muted); }
.setting-note { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.pin-dots { display: flex; justify-content: center; gap: 11px; margin: 25px 0 16px; }
.pin-dot { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.36); border-radius: 50%; }
.pin-dot.filled { border-color: var(--accent); background: var(--accent); transform: scale(1.08); }
.pin-error { min-height: 22px; margin-bottom: 8px; color: #ffc0bb; text-align: center; font-size: 13px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.key { min-height: 59px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); font-size: 23px; cursor: pointer; }
.key.action { color: var(--muted); font-size: 14px; }
.pin-sheet .btn.full { margin-top: 12px; }
.success-badge { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%; color: #132b22; background: var(--green); font-size: 28px; font-weight: 950; }
.invitation-sheet { text-align: center; }
.invite-card { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: rgba(0,0,0,.16); text-align: left; }
.invite-card span { color: var(--muted); font-size: 11px; }
.invite-card div { margin-top: 5px; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
.invite-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.about-card { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.about-card strong, .about-card small { display: block; }
.about-card small { margin-top: 4px; color: var(--muted); }
.stop-word { color: var(--red); font: 950 56px/1 Georgia, serif; letter-spacing: .05em; }

/* Salle d'attente */
.waiting-screen { display: flex; flex-direction: column; }
.compact-topbar { min-height: 48px; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: #6a7773; box-shadow: 0 0 0 5px rgba(106,119,115,.1); }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 5px rgba(103,207,154,.1); }
.waiting-stage { flex: 1; display: grid; align-content: center; justify-items: center; text-align: center; padding: 22px 0; }
.waiting-deck { position: relative; width: 150px; height: 145px; margin-bottom: 20px; }
.waiting-deck .play-card { width: 92px; }
.waiting-deck .play-card.front { left: 29px; }
.waiting-stage h1 { margin: 12px 0 8px; font-size: clamp(30px, 8vw, 43px); }
.waiting-stage > p { max-width: 430px; margin: 0; color: var(--muted); line-height: 1.5; }
.players-ready { width: min(100%, 470px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 32px 0; }
.ready-player { min-width: 0; padding: 15px 8px; border: 1px solid var(--line); border-radius: 20px; background: rgba(0,0,0,.12); opacity: .55; }
.ready-player.online { opacity: 1; border-color: rgba(103,207,154,.28); }
.ready-player > span { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 9px; border-radius: 17px; color: #173128; background: var(--accent); font-weight: 950; }
.ready-player strong, .ready-player small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ready-player small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.ready-vs { color: var(--accent); font: italic 800 16px Georgia, serif; }
.waiting-actions { width: min(100%, 450px); display: grid; grid-template-columns: 1fr 1.5fr; gap: 10px; }

/* Table de jeu */
.game-layout { width: min(100%, 760px); min-height: 100dvh; margin: 0 auto; padding: calc(8px + var(--safe-top)) 10px calc(8px + var(--safe-bottom)); display: grid; grid-template-rows: auto minmax(92px, .9fr) minmax(235px, 2fr) minmax(108px, 1fr) auto; gap: 5px; overflow: hidden; }
.scoreboard { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 7px; min-height: 53px; }
.score-box { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 15px; background: rgba(0,0,0,.18); }
.score-box:last-child { text-align: right; }
.score-box.active { border-color: rgba(239,201,103,.55); box-shadow: inset 0 0 0 1px rgba(239,201,103,.1), 0 0 22px rgba(239,201,103,.08); }
.score-box span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 11px; font-weight: 750; }
.score-box span em { display: block; margin-top: 2px; color: var(--accent); font-size: 7px; font-style: normal; letter-spacing: .12em; }
.score-box strong { font-size: 22px; }
.round-counter { display: grid; place-content: center; justify-items: center; min-width: 82px; padding: 5px 7px; border-radius: 15px; background: rgba(239,201,103,.12); color: var(--accent); text-align: center; }
.round-counter span { font-size: 10px; font-weight: 900; }
.round-counter small { margin-top: 3px; font-size: 7px; letter-spacing: .08em; }
.player-zone { min-height: 0; display: grid; grid-template-rows: auto 1fr; align-items: center; padding: 4px 7px; border-radius: 19px; transition: background .2s ease, box-shadow .2s ease; }
.player-zone.active-zone { background: rgba(239,201,103,.045); box-shadow: inset 0 0 0 1px rgba(239,201,103,.08); }
.zone-label { display: flex; justify-content: space-between; align-items: baseline; padding: 0 3px 3px; }
.zone-label strong { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
.zone-label strong em { margin-left: 5px; color: var(--accent); font-size: 7px; font-style: normal; letter-spacing: .12em; }
.zone-label span { color: var(--muted); font-size: 9px; }
.hand-grid { min-width: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: clamp(3px, 1.1vw, 7px); }
.table-card { position: relative; flex: 0 0 auto; width: clamp(49px, 14.2vw, 76px); aspect-ratio: var(--card-ratio); padding: 0; border: 0; border-radius: clamp(6px, 2vw, 10px); background: transparent; perspective: 700px; cursor: pointer; transition: transform .18s ease, filter .18s ease; }
.opponent-card { width: clamp(43px, 12vw, 66px); }
.card-inner { position: absolute; inset: 0; border-radius: inherit; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.75,.2,1), opacity .32s ease, filter .32s ease; box-shadow: 0 8px 16px rgba(0,0,0,.3); }
.card-face { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; backface-visibility: hidden; }
.card-face img { width: 100%; height: 100%; object-fit: contain; }
.card-front { transform: rotateY(180deg); background: white; }
.table-card.revealed .card-inner { transform: rotateY(180deg); }
.table-card.selected { transform: translateY(-8px) scale(1.055); filter: drop-shadow(0 0 9px rgba(239,201,103,.75)); }
.table-card.selected::after { content: "✓"; position: absolute; right: -5px; top: -7px; z-index: 4; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; color: #132a22; background: var(--accent); font-size: 12px; font-weight: 950; }
.table-card:active { transform: scale(.96); }
.penalty-mark { position: absolute; right: -5px; bottom: -5px; z-index: 5; display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 4px; border-radius: 99px; color: white; background: var(--red); border: 2px solid var(--bg); font-size: 8px; font-weight: 950; }
.phase-initial_peek .own-card.hidden-card { animation: selectable 1.8s ease-in-out infinite; }
@keyframes selectable { 50% { translate: 0 -3px; } }

/* Pendant la mémorisation initiale, l'adversaire voit les deux positions consultées se vider. */
.table-card.initial-peek-away { cursor: default; pointer-events: none; }
.table-card.initial-peek-away .card-inner { opacity: 0; transform: translateY(-12px) scale(.72); filter: blur(2px); }
.table-card.initial-peek-away::before { content: ""; position: absolute; inset: 4px; border: 1px dashed rgba(239,201,103,.32); border-radius: inherit; animation: peek-slot-pulse 1.25s ease-in-out infinite; }
@keyframes peek-slot-pulse { 50% { border-color: rgba(239,201,103,.12); transform: scale(.94); } }

.table-center { min-height: 0; position: relative; display: grid; grid-template-rows: auto 1fr auto auto; align-items: center; justify-items: center; padding: 3px 0; }
.table-center::before { content: ""; position: absolute; inset: 4px 2px; z-index: -1; border: 1px solid rgba(255,255,255,.07); border-radius: 26px; background: radial-gradient(ellipse at center, rgba(31,91,73,.32), rgba(0,0,0,.12)); box-shadow: inset 0 10px 35px rgba(255,255,255,.025); }
.turn-banner { display: inline-flex; max-width: calc(100% - 20px); align-items: center; gap: 7px; min-height: 27px; padding: 5px 10px; border-radius: 99px; color: var(--muted); background: rgba(0,0,0,.2); font-size: 10px; }
.turn-banner strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.turn-light { width: 7px; height: 7px; border-radius: 50%; background: #6d7d78; }
.turn-banner.mine { color: #fff1c1; }
.turn-banner.mine .turn-light { background: var(--accent); box-shadow: 0 0 0 0 rgba(239,201,103,.6); animation: pulse-light 1.8s infinite; }
@keyframes pulse-light { 65% { box-shadow: 0 0 0 7px rgba(239,201,103,0); } }
.table-cards { width: min(100%, 385px); display: grid; grid-template-columns: 1fr 1.12fr 1fr; align-items: center; justify-items: center; gap: 8px; }
.pile { position: relative; width: clamp(63px, 19vw, 92px); aspect-ratio: var(--card-ratio); padding: 0; border: 0; border-radius: 10px; background: transparent; }
.pile[disabled] { opacity: 1; }
.pile small { position: absolute; right: -6px; bottom: -7px; z-index: 5; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border: 2px solid var(--bg); border-radius: 99px; color: #173128; background: var(--accent); font-size: 9px; font-weight: 950; }
.stack-card { position: absolute; inset: 0; border-radius: inherit; background: #f8f1df; box-shadow: 0 8px 17px rgba(0,0,0,.32); }
.stack-card.s3 { transform: translate(-4px,4px); opacity: .6; }
.stack-card.s2 { transform: translate(-2px,2px); opacity: .8; }
.stack-card.s1 { overflow: hidden; }
.stack-card img, .discard-pile > img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; box-shadow: 0 9px 20px rgba(0,0,0,.33); }
.pile.clickable { cursor: pointer; animation: pile-ready 1.65s ease-in-out infinite; }
.pile.clickable::after { content: ""; position: absolute; inset: -5px; border: 2px solid rgba(239,201,103,.45); border-radius: 14px; animation: ring 1.65s ease-out infinite; }
@keyframes pile-ready { 50% { transform: translateY(-5px); } }
@keyframes ring { 70%,100% { inset: -12px; opacity: 0; } }
.discard-pile.empty { display: grid; place-items: center; border: 1px dashed rgba(255,255,255,.18); color: var(--muted); text-align: center; font-size: 9px; }
.held-space { min-height: 122px; display: grid; place-items: center; }
.table-logo { color: rgba(239,201,103,.13); font: 900 69px Georgia, serif; }
.held-card { position: relative; width: clamp(72px, 22vw, 104px); animation: held-in .42s cubic-bezier(.2,.85,.2,1) both; }
.held-card img { width: 100%; aspect-ratio: var(--card-ratio); border-radius: 11px; object-fit: contain; box-shadow: 0 14px 30px rgba(0,0,0,.38); }
.held-card span { position: absolute; left: 50%; bottom: -18px; translate: -50% 0; width: max-content; max-width: 150px; color: var(--muted); font-size: 8px; text-align: center; }
.held-card.secret { opacity: .85; }
@keyframes held-in { from { transform: translateY(-22px) rotate(-7deg) scale(.8); opacity: 0; } }
.context-panel { max-width: calc(100% - 18px); min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 14px; background: rgba(6,30,24,.9); text-align: center; }
.context-panel strong { font-size: 11px; }
.context-panel p { margin: 2px 0 0; color: var(--muted); font-size: 8px; }
.action-panel { display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 310px); }
.action-panel .btn { font-size: 11px; }
.active-choice { box-shadow: 0 0 0 2px rgba(239,201,103,.35); }
.waiting-context { color: var(--muted); font-size: 10px; }
.mini-spinner { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stop-panel { width: min(100%, 410px); display: grid; grid-template-columns: 1fr auto auto; text-align: left; }
.stop-panel .btn { font-size: 10px; }
.power-panel { justify-content: flex-start; width: min(100%, 430px); text-align: left; }
.power-copy { flex: 1 1 145px; min-width: 0; }
.power-panel .power-skip { flex: 0 0 auto; min-height: 34px; padding-inline: 10px; font-size: 9px; white-space: nowrap; }
.power-letter { display: grid; place-items: center; flex: 0 0 auto; width: 31px; height: 38px; border-radius: 6px; color: #b84742; background: white; font: 900 22px Georgia, serif; }
.event-line { min-height: 13px; max-width: calc(100% - 30px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: rgba(255,255,255,.38); font-size: 8px; }
.result-panel { width: min(100%, 430px); padding: 11px 14px; border: 1px solid rgba(103,207,154,.25); border-radius: 18px; background: rgba(9,48,38,.96); box-shadow: var(--shadow); text-align: center; }
.result-panel.failed { border-color: rgba(240,117,108,.32); }
.result-icon { display: grid; place-items: center; width: 31px; height: 31px; margin: -25px auto 3px; border-radius: 50%; color: #163126; background: var(--green); border: 3px solid var(--bg); font-size: 20px; font-weight: 950; }
.result-panel.failed .result-icon { color: white; background: var(--red); }
.result-panel h2 { margin: 0; font-size: 19px; }
.result-panel > p { margin: 3px 0 6px; color: var(--muted); font-size: 9px; }
.round-score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.round-score-grid > div { padding: 6px; border-radius: 11px; background: rgba(0,0,0,.14); }
.round-score-grid span, .round-score-grid small { display: block; color: var(--muted); font-size: 8px; }
.round-score-grid strong { display: block; margin: 1px 0; color: var(--accent); font-size: 19px; }
.next-starter { font-size: 8px !important; }
.result-panel .btn { min-height: 36px; font-size: 10px; }
.final-result .trophy { color: var(--accent); font-size: 28px; }
.final-result .eyebrow { margin-top: 2px; font-size: 7px; }
.final-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.final-scores div { padding: 7px; border-radius: 11px; background: rgba(0,0,0,.15); }
.final-scores span { display: block; color: var(--muted); font-size: 8px; }
.final-scores strong { font-size: 20px; }
.game-actions { min-height: 35px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; }
.admin-peek, .fullscreen-toggle { width: 35px; height: 35px; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface); }
.fullscreen-toggle { display: grid; place-items: center; font-size: 20px; line-height: 1; }
.fullscreen-toggle span { display: block; transform: translateY(-1px); }
.fullscreen-toggle.active { color: var(--accent); border-color: rgba(239,201,103,.38); background: rgba(239,201,103,.08); }

/* Révélations privées et effets */
.reveal-overlay { width: min(100%, 650px); min-height: 100dvh; margin: 0 auto; padding: calc(25px + var(--safe-top)) 20px calc(22px + var(--safe-bottom)); display: grid; align-content: center; justify-items: center; text-align: center; background: radial-gradient(circle at 50% 35%, #164d3f, #071f1a 58%); }
.reveal-lock { padding: 7px 11px; border: 1px solid rgba(239,201,103,.25); border-radius: 99px; color: var(--accent); font-size: 9px; font-weight: 900; letter-spacing: .13em; }
.reveal-overlay h2 { margin: 17px 0 5px; font-size: 31px; }
.reveal-overlay > p { max-width: 410px; margin: 0 0 24px; color: var(--muted); line-height: 1.45; }
.reveal-cards { display: flex; justify-content: center; gap: 15px; margin-bottom: 28px; }
.reveal-card { width: min(37vw, 165px); animation: reveal-pop .55s var(--delay) cubic-bezier(.2,.8,.2,1) both; }
.reveal-card > div { position: relative; aspect-ratio: var(--card-ratio); perspective: 1000px; transform-style: preserve-3d; animation: private-flip .8s calc(var(--delay) + .28s) cubic-bezier(.2,.8,.2,1) both; }
.reveal-card > div span { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 45px rgba(0,0,0,.36); }
.reveal-card > div span:last-child { transform: rotateY(180deg); }
.reveal-card img { width: 100%; height: 100%; object-fit: contain; }
.reveal-card strong, .reveal-card small { display: block; }
.reveal-card strong { margin-top: 12px; font-size: 13px; }
.reveal-card small { margin-top: 3px; color: var(--accent); font-size: 11px; }
.reveal-overlay .btn { width: min(100%, 350px); }
@keyframes reveal-pop { from { transform: translateY(30px) scale(.82); opacity: 0; } }
@keyframes private-flip { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
.fx-layer { position: fixed; inset: 0; z-index: 300; pointer-events: none; overflow: hidden; }
.flying-card { position: fixed; z-index: 301; object-fit: contain; border-radius: 9px; box-shadow: 0 16px 35px rgba(0,0,0,.4); will-change: transform, opacity; }
.flash-feedback { position: fixed; inset: 0; z-index: 350; display: grid; place-content: center; justify-items: center; gap: 10px; color: white; background: rgba(2,16,12,.7); backdrop-filter: blur(7px); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.flash-feedback.show { opacity: 1; }
.flash-feedback strong { display: grid; place-items: center; width: 95px; height: 95px; border-radius: 50%; color: #163126; background: var(--green); font-size: 64px; box-shadow: 0 0 0 12px rgba(103,207,154,.12); transform: scale(.6); animation: feedback-pop .35s cubic-bezier(.2,.85,.2,1) forwards; }
.flash-feedback.failure strong { color: white; background: var(--red); box-shadow: 0 0 0 12px rgba(240,117,108,.12); }
.flash-feedback span { font-size: 19px; font-weight: 900; }
@keyframes feedback-pop { to { transform: scale(1); } }
.toast { position: fixed; left: 50%; bottom: calc(18px + var(--safe-bottom)); z-index: 500; max-width: calc(100% - 30px); padding: 11px 15px; border-radius: 13px; color: #173128; background: #fff8e7; box-shadow: var(--shadow); font-size: 12px; font-weight: 850; text-align: center; opacity: 0; transform: translate(-50%, 25px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.error-box { padding: 15px; border: 1px solid rgba(240,117,108,.35); border-radius: 16px; color: #ffd1cd; background: rgba(240,117,108,.13); }
.is-busy button { pointer-events: none; }

/* View Transitions */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

@media (min-width: 700px) {
  .modal-backdrop { align-items: center; padding: 22px; }
  .sheet { border-radius: 30px; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
  .game-layout { grid-template-rows: auto minmax(125px, .9fr) minmax(310px, 2fr) minmax(145px, 1fr) auto; padding-left: 20px; padding-right: 20px; }
  .table-card { width: 82px; }
  .opponent-card { width: 72px; }
  .pile { width: 104px; }
  .held-card { width: 118px; }
  .context-panel strong { font-size: 13px; }
  .context-panel p { font-size: 10px; }
  .event-line { font-size: 10px; }
}

@media (max-width: 520px) {
  .hero-cards { opacity: .3; right: -8px; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .dashboard-actions { grid-template-columns: 1fr 1fr; }
  .game-open { grid-template-columns: auto minmax(0,1fr); }
  .game-open .status-pill { grid-column: 2; justify-self: start; }
}

@media (max-width: 370px) {
  .screen { padding-left: 13px; padding-right: 13px; }
  .dashboard-actions { grid-template-columns: 1fr; }
  .action-card { min-height: 105px; }
  .game-layout { padding-left: 5px; padding-right: 5px; }
  .score-box { padding: 6px 7px; }
  .round-counter { min-width: 72px; }
  .table-card { width: 46px; }
  .opponent-card { width: 40px; }
  .pile { width: 58px; }
  .held-card { width: 67px; }
  .held-space { min-height: 108px; }
  .context-panel { padding: 6px 8px; }
}

@media (max-height: 680px) {
  .game-layout { grid-template-rows: auto minmax(78px,.75fr) minmax(210px,2fr) minmax(88px,.85fr) auto; }
  .table-card { width: clamp(42px, 12vw, 65px); }
  .opponent-card { width: clamp(38px, 10.5vw, 57px); }
  .pile { width: clamp(55px, 16vw, 78px); }
  .held-card { width: clamp(62px, 18vw, 88px); }
  .held-space { min-height: 100px; }
  .context-panel { min-height: 36px; }
  .result-panel { transform: scale(.9); }
}


/* v0.2.3 — mémorisation initiale visible dans les deux sens */
.game-layout { height: 100dvh; grid-template-rows: auto minmax(64px, .45fr) minmax(225px, 1.45fr) minmax(150px, 1fr) auto; }
.zone-label .card-total { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.zone-label .card-total b { color: var(--accent); font-size: 14px; line-height: 1; }

.opponent-zone { padding-top: 2px; padding-bottom: 2px; }
.opponent-hand { display: grid; grid-template-columns: repeat(4, max-content); align-content: center; justify-content: center; gap: 3px; }
.opponent-card { width: clamp(31px, 9vw, 40px); }

.own-zone { padding-bottom: 7px; }
.own-hand { display: grid; grid-template-columns: repeat(2, max-content); align-content: center; justify-content: center; gap: 5px 9px; }
.own-card { width: clamp(52px, 15.5vw, 68px); }
.own-hand.expanded-hand { grid-template-columns: repeat(2, max-content); gap: 4px 7px; }
.own-hand.expanded-hand .own-card { width: clamp(42px, 12.2vw, 55px); }
.opponent-hand.expanded-hand { grid-template-columns: repeat(4, max-content); }
.opponent-hand.expanded-hand .opponent-card { width: clamp(25px, 6.9vw, 31px); }

.card-face img,
.stack-card img,
.discard-pile > img,
.held-card img,
.reveal-card img { object-fit: contain; }
.card-front,
.card-back { background: transparent; }

@media (min-width: 900px) and (min-height: 620px) {
  .game-layout {
    width: min(100%, 1180px);
    height: 100dvh;
    min-height: 100dvh;
    grid-template-columns: minmax(250px, 1fr) minmax(330px, 420px) minmax(210px, .78fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "scores scores scores"
      "own table opponent"
      "actions actions actions";
    gap: 12px 18px;
    padding: calc(12px + var(--safe-top)) 22px calc(12px + var(--safe-bottom));
    overflow: hidden;
  }
  .scoreboard { grid-area: scores; }
  .own-zone { grid-area: own; }
  .table-center { grid-area: table; }
  .opponent-zone { grid-area: opponent; }
  .game-actions { grid-area: actions; }

  .player-zone {
    align-self: stretch;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.075);
    background: rgba(0,0,0,.10);
  }
  .zone-label { width: 100%; padding-bottom: 10px; }
  .zone-label strong { font-size: 13px; }
  .zone-label span { font-size: 10px; }
  .zone-label .card-total b { font-size: 18px; }

  .own-hand { grid-template-columns: repeat(2, max-content); gap: 10px 14px; }
  .own-card { width: clamp(88px, 8.3vw, 112px); }
  .own-hand.expanded-hand { grid-template-columns: repeat(2, max-content); gap: 8px 10px; }
  .own-hand.expanded-hand .own-card { width: clamp(65px, 6vw, 82px); }

  .opponent-hand { grid-template-columns: repeat(2, max-content); gap: 7px; }
  .opponent-card { width: clamp(48px, 4.8vw, 64px); }
  .opponent-hand.expanded-hand { grid-template-columns: repeat(2, max-content); }
  .opponent-hand.expanded-hand .opponent-card { width: clamp(39px, 3.9vw, 51px); }

  .table-center { min-width: 0; padding: 12px 4px; }
  .table-cards { width: min(100%, 400px); }
  .pile { width: 100px; }
  .held-card { width: 114px; }
  .context-panel { max-width: 100%; }
}

@media (max-width: 370px), (max-height: 680px) {
  .game-layout { grid-template-rows: auto minmax(54px, .38fr) minmax(205px, 1.42fr) minmax(130px, .92fr) auto; }
  .opponent-card { width: 29px; }
  .own-card { width: 47px; }
  .own-hand { gap: 4px 7px; }
  .own-hand.expanded-hand .own-card { width: 39px; }
  .opponent-hand.expanded-hand .opponent-card { width: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}


/* v0.2.4 — les cartes conservent leur emplacement après une défausse. */
.empty-card-slot {
  visibility: hidden;
  pointer-events: none;
  cursor: default;
}

/* Les grilles gardent une structure fixe : 2 colonnes pour soi, compacte pour l'adversaire. */
.own-hand,
.own-hand.expanded-hand { grid-template-columns: repeat(2, max-content); }
.opponent-hand,
.opponent-hand.expanded-hand { grid-template-columns: repeat(4, max-content); }

@media (min-width: 900px) and (min-height: 620px) {
  .own-hand,
  .own-hand.expanded-hand,
  .opponent-hand,
  .opponent-hand.expanded-hand { grid-template-columns: repeat(2, max-content); }
}


/* v0.2.5 — actions directes et double-clic de défausse */
.table-card { touch-action: manipulation; }
.direct-action-panel { width: min(100%, 390px); }
.holding-card .own-card:not(.empty-card-slot) { filter: drop-shadow(0 0 7px rgba(239,201,103,.28)); }
.holding-card .own-card:not(.empty-card-slot)::before { content: ""; position: absolute; inset: -4px; border: 1px solid rgba(239,201,103,.42); border-radius: 12px; animation: exchange-target-pulse 1.4s ease-in-out infinite; }
.discard-pile.discard-target::before { content: "JETER"; position: absolute; left: 50%; top: -23px; translate: -50% 0; z-index: 8; padding: 3px 7px; border-radius: 99px; color: #173128; background: var(--accent); font-size: 7px; font-weight: 950; letter-spacing: .08em; }
@keyframes exchange-target-pulse { 50% { opacity: .35; transform: scale(1.04); } }
.double-click-hint { min-height: 34px; display: flex; align-items: center; justify-content: center; padding: 5px 10px; border: 1px solid rgba(239,201,103,.18); border-radius: 13px; color: #ffe5a0; background: rgba(239,201,103,.06); font-size: 9px; font-weight: 750; text-align: center; }
.double-click-hint span { margin-right: 6px; color: var(--accent); font-size: 13px; }
.stop-panel.stop-locked { grid-template-columns: 1fr auto auto; border-color: rgba(255,255,255,.08); }
.stop-panel .btn[disabled] { opacity: .38; filter: grayscale(.4); cursor: not-allowed; }

/* v0.3.0 — fin de tour, sons et pouvoirs synchronisés */
.sound-toggle {
  position: fixed;
  top: calc(8px + var(--safe-top));
  right: 8px;
  z-index: 460;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  color: white;
  background: rgba(4,24,20,.82);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  backdrop-filter: blur(12px);
  font-size: 17px;
  cursor: pointer;
}
.sound-toggle.enabled { border-color: rgba(239,201,103,.42); background: rgba(17,65,53,.92); }
.sound-toggle:active { transform: scale(.92); }

.turn-end-backdrop {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: calc(88px + var(--safe-top)) 16px calc(20px + var(--safe-bottom));
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,8,7,.62), rgba(0,8,7,.12) 52%, transparent 76%);
  animation: turn-end-fade .2s ease both;
}
.turn-end-backdrop.waiting { background: linear-gradient(180deg, rgba(0,8,7,.38), transparent 60%); }
.turn-end-window {
  pointer-events: auto;
  width: min(92vw, 520px);
  padding: 25px 22px 22px;
  border: 1px solid rgba(239,201,103,.34);
  border-radius: 25px;
  text-align: center;
  color: white;
  background: linear-gradient(145deg, rgba(17,69,56,.98), rgba(5,30,25,.98));
  box-shadow: 0 25px 70px rgba(0,0,0,.48), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
  animation: turn-end-pop .26s cubic-bezier(.2,.85,.2,1) both;
}
.turn-end-window > small {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .18em;
}
.turn-end-window h2 { margin: 0 0 8px; font-size: clamp(25px, 7vw, 38px); line-height: 1; }
.turn-end-window p { margin: 0 auto 20px; max-width: 420px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.turn-end-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.turn-choice { min-height: 56px; font-size: 15px; font-weight: 950; }
.turn-end-window.waiting {
  width: min(88vw, 450px);
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 20px;
  text-align: left;
  border-color: rgba(255,255,255,.12);
}
.turn-end-window.waiting h2 { font-size: 20px; }
.turn-end-window.waiting p { margin: 5px 0 0; font-size: 10px; }
.turn-end-window.waiting .mini-spinner { flex: 0 0 auto; width: 23px; height: 23px; }
@keyframes turn-end-fade { from { opacity: 0; } }
@keyframes turn-end-pop { from { opacity: 0; transform: translateY(-18px) scale(.94); } }

.phase-jack_reveal .table-card.initial-peek-away,
.phase-queen_power .table-card.initial-peek-away {
  filter: drop-shadow(0 0 8px rgba(239,201,103,.12));
}

@media (min-width: 900px) {
  .sound-toggle { top: calc(14px + var(--safe-top)); right: 18px; width: 42px; height: 42px; }
  .turn-end-backdrop { align-items: center; padding-top: calc(20px + var(--safe-top)); }
  .turn-end-window { padding: 32px 34px 28px; }
}

@media (max-height: 650px) {
  .turn-end-backdrop { padding-top: calc(58px + var(--safe-top)); }
  .turn-end-window { padding: 17px 18px 15px; }
  .turn-end-window h2 { font-size: 24px; }
  .turn-end-window p { margin-bottom: 12px; }
  .turn-choice { min-height: 47px; }
}

/* v0.3.1 — validation de fin de manche, panneau compact et cartes sans masque CSS */
.table-center {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  row-gap: 4px;
}

.decision-panel {
  width: min(calc(100% - 16px), 430px);
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(239,201,103,.32);
  border-radius: 14px;
  color: white;
  background: linear-gradient(145deg, rgba(17,69,56,.97), rgba(5,30,25,.97));
  box-shadow: 0 10px 28px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.06);
  animation: decision-in .22s cubic-bezier(.2,.85,.2,1) both;
}
.decision-panel.waiting { grid-template-columns: auto minmax(0, 1fr); border-color: rgba(255,255,255,.12); }
.decision-panel small { display: block; margin-bottom: 2px; color: var(--accent); font-size: 7px; font-weight: 950; letter-spacing: .14em; }
.decision-panel strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
.decision-panel p { margin: 2px 0 0; color: var(--muted); font-size: 7px; line-height: 1.3; }
.decision-actions { display: grid; grid-template-columns: auto auto; gap: 6px; }
.decision-actions .btn, .decision-panel > .btn { min-height: 36px; padding: 7px 11px; border-radius: 11px; font-size: 9px; }
.round-closing-panel { grid-template-columns: minmax(0, 1fr) auto auto; }
.round-ready-status { display: grid; gap: 2px; min-width: 74px; }
.round-ready-status span { padding: 2px 5px; border-radius: 7px; color: var(--muted); background: rgba(0,0,0,.16); font-size: 7px; white-space: nowrap; }
.round-ready-status span.ready { color: #baf5d4; background: rgba(103,207,154,.12); }
.decision-panel .btn[disabled] { opacity: .5; cursor: default; }
@keyframes decision-in { from { opacity: 0; transform: translateY(-7px) scale(.97); } }

/* Les images possèdent déjà leur propre silhouette arrondie et transparente. */
.table-card,
.card-inner,
.card-face,
.card-face img,
.pile,
.stack-card,
.stack-card img,
.discard-pile > img,
.held-card img,
.reveal-card > div span,
.flying-card {
  border-radius: 0 !important;
}
.card-inner,
.card-face,
.stack-card.s1,
.reveal-card > div span { overflow: visible !important; }
.card-inner { box-shadow: none; }
.card-face img,
.stack-card img,
.discard-pile > img,
.held-card img,
.reveal-card img,
.flying-card {
  box-shadow: none !important;
  filter: drop-shadow(0 9px 12px rgba(0,0,0,.32));
}
.card-front { background: transparent !important; }

/* L'ancien bouton son et l'ancien grand voile de fin de tour ne sont plus utilisés. */
.sound-toggle,
.turn-end-backdrop { display: none !important; }

@media (max-width: 430px) {
  .decision-panel { width: min(calc(100% - 10px), 390px); }
  .round-closing-panel { grid-template-columns: minmax(0, 1fr) auto; }
  .round-closing-panel .round-ready-status { display: none; }
  .decision-panel p { max-width: 225px; }
}

@media (max-height: 700px) {
  .decision-panel { min-height: 42px; padding-block: 5px; }
  .decision-panel p { display: none; }
  .decision-actions .btn, .decision-panel > .btn { min-height: 32px; padding-block: 5px; }
}

/* v0.3.2 — les coups adverses sont rejoués intégralement avant les choix de fin de tour. */
body.is-busy .decision-panel,
body.is-remote-animating .decision-panel {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.remote-action-target {
  z-index: 4;
  animation: remote-target-pulse 360ms ease-in-out 1;
}

@keyframes remote-target-pulse {
  0%, 100% { transform: scale(1); filter: none; }
  48% { transform: scale(1.08); filter: drop-shadow(0 0 12px rgba(255,255,255,.8)); }
}


/* v0.3.3 — panneau de décision plus lisible et annonce Stop bloquante. */
.decision-panel {
  width: min(calc(100% - 12px), 470px);
  min-height: 56px;
  gap: 10px;
  padding: 9px 11px;
}
.decision-panel small { font-size: 8px; }
.decision-panel strong { font-size: 12px; }
.decision-panel p { font-size: 8px; }
.decision-actions { gap: 8px; }
.decision-actions .btn,
.decision-panel > .btn {
  min-height: 41px;
  padding: 8px 14px;
  font-size: 10px;
}

.stop-announcement-backdrop {
  position: fixed;
  inset: 0;
  z-index: 720;
  display: grid;
  place-items: center;
  padding: calc(20px + var(--safe-top)) 18px calc(20px + var(--safe-bottom));
  background: rgba(0, 13, 11, .78);
  backdrop-filter: blur(8px);
  animation: stop-notice-fade .2s ease both;
}
.stop-announcement-window {
  width: min(92vw, 470px);
  padding: 26px 22px 22px;
  border: 1px solid rgba(240, 113, 104, .58);
  border-radius: 22px;
  text-align: center;
  color: white;
  background: linear-gradient(145deg, rgba(73, 24, 22, .98), rgba(23, 19, 17, .99));
  box-shadow: 0 28px 80px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.08);
  animation: stop-notice-pop .28s cubic-bezier(.2,.85,.2,1) both;
}
.stop-announcement-icon {
  display: inline-grid;
  place-items: center;
  min-width: 92px;
  min-height: 42px;
  margin-bottom: 15px;
  padding: 7px 18px;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 10px;
  color: white;
  background: var(--red);
  font: 950 22px/1 Georgia, serif;
  letter-spacing: .09em;
  transform: rotate(-2deg);
}
.stop-announcement-window h2 {
  margin: 0 0 9px;
  font-size: clamp(25px, 7vw, 36px);
  line-height: 1.05;
}
.stop-announcement-window p {
  margin: 0 0 21px;
  color: rgba(255,255,255,.78);
  font-size: 15px;
}
.stop-announcement-ok {
  width: min(100%, 250px);
  min-height: 54px;
  font-size: 16px;
}
@keyframes stop-notice-fade { from { opacity: 0; } }
@keyframes stop-notice-pop { from { opacity: 0; transform: translateY(16px) scale(.94); } }

@media (max-width: 430px) {
  .decision-panel {
    width: min(calc(100% - 8px), 410px);
    min-height: 52px;
    padding: 8px 9px;
  }
  .decision-actions .btn,
  .decision-panel > .btn { padding-inline: 11px; }
}

@media (max-height: 700px) {
  .decision-panel { min-height: 48px; padding-block: 7px; }
  .decision-actions .btn,
  .decision-panel > .btn { min-height: 37px; padding-block: 7px; }
  .stop-announcement-window { padding: 19px 18px 17px; }
  .stop-announcement-icon { margin-bottom: 10px; }
  .stop-announcement-window p { margin-bottom: 14px; }
}


/* v0.3.4 — lancement de la manche suivante validé par les deux joueurs. */
.next-round-ready-status {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 7px 0 6px;
}
.next-round-ready-status span {
  min-width: 82px;
  padding: 4px 8px;
  border-radius: 9px;
  color: var(--muted);
  background: rgba(0,0,0,.18);
  font-size: 8px;
  white-space: nowrap;
}
.next-round-ready-status span.ready {
  color: #baf5d4;
  background: rgba(103,207,154,.13);
}
.result-panel [data-next-round][disabled] {
  opacity: .68;
  cursor: wait;
}


/* v0.3.5 — table centrale stable, gestes système neutralisés et révélations privées isolées. */
.game-layout,
.game-layout * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.game-layout button,
.game-layout [role="button"] {
  touch-action: manipulation;
}
.game-layout img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

/* Les zones de notification conservent toujours la même hauteur : le talon et la défausse ne bougent plus. */
.table-center {
  grid-template-rows: 28px 64px minmax(112px, 1fr) 54px 14px;
  row-gap: 4px;
}
.decision-slot,
.context-slot {
  width: 100%;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: visible;
}
.decision-slot { height: 64px; }
.context-slot { height: 54px; }
.table-cards {
  align-self: center;
  min-height: 112px;
}
.decision-slot:empty,
.context-slot:empty { pointer-events: none; }

/* Les résultats peuvent reprendre davantage de hauteur, sans incidence pendant le jeu. */
.phase-round_end .table-center,
.phase-game_over .table-center {
  grid-template-rows: 28px 0 minmax(82px, .65fr) minmax(150px, 1.35fr) 14px;
}
.phase-round_end .decision-slot,
.phase-game_over .decision-slot { height: 0; }
.phase-round_end .context-slot,
.phase-game_over .context-slot {
  height: auto;
  min-height: 150px;
  align-self: stretch;
}

/* Aucun rafraîchissement visuel de la table sous une révélation privée. */
body.private-reveal-open .app-shell {
  contain: paint;
}

@media (max-height: 700px) {
  .table-center {
    grid-template-rows: 26px 54px minmax(96px, 1fr) 42px 12px;
    row-gap: 2px;
  }
  .decision-slot { height: 54px; }
  .context-slot { height: 42px; }
  .table-cards { min-height: 96px; }
}

@media (min-width: 900px) and (min-height: 620px) {
  .table-center {
    grid-template-rows: 30px 70px minmax(155px, 1fr) 58px 16px;
  }
  .decision-slot { height: 70px; }
  .context-slot { height: 58px; }
  .table-cards { min-height: 155px; }
}


/* v0.3.6 — commande plein écran en bas à gauche. */
