/* ==================== 4.1 ROOM CANVAS ==================== */
body.game-screen #view-game {
  background-color: #e2bf94;
  background-image:
    radial-gradient(ellipse 75% 65% at 50% 55%, rgba(255,244,222,.38) 0%, rgba(255,244,222,0) 60%),
    radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(94,60,36,.26) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='92' viewBox='0 0 240 92'%3E%3Crect width='240' height='92' fill='%23E2BF94'/%3E%3Crect width='240' height='46' fill='%23E8C79D'/%3E%3Cpath d='M0 46.5H240M0 91.5H240' stroke='%23B88A5E' stroke-opacity='.45'/%3E%3Cpath d='M150 0V46M60 46V92' stroke='%23B88A5E' stroke-opacity='.4'/%3E%3Cpath d='M10 14C60 10 110 18 140 13M160 30C190 26 220 33 238 29M8 62C30 58 45 66 55 61M70 76C120 72 180 80 235 74' stroke='%23C9A074' stroke-opacity='.35' fill='none'/%3E%3C/svg%3E");
  background-size: auto, auto, 240px 92px;
}
body.game-screen #view-game::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 6% 0%, rgba(255,238,200,.62), transparent 70%),
    linear-gradient(118deg, transparent 6%, rgba(255,246,220,.34) 12%, transparent 21%),
    linear-gradient(118deg, transparent 23%, rgba(255,246,220,.24) 28%, transparent 36%),
    linear-gradient(118deg, transparent 38%, rgba(255,246,220,.14) 42%, transparent 49%);
  -webkit-mask-image: linear-gradient(165deg, #000 0%, rgba(0,0,0,.6) 40%, transparent 72%);
  mask-image: linear-gradient(165deg, #000 0%, rgba(0,0,0,.6) 40%, transparent 72%);
}
body.game-screen #view-game::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 48px;
  z-index: 1;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='48' viewBox='0 0 180 48'%3E%3Cpath d='M0 6 Q90 40 180 6' stroke='%238A5F3F' stroke-opacity='.55' stroke-width='1.6' fill='none'/%3E%3Cpath d='M30 15.4V18M90 23V26M150 15.4V18' stroke='%238A5F3F' stroke-opacity='.55' stroke-width='1.2'/%3E%3Ccircle cx='30' cy='21' r='8' fill='%23FFE7A3' fill-opacity='.45'/%3E%3Ccircle cx='30' cy='21' r='3.6' fill='%23FFD166'/%3E%3Ccircle cx='90' cy='29' r='8' fill='%23FFD9E2' fill-opacity='.5'/%3E%3Ccircle cx='90' cy='29' r='3.6' fill='%23FF9FB5'/%3E%3Ccircle cx='150' cy='21' r='8' fill='%23FFE7A3' fill-opacity='.45'/%3E%3Ccircle cx='150' cy='21' r='3.6' fill='%23FFC857'/%3E%3C/svg%3E") repeat-x 0 0 / 180px 48px;
  filter: drop-shadow(0 0 5px rgba(255,206,110,.6));
  animation: fairyTwinkle 3.6s ease-in-out infinite alternate;
}

/* ==================== 4.2 STAGE, DECOR, ARENA ==================== */
.cafe-room-stage {
  position: relative;
  z-index: 3;
  display: flex;
  flex: 1 1 auto;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
}
.cafe-room-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.cafe-room-decor > svg {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 8px 10px rgba(74,48,28,.22));
}
.decor-shelf { left: clamp(8px,2vw,40px); top: clamp(10px,3vh,40px); width: clamp(90px,10vw,190px); }
.decor-lamp { right: clamp(14px,4vw,90px); top: 0; width: clamp(52px,6vw,110px); }
.decor-monstera { left: clamp(4px,1.6vw,30px); bottom: 0; width: clamp(78px,9vw,168px); }
.decor-cat-condo { right: clamp(4px,1.6vw,30px); bottom: 0; width: clamp(80px,9.5vw,176px); }

