/* Prefa (static/js/games/prefa.js): a card-club table — tooled leather in a wooden rim, the warm pool of a brass lamp
   from above — the three players round it, a brass medallion in the middle with the game, the score sheet at the side
   like a pad of paper. Five tables (.pft-*) and five card backs (drawn in the js); each player may choose their own. Its
   own look: nothing here is shared with the other card games. */

/* ---------- the tables: the leather, its tooled line, the wood of the rim ---------- */
.pft-leather { --l1: #6e1f22; --l2: #4a1216; --l3: #2a0a0c; --rim1: #5a3a22; --rim2: #2c1a0e; --tool: #c9973e; --ink: #f6ead3; }
.pft-cognac { --l1: #9a5a2a; --l2: #6e3c18; --l3: #3e200b; --rim1: #3a2414; --rim2: #1c1008; --tool: #e8c06a; --ink: #fbf0dd; }
.pft-emerald { --l1: #1f5a3e; --l2: #123a28; --l3: #071d14; --rim1: #4a3220; --rim2: #24170c; --tool: #d4a84e; --ink: #eef6ee; }
.pft-midnight { --l1: #22345a; --l2: #142240; --l3: #070f22; --rim1: #3a3a44; --rim2: #17171d; --tool: #c0c8d8; --ink: #eef2fb; }
.pft-ebony { --l1: #2e2a26; --l2: #1c1a17; --l3: #0b0a09; --rim1: #1a1410; --rim2: #070504; --tool: #c9973e; --ink: #f4ece0; }

/* ---------- a card ---------- */
.pfc { position: relative; display: block; width: var(--cw, 80px); aspect-ratio: 2 / 3; flex: none; border-radius: calc(var(--cw, 80px) * .065); }
.pfc .pfsvg, .pf-hc .pfsvg { display: block; width: 100%; height: 100%; }
.pf-ghost { position: fixed; z-index: 95; pointer-events: none; will-change: transform; filter: drop-shadow(0 10px 14px rgba(0,0,0,.55)); }
.pf-ghost .pfc { width: 100%; }

/* ---------- the page ---------- */
html:has(body.game-prefa[data-page="table"]) { overflow: hidden; }
body.game-prefa[data-page="table"] .site-foot { display: none; }
body.game-prefa[data-page="table"] .chat-fab { display: none !important; }
body.game-prefa[data-page="table"] #table.page { max-width: none; height: calc(100dvh - var(--top)); box-sizing: border-box; overflow: hidden; padding: 10px 14px; }
body.game-fs .pf-wrap { height: 100%; }
.pf-wrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; height: 100%;
  --cw: clamp(56px, 6vw, 90px); color: var(--ink); }
@media (min-width: 1180px) and (min-height: 521px) {
  .pf-wrap { grid-template-columns: minmax(0, 1fr) 250px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "table sheet" "me sheet"; }
  .pf-table { grid-area: table; } .pf-me { grid-area: me; } .pf-sheet { grid-area: sheet; }
}

/* ---------- the bar ---------- */
.pf-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 5px 6px 5px 14px; border-radius: 10px;
  background: linear-gradient(180deg, #2a1c12, #170f09); border: 1px solid color-mix(in srgb, var(--tool) 45%, transparent); color: #f6ead3; }
.pf-info { min-width: 0; font: 700 12.5px Georgia, 'Times New Roman', serif; letter-spacing: .3px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.pf-tool { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 36px; height: 36px; padding: 0; border-radius: 8px; cursor: pointer;
  color: #f6ead3; font: 700 12.5px 'Inter', system-ui, sans-serif; background: linear-gradient(180deg, #3a2618, #22160d); border: 1px solid color-mix(in srgb, var(--tool) 55%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,235,200,.12); }
.pf-tool:hover { border-color: var(--tool); }
.pf-tool svg.i { width: 17px; height: 17px; }
.pf-tool.wide { width: auto; padding: 0 12px; white-space: nowrap; }
.pf-tool.hidden { display: none; }
.pf-tool > b { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; display: grid; place-items: center;
  font-size: 10.5px; color: #fff; background: #8e1b24; }
.pf-tool > b.hidden { display: none; }
.pf-tool.pf-leave:hover { border-color: #e06a5a; color: #ffc4b8; }
.pf-mute .tv-snd-off { display: none; }
body.tv-muted .pf-mute .tv-snd-off { display: inline; } body.tv-muted .pf-mute .tv-snd-on { display: none; }
.pf-tool.pf-sheet-b { display: none; }

/* ---------- the table: a wooden rim, tooled leather, the lamp's light ---------- */
.pf-table { position: relative; min-height: 0; border-radius: 140px; isolation: isolate;
  background: radial-gradient(ellipse 46% 52% at 50% 46%, rgba(255,214,150,.22), transparent 72%),
    repeating-radial-gradient(ellipse at 50% 50%, rgba(0,0,0,.03) 0 2px, transparent 2px 5px),
    radial-gradient(ellipse 70% 70% at 50% 45%, var(--l1), var(--l2) 65%, var(--l3));
  box-shadow: inset 0 0 0 10px var(--rim1), inset 0 0 0 13px var(--rim2), inset 0 0 0 15px color-mix(in srgb, var(--tool) 70%, transparent),
    inset 0 0 0 26px rgba(0,0,0,.12), inset 0 0 0 27px color-mix(in srgb, var(--tool) 45%, transparent), inset 0 0 80px rgba(0,0,0,.65),
    0 26px 44px -20px rgba(0,0,0,.95); }
.pf-table::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 1px, transparent 1px 4px), radial-gradient(ellipse 30% 12% at 50% 6%, rgba(255,235,200,.12), transparent 70%); }
/* bordeaux velvet (as in the game's picture): no wooden rim — deep velvet under a lamp, a gold hairline, softer corners */
.pft-bordeaux { --l1: #6b1d27; --l2: #3a0e15; --l3: #14070a; --rim1: #14070a; --rim2: #14070a; --tool: #c9a45c; --ink: #f7ecd6; }
.pft-bordeaux .pf-table { border-radius: 48px;
  background: radial-gradient(ellipse 50% 40% at 50% 26%, rgba(255,217,160,.2), transparent 75%),
    radial-gradient(ellipse 75% 75% at 50% 42%, var(--l1), var(--l2) 58%, var(--l3));
  box-shadow: inset 0 0 0 9px var(--l3), inset 0 0 0 10px rgba(201,164,92,.55), inset 0 0 70px rgba(0,0,0,.6), 0 26px 44px -20px rgba(0,0,0,.95); }
.pft-bordeaux .pf-table::before { background: repeating-linear-gradient(115deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px); }

/* ---------- the others ---------- */
.pf-opps { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.pf-opp { position: absolute; top: 15%; display: grid; justify-items: center; gap: 6px; width: min(230px, 30%); }
.pf-opp.at-l { left: 6%; } .pf-opp.at-r { right: 6%; }
.pf-plate { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 30px; background: rgba(18,10,6,.72);
  border: 1px solid color-mix(in srgb, var(--tool) 50%, transparent); box-shadow: 0 6px 14px -8px rgba(0,0,0,.8); }
.pf-opp.turn .pf-plate { border-color: var(--tool); box-shadow: 0 0 0 1px var(--tool), 0 0 22px -4px var(--tool); }
.pf-av { position: relative; display: grid; place-items: center; width: 42px; height: 42px; padding: 3px; box-sizing: border-box; border-radius: 50%; flex: none; }
.pf-av.sm { width: 26px; height: 26px; padding: 2px; display: inline-grid; vertical-align: middle; margin-right: 6px; }
.pf-tring { position: absolute; inset: 0; border-radius: 50%; background: rgba(255,255,255,.1); }
.pf-opp.turn .pf-tring, .pf-dock.my-turn .pf-tring { background: conic-gradient(var(--tool) calc(var(--k, 1) * 360deg), rgba(255,255,255,.08) 0); filter: drop-shadow(0 0 6px var(--tool)); }
.pf-avi { position: relative; display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; color: #fff; font-weight: 900; font-size: 16px;
  background: radial-gradient(circle at 35% 28%, rgba(255,255,255,.4), transparent 45%), var(--bg); box-shadow: 0 0 0 1.5px rgba(0,0,0,.6); }
.pf-avi svg.i { width: 20px; height: 20px; } .pf-avi .ava-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pf-pn { display: grid; line-height: 1.15; min-width: 0; }
.pf-pn b { font: 700 13px Georgia, 'Times New Roman', serif; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-pn small { font-size: 10.5px; font-weight: 700; opacity: .65; }
.pf-pts { font: 900 15px Georgia, serif; color: var(--tool); font-variant-numeric: tabular-nums; padding-left: 6px; border-left: 1px solid rgba(255,255,255,.15); }
.pf-backs { position: relative; display: block; width: 110px; height: 44px; }
.pf-backs i { position: absolute; left: 50%; bottom: 0; width: 24px; aspect-ratio: 2 / 3; margin-left: -12px; transform-origin: 50% 140%; transform: rotate(calc(var(--k) * 7deg));
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.pf-backs i .pfsvg { display: block; width: 100%; height: 100%; }
.pf-meta { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.pf-say { padding: 3px 10px; border-radius: 6px; font: 800 12px Georgia, serif; background: #f3e7cc; color: #1b1712; box-shadow: 0 3px 8px -3px rgba(0,0,0,.6), inset 0 0 0 1px rgba(0,0,0,.15); }
.pf-say.red { color: #8e1b24; } .pf-say.nt { color: #4a3a10; }
.pf-say.pass { background: rgba(255,255,255,.12); color: var(--ink); opacity: .75; font-style: italic; }
.pf-say.play { background: color-mix(in srgb, var(--tool) 85%, #000); color: #1b1006; }
.pf-say.dec { box-shadow: 0 0 0 2px var(--tool), 0 0 14px -2px var(--tool); }
.pf-say.write { background: #f6ead3; color: #3a2a1a; font-style: italic; border: 1px dashed #8e1b24; }
.pf-tricks { display: inline-flex; align-items: center; gap: 2px; }
.pf-tricks i { width: 8px; height: 11px; border-radius: 2px; background: linear-gradient(160deg, #6e1f22, #2a0a0c); border: 1px solid var(--tool); }
.pf-tricks b { margin-left: 4px; font: 900 13px Georgia, serif; color: var(--tool); }

/* ---------- the middle: the medallion, the talon, the trick ---------- */
.pf-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; width: calc(var(--cw) * 3.6); height: calc(var(--cw) * 3); }
.pf-medal { position: absolute; left: 50%; top: 50%; width: calc(var(--cw) * 1.25); height: calc(var(--cw) * 1.25); transform: translate(-50%, -50%); border-radius: 50%;
  display: grid; place-items: center; align-content: center; gap: 0; text-align: center; color: #2a1a06;
  background: radial-gradient(circle at 35% 30%, #fff1c4, #e3b85c 40%, #a8782a 75%, #6e4c14); box-shadow: 0 0 0 3px #3a2408, 0 0 0 5px color-mix(in srgb, var(--tool) 80%, transparent),
    0 10px 20px -6px rgba(0,0,0,.8), inset 0 2px 6px rgba(255,255,255,.5), inset 0 -6px 10px rgba(0,0,0,.25); transition: transform .3s; }
.pf-medal b { font: 900 calc(var(--cw) * .44) / 1 Georgia, serif; }
.pf-medal span { font: 900 calc(var(--cw) * .32) / 1 Georgia, serif; }
.pf-medal.red span { color: #8e1b24; }
.pf-medal small { font: 800 calc(var(--cw) * .11) 'Inter', system-ui, sans-serif; letter-spacing: .5px; text-transform: uppercase; opacity: .7; margin-top: 2px; }
.pf-medal.empty .pf-mlogo { font: 900 calc(var(--cw) * .5) / 1 Georgia, serif; opacity: .8; }
.pf-medal.final { animation: pfMedal .6s cubic-bezier(.3,1.5,.5,1); }
@keyframes pfMedal { from { transform: translate(-50%, -50%) scale(1.25); filter: brightness(1.4); } }
.pf-talon { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 2; }
.pf-talon.hidden { display: none; }
.pf-talon .pfc { position: absolute; width: calc(var(--cw) * .8); filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
.pf-talon .pfc.t1 { left: calc(var(--cw) * -1.25); top: calc(var(--cw) * -1.65); transform: rotate(-8deg); }
.pf-talon .pfc.t2 { left: calc(var(--cw) * .45); top: calc(var(--cw) * -1.65); transform: rotate(7deg); }
.pf-talon .pfc.open { animation: pfFlip .5s ease-out backwards; }
.pf-talon .pfc.t2.open { animation-delay: .15s; }
@keyframes pfFlip { from { transform: rotateY(90deg) scale(.9); } }
.pf-trick { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.pf-trick .pfc { position: absolute; left: 50%; top: 50%; width: var(--cw); filter: drop-shadow(0 5px 8px rgba(0,0,0,.55)); }
.pf-trick .pfc.p-b { transform: translate(-50%, -6%) rotate(-3deg); }
.pf-trick .pfc.p-l { transform: translate(-128%, -78%) rotate(-12deg); }
.pf-trick .pfc.p-r { transform: translate(28%, -78%) rotate(11deg); }
.pf-trick .pfc.land { animation: none; }       /* (the card arrives and simply lies there: no flash, no bounce) */
@keyframes pfLand { from { filter: brightness(1.35) drop-shadow(0 14px 16px rgba(0,0,0,.6)); scale: 1.15; } }

/* ---------- the word in the middle ---------- */
.pf-banner { position: absolute; left: 50%; top: 9%; z-index: 25; transform: translateX(-50%); max-width: min(90%, 520px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none; padding: 8px 18px; border-radius: 6px; font: 700 15px Georgia, 'Times New Roman', serif; letter-spacing: .3px; color: #1b1712;
  background: linear-gradient(180deg, #fbf3e0, #ecdcb8); box-shadow: 0 10px 22px -10px rgba(0,0,0,.9), inset 0 0 0 1px rgba(0,0,0,.2); animation: pfBan .3s ease-out; }
.pf-banner.blank { display: none; }
.pf-banner.good { background: linear-gradient(180deg, #f6dc95, #c9973e); }
.pf-banner.gold { box-shadow: 0 0 0 2px var(--tool), 0 10px 22px -10px rgba(0,0,0,.9); }
.pf-banner.mute { opacity: .85; font-style: italic; }
@keyframes pfBan { from { opacity: 0; transform: translate(-50%, -6px); } }
.pf-table > .paused21 { z-index: 26; }

/* ---------- the time round the leather ---------- */
/* (the turn's line round the table: on its own layer — it changes every frame, the table under it is not drawn again) */
.pf-timer { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; overflow: visible; will-change: transform; }
.pf-timer rect { fill: none; stroke-width: 3; }
.pf-timer .tr-bg { stroke: rgba(0,0,0,.25); }
.pf-timer .tr-fg { stroke: color-mix(in srgb, var(--ink) 50%, transparent); stroke-linecap: round; stroke-dasharray: 100 100; }
.pf-timer.mine .tr-fg { stroke: var(--tool); }
/* the glow: a soft line under the line (was a filter, drawn again every frame) */
.pf-timer .tr-g1 { stroke-linecap: round; stroke-dasharray: 100 100; opacity: 0; transition: opacity .3s; }
.pf-timer.mine .tr-g1 { opacity: 1; stroke: var(--tool); stroke-width: 10; stroke-opacity: .3; }
.pf-timer.low .tr-fg { stroke: #e0574a; animation: pfLow .6s ease-in-out infinite alternate; }
.pf-timer.idle .tr-fg, .pf-timer.idle .tr-head, .pf-timer.idle .tr-g1 { opacity: 0; }
.pf-timer .tr-head { fill: #fff5e0; filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 8px var(--tool)); }
@keyframes pfLow { to { stroke-width: 5; } }

/* ---------- the bidding box ---------- */
.pf-bid { position: absolute; left: 50%; bottom: 10px; z-index: 30; transform: translateX(-50%); width: min(380px, 94%); padding: 10px 12px 12px; border-radius: 10px;
  background: linear-gradient(180deg, #2c1d12, #170e08); border: 1px solid var(--tool); box-shadow: 0 18px 40px -16px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,230,190,.12); animation: pfIn .25s ease-out; }
.pf-bid.hidden { display: none; }
@keyframes pfIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.pf-bb-h { text-align: center; font: 700 13px Georgia, serif; color: #f6ead3; margin-bottom: 8px; letter-spacing: .3px; }
.pf-bb-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.pf-bb { display: flex; align-items: baseline; justify-content: center; gap: 3px; padding: 6px 0; border-radius: 5px; cursor: pointer; font: 900 15px Georgia, serif;
  background: linear-gradient(180deg, #fbf3e0, #e8d8b2); color: #1b1712; border: 0; box-shadow: 0 2px 0 #8a6a3a, inset 0 0 0 1px rgba(0,0,0,.12); transition: transform .12s, filter .12s; }
.pf-bb i { font-style: normal; font-size: 14px; } .pf-bb.red i { color: #8e1b24; } .pf-bb.nt i { font-size: 10px; letter-spacing: .3px; color: #4a3a10; }
.pf-bb:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }
.pf-bb:disabled { opacity: .28; cursor: default; box-shadow: none; }
.pf-bb.on { background: linear-gradient(180deg, #f6dc95, #c9973e); box-shadow: 0 0 0 2px #fff6dc, 0 0 14px -2px var(--tool); }
.pf-bb-acts { display: flex; justify-content: center; margin-top: 10px; }
.pf-btn { min-height: 38px; padding: 0 22px; border-radius: 6px; cursor: pointer; font: 700 14px Georgia, serif; letter-spacing: .3px; border: 0; transition: transform .12s; }
.pf-btn:active { transform: translateY(1px); }
.pf-btn.hidden { display: none; }
.pf-btn.pass { background: #3a2a1e; color: #f6ead3; border: 1px solid rgba(255,235,200,.3); }
/* "I write": the paper's own colour, a pen line */
.pf-btn.write { background: linear-gradient(180deg, #fbf6e8, #efe4c8); color: #3a2a1a; border: 1px dashed #8e1b24; font-style: italic; }
.pf-btn.go, .pf-btn.play { background: linear-gradient(180deg, #f6dc95, #c9973e); color: #1b1006; box-shadow: 0 3px 0 #6e4c14; }
.pf-btn.go:disabled { opacity: .4; }

/* ---------- you ---------- */
.pf-me { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.pf-dock { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; padding: 8px 200px; border-radius: 10px; min-width: 0; text-align: center;
  background: linear-gradient(180deg, #2a1c12, #170f09); border: 1px solid color-mix(in srgb, var(--tool) 40%, transparent); color: #f6ead3; }
.pf-dock.my-turn { border-color: var(--tool); box-shadow: 0 0 22px -8px var(--tool); }
.pf-who { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 12px; }
.pf-meinfo { display: flex; align-items: center; gap: 10px; }
.pf-mepts { display: grid; line-height: 1.05; text-align: left; }
.pf-mepts b { font: 900 20px Georgia, serif; color: var(--tool); }
.pf-mepts small { font-size: 10.5px; font-weight: 700; opacity: .65; white-space: nowrap; }
.pf-dock .turnlbl { display: flex; justify-content: center; gap: 10px; margin: 0; max-width: 100%; }
.pf-dock .turnlbl b { font: 700 14px Georgia, serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-dock .turnlbl span { font-size: 12px; font-weight: 700; opacity: .65; white-space: nowrap; }
.pf-dock .tbar { display: none; }
.pf-acts { display: flex; justify-content: center; gap: 10px; }
.pf-hand { display: flex; justify-content: center; align-items: flex-end; min-width: 0; overflow: hidden; --ov: .2;
  padding: 26px 8px calc(30px + env(safe-area-inset-bottom)); min-height: calc(var(--cw) * 1.5 + 46px); }
/* (the cards a little higher: the ends of the fan drop with the arc and stay on the screen) */
.pf-hc { position: relative; flex: none; width: var(--cw); aspect-ratio: 2 / 3; padding: 0; border: 0; background: none; cursor: pointer; margin-left: calc(var(--cw) * var(--ov) * -1);
  border-radius: calc(var(--cw) * .065); filter: drop-shadow(0 4px 6px rgba(0,0,0,.55)); transform: translateY(calc(var(--d) * var(--d) * .6px)) rotate(calc(var(--d) * 1.5deg));
  transform-origin: 50% 120%; transition: transform .18s, filter .2s, opacity .2s; }
.pf-hc:first-child { margin-left: 0; }
.pf-hc.no { opacity: .5; filter: saturate(.6) brightness(.85) drop-shadow(0 4px 6px rgba(0,0,0,.5)); cursor: default; }
.pf-hc.ok { transform: translateY(calc(var(--d) * var(--d) * .6px - 12px)) rotate(calc(var(--d) * 1.5deg)); filter: drop-shadow(0 0 9px color-mix(in srgb, var(--tool) 80%, transparent)) drop-shadow(0 6px 8px rgba(0,0,0,.55)); }
/* (on hover only the picture rises: the card's place stays under the pointer, so it does not flicker at its lower edge) */
.pf-hc .pfsvg { transition: transform .18s; }
.pf-hc.ok:hover { z-index: 5; }
.pf-hc.ok:hover > .pfsvg { transform: translateY(-28px) scale(1.06); }
.pf-hc.pick:hover > .pfsvg { transform: translateY(-10px); }
.pf-hc.sel { z-index: 4; transform: translateY(-34px) rotate(0); filter: drop-shadow(0 0 0 #8e1b24) drop-shadow(0 0 12px rgba(142,27,36,.9)) drop-shadow(0 10px 12px rgba(0,0,0,.6)); }
.pf-hc.sel::after { content: '✕'; position: absolute; top: -10px; right: -8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font: 900 12px 'Inter', sans-serif; color: #fff; background: #8e1b24; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.pf-hc.came { animation: pfCame .45s cubic-bezier(.3,1.3,.5,1); }
@keyframes pfCame { from { transform: translateY(-70px) rotate(-10deg) scale(.7); opacity: 0; } }
.pf-hc.gone { opacity: 0; transform: translateY(-20px) scale(.9); transition: opacity .1s, transform .1s; }
.pf-hand.dealt .pf-hc { animation: pfDeal .5s cubic-bezier(.3,1.2,.5,1) backwards; animation-delay: calc(var(--i) * 70ms + .1s); }
@keyframes pfDeal { from { transform: translateY(-170px) rotateY(90deg) scale(.6); opacity: 0; } }
.pf-hc.nope { animation: pfNope .35s; }
@keyframes pfNope { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }

/* ---------- the score sheet: a pad of paper ---------- */
.pf-sheet { min-height: 0; display: flex; flex-direction: column; padding: 14px 12px 12px; border-radius: 4px; color: #2a2016;
  background: repeating-linear-gradient(180deg, transparent 0 23px, rgba(60,90,160,.18) 23px 24px), linear-gradient(180deg, #fbf6e8, #efe4c8);
  box-shadow: 0 1px 0 #d9ccaa, 0 2px 0 #fbf6e8, 0 3px 0 #d9ccaa, 0 14px 30px -12px rgba(0,0,0,.8); border-left: 2px solid rgba(190,60,60,.45); }
.pf-sheet h3 { margin: 0 0 6px; font: italic 700 17px Georgia, 'Times New Roman', serif; text-align: center; color: #3a2a1a; }
.pf-sheet-in { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.pf-sheet table { width: 100%; border-collapse: collapse; font: 700 13px 'Segoe Print', 'Bradley Hand', 'Comic Neue', Georgia, cursive; font-variant-numeric: tabular-nums; }
.pf-sheet th { font: 800 11px 'Inter', sans-serif; text-align: center; padding: 3px 2px; border-bottom: 1.5px solid #3a2a1a; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-sheet th.me { color: #8e1b24; }
.pf-sheet td { text-align: center; padding: 2px; height: 22px; color: #1f3a7a; }
.pf-sheet td:first-child { color: #6a5a40; text-align: left; font-size: 11px; }
.pf-sheet td:first-child small { display: block; font-size: 10px; line-height: 1; } .pf-sheet td small.red { color: #8e1b24; }
.pf-sheet td.dec { text-decoration: underline; text-decoration-color: rgba(142,27,36,.5); }
.pf-sheet tr.tot td { border-top: 1.5px solid #3a2a1a; font-size: 15px; color: #8e1b24; padding-top: 4px; }
.pf-sheet tr.kasa td { border-top: 1.5px solid #3a2a1a; font-size: 14px; color: #3a2a1a; padding-top: 4px; }
.pf-sheet td small.red { display: block; font-size: 10px; line-height: 1; color: #8e1b24; }

/* ---------- the end of a hand ---------- */
.pf-res { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 12px; pointer-events: none; }
.pf-res.hidden { display: none; }
.pf-res-in { pointer-events: auto; width: min(540px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; box-sizing: border-box; padding: 18px 20px; border-radius: 6px; color: #2a2016;
  background: linear-gradient(180deg, #fbf3e0, #ecdcb8); box-shadow: 0 0 0 1px #8a6a3a, 0 0 0 6px rgba(42,26,12,.9), 0 0 0 7px #c9973e, 0 30px 70px -20px rgba(0,0,0,.95); animation: pfIn2 .3s ease-out; }
@keyframes pfIn2 { from { transform: scale(.94); opacity: 0; } }
.pf-res-in h3 { margin: 0 0 10px; text-align: center; font: 700 20px Georgia, 'Times New Roman', serif; color: #3a2010; }
.pf-res-note { margin: -4px 0 10px; text-align: center; font-size: 12.5px; font-style: italic; color: #8e1b24; }
.pf-rt { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.pf-rt th { padding: 6px 6px; font-size: 11.5px; font-weight: 800; text-align: right; border-bottom: 1.5px solid #3a2a1a; color: #5a4430; }
.pf-rt th:first-child { text-align: left; }
.pf-rt td { padding: 6px; text-align: right; border-bottom: 1px solid rgba(58,42,26,.15); }
.pf-rt td:first-child { text-align: left; font-weight: 700; white-space: nowrap; }
.pf-rt tr.dec td { background: rgba(201,151,62,.18); }
.pf-rt td.g { font-weight: 800; color: #1f3a7a; } .pf-rt td.k { font-weight: 800; color: #3a2a1a; } .pf-rt td.k small { color: #8e1b24; font-weight: 700; }
.pf-res-note.u { font-style: normal; opacity: .8; } .pf-rt td.tot { font: 900 15px Georgia, serif; color: #8e1b24; }
.pf-res-n { margin: 12px 0 0; text-align: center; font-size: 12px; color: #6a5a40; }

/* ---------- home and my look ---------- */
.hero-pf .pf-art { display: flex; justify-content: center; padding: 4px 0 10px; }
.hero-pf .pf-art img { display: block; width: 100%; max-width: 320px; height: auto; filter: drop-shadow(0 14px 18px rgba(0,0,0,.55)); }
.pf-rounds { display: grid; grid-template-columns: repeat(3, 1fr); }
/* (always three at the table: no slider for the players, only the seats) */
body.game-prefa #rPlayers, body.game-prefa #rPlayers + .ticks { display: none; }
.pf-rounds button { font-size: 12.5px; font-weight: 900; }
.pf-lk { position: relative; display: block; width: 100%; height: 100%; min-height: 60px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, var(--l1), var(--l2) 70%, var(--l3)); box-shadow: inset 0 0 0 3px var(--rim1), inset 0 0 0 4px var(--tool); }
.pf-lk-c { position: absolute; top: 50%; width: 28%; max-width: 46px; aspect-ratio: 2 / 3; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); }
.pf-lk-c .pfsvg { width: 100%; height: 100%; display: block; }
.pf-lk-c.b { left: 30%; transform: translate(-50%, -50%) rotate(-9deg); } .pf-lk-c.f { left: 64%; transform: translate(-50%, -50%) rotate(7deg); }
.logo-pf { width: 36px; height: 36px; flex: none; } .logo-pf img { width: 36px; height: 36px; display: block; filter: drop-shadow(0 3px 5px rgba(0,0,0,.45)); }

@media (prefers-reduced-motion: reduce) { .pf-medal.final, .pf-talon .pfc.open, .pf-timer.low .tr-fg { animation: none !important; } }

/* ---------- a computer: the tools on the table's corner; a smaller screen: the score sheet behind a button ---------- */
@media (min-width: 761px) and (min-height: 521px) {
  .pf-wrap { grid-template-rows: minmax(0, 1fr) auto; }
  .pf-top { position: absolute; top: 14px; right: 30px; z-index: 30; padding: 0; background: none; border: 0; }
  .pf-top .pf-info { display: none; }
}
@media (max-width: 1179px), (max-height: 520px) {
  .pf-tool.pf-sheet-b { display: inline-flex; }
  .pf-sheet { position: absolute; right: 10px; top: 56px; z-index: 50; width: min(280px, calc(100% - 20px)); max-height: 60%; display: none; }
  .pf-sheet.open { display: flex; }
}
@media (min-width: 761px) and (min-height: 521px) and (max-width: 1179px) { .pf-sheet { top: 60px; right: 30px; } }
/* (the score sheet beside the table: the tools stay on the table's corner, not over the sheet) */
@media (min-width: 1180px) and (min-height: 521px) { .pf-top { right: calc(250px + 8px + 30px); } }
/* ---------- a phone ---------- */
@media (max-width: 760px) {
  .pf-wrap { --cw: clamp(40px, 11.5vw, 58px); }
  .pf-table { border-radius: 60px; }
  .pf-opp { top: 9%; width: 46%; } .pf-opp.at-l { left: 2%; } .pf-opp.at-r { right: 2%; }
  .pf-av { width: 32px; height: 32px; padding: 2px; } .pf-pn b { font-size: 11.5px; max-width: 70px; } .pf-pn small { display: none; }
  .pf-backs { width: 70px; height: 30px; } .pf-backs i { width: 16px; margin-left: -8px; }
  /* (your own plate shows here too, small, beside what to do: the kasa, the kapikia, the dealer, your tricks) */
  .pf-dock { padding: 7px 10px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; text-align: left; }
  .pf-who { position: static; transform: none; flex: none; gap: 6px; }
  .pf-who .pf-av { width: 30px; height: 30px; padding: 2px; }
  .pf-meinfo { gap: 6px; } .pf-mepts b { font-size: 15px; } .pf-mepts small { font-size: 9.5px; }
  .pf-dock .turnlbl { flex: 1; min-width: 0; flex-direction: column; gap: 0; align-items: flex-start; }
  .pf-dock .turnlbl b { white-space: normal; font-size: 12.5px; line-height: 1.25; }
  .pf-tool { width: 32px; height: 32px; }
  .pf-bid { width: min(340px, 96%); padding: 8px; } .pf-bb { padding: 5px 0; font-size: 13px; }
}
@media (max-width: 760px) and (orientation: portrait) { .pf-table { align-self: center; height: min(100%, 130vw); } }
@media (orientation: landscape) and (max-height: 520px) {
  body.game-prefa[data-page="table"] .top { display: none; }
  body.game-prefa[data-page="table"] #table.page { height: 100dvh; margin: 0; padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(2px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .pf-wrap { --cw: clamp(34px, 9.5vh, 50px); gap: 4px; }
  .pf-table { border-radius: 70px; }
  .pf-dock { padding: 4px 8px; gap: 6px; flex-direction: row; align-items: center; justify-content: center; }
  .pf-who { position: static; transform: none; flex: none; gap: 6px; } .pf-who .pf-av { width: 26px; height: 26px; padding: 2px; }
  .pf-mepts b { font-size: 14px; } .pf-mepts small { font-size: 9px; }
  .pf-hand { padding-top: 12px; min-height: calc(var(--cw) * 1.5 + 12px); }
  .pf-tool { width: 30px; height: 30px; }
  .pf-bid { bottom: 4px; padding: 6px; } .pf-bb { padding: 3px 0; font-size: 12px; }
}
