/* table scene (agent 05): background light, wooden rim, seats, turn-timer ring,
   last-throw fans, score tokens, Yaniv megaphone, Scores note.
   Only transform/opacity animate. Card faces/backs belong to cards.css. */

#table {
  --ring-gold: #ffd23f;
  --ring-warn: #ff5b3a;
  --ring-track: #6b4a2b;
  --seat-ink: #fff;
  --plank-hi: rgba(255, 244, 214, 0.6);
}

/* ------------------------------------------------------------ surface */
/* Golden-hour beach table to match the 3D landing: a sunset wash along the top edge, a warm
   light pool on the centre, soft vignette and fine grain. Static; [data-quality=low] → flat.
   paper = honey teak planks · ocean = teal felt with faint caustics. */
body[data-theme="paper"] #table .water {
  background:
    linear-gradient(180deg, rgba(255, 128, 92, 0.30) 0%, rgba(255, 178, 120, 0.14) 8%, rgba(255, 200, 140, 0) 22%),
    radial-gradient(70% 42% at 50% 47%, rgba(255, 242, 212, 0.62), rgba(255, 236, 200, 0.2) 55%, rgba(255, 236, 200, 0) 78%),
    radial-gradient(135% 100% at 50% 46%, rgba(60, 30, 10, 0) 52%, rgba(60, 30, 10, 0.46) 100%),
    repeating-linear-gradient(90deg, rgba(86, 46, 16, 0.12) 0 1.5px, rgba(86, 46, 16, 0) 1.5px 78px),
    repeating-linear-gradient(90deg, rgba(255, 228, 186, 0.08) 0 39px, rgba(130, 74, 30, 0.06) 39px 78px),
    linear-gradient(180deg, #dcb17a 0%, #d2a368 48%, #c38f55 100%);
}
body[data-theme="paper"] #table .water::before { opacity: 0.26; }
body[data-theme="ocean"] #table .water {
  background:
    linear-gradient(180deg, rgba(255, 140, 104, 0.34) 0%, rgba(255, 196, 150, 0.12) 9%, rgba(255, 196, 150, 0) 24%),
    radial-gradient(70% 42% at 50% 47%, rgba(200, 255, 244, 0.42), rgba(160, 240, 230, 0.12) 55%, rgba(160, 240, 230, 0) 78%),
    radial-gradient(135% 100% at 50% 46%, rgba(0, 40, 55, 0) 50%, rgba(0, 40, 55, 0.5) 100%),
    linear-gradient(180deg, #2db6be 0%, #1b9cab 52%, #127f92 100%);
}
/* caustic lines: faint and very slow */
body[data-theme="ocean"] #table .water::before { opacity: 0.2; animation-duration: 120s; }
/* palm shade over the top corners: barely there, still */
#table .water::after {
  inset: -4% -4% auto -4%;
  height: 52%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300'%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='2.2'/%3E%3C/filter%3E%3Cg fill='%231e2a14' filter='url(%23b)'%3E%3Cpath d='M-20.6 -6.5L-9.8 -4.4L1.1 -1.9L11.8 1.0L22.6 4.4L33.3 8.3L44.0 12.6L54.7 17.3L65.3 22.5L75.9 28.2L86.4 34.3L96.9 40.8L107.4 47.9L117.8 55.3L128.2 63.3L138.5 71.7L148.8 80.5L159.1 89.8L169.3 99.5L179.4 109.7L189.6 120.4L190.4 119.6L180.5 108.7L170.5 98.3L160.5 88.3L150.4 78.7L140.3 69.6L130.0 60.9L119.8 52.7L109.4 44.9L99.1 37.6L88.6 30.7L78.1 24.3L67.5 18.3L56.9 12.7L46.2 7.6L35.4 3.0L24.6 -1.2L13.7 -5.0L2.7 -8.3L-8.3 -11.1L-19.4 -13.5ZM6.7 -3.8Q20.2 17.8 21.0 35.6Q16.4 16.6 12.9 -2.0ZM6.7 -3.8Q27.6 -7.1 35.8 -14.1Q23.7 -8.2 12.9 -2.0ZM19.0 -0.0Q33.1 27.8 34.8 51.2Q29.3 26.5 25.0 2.1ZM19.0 -0.0Q44.0 -3.8 56.6 -11.9Q40.2 -5.1 25.0 2.1ZM31.1 4.3Q45.3 37.5 47.3 65.8Q41.6 36.0 37.1 6.7ZM31.1 4.3Q59.9 0.5 76.4 -8.1Q56.2 -0.9 37.1 6.7ZM43.2 9.3Q57.0 46.8 58.7 78.9Q53.3 45.1 49.1 11.9ZM43.2 9.3Q75.1 6.0 94.9 -2.7Q71.4 4.3 49.1 11.9ZM55.3 14.8Q68.2 55.3 69.2 90.0Q64.6 53.5 61.0 17.6ZM55.3 14.8Q89.3 12.4 111.6 4.1Q85.8 10.6 61.0 17.6ZM67.3 20.9Q79.0 63.0 79.0 98.9Q75.4 61.1 72.9 23.9ZM67.3 20.9Q102.5 19.7 126.2 12.1Q99.0 17.7 72.9 23.9ZM79.2 27.5Q89.5 69.8 88.5 105.4Q86.1 67.8 84.7 30.8ZM79.2 27.5Q114.6 27.7 138.6 21.1Q111.2 25.7 84.7 30.8ZM91.1 34.7Q100.0 75.7 97.9 109.5Q96.7 73.5 96.5 38.2ZM91.1 34.7Q125.4 36.4 148.7 30.9Q122.1 34.2 96.5 38.2ZM102.9 42.5Q110.5 80.8 107.3 111.4Q107.3 78.5 108.2 46.2ZM102.9 42.5Q135.1 45.6 156.5 41.0Q131.8 43.3 108.2 46.2ZM114.7 50.9Q121.2 85.1 117.2 111.4Q118.0 82.7 119.8 54.8ZM114.7 50.9Q143.7 55.2 162.2 51.5Q140.5 52.8 119.8 54.8ZM126.3 59.9Q132.1 88.9 127.5 109.7Q129.0 86.4 131.3 63.9ZM126.3 59.9Q151.3 65.1 165.9 62.0Q148.2 62.6 131.3 63.9ZM138.0 69.4Q143.3 92.5 138.5 107.0Q140.2 89.9 142.8 73.6ZM138.0 69.4Q158.1 75.2 168.2 72.5Q155.0 72.6 142.8 73.6ZM149.5 79.5Q154.7 96.1 150.2 103.7Q151.8 93.4 154.3 83.8ZM149.5 79.5Q164.3 85.6 169.3 82.8Q161.3 82.9 154.3 83.8ZM161.0 90.2Q166.5 99.9 162.5 100.4Q163.6 97.1 165.6 94.7ZM161.0 90.2Q170.1 96.2 169.7 93.0Q167.2 93.4 165.6 94.7ZM172.5 101.5Q177.7 111.0 173.8 111.2Q174.9 108.2 176.9 106.0ZM172.5 101.5Q181.2 107.7 180.6 104.5Q178.4 104.8 176.9 106.0ZM183.8 113.3Q188.9 123.0 184.9 123.0Q186.1 120.1 188.2 118.0ZM183.8 113.3Q192.4 119.7 192.0 116.5Q189.7 116.8 188.2 118.0Z'/%3E%3Cpath d='M-13.1 -18.1L-8.0 -10.1L-3.2 -1.9L1.5 6.6L6.1 15.3L10.5 24.3L14.8 33.6L19.0 43.1L23.0 52.9L26.8 62.9L30.5 73.2L34.1 83.7L37.5 94.5L40.7 105.6L43.8 116.9L46.8 128.4L49.6 140.3L52.3 152.3L54.8 164.7L57.2 177.2L59.4 190.1L60.6 189.9L58.7 177.0L56.6 164.3L54.4 151.9L52.0 139.7L49.4 127.8L46.8 116.1L43.9 104.7L40.9 93.5L37.8 82.5L34.5 71.8L31.0 61.4L27.4 51.1L23.7 41.2L19.8 31.4L15.7 21.9L11.5 12.7L7.1 3.7L2.6 -5.1L-2.1 -13.6L-6.9 -21.9ZM2.8 2.2Q0.3 26.2 -8.3 38.5Q-1.6 22.6 5.7 7.8ZM2.8 2.2Q20.9 15.4 33.0 17.0Q19.1 11.9 5.7 7.8ZM9.0 14.5Q3.8 43.4 -7.2 60.5Q2.1 39.8 11.8 20.2ZM9.0 14.5Q31.2 30.3 47.6 34.3Q29.4 26.7 11.8 20.2ZM15.0 27.2Q7.3 59.8 -5.7 80.4Q5.7 56.2 17.6 33.1ZM15.0 27.2Q40.1 45.5 59.9 51.6Q38.5 41.8 17.6 33.1ZM20.7 40.5Q11.0 75.3 -3.7 97.9Q9.5 71.6 23.1 46.4ZM20.7 40.5Q47.5 60.6 69.4 68.5Q46.0 56.9 23.1 46.4ZM26.1 54.3Q15.0 89.7 -0.6 112.8Q13.6 86.0 28.3 60.3ZM26.1 54.3Q53.3 75.7 76.0 84.7Q51.9 71.9 28.3 60.3ZM31.2 68.5Q19.6 103.1 3.8 125.1Q18.3 99.3 33.2 74.6ZM31.2 68.5Q57.5 90.4 79.6 99.7Q56.2 86.6 33.2 74.6ZM36.0 83.2Q24.8 115.5 9.7 135.1Q23.6 111.6 37.8 89.3ZM36.0 83.2Q60.1 104.7 80.3 113.5Q58.9 100.8 37.8 89.3ZM40.5 98.4Q30.5 127.1 17.0 143.0Q29.4 123.2 42.2 104.6ZM40.5 98.4Q61.2 118.6 78.4 126.0Q60.2 114.7 42.2 104.6ZM44.7 114.1Q36.8 138.2 25.7 149.5Q35.8 134.3 46.3 120.3ZM44.7 114.1Q61.2 132.1 74.5 137.3Q60.2 128.2 46.3 120.3ZM48.6 130.3Q43.5 149.1 35.4 155.1Q42.6 145.2 50.0 136.5ZM48.6 130.3Q60.2 145.3 68.9 147.5Q59.4 141.4 50.0 136.5ZM52.3 146.9Q50.4 160.2 45.9 160.6Q49.6 156.3 53.5 153.2ZM52.3 146.9Q58.7 158.5 62.4 157.2Q57.9 154.6 53.5 153.2ZM55.6 164.0Q55.0 175.1 52.1 173.1Q54.3 171.1 56.8 170.3ZM55.6 164.0Q59.8 174.2 61.6 171.4Q59.1 170.3 56.8 170.3ZM58.7 181.7Q57.9 192.7 55.0 190.6Q57.3 188.7 59.7 188.0ZM58.7 181.7Q62.6 191.9 64.5 189.1Q62.0 188.0 59.7 188.0Z'/%3E%3Cpath d='M419.6 -18.6L407.5 -16.7L395.7 -14.4L384.1 -11.8L372.6 -8.7L361.3 -5.2L350.2 -1.3L339.3 2.9L328.6 7.6L318.1 12.7L307.8 18.1L297.6 24.0L287.6 30.3L277.9 36.9L268.3 44.0L258.8 51.4L249.6 59.3L240.6 67.5L231.7 76.2L223.0 85.2L214.6 94.6L215.4 95.4L224.1 86.2L233.0 77.4L242.0 69.1L251.2 61.1L260.5 53.6L270.0 46.4L279.7 39.7L289.6 33.3L299.6 27.4L309.7 21.9L320.1 16.7L330.6 12.0L341.2 7.7L352.1 3.7L363.0 0.2L374.2 -2.9L385.5 -5.6L397.0 -8.0L408.6 -9.9L420.4 -11.4ZM390.2 -9.9Q370.3 -14.3 363.2 -21.7Q374.2 -15.2 384.0 -8.5ZM390.2 -9.9Q375.8 10.1 374.3 27.2Q379.7 9.2 384.0 -8.5ZM376.5 -6.6Q352.6 -11.8 341.4 -20.5Q356.4 -12.9 370.3 -5.0ZM376.5 -6.6Q361.1 19.4 358.5 42.0Q365.0 18.4 370.3 -5.0ZM363.0 -2.8Q335.6 -8.1 320.7 -17.5Q339.4 -9.4 356.9 -0.8ZM363.0 -2.8Q347.4 28.5 344.3 55.8Q351.2 27.3 356.9 -0.8ZM349.8 1.7Q319.5 -3.3 301.5 -12.8Q323.2 -4.6 343.8 3.9ZM349.8 1.7Q334.5 37.1 331.6 67.8Q338.3 35.7 343.8 3.9ZM336.8 6.7Q304.5 2.7 284.4 -6.4Q308.2 1.2 330.9 9.2ZM336.8 6.7Q322.4 44.8 320.2 77.8Q326.1 43.3 330.9 9.2ZM324.1 12.3Q290.9 9.7 269.6 1.4Q294.5 8.0 318.3 15.1ZM324.1 12.3Q311.0 51.7 309.8 85.3Q314.6 49.9 318.3 15.1ZM311.6 18.5Q278.6 17.5 257.3 10.3Q282.1 15.6 305.9 21.5ZM311.6 18.5Q300.1 57.5 300.2 90.3Q303.6 55.6 305.9 21.5ZM299.3 25.3Q267.8 26.0 247.6 20.0Q271.2 24.0 293.8 28.5ZM299.3 25.3Q289.5 62.4 291.0 92.8Q292.9 60.3 293.8 28.5ZM287.3 32.6Q258.4 35.0 240.5 30.2Q261.7 32.8 282.0 36.1ZM287.3 32.6Q279.0 66.4 281.7 92.9Q282.4 64.2 282.0 36.1ZM275.6 40.5Q250.3 44.4 235.7 40.5Q253.5 42.0 270.4 44.3ZM275.6 40.5Q268.6 69.7 272.3 91.2Q271.8 67.4 270.4 44.3ZM264.1 49.0Q243.4 54.0 233.0 50.8Q246.5 51.5 259.1 53.0ZM264.1 49.0Q258.0 72.6 262.3 87.9Q261.1 70.1 259.1 53.0ZM252.8 58.1Q237.3 63.8 231.9 60.8Q240.4 61.2 248.0 62.3ZM252.8 58.1Q247.2 75.3 251.7 83.9Q250.3 72.7 248.0 62.3ZM241.8 67.8Q232.0 73.7 231.8 70.5Q234.9 70.9 237.1 72.1ZM241.8 67.8Q236.2 78.2 240.3 79.7Q239.2 75.5 237.1 72.1ZM231.1 78.0Q222.3 84.2 222.9 81.0Q225.1 81.4 226.6 82.6ZM231.1 78.0Q225.7 87.6 229.7 87.7Q228.6 84.7 226.6 82.6ZM220.6 88.9Q212.0 95.4 212.4 92.1Q214.8 92.4 216.3 93.6ZM220.6 88.9Q215.6 98.6 219.5 98.6Q218.3 95.7 216.3 93.6Z'/%3E%3Cpath d='M411.8 -21.6L407.5 -12.5L403.3 -3.3L399.2 5.9L395.2 15.2L391.4 24.5L387.7 33.9L384.2 43.3L380.8 52.8L377.4 62.3L374.3 71.8L371.2 81.4L368.3 91.1L365.5 100.8L362.8 110.5L360.3 120.3L357.8 130.1L355.5 140.0L353.4 149.9L351.3 159.9L349.4 169.9L350.6 170.1L352.8 160.2L355.1 150.3L357.6 140.5L360.2 130.7L362.9 121.0L365.7 111.3L368.6 101.7L371.7 92.1L374.9 82.6L378.2 73.2L381.7 63.8L385.2 54.4L388.9 45.1L392.8 35.9L396.7 26.7L400.8 17.6L404.9 8.5L409.2 -0.5L413.7 -9.5L418.2 -18.4ZM403.0 5.2Q385.9 19.3 374.3 21.3Q387.6 15.6 400.3 11.1ZM403.0 5.2Q406.4 28.4 415.2 39.6Q408.0 24.8 400.3 11.1ZM396.9 19.0Q375.9 35.5 360.1 39.8Q377.5 31.8 394.4 24.9ZM396.9 19.0Q402.8 46.9 414.0 62.7Q404.4 43.2 394.4 24.9ZM391.1 32.9Q367.3 51.4 348.4 57.7Q368.8 47.7 388.7 38.8ZM391.1 32.9Q399.1 64.2 412.1 83.3Q400.6 60.5 388.7 38.8ZM385.5 46.9Q360.3 66.8 339.7 74.4Q361.7 63.1 383.3 52.8ZM385.5 46.9Q395.1 80.0 409.4 100.8Q396.5 76.3 383.3 52.8ZM380.3 61.0Q355.0 81.6 334.1 89.8Q356.3 77.9 378.2 67.0ZM380.3 61.0Q390.6 94.3 405.4 115.2Q392.0 90.5 378.2 67.0ZM375.3 75.2Q351.4 95.7 331.7 103.7Q352.7 91.9 373.3 81.2ZM375.3 75.2Q385.5 107.1 399.9 126.4Q386.8 103.3 373.3 81.2ZM370.7 89.5Q349.5 109.0 332.2 115.9Q350.6 105.2 368.8 95.6ZM370.7 89.5Q379.9 118.4 393.0 134.8Q381.1 114.6 368.8 95.6ZM366.2 104.0Q348.9 121.5 335.3 126.5Q350.0 117.7 364.5 110.1ZM366.2 104.0Q373.7 128.7 384.7 140.8Q374.8 124.9 364.5 110.1ZM362.1 118.5Q349.5 133.5 340.3 135.7Q350.5 129.6 360.5 124.7ZM362.1 118.5Q367.0 138.2 375.3 145.1Q368.0 134.3 360.5 124.7ZM358.3 133.2Q350.8 145.0 346.6 143.9Q351.8 141.1 356.8 139.4ZM358.3 133.2Q360.1 147.2 365.1 148.5Q361.0 143.4 356.8 139.4ZM354.7 148.0Q350.2 157.9 348.6 155.0Q351.1 154.0 353.3 154.2ZM354.7 148.0Q354.9 159.0 357.9 157.2Q355.7 155.1 353.3 154.2ZM351.5 162.9Q347.1 172.9 345.4 170.1Q347.9 169.0 350.2 169.1ZM351.5 162.9Q351.8 173.9 354.8 172.0Q352.6 170.0 350.2 169.1Z'/%3E%3C/g%3E%3C/svg%3E") center top / 100% auto no-repeat;
  opacity: 0.07;
  mix-blend-mode: multiply;
  pointer-events: none;
}
body[data-theme="ocean"] #table .water::after { opacity: 0.1; }
html[data-quality="low"] body[data-theme="paper"] #table .water { background: radial-gradient(120% 90% at 50% 45%, #e2bb86, #c38f55); }
html[data-quality="low"] body[data-theme="ocean"] #table .water { background: radial-gradient(120% 90% at 50% 45%, #33bcc3, #127f92); }
html[data-quality="low"] #table .water::before, html[data-quality="low"] #table .water::after { display: none; }

