:root {
  color-scheme: dark;
  --ink: #edf4ed;
  --muted: #a0b4aa;
  --green: #62d4ad;
  --gold: #e4c483;
  --paper: #0b1917;
  --panel: #142622;
  --border: #ffffff12;
  --error: #ffc2ae;
  --card-paper: #fffaf0;
  --court-fill: #d8b571;
  font-family: "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 25% 36%, #193a2d80, transparent 60%), var(--paper);
  color: var(--ink);
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
[hidden] { display: none !important; }
.shell { max-width: 1350px; margin: auto; padding: 0 46px; }
.site-header {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 2px;
  line-height: 1.1;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 37px;
  height: 45px;
  border: 1px solid #e4c48366;
  border-radius: 7px;
  background: linear-gradient(135deg, #294638, #142c22);
  color: var(--gold);
  font-size: 29px;
  transform: rotate(-8deg);
}
.brand-subtitle { display: block; margin-top: 6px; font-size: 8px; font-weight: 500; letter-spacing: 5px; color: var(--muted); }
.header-detail { display: flex; align-items: center; gap: 28px; }
.header-tagline { font-size: 12px; color: var(--muted); }
.prototype-badge { display: flex; align-items: center; gap: 8px; font-size: 10px; color: #aebeb4; }
.prototype-badge > span { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px #62d4ad55; }
.welcome { display: grid; grid-template-columns: 1.1fr 1fr; gap: 72px; align-items: center; min-height: min(710px, calc(100vh - 160px)); padding: 48px 36px 42px; }
.eyebrow, .panel-eyebrow { font-size: 10px; font-weight: 650; letter-spacing: 2.1px; line-height: 1.6; color: var(--gold); margin: 0 0 22px; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow-line { width: 24px; height: 1px; background: var(--gold); }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(48px, 5.4vw, 72px); line-height: 1.05; letter-spacing: -2.8px; margin: 0 0 22px; }
h1 em { color: var(--gold); font-weight: 400; }
.intro-copy { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 0; max-width: 370px; }
.small-note { display: flex; align-items: center; gap: 13px; font-size: 11px; color: var(--muted); margin: 21px 0 0; }
.small-note > span:not(.feature-dot) { color: #72897c; }
.feature-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.card-fan { position: relative; width: 310px; height: 235px; margin: 25px 0 0 0; }
.fan-glow { position: absolute; inset: 6px -30px 5px -40px; background: radial-gradient(ellipse, #5b986326, transparent 67%); }
.playing-card {
  position: absolute;
  top: 17px;
  width: 111px;
  height: 157px;
  padding: 10px;
  background: linear-gradient(125deg, #fffdf6, #eee8d8);
  border: 1px solid #fff8e5;
  border-radius: 9px;
  box-shadow: 0 10px 30px #0007, inset 0 0 0 3px #ffffff88;
  color: #193b32;
}
.playing-card b, .playing-card small { position: absolute; top: 8px; left: 8px; font: 700 20px/1 Georgia, serif; text-align: center; }
.playing-card b > span, .playing-card small > span { display: block; font-size: 17px; margin-top: 2px; }
.playing-card small { left: auto; top: auto; right: 8px; bottom: 8px; transform: rotate(180deg); }
.card-one { left: 22px; transform: rotate(-20deg); }
.card-two { left: 97px; top: 2px; transform: rotate(-2deg); color: #b4423f; }
.card-three { left: 168px; transform: rotate(16deg); }
.decorative-court { position: absolute; inset: 24px 26px; display: grid; place-items: center; border: 1px solid #cbb278; background: repeating-linear-gradient(45deg, #c3a1641a 0 3px, transparent 3px 10px); border-radius: 30% 30% 8% 8%; font-size: 47px; }
.decorative-pips { position: absolute; inset: 25px 26px; text-align: center; font: 18px/1.13 Georgia, serif; }
.decorative-ace { position: absolute; inset: 0; display: grid; place-items: center; font: 76px Georgia, serif; }
.fan-caption { position: absolute; bottom: 9px; left: 33px; font-size: 8px; letter-spacing: 2px; color: #789789; }
.entry-panel { background: linear-gradient(145deg, #1b302be8, #11241ee8); border: 1px solid #b7d2b61c; border-radius: 21px; padding: 12px 30px 25px; box-shadow: 0 25px 70px #0003, inset 0 1px #ffffff05; }
.entry-tabs { display: flex; gap: 4px; margin: 0 -18px 30px; padding: 5px; border-radius: 12px; background: #081a14a8; }
.entry-tab { flex: 1; border: 0; border-radius: 8px; background: transparent; color: #9cb2a5; padding: 13px 5px; font-size: 12px; font-weight: 600; transition: background .18s, color .18s; }
.entry-tab:hover { color: var(--ink); }
.entry-tab.active { background: #2b4438; color: #f1ead7; box-shadow: 0 3px 7px #0002, inset 0 1px #ffffff0b; }
.panel-eyebrow { font-size: 9px; letter-spacing: 1.7px; margin-bottom: 10px; }
h2 { font: 400 29px/1.2 Georgia, "Times New Roman", serif; letter-spacing: -.7px; margin: 0 0 14px; }
.panel-copy { color: var(--muted); font-size: 13px; line-height: 1.75; margin: 0 0 25px; }
label { display: block; font-weight: 600; font-size: 11px; margin: 0 0 8px; color: #c8d6cb; }
input { width: 100%; min-width: 0; border: 1px solid #bac8b426; border-radius: 9px; background: #0d1e19a8; color: var(--ink); padding: 14px; font-size: 16px; margin: 0 0 18px; transition: border-color .18s, background .18s; }
input:hover { border-color: #bbcbae55; }
input::placeholder { color: #738d7e; }
.code-input { text-transform: uppercase; letter-spacing: 4px; }
.button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; border: 1px solid transparent; border-radius: 9px; min-height: 46px; padding: 13px 14px; font-size: 12px; font-weight: 650; transition: background .18s, transform .18s, box-shadow .18s; }
.button:active:enabled { transform: translateY(1px); }
.button-primary { background: linear-gradient(130deg, #e7cc92, #d8b46d); color: #243221; border-color: #f6dfa85e; box-shadow: 0 5px 18px #0002; }
.button-primary:hover:enabled { background: linear-gradient(130deg, #f1dca9, #e8c783); box-shadow: 0 5px 25px #c6a65c22; }
.button-primary span { font-size: 20px; line-height: 1; }
.button-secondary { background: #ffffff05; border-color: #b2c7b52e; color: #d3dfd3; }
.button-secondary:hover:enabled { background: #ffffff0d; border-color: #c7d5bf55; }
.button-quiet { min-height: 38px; padding: 10px; margin-top: 4px; color: #9eb4a4; background: transparent; border: 0; font-weight: 500; font-size: 11px; }
.button-quiet:hover:enabled { color: #e3eade; background: #ffffff06; }
.entry-footnote { border-top: 1px solid var(--border); padding-top: 18px; margin: 25px 0 0; text-align: center; color: #8ca693; font-size: 10px; line-height: 1.5; }
.entry-footnote span { color: var(--gold); margin-right: 6px; font-size: 14px; }
.solo-limit { color: #91aa99; font-size: 10px; line-height: 1.6; margin: 14px 0 0; }
.message { padding: 11px; border: 1px solid #efb39730; border-radius: 8px; background: #813e2926; color: var(--error); font-size: 12px; line-height: 1.6; margin: 14px 0 0; overflow-wrap: anywhere; }
.site-footer { display: flex; justify-content: space-between; gap: 25px; padding: 22px 0; border-top: 1px solid var(--border); color: #7c9585; font-size: 10px; line-height: 1.7; }
.site-footer > p { margin: 0; }
.site-footer > p > span { margin-right: 8px; color: #acb68a; }
.site-footer details { max-width: 480px; text-align: right; }
.site-footer details p { margin: 10px 0 0; }
summary { cursor: pointer; }
.loading { min-height: 450px; display: flex; justify-content: center; align-items: center; gap: 14px; color: var(--muted); }
.spinner { height: 22px; width: 22px; border: 2px solid #526a582d; border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* The game is a single table, with private cards in the foreground. */
body.in-room { background: radial-gradient(ellipse at 40% 45%, #14332690, transparent 66%), #0a1714; }
.in-room .site-header { height: 72px; }
.in-room .site-footer { display: none; }
.room { padding: 24px 0 20px; }
.room-heading { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 23px; }
.room-heading .eyebrow { font-size: 8px; letter-spacing: 2.2px; margin-bottom: 5px; color: #91ac95; }
.room-heading h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.6px; margin: 0; }
.room-mode { color: #87a790; font-size: 10px; margin: 8px 0 0; }
.player-count { white-space: nowrap; font-size: 10px; color: #b3c8b7; padding: 9px 12px; border: 1px solid #829a762b; border-radius: 20px; background: #29483133; }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 30px; align-items: start; }
.table-play-area { min-width: 0; }
.table-stage { position: relative; height: 410px; min-width: 0; isolation: isolate; }
.table-felt {
  position: absolute;
  inset: 43px 34px 40px;
  border: 9px solid #293c2e;
  border-radius: 48%;
  background: repeating-linear-gradient(25deg, #ffffff01 0 1px, #00000003 1px 3px), radial-gradient(ellipse at 44% 32%, #245a44, #123c2c 77%);
  box-shadow: 0 0 0 1px #9d96634a, 0 0 0 6px #101f17, 0 0 0 7px #56724136, 0 24px 45px #0006, inset 0 0 0 1px #94b57d28, inset 0 0 42px #071d1a77;
}
.table-felt::after { content: ""; position: absolute; inset: 14px; border: 1px solid #c8ca882c; border-radius: 48%; }
.table-center { position: absolute; top: 49%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: #c4cfa845; white-space: nowrap; }
.table-center > span { font-size: 21px; letter-spacing: 10px; margin-right: -10px; }
.table-center i { font-style: normal; }
.table-center p { font-size: 15px; letter-spacing: 6px; line-height: 1.8; margin: 12px 0 0; font-weight: 650; }
.table-center small { font-size: 7px; letter-spacing: 3px; font-weight: 400; }
.seat { position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 125px; min-height: 98px; padding: 10px 7px 9px; background: linear-gradient(145deg, #1e332a, #12281f); border: 1px solid #657e5540; border-radius: 14px; box-shadow: 0 8px 20px #0004, inset 0 1px #ffffff04; text-align: center; }
.seat-0 { top: 0; left: 50%; transform: translateX(-50%); }
.seat-1 { right: 0; top: 50%; transform: translateY(-50%); }
.seat-2 { bottom: 0; left: 50%; transform: translateX(-50%); }
.seat-3 { left: 0; top: 50%; transform: translateY(-50%); }
.seat[data-position="top"] { top: 0; right: auto; bottom: auto; left: 50%; transform: translateX(-50%); }
.seat[data-position="left"] { top: 50%; right: auto; bottom: auto; left: 0; transform: translateY(-50%); }
.seat[data-position="right"] { top: 50%; right: 0; bottom: auto; left: auto; transform: translateY(-50%); }
.seat[data-position="bottom"] { top: auto; right: auto; bottom: 0; left: 50%; transform: translateX(-50%); }
.avatar { display: grid; place-items: center; width: 37px; height: 37px; border: 1px dashed #96b18851; border-radius: 50%; background: #35543d70; color: #a3b58f; font-size: 21px; }
.seat.occupied .avatar { border: 1px solid #9acabf33; background: linear-gradient(145deg, #3b6d57, #244d3b); color: #d2ead7; font-size: 12px; font-weight: 700; }
.seat[data-team="b"] .avatar { background: linear-gradient(145deg, #6f6150, #493d30); color: #efdbb4; border-color: #d6b98d33; }
.seat-name { max-width: 100%; overflow-wrap: anywhere; font-size: 11px; font-weight: 650; line-height: 1.35; color: #e7eee1; }
.seat-team { font-size: 8px; color: #9bb39c; line-height: 1.35; }
.you-mark, .bot-mark { display: inline-block; margin-left: 4px; font-size: 8px; font-weight: 500; color: #8aa793; }
.you-mark { color: #e1c584; }
.dealer-mark { font-weight: 500; color: #d6c18e; }
.seat-card-count { color: #a6bba2; font-size: 9px; line-height: 1.3; }
.seat.is-you { border-color: #d9bd7d7a; }
.seat.is-turn { border-color: #e5c986; box-shadow: 0 0 0 3px #dfc88020, 0 0 27px #e4c48324, 0 8px 20px #0004; }
.seat.is-turn::before { content: ""; position: absolute; top: -5px; right: -5px; width: 9px; height: 9px; background: var(--gold); border: 2px solid #1c3326; border-radius: 50%; box-shadow: 0 0 13px #e4c48366; animation: turn-pulse 2.5s ease-in-out infinite; }
@keyframes turn-pulse { 50% { box-shadow: 0 0 0 5px #e4c48318, 0 0 15px #e4c48366; } }
.seat[data-position="bottom"] { width: 200px; min-height: 56px; display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; gap: 2px 9px; padding: 8px 13px; text-align: left; }
.seat[data-position="bottom"] .avatar { grid-row: 1 / 3; width: 34px; height: 34px; }
.seat[data-position="bottom"] .seat-name { align-self: end; }
.seat[data-position="bottom"] .seat-team { align-self: start; }
.seat[data-position="bottom"] .seat-card-count { display: none; }
.opponent-hand { position: absolute; z-index: -1; width: 85px; height: 36px; left: 50%; bottom: -24px; transform: translateX(-50%); pointer-events: none; }
.mini-card { position: absolute; top: 0; left: calc(50% + (var(--back-index, 0) - (var(--back-count, 5) - 1) / 2) * 9px); width: 24px; height: 34px; border: 2px solid #e8e5ce; border-radius: 3px; background: repeating-linear-gradient(45deg, #ffffff14 0 1px, transparent 1px 5px), #345c4d; box-shadow: 0 2px 4px #0005; transform: translateX(-50%) rotate(calc((var(--back-index, 0) - (var(--back-count, 5) - 1) / 2) * 6deg)); transform-origin: 50% 110%; }
.motion-layer { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.flying-card { position: fixed; width: 26px; height: 38px; z-index: 1000; pointer-events: none; border: 2px solid #ebe6cf; border-radius: 4px; background: repeating-linear-gradient(45deg, #ffffff19 0 1px, transparent 1px 5px), #345c4d; box-shadow: 0 5px 12px #0005; }
.turned-area { position: absolute; top: 49%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 9px; width: 150px; text-align: center; }
.turned-label { color: #ddd7ae; font-size: 10px; font-weight: 600; letter-spacing: .5px; margin: 0; }
.turned-help { color: #b0c2a1; font-size: 9px; line-height: 1.4; margin: 0; max-width: 145px; overflow-wrap: anywhere; }
#turnedCard .game-card { width: 77px; height: 111px; box-shadow: 0 8px 16px #061d1a66; transform: rotate(-5deg); }
.trump-marker { display: grid; place-items: center; width: 85px; height: 90px; border: 1px solid #b5c57b2b; border-radius: 50%; background: #0c2b202b; color: #f0e4b7; font: 62px/1 Georgia, serif; text-shadow: 0 5px 10px #071f1666; }
.trump-marker.red-suit { color: #f1ae94; }

/* Card faces: clear corner ranks, full pips, and illustrated court cards. */
.game-card { position: relative; width: 100%; height: 100%; aspect-ratio: 2 / 3; border: 1px solid #eae4d6; border-radius: 9px; background: linear-gradient(128deg, #fffdf7, #f2eddf); color: #19352d; box-shadow: 0 5px 12px #0004, inset 0 0 0 2px #fffdf780; user-select: none; overflow: hidden; }
.game-card.red-suit { color: #b54443; }
.game-card::after { content: ""; position: absolute; inset: 3px; border: 1px solid #b3a67c18; border-radius: 6px; pointer-events: none; }
.card-corner { position: absolute; left: 7px; top: 7px; display: flex; flex-direction: column; align-items: center; font-size: 16px; line-height: .98; z-index: 2; }
.card-corner b { font: 700 23px/1.03 Georgia, "Times New Roman", serif; letter-spacing: -1px; }
.card-corner.bottom { left: auto; top: auto; right: 7px; bottom: 7px; transform: rotate(180deg); }
.card-pip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 46px/1 Georgia, serif; }
.card-art { position: absolute; inset: 19% 23%; font-family: Georgia, serif; }
.card-art .pip { position: absolute; font-size: 24px; line-height: 1; }
.ace-art { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; }
.ace-symbol { font: 66px/1 Georgia, serif; }
.ace-caption { font: 5px/1 "Segoe UI", sans-serif; text-transform: uppercase; letter-spacing: 1.3px; }
.court-art { inset: 18% 19%; }
.court-medallion { display: block; width: 100%; height: 100%; }
.hand-section { position: relative; margin: 20px 0 0; padding: 0 18px; }
.hand-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 8px; margin-bottom: 17px; }
.hand-heading h2 { font-family: "Segoe UI", Arial, sans-serif; font-size: 11px; font-weight: 650; letter-spacing: .5px; margin: 0; }
.private-hand { color: #819d89; font-size: 9px; }
.private-hand > span { margin-right: 3px; color: #adc29c; }
.hand-cards { display: flex; justify-content: center; align-items: flex-start; height: 159px; padding: 0 12px; }
.hand-cards > [role="listitem"] { position: relative; min-width: 0; flex: 0 0 104px; height: 148px; margin: 0 0 0 -15px; transform: translateY(calc(var(--card-curve, 0) * 1px)) rotate(calc(var(--card-tilt, 0) * 1deg)); transform-origin: 50% 100%; }
.hand-cards > [role="listitem"]:first-child { margin-left: 0; }
.hand-cards.complete-hand > [role="listitem"] { flex-basis: clamp(75px, 7.7vw, 104px); margin-left: -28px; }
.hand-cards.complete-hand > [role="listitem"]:first-child { margin-left: 0; }
.hand-cards .game-card { transition: transform .2s ease, box-shadow .2s ease; }
@media (hover: hover) {
  .hand-cards > [role="listitem"]:hover { z-index: 3; }
  .hand-cards > [role="listitem"]:hover .game-card { transform: translateY(-10px); box-shadow: 0 10px 20px #0006; }
}
.hand-help { font-size: 9px; line-height: 1.5; color: #839a82; margin: 14px 0 0; text-align: center; }
.room-sidebar { display: flex; flex-direction: column; gap: 15px; padding-top: 14px; }
.action-panel { padding: 21px; background: linear-gradient(145deg, #1a3025, #14271f); border: 1px solid #a0b28e24; border-radius: 16px; box-shadow: 0 12px 32px #0002; }
.room-status { display: flex; align-items: baseline; gap: 8px; }
.status-dot { flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 9px #e4c4832b; }
.room-status p { font-size: 11px; line-height: 1.7; font-weight: 500; color: #b9cbb4; margin: 0; }
.room-status.complete .status-dot { background: var(--green); }
.deal-button { margin-top: 18px; }
.deal-notice { margin: 13px 0 0; padding: 10px; border: 1px solid #ddcfad2b; border-radius: 8px; background: #c7a7660b; color: #d3bd8c; font-size: 10px; line-height: 1.6; }
.bidding-panel { border-top: 1px solid var(--border); padding-top: 17px; margin-top: 17px; }
.bidding-panel h2 { font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; font-weight: 650; line-height: 1.5; letter-spacing: -.2px; margin: 0; color: #eee4c9; }
.bidding-help { color: #9fb39e; font-size: 11px; line-height: 1.6; margin: 8px 0 16px; }
.bid-actions { display: grid; gap: 8px; }
.bid-actions:empty { display: none; }
.bid-actions .button { min-height: 43px; padding: 11px 10px; font-size: 12px; gap: 5px; }
.bid-details { color: #879e88; font-size: 10px; margin-top: 15px; }
.bid-details:not(:has(.bid-history:not([hidden]))) { display: none; }
.bid-details summary::marker { color: #6c866c; }
.bid-history { padding: 10px 0 0; margin: 0; list-style: none; color: #afbea7; font-size: 10px; line-height: 1.9; }
.bid-history li { overflow-wrap: anywhere; }
.invite-panel { padding: 20px; border: 1px solid #91a47520; border-radius: 14px; background: #172b1f60; }
.invite-panel .panel-eyebrow { font-size: 8px; color: #96ad91; margin-bottom: 9px; }
.room-code { padding: 2px 0 13px; margin: 0 0 4px; background: transparent; border: 0; border-radius: 0; font: 600 29px/1.2 Consolas, monospace; letter-spacing: 5px; cursor: text; color: #ece3bb; }
.invite-panel > p:not(.panel-eyebrow) { color: #91a68b; font-size: 10px; line-height: 1.7; margin: 12px 0 0; }
.invite-panel .copy-message:empty { display: none; }
.solo-room-info { display: flex; gap: 12px; align-items: center; padding: 4px 12px; }
.solo-room-info .panel-eyebrow { color: #a2b194; font-size: 8px; margin: 0 0 4px; }
.solo-room-info p:not(.panel-eyebrow) { color: #829a80; font-size: 10px; line-height: 1.6; margin: 0; }
.solo-icon { display: grid; place-items: center; width: 34px; height: 38px; color: #a4bc8e; border: 1px solid #7596672e; border-radius: 7px; font-size: 20px; flex-shrink: 0; }
.table-details { margin: 0 12px; font-size: 10px; line-height: 1.7; color: #81957c; }
.team-help { font-size: 10px; line-height: 1.7; color: #91a187; margin: 12px 0 0; }
.team-help strong { font-weight: 500; color: #c0c9ae; }
.text-button { background: transparent; border: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; font-size: 11px; padding: 12px 0 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1100px) {
  .shell { padding: 0 30px; }
  .welcome { gap: 40px; padding-left: 10px; padding-right: 10px; }
  .room-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 23px; }
  .table-stage { height: 395px; }
  .seat { width: 110px; }
  .table-felt { left: 22px; right: 22px; }
  .hand-cards > [role="listitem"] { flex-basis: 92px; height: 132px; }
  .hand-cards.complete-hand > [role="listitem"] { flex-basis: 86px; margin-left: -34px; }
  .hand-cards { height: 145px; }
  .card-corner { font-size: 14px; left: 6px; top: 6px; }
  .card-corner b { font-size: 21px; }
  .card-corner.bottom { right: 6px; bottom: 6px; }
  .card-art .pip { font-size: 21px; }
  .ace-symbol { font-size: 54px; }
  .action-panel { padding: 18px; }
}

@media (max-width: 800px) {
  .header-tagline { display: none; }
  .welcome { gap: 25px; grid-template-columns: .95fr 1fr; padding: 40px 0; }
  .entry-panel { padding-right: 22px; padding-left: 22px; }
  .entry-tabs { margin-left: -12px; margin-right: -12px; }
  .entry-tab { font-size: 10px; }
  h1 { font-size: 48px; }
  h2 { font-size: 25px; }
  .intro-copy { font-size: 13px; }
  .card-fan { transform: scale(.88); transform-origin: left center; width: 270px; margin-left: -8px; }
  .small-note { gap: 9px; font-size: 10px; }
  .room-layout { grid-template-columns: minmax(0, 1fr) 220px; gap: 17px; }
  .table-stage { height: 360px; }
  .seat { width: 91px; min-height: 90px; padding: 8px 5px; }
  .seat-name { font-size: 10px; }
  .seat-team { font-size: 7px; }
  .avatar { width: 32px; height: 32px; }
  .seat.occupied .avatar { font-size: 11px; }
  .table-felt { inset: 42px 15px 34px; border-width: 6px; }
  #turnedCard .game-card { width: 65px; height: 94px; }
  .turned-area { width: 112px; }
  .turned-label { font-size: 9px; }
  .turned-help { font-size: 8px; max-width: 104px; }
  .hand-section { padding: 0; }
  .hand-cards { padding: 0; height: 132px; }
  .hand-cards > [role="listitem"] { flex-basis: 78px; height: 115px; margin-left: -22px; }
  .hand-cards.complete-hand > [role="listitem"] { flex-basis: 71px; margin-left: -35px; }
  .hand-heading { gap: 5px; padding: 0; }
  .private-hand { font-size: 8px; }
  .card-corner { font-size: 11px; left: 5px; top: 5px; }
  .card-corner b { font-size: 18px; }
  .card-corner.bottom { right: 5px; bottom: 5px; }
  .card-art .pip { font-size: 17px; }
  .ace-symbol { font-size: 46px; }
  .action-panel { padding: 16px; }
  .bid-actions .button { font-size: 11px; }
}

@media (max-width: 680px) {
  .shell { padding: 0 20px; }
  .site-header, .in-room .site-header { height: 66px; }
  .brand { font-size: 13px; gap: 10px; }
  .brand-mark { width: 29px; height: 35px; font-size: 23px; border-radius: 5px; }
  .brand-subtitle { font-size: 7px; letter-spacing: 3.8px; margin-top: 5px; }
  .prototype-badge { font-size: 9px; gap: 6px; }
  .welcome { grid-template-columns: 1fr; gap: 26px; min-height: 0; padding: 30px 0; }
  .intro { position: relative; }
  .eyebrow { font-size: 8px; margin-bottom: 13px; letter-spacing: 1.7px; }
  h1 { font-size: 46px; letter-spacing: -1.8px; margin-bottom: 17px; }
  .intro-copy { font-size: 12px; max-width: 100%; }
  .intro-copy br { display: none; }
  .card-fan { position: absolute; top: 10px; right: -2px; width: 128px; height: 137px; margin: 0; transform: scale(.46); transform-origin: top right; pointer-events: none; }
  .playing-card { top: 22px; }
  .card-one { left: -145px; }
  .card-two { left: -76px; top: 7px; }
  .card-three { left: -7px; }
  .fan-caption { display: none; }
  .fan-glow { display: none; }
  .small-note { margin: 16px 0 0; font-size: 10px; }
  .entry-panel { border-radius: 17px; padding: 11px 23px 21px; }
  .entry-tabs { margin-bottom: 23px; }
  .entry-tab { font-size: 11px; padding: 12px 4px; }
  .panel-eyebrow { font-size: 8px; }
  h2 { font-size: 27px; }
  .panel-copy { font-size: 12px; margin-bottom: 20px; }
  .entry-footnote { font-size: 9px; margin-top: 20px; padding-top: 17px; }
  .site-footer { padding: 18px 0; font-size: 9px; gap: 15px; }
  .site-footer details { max-width: 50%; }
  .loading { min-height: 350px; font-size: 13px; }
  .room { padding: 18px 0; }
  .room-heading { align-items: center; margin-bottom: 17px; gap: 9px; }
  .room-heading .eyebrow { font-size: 7px; margin-bottom: 5px; }
  .room-heading h1 { font-size: 23px; letter-spacing: -.7px; }
  .room-mode { font-size: 9px; margin-top: 6px; }
  .player-count { font-size: 8px; padding: 7px 8px; }
  .room-layout { display: block; }
  .table-stage { height: 310px; max-width: 480px; margin: auto; }
  .table-felt { inset: 35px 10px 24px; border-width: 6px; box-shadow: 0 0 0 1px #9d96634a, 0 0 0 4px #101f17, 0 0 0 5px #56724136, 0 16px 26px #0005, inset 0 0 32px #071d1a77; }
  .table-felt::after { inset: 10px; }
  .table-center > span { font-size: 15px; letter-spacing: 5px; }
  .table-center p { font-size: 11px; letter-spacing: 4px; }
  .table-center small { font-size: 6px; letter-spacing: 2px; }
  .seat { width: 92px; min-height: 83px; gap: 3px; padding: 7px 5px; border-radius: 11px; }
  .seat-name { font-size: 10px; line-height: 1.3; }
  .seat-team { font-size: 7px; }
  .avatar { width: 28px; height: 28px; font-size: 17px; }
  .seat.occupied .avatar { font-size: 10px; }
  .seat-card-count { font-size: 8px; }
  .you-mark, .bot-mark { font-size: 7px; margin-left: 3px; }
  .seat[data-position="left"], .seat[data-position="right"] { top: 48%; }
  .seat[data-position="bottom"] { width: 175px; min-height: 48px; grid-template-columns: 29px 1fr; padding: 6px 11px; gap: 2px 9px; }
  .seat[data-position="bottom"] .avatar { width: 29px; height: 29px; }
  .seat[data-position="bottom"] .seat-name { font-size: 10px; }
  .opponent-hand { height: 28px; bottom: -18px; }
  .mini-card { width: 19px; height: 27px; left: calc(50% + (var(--back-index, 0) - (var(--back-count, 5) - 1) / 2) * 7px); border-width: 1px; }
  .turned-area { top: 56%; gap: 7px; width: 120px; }
  .turned-area:has(.game-card) { top: 59%; }
  #turnedCard .game-card { width: 61px; height: 87px; border-radius: 6px; }
  .turned-label { font-size: 9px; letter-spacing: 0; }
  .turned-help { font-size: 8px; max-width: 112px; }
  .trump-marker { width: 66px; height: 72px; font-size: 51px; }
  .hand-section { max-width: 480px; margin: 17px auto 0; }
  .hand-heading { padding: 0 2px; margin-bottom: 14px; }
  .hand-heading h2 { font-size: 10px; }
  .private-hand { font-size: 8px; }
  .hand-cards { padding: 0 5px; height: 112px; }
  .hand-cards > [role="listitem"] { flex-basis: 70px; height: 101px; margin-left: -10px; }
  .hand-cards.complete-hand > [role="listitem"] { flex-basis: clamp(54px, 16.5vw, 64px); margin-left: -26px; }
  .game-card { border-radius: 6px; }
  .game-card::after { inset: 2px; border-radius: 4px; }
  .card-corner { top: 4px; left: 4px; font-size: 10px; }
  .card-corner b { font-size: 17px; letter-spacing: -.8px; }
  .card-corner.bottom { right: 4px; bottom: 4px; }
  .card-art { inset: 21% 24%; }
  .card-art .pip { font-size: 16px; }
  .court-art { inset: 19% 19%; }
  .ace-symbol { font-size: 42px; }
  .ace-caption { font-size: 3px; letter-spacing: .6px; }
  .card-pip { font-size: 35px; }
  .hand-help { font-size: 8px; margin: 9px 8px 0; line-height: 1.5; }
  .room-sidebar { display: flex; flex-direction: column; gap: 13px; max-width: 480px; margin: 18px auto 0; padding: 0; }
  .action-panel { padding: 16px; border-radius: 13px; }
  .action-panel:has(#biddingPanel:not([hidden])) .room-status { display: none; }
  .bidding-panel { margin: 0; padding: 0; border: 0; }
  .bidding-panel h2 { font-size: 13px; letter-spacing: 0; }
  .bidding-help { font-size: 10px; margin: 6px 0 12px; line-height: 1.6; }
  .bid-actions { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bid-actions .button { font-size: 10px; min-height: 43px; padding: 10px 5px; }
  .bid-actions .take-button:only-of-type { grid-column: 1 / -1; }
  .bid-details { margin-top: 11px; font-size: 9px; }
  .bid-history { font-size: 10px; }
  .room-status p { font-size: 11px; }
  .deal-button { margin-top: 13px; }
  .invite-panel { padding: 16px; }
  .room-code { font-size: 27px; }
  .solo-room-info { padding: 3px 9px; }
  .solo-room-info p:not(.panel-eyebrow) { font-size: 10px; }
  .table-details { margin: 0 10px; font-size: 10px; }
  .button-quiet { margin: 0; }
}

@media (max-width: 370px) {
  .shell { padding: 0 13px; }
  .room-heading h1 { font-size: 21px; }
  .table-stage { height: 294px; }
  .seat { width: 84px; }
  .turned-area { width: 106px; }
  .hand-cards.complete-hand > [role="listitem"] { height: 96px; }
  .hand-cards > [role="listitem"] { flex-basis: 65px; }
  .hand-cards { height: 106px; }
  .intro-copy { max-width: 310px; }
  .card-fan { display: none; }
  .entry-panel { padding-left: 18px; padding-right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Jeu des plis : cartes privées interactives et cartes publiques sur le tapis. */
.score-board { display: flex; align-items: center; justify-content: center; gap: 25px; padding: 10px 14px; margin: 0 0 16px; border: 1px solid #e4c48322; border-radius: 11px; background: #10251c; }
.team-score { display: flex; align-items: center; gap: 11px; font-size: 11px; color: #bdcfb8; }
.team-score strong { font: 600 24px/1 Georgia, serif; color: #eee4c3; font-variant-numeric: tabular-nums; }
.score-target { color: #8da789; font-size: 9px; text-align: center; line-height: 1.5; }
.room:has(#playPanel:not([hidden])) .turned-area { top: 20px; left: auto; right: 14px; transform: none; width: 96px; gap: 3px; }
.room:has(#playPanel:not([hidden])) .turned-help { display: none; }
.room:has(#playPanel:not([hidden])) .trump-marker { height: 33px; width: 33px; font-size: 27px; border: 0; background: none; }
.room:has(#playPanel:not([hidden])) .turned-label { font-size: 9px; }
.trick-area { position: absolute; z-index: 1; top: 52%; left: 50%; transform: translate(-50%, -50%); width: 214px; height: 210px; }
.trick-cards { position: absolute; inset: 0; }
.played-card { position: absolute; width: 72px; height: 104px; }
.played-card[data-position="top"] { top: 0; left: 71px; transform: rotate(3deg); }
.played-card[data-position="left"] { top: 46px; left: 7px; transform: rotate(-8deg); }
.played-card[data-position="right"] { top: 46px; left: 135px; transform: rotate(8deg); }
.played-card[data-position="bottom"] { top: 88px; left: 71px; transform: rotate(-3deg); }
.played-card .card-corner { font-size: 12px; top: 5px; left: 5px; }
.played-card .card-corner b { font-size: 19px; }
.played-card .card-corner.bottom { top: auto; left: auto; bottom: 5px; right: 5px; }
.played-card .card-art .pip { font-size: 17px; }
.played-card .ace-symbol { font-size: 42px; }
.trick-caption { position: absolute; top: 100%; left: -35px; right: -35px; margin: 7px 0 0; text-align: center; color: #d5d9b6; font-size: 10px; line-height: 1.35; }
.card-announcement { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); padding: 3px 6px; border-radius: 5px; background: #edd091; color: #203523; white-space: nowrap; font-size: 9px; font-weight: 700; box-shadow: 0 2px 8px #0004; }
.announcement-toast { position: fixed; z-index: 1400; top: calc(env(safe-area-inset-top, 0px) + 68px); right: max(12px, env(safe-area-inset-right, 0px)); max-width: min(70vw, 290px); padding: 8px 12px; border: 1px solid #f0d58a99; border-radius: 999px; background: #173b31e8; color: #fff0bd; font-size: 12px; font-weight: 750; letter-spacing: .2px; box-shadow: 0 5px 18px #001b1640; pointer-events: none; opacity: 0; transform: translateY(-7px) scale(.97); transition: opacity .22s ease, transform .22s ease; backdrop-filter: blur(8px); }
.announcement-toast.is-visible { opacity: 1; transform: translateY(0) scale(1); }
.collecting-card { position: fixed; z-index: 1000; pointer-events: none; }
button.game-card { display: block; padding: 0; font: inherit; text-align: left; cursor: default; transition: box-shadow .2s, filter .2s, transform .2s; }
button.game-card:disabled { opacity: .87; }
button.game-card.is-playable { cursor: pointer; box-shadow: 0 0 0 2px #dfc785, 0 0 18px #d6bd722d, 0 7px 14px #0006; }
.hand-cards:has(.is-playable) button.game-card:disabled { filter: brightness(.64) saturate(.7); }
.hand-cards > .hand-slot:focus-within { z-index: 5; }
button.game-card:focus-visible { outline: 3px solid #f5d580; outline-offset: 3px; transform: translateY(-10px); }
.play-status { display: flex; align-items: center; justify-content: center; gap: 7px; color: #b7caae; font-size: 12px; font-weight: 600; margin: 17px 0 0; min-height: 20px; text-align: center; }
.play-status.your-turn { color: #edce8a; }
.play-status.your-turn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #edce8a; box-shadow: 0 0 12px #edce8a88; }
.play-panel { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.round-progress { font-size: 10px; line-height: 1.8; color: #b6c4a7; }
.last-trick-details { margin-top: 13px; font-size: 10px; color: #a5bb9b; }
.last-trick-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.last-trick-cards > div { min-width: 0; }
.last-trick-cards .game-card { width: 100%; height: auto; border-radius: 5px; }
.last-trick-cards .card-corner { font-size: 8px; top: 3px; left: 3px; }
.last-trick-cards .card-corner b { font-size: 14px; }
.last-trick-cards .card-corner.bottom { top: auto; left: auto; bottom: 3px; right: 3px; }
.last-trick-cards .card-art .pip { font-size: 11px; }
.last-trick-cards .ace-symbol { font-size: 28px; }
.last-trick-cards .ace-caption { display: none; }
.last-trick-cards > div > span { display: block; overflow-wrap: anywhere; font-size: 8px; margin-top: 6px; line-height: 1.4; }
.round-result { margin-top: 18px; }
.round-result h2 { font-size: 23px; color: #ecd08f; margin-bottom: 9px; line-height: 1.15; }
.round-result > p { font-size: 11px; line-height: 1.6; color: #b0c3a5; margin: 0 0 15px; }
.result-scores { display: grid; gap: 9px; }
.result-scores > div { display: grid; grid-template-columns: 1fr auto; gap: 5px; padding: 11px; border: 1px solid #ead59a19; border-radius: 8px; background: #0c211b55; }
.result-scores span { font-size: 10px; align-self: center; color: #c9d4bc; }
.result-scores strong { font-size: 18px; font-weight: 600; color: #f0deb5; }
.result-scores small { grid-column: 1 / -1; font-size: 9px; line-height: 1.5; color: #a4b89b; }
.next-deal-button { margin-top: 18px; }
@media (hover: hover) {
  .hand-cards > .hand-slot:hover button.game-card:disabled { transform: none; }
  .hand-cards > .hand-slot:hover button.game-card.is-playable { transform: translateY(-14px); box-shadow: 0 0 0 2px #f1d18b, 0 12px 22px #0006; }
}
@media (max-width: 900px) and (min-width: 681px) {
  .trick-area { transform: translate(-50%, -50%) scale(.76); }
  .score-board { gap: 12px; padding: 9px; }
  .team-score { gap: 6px; font-size: 9px; }
  .team-score strong { font-size: 21px; }
  .score-target { font-size: 8px; }
}
@media (max-width: 680px) {
  .score-board { gap: 13px; padding: 10px; max-width: 480px; margin: 0 auto 16px; }
  .team-score { gap: 7px; font-size: 9px; }
  .team-score strong { font-size: 22px; }
  .score-target { font-size: 8px; max-width: 85px; }
  .room:has(#playPanel:not([hidden])) .table-stage { height: 330px; }
  .room:has(#playPanel:not([hidden])) .turned-area { top: 12px; right: 1px; width: 79px; }
  .room:has(#playPanel:not([hidden])) .turned-label { font-size: 8px; }
  .room:has(#playPanel:not([hidden])) .trump-marker { width: 26px; height: 26px; font-size: 24px; }
  .trick-area { top: 57%; width: 164px; height: 172px; }
  .played-card { width: 54px; height: 78px; }
  .played-card[data-position="top"] { top: 0; left: 55px; }
  .played-card[data-position="left"] { top: 36px; left: 0; }
  .played-card[data-position="right"] { top: 36px; left: 110px; }
  .played-card[data-position="bottom"] { top: 75px; left: 55px; }
  .played-card .card-corner { font-size: 9px; top: 3px; left: 3px; }
  .played-card .card-corner b { font-size: 15px; }
  .played-card .card-corner.bottom { top: auto; left: auto; right: 3px; bottom: 3px; }
  .played-card .card-art .pip { font-size: 13px; }
  .played-card .ace-symbol { font-size: 34px; }
  .played-card .ace-caption { display: none; }
  .trick-caption { top: calc(100% - 13px); font-size: 9px; margin-top: 1px; left: -20px; right: -20px; }
  .card-announcement { top: -14px; font-size: 8px; padding: 2px 4px; }
  .play-status { font-size: 11px; margin-top: 15px; }
  .room:has(#playPanel:not([hidden])) .hand-help { font-size: 9px; margin-top: 4px; }
  .room:has(#playPanel:not([hidden])) .hand-heading { margin-bottom: 17px; }
  .room:has(#playPanel:not([hidden])) .private-hand { display: none; }
  .room:has(#playPanel:not([hidden])) .hand-cards.complete-hand > .hand-slot { margin-left: -22px; }
  .room:has(#playPanel:not([hidden])) .hand-cards.complete-hand > .hand-slot:first-child { margin-left: 0; }
  .room:has(#playPanel:not([hidden])) .invite-panel { display: none; }
  .round-progress { font-size: 11px; }
  .last-trick-cards { max-width: 290px; }
  .last-trick-cards .card-corner { font-size: 11px; }
  .last-trick-cards .card-corner b { font-size: 18px; }
  .last-trick-cards .card-art .pip { font-size: 15px; }
}
@media (max-width: 370px) {
  .score-board { gap: 9px; padding: 9px 8px; }
  .team-score { gap: 5px; font-size: 8px; }
  .team-score strong { font-size: 20px; }
  .score-target { font-size: 7px; max-width: 70px; }
  .room:has(#playPanel:not([hidden])) .hand-cards.complete-hand > .hand-slot { margin-left: -25px; }
  .trick-area { width: 128px; height: 164px; }
  .played-card { width: 46px; height: 69px; }
  .played-card[data-position="top"] { top: 0; left: 41px; }
  .played-card[data-position="left"] { top: 38px; left: 0; }
  .played-card[data-position="right"] { top: 38px; left: 82px; }
  .played-card[data-position="bottom"] { top: 78px; left: 41px; }
  .played-card .card-art .pip { font-size: 11px; }
  .played-card .ace-symbol { font-size: 29px; }
}
/* Un repère principal, puis les cartes et les actions au même endroit. */
.in-room .site-header { height: 58px; }
.room { padding-top: 14px; }
.room-heading { margin-bottom: 13px; }
.room-heading .eyebrow { display: none; }
.room-heading h1 { font: 600 16px/1.3 "Segoe UI", sans-serif; letter-spacing: 0; }
.room-mode { margin-top: 3px; }
.room-layout { gap: 24px; }
.phase-banner { display: flex; align-items: center; gap: 14px; min-height: 85px; padding: 14px 17px; margin-bottom: 14px; border: 1px solid #e0c78b44; border-radius: 13px; background: linear-gradient(105deg,#263f30,#172e24); }
.phase-icon { display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 45px; border-radius: 9px; background: #ead19812; color: #f0d698; font-size: 29px; }
.phase-label { margin: 0 0 5px; font-size: 9px; font-weight: 650; letter-spacing: 1.5px; color: #d1bb84; }
.phase-banner h2 { margin: 0; font: 650 21px/1.25 "Segoe UI", sans-serif; letter-spacing: -.35px; overflow-wrap: anywhere; }
.phase-help { margin: 6px 0 0; color: #adc1ad; font-size: 11px; line-height: 1.5; }
.phase-banner.your-turn { border-color: #e9cf87; background: linear-gradient(105deg,#3b4b2d,#203c2a); }
.is-paused .phase-banner { border-color: #b3c5c2; background: #243634; }
.is-paused .phase-label { color: #d6e4de; }
.is-paused .seat.is-turn::before { animation-play-state: paused; }
.score-board { margin-bottom: 13px; padding: 9px 14px; }
.table-stage { height: 373px; }
.seat { width: 128px; min-height: 92px; padding-top: 9px; }
.seat-name { font-size: 12px; }
.seat-team { font-size: 9px; }
.seat.is-turn { border-width: 2px; border-color: #f6d682; box-shadow: 0 0 0 4px #e5c87b22,0 8px 20px #0005; }
.seat-turn-label { position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 5px 9px; border-radius: 6px; background: #f0d08b; color: #223824; font-size: 10px; font-weight: 750; box-shadow: 0 3px 12px #0004; }
.seat[data-position="top"] .seat-turn-label { bottom: auto; top: calc(100% + 22px); }
.seat[data-position="bottom"] .seat-turn-label { left: auto; right: -4px; bottom: calc(100% + 4px); transform: none; }
.taker-mark { display: inline-block; color: #f2d08d; font-weight: 650; }
.dealer-mark { display: inline-block; color: #badad4; }
.flying-card { width: 40px; height: 58px; border-width: 2px; background: repeating-linear-gradient(45deg,#f0d38e27 0 1px,transparent 1px 5px),#183f37; box-shadow: 0 8px 16px #0006; }
.table-controls { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; margin: 14px 0 18px; }
.table-controls .button { min-height: 41px; padding: 9px 7px; font-size: 11px; gap: 5px; }
.table-controls .continue-button { grid-column: 1/-1; min-height: 43px; font-size: 13px; }
.hand-section { margin-top: 7px; padding: 0 9px; }
.hand-heading { margin-bottom: 13px; }
.hand-cards { height: 150px; }
.hand-cards > [role="listitem"] { height: 141px; flex-basis: 101px; }
.hand-cards.complete-hand > [role="listitem"] { flex-basis: clamp(74px,7.5vw,101px); margin-left: -27px; }
.hand-cards.complete-hand > [role="listitem"]:first-child { margin-left: 0; }
.game-card { aspect-ratio: 5/7; border: 0; background: #fffaf0; border-radius: 7px; overflow: hidden; }
.game-card::after { display: none; }
.card-face-svg { display: block; width: 100%; height: 100%; }
button.game-card:disabled { opacity: 1; filter: none; }
.hand-cards:has(.is-playable) button.game-card:disabled { filter: brightness(.85); opacity: 1; }
button.game-card.is-playable { box-shadow: 0 0 0 3px #f0cf7b,0 7px 14px #0006; }
.hand-help { font-size: 10px; }
.play-status { margin-top: 10px; }
.trick-area { width: 242px; height: 221px; top: 52%; }
.played-card { width: 76px; height: 106px; }
.played-card[data-position="top"] { top: 0; left: 83px; }
.played-card[data-position="left"] { top: 49px; left: 1px; }
.played-card[data-position="right"] { top: 49px; left: 165px; }
.played-card[data-position="bottom"] { top: 108px; left: 83px; }
.played-by { position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%); max-width: 110px; width: max-content; padding: 3px 6px; border-radius: 5px; background: #0a251dee; color: #f1ebd3; font-size: 9px; line-height: 1.25; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; box-shadow: 0 2px 4px #0003; }
.played-card[data-position="top"] .played-by { top: auto; bottom: calc(100% + 3px); }
.trick-caption { top: auto; bottom: -33px; }
.room[data-stage="trumpChosen"]:has(#playPanel:not([hidden])) .turned-area { top: 50%; left: 50%; right: auto; transform: translate(-50%,-50%); width: 180px; gap: 7px; }
.room[data-stage="trumpChosen"]:has(#playPanel:not([hidden])) .trump-marker { font-size: 72px; height: 89px; width: 90px; }
.room[data-stage="trumpChosen"]:has(#playPanel:not([hidden])) .turned-help { display: block; font-size: 12px; }
.room[data-stage="trumpChosen"]:has(#playPanel:not([hidden])) .turned-label { font-size: 12px; }
.room[data-stage="trumpChosen"]:has(#playPanel:not([hidden])) .trick-area { display: none; }
.room-sidebar { padding-top: 0; }
.solo-room-info { display: none; }
.last-trick-details { display: none; }
.game-dialog { width: min(660px,calc(100% - 32px)); max-height: min(850px,90vh); padding: 25px; border: 1px solid #d7c49555; border-radius: 18px; background: #142b22; color: #edf4ed; box-shadow: 0 28px 100px #0009; overflow-y: auto; overscroll-behavior: contain; }
.game-dialog::backdrop { background: #04100ddd; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.dialog-heading h2 { margin: 0; font: 650 24px/1.25 "Segoe UI",sans-serif; letter-spacing: -.5px; }
.dialog-heading .panel-eyebrow { margin-bottom: 8px; }
.dialog-close { border: 1px solid #c0d1bc44; border-radius: 8px; background: #ffffff06; color: #e8ebdd; font-size: 28px; line-height: 1; width: 37px; height: 37px; flex: 0 0 37px; }
.dialog-pause-note { padding: 10px 12px; margin: 0 0 18px; border: 1px solid #77b39c33; border-radius: 8px; background: #70b18c0a; font-size: 11px; line-height: 1.5; color: #b0d1bc; }
.game-dialog label { font-size: 12px; margin-top: 14px; }
.game-dialog input { margin-bottom: 2px; }
select { display: block; width: 100%; min-width: 0; margin: 0 0 15px; padding: 11px 12px; border: 1px solid #c1cfb544; border-radius: 8px; background: #0d211a; color: #e5eada; font: 13px "Segoe UI",sans-serif; }
select:focus-visible { outline: 2px solid #e4c483; outline-offset: 3px; }
.trick-detail { padding-top: 8px; }
.trick-detail-winner { color: #f1d495; font-size: 16px; line-height: 1.5; margin: 0 0 16px; }
.audit-cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.audit-card { min-width: 0; text-align: center; }
.audit-card .game-card { width: 100%; height: auto; margin-bottom: 10px; }
.audit-card strong { display: block; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; margin: 0 0 4px; }
.audit-card span { display: block; color: #e8cd93; font-size: 13px; }
.audit-card small { display: block; margin-top: 5px; color: #c4d5b8; font-size: 10px; }
.point-equation { font-size: 12px; line-height: 1.6; color: #b6c8b3; margin: 20px 0 7px; }
.trick-detail-total { font-size: 16px; color: #f1dba5; font-weight: 650; margin: 0 0 10px; }
.audit-teams, .audit-contract, .audit-explanation, .settings-help, .card-values p { font-size: 12px; line-height: 1.7; color: #b6cbb8; }
.audit-contract { color: #e8ce91; }
.audit-matrix { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.audit-matrix th { text-align: left; font-weight: 500; }
.audit-matrix td { text-align: right; white-space: nowrap; }
.audit-matrix th, .audit-matrix td { padding: 11px 9px; border-bottom: 1px solid #c3d5b61c; }
.audit-matrix thead th { font-weight: 650; color: #f0d89d; background: #ffffff04; }
.audit-matrix thead th:not(:first-child) { text-align: right; }
.audit-matrix .audit-total { color: #f2dba5; background: #e8ca8009; font-weight: 650; }
.audit-matrix .audit-total th { font-weight: 650; }
.game-dialog h3 { font-size: 15px; font-weight: 600; margin: 24px 0 12px; color: #e2d7b5; }
.audit-trick { border-bottom: 1px solid #c3d5b623; padding: 12px 0; }
.audit-trick summary, .card-values summary { color: #c7d7bd; font-size: 12px; line-height: 1.5; }
.audit-trick .trick-detail { padding-top: 18px; }
.card-values { padding: 15px 0 0; border-top: 1px solid #c3d5b623; margin-top: 20px; }
.check-label { display: flex; align-items: start; gap: 10px; line-height: 1.5; }
.check-label input { width: 18px; min-width: 18px; height: 18px; padding: 0; margin: 0; accent-color: #c8b270; }
#soloSettingsForm .button { margin-top: 20px; }
@media (min-width:681px) and (max-width:1000px) {
  .table-stage { height: 375px; }
  .phase-banner { padding: 12px; gap: 9px; }
  .phase-banner h2 { font-size: 17px; }
  .phase-icon { width: 30px; flex-basis: 30px; }
  .table-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .hand-cards.complete-hand > [role="listitem"] { flex-basis: 77px; height: 108px; margin-left: -35px; }
  .hand-cards { height: 122px; }
  .seat { width: 93px; }
  .seat-name { font-size: 10px; }
  .seat-team { font-size: 8px; }
  .seat-turn-label { font-size: 9px; padding: 4px 6px; }
}
@media (max-width:680px) {
  .in-room .shell { padding: 0 14px; }
  .in-room .site-header { height: 51px; }
  .room { padding-top: 10px; }
  .room-heading { margin-bottom: 10px; }
  .room-heading h1 { font-size: 13px; }
  .room-mode { display: none; }
  .phase-banner { min-height: 86px; padding: 11px 12px; margin-bottom: 10px; gap: 10px; }
  .phase-icon { width: 28px; height: 37px; flex-basis: 28px; font-size: 26px; }
  .phase-label { font-size: 8px; letter-spacing: 1px; margin-bottom: 4px; }
  .phase-banner h2 { font-size: 17px; letter-spacing: -.3px; }
  .phase-help { font-size: 10px; margin-top: 4px; line-height: 1.45; }
  .score-board { padding: 7px 9px; margin-bottom: 14px; gap: 10px; }
  .team-score strong { font-size: 20px; }
  .table-stage, .room:has(#playPanel:not([hidden])) .table-stage { height: 303px; }
  .table-felt { inset: 35px 10px 25px; }
  .seat { width: 85px; min-height: 78px; padding: 6px 5px; gap: 3px; }
  .seat-name { font-size: 10px; }
  .seat-team { font-size: 8px; }
  .seat .avatar { width: 25px; height: 25px; }
  .seat[data-position="bottom"] { min-height: 45px; width: 164px; padding: 6px 9px; }
  .seat[data-position="bottom"] .seat-team { font-size: 8px; }
  .seat-turn-label { font-size: 8px; padding: 4px 6px; }
  .seat[data-position="top"] .seat-turn-label { top: calc(100% + 16px); }
  .opponent-hand { bottom: -14px; }
  .table-controls { grid-template-columns: repeat(2,minmax(0,1fr)); margin: 12px 0 14px; gap: 6px; }
  .table-controls .button { min-height: 37px; padding: 8px 5px; font-size: 10px; }
  .table-controls .continue-button { min-height: 40px; font-size: 12px; }
  .hand-section { padding: 0; margin-top: 3px; }
  .hand-heading { margin-bottom: 12px !important; }
  .hand-cards { height: 108px; padding: 0 5px; }
  .hand-cards > [role="listitem"] { height: 98px; flex-basis: 70px; margin-left: -12px; }
  .hand-cards.complete-hand > [role="listitem"], .room:has(#playPanel:not([hidden])) .hand-cards.complete-hand > .hand-slot { height: 98px; flex-basis: 70px; margin-left: -31px; }
  .hand-cards.complete-hand > [role="listitem"]:first-child, .room:has(#playPanel:not([hidden])) .hand-cards.complete-hand > .hand-slot:first-child { margin-left: 0; }
  .hand-help { font-size: 9px; }
  .play-status { font-size: 11px; margin-top: 6px; }
  .trick-area { width: 166px; height: 165px; top: 52%; }
  .played-card { width: 51px; height: 72px; }
  .played-card[data-position="top"] { top: 0; left: 57px; }
  .played-card[data-position="left"] { top: 37px; left: 0; }
  .played-card[data-position="right"] { top: 37px; left: 115px; }
  .played-card[data-position="bottom"] { top: 80px; left: 57px; }
  .played-by { font-size: 7px; max-width: 73px; padding: 2px 4px; }
  .trick-caption { bottom: -11px; font-size: 8px; }
  .card-announcement { font-size: 8px; }
  .room-sidebar { margin-top: 14px; }
  .room:has(#playPanel:not([hidden])) .turned-area { top: 1px; }
  .room[data-stage="trumpChosen"]:has(#playPanel:not([hidden])) .turned-area { top: 52%; left: 50%; right: auto; width: 145px; }
  .game-dialog { width: calc(100% - 22px); padding: 17px; border-radius: 14px; max-height: 91vh; }
  .dialog-heading h2 { font-size: 21px; }
  .dialog-heading .panel-eyebrow { font-size: 8px; letter-spacing: 1px; }
  .dialog-pause-note { font-size: 10px; }
  .audit-cards { gap: 7px; }
  .audit-card strong { font-size: 10px; }
  .audit-card span { font-size: 11px; }
  .trick-detail-winner { font-size: 14px; }
  .point-equation, .audit-explanation, .audit-teams, .audit-contract { font-size: 11px; }
  .audit-matrix { font-size: 10px; }
  .audit-matrix th, .audit-matrix td { padding: 10px 6px; }
  .trick-detail-total { font-size: 14px; }
}
@media (max-width:370px) {
  .in-room .shell { padding: 0 10px; }
  .phase-banner { padding: 10px; gap: 8px; }
  .phase-icon { display: none; }
  .phase-banner h2 { font-size: 16px; }
  .seat { width: 75px; }
  .seat-name { font-size: 9px; }
  .seat-team { font-size: 7px; }
  .hand-cards.complete-hand > [role="listitem"], .room:has(#playPanel:not([hidden])) .hand-cards.complete-hand > .hand-slot { height: 90px; flex-basis: 64px; margin-left: -33px; }
  .hand-cards > [role="listitem"] { flex-basis: 60px; height: 87px; }
  .hand-cards { height: 101px; }
  .trick-area { width: 144px; height: 160px; }
  .played-card { width: 47px; height: 66px; }
  .played-card[data-position="top"] { left: 48px; }
  .played-card[data-position="left"] { left: 0; }
  .played-card[data-position="right"] { left: 97px; }
  .played-card[data-position="bottom"] { left: 48px; }
  .played-by { max-width: 65px; }
}

/* La bannière porte déjà le contexte : on garde les cartes et les commandes en vue. */
.room:not([data-stage="waiting"]) .room-heading { display: none; }
.room[data-stage="trumpChosen"] #turnedLabel { display: none; }
@media (min-width: 1100px) {
  .table-controls:has(#continueButton:not([hidden])) { grid-template-columns: 1.8fr repeat(4,minmax(0,1fr)); }
  .table-controls .continue-button { grid-column: auto; }
}
/* Invitations : le lien reste visible et copiable, même sans presse-papiers sécurisé. */
.invite-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.invite-actions .button { font-size: 11px; padding: 11px 6px; min-height: 42px; }
.invitation-link-label, .network-choice label { display: block; color: #afbea7; font-size: 10px; margin: 16px 0 6px; }
.invitation-link { width: 100%; min-width: 0; font-size: 11px; padding: 10px; margin: 0; color: #d9e1d3; background: #0b191770; }
.network-choice select { width: 100%; min-width: 0; padding: 9px; border: 1px solid #ffffff1c; border-radius: 7px; background: #142622; color: #edf4ed; font: 12px "Segoe UI", sans-serif; }
.network-choice select:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.invitation-notice { padding: 12px 16px; margin: 0 0 16px; border: 1px solid #e4c48350; border-radius: 10px; color: #ece3bb; background: #332e2050; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
