/* fonts, served from our own site */
@font-face { font-family: 'Pacifico'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/pacifico.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/fraunces.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/fraunces-600.woff2) format('woff2'); }
.fName { font-family: 'Pacifico', cursive; font-weight: 400; }
.fSoft { font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-variation-settings: "SOFT" 100; }

/* Kitchen Table: an old wooden table, a green felt mat, faces in the seats around it.
   Sideways screens: faces in the corners and along the sides. Upright phones: faces in a row on top. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #5a3b20; color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }

#wood { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }

/* ---------- plain screens (front page, join, who are you) ---------- */
#screen { position: fixed; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 20px;
  overflow-y: auto; }
#screen:empty { display: none; }
.box { background: #f4ead8; color: #3b2412; border-radius: 22px; padding: 28px 26px; width: min(520px, 100%);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); text-align: center; border: 6px solid #4a2f18; margin: auto; }
.box h1 { margin: 0 0 8px; font-size: 34px; }
.box p { font-size: 20px; line-height: 1.4; margin: 10px 0 18px; }
.box input { width: 100%; font-size: 26px; padding: 14px 16px; border-radius: 14px; border: 3px solid #8a6240;
  background: #fff; color: #222; margin: 6px 0 16px; text-align: center; user-select: text; -webkit-user-select: text; }
.big { display: block; width: 100%; font-size: 26px; font-weight: 800; padding: 18px 20px; border-radius: 16px; border: 0;
  background: #2e7d4a; color: #fff; box-shadow: 0 4px 0 #1d5432; margin: 10px 0; }
.big:active { transform: translateY(3px); box-shadow: 0 1px 0 #1d5432; }
.whoRow { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.whoBtn { font-size: 22px; font-weight: 800; padding: 12px 22px; border-radius: 14px; border: 0; background: #8a5a2e; color: #fff;
  box-shadow: 0 3px 0 #5a3a1a; min-width: 110px; }
.small { font-size: 18px; padding: 10px 16px; border-radius: 12px; border: 2px solid #8a6240; background: #fff8ec; color: #3b2412; margin: 6px 4px; }
.linkBox { background: #fff; border: 2px dashed #8a6240; border-radius: 12px; padding: 12px; font-size: 18px; word-break: break-all;
  user-select: all; -webkit-user-select: all; color: #222; }
.box input.codeIn { letter-spacing: 6px; font-weight: 800; text-transform: uppercase; }
.codeShow { letter-spacing: 4px; font-size: 26px; }
.box .note { font-size: 17px; color: #6b4a2c; }
.box hr { border: 0; border-top: 2px solid #d9c6a6; margin: 22px 0; }

/* ---------- front page: the green felt on the wood, games lying loose around it ---------- */
#screen:has(.front) { padding: 12px; overflow: hidden; }
.front { margin: auto; width: 100%; display: flex; align-items: center; justify-content: center;
  --gw: clamp(64px, min(100vw, 100dvh) / 7.5, 110px); }
.frontFelt { flex: 0 1 500px; min-width: 0; border-radius: 28px; padding: 24px 30px 22px; text-align: center; color: #fff;
  background: radial-gradient(ellipse at center, #3d6e4c, #25472f); border: 8px solid #4a2f18;
  box-shadow: inset 0 0 26px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.5); }
.frontFelt .logo { width: 104px; height: 104px; display: block; margin: 0 auto 2px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); }
.frontFelt h1 { font-size: 52px; line-height: 1.2; margin: 0; color: #fff4e0; text-shadow: 0 3px 0 rgba(0,0,0,.25), 0 6px 14px rgba(0,0,0,.35); }
.frontFelt .tagline { font-size: 22px; color: #f4d58a; margin: 2px 0 10px; }
/* the name as a sign, like the address: a small OUR above, a small GAMES between two lines below */
.frontFelt h1 .fOur, .frontFelt h1 .fGames { display: block; color: #f4d58a; text-transform: uppercase; line-height: 1.3; text-shadow: 0 2px 4px rgba(0,0,0,.35); }
.frontFelt h1 .fOur { font-size: .42em; letter-spacing: .35em; padding-left: .35em; }
.frontFelt h1 .fGames { font-size: .33em; letter-spacing: .45em; display: flex; align-items: center; justify-content: center; gap: .6em; margin-bottom: .25em; }
.frontFelt h1 .fGames::before, .frontFelt h1 .fGames::after { content: ''; height: 2px; width: 2.5em; background: #f4d58a; opacity: .7; }
.frontFelt .welcome { font-size: 17px; line-height: 1.45; margin: 0 auto 18px; max-width: 400px; color: #e9f1ea; text-wrap: pretty; }
.frontFelt .codeQ { font-weight: 700; font-size: 18px; margin-bottom: 6px; }
.frontFelt input.codeIn { width: 100%; font-size: 26px; padding: 12px 16px; border-radius: 14px; border: 3px solid #4a2f18; background: #fff8ec;
  color: #3b2412; text-align: center; letter-spacing: 6px; font-weight: 800; text-transform: uppercase; font-family: inherit;
  user-select: text; -webkit-user-select: text; }
.frontFelt input.codeIn::placeholder { color: #cbb9a0; }
.joinBtn { display: block; width: 100%; font-size: 24px; font-weight: 800; padding: 14px; border-radius: 16px; border: 0; margin-top: 10px;
  background: #f4d58a; color: #3b2412; box-shadow: 0 4px 0 #b08d3c; }
.joinBtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b08d3c; }
.codeErr, .frontNote { font-size: 17px; font-weight: 700; color: #ffe2a8; margin: 10px 0 0; line-height: 1.35; }
.codeErr:empty { display: none; }
.startLine { margin-top: 14px; font-size: 16px; color: #e9f1ea; }
.inviteNote { margin: 8px auto 0; max-width: 30em; font-size: 14px; font-style: italic; line-height: 1.35; color: #e9f1ea; opacity: .85; }
.linkBtn { background: none; border: 0; padding: 4px 2px; font-size: inherit; font-weight: 700; color: #fff4e0; text-decoration: underline;
  text-underline-offset: 3px; }

/* every game is one loose thing on the wood; the layer itself lets touches through to the felt */
.frontPieces { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.piece { position: absolute; left: 0; top: 0; pointer-events: auto; touch-action: none; cursor: grab; will-change: transform; transition: filter .15s; }
.piece .gameCard { --tilt: 0deg !important; pointer-events: none; transition: transform .15s; }
.piece .gameCard:hover { transform: none; }
.piece .gameCard.look-plain .gn { padding: 0 4px; }
.piece.held { cursor: grabbing; filter: drop-shadow(0 18px 14px rgba(0,0,0,.35)); }
.piece.held .gameCard { transform: scale(1.07); }
.tidyBtn { position: fixed; top: 10px; left: 10px; z-index: 3; font-size: 16px; font-weight: 700; padding: 7px 14px; border-radius: 12px;
  border: 2px solid #8a6240; background: #fff8ec; color: #3b2412; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.tidyBtn:active { transform: translateY(2px); }
.gameCard { width: var(--gw); height: calc(var(--gw) * 1.38); flex: none; border-radius: 13px; background: #fff; color: #3b2412; border: 0;
  box-shadow: 0 8px 18px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: calc(var(--gw) * .07); padding: 6px; text-align: center; transform: rotate(var(--tilt, 0deg)); transition: transform .15s; }
.gameCard:hover { transform: rotate(var(--tilt, 0deg)) translateY(-4px); }
.gameCard .pip { font-size: calc(var(--gw) * .34); line-height: 1; font-weight: 900; }
.gameCard .pip svg { width: calc(var(--gw) * .42); height: calc(var(--gw) * .42); display: block; }
.gameCard .gn { font-size: calc(var(--gw) * .15); line-height: 1.1; text-wrap: balance; }
.gameCard.look-splash { background: #d94040; color: #fff; border: 5px solid #fff; }
.gameCard.look-splash .pip { background: #fff; color: #d94040; border-radius: 50%; width: calc(var(--gw) * .45); height: calc(var(--gw) * .45);
  display: flex; align-items: center; justify-content: center; }
.gameCard.look-doubt { background: repeating-linear-gradient(45deg, #2c4a7a 0 6px, #385b92 6px 12px); color: #fff; border: 5px solid #fff; }
.gameCard.look-doubt .pip { text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.gameCard.look-golf { background: #3f9d54; color: #fff; border: 5px solid #fff; }
.gameCard.look-golf .pip svg { filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.gameCard.look-plain .gn { font-size: calc(var(--gw) * .19); }
/* Full Moon: a harvest moon over pines in a night sky */
.gameCard.look-moon { background: linear-gradient(#0b0912, #22152e 58%, #3a2030); color: #ffd8a8; border: 5px solid #fff; position: relative; overflow: hidden; }
.gameCard.look-moon .pip svg { width: calc(var(--gw) * .78); height: calc(var(--gw) * .58); }
.gameCard.look-moon .gn { position: relative; }
/* Scrambled: loose letter cubes instead of a card (same look as the cubes in the game) */
.gameCard.look-cubes { background: none; box-shadow: none; padding: 0; position: relative; display: block; --s: calc(var(--gw) * .34); --edge: calc(var(--s) * .09); }
.fCube { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s); border-radius: 16%; rotate: var(--r);
  display: flex; align-items: center; justify-content: center; color: #3b2412;
  background: radial-gradient(circle at 32% 26%, #fffdf7, #f7ecd6 55%, #ead8b4);
  box-shadow: inset 0 -2px 3px rgba(120,80,30,.12), 0 var(--edge) 0 #b8976d, 0 calc(var(--edge) + 1px) 0 #8f6e4b, 0 calc(var(--edge) + 4px) 9px rgba(0,0,0,.45); }
.fCube b { font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-variation-settings: "SOFT" 100; font-size: calc(var(--s) * .58); line-height: 1; }
/* 10,000 and Hearts: loose dice or playing cards instead of a card, the name written on the wood under them */
.gameCard.look-dice, .gameCard.look-loose { background: none; box-shadow: none; padding: 0; position: relative; display: block; }
.gameCard.look-dice { --s: calc(var(--gw) * .3); --edge: calc(var(--s) * .09); }
.fDie { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 6%; }
.fDie i { display: block; width: 96%; height: 96%; margin: auto; border-radius: 50%; visibility: hidden; background: #3b2412;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.6); }
.fDie i.on { visibility: visible; }
.fDie.red i { background: #c0392b; }
.fPc { position: absolute; left: var(--x); top: var(--y); rotate: var(--r); width: calc(var(--gw) * .78); height: calc(var(--gw) * 1.08);
  border-radius: 10px; background: #fff; box-shadow: 0 6px 14px rgba(0,0,0,.45); font-family: Georgia, serif; font-weight: 900; }
.fPc.red { color: #c8202f; } .fPc.blk { color: #1f1f24; }
.fPcCorner { position: absolute; top: 5%; left: 7%; display: flex; flex-direction: column; align-items: center; line-height: .95; font-size: calc(var(--gw) * .16); }
.fPcCorner i { font-style: normal; font-size: calc(var(--gw) * .14); }
.fPcMid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; line-height: 1; font-size: calc(var(--gw) * .5); }
.fPcMid.face { font-size: calc(var(--gw) * .34); }
.fUnder { position: absolute; left: -10%; right: -10%; bottom: -6%; text-align: center; line-height: 1; font-size: calc(var(--gw) * .17);
  color: #fff4e0; text-shadow: 0 2px 4px rgba(0,0,0,.5); }

/* the pop-up: one box over a dim layer */
.popupDim { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.popup { background: #f4ead8; color: #3b2412; border-radius: 22px; border: 6px solid #4a2f18; padding: 20px 24px; width: min(520px, 100%);
  max-height: 100%; overflow-y: auto; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.popup h2 { margin: 0 0 4px; font-size: 30px; text-align: center; }
.popup h3 { margin: 14px 0 4px; font-size: 19px; }
.popup .players { margin: 0; text-align: center; font-weight: 700; font-size: 18px; color: #6b4a2c; }
.popup p { font-size: 18px; line-height: 1.4; margin: 10px 0; }
.popup ul { margin: 0; padding-left: 22px; font-size: 18px; line-height: 1.4; }
.popup li { margin: 6px 0; }
.clipSpot { aspect-ratio: 16 / 9; background: #2a1a0c; border-radius: 12px; margin-bottom: 14px; }
.popupClose { display: block; margin: 16px auto 0; font-size: 18px; padding: 10px 26px; border-radius: 12px; border: 2px solid #8a6240;
  background: #fff8ec; color: #3b2412; font-weight: 700; }

/* upright phones: the felt sits up top, smaller, and the games lie on the wood below it; nothing scrolls */
@media (max-width: 760px) and (orientation: portrait) {
  #screen:has(.front) { align-items: flex-start; padding: 50px 10px 10px; }
  .front { margin: 0 auto; --gw: 64px; }
  .frontFelt { flex: none; width: 100%; padding: 12px 16px 12px; border-width: 6px; }
  .frontFelt .logo { width: 54px; height: 54px; }
  .frontFelt h1 { font-size: 36px; line-height: 1.15; }
  .frontFelt .tagline { font-size: 18px; margin: 0 0 6px; }
  .frontFelt .welcome { font-size: 15px; line-height: 1.35; margin: 0 auto 10px; }
  .frontFelt .codeQ { font-size: 16px; margin-bottom: 4px; }
  .frontFelt input.codeIn { font-size: 22px; padding: 8px 12px; }
  .joinBtn { font-size: 20px; padding: 10px; margin-top: 8px; }
  .startLine { margin-top: 8px; font-size: 15px; }
  .inviteNote { margin-top: 4px; font-size: 13px; }
  .gameCard { border-radius: 10px; }
  .gameCard.look-splash, .gameCard.look-doubt, .gameCard.look-golf, .gameCard.look-moon { border-width: 4px; }
}
/* shorter upright phones (a phone browser's own bars take their share): a tighter felt, so there's wood for the games */
@media (max-width: 760px) and (orientation: portrait) and (max-height: 720px) {
  #screen:has(.front) { padding-top: 46px; }
  .frontFelt { padding: 8px 14px 8px; }
  .frontFelt .logo { width: 40px; height: 40px; }
  .frontFelt h1 { font-size: 29px; }
  .frontFelt .tagline { font-size: 16px; margin: 0 0 4px; }
  .frontFelt .welcome { font-size: 13px; margin: 0 auto 6px; }
  .frontFelt .codeQ { font-size: 14px; }
  .frontFelt input.codeIn { font-size: 19px; padding: 5px 10px; border-radius: 12px; }
  .joinBtn { font-size: 17px; padding: 7px; margin-top: 6px; border-radius: 12px; }
  .codeErr, .frontNote { font-size: 14px; margin-top: 6px; }
  .startLine { margin-top: 6px; font-size: 14px; }
  .inviteNote { font-size: 11px; }
  .linkBtn { padding: 2px; }
}
/* short sideways phones: tighter felt, smaller games on the wood beside it */
@media (max-height: 500px) and (orientation: landscape) {
  #screen:has(.front) { padding: 4px 12px; }
  .front { --gw: 60px; }
  .gameCard { border-radius: 10px; }
  .gameCard.look-splash, .gameCard.look-doubt, .gameCard.look-golf, .gameCard.look-moon { border-width: 4px; }
  .frontFelt { flex-basis: 420px; padding: 8px 18px 10px; border-width: 6px; }
  .frontFelt .logo { width: 50px; height: 50px; margin: 0 auto; }
  .frontFelt h1 { font-size: 30px; line-height: 1.25; }
  .frontFelt .tagline { font-size: 17px; margin: 0 0 4px; }
  .frontFelt .welcome { font-size: 14px; line-height: 1.35; margin: 0 auto 8px; max-width: 440px; }
  .frontFelt .codeQ { font-size: 15px; margin-bottom: 4px; }
  .frontFelt input.codeIn { font-size: 20px; padding: 6px 12px; border-radius: 12px; }
  .joinBtn { font-size: 19px; padding: 8px; margin-top: 6px; border-radius: 12px; }
  .codeErr, .frontNote { font-size: 14px; margin-top: 6px; }
  .startLine { margin-top: 6px; font-size: 14px; }
  .inviteNote { margin-top: 4px; font-size: 12px; }
  .linkBtn { padding: 2px; }
}

/* ---------- the table ---------- */
#table { position: fixed; inset: 0; z-index: 1; display: none; }
#table.on { display: block; }

#felt { position: absolute; left: 22%; right: 22%; top: 6%; bottom: 38%; border-radius: 28px;
  background: radial-gradient(ellipse at center, #3d6e4c, #25472f); border: 8px solid #4a2f18;
  box-shadow: inset 0 0 26px rgba(0,0,0,.5), 0 4px 12px rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; }
#piles { display: flex; gap: 36px; align-items: center; --cw: clamp(76px, 14vh, 140px); }
#drawPile { padding: 0; border: 0; background: none; border-radius: 12px; }
#drawPile { position: relative; }
#drawPile .left { position: absolute; left: 0; right: 0; top: calc(100% + 8px); font-size: 15px; font-weight: 700; color: #e8f2e8;
  text-shadow: 0 1px 2px rgba(0,0,0,.7); white-space: nowrap; }
#drawPile.empty .pc { opacity: .25; }
#drawPile.shuffling .pc { animation: shuffleShake .7s ease-in-out; }
@keyframes shuffleShake { 0%,100% { rotate: 0deg; } 20% { rotate: -8deg; } 40% { rotate: 7deg; } 60% { rotate: -5deg; } 80% { rotate: 3deg; } }
#drawPile.canDraw { box-shadow: 0 0 0 4px #ffd54a, 0 0 18px #ffd54a; }
#drawPile:disabled { cursor: default; }
/* Attack: a round push button by the draw pile */
#attackBtn { width: calc(var(--cw) * .62); height: calc(var(--cw) * .62); border-radius: 50%; border: 0; padding: 0; margin-right: -18px;
  background: #3a3a3a; box-shadow: 0 4px 8px rgba(0,0,0,.5), inset 0 -4px 0 rgba(0,0,0,.4); display: grid; place-items: center; }
#attackBtn span { width: 70%; height: 70%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff7a6a, #c62b1e 65%);
  box-shadow: 0 5px 0 #7d1a12, 0 6px 6px rgba(0,0,0,.4); transition: transform .08s, box-shadow .08s; }
#attackBtn.canPush { box-shadow: 0 0 0 4px #ffd54a, 0 0 18px #ffd54a, inset 0 -4px 0 rgba(0,0,0,.4); }
#attackBtn.pushed span, #attackBtn:active:not(:disabled) span { transform: translateY(4px); box-shadow: 0 1px 0 #7d1a12, 0 2px 3px rgba(0,0,0,.4); }
#attackBtn:disabled { cursor: default; }

#colors { position: absolute; inset: 0; background: rgba(20,40,25,.92); border-radius: 20px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; }
.colorsLine { font-size: 26px; font-weight: 800; }
.colorsRow { display: flex; gap: 14px; }
.colorsRow button { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.5); }
[data-color=r] { background: #d63c3c; } [data-color=b] { background: #2b78d8; }
[data-color=g] { background: #2e9e4f; } [data-color=y] { background: #f2b01e; }

#msgRow { position: absolute; left: 22%; right: 22%; top: calc(62% - 6px); display: flex; justify-content: center; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
#msg { background: rgba(0,0,0,.5); padding: 6px 18px; border-radius: 22px; font-size: 21px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#msg:empty { display: none; }
#msg.mine { background: #ffd54a; color: #3b2412; }
#passBtn, #passCardsBtn, #playCardsBtn { font-size: 22px; font-weight: 800; padding: 8px 26px; border-radius: 22px; border: 0; background: #fff8ec; color: #3b2412;
  box-shadow: 0 3px 0 #8a6240; }

/* your cards along the bottom */
#hand { position: absolute; left: 18%; right: 18%; bottom: 38px; height: calc(var(--cw) * 1.48 + 22px); display: flex;
  justify-content: center; align-items: flex-end; --cw: clamp(70px, 11vh, 118px); }
#hand .pc { margin-left: var(--overlap, 0px); transition: transform .12s; }
#hand .pc:first-child { margin-left: 0; }
#hand .pc.lift { transform: translateY(-18px); box-shadow: 0 0 0 4px #ffd54a, 0 0 16px #ffd54a, 0 6px 10px rgba(0,0,0,.5); cursor: pointer; }

#hand .pc { touch-action: none; }
#hand .pc.ghost { visibility: hidden; }
#hand .pc.lift.slap { box-shadow: 0 0 0 4px #ff5a3c, 0 0 18px #ff5a3c, 0 6px 10px rgba(0,0,0,.5); animation: slapPulse .8s ease-in-out infinite alternate; }
@keyframes slapPulse { to { transform: translateY(-24px); } }
/* Hearts: cards picked to pass lift; the 3 cards you were passed glow blue for a moment (no lift: only playable cards lift) */
#hand .pc.got:not(.lift) { box-shadow: 0 0 0 4px #7fd0ff, 0 0 16px #7fd0ff, 0 6px 10px rgba(0,0,0,.5); }
#hand .pc.lift.pick { box-shadow: 0 0 0 4px #fff, 0 0 14px #ffd54a, 0 6px 10px rgba(0,0,0,.5); }
#hand .pc.dragging { transition: none; z-index: 5; box-shadow: 0 10px 20px rgba(0,0,0,.55); }
/* Sort sits just under your cards */
#sortBtn { position: absolute; left: 50%; transform: translateX(-50%); bottom: 6px; z-index: 2;
  font-size: 15px; font-weight: 800; padding: 4px 12px; border-radius: 14px; border: 0; background: rgba(0,0,0,.45); color: #fff; }
.pc.flying { position: fixed; margin: 0; z-index: 20; transform-origin: 0 0; pointer-events: none; }

#colorBanner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 6px 22px; border-radius: 22px; font-size: 22px;
  font-weight: 800; color: #fff; white-space: nowrap; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.45); z-index: 1; }
#colorBanner[data-c=r] { background: #d63c3c; } #colorBanner[data-c=b] { background: #2b78d8; }
#colorBanner[data-c=g] { background: #2e9e4f; } #colorBanner[data-c=y] { background: #e0a00c; }
#colorBanner.pop { animation: bannerPop .45s ease-out; }
@keyframes bannerPop { 0% { transform: translateX(-50%) scale(.6); } 60% { transform: translateX(-50%) scale(1.12); } 100% { transform: translateX(-50%) scale(1); } }

#passCardsBtn:disabled, #playCardsBtn:disabled { opacity: .45; cursor: default; }

/* I Doubt It: the face-down pile, what was played, what's up next, the bar and the button */
#doubtArea { display: flex; align-items: center; gap: 30px; --cw: clamp(70px, 13vh, 128px); color: #fff; }
#doubtArea .dStack { position: relative; width: var(--cw); height: calc(var(--cw) * 1.48); margin-bottom: 26px; }
#doubtArea .dBacks .pc, #doubtArea .dShown .pc { position: absolute; left: 0; top: 0; }
#doubtArea .dBacks .pc:nth-child(2) { transform: translate(3px, -3px) rotate(2deg); }
#doubtArea .dBacks .pc:nth-child(3) { transform: translate(6px, -6px) rotate(-2deg); }
#doubtArea .dStack.empty .dBacks { width: 100%; height: 100%; border: 3px dashed rgba(255,255,255,.35); border-radius: calc(var(--cw) * .14); }
#doubtArea .dShown .pc { box-shadow: 0 6px 14px rgba(0,0,0,.55); animation: dFlip .3s ease-out both; }
#doubtArea .dShown.lied .pc.no { box-shadow: 0 0 0 4px #ff5a3c, 0 0 16px #ff5a3c; }
#doubtArea .dShown.truth .pc { box-shadow: 0 0 0 4px #7fe08a, 0 0 16px #7fe08a; }
@keyframes dFlip { from { transform: var(--at) rotateY(90deg); } to { transform: var(--at); } }
#doubtArea .dCount { position: absolute; left: 0; right: 0; top: calc(100% + 6px); text-align: center; font-size: 16px; font-weight: 700; color: #e8f2e8; white-space: nowrap; }
#doubtArea .dInfo { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
#doubtArea .dLast { font-size: 20px; font-weight: 700; }
#doubtArea .dLast:empty { display: none; }
#doubtArea .dNext { font-size: 24px; font-weight: 900; color: #ffd54a; }
#doubtArea .dTimer { width: 180px; max-width: 100%; height: 10px; border-radius: 6px; background: rgba(0,0,0,.35); overflow: hidden; }
#doubtArea .dTimer i { display: block; height: 100%; background: #ffd54a; transform-origin: left; animation: dShrink linear forwards; }
@keyframes dShrink { from { transform: scaleX(var(--from, 1)); } to { transform: scaleX(0); } }
#doubtBtn { font-size: 26px; font-weight: 900; padding: 12px 26px; border-radius: 18px; border: 0; background: #d23c2a; color: #fff; white-space: nowrap;
  box-shadow: 0 5px 0 #8e2417, 0 8px 16px rgba(0,0,0,.4); animation: doubtPop .25s ease-out; }
#doubtBtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #8e2417, 0 4px 10px rgba(0,0,0,.4); }
@keyframes doubtPop { 0% { transform: scale(.6); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* Hearts: the trick in the middle, each card pushed toward the side of the person who played it */
#trick { position: relative; --cw: clamp(60px, 10vh, 104px); width: calc(var(--cw) * 3.3); height: calc(var(--cw) * 2.8); }
#trick .pc { position: absolute; left: 50%; top: 50%; margin: calc(var(--cw) * -.74) 0 0 calc(var(--cw) * -.5); }
#trick .pc[data-side=S] { transform: translateY(calc(var(--cw) * .64)); }
#trick .pc[data-side=N] { transform: translateY(calc(var(--cw) * -.64)); }
#trick .pc[data-side=W] { transform: translateX(calc(var(--cw) * -1.05)) rotate(-6deg); }
#trick .pc[data-side=E] { transform: translateX(calc(var(--cw) * 1.05)) rotate(6deg); }
#trick .pc.won { box-shadow: 0 0 0 4px #ffd54a, 0 0 16px #ffd54a; }
#trick .pc.ghost { visibility: hidden; }

/* "Skipped!" over a face */
.skipTag { position: fixed; z-index: 21; transform: translate(-50%, -50%) rotate(-8deg); background: #b23a2a; color: #fff; font-weight: 900;
  font-size: 20px; padding: 6px 14px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.5); white-space: nowrap;
  pointer-events: none; animation: skipTag 1.8s ease-out forwards; }
@keyframes skipTag { 0% { opacity: 0; scale: .4; } 12% { opacity: 1; scale: 1.15; } 22% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- cards ---------- */
.pc { width: var(--cw, 80px); height: calc(var(--cw, 80px) * 1.48); border-radius: calc(var(--cw, 80px) * .14); background: #fff;
  padding: calc(var(--cw, 80px) * .07); box-shadow: 0 3px 6px rgba(0,0,0,.45); position: relative; flex: none; }
.pc .in { width: 100%; height: 100%; border-radius: calc(var(--cw, 80px) * .1); display: flex; align-items: center; justify-content: center; position: relative; }
.pc .val { width: 62%; aspect-ratio: 1; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--cw, 80px) * .4); font-weight: 900; line-height: 1; }
.pc .val.two { font-size: calc(var(--cw, 80px) * .3); }
.pc .val.three { font-size: calc(var(--cw, 80px) * .2); letter-spacing: -.02em; }
.pc .tl, .pc .br { white-space: nowrap; }
.pc .tl, .pc .br { position: absolute; font-size: calc(var(--cw, 80px) * .19); font-weight: 900; color: #fff; line-height: 1;
  text-shadow: 0 1px 1px rgba(0,0,0,.35); }
.pc .tl { top: 5%; left: 8%; } .pc .br { bottom: 5%; right: 8%; transform: rotate(180deg); }
.pc.r .in { background: #d63c3c; } .pc.r .val { color: #d63c3c; }
.pc.b .in { background: #2b78d8; } .pc.b .val { color: #2b78d8; }
.pc.g .in { background: #2e9e4f; } .pc.g .val { color: #2e9e4f; }
.pc.y .in { background: #f2b01e; } .pc.y .val { color: #c98a00; }
.pc.wild .in { background: #2a2a2a; }
.pc.wild .val { background: conic-gradient(#d63c3c 0 25%, #2b78d8 0 50%, #2e9e4f 0 75%, #f2b01e 0); color: #fff;
  border: 3px solid #fff; text-shadow: 0 0 4px #000, 0 0 2px #000; }
/* normal playing cards (Hearts) */
.pc.suit .in { background: #fff; border: 1px solid #e3ddd2; color: #1f1f24; flex-direction: column; }
.pc.suit.red .in { color: #c8202f; }
.pc.suit .mid { display: flex; flex-direction: column; align-items: center; line-height: .9; font-weight: 900; }
.pc.suit .mid b { font-size: calc(var(--cw, 80px) * .42); }
.pc.suit .mid.two b { font-size: calc(var(--cw, 80px) * .34); letter-spacing: -.04em; }
.pc.suit .mid i { font-style: normal; font-size: calc(var(--cw, 80px) * .34); }
.pc.suit .tl, .pc.suit .br { color: inherit; text-shadow: none; display: flex; flex-direction: column; align-items: center; font-size: calc(var(--cw, 80px) * .17); }
.pc.suit .tl i, .pc.suit .br i { font-style: normal; }
.pc.suit .tl { top: 4%; left: 5%; } .pc.suit .br { bottom: 4%; right: 5%; }
.pc.back .in { background: repeating-linear-gradient(45deg, #8e3b2f 0 6px, #a24a3c 6px 12px); }
.pc.back .in::after { content: ''; width: 46%; aspect-ratio: 1; border: 3px solid rgba(255,255,255,.85); border-radius: 50%; }
#pile .pc.tint-r { box-shadow: 0 0 0 4px #d63c3c, 0 3px 6px rgba(0,0,0,.45); }
#pile .pc.tint-b { box-shadow: 0 0 0 4px #2b78d8, 0 3px 6px rgba(0,0,0,.45); }
#pile .pc.tint-g { box-shadow: 0 0 0 4px #2e9e4f, 0 3px 6px rgba(0,0,0,.45); }
#pile .pc.tint-y { box-shadow: 0 0 0 4px #f2b01e, 0 3px 6px rgba(0,0,0,.45); }

/* ---------- seats (faces) ---------- */
#seats { position: absolute; inset: 0; pointer-events: none; }
.seat { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: auto;
  --fw: clamp(96px, 12vw, 150px); }
.seat .face { width: var(--fw); height: calc(var(--fw) * .75); border-radius: 12px; border: 4px solid #efe2cc; overflow: hidden;
  background: linear-gradient(#6d5a48, #4a3a2c); box-shadow: 0 3px 6px rgba(0,0,0,.45); position: relative; }
.seat .initial { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(var(--fw) * .34);
  font-weight: 800; color: #efe2cc; }
.seat .face svg { width: 100%; height: 100%; display: block; }
.miniFace { display: inline-block; width: 32px; height: 24px; border-radius: 6px; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.miniFace svg { width: 100%; height: 100%; display: block; }
.seat.turn .face { border-color: #ffd54a; box-shadow: 0 0 0 2px #ffd54a, 0 0 22px #ffd54a; }
.seat.away .face { opacity: .5; }
.seat .name[data-away="1"] { white-space: normal; text-align: center; }
.seat .name[data-away="1"]::after { content: '(away)'; display: block; font-size: 14px; font-weight: 600; opacity: .85; }
.seat .name { font-size: 18px; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.9); max-width: calc(var(--fw) + 20px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .cnt { display: flex; align-items: center; gap: 6px; background: #efe2cc; color: #4a2f18; border-radius: 14px; padding: 2px 10px 2px 6px;
  font-size: 17px; font-weight: 800; }
.seat .cnt.low { background: #ffd54a; }
.seat .cnt:empty { display: none; }
#mySeat .face { cursor: pointer; }
.seat .leaveMe { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; z-index: 5;   /* over the end-of-hand box (4), under the table panel (6) */
  font-size: 16px; font-weight: 800; padding: 6px 14px; border-radius: 14px; white-space: nowrap;
  background: #b23a2a; color: #fff; border: 2px solid #7d2418; box-shadow: 0 3px 6px rgba(0,0,0,.45); }
/* "Tap again to leave. A computer will play for you.": wraps, and app.js slides it back on screen if it would run off an edge */
.seat .leaveMe.sure { white-space: normal; width: max-content; max-width: min(240px, calc(100vw - 16px)); text-align: center; line-height: 1.25;
  translate: var(--nudge, 0) 0; }
#mySeat.leaving .leaveMe { display: block; }
/* swap-in: under the name of a seat the computer is playing, for someone watching */
.seat .takeOver { position: relative; z-index: 5; margin-top: 4px; font-size: 14px; font-weight: 800; padding: 4px 12px; border-radius: 14px;
  white-space: nowrap; background: #2f6b3a; color: #fff; border: 2px solid #1d4826; box-shadow: 0 3px 6px rgba(0,0,0,.45); cursor: pointer; }
.seat .takeOver:disabled { opacity: .6; }
@media (hover: hover) { #mySeat:hover .leaveMe { display: block; } }
.seat .cnt { flex-wrap: wrap; justify-content: center; max-width: calc(var(--fw) + 24px); }
.seat .cnt .n { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.seat .cnt .pts { color: #c8202f; white-space: nowrap; }
.seat .cnt .qs { color: #1f1f24; background: #fff; border-radius: 6px; padding: 0 4px; }
.seat .cnt .jd { color: #c62828; background: #fff; border-radius: 6px; padding: 0 4px; }
.fan { position: relative; width: 24px; height: 18px; display: inline-block; }
.fan i { position: absolute; width: 11px; height: 16px; border-radius: 2px; border: 1px solid #fff; background: #8e3b2f; bottom: 0; }
.fan i:nth-child(1) { left: 0; transform: rotate(-14deg); } .fan i:nth-child(2) { left: 6px; } .fan i:nth-child(3) { left: 12px; transform: rotate(14deg); }

/* sideways: seats go around the table clockwise; "you" in the lower left */
.seat[data-spot="L"]   { top: 33%; left: 12px; }
.seat[data-spot="TL"]  { top: 10px; left: 12px; }
.seat[data-spot="TL2"] { top: 10px; left: calc(12px + var(--fw) + 20px); }
.seat[data-spot="TR2"] { top: 10px; right: calc(12px + var(--fw) + 20px); }
.seat[data-spot="TR"]  { top: 10px; right: 12px; }
.seat[data-spot="R"]   { top: 33%; right: 12px; }
.seat[data-spot="BR"]  { bottom: 10px; right: 12px; }
#mySeat { bottom: 10px; left: 12px; --fw: clamp(80px, 9vw, 120px); }
/* looking over a shoulder: a smaller face just inside the player it looks at */
.seat.shoulder { --fw: clamp(60px, 7vw, 90px); z-index: 1; }
.seat.shoulder[data-spot="L"], .seat.shoulder[data-spot="TL"] { left: calc(24px + clamp(96px, 12vw, 150px)); }
.seat.shoulder[data-spot="TL2"] { left: calc(44px + 2 * clamp(96px, 12vw, 150px)); }
.seat.shoulder[data-spot="TR"], .seat.shoulder[data-spot="R"], .seat.shoulder[data-spot="BR"] { right: calc(24px + clamp(96px, 12vw, 150px)); }
.seat.shoulder[data-spot="TR2"] { right: calc(44px + 2 * clamp(96px, 12vw, 150px)); }
.seat.shoulder[data-spot="ME"] { bottom: 10px; left: calc(28px + clamp(80px, 9vw, 120px)); }
/* watching, not looking at anyone: small faces down the right side, between the top and bottom faces */
.seat.idle { --fw: clamp(54px, 6vw, 80px); right: 12px; top: calc(30% + var(--wi) * (clamp(54px, 6vw, 80px) * .75 + 34px)); }
.seat.idle .name { font-size: 14px; }
.seat.askable .face { cursor: pointer; }
#hand .pc.peek { cursor: default; filter: saturate(.85) brightness(.95); }
#peekBar { background: rgba(0,0,0,.5); color: #fff; padding: 5px 8px 5px 16px; border-radius: 22px; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; margin-left: 8px; white-space: nowrap; }
#peekBar.hidden { display: none; }
#peekBar button { font-size: 15px; padding: 4px 12px; margin: 0; }
#askBar { position: fixed; left: 50%; top: 60px; transform: translateX(-50%); z-index: 9; background: #f4ead8; color: #3b2412;
  border: 3px solid #c98a00; border-radius: 18px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  justify-content: center; font-size: 19px; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.45); max-width: calc(100% - 24px); }
#askBar.hidden { display: none; }
#askBar button { margin: 0; font-size: 18px; padding: 6px 18px; }
#askBar #askYes { background: #2e7d4a; color: #fff; border-color: #1d5432; }
#mySeat .cnt { display: none; }
#mySeat .cnt:has(.pts) { display: flex; padding: 2px 8px; }   /* Hearts: the points you took */

/* the kit's video tile fills the face */
.kitVideo { position: fixed; top: -9999px; left: -9999px; }
.kitTile { position: absolute; inset: 0; border: 0 !important; background: transparent; }
.kitTile video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.kitTile.off video, .kitTile.hid video { visibility: hidden; }
.kitTile.nightHid { display: none; }
.kitName { display: none; }
.kitBtns { display: none; }
#mySeat .kitBtns { display: flex; position: absolute; left: 0; right: 0; bottom: 0; justify-content: space-between; padding: 3px; }
#mySeat .kitBtns button { font-size: 12px; font-weight: 800; padding: 3px 7px; border-radius: 8px; border: 0; background: rgba(0,0,0,.65); color: #fff; }
#mySeat .kitBtns button.on { background: #2e7d4a; }

/* ---------- between hands, owner panel ---------- */
#between { z-index: 4; } #tablePanel { z-index: 6; }
#between, #tablePanel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); width: min(460px, calc(100% - 24px));
  max-height: calc(100% - 24px); overflow-y: auto; }
#between .box, #tablePanel .box { padding: 20px; }
/* the top edge stays put (not the middle), so picking a game with a longer or shorter rules line doesn't move the box */
#between { --top: max(12px, calc(46% - 215px)); top: var(--top); transform: translateX(-50%); max-height: calc(100% - var(--top) - 12px); }
#between.low { top: auto; bottom: 8px; transform: translateX(-50%); }
#between h2, #tablePanel h2 { margin: 0 0 10px; font-size: 28px; }
.scores { list-style: none; padding: 0; margin: 0 0 8px; font-size: 21px; }
.scores li { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px; border-bottom: 1px solid #e2d3b8; }
.scores .right { display: flex; align-items: center; gap: 10px; }
.box .xSlot { display: inline-block; position: relative; width: 28px; height: 28px; margin-left: 8px; vertical-align: middle; flex: none; }
.box .x { position: absolute; right: 0; top: 0; border: 0; background: #23414d; color: #fff; border-radius: 14px; min-width: 28px; height: 28px;
  font-size: 18px; font-weight: 800; line-height: 1; padding: 0 6px; cursor: pointer; white-space: nowrap; }
.box .x.sure { background: #c0392b; font-size: 15px; padding: 0 10px; }
.games { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 10px 0 4px; font-size: 20px; font-weight: 800; }
#gamePick { font: inherit; font-size: 22px; padding: 10px 40px 10px 16px; border-radius: 14px; border: 3px solid #c98a00; background: #ffd54a; color: #3b2412;
  min-width: 0; flex: 0 1 260px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #3b2412 50%), linear-gradient(135deg, #3b2412 50%, transparent 50%);
  background-position: right 20px center, right 13px center; background-size: 7px 7px; background-repeat: no-repeat; }
#gamePick:disabled { opacity: .45; }
.botRow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.botTag { background: #dbe7ec; color: #23414d; border-radius: 16px; padding: 4px 4px 4px 12px; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.botTag button { border: 0; background: #23414d; color: #fff; border-radius: 50%; width: 28px; height: 28px; font-size: 18px; line-height: 1; padding: 0; }
.personRow { display: flex; justify-content: space-between; align-items: center; font-size: 21px; padding: 6px 4px; border-bottom: 1px solid #e2d3b8; }
.rulesBox { margin: 4px 0 12px; }
.rulesBox .ruleRow + .ruleRow { border-top: 1px solid #e2d3b8; }
.rulesLine { font-size: 17px !important; color: #6b4a2c; margin: 8px 0 0 !important; line-height: 1.35 !important; }
.rulesBox h3 { margin: 0 0 4px; font-size: 20px; }
.ruleRow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 2px; }
.ruleRow > div { text-align: left; }
.ruleRow b { font-size: 19px; display: block; }
.ruleRow small { font-size: 15px; color: #6b5440; display: block; line-height: 1.2; }
.ruleRow .onOff { font-size: 15px; font-weight: 800; color: #6b5440; }
.ruleRow .onOff.on { color: #2e7d4a; }
.ruleRow.choices { flex-wrap: wrap; }
.choiceRow { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.choiceRow .toggle { min-width: 0; }
/* Full Moon's card picker (in the Rules pop-up) */
.pickGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 10px 6px; margin: 6px 0 0; }
.pk { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; color: #3b2412; cursor: pointer; --cw: 64px; }
.pk .cd { pointer-events: none; transition: opacity .15s, filter .15s; }
.pk:not(.in) .cd { opacity: .35; filter: grayscale(1); }
.pk span { font-size: 13px; font-weight: 700; }
.pk:not(.in) span { color: #9a836a; }
.pk .tag { position: absolute; top: -6px; right: 2px; min-width: 24px; height: 24px; border-radius: 12px; background: #2e7d4a; color: #fff;
  font-size: 14px; font-style: normal; font-weight: 800; line-height: 24px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.pk:not(.in) .tag { background: #b9a88f; }
.fit { font-size: 16px; font-weight: 700; color: #2e7d4a; margin: 10px 0 4px; text-align: center; }
.fit.bad { color: #b3261e; }
.fit.shake { animation: fitShake .35s; }
@keyframes fitShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.otherRow { width: 100%; margin: 4px 0 0; }
/* Hearts between hands: seat picker, score table, how to play */
.whoHelp { font-size: 15px !important; margin: 0 0 8px !important; color: #6b4a2c; }
.whoGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 0 4px; }
.who { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 42px; box-sizing: border-box; padding: 4px 8px; border-radius: 12px;
  border: 0; font: inherit; font-size: 17px; font-weight: 800; text-align: left; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.who.in { background: #ffd54a; color: #3b2412; }
.who.out { background: #e9dcc4; color: #8a6240; }
.who.fixed { cursor: default; }
.who.add { background: none; border: 2px dashed #b39470; color: #6b4a2c; justify-content: center; }
.who .whoName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.who .wins { flex: none; margin-left: auto; }
.who .whoText { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.who .whoText .tag { margin-left: 0; font-size: 9px; }
#between #startBtn:disabled { opacity: .45; }
.who .tag { margin-left: auto; font-size: 10px; font-weight: 800; opacity: .75; flex: none; }
.who .miniFace { flex: none; margin-right: 0; }
.who.out .miniFace { opacity: .6; }
.who .xSlot { margin-left: auto; }
.who .tag + .xSlot { margin-left: 4px; }
.whoLine { text-align: center; font-weight: 800; font-size: 16px !important; color: #6b4a2c; margin: 8px 0 4px !important; }
.moonLine { font-size: 22px !important; font-weight: 900; color: #b23a2a; margin: 0 0 8px !important; }
.scoreTable { width: 100%; border-collapse: collapse; font-size: 20px; margin: 4px 0 6px; }
.scoreTable th { font-size: 15px; color: #6b5440; font-weight: 700; padding: 2px 6px; text-align: right; }
.scoreTable td { padding: 6px; border-bottom: 1px solid #e2d3b8; text-align: right; }
.scoreTable td:first-child { text-align: left; font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playTo { font-size: 17px !important; color: #6b4a2c; margin: 4px 0 6px !important; }
.btnRow { display: flex; flex-wrap: wrap; justify-content: center; }
.howTo ul { text-align: left; font-size: 19px; line-height: 1.4; padding-left: 22px; margin: 6px 0 12px; }
.howTo li { margin-bottom: 8px; }
.danger { background: #b23a2a; color: #fff; border-color: #7d2418; }

#topBtns { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 8px; }
#topBtns button { font-size: 16px; font-weight: 700; padding: 6px 14px; white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis;
  border-radius: 14px; border: 2px solid #efe2cc; background: rgba(40,22,10,.7); color: #efe2cc; }
.renameRow { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.renameRow input { flex: 1; min-width: 0; margin: 0; }
.setRow { display: flex; justify-content: space-between; align-items: center; font-size: 22px; padding: 10px 4px; border-bottom: 1px solid #e2d3b8; margin-bottom: 10px; }
.toggle { font-size: 18px; font-weight: 800; min-width: 74px; padding: 8px 14px; border-radius: 20px; border: 2px solid #8a6240; background: #fff8ec; color: #3b2412; }
.toggle.on { background: #2e7d4a; border-color: #1d5432; color: #fff; }

#hint { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 8; background: #f4ead8; color: #3b2412; border-radius: 18px;
  padding: 14px 18px; width: min(460px, calc(100% - 24px)); box-shadow: 0 8px 22px rgba(0,0,0,.5); text-align: center; font-size: 19px; border: 4px solid #4a2f18; }
#hint p { margin: 0 0 10px; }
#hint button { font-size: 20px; font-weight: 800; padding: 8px 30px; border-radius: 14px; border: 0; background: #2e7d4a; color: #fff; }
#toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 9; background: rgba(30,15,5,.9); color: #fff; padding: 10px 18px;
  border-radius: 16px; font-size: 18px; max-width: calc(100% - 24px); text-align: center; }

/* ---------- upright phones (and upright iPads): faces in a row on top ---------- */
@media (orientation: portrait) {
  #table.on { display: flex; flex-direction: column; padding: 8px 8px 10px; }
  #seats { position: static; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; pointer-events: auto; flex: none; }
  .seat, #mySeat { position: static; --fw: clamp(62px, 17vw, 120px); gap: 2px; }
  #mySeat { position: relative; }
  .seat .leaveMe { bottom: auto; top: 100%; margin: 4px 0 0; left: auto; right: 0; transform: none; }
  .seat .name { font-size: 14px; }
  .seat .cnt { font-size: 13px; padding: 1px 7px 1px 4px; gap: 2px 5px; }
  .seat .cnt .w { display: none; }   /* Hearts on a phone: the little fan and the number say it */
  .fan { transform: scale(.8); }
  #felt { position: relative; inset: auto; flex: 1; min-height: 140px; margin: 8px 4px 6px; border-width: 6px; }
  #piles { --cw: clamp(60px, 18vw, 100px); }
  #trick { --cw: clamp(52px, 19vw, 96px); }
  #doubtArea { --cw: clamp(48px, 15vw, 84px); gap: 14px; }
  #doubtArea .dStack { margin-bottom: 22px; }
  #doubtArea .dCount { font-size: 13px; }
  #doubtArea .dLast { font-size: 15px; }
  #doubtArea .dNext { font-size: 18px; }
  #doubtArea .dTimer { width: 120px; }
  #doubtArea .dInfo { gap: 7px; }
  #doubtBtn { font-size: 19px; padding: 9px 16px; }
  #msgRow { position: static; flex: none; margin-bottom: 4px; min-height: 36px; }
  #msg { font-size: 18px; }
  #colorBanner { font-size: 17px; padding: 4px 14px; top: 6px; }
  #sortBtn { position: static; transform: none; order: 3; align-self: flex-start; margin: 6px 6px 0; font-size: 13px; padding: 3px 10px; }
  #hand { order: 2; }
  #hand { position: relative; left: auto; right: auto; bottom: auto; flex: none; width: 100%; --cw: clamp(58px, 17vw, 110px); }
  #topBtns { top: auto; bottom: 8px; left: auto; right: 10px; transform: none; }
  #topBtns button { max-width: 58vw; }
  #topBtns button { font-size: 14px; padding: 5px 10px; }
  .colorsRow button { width: 56px; height: 56px; }
  .seat.shoulder, .seat.idle { position: static; transform: none; --fw: clamp(44px, 12vw, 80px); }
  .seat.shoulder { margin-left: -4px; }
  #peekBar { font-size: 15px; }
  #mySeat .kitBtns { padding: 2px; }
  #mySeat .kitBtns button { font-size: 10px; padding: 2px 4px; }
}

/* ---------- computer faces: looking around, and feelings ---------- */
.seat[data-mood="happy"] .m-ok, .seat[data-mood="sad"] .m-ok { display: none !important; }
.seat[data-mood="happy"] .m-happy { display: inline !important; }
.seat[data-mood="sad"] .m-sad { display: inline !important; }
.seat .eyes { animation: lookAround 8s ease-in-out infinite; animation-delay: var(--look, 0s); }
@keyframes lookAround {
  0%, 12% { transform: translateX(0); }
  25%, 37% { transform: translateX(-4px); }
  50%, 62% { transform: translateX(0); }
  75%, 87% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}
.seat[data-mood="happy"] .face { animation: faceBounce .6s ease-in-out 2; }
.seat[data-mood="sad"] .face { transform: translateY(5px); transition: transform .4s; }
@keyframes faceBounce { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  .seat .eyes, .seat[data-mood="happy"] .face { animation: none; }
  .seat[data-mood="sad"] .face { transform: none; transition: none; }
}

/* invite codes in the Table panel */
.inviteRow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.18); }
.inviteRow > div { text-align: left; align-items: flex-start; display: flex; flex-direction: column; min-width: 0; }
.inviteCode { font-size: 22px; letter-spacing: 1px; user-select: all; }
.inviteUntil { font-size: 14px; opacity: .8; }

/* ---------- Scrambled: the sand timer, the grid of letter cubes, your words ---------- */
/* no hand of cards: the felt takes the whole middle */
#table[data-game="scrambled"] #msgRow, #table[data-game="scrambled"] #hand { display: none; }
@media (orientation: landscape) { #table[data-game="scrambled"] #felt { bottom: 4%; } }
/* upright phones: the grid as wide as the screen, less a 16px gutter each side (8 table + 6 felt edge + 2 here) */
@media (orientation: portrait) {
  #table[data-game="scrambled"] #felt { margin: 8px 0 44px; }
  #table[data-game="scrambled"] #scrambledArea { padding: 8px 2px; }
}

/* --b: the tray's width (set by scrambled-ui.js), --s: one cube, --spin: quarter turns so far */
#scrambledArea { --s: calc(var(--b) * .2155); --edge: clamp(4px, calc(var(--s) * .07), 6px);
  width: 100%; height: 100%; padding: 8px; display: grid; justify-content: center; align-content: center; gap: 8px;
  grid-template-columns: var(--b); grid-template-rows: auto auto minmax(74px, auto); grid-template-areas: "top" "wrap" "info"; }
#scrambledArea.wide { grid-template-columns: var(--b) 240px; grid-template-rows: auto 1fr; grid-template-areas: "wrap top" "wrap info"; gap: 8px 20px; }
#scrambledArea.side { grid-template-columns: var(--b) 150px; grid-template-rows: auto minmax(74px, auto); grid-template-areas: "wrap top" "info ."; gap: 8px 20px; }
.scSide { grid-area: top; }
.scTop { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#scrambledArea.side .scTop { flex-direction: column; justify-content: flex-start; gap: 18px; }
.scTurn { font-size: 19px; font-weight: 800; padding: 9px 16px; border-radius: 14px; border: 0; background: #f4d58a; color: #3b2412;
  box-shadow: 0 3px 0 #b08d3c; }
.scTurn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b08d3c; }

/* the sand timer: no numbers, the sand says it */
.scGlass { width: calc(var(--gh) * .6); height: var(--gh); flex: none; filter: drop-shadow(0 3px 3px rgba(0,0,0,.4)); }
.scGlass svg { width: 100%; height: 100%; display: block; overflow: visible; }
.scGlass .glass { fill: rgba(255,255,255,.13); stroke: rgba(255,255,255,.8); stroke-width: 1.6; }
.scGlass .shine { fill: none; stroke: rgba(255,255,255,.45); stroke-width: 1.6; stroke-linecap: round; }
.scGlass .stream { stroke: #f2c46b; stroke-width: 1.3; }
.scGlass .wood { fill: #8a5a2e; stroke: #5e3a1a; stroke-width: 1; }
.scGlass .post { fill: #a8743f; }
.scGlass.tock { animation: scTock .45s ease-in-out; }
@keyframes scTock { 0%, 100% { rotate: 0deg; } 30% { rotate: -5deg; } 65% { rotate: 4deg; } }

/* the tray turns; each cube turns back so its letter stays upright */
.scWrap { grid-area: wrap; position: relative; width: var(--b); }
.scBox { position: relative; width: var(--b); height: var(--b); padding: calc(var(--b) * .03); gap: calc(var(--b) * .026);
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); border-radius: 6%;
  background: linear-gradient(145deg, #3d2613, #2a180a); box-shadow: inset 0 0 10px rgba(0,0,0,.7), 0 0 0 3px #5e3a1a, 0 0 18px rgba(0,0,0,.45);
  rotate: calc(var(--spin, 0) * 90deg); transition: rotate .4s ease-in-out, width .4s, height .4s; touch-action: none; }
.scBox .spot { position: relative; border-radius: 16%; background: rgba(0,0,0,.28);
  box-shadow: inset 0 4px 7px rgba(0,0,0,.65), inset 0 -1px 0 rgba(255,255,255,.07); }
.scBox .cube { position: absolute; inset: 0; rotate: calc(var(--spin, 0) * -90deg); transition: rotate .4s ease-in-out, transform .3s cubic-bezier(.3,.7,.4,1); }
.scBox .cube.flying { z-index: 3; }
#scrambledArea.still .scBox, #scrambledArea.still .cube { transition: none; }
#scrambledArea.typing .scBox { cursor: pointer; }
.scLine { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.scLine path { fill: none; stroke: #c0392b; stroke-width: 3.6; stroke-linecap: round; opacity: .75; }

/* a cube: a lighter top, a darker edge under it, a soft shadow on the felt */
.die { --rest: rotate(0deg); position: absolute; left: 0; right: 0; top: 0; height: calc(100% - var(--edge)); border-radius: 16%;
  display: flex; align-items: center; justify-content: center; color: #3b2412;
  background: radial-gradient(circle at 32% 26%, #fffdf7, #f7ecd6 55%, #ead8b4);
  box-shadow: inset 0 -2px 3px rgba(120,80,30,.12), 0 var(--edge) 0 #b8976d, 0 calc(var(--edge) + 1px) 0 #8f6e4b, 0 calc(var(--edge) + 4px) 9px rgba(0,0,0,.45);
  transition: background .12s, box-shadow .12s, transform .3s; }
.die b { font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-variation-settings: "SOFT" 100; font-size: calc(var(--s) * .58); line-height: 1; }
.die.qu b { font-size: calc(var(--s) * .44); letter-spacing: -.02em; }
.cube.on .die { background: radial-gradient(circle at 32% 26%, #fff2bf, #f6d36a 60%, #eab83e);
  box-shadow: 0 var(--edge) 0 #b8862a, 0 calc(var(--edge) + 1px) 0 #8a6218, 0 calc(var(--edge) + 4px) 9px rgba(0,0,0,.45); }
.cube.last .die { background: radial-gradient(circle at 32% 26%, #fffbe6, #ffd84a 55%, #ffbf1a);
  box-shadow: 0 0 0 3px #fff4d0, 0 0 14px #ffd54a, 0 var(--edge) 0 #b8862a, 0 calc(var(--edge) + 4px) 9px rgba(0,0,0,.45); }

/* while the cubes settle: the real cubes (public/play/thrower.js) in the box, seen from above with a little depth.
   Cubes in a dent are squared up and locked; loose ones can be picked up. The flat grid takes over when the round starts. */
.scWrap { perspective: 1500px; }
.scBox { transform-style: preserve-3d; }
.scCubes { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; display: none; }
#scrambledArea.real .scCubes { display: block; }
#scrambledArea.real .scBox .spot .cube { visibility: hidden; }
#scrambledArea.real.pushable .scBox { cursor: grab; }
#scrambledArea.settling:not(.watching) .scMine { visibility: hidden; }
.tc.tcDrag { z-index: 6; }

.scUp { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 7; white-space: nowrap;
  background: rgba(30,15,5,.88); color: #ffd54a; font-size: clamp(30px, calc(var(--b) * .11), 54px); font-weight: 900;
  padding: 12px 28px; border-radius: 22px; box-shadow: 0 6px 18px rgba(0,0,0,.5); animation: scPop .45s ease-out; }
@keyframes scPop { 0% { transform: translate(-50%, -50%) scale(.6); } 60% { transform: translate(-50%, -50%) scale(1.1); } 100% { transform: translate(-50%, -50%) scale(1); } }
.scCount { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 7; pointer-events: none; white-space: nowrap;
  min-width: 1.6em; text-align: center; background: rgba(30,15,5,.85); color: #fff4e0; font-size: clamp(56px, calc(var(--b) * .3), 140px); font-weight: 900;
  line-height: 1.15; padding: 4px 28px; border-radius: 28px; box-shadow: 0 6px 18px rgba(0,0,0,.5); animation: scBeat .9s ease-out both; }
.scCount.go { color: #ffd54a; }
@keyframes scBeat { 0% { scale: .5; opacity: 0; } 20% { scale: 1.12; opacity: 1; } 35% { scale: 1; } 85% { opacity: 1; } 100% { opacity: .85; } }

/* the word being built, and your words */
.scInfo { grid-area: info; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.scNow { text-align: center; font-size: 34px; font-weight: 900; letter-spacing: 5px; min-height: 44px; line-height: 44px;
  text-shadow: 0 2px 4px rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; }
.scNow.note { font-size: 20px; letter-spacing: 0; color: #ffe9a8; font-weight: 800; }
.scMine { background: #fff8ec; color: #3b2412; border-radius: 12px; padding: 8px 12px; font-size: 17px; overflow-y: auto; min-height: 0; flex: 0 1 auto; }
.scMine b { display: block; font-size: 15px; color: #6b4a2c; margin-bottom: 4px; }
.scChips span { display: inline-block; background: #f4ead8; border: 2px solid #d9c6a6; border-radius: 10px; padding: 2px 9px; margin: 3px; font-weight: 800; }
#scrambledArea.wide .scNow { text-align: left; }
/* the round screen: players ranked by total; tap one to open their words */
#between:has(.scRound) { width: min(520px, calc(100% - 24px)); top: 50%; transform: translate(-50%, -50%); max-height: calc(100% - 24px); }
#between:has(.scRound) .box { width: 100%; }
.scRound { margin: 4px 0 4px; text-align: left; }
.scRow { border-bottom: 2px solid #e2d3b8; }
.scRow:last-child { border-bottom: 0; }
.scTop { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 4px; margin: 0; background: none; border: 0; box-shadow: none;
  font: inherit; color: inherit; text-align: left; cursor: default; }
button.scTop { cursor: pointer; }
.scTop .miniFace { margin: 0; flex: none; }
.miniFace.initial { background: #6d5a48; color: #efe2cc; font-weight: 800; font-size: 15px; text-align: center; line-height: 24px; width: 24px; border-radius: 50%; }
.scPlace { width: 18px; flex: none; font-size: 17px; font-weight: 800; color: #6b5440; text-align: center; }
.scWho { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 19px; font-weight: 800; line-height: 1.2; }
.scWho > span, .scWho small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scWho small { font-size: 14px; font-weight: 600; color: #6b5440; }
.scTotal { font-size: 28px; font-weight: 800; }
.scRow.lead .scTotal { color: #2e7d4a; }
.scArr { width: 18px; flex: none; color: #8a5a2e; font-size: 20px; text-align: center; }
.scArr::before { content: '▸'; }
.scRow.open .scArr::before { content: '▾'; }
.scWords { display: none; flex-wrap: wrap; column-gap: 12px; row-gap: 2px; background: #f4ead8; border-radius: 10px; padding: 6px 10px; margin: 0 0 8px 26px;
  font-size: 16px; max-height: 40vh; overflow-y: auto; }
.scRow.open .scWords { display: flex; }
.scWords > small { flex-basis: 100%; font-size: 13px; color: #6b5440; font-weight: 700; }
.scW { white-space: nowrap; font-weight: 800; }
.scW b { font-weight: 700; font-size: 12px; color: #6b5440; margin-left: 2px; vertical-align: super; }
.scW.long { color: #2e7d4a; }
.scW.shared { color: #a8957c; font-weight: 400; text-decoration: line-through; }
.scW.shared b { display: none; }
.scHint { font-size: 14px !important; color: #6b4a2c; margin: 0 0 6px !important; text-align: left; }
.scUnfound { text-align: left; margin: 6px 0; }
.scUnfound > b { font-size: 17px; color: #6b4a2c; }
.scUnfound .scChips span { font-size: 17px; }
.scUnfound .scChips i { font-style: normal; color: #2e7d4a; margin-left: 4px; }
@media (orientation: portrait) {
  .scNow { font-size: 28px; min-height: 38px; line-height: 38px; letter-spacing: 3px; }
  .scTurn { font-size: 17px; padding: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .scGlass.tock, .scCount { animation: none; }
}

/* ---------- Golf: the deck and the pile on the felt, your four cards big under it, small squares by the faces ---------- */
/* no hand of cards and no Sort: your square sits under the felt instead (--mw: one of your cards) */
#table[data-game="golf"] #hand, #table[data-game="golf"] #sortBtn, #table[data-game="golf"] #msgRow { display: none; }
#table[data-game="golf"] { --mw: clamp(56px, 9.5vh, 96px); }
@media (orientation: landscape) { #table[data-game="golf"] #felt { bottom: calc(var(--mw) * 2.96 + 48px); } }
#golfArea { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
#golfArea button { padding: 0; border: 0; background: none; color: inherit; font: inherit; }
#golfArea .gHole { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); font-size: 16px; font-weight: 800; padding: 3px 12px;
  border-radius: 12px; border: 2px solid #efe2cc; background: rgba(40,22,10,.7); color: #efe2cc; white-space: nowrap; }
#golfArea .gMid { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 34px 10px 10px; max-width: 100%; }
#golfArea .gPiles { position: relative; display: flex; gap: 28px; align-items: flex-start; --cw: clamp(60px, 12vh, 112px); }
/* someone else's card in hand hangs to the right, so the deck and the pile stay in the middle */
#golfArea .gPile.gHeldFelt { position: absolute; left: calc(100% + 28px); top: 0; }
#golfArea .gPile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
#golfArea .gLbl, #golfArea .gCount { font-size: 15px; font-weight: 700; color: #e8f2e8; text-shadow: 0 1px 2px rgba(0,0,0,.7); white-space: nowrap; min-height: 18px; }
#golfArea .gCount.low { color: #ff7a6a; }
#golfArea .gTag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); z-index: 1; background: #ffd54a; color: #3b2412;
  font-size: 13px; font-weight: 800; padding: 1px 8px; border-radius: 10px; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
#golfArea .gDeck, #golfArea .gDiscard, #golfArea .gSlot { border-radius: calc(var(--cw) * .14); display: block; }
#golfArea .gDeck:not(:disabled), #golfArea .gDiscard:not(:disabled), #golfArea .gSlot:not(:disabled) { cursor: pointer; }
#golfArea .glow .pc { box-shadow: 0 0 0 4px #ffd54a, 0 0 18px #ffd54a, 0 3px 6px rgba(0,0,0,.45); }
#golfArea .gDeck.empty .pc { opacity: .25; }
#golfArea .gDeck.shuffling .pc { animation: shuffleShake .7s ease-in-out; }
#golfArea .pc.gEmpty { background: none; box-shadow: none; border: 3px dashed rgba(255,255,255,.35); }
#golfArea .ghost .pc { visibility: hidden; }
/* the card in someone's hand: tilted and glowing */
#golfArea .gCard { width: var(--cw); height: calc(var(--cw) * 1.48); }
#golfArea .gHeld .pc { transform: rotate(6deg); box-shadow: 0 0 0 4px #ffd54a, 0 6px 14px rgba(0,0,0,.6); }
#golfArea .gHeld.empty { visibility: hidden; }
#golfArea .gLine { background: rgba(0,0,0,.5); padding: 6px 18px; border-radius: 22px; font-size: 20px; font-weight: 700; text-align: center; max-width: 100%; }
#golfArea .gLine.mine { background: #ffd54a; color: #3b2412; }
#golfArea .gLine.knock { background: #c62828; color: #fff; font-size: 24px; animation: gKnock .5s ease-out 2; }
@keyframes gKnock { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.12); } }
#golfArea .gLine:empty, #golfArea .gNote:empty { display: none; }
#golfArea .gNote { font-size: 15px; font-weight: 700; color: #ffd54a; text-shadow: 0 1px 2px rgba(0,0,0,.7); margin-top: -4px; text-align: center; }
/* your square: big, under the felt, with Got it / Knock on one side and the card you hold on the other */
#golfArea .gMineRow { position: absolute; top: calc(100% + 20px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; --cw: var(--mw); }
#golfArea .gSquare { display: grid; grid-template-columns: auto auto; gap: 8px; position: relative; }
#golfArea .gBtns, #golfArea .gHeldMine { width: calc(var(--cw) * 1.5); }
#golfArea .gBtns { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
#golfArea .gKnock, #golfArea .gGotIt { font-size: 20px; font-weight: 800; padding: 8px 18px; border-radius: 16px; white-space: nowrap; }
#golfArea .gKnock { background: #2e7d4a; color: #fff; box-shadow: 0 3px 0 #1d5432; }
#golfArea .gGotIt { background: #fff8ec; color: #3b2412; box-shadow: 0 3px 0 #8a6240; }
#golfArea .gSlot .pc.up { animation: gFlip .3s ease-out both; }
/* the end of a hole: everyone's cards face up, a line through a matching column, each score */
#golfArea .gReveal { display: flex; flex-direction: column; align-items: center; gap: 8px; }
#golfArea .gHead { font-size: 22px; font-weight: 900; color: #ffd54a; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
#golfArea .gHead:empty { display: none; }
#golfArea .gAll { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 26px; --cw: clamp(40px, 10vh, 76px); }
#golfArea .gAll[data-n="4"] { --cw: clamp(34px, 8vh, 60px); }
#golfArea .gAll[data-n="5"], #golfArea .gAll[data-n="6"], #golfArea .gAll[data-n="7"], #golfArea .gAll[data-n="8"] { --cw: clamp(28px, 5vh, 42px); gap: 8px 18px; }
#golfArea .gOne { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#golfArea .gOne .gSquare { gap: 4px; }
#golfArea .gWho { font-size: 16px; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
#golfArea .gPts { font-size: 15px; font-weight: 800; background: #efe2cc; color: #4a2f18; border-radius: 12px; padding: 1px 10px; }
#golfArea .gOne .pc.up { animation: gFlip .35s ease-out both; }
#golfArea .gPair { position: absolute; top: 3%; bottom: 3%; width: 4px; margin-left: -2px; border-radius: 2px; background: #ff5a3c; box-shadow: 0 0 6px rgba(0,0,0,.5); }
#golfArea .gPair.c0 { left: 25%; } #golfArea .gPair.c1 { left: 75%; }
@keyframes gFlip { from { transform: rotateY(90deg); } to { transform: none; } }
/* by each face: that player's four cards, small; the spot they just changed glows */
#table[data-game="golf"] .seat .cnt { background: none; padding: 0; flex-direction: column; gap: 3px; }
.gMini { display: grid; grid-template-columns: auto auto; gap: 2px; }
.gMini i { display: block; width: 16px; height: 23px; border-radius: 3px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5);
  background: repeating-linear-gradient(45deg, #8e3b2f 0 3px, #a24a3c 3px 6px); }
.gMini i.hit { box-shadow: 0 0 0 3px #ffd54a, 0 0 10px #ffd54a; }
.gKnocked { font-size: 13px; font-weight: 800; background: #2e7d4a; color: #fff; border-radius: 10px; padding: 1px 8px; }
@media (orientation: portrait) {
  #table[data-game="golf"] { --mw: clamp(56px, 15vw, 84px); }
  #table[data-game="golf"] #felt { margin-bottom: calc(var(--mw) * 2.96 + 66px); }
  #golfArea .gHole { font-size: 14px; top: 6px; }
  #golfArea .gMid { padding-top: 30px; gap: 8px; }
  #golfArea .gPiles { --cw: clamp(56px, 20vw, 90px); gap: 16px; }
  #golfArea .gPile.gHeldFelt { left: calc(100% + 14px); }
  #golfArea .gLbl, #golfArea .gCount { font-size: 13px; }
  #golfArea .gLine { font-size: 16px; padding: 5px 12px; }
  #golfArea .gNote { font-size: 13px; }
  #golfArea .gMineRow { gap: 10px; top: calc(100% + 16px); }
  #golfArea .gBtns, #golfArea .gHeldMine { width: calc(var(--cw) * 1.25); }
  #golfArea .gKnock, #golfArea .gGotIt { font-size: 17px; padding: 7px 12px; }
  #golfArea .gAll { --cw: clamp(30px, 13vw, 60px); gap: 10px 14px; }
  #golfArea .gAll[data-n="3"], #golfArea .gAll[data-n="4"] { --cw: clamp(30px, 9vw, 48px); }
  #golfArea .gAll[data-n="5"], #golfArea .gAll[data-n="6"], #golfArea .gAll[data-n="7"], #golfArea .gAll[data-n="8"] { --cw: clamp(26px, 7vw, 36px); gap: 6px 10px; }
  #golfArea .gWho { font-size: 14px; }
  #golfArea .gPts { font-size: 13px; }
  .gMini i { width: 12px; height: 17px; border-width: 1.5px; }
}
@media (prefers-reduced-motion: reduce) { #golfArea .pc.up { animation: none; } }

/* ---------- the dice thrower's cubes, shared by 10,000 and Scrambled (public/play/thrower.js) ---------- */
.tc { position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); transform-style: preserve-3d; will-change: transform; pointer-events: none; }
.tcSh { position: absolute; left: 0; top: 0; width: var(--s); height: var(--s); border-radius: 30%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0,0,0,.5), rgba(0,0,0,0)); will-change: transform, opacity; }
.tcF { position: absolute; inset: 0; border-radius: 14%; box-sizing: border-box; backface-visibility: hidden; background: #f7ecd6;
  box-shadow: inset 0 0 0 1px rgba(150,110,60,.35), inset 0 0 calc(var(--s) * .12) rgba(150,110,60,.35); }
.tcCore { position: absolute; inset: 2%; background: #d9c299; }   /* fills the rounded corners, so no felt shows through the edges */
.tcPips { padding: 13%; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); }
.tcPips i { display: block; width: 72%; height: 72%; margin: auto; border-radius: 50%; background: #3b2412; box-shadow: inset 0 1px 2px rgba(0,0,0,.6); visibility: hidden; }
.tcPips i.tcOn { visibility: visible; }
.tcPips.tcRed i { background: #c0392b; }   /* red pips: the dice that score alone */
.tcLet { display: flex; align-items: center; justify-content: center; color: #3b2412;
  font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-variation-settings: "SOFT" 100; font-size: calc(var(--s) * .58); line-height: 1; }
.tcLet.tcQu { font-size: calc(var(--s) * .44); }
/* a flat die on its own (10,000's kept row) */
.tcStatic { position: absolute; width: var(--s); height: var(--s); transform-style: preserve-3d; }

/* ---------- 10,000: the felt is seen from a seat: tilted away, so every die shows its top and two sides ---------- */
.fkFelt { position: relative; perspective: 1600px; perspective-origin: 50% 0%; }
.fkTray { position: absolute; left: 10%; right: 10%; top: 4%; height: 62%; transform-style: preserve-3d; transform: rotateX(34deg); }
.fkKept { position: absolute; left: 12px; bottom: 14px; width: 42%; height: 22%; transform-style: preserve-3d; transform: rotateX(34deg); transform-origin: 50% 100%; }
.fkKept .tcStatic { left: calc(var(--x) * 100% - var(--s) / 2); top: calc(50% - var(--s) / 2); }
/* a flat pad on the felt under each die, bigger than the die. Taps are matched to the nearest die in the page, so the pads don't take them */
.tcHit { position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: none; }
/* can score: a gold edge around the top face that gently pulses (only on your own turn) */
.tcCan .tcTop { animation: fkCanScore 1.4s ease-in-out infinite; }
@keyframes fkCanScore {
  0%, 100% { box-shadow: inset 0 0 0 2px #ffcf3a, inset 0 0 calc(var(--s) * .12) rgba(150,110,60,.35); }
  50% { box-shadow: inset 0 0 0 calc(var(--s) * .07) #ffcf3a, inset 0 0 calc(var(--s) * .12) rgba(150,110,60,.35); }
}
.tcPicked .tcF { background: #f6d36a; }
.tcPicked .tcCore { background: #c99a35; }
@media (prefers-reduced-motion: reduce) { .tcCan .tcTop { animation: none; } }

/* ---------- 10,000 on the table: the felt is the game's own (look B), so the table's felt steps aside ---------- */
#table[data-game="farkle"] #hand, #table[data-game="farkle"] #sortBtn, #table[data-game="farkle"] #msgRow { display: none; }
#table[data-game="farkle"] #felt { background: none; border: 0; box-shadow: none; }
@media (orientation: landscape) { #table[data-game="farkle"] #felt { bottom: 4%; } }
#farkleArea { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; container-type: size; color: #fff; }
/* the felt keeps its shape (so the 0 to 1 spots land in the same places), as big as fits */
.fkBox { position: relative; width: min(100cqw, 100cqh * 480 / 330); aspect-ratio: 480 / 330; }
.fkBox .fkFelt { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; box-sizing: border-box;
  background: radial-gradient(ellipse at 50% 40%, #3f8a5a, #2b6b43); border: 7px solid #6a4529; box-shadow: 0 6px 0 #2a1a0c; isolation: isolate; }
.fkTray { cursor: pointer; touch-action: none; }   /* dice are dragged on it */
.fkLine { position: absolute; left: 8px; right: 8px; bottom: 27%; text-align: center; font-weight: 800; font-size: 19px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.fkLine.bad { color: #ffb4a8; }
.fkBanner { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 4; display: flex; flex-direction: column; align-items: center;
  background: rgba(30,15,5,.88); border-radius: 22px; padding: 10px 26px; box-shadow: 0 6px 18px rgba(0,0,0,.5); text-align: center;
  max-width: 88%; animation: scPop .45s ease-out; }
.fkBanner b { font-size: clamp(30px, 6cqw, 54px); font-weight: 900; line-height: 1.15; }
.fkBanner span { font-size: 18px; font-weight: 700; color: #fff4e0; }
.fkBanner span:empty { display: none; }
.fkBanner.farkle b { color: #ff7a6a; }
.fkBanner.reach b { color: #ffd54a; font-size: clamp(24px, 4.5cqw, 40px); }
/* Roll and Keep: bottom right of the felt, the note above them */
.fkActs { position: absolute; right: 17px; bottom: 17px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; z-index: 3; }
.fkActs.hidden { display: none; }
.fkBtns { display: flex; gap: 8px; }
.fkBtns button { min-height: 44px; font: inherit; font-weight: 800; font-size: 18px; border: 0; border-radius: 10px; padding: 10px 18px; white-space: nowrap;
  background: #ffd54a; color: #3b2412; box-shadow: 0 3px 0 #b8862a; cursor: pointer; }
.fkBtns button.fkKeep { background: #fff4e0; box-shadow: 0 3px 0 #b8976d; }
.fkBtns button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #b8862a; }
.fkBtns button:disabled { opacity: .45; cursor: default; }
.fkBtns button.hidden { display: none; }
.fkNote { font-size: 15px; font-weight: 800; color: #ffd54a; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.fkNote:empty { display: none; }
/* by each face: the total, and what the person rolling has this turn */
#table[data-game="farkle"] #mySeat .cnt:not(:empty) { display: flex; }
.seat .cnt .fkPlus { color: #2e7d4a; white-space: nowrap; }
.fkFloat { position: fixed; z-index: 8; pointer-events: none; font-size: 30px; font-weight: 900; color: #ffd54a; white-space: nowrap;
  text-shadow: 0 2px 4px rgba(0,0,0,.8), 0 0 10px rgba(0,0,0,.5); }
/* upright phones: a taller felt, and Roll / Keep in a row under it */
@media (orientation: portrait) {
  #table[data-game="farkle"] #felt { margin: 8px 0 10px; }
  .fkBox { width: min(100cqw, (100cqh - 96px) * 360 / 300); aspect-ratio: 360 / 300; margin-bottom: 96px; }
  .fkLine { font-size: 16px; bottom: 26%; }
  .fkActs { top: calc(100% + 14px); bottom: auto; left: 0; right: 0; align-items: center; }
  .fkNote { order: 2; }
  .fkBtns button { font-size: 18px; padding: 11px 18px; min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .fkBanner { animation: none; } }

/* ---------- Full Moon: the deal, day, vote and reveal on the felt; the night over the whole table ---------- */
#table[data-game="fullmoon"] #hand, #table[data-game="fullmoon"] #sortBtn, #table[data-game="fullmoon"] #msgRow { display: none; }
@media (orientation: landscape) { #table[data-game="fullmoon"] #felt { bottom: 20%; } }
#fullmoonArea { position: absolute; inset: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; color: #fff; }
.fm button { font: inherit; }
.fmPane { margin: auto; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px; width: 100%; position: relative; }
.fmTitle { font-size: 24px; color: #fff4e0; margin-bottom: 12px; }
.fmLine { font-size: 17px; font-weight: 700; line-height: 1.35; margin: 14px 0 12px; max-width: 420px; min-height: 46px; color: #e9f1ea; }
.fmPeek { border: 0; background: none; padding: 0; --cw: clamp(96px, 16vh, 150px); }
.fmDeck { display: flex; margin: 0 0 14px; border-radius: 12px; overflow: hidden; border: 2px solid rgba(255,255,255,.35); }
.fmDeck button { font-size: 14px; font-weight: 800; padding: 5px 14px; border: 0; background: rgba(0,0,0,.25); color: #e9f1ea; }
.fmDeck button.on { background: #f4ead8; color: #2e7d4a; }
.fm .btnGo { display: inline-block; font-size: 22px; font-weight: 800; padding: 12px 36px; border-radius: 16px; border: 0;
  background: #2e7d4a; color: #fff; box-shadow: 0 4px 0 #1d5432; }
.fm .btnGo:active { transform: translateY(3px); box-shadow: 0 1px 0 #1d5432; }
.fm .btnGo.done { background: #f4ead8; color: #2e7d4a; box-shadow: 0 4px 0 #b8a27e; }
.fm .btnGo:disabled { opacity: .6; }
.fm .btnMoon { font-size: 21px; font-weight: 800; padding: 12px 34px; border-radius: 16px; border: 0; background: #f2a65a; color: #2a1420; box-shadow: 0 4px 0 #a85a24; }
.fm .btnMoon:active { transform: translateY(3px); box-shadow: 0 1px 0 #a85a24; }
.fm .btnQuiet { font-size: 17px; font-weight: 700; padding: 9px 20px; border-radius: 14px; border: 2px solid rgba(255,216,168,.55); background: rgba(0,0,0,.25); color: #ffd8a8; }
.fm .voteCount { font-size: 17px; font-weight: 700; color: #e9f1ea; margin-top: 10px; }
.fm .voteCount b { color: #ffd54a; }

/* the cards (a face-down card has no face in the page) */
.fm .cd, .seat .cd { width: var(--cw, 90px); height: calc(var(--cw, 90px) * 1.42); position: relative; flex: none; perspective: 700px; transform-origin: 0 0; display: block; }
.cdIn { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3,.7,.3,1.15); }
.cd.up .cdIn { transform: rotateY(180deg); }
.cdBack, .cdFace { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: calc(var(--cw, 90px) * .12);
  background: #fff; padding: calc(var(--cw, 90px) * .065); box-shadow: 0 4px 10px rgba(0,0,0,.5); }
.cdFace { transform: rotateY(180deg); }
.cdBack svg { width: 100%; height: 100%; display: block; border-radius: calc(var(--cw, 90px) * .08); }
.cf { position: relative; overflow: hidden; width: 100%; height: 100%; border-radius: calc(var(--cw, 90px) * .08); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cfPip svg { width: 100%; height: 100%; display: block; }
.cfName, .cfSide { white-space: nowrap; position: relative; text-align: center; }
.cfSide { font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
/* the Gold deck: dark card, gold lines, the role's color as a soft glow, a thin double gold border, a roman numeral */
.cdFace:has(.cf.gold) { background: #0e0a14; padding: calc(var(--cw, 90px) * .04); }
.cf.gold { background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--rc) 55%, #120c1a) 0%, #120c1a 75%);
  gap: calc(var(--cw) * .025); color: #e8c26a; padding: calc(var(--cw) * .1) 4% 0; }
.cf.gold .frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cfNum { font-family: 'Fraunces', Georgia, serif; font-weight: 600; color: #e8c26a; font-size: calc(var(--cw) * .085); letter-spacing: .12em; line-height: 1; position: absolute; top: calc(var(--cw) * .085); left: 0; right: 0; text-align: center; }
.cf.gold .cfPip { width: 82%; aspect-ratio: 1; position: relative; }
.cf.gold .cfName { font-family: 'Fraunces', Georgia, serif; font-weight: 600; color: #e8c26a; font-size: calc(var(--cw) * .1); letter-spacing: .05em; text-transform: uppercase; line-height: 1.05; }
.cf.gold .cfSide { color: #cdb37a; font-size: calc(var(--cw) * .072); letter-spacing: .1em; opacity: .8; }
/* the Storybook deck: the role's color, a cream round portrait, the name in white */
.cf.story { background: var(--rc); gap: calc(var(--cw) * .05); color: #fff; padding: 0 4%; }
.cf.story .cfPip { width: 70%; aspect-ratio: 1; border-radius: 50%; background: #fff8ec; padding: 3%; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.cf.story .cfPip svg { border-radius: 50%; }
.cf.story .cfName { font-size: calc(var(--cw) * .14); line-height: 1.05; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.cf.story .cfSide { font-size: calc(var(--cw) * .1); opacity: .9; background: rgba(0,0,0,.22); padding: 1px 6px; border-radius: 6px; }
.sm .cfNum, .xs .cfNum, .sm .cfSide, .xs .cfSide, .xs .cfName { display: none; }
.sm .cf.gold, .xs .cf.gold { padding-top: 0; }
.fm .slot { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.fm .sl { font-size: 17px; font-weight: 800; color: #fff4e0; text-shadow: 0 1px 3px #000; white-space: nowrap; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.fm .slot.sel .cdBack, .fm .slot.sel .cdFace { box-shadow: 0 0 0 4px #ffd54a, 0 0 18px #ffd54a; }
.fm .slot.dim { opacity: .35; transition: opacity .5s; }
.fm .flying { z-index: 20; }

/* ---------- night: harvest moon over pines with heavy clouds drifting across it ---------- */
.fmNight { position: absolute; inset: 0; z-index: 3; overflow: hidden; opacity: 0; transition: opacity 2.5s ease;
  background: linear-gradient(#07060d 0%, #191026 45%, #2c1a24 75%, #0b0709 100%);
  --moon: min(64vw, 30vh, 280px); --moonTop: min(36vh, 300px); --treesH: 40vh; --run: calc(100vw + 120px); }
.fmNight.on { opacity: 1; }
.fmNight.lifting { pointer-events: none; }   /* the sky fading into the day: taps reach the day screen under it */
.fmNight .moon { position: absolute; z-index: 2; width: var(--moon); height: var(--moon); left: calc(50% - var(--moon) / 2); top: var(--moonTop); border-radius: 50%;
  background: radial-gradient(circle at 42% 40%, #ffd79a 0%, #f2a65a 55%, #c96a2c 100%); box-shadow: 0 0 80px 20px rgba(255,150,70,.35); }
.fmNight .moon::after { content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 30% 58%, rgba(120,50,10,.12) 0 9%, transparent 10%), radial-gradient(circle at 64% 34%, rgba(120,50,10,.1) 0 12%, transparent 13%), radial-gradient(circle at 66% 70%, rgba(120,50,10,.09) 0 7%, transparent 8%); }
.fmNight .star { position: absolute; z-index: 1; width: 2px; height: 2px; background: #fff; border-radius: 50%; animation: fmTw 3s ease-in-out infinite; }
@keyframes fmTw { 0%,100% { opacity: .2 } 50% { opacity: .9 } }
.fmNight .cloud { position: absolute; left: 0; z-index: 3; border-radius: 50%; background: rgba(30,20,38,.9); filter: blur(14px); animation: fmDrift linear infinite; }
@keyframes fmDrift { from { transform: translateX(-110%) } to { transform: translateX(var(--run)) } }
.fmNight .trees { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: var(--treesH); z-index: 4; display: block; }
.fmNightIn { position: absolute; inset: 0; z-index: 5; }
.fmNight .say { position: absolute; left: 0; right: 0; top: 15%; text-align: center; padding: 0 24px; font-size: 34px; line-height: 1.25; color: #ffd8a8;
  animation: fmBreathe 5s ease-in-out infinite; }
.fmNight .say.swap { animation: fmFadeIn 1.2s ease-out, fmBreathe 5s 1.2s ease-in-out infinite; }
.fmNight .hint { position: absolute; left: 0; right: 0; bottom: 30px; text-align: center; font-size: 15px; color: #ffd8a8; opacity: .6; padding: 0 20px; }
@keyframes fmBreathe { 0%,100% { opacity: .55 } 50% { opacity: 1 } }
@keyframes fmFadeIn { from { opacity: 0 } }

/* awake: your screen lights up over the night */
.fm .wake { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; padding: 56px 30px 24px; text-align: center; overflow: auto;
  background: radial-gradient(ellipse at 50% 30%, rgba(255,190,120,.16), transparent 65%); transition: opacity .8s; }
.fm .wake.dimmed { opacity: .3; }
.fm .voice { font-size: 26px; line-height: 1.25; color: #ffd8a8; animation: fmFadeIn 2s ease-out; text-shadow: 0 2px 8px #000; }
.fm .tbar { width: 220px; height: 6px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; margin: 12px 0 14px; flex: none; }
.fm .tbar i { display: block; height: 100%; background: #f2a65a; transform-origin: left; animation: fmShrink 10s linear 1 forwards; }
@keyframes fmShrink { from { transform: scaleX(1) } to { transform: scaleX(0) } }
.fm .ask { font-size: 21px; font-weight: 700; line-height: 1.35; color: #fff4e0; text-shadow: 0 1px 4px #000; max-width: 640px; }
.fm .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 18px; position: relative; --cw: 92px; }
.fm .row.mid { --cw: 80px; margin-top: 10px; }
.fm .orLine { margin: 14px 0 0; font-size: 18px; font-weight: 800; color: #ffd8a8; opacity: .8; }
.fm .mine { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; --cw: 124px; }
.fm .mine .peek { border: 0; background: none; padding: 0; --cw: 150px; }
.fm .mineLbl { font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff4e0; text-shadow: 0 1px 6px #000, 0 0 12px #000; }
.fm .result { min-height: 76px; margin-top: 12px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; }
.fm .result:not(:empty) { background: rgba(12,7,16,.62); border-radius: 18px; padding: 10px 18px; box-shadow: 0 0 24px 10px rgba(12,7,16,.45); }
.fm .result b { font-size: 28px; color: #fff4e0; text-shadow: 0 2px 8px #000; animation: fmFadeIn .8s ease-out; }
.fm .result span { font-size: 19px; font-weight: 700; color: #ffd8a8; text-shadow: 0 1px 6px #000; animation: fmFadeIn 1.4s ease-out; max-width: 520px; line-height: 1.3; }
.fm .result .changed { font-size: 16px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #ffb38a; }
.fm .wake .foot { margin-top: 10px; min-height: 52px; display: flex; gap: 10px; align-items: center; justify-content: center; }
.fm .fmAside { font-size: 15px; color: #ffd8a8; opacity: .75; }
/* the wolves' turn: the other wolf large, you small in the corner */
.fm .bigTile { position: relative; margin-top: 6px; border-radius: 18px; overflow: hidden; border: 5px solid #ffd79a; background: #2a1c26; flex: none;
  width: min(500px, 88vw); aspect-ratio: 4 / 3; box-shadow: 0 0 0 3px rgba(255,150,70,.5), 0 0 60px 10px rgba(255,150,70,.45); }
/* two other wolves: side by side, smaller */
.fm .bigTiles { display: flex; gap: 12px; justify-content: center; }
.fm .bigTiles.n2 .bigTile { width: min(320px, 43vw); }
.fm .fmInPlay { font-size: 15px; color: #e9dcc4; opacity: .8; margin-top: 10px; text-align: center; }
.fm .bigTile video, .fm .selfTile video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.fm .bigTile.noPic video, .fm .selfTile.noPic video { visibility: hidden; }
.fm .bigTile .bn { position: absolute; left: 12px; bottom: 10px; background: rgba(0,0,0,.6); padding: 4px 14px; border-radius: 12px; font-size: 22px; font-weight: 800; }
.fm .bigTile.noPic .bn { left: 50%; top: 50%; bottom: auto; transform: translate(-50%, -50%); font-size: 30px; }
.fm .selfTile { position: absolute; right: 22px; bottom: 22px; width: 150px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; border: 3px solid #efe2cc; background: #2a1c26; z-index: 7; }
.fm .selfTile span { position: absolute; left: 6px; bottom: 4px; font-size: 13px; font-weight: 800; background: rgba(0,0,0,.6); padding: 1px 8px; border-radius: 8px; }
/* the Henchman: names only */
.fm .plates { display: flex; gap: 22px; margin-top: 22px; justify-content: center; }
.fm .plate { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 26px 14px; border-radius: 18px; background: rgba(20,10,20,.65);
  border: 3px solid #b23a2a; box-shadow: 0 0 30px rgba(178,58,42,.45); min-width: 150px; }
.fm .plate .pi { width: 64px; height: 64px; border-radius: 50%; }
.fm .plate .pi svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.fm .plate .pi.gold { background: radial-gradient(circle, #5a2a2a, #120c1a 75%); box-shadow: 0 0 0 1.5px #e8c26a; padding: 6px; }
.fm .plate .pi.story { background: #fff8ec; padding: 2px; }
.fm .plate b { font-size: 30px; }
/* the narrator's words, low on the screen */
#fmWords { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 7; width: max-content; max-width: min(640px, calc(100vw - 32px));
  text-align: center; font-size: 22px; line-height: 1.3; color: #ffd8a8; text-shadow: 0 2px 8px #000, 0 0 18px #000; pointer-events: none; opacity: 0; transition: opacity 1.2s; }
#fmWords.on { opacity: 1; }

/* ---------- day: timer, Vote now, the little reminder ---------- */
.fm .clock { font-size: 92px; line-height: 1; color: #fff4e0; text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.fm .clockLbl { font-size: 19px; font-weight: 700; color: #e9f1ea; margin: 6px 0 22px; }
.fm .talk { font-size: 24px; font-weight: 800; margin-bottom: 22px; color: #ffd54a; }
.fm .voteNow { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fm .remind { display: flex; align-items: center; gap: 10px; background: rgba(30,18,8,.82); border: 2px solid #8a6240; border-radius: 14px;
  padding: 8px 10px; text-align: left; color: #f4ead8; --cw: 34px; margin-top: 18px; max-width: 420px; }
.fm .remindWrap { display: contents; }
.fm .remindWrap.shut .remind, .fm .remindWrap:not(.shut) .remindOpen { display: none; }
.fm .remind .rX { border: 0; background: none; color: #f4ead8; font-size: 22px; line-height: 1; padding: 0 4px; align-self: flex-start; }
.fm .remindOpen { margin-top: 18px; font-size: 14px; font-weight: 700; padding: 8px 12px; border-radius: 14px; border: 2px solid #8a6240; background: rgba(30,18,8,.82); color: #f4ead8; }
.fm .remind .rTxt { font-size: 14px; line-height: 1.3; }
.fm .remind .rTxt b { color: #ffd54a; }
@media (orientation: landscape) and (min-height: 600px) {
  .fm .remindOpen { position: absolute; left: 12px; top: 12px; margin: 0; }
  .fm .remind { position: absolute; left: 12px; top: 12px; width: 162px; flex-direction: column; text-align: center; padding: 10px 8px; --cw: 52px; margin: 0; }
}

/* ---------- vote: tap a face ---------- */
.fm .vHead { font-size: 34px; color: #fff4e0; margin-bottom: 8px; }
.fm .vSub { font-size: 20px; font-weight: 700; color: #e9f1ea; margin-bottom: 18px; line-height: 1.35; }
.fm .vWait { font-size: 18px; color: #ffd54a; font-weight: 800; min-height: 26px; }
#table.fmVoting .seat:not(#mySeat) .face { cursor: pointer; box-shadow: 0 0 0 3px rgba(255,213,74,.5), 0 3px 6px rgba(0,0,0,.45); }
#table[data-game="fullmoon"] .seat.fmPicked .face { border-color: #ffd54a; box-shadow: 0 0 0 3px #ffd54a, 0 0 22px #ffd54a !important; }
/* sideways: the players' faces leave the corners and gather big in the middle, right over "Time to vote!" (your own stays small in its corner).
   fullmoon-ui.js sets --fmN (how many), --fmC / --fmR (columns and rows); the faces get as big as the width and height allow */
@media (orientation: landscape) {
  #table[data-game="fullmoon"].fmVote {
    --fmCols: var(--fmC); --fmRows: var(--fmR); --fmGap: 24px; --fmWide: 64vw; --fmText: 230px;
    --fmFw: max(56px, min(220px, (var(--fmWide) - (var(--fmCols) - 1) * var(--fmGap)) / var(--fmCols) - 8px, ((91vh - var(--fmText)) / var(--fmRows) - 54px) / .75));
    --fmTilesH: calc(var(--fmRows) * (var(--fmFw) * .75 + 40px) + (var(--fmRows) - 1) * 14px);
    --fmTop: max(6vh + 22px, (100vh - var(--fmTilesH) - var(--fmText) + 40px) / 2);
    --fmRowW: calc(var(--fmCols) * (var(--fmFw) + 8px) + (var(--fmCols) - 1) * var(--fmGap));
  }
  #table[data-game="fullmoon"].fmVote #felt { bottom: 3%; }
  #table[data-game="fullmoon"].fmVote #seats { z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 14px var(--fmGap);
    padding: var(--fmTop) calc((100vw - var(--fmRowW)) / 2 - 1px) 0; }
  #table[data-game="fullmoon"].fmVote .seat.fmVoter { position: relative; inset: auto; --fw: var(--fmFw); width: calc(var(--fmFw) + 8px); flex: none; }
  #table[data-game="fullmoon"].fmVote .seat.fmVoter .name { font-size: 20px; max-width: 100%; }
  #table[data-game="fullmoon"].fmVote #fullmoonArea .fmPane { margin: calc(var(--fmTop) + var(--fmTilesH) - 6vh - 8px) auto auto; padding-top: 4px; }
}
/* a sideways phone (short): all the faces in one row across the screen, and smaller words */
@media (orientation: landscape) and (max-height: 520px) {
  #table[data-game="fullmoon"].fmVote { --fmCols: var(--fmN); --fmRows: 1; --fmGap: 14px; --fmWide: 88vw; --fmText: 222px; }
  #table[data-game="fullmoon"].fmVote .seat.fmVoter .name { font-size: 15px; }
  #table[data-game="fullmoon"].fmVote .fm .vHead { font-size: 26px; margin-bottom: 4px; }
  #table[data-game="fullmoon"].fmVote .fm .vSub { font-size: 16px; margin-bottom: 6px; }
  #table[data-game="fullmoon"].fmVote .fm .vWait { font-size: 15px; }
}

/* ---------- under the faces ---------- */
#table[data-game="fullmoon"] .seat .cnt { background: none; padding: 0; flex-direction: column; gap: 2px; }
#table[data-game="fullmoon"] #mySeat .cnt:not(:empty) { display: flex; }
/* upright phones: seats sit in a row, so make each one the box its badges and Out tag sit in */
@media (orientation: portrait) { #table[data-game="fullmoon"] .seat { position: relative; inset: auto; } }
.fmBadge { position: absolute; top: -8px; right: -8px; z-index: 2; white-space: nowrap; background: #2e7d4a; color: #fff; font-size: 13px; font-weight: 800; padding: 2px 9px; border-radius: 12px; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,.4); }
.fmBadge.pick { background: #ffd54a; color: #3b2412; }
.rolePill { font-size: 13px; font-weight: 800; color: #fff; background: var(--rc); padding: 2px 9px; border-radius: 10px; white-space: nowrap; border: 2px solid rgba(255,255,255,.75); }
.votedFor { font-size: 12px; font-weight: 700; color: #f0e2c8; white-space: nowrap; text-shadow: 0 1px 2px #000; }
.fmTcard { position: absolute; right: -14px; top: 30px; --cw: 50px; z-index: 2; transform: rotate(8deg); pointer-events: none; }
#table[data-game="fullmoon"] .seat.fmOut .face { filter: grayscale(.6) brightness(.7); }
.outTag { position: absolute; top: 18%; left: 50%; transform: translateX(-50%) rotate(-8deg); background: #b23a2a; color: #fff; font-weight: 900; font-size: 20px;
  padding: 3px 14px; border-radius: 10px; border: 3px solid #fff; z-index: 3; box-shadow: 0 3px 8px rgba(0,0,0,.5); pointer-events: none; }

/* ---------- the reveal ---------- */
.fm .win { font-size: 44px; line-height: 1.1; color: #ffd54a; text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.fm .winSub { font-size: 18px; line-height: 1.35; font-weight: 700; color: #e9f1ea; margin: 6px 0 12px; max-width: 520px; }
.fm .midLbl { font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #cfe3d4; margin-bottom: 6px; }
.fm .midRow { display: flex; gap: 10px; justify-content: center; --cw: 56px; margin-bottom: 12px; }
.fm ol.story { text-align: left; margin: 0 0 14px; padding-left: 22px; font-size: 16px; line-height: 1.45; color: #f4f8f4; max-width: 520px; }
.fm ol.story b { color: #fff; }
.fmBtns { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: center; }

/* upright phones: everything a size smaller */
@media (orientation: portrait) {
  .fmTitle { font-size: 20px; }
  .fmLine { font-size: 15px; }
  .fmNight .say { font-size: 30px; top: 16%; }
  .fm .wake { padding: 50px 14px 20px; }
  .fm .voice { font-size: 22px; }
  .fm .ask { font-size: 17px; }
  .fm .row { --cw: 56px; gap: 10px 8px; margin-top: 14px; }
  .fm .row.mid { --cw: 52px; margin-top: 8px; }
  .fm .sl { font-size: 13px; max-width: 64px; }
  .fm .orLine { font-size: 15px; margin-top: 10px; }
  .fm .mine { --cw: 104px; }
  .fm .mine .peek { --cw: 124px; }
  .fm .result { min-height: 70px; }
  .fm .result:not(:empty) { padding: 8px 12px; }
  .fm .result b { font-size: 22px; }
  .fm .result span { font-size: 15px; }
  .fm .result .changed { font-size: 13px; }
  .fm .bigTile .bn { font-size: 17px; }
  .fm .selfTile { width: 92px; right: 14px; bottom: 96px; }
  .fm .plates { gap: 12px; }
  .fm .plate { min-width: 120px; padding: 14px 16px 10px; }
  .fm .plate b { font-size: 24px; }
  .fm .btnGo { font-size: 20px; padding: 11px 30px; }
  .fm .btnMoon { font-size: 19px; padding: 11px 28px; }
  .fm .btnQuiet { font-size: 15px; padding: 8px 16px; }
  .fm .clock { font-size: 64px; }
  .fm .clockLbl { font-size: 15px; margin-bottom: 14px; }
  .fm .talk { font-size: 18px; margin-bottom: 14px; }
  .fm .voteCount { font-size: 15px; }
  .fm .vHead { font-size: 26px; }
  .fm .vSub { font-size: 16px; margin-bottom: 10px; }
  .fm .vWait { font-size: 15px; }
  .fm .win { font-size: 26px; }
  .fm .winSub { font-size: 14px; margin: 4px 0 8px; }
  .fm .midRow { --cw: 40px; gap: 8px; margin-bottom: 8px; }
  .fm .midLbl { font-size: 11px; margin-bottom: 4px; }
  .fm ol.story { font-size: 13px; line-height: 1.38; margin-bottom: 10px; padding-left: 18px; }
  .fmTcard { display: none; }
  .rolePill { font-size: 11px; padding: 1px 7px; }
  .votedFor { font-size: 11px; }
  .outTag { font-size: 15px; padding: 2px 10px; }
  .fmBadge { font-size: 11px; padding: 2px 7px; top: -6px; right: -6px; }
  #fmWords { font-size: 18px; bottom: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .fmNight .cloud, .fmNight .star, .fmNight .say { animation: none; }
  .cdIn { transition: none; }
}