/* wooden table rim around the hand (both themes) */
body[data-theme] .table-arc { display: block; }
.table-arc .ta-fill { fill: rgba(255, 250, 236, 0.16); }
body[data-theme="ocean"] .table-arc .ta-fill { fill: rgba(255, 236, 190, 0.26); }
.table-arc .ta-shade { stroke: rgba(50, 28, 8, 0.22); }
body[data-theme="ocean"] .table-arc .ta-shade { stroke: rgba(0, 50, 80, 0.28); }

/* ------------------------------------------------------------ table layout */
/* One vertical rhythm for the whole table (all values resolve against the table height):
     --ts  top seat's top edge: tucked between Menu and chat on short phones, below that bar on tall ones
     --th  top seat's height (avatar + name + last-throw row)
     --cc  centre row height (= deck footprint, 168px * --deck-s)
     --rb  reserved at the bottom: hand block + turn banner (banner clears a lifted card)
   The centre row is optically centred in the band between the top seat and the banner
   (36px is the caption/take slot under it); the side seats hang on the same centre line. */
#table {
  --av: 50px;
  --deck-s: 0.72;
  --pile-s: 1.1;
  --cc: 121px;
  --ts: clamp(14px, calc((100% - 640px) * 0.55 + 14px), 116px);
  --th: 124px;
  --rb: 276px;
  --ct: calc(var(--ts) + var(--th) + (100% - var(--ts) - var(--th) - var(--rb) - var(--cc) - 36px) * 0.54);
  --side-x: 10px;
}
.turn-banner { bottom: calc(244px + var(--safe-bottom)); }
/* wide (desktop column): more room between the side seats */
@media (min-width: 480px) {
  #table { --av: 56px; --deck-s: 0.8; --pile-s: 1.14; --cc: 134px; --th: 130px; --side-x: 18px; }
}
/* narrow phones: smaller centre so it clears the side seats (height rules below still win) */
@media (max-width: 370px) {
  #table { --deck-s: 0.6; --cc: 101px; --pile-s: 0.95; --side-x: 6px; }
}
@media (max-height: 760px) {
  #table { --av: 46px; --deck-s: 0.62; --pile-s: 0.95; --cc: 104px; --th: 116px; --rb: 258px; }
  .turn-banner { bottom: calc(226px + var(--safe-bottom)); }
}
@media (max-height: 660px) {
  #table { --av: 42px; --deck-s: 0.56; --pile-s: 0.88; --cc: 94px; --th: 106px; --rb: 238px; }
  .turn-banner { bottom: calc(206px + var(--safe-bottom)); }
}