.table-arena {
  position: relative;
  z-index: 2;
  flex: 0 1 auto;
  align-self: stretch;
  width: min(100%, 1320px);
  min-height: 300px;
  margin-inline: auto;
  container-type: size;
  --table-cy: 54%;
  --table-h: clamp(180px, min(56cqh, 42cqw), 400px);
  --table-w: clamp(260px, min(68cqw, calc(var(--table-h) * 3.2)), 1020px);
  --seat-avatar: clamp(54px, 12cqh, 96px);
}

/* ==================== 4.3 RUG + TABLE ==================== */
.cafe-rug {
  position: absolute;
  left: 50%;
  top: var(--table-cy);
  transform: translate(-50%,-50%);
  width: min(calc(var(--table-w) * 1.24 + 56px), calc(100cqw - 6px));
  height: min(calc(var(--table-h) * 1.42 + 44px), calc(100cqh - 6px));
  border-radius: 50%;
  z-index: 3;
  pointer-events: none;
  background:
    repeating-radial-gradient(ellipse at center, transparent 0 10px, rgba(190,146,104,.13) 10px 12px),
    radial-gradient(ellipse at center, #fff9ee 0%, #f7ead6 60%, #ecd5b6 100%);
  border: 3px dashed rgba(176,130,90,.42);
  box-shadow:
    inset 0 0 0 7px rgba(255,248,234,.9),
    inset 0 0 0 10px rgba(214,176,134,.45),
    inset 0 0 26px rgba(160,118,80,.18),
    0 16px 30px rgba(84,54,30,.2);
}
.cozy-table {
  position: absolute !important;
  left: 50%;
  top: var(--table-cy);
  transform: translate(-50%, -50%);
  width: var(--table-w) !important;
  height: var(--table-h) !important;
  min-height: 0 !important;
  padding: clamp(12px, 3cqh, 20px) clamp(16px, 3cqw, 28px) clamp(10px, 2.2cqh, 16px) !important;
  gap: 3px !important;
  z-index: 6;
  border: 12px solid #7b5136 !important;
  border-radius: 50% / 44% !important;
  background-color: var(--felt);
  background-image:
    radial-gradient(ellipse at 50% 30%, rgba(236, 248, 218, .3), transparent 54%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='%23ffffff' fill-opacity='.055'%3E%3Cellipse cx='48' cy='54' rx='10' ry='8'/%3E%3Ccircle cx='35' cy='41' r='4.2'/%3E%3Ccircle cx='44' cy='35' r='4.2'/%3E%3Ccircle cx='53' cy='35' r='4.2'/%3E%3Ccircle cx='61' cy='41' r='4.2'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 48%, #77a380 0%, #537e61 60%, #3a5d48 100%) !important;
  box-shadow:
    inset 0 0 0 3px rgba(247, 221, 165, .9),
    inset 0 14px 34px rgba(19, 44, 29, .45),
    inset 0 -8px 22px rgba(20, 42, 28, .28),
    0 20px 38px rgba(72, 48, 32, .26),
    0 0 0 5px #cf9b6e,
    0 0 0 7px rgba(255, 250, 240, .85),
    0 26px 34px -8px rgba(62, 38, 20, .38) !important;
}
.cozy-table::before {
  position: absolute;
  inset: 12px;
  border: 1.5px dashed rgba(248, 228, 182, .38);
  border-radius: inherit;
  content: '';
  pointer-events: none;
}
.table-coaster-accent {
  position: absolute;
  right: 12%;
  bottom: 14%;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #ebc598, #c79360);
  border: 2px solid rgba(255, 248, 232, .65);
  box-shadow: 0 3px 6px rgba(18, 38, 25, .32);
  opacity: .72;
  pointer-events: none;
}
#cat-speech-bubble {
  border: 2px solid rgba(255, 207, 220, .95) !important;
  border-radius: 999px !important;
  background: rgba(255, 253, 249, .97) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 6px 14px rgba(42, 46, 36, .16) !important;
  font-family: var(--font-display);
  line-height: 1.35;
  padding: 2px 10px !important;
  font-size: 10.5px !important;
  margin-bottom: 2px !important;
  max-width: min(260px, 88%);
}
#view-game .cat-idle { filter: drop-shadow(0 6px 8px rgba(20, 34, 22, .32)); }
#view-game .cat-idle svg { width: clamp(32px, 7.6cqh, 60px) !important; height: auto !important; }
#view-game #table-center-stage { min-height: 44px; margin-block: 0 !important; padding-block: 0 !important; flex-shrink: 0; position: relative; z-index: 12; }
#view-game #table-center-stage .mb-1\.5 { margin-bottom: 3px !important; }
#view-game #table-center-stage .max-w-xs > div:last-child { padding: 3px 9px !important; font-size: 10px !important; line-height: 1.4 !important; }
#view-game .cozy-table > div:first-child { flex-shrink: 0; }
#view-game .cozy-table > div:last-child { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); font-size: 8.5px; line-height: 1.3; opacity: .55; pointer-events: none; white-space: nowrap; }

/* Larger, crisp, fanned table cards */
body.game-screen #table-center-stage .playing-card {
  width: clamp(58px, 13.5cqh, 88px) !important;
  height: clamp(84px, 19.5cqh, 128px) !important;
  padding: 4px !important;
  border-radius: 14px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    0 4px 0 rgba(140,104,72,.28),
    0 10px 20px rgba(18, 38, 25, .36) !important;
}
body.game-screen #table-center-stage .playing-card:hover { transform: none; }
#table-center-stage .playing-card .playing-card__corner { top: 4px; left: 4px; width: auto; }
#table-center-stage .playing-card .playing-card__corner.rotate-180 { top: auto; left: auto; bottom: 4px; right: 4px; }
#table-center-stage .playing-card .playing-card__rank { font-size: clamp(12px, 2.5cqh, 17px) !important; line-height: 1.05; }
#table-center-stage .playing-card .w-7,
#table-center-stage .playing-card .w-8 { width: clamp(1.9rem, 4.4cqh, 2.8rem); height: clamp(1.9rem, 4.4cqh, 2.8rem); }
.table-pile-fan {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
}
.table-pile-fan__item {
  position: relative;
  transform: rotate(var(--fan-angle, 0deg)) translateY(var(--fan-lift, 0px));
  filter: drop-shadow(0 6px 12px rgba(18, 38, 25, .28));
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.table-pile-fan[data-count="2"] .table-pile-fan__item + .table-pile-fan__item { margin-left: -10px; }
.table-pile-fan[data-count="3"] .table-pile-fan__item + .table-pile-fan__item,
.table-pile-fan[data-count="4"] .table-pile-fan__item + .table-pile-fan__item { margin-left: -16px; }

/* Cozy Exchange Stage (non-blocking card exchange announcement above hand) */
.exchange-stage-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 252, 245, .97), rgba(255, 244, 228, .96));
  border: 2px solid #e8b65c;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, .92),
    0 5px 0 rgba(184, 134, 62, .28),
    0 16px 32px rgba(48, 34, 22, .26);
  max-width: min(440px, 92vw);
  text-align: center;
  line-height: 1.45;
  z-index: 30;
}
.exchange-stage-card__title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff3d6, #ffe3a8);
  border: 1.5px solid #f0c975;
  color: #6b4914;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}