/* centre: deck and pile side by side, take row (and the anim caption) beneath */
.table-center {
  top: calc(var(--ct) + var(--safe-top) / 2);
  flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center;
  column-gap: 0; row-gap: 16px;
}
#deckFan { order: 1; }
#pile { order: 2; }
#takeRow { order: 3; flex: 0 0 100%; }
.deck-swirl, .deck-swirl:active {
  transform: scale(var(--deck-s));
  margin: calc(84px * (var(--deck-s) - 1));
  margin-right: calc(84px * (var(--deck-s) - 1) - 6px); /* pile tucks against the swirl blades */
}
.deck-swirl:active { transform: scale(calc(var(--deck-s) * 0.96)); }
/* pile box hugs one card (cards are laid out around its centre in renderTable) */
.pile { width: 88px; height: 92px; transform: scale(var(--pile-s)); margin: calc(46px * (var(--pile-s) - 1)) calc(44px * (var(--pile-s) - 1)); }
.pile .empty-label { white-space: nowrap; }
.take-row { margin: 0; }
.take-row:not(:empty) + .pile { margin-top: 0; }
/* keep the anim agent's "X threw …" chip on the table axis, under the centre row */
.anim-caption { left: 50% !important; }

/* ------------------------------------------------------------ seats */
.seats { top: 0; bottom: 0; height: auto; z-index: 5; }
.opp {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  width: calc(var(--av) + 28px);
  transition: opacity 0.35s ease;
}
.opp-top { top: calc(var(--ts) + var(--safe-top)); left: 50%; transform: translateX(-50%); }
.opp-left, .opp-right { top: calc(var(--ct) + var(--safe-top) / 2 + var(--cc) / 2 - var(--av) / 2 - 2px); }
.opp-left { left: var(--side-x); right: auto; }
.opp-right { right: var(--side-x); left: auto; }
.opp .seat-main { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; transition: transform 0.4s cubic-bezier(0.2, 1.3, 0.4, 1); }
.opp .seat-throw { position: relative; z-index: 1; margin-top: 4px; }
.opp-left .seat-throw { align-self: flex-start; }
.opp-right .seat-throw { align-self: flex-end; }