.exchange-stage-card__subtitle {
  font-size: 12px;
  font-weight: 700;
  color: #5d4e46;
  line-height: 1.45;
}
.exchange-stage-card__cards {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.exchange-stage-card__group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.exchange-stage-card__group-label {
  font-size: 10px;
  font-weight: 700;
  color: #8c7a70;
  line-height: 1.4;
}
.playing-card__exchange-badge {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd166 0%, #ff8fab 100%);
  border: 1.5px solid #fffdf9;
  color: #4f2c1a;
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 3px 7px rgba(132, 68, 82, .26);
  z-index: 12;
  pointer-events: none;
}
.playing-card[class*="F0B45A"] {
  background: linear-gradient(160deg, #fffef6 0%, #fff3d6 100%) !important;
  border-color: #e8b65c !important;
}

/* ==================== 4.4 SEATS (STICKER STYLE) ==================== */
.elliptical-seats-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}
.elliptical-seats-layer > .player-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  z-index: 15;
}
.elliptical-seats-layer > .player-seat.turn-glow { z-index: 22; }
.elliptical-seats-layer > .player-seat.player-seat--draw-target { z-index: 35 !important; }

#view-game .player-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: auto;
  min-width: calc(var(--seat-avatar, 64px) + 8px);
  max-width: calc(var(--seat-avatar, 64px) * 1.9);
  padding: 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.player-seat__medallion {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.player-seat__medallion::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -6px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(70,44,26,.32), transparent 72%);
  pointer-events: none;
  z-index: -1;
}
#view-game .player-seat__avatar {
  position: relative;
  width: var(--seat-avatar, 64px) !important;
  height: var(--seat-avatar, 64px) !important;
  border: 4px solid #fffdf8 !important;
  border-radius: 999px !important;
  margin-bottom: 0 !important;
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(214,170,130,.55),
    inset 0 -6px 10px rgba(120,80,50,.12),
    inset 0 4px 6px rgba(255,255,255,.7),
    0 8px 16px rgba(72,48,32,.24);
  transition: transform calc(var(--motion-base) * var(--motion-duration)), box-shadow var(--motion-base);
}
#view-game .player-seat__avatar::after {
  content: '';
  position: absolute;
  left: 14%;
  top: 8%;
  width: 38%;
  height: 22%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0));
  transform: rotate(-18deg);
  pointer-events: none;
}
.player-seat__avatar .character-svg {
  filter: drop-shadow(0 2px 0 rgba(255,255,255,.85)) drop-shadow(0 3px 4px rgba(90,60,40,.18));
}
#view-game .player-seat__status {
  position: absolute;
  top: -4px;
  right: -10px;
  margin: 0 !important;
  z-index: 15;
}
#view-game .player-seat__count-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 2px solid #fffdf9;
  background: linear-gradient(180deg, #fff5dc, #ffe3a8);
  color: #6b4914;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(72, 48, 32, .18);
}
#view-game .player-seat__count-pill--safe { background: linear-gradient(180deg, #e8faef, #c7f0d7); color: #215a3e; }
#view-game .player-seat__count-pill--pass { background: linear-gradient(180deg, #f8f3ef, #e8ded6); color: #7a685e; }
#view-game .player-seat__count-pill--rank { background: linear-gradient(180deg, #ffeaa6, #ffd25c); color: #6d4802; }
#view-game .player-seat__name {
  position: relative;
  z-index: 14;
  margin-top: -12px;
  padding: 2px 10px;
  max-width: calc(var(--seat-avatar, 64px) * 1.75);
  border-radius: 999px;
  border: 2px solid #fffdf9;
  background: linear-gradient(180deg, #fffefb, #f8efe2);
  color: #4d3b31 !important;
  font-family: var(--font-display);
  font-size: 11.5px !important;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 4px 10px rgba(64, 43, 28, .14);
}
#view-game .player-seat.turn-glow .player-seat__avatar {
  border-color: #fff8de !important;
  box-shadow:
    0 0 0 4px rgba(255, 212, 121, .92),
    0 0 0 9px rgba(255, 168, 190, .44),
    0 12px 24px rgba(217, 107, 132, .25) !important;
}
#view-game .player-seat.turn-glow .player-seat__name {
  border-color: #ffe39b;
  background: linear-gradient(180deg, #fff5d4, #ffe4a3);
  color: #6f4508 !important;
}
.player-seat--draw-target .player-seat__avatar {
  box-shadow: 0 0 0 4px #9cc59a, 0 0 0 9px rgba(156,197,154,.35), 0 8px 16px rgba(72,48,32,.24) !important;
}
#view-game .player-seat--bot.player-seat--active .player-seat__medallion::before {
  content: '• • •';
  position: absolute;
  top: -6px;
  left: -14px;
  z-index: 16;
  padding: 1px 7px 3px;
  border-radius: 999px 999px 999px 4px;
  background: #fffdf8;
  border: 2px solid #ffd7e0;
  color: #d96b84;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -1px;
  box-shadow: 0 3px 8px rgba(72,48,32,.16);
  animation: thinkingPulse 1.2s ease-in-out infinite;
}
.player-seat__mini-cards { width: 100%; max-width: 100%; min-width: 0; overflow: hidden; }
body.game-screen #view-game .player-seat:not(.player-seat--draw-target) .player-seat__mini-cards { display: none; }

/* ==================== 4.5 DRAW POPOVER (OLD MAID) ==================== */
#view-game .player-seat--draw-target .player-seat__mini-cards { display: block !important; width: auto; overflow: visible; }
#view-game .player-seat--draw-target .draw-pick-cards {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(calc(-50% + var(--pop-dx, 0px)), calc(-50% + var(--pop-dy, 0px)));
  width: max-content;
  max-width: min(var(--pop-max-w, 300px), calc(100vw - 24px));
  margin: 0 !important;
  padding: 8px 10px 10px;
  border-radius: 20px;
  background: rgba(255,251,244,.97);
  border: 2px solid #9cc59a;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.9), 0 5px 0 rgba(86,138,96,.28), 0 18px 34px rgba(40,52,38,.28);
  z-index: 36;
}
#view-game .draw-pick-cards > div:first-child {
  display: block !important;
  margin-bottom: 4px !important;
  font-family: var(--font-display);
  font-size: 12px !important;
  line-height: 1.4;
  color: #2d6a4f;
  text-align: center;
  white-space: nowrap;
}
#view-game .draw-pick-cards__list {
  display: flex;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 4px 4px !important;
  scrollbar-width: thin;
}
#view-game .draw-pick-cards__list .draw-pick-card {
  width: 30px !important;
  height: 44px !important;
  flex: 0 0 30px;
  padding: 0;
  border: 2px solid #fff6e6 !important;
  border-radius: 8px !important;
  box-shadow: 0 3px 0 rgba(90,58,40,.25), 0 6px 10px rgba(60,40,26,.2);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s;
}
#view-game .draw-pick-card:hover,
#view-game .draw-pick-card:focus-visible {
  transform: translateY(-6px) rotate(-3deg) scale(1.08);
  box-shadow: 0 0 0 3px rgba(244,190,96,.75), 0 10px 16px rgba(60,40,26,.28);
}