/* spotlight: active seat grows and glows, the others step back */
.seats.has-active .opp:not(.active) { opacity: 0.66; }
.opp.active .seat-main { transform: scale(1.12); }
.opp.eliminated { opacity: 0.4; }

/* avatar */
.seat-avatar, .me-ava { position: relative; width: var(--av, 46px); height: var(--av, 46px); flex: 0 0 auto; }
.seat-avatar .ava, .me-ava .ava {
  position: absolute; inset: 0; border-radius: 50%;
  display: grid; place-items: center;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: calc(var(--av, 46px) * 0.45); color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.45), transparent 42%),
    radial-gradient(circle at 50% 40%, hsl(var(--hue, 200) 62% 58%), hsl(var(--hue, 200) 58% 38%) 68%, hsl(var(--hue, 200) 62% 26%));
  border: 3px solid #fbf1dc;
  box-shadow:
    0 0 0 2px #7a4b1f,
    0 0 0 3px rgba(255, 226, 170, 0.5),
    0 4px 8px rgba(60, 40, 15, 0.4),
    inset 0 -4px 7px rgba(0, 0, 0, 0.25);
}
.opp.bot .ava::after {
  content: ""; position: absolute; top: -5px; left: 50%; width: 3px; height: 6px; margin-left: -1.5px;
  background: #7a4b1f; border-radius: 2px;
  box-shadow: 0 -3px 0 1px #ffd23f;
}
.opp.offline .ava { opacity: 0.55; }
/* glow halo behind the active avatar */
.seat-avatar::before, .me-ava::before {
  content: ""; position: absolute; inset: -16px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 80, 0.75), rgba(255, 214, 80, 0) 75%);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.opp.active .seat-avatar::before, .me-line.active .me-ava::before { opacity: 1; animation: haloPulse 1.6s ease-in-out infinite; }
@keyframes haloPulse { 0%, 100% { opacity: 0.55; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.06); } }