/* ==================== 4.6 HAND TRAY ==================== */
body.game-screen #view-game .my-hand-console {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  width: min(calc(100% - 24px), 1240px) !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 16px clamp(10px,2vw,22px) max(8px, env(safe-area-inset-bottom)) !important;
  border: 1.5px solid rgba(255,255,255,.6) !important;
  border-bottom: 0 !important;
  border-radius: 30px 30px 0 0 !important;
  background: linear-gradient(180deg, rgba(255,250,241,.80) 0%, rgba(249,236,218,.9) 100%) !important;
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 -8px 26px rgba(62,40,22,.18), 0 -2px 0 rgba(150,105,70,.18) !important;
}
body.game-screen #view-game .my-hand-console::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: -7px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #e2b384 0%, #c48b5c 55%, #a8724a 100%);
  box-shadow: inset 0 2px 0 rgba(255,236,206,.7), 0 3px 6px rgba(80,50,28,.28);
  pointer-events: none;
}
body.game-screen #view-game .my-hand-console > div:first-child {
  padding-bottom: 6px !important;
  border-bottom: 1.5px dashed rgba(190,150,112,.35) !important;
}
body.game-screen #view-game #my-player-badge { min-height: 38px; }
body.game-screen #view-game #my-player-badge > div:first-child { width: 42px !important; height: 42px !important; }

body.game-screen #my-hand-container {
  min-height: 0 !important;
  padding-top: 20px !important;
  padding-bottom: 8px !important;
  overflow-x: hidden !important;
  overflow-y: visible;
}
#my-hand-container .hand-fan {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding-inline: 4px;
}
#my-hand-container .hand-fan .playing-card + .playing-card {
  margin-left: var(--card-overlap, 6px);
}
#my-hand-container.hand-dense .playing-card {
  width: 52px;
  height: 80px;
  padding: 3px !important;
}
#my-hand-container.hand-dense .playing-card .w-8 {
  width: 1.5rem;
  height: 1.5rem;
}
#my-hand-container .playing-card { touch-action: manipulation; }

/* ==================== 4.7 CARDS ==================== */
.playing-card {
  display: block;
  width: 66px;
  height: 98px;
  padding: 4px !important;
  color: #3b3548;
  border: 1.5px solid rgba(186,146,104,.42) !important;
  border-radius: 14px !important;
  background: linear-gradient(160deg,#fffdf6 0%,#fff7e8 58%,#f6e8d0 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -2px 0 rgba(214,184,146,.35),
    0 3px 0 rgba(165,132,98,.22),
    -4px 4px 10px rgba(62,43,28,.16) !important;
  backface-visibility: hidden;
  transition: transform calc(var(--motion-base) * var(--motion-duration)) cubic-bezier(.34,1.4,.64,1), box-shadow var(--motion-base), border-color var(--motion-fast);
}
.playing-card > div:first-child { width: 100%; height: 100%; border: 1px solid rgba(206, 179, 146, .42) !important; border-radius: 10px !important; }
.playing-card__rank { font-family: var(--font-display); }
.playing-card[class*="FF8FAB"] {
  background: linear-gradient(160deg,#fff7fa,#ffe7ee) !important;
  border-color: rgba(255,143,171,.7) !important;
}
.playing-card[class*="74C69D"] {
  background: linear-gradient(160deg,#f6fcf7,#e4f5ea) !important;
  border-color: rgba(116,198,157,.75) !important;
}
.playing-card:hover { transform: translateY(-10px) rotate(-1.2deg) scale(1.035); box-shadow: 0 14px 24px rgba(55, 38, 26, .22) !important; z-index: 50 !important; }
.playing-card.selected {
  transform: translateY(-20px) scale(1.06);
  border-color: #f0a35e !important;
  box-shadow:
    0 0 0 3px #fff6dc,
    0 0 0 6px rgba(244,190,96,.8),
    0 0 24px rgba(255,160,186,.55),
    0 18px 30px rgba(120,64,58,.28) !important;
}
.card-back-pattern {
  border: 3px solid #fff6e6;
  background-color: #7a5541 !important;
  background-image: url('../images/cards/card-back.svg') !important;
  background-size: cover !important;
  background-position: center !important;
  box-shadow: inset 0 0 0 1px rgba(64, 43, 30, .35), 0 4px 8px rgba(32, 23, 18, .24);
}
@media (min-width: 701px) {
  .playing-card { width: 78px; height: 114px; padding: 6px !important; }
}
@media (min-width: 1600px) and (min-height: 940px) {
  .playing-card { width: 88px; height: 128px; }
}

/* ==================== 4.8 MOBILE <= 700px ==================== */
@media (max-width: 700px) {
  .table-arena {
    width: 100%;
    min-height: 280px;
    --table-cy: 53%;
    --table-h: clamp(164px, min(49cqh, 68cqw), 298px);
    --table-w: clamp(220px, 68cqw, 330px);
    --seat-avatar: clamp(42px, 9.5cqh, 54px);
  }
  .elliptical-seats-layer--dense { --seat-avatar: clamp(38px, 8cqh, 48px); }
  .cozy-table {
    border-width: 7px !important;
    padding: 14px 10px 10px !important;
    gap: 2px !important;
    box-shadow: inset 0 0 0 2px rgba(235,205,154,.82), inset 0 8px 18px rgba(21,47,30,.36), 0 10px 20px rgba(55,42,30,.25), 0 0 0 3px var(--wood-light) !important;
  }
  .table-coaster-accent { width: 18px; height: 18px; right: 11%; bottom: 13%; }
  #cat-speech-bubble { max-width: 112px !important; font-size: 8.5px !important; line-height: 1.35; padding: 1px 6px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #view-game .cat-idle svg { width: clamp(26px, 6.4cqh, 38px) !important; }
  #view-game #table-center-stage { min-height: 40px; }
  #view-game #table-center-stage .max-w-xs > div:last-child { max-width: 192px; padding: 2px 6px !important; gap: 4px !important; font-size: 9px !important; }
  #view-game #table-center-stage .max-w-xs > div:last-child > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.game-screen #table-center-stage .playing-card {
    width: clamp(50px, 11.5cqh, 60px) !important;
    height: clamp(72px, 16.5cqh, 86px) !important;
    padding: 3px !important;
    border-radius: 11px !important;
  }
  #table-center-stage .playing-card .playing-card__rank { font-size: 11.5px !important; }
  #table-center-stage .playing-card .w-7,
  #table-center-stage .playing-card .w-8 { width: 1.55rem; height: 1.55rem; }
  .table-pile-fan[data-count="2"] .table-pile-fan__item + .table-pile-fan__item { margin-left: -8px; }
  .table-pile-fan[data-count="3"] .table-pile-fan__item + .table-pile-fan__item,
  .table-pile-fan[data-count="4"] .table-pile-fan__item + .table-pile-fan__item { margin-left: -15px; }
  .exchange-stage-card { padding: 7px 10px; gap: 4px; border-radius: 18px; max-width: min(320px, 90vw); }
  .exchange-stage-card__title { font-size: 10px; padding: 1px 8px; }
  .exchange-stage-card__subtitle { font-size: 10.5px; }
  .playing-card__exchange-badge { font-size: 7.5px; padding: 0.5px 4.5px; top: -6px; }
  #view-game .player-seat__avatar { border-width: 3px !important; }
  #view-game .player-seat__status { top: -3px; right: -7px; }
  #view-game .player-seat__count-pill { padding: 1px 5px; font-size: 9px; border-width: 1.5px; }
  #view-game .player-seat__name { margin-top: -8px; padding: 1px 6px; font-size: 9px !important; }
  #view-game .player-seat--bot.player-seat--active .player-seat__medallion::before { font-size: 9px; left: -10px; }
  #view-game .player-seat--draw-target .draw-pick-cards { padding: 6px 8px 8px; }
  #view-game .draw-pick-cards__list { gap: 4px; max-height: 112px; padding: 6px 4px 2px !important; }
  #view-game .draw-pick-cards__list .draw-pick-card { width: 25px !important; height: 35px !important; flex: 0 0 25px; }
  body.game-screen #view-game .my-hand-console {
    width: 100% !important;
    border-radius: 22px 22px 0 0 !important;
    padding: 13px 8px max(8px, env(safe-area-inset-bottom)) !important;
  }
  body.game-screen #view-game .my-hand-console::before { left: 12px; right: 12px; }
  body.game-screen #my-hand-container { padding-top: 16px !important; padding-bottom: 6px !important; }
  .decor-shelf { width: 70px; }
  .decor-lamp { width: 44px; }
  .decor-monstera { width: 54px; }
  .decor-cat-condo { width: 56px; }
  .playing-card { box-shadow: 0 2px 0 rgba(133,106,77,.16), -1px 3px 8px rgba(35,26,19,.19) !important; }
  .playing-card:hover { transform: translateY(-5px); }
  .playing-card.selected { transform: translateY(-12px) scale(1.04); }
}

/* ==================== 4.9 SMALL SCREENS & SHORT LANDSCAPE ==================== */
@media (max-width: 460px) {
  .decor-shelf { display: none; }
}
@media (max-height: 620px) and (orientation: landscape) {
  .table-arena { min-height: 230px; }
  .cafe-room-decor { display: none; }
}