/* score token: cyan coin pinned to the avatar */
.opp .token {
  position: absolute; right: -9px; bottom: -6px; z-index: 3;
  width: auto; min-width: 25px; height: 25px; padding: 0 4px; border-radius: 13px;
  background:
    radial-gradient(circle at 40% 28%, rgba(255, 255, 255, 0.55), transparent 45%),
    radial-gradient(circle at 50% 40%, #4fd0f5, #1ba6d8 62%, #1290c0);
  border: 2px solid #0a7fae;
  font-size: 13px; font-weight: 600; font-style: italic; line-height: 1;
  box-shadow: 0 2px 3px rgba(40, 25, 10, 0.4), inset 0 -2px 0 rgba(0, 60, 100, 0.25);
  transition: transform 0.3s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.opp .token::before { inset: 2px; border-radius: inherit; border-color: rgba(255, 255, 255, 0.35); }
.opp.active .token { box-shadow: 0 2px 3px rgba(40, 25, 10, 0.4), inset 0 -2px 0 rgba(0, 60, 100, 0.25); }

/* name plate */
.opp .name {
  margin-top: 5px; font-size: 16px; max-width: 86px;
  -webkit-text-stroke: 1.5px var(--name-stroke);
}
.opp-left .name, .opp-right .name { margin-left: 0; margin-right: 0; max-width: 72px; }
.opp.active .name { color: #ffe680; -webkit-text-stroke-color: #8a5410; }

/* opponents' hand: small fan of backs plus a count chip */
/* tucked behind the avatar, peeking out toward the table (top seat: to the left) */
.opp .back-fan { position: absolute; z-index: 1; top: calc(var(--av) * 0.5 - 30px); width: 44px; height: 44px; }
.opp-left .back-fan { left: calc(50% + var(--av) * 0.5 - 24px); }
.opp-right .back-fan, .opp-top .back-fan { right: calc(50% + var(--av) * 0.5 - 24px); }
.opp .back-fan .back-mini {
  width: 23px; height: 33px; margin: -16px 0 0 -11.5px; border-radius: 3px;
  transform: rotate(var(--rot, 0deg)) translate(var(--x, 0px), calc(var(--y, 0px) - 2px));
  transform-origin: 50% 90%;
}
.opp .back-fan .back-mini::after { font-size: 5.5px; }
.opp .hand-n {
  position: absolute; right: -2px; bottom: -3px; z-index: 6;
  min-width: 17px; height: 17px; padding: 0 3px; border-radius: 9px;
  display: grid; place-items: center;
  background: #3b2614; color: #ffe9b8; font-size: 10.5px; font-weight: 600; line-height: 1;
  border: 1.5px solid #f6e3bd;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ------------------------------------------------------------ last throw */
.opp .seat-throw {
  display: flex; align-items: center; gap: 5px; min-height: 38px;
  transition: opacity 0.25s ease;
}
.opp-right .seat-throw { flex-direction: row-reverse; }
.opp .seat-throw.empty { opacity: 0; }
.st-fan { display: flex; align-items: center; padding: 2px 0 0 9px; animation: stIn 0.35s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
@keyframes stIn { from { opacity: 0; transform: translateY(-8px) scale(0.85); } }
.seat-card {
  position: relative; width: 25px; height: 35px; margin-left: -9px; flex: 0 0 auto;
  border-radius: 4px; background: #fffdf7;
  border: 1px solid rgba(60, 45, 25, 0.45);
  box-shadow: 0 2px 3px rgba(60, 40, 15, 0.32);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: Georgia, "Times New Roman", serif; line-height: 0.95;
  transform: rotate(calc(var(--i, 0) * 7deg)) translateY(calc(var(--i, 0) * var(--i, 0) * 1px));
  color: #1a1a1a;
}
.seat-card b { font-size: 14px; font-weight: 700; }
.seat-card i { font-style: normal; font-size: 12px; }
.seat-card.red, .seat-card.joker { color: var(--red); }
.seat-card.joker i { font-family: "Fredoka", sans-serif; font-size: 6.5px; letter-spacing: 0.3px; margin-top: 1px; }
.seat-card.taken { opacity: 0.38; }
.seat-card.taken::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 1.5px;
  background: #8a5410; transform: rotate(-35deg);
}
/* drew-from chip */
.st-drew {
  display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 4px 0 3px;
  border-radius: 11px; background: rgba(255, 249, 234, 0.92);
  border: 1px solid rgba(138, 84, 16, 0.45);
  box-shadow: 0 1px 2px rgba(60, 40, 15, 0.3);
  color: #6b3f12; font-size: 11px; font-weight: 600; line-height: 1;
  animation: stIn 0.35s 0.08s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}
.st-drew .st-arrow { font-size: 12px; }
.st-drew .st-icon {
  width: 11px; height: 15px; border-radius: 2px;
  background: repeating-conic-gradient(from 0deg at 50% 50%, #5ed3f7 0 15deg, #1fa7dd 15deg 30deg);
  border: 1.5px solid #fff; box-shadow: 0 0 0 0.5px #2b2b2b;
}
.st-drew .seat-card.took { width: 16px; height: 20px; margin: 0; transform: none; box-shadow: none; flex-direction: row; gap: 0; border-radius: 3px; }
.st-drew .seat-card.took b { font-size: 9.5px; }
.st-drew .seat-card.took i { font-size: 8px; }

/* ------------------------------------------------------------ turn-timer ring */
.seat-ring-slot { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.seat-ring { position: absolute; inset: -7px; border-radius: 50%; }
.seat-ring i { position: absolute; border-radius: 50%; }
.seat-ring .r-base { inset: 0; border: 4px solid var(--ring-gold); box-shadow: 0 0 8px rgba(255, 200, 40, 0.75), inset 0 0 4px rgba(255, 200, 40, 0.5); }
.seat-ring .r-warn {
  inset: 0; border: 4px solid var(--ring-warn); opacity: 0;
  animation: ringWarn var(--dur, 32000ms) linear var(--delay, 0ms) both;
}
.seat-ring .sw { inset: -1px; }
.seat-ring .sw-r { clip-path: inset(0 0 0 50%); }
.seat-ring .sw-l { clip-path: inset(0 50% 0 0); }
.seat-ring .arc { inset: 0; border: 6px solid var(--ring-track); }
.seat-ring .sw-r .arc { clip-path: inset(0 50% 0 0); animation: ringR var(--dur, 32000ms) linear var(--delay, 0ms) both; }
.seat-ring .sw-l .arc { clip-path: inset(0 0 0 50%); animation: ringL var(--dur, 32000ms) linear var(--delay, 0ms) both; }
@keyframes ringR { 0% { transform: rotate(0deg); opacity: 0; } 0.4% { opacity: 1; } 50%, 100% { transform: rotate(180deg); opacity: 1; } }
@keyframes ringL { 0%, 50% { transform: rotate(0deg); opacity: 0; } 50.4% { opacity: 1; } 100% { transform: rotate(180deg); opacity: 1; } }
@keyframes ringWarn { 0%, 68% { opacity: 0; } 80%, 100% { opacity: 1; } }
/* bots: short "thinking" sweep */
.seat-ring.thinking { inset: -6px; }
.seat-ring .r-spin {
  inset: 0; border: 3.5px solid rgba(255, 210, 63, 0.25);
  border-top-color: var(--ring-gold); border-right-color: var(--ring-gold);
  animation: ringSpin 0.9s linear infinite;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ me */
.me-line { display: flex; align-items: center; justify-content: center; gap: 8px; }
.me-ava { width: 30px; height: 30px; -webkit-text-stroke: 0; }
.me-ava .ava { font-size: 14px; border-width: 2px; box-shadow: 0 0 0 1.5px #7a4b1f, 0 2px 4px rgba(60, 40, 15, 0.4), inset 0 -3px 5px rgba(0, 0, 0, 0.25); }
.me-ava .seat-ring { inset: -6px; }
.me-ava .seat-ring .r-base, .me-ava .seat-ring .r-warn { border-width: 3px; }
.me-ava .seat-ring .arc { border-width: 5px; }
.me-ava::before { inset: -12px; }
#meScore {
  display: inline-grid; place-items: center; min-width: 27px; height: 27px; padding: 0 5px; border-radius: 14px;
  background:
    radial-gradient(circle at 40% 28%, rgba(255, 255, 255, 0.55), transparent 45%),
    radial-gradient(circle at 50% 40%, #4fd0f5, #1ba6d8 62%, #1290c0);
  border: 2px solid #0a7fae;
  font-size: 14px; font-style: italic; color: #fff;
  -webkit-text-stroke: 0; text-shadow: 0 1px 1px rgba(0, 50, 80, 0.4);
  box-shadow: 0 2px 3px rgba(40, 25, 10, 0.4), inset 0 -2px 0 rgba(0, 60, 100, 0.25);
}
.me-line.active #meName { color: #ffe680; -webkit-text-stroke-color: #8a5410; }
.hand-count { letter-spacing: 1.2px; font-size: 13px; opacity: 0.85; }

/* your-turn glow under the hand */
.hand-wrap::before {
  content: ""; position: absolute; left: -12px; right: -12px; top: -26px; height: 150px; z-index: -1;
  background: radial-gradient(55% 60% at 50% 62%, rgba(255, 210, 70, 0.55), rgba(255, 210, 70, 0) 72%);
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.table.is-my-turn .hand-wrap::before { animation: myTurnGlow 1.9s ease-in-out infinite; }
@keyframes myTurnGlow { 0%, 100% { opacity: 0.45; transform: scale(0.97); } 50% { opacity: 1; transform: scale(1.03); } }

/* ------------------------------------------------------------ turn banner */
.turn-banner {
  animation: none; overflow: hidden;
  background: linear-gradient(180deg, #fff0a6, #ffd447 55%, #f3b72a);
  border-color: #a8650a;
  box-shadow: 0 4px 10px rgba(60, 40, 15, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding-bottom: 8px;
}
.turn-banner::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 4px rgba(255, 209, 63, 0.35), 0 0 22px rgba(255, 170, 0, 0.6);
  opacity: 0; animation: bannerPulse 1.3s ease-in-out infinite;
}
@keyframes bannerPulse { 50% { opacity: 1; } }
.turn-banner .tb-text { position: relative; }
.turn-banner .tb-time { position: absolute; left: 14px; right: 14px; bottom: 3px; height: 3px; border-radius: 2px; background: rgba(120, 70, 10, 0.2); overflow: hidden; }
.turn-banner .tb-time i {
  position: absolute; inset: 0; border-radius: inherit; background: #a8650a;
  transform-origin: 0 50%;
  animation: tbTime var(--dur, 32000ms) linear var(--delay, 0ms) both;
}
@keyframes tbTime { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ------------------------------------------------------------ Yaniv megaphone */
.yaniv-logo { position: relative; }
.yaniv-logo::before {
  content: ""; position: absolute; inset: -14px -8px; border-radius: 40px; z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 214, 70, 0.85), rgba(255, 214, 70, 0) 80%);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.yaniv-logo.live { animation: none; }
.yaniv-logo.live::before { animation: yHalo 1.4s ease-in-out infinite; }
@keyframes yHalo { 0%, 100% { opacity: 0.35; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.05); } }
.yaniv-logo .txt { position: relative; display: inline-block; }
.yaniv-logo.live .txt {
  background: linear-gradient(180deg, #fff6c2, #ffd23f 52%, #d08d0c);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke-color: #5a3500;
}
.yaniv-logo .y-glint {
  position: absolute; top: -3px; bottom: -3px; left: 0; width: 45%;
  overflow: hidden; opacity: 0; pointer-events: none;
  -webkit-mask-image: linear-gradient(100deg, transparent 5%, #000 40%, #000 60%, transparent 95%);
  mask-image: linear-gradient(100deg, transparent 5%, #000 40%, #000 60%, transparent 95%);
  transform: translateX(-110%);
}
.yaniv-logo .y-glint > span {
  position: absolute; left: 0; top: 3px; white-space: nowrap;
  color: #fffef4; -webkit-text-fill-color: #fffef4; background: none;
  -webkit-text-stroke: inherit; text-shadow: 0 0 6px rgba(255, 240, 170, 0.9);
  transform: translateX(49.5%);
}
.yaniv-logo.ready .y-glint, .yaniv-logo.live .y-glint { opacity: 1; animation: yGlint 3.6s ease-in-out infinite; }
.yaniv-logo.ready .y-glint > span, .yaniv-logo.live .y-glint > span { animation: yGlintTxt 3.6s ease-in-out infinite; }
.yaniv-logo.live .y-glint, .yaniv-logo.live .y-glint > span { animation-duration: 1.8s; }
@keyframes yGlint { 0% { transform: translateX(-110%); } 55%, 100% { transform: translateX(330%); } }
@keyframes yGlintTxt { 0% { transform: translateX(49.5%); } 55%, 100% { transform: translateX(-148.5%); } }
.yaniv-logo.live .megaphone { transform-origin: 70% 55%; animation: megWiggle 1.8s ease-in-out infinite; }
@keyframes megWiggle {
  0%, 60%, 100% { transform: rotate(0deg); }
  66% { transform: rotate(-9deg) scale(1.06); }
  74% { transform: rotate(7deg) scale(1.06); }
  82% { transform: rotate(-4deg); }
  90% { transform: rotate(2deg); }
}

/* ------------------------------------------------------------ Scores note */
.scores-note { transition: transform 0.2s ease; }
.scores-note::before {
  content: ""; position: absolute; z-index: 2; top: -5px; left: 10px; width: 30px; height: 12px;
  background: repeating-linear-gradient(90deg, rgba(64, 190, 214, 0.7) 0 4px, rgba(120, 216, 232, 0.7) 4px 8px);
  transform: rotate(-14deg); box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
  clip-path: polygon(0 10%, 6% 0, 12% 12%, 100% 0, 96% 50%, 100% 100%, 6% 92%, 0 100%);
}
@media (hover: hover) { .scores-note:hover { transform: rotate(-6deg) translateY(-3px); } }

/* ------------------------------------------------------------ focus pass */
/* Hierarchy: centre (deck + pile + caption) and your hand are the heroes. Gold is reserved
   for "you": your ring, banner, hand glow, Discard and a live YANIV. Opponents use a soft
   cream ring. Decoration is kept still and faint. */

/* top bar: a compact pill (≡ + table code) top-left, a quiet "Round N" chip top-centre.
   Same family as the chat/emoji buttons: cream face, 2px edge, 3px base shadow. */
.table-top .menu-pole { display: none; }
#menuBtn.menu-sign {
  height: 38px; padding: 0 14px 0 12px; gap: 8px; border-radius: 19px; clip-path: none; transform: none;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; letter-spacing: 1.4px; color: #5a3a1a;
  background: linear-gradient(180deg, rgba(255, 253, 246, 0.94), rgba(239, 223, 189, 0.94));
  border: 2px solid #b89b6a; text-shadow: none;
  filter: none; box-shadow: 0 3px 0 #8a6c40, 0 6px 12px rgba(60, 40, 15, 0.28);
}
#menuBtn.menu-sign:active { transform: translateY(2px); box-shadow: 0 1px 0 #8a6c40, 0 3px 6px rgba(60, 40, 15, 0.25); }
#menuBtn.menu-sign::after { content: ""; position: absolute; inset: -5px -2px; } /* 48px target */
#menuBtn .mb-ico { display: grid; gap: 3.5px; width: 16px; }
#menuBtn .mb-ico i { display: block; height: 2.2px; border-radius: 2px; background: currentColor; }
#menuBtn .mb-ico i:nth-child(2) { width: 75%; }
#menuBtn .mb-code { line-height: 1; padding-top: 1px; }
#menuBtn .mb-round { display: none; line-height: 1; padding: 3px 6px 2px; border-radius: 8px; background: rgba(90, 58, 26, 0.12); font-size: 11.5px; letter-spacing: 0.5px; }
.round-chip {
  position: absolute; left: 50%; top: 9px; transform: translateX(-50%);
  padding: 5px 12px 4px; border-radius: 12px; white-space: nowrap; pointer-events: none;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase;
  color: rgba(255, 250, 240, 0.95); background: rgba(70, 36, 14, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 220, 0.18);
}
body[data-theme="ocean"] .round-chip { background: rgba(0, 54, 70, 0.32); }
/* short screens: the top seat needs the top centre, so the round moves into the pill */
@media (max-height: 760px) {
  .round-chip { display: none; }
  #menuBtn .mb-round { display: inline-block; }
}
@media (max-height: 660px) { #menuBtn.menu-sign { height: 34px; padding: 0 11px 0 10px; font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { body[data-theme="ocean"] #table .water::before { animation: none; } }

/* seats, premium: soft contact shadow, a ring with depth, names on a small dark plate */
.seat-avatar .ava, .me-ava .ava {
  border: 3px solid #fff6e4;
  box-shadow:
    0 0 0 1.5px rgba(90, 52, 20, 0.85),
    0 0 0 4px rgba(255, 238, 205, 0.35),
    0 8px 16px -4px rgba(50, 26, 8, 0.55),
    0 2px 3px rgba(50, 26, 8, 0.3),
    inset 0 -5px 9px rgba(0, 0, 0, 0.28),
    inset 0 3px 5px rgba(255, 255, 255, 0.35);
}
.opp .name {
  margin-top: 7px; padding: 2px 9px 1px; border-radius: 10px; max-width: calc(var(--av) + 30px);
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13.5px; letter-spacing: 0.3px; line-height: 1.25;
  color: #fff; -webkit-text-stroke: 0; text-shadow: 0 1px 1px rgba(30, 14, 4, 0.45);
  background: rgba(50, 26, 8, 0.38);
  box-shadow: inset 0 0 0 1px rgba(255, 236, 205, 0.14);
}
body[data-theme="ocean"] .opp .name { background: rgba(0, 46, 62, 0.4); }
.opp.active .name { color: #fff; background: rgba(50, 26, 8, 0.55); -webkit-text-stroke: 0; }
body[data-theme="ocean"] .opp.active .name { background: rgba(0, 46, 62, 0.6); }
#meName { font-weight: 600; -webkit-text-stroke-width: 1.5px; }

/* opponents' hand size at a glance: a small fan of N face-down backs held in front of the
   avatar's lower edge, plus a count badge. .back-fan stays the landing target for flights.
   2 cards → amber badge; 1 card → coral "1 left" and the lone card glows. */
.opp .back-fan {
  position: absolute; z-index: 3; top: calc(var(--av) - 17px); bottom: auto;
  left: 50%; right: auto; margin-left: -30px; width: 60px; height: 30px;
  pointer-events: none;
}
.opp-left .back-fan, .opp-right .back-fan, .opp-top .back-fan { left: 50%; right: auto; }
.opp .back-fan .bf-cards { position: absolute; inset: 0; }
.opp .back-fan .bf-cards.out { animation: bfSettle 0.32s ease-out; }
.opp .back-fan .back-mini {
  position: absolute; left: 50%; top: 2px; margin: 0 0 0 -8.5px; width: 17px; height: 24px; border-radius: 3px;
  transform-origin: 50% 140%;
  transform: translate(var(--x, 0px), var(--y, 0px)) rotate(var(--rot, 0deg));
  box-shadow: 0 0 0 0.75px rgba(30, 20, 10, 0.45), 0 2px 4px rgba(40, 22, 8, 0.4);
}
.opp .back-fan .back-mini::after { display: none; }
.opp .back-fan .back-mini ~ .back-mini { display: block; }
.opp .back-fan .back-mini.in { animation: bfIn 0.38s cubic-bezier(0.2, 1.3, 0.4, 1) both; }
@keyframes bfIn { from { opacity: 0; translate: 0 -12px; scale: 0.6; } }
@keyframes bfSettle { from { scale: 1.1; } }
.opp .hand-n {
  position: absolute; left: calc(50% + 17px); right: auto; top: 9px; z-index: 2; width: auto;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  display: grid; place-items: center; white-space: nowrap;
  background: #3b2614; color: #ffeccc; border: 1.5px solid #fff1d6;
  font-family: "Fredoka", sans-serif; font-size: 11.5px; font-weight: 700; line-height: 1;
  box-shadow: 0 2px 4px rgba(40, 22, 8, 0.45);
}
.opp.cards-2 .hand-n { background: linear-gradient(180deg, #ffc94a, #f29a12); color: #4a2600; border-color: #fff4d8; }
.opp.cards-1 .hand-n {
  background: linear-gradient(180deg, #ff7a62, #e8432f); color: #fff; border-color: #fff1e8;
  font-size: 10.5px; letter-spacing: 0.3px; text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(120, 20, 10, 0.45), 0 0 10px rgba(255, 96, 70, 0.6);
}
.opp.cards-1 .back-fan .back-mini { box-shadow: 0 0 0 1.5px #ff6a52, 0 0 10px rgba(255, 96, 70, 0.75); }
.opp .hand-n.pulse { animation: handPulse 0.9s ease-out 1; }
@keyframes handPulse { 0% { scale: 1; } 20% { scale: 1.35; } 45% { scale: 0.95; } 65% { scale: 1.18; } 100% { scale: 1; } }
/* score coin moves to the avatar's top-right so the fan owns the bottom edge */
.opp .token { top: -7px; bottom: auto; right: -10px; }
.opp .name { margin-top: 15px; }
@media (prefers-reduced-motion: reduce) {
  .opp .back-fan .back-mini.in, .opp .back-fan .bf-cards.out, .opp .hand-n.pulse { animation: none; }
}
.opp .seat-main { position: relative; }
.opp .seat-avatar { z-index: 2; }

/* opponents' active state: soft cream ring/halo (gold means "you") */
#seats .seat-ring .r-base { border-color: #fff4d6; box-shadow: 0 0 8px rgba(255, 244, 214, 0.75); }
#seats .seat-ring .r-spin { border-color: rgba(255, 244, 214, 0.28); border-top-color: #fff4d6; border-right-color: #fff4d6; }
#seats .seat-avatar::before { background: radial-gradient(closest-side, rgba(255, 248, 228, 0.7), rgba(255, 248, 228, 0) 75%); }
.opp.active .name { color: #fff; -webkit-text-stroke-color: var(--name-stroke); }
/* dim the waiting seats but keep their hand-size fan crisp: low counts must always read */
.seats.has-active .opp:not(.active) { opacity: 1; }
.seats.has-active .opp:not(.active) .seat-main { opacity: 0.62; }
.opp .seat-main { transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.2, 1.3, 0.4, 1); }

/* last throws: the most recent opponent throw in full, older ones small and faded */
.opp .seat-throw { min-height: 30px; transition: opacity 0.3s ease, transform 0.3s ease; transform-origin: 50% 0; }
.opp-left .seat-throw { transform-origin: 0 0; }
.opp-right .seat-throw { transform-origin: 100% 0; }
.opp .seat-throw:not(.recent) { opacity: 0.42; transform: scale(0.78); }
.opp .seat-throw.empty { opacity: 0; }
/* draw-source chip: shown briefly, then fades away */
.st-drew { animation: stDrew 3.2s ease both; }
@keyframes stDrew { 0% { opacity: 0; transform: translateY(-4px); } 8%, 78% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* your line: avatar, name, score — the chat pair sits on the right of it */
.me-line { gap: 7px; padding: 0 90px; min-height: 36px; }
#meName { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 370px) { .me-line { padding: 0 80px 0 70px; } #meName { max-width: 96px; } }

/* action row: Scores | Discard | YANIV — one baseline, equal side columns, safe-area aware */
.bottom-row {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 58px; padding: 0 2px;
}
.bottom-row .scores-note { justify-self: start; grid-column: 1; width: 78px; height: 52px; margin-left: 2px; transform: rotate(-5deg); }
.bottom-row .scores-note:active { transform: rotate(-5deg) scale(0.96); }
.bottom-row .scores-note .note-text { font-size: 22px; }
.bottom-row .scores-note .pencil { width: 44px; top: -9px; }
@media (hover: hover) { .bottom-row .scores-note:hover { transform: rotate(-3deg) translateY(-2px); } }
.bottom-row .yaniv-logo { justify-self: end; grid-column: 3; grid-row: 1; margin-right: 6px; transform: rotate(-5deg); }
.bottom-row .yaniv-logo:active { transform: rotate(-5deg) translateY(2px); }
.bottom-row .discard-tag {
  position: relative; left: auto; grid-column: 2; grid-row: 1; justify-self: center;
  transform: none; clip-path: none;
  min-width: 132px; height: 46px; padding: 0 22px; border-radius: 23px;
  background: linear-gradient(180deg, #fff0a6, #ffd447 55%, #f0b223);
  border: 2px solid #a8650a; color: #4a2a0e;
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 17px; letter-spacing: 0.6px; text-transform: uppercase;
  filter: none; box-shadow: 0 4px 0 #a8650a, 0 8px 16px rgba(120, 70, 10, 0.35);
  animation: discardIn 0.24s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.bottom-row .discard-tag:active { transform: translateY(3px); box-shadow: 0 1px 0 #a8650a, 0 4px 8px rgba(120, 70, 10, 0.3); }
@keyframes discardIn { from { opacity: 0; transform: translateY(6px) scale(0.9); } }
@media (max-height: 660px) {
  .bottom-row { height: 52px; }
  .bottom-row .discard-tag { height: 42px; min-width: 116px; font-size: 15px; }
  .bottom-row .scores-note { width: 70px; height: 46px; }
}

/* ------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .st-fan, .st-drew,
  .opp.active .seat-avatar::before, .me-line.active .me-ava::before,
  .table.is-my-turn .hand-wrap::before, .turn-banner::after, .st-drew, .bottom-row .discard-tag,
  .yaniv-logo.live::before, .yaniv-logo .y-glint, .yaniv-logo .y-glint > span,
  .yaniv-logo.live .megaphone { animation: none !important; }
  .opp.active .seat-avatar::before, .me-line.active .me-ava::before, .yaniv-logo.live::before { opacity: 0.8; }
  .table.is-my-turn .hand-wrap::before { opacity: 0.7; }
  .yaniv-logo .y-glint { opacity: 0 !important; }
  .seat-ring .r-spin { animation-duration: 3s; }
  .opp .seat-main, .opp, .scores-note { transition: none; }
  /* the countdown ring/bar stay: they carry timing information, move slowly and do not oscillate */
}
