/*
 * FUNFOR.YOU Poker — authoritative responsive composition.
 * Loaded after legacy Poker CSS and the shared Emerald Royale material layer.
 * This file changes presentation only; no state, wallet, socket or game rule.
 */

#pokerScreen.poker-reference,
#pokerScreen.poker-reference * { box-sizing:border-box; }

html:has(body.poker-table-view) { overflow-x:hidden; }

#pokerScreen.poker-reference {
  width:100%;
  max-width:none;
  min-width:0;
  overflow-x:clip;
}

body.poker-table-view {
  margin:0;
  color:#fff7dc;
  background:
    linear-gradient(180deg,rgba(0,12,9,.08),rgba(0,8,6,.46)),
    var(--poker-casino-background,radial-gradient(circle at 50% 15%,#0c4934,#00110c 62%,#000));
  background-color:#00110c;
  background-position:center top;
  background-repeat:no-repeat;
  background-size:cover;
  background-attachment:fixed;
}

#pokerScreen.poker-reference .poker-chips-on-hand,
#pokerScreen.poker-reference .poker-wallet-panel,
#pokerScreen.poker-reference #topUpContainer,
#pokerScreen.poker-reference .bet-info,
#pokerScreen.poker-reference .poker-fab { display:none !important; }

#pokerScreen.poker-reference .poker-reference-center,
#pokerScreen.poker-reference .table-wrapper,
#pokerScreen.poker-reference .poker-table { min-width:0;min-height:0; }

/* Use the supplied Poker artwork as art — never stretch or repaint it. */
#pokerScreen.poker-reference .poker-table,
body.poker-theme-active #pokerScreen.poker-reference .poker-table {
  position:relative;
  isolation:isolate;
  overflow:visible !important;
  border:0 !important;
  border-radius:0 !important;
  background:none !important;
  box-shadow:none !important;
  filter:drop-shadow(0 18px 24px rgba(0,0,0,.72));
}

#pokerScreen.poker-reference .poker-table::before,
#pokerScreen.poker-reference .poker-table::after { content:none !important;display:none !important; }

#pokerScreen.poker-reference .desktop-poker-frame,
#pokerScreen.poker-reference .mobile-poker-frame {
  position:absolute;
  inset:0;
  z-index:1;
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  pointer-events:none;
  user-select:none;
}

#pokerScreen.poker-reference .mobile-poker-frame { display:none; }
#pokerScreen.poker-reference .mobile-poker-content {
  position:absolute;
  inset:0;
  z-index:2;
  display:block;
  min-width:0;
}
#pokerScreen.poker-reference .table-inner { display:none !important; }
#pokerScreen.poker-reference .table-center { z-index:3; }
#pokerScreen.poker-reference .player-seat { z-index:7 !important; }

/* Names are tangible glowing name chips, while remaining compact and readable. */
#pokerScreen.poker-reference .player-seat .player-box,
#pokerScreen.poker-reference .player-seat .player-box.lucky-charm-host {
  position:relative;
  width:100% !important;
  min-width:0 !important;
  min-height:0 !important;
  padding:7px 10px !important;
  border:1px solid rgba(212,169,77,.82) !important;
  border-radius:15px !important;
  background:
    linear-gradient(180deg,rgba(12,36,29,.97),rgba(1,16,12,.98)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,240,184,.18),
    inset 0 -3px 7px rgba(0,0,0,.6),
    0 0 0 1px rgba(0,0,0,.68),
    0 7px 16px rgba(0,0,0,.5) !important;
  animation:none !important;
}

#pokerScreen.poker-reference .player-seat .player-box.is-turn,
#pokerScreen.poker-reference .player-seat .player-box.current {
  border-color:#63f5b0 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    0 0 0 1px rgba(255,209,90,.52),
    0 0 15px rgba(49,239,151,.7),
    0 7px 17px rgba(0,0,0,.55) !important;
}

#pokerScreen.poker-reference .player-name {
  display:block;
  width:100%;
  overflow:hidden !important;
  color:#fff !important;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif !important;
  font-weight:900 !important;
  line-height:1.08 !important;
  text-align:center;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  text-shadow:0 1px 2px #000,0 0 6px rgba(74,237,154,.5) !important;
}

#pokerScreen.poker-reference .player-seat .player-name {
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}

/* The equipped charm hangs in the rank badge's place on the leaderboard, as it
   does in the other games; the row makes room for it on the left. */
#pokerScreen.poker-reference .poker-participant.lucky-charm-host {
  --lucky-charm-size:clamp(42px,3.4vw,52px) !important;
  --lucky-charm-chain-length:10px !important;
  min-height:72px;
  padding-left:62px !important;
}
#pokerScreen.poker-reference .poker-participant.lucky-charm-host > .lucky-charm-attachment {
  top:-4px !important;
  left:4px !important;
  right:auto !important;
}

#pokerScreen.poker-reference .player-chips {
  display:block;
  margin-top:3px !important;
  color:#ffd568 !important;
  font-weight:850 !important;
  line-height:1.05 !important;
  text-shadow:0 1px 2px #000,0 0 6px rgba(255,205,77,.34);
}

#pokerScreen.poker-reference .player-status {
  display:inline-block !important;
  max-width:100%;
  margin-top:4px !important;
  padding:2px 8px;
  overflow:hidden;
  border:1px solid rgba(101,236,168,.38);
  border-radius:999px;
  color:#b8f2d4 !important;
  background:rgba(1,33,22,.86);
  font-weight:800;
  line-height:1.15;
  text-overflow:ellipsis;
  white-space:nowrap;
}

#pokerScreen.poker-reference .dealer-button { display:none !important; }
#pokerScreen.poker-reference .player-cards:not(.showdown-cards) { display:none !important; }

#pokerScreen.poker-reference .controls {
  border:1px solid rgba(202,157,68,.76) !important;
  border-radius:20px !important;
  background:
    repeating-linear-gradient(45deg,rgba(255,255,255,.018) 0 1px,transparent 1px 15px),
    repeating-linear-gradient(-45deg,rgba(0,0,0,.24) 0 1px,transparent 1px 15px),
    linear-gradient(165deg,rgba(13,34,27,.98),rgba(0,14,10,.98)) !important;
  box-shadow:inset 0 1px 0 rgba(255,239,182,.18),inset 0 -5px 12px rgba(0,0,0,.45),0 12px 25px rgba(0,0,0,.52) !important;
}

#pokerScreen.poker-reference .controls-row .action-button {
  min-width:0 !important;
  border:1px solid rgba(235,192,91,.65) !important;
  border-radius:12px !important;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.22),inset 0 -5px 8px rgba(0,0,0,.42),0 3px 0 rgba(0,0,0,.5) !important;
  color:#fff6d9;
  font-weight:900 !important;
  letter-spacing:.025em;
  text-shadow:0 1px 2px rgba(0,0,0,.88);
}

#pokerScreen.poker-reference .controls-row .action-button:enabled:active {
  transform:translateY(2px) scale(.985);
  box-shadow:inset 0 4px 9px rgba(0,0,0,.65),0 1px 0 rgba(0,0,0,.6) !important;
}

#pokerScreen.poker-reference .fold-button { background:linear-gradient(180deg,#bd2b24,#68110f) !important; }
/* One colour per slot: check/call blue, bet/raise amber. The bet button
   carries .raise-button and has no rule of its own, so it cannot drift. */
#pokerScreen.poker-reference .check-button,
#pokerScreen.poker-reference .call-button { background:linear-gradient(180deg,#137ca0,#084052) !important; }
#pokerScreen.poker-reference .raise-button { background:linear-gradient(180deg,#b26a13,#6b3506) !important; }
#pokerScreen.poker-reference .allin-button { background:linear-gradient(180deg,#7728b7,#3f126d) !important; }

#pokerScreen.poker-reference .controls-row .action-button:disabled {
  filter:saturate(.46) brightness(.62);
  opacity:.58;
}

#pokerScreen.poker-reference #pokerChips > .chip-option {
  flex:none !important;
  aspect-ratio:1;
  border:0 !important;
  border-radius:50%;
  background:transparent !important;
  box-shadow:none !important;
}

#pokerScreen.poker-reference #pokerChips > .chip-option img {
  display:block;
  width:100% !important;
  height:100% !important;
  object-fit:contain;
  filter:drop-shadow(0 5px 5px rgba(0,0,0,.7));
}

#pokerScreen.poker-reference #pokerChips > .chip-option.selected,
#pokerScreen.poker-reference #pokerChips > .chip-option[aria-checked="true"] {
  outline:3px solid #ffe28b;
  outline-offset:2px;
  filter:drop-shadow(0 0 9px rgba(255,203,72,.8));
}

#pokerScreen.poker-reference #betAmount {
  border:1px solid rgba(225,180,80,.78) !important;
  border-radius:13px !important;
  color:#fff5d2 !important;
  background:linear-gradient(180deg,#051d16,#00100c) !important;
  box-shadow:inset 0 3px 8px rgba(0,0,0,.55),0 1px 0 rgba(255,233,165,.14);
  text-align:center;
}

#pokerScreen.poker-reference .poker-chat-panel,
#pokerScreen.poker-reference .poker-participants {
  border:1px solid rgba(213,169,75,.72) !important;
  background:
    linear-gradient(145deg,rgba(255,255,255,.025),transparent 38%),
    linear-gradient(180deg,rgba(5,35,25,.96),rgba(0,19,14,.97)) !important;
  box-shadow:inset 0 1px 0 rgba(255,235,174,.19),inset 0 -5px 13px rgba(0,0,0,.35),0 12px 28px rgba(0,0,0,.5) !important;
}

#pokerScreen.poker-reference .poker-chat-line {
  border:1px solid rgba(125,193,155,.13);
  background:linear-gradient(180deg,rgba(9,54,39,.82),rgba(2,34,23,.88)) !important;
}

/* Result dialog must cover every sidebar and remain the only active surface. */
#winnerOverlay { z-index:900000 !important; }
#winnerOverlay.show ~ * { pointer-events:none; }

@media (min-width:861px) {
  body.poker-table-view { height:100dvh;overflow:hidden; }

  body.poker-table-view #pokerScreen.poker-reference {
    display:flex !important;
    flex-direction:column;
    height:100dvh;
    min-height:0;
    overflow:hidden;
  }

  #pokerScreen.poker-reference .topbar {
    display:flex !important;
    align-items:center;
    flex-wrap:nowrap !important;
    gap:clamp(10px,1vw,18px);
    flex:0 0 auto;
    min-height:70px;
    padding:8px clamp(12px,1.4vw,24px);
  }

  #pokerScreen.poker-reference .topbar .brand {
    flex:0 0 auto;
    min-width:0;
  }

  #pokerScreen.poker-reference .topbar .table-brand-logo {
    width:clamp(110px,10vw,165px);
    height:auto;
  }

  #pokerScreen.poker-reference .topbar .table-brand-game { display:none !important; }

  #pokerScreen.poker-reference .mobile-table-nav {
    display:block !important;
    flex:0 0 clamp(170px,15vw,220px);
    order:1;
  }

  #pokerScreen.poker-reference .mobile-overflow-menu {
    position:relative;
    width:100%;
  }

  #pokerScreen.poker-reference .mobile-overflow-menu > summary {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    width:100%;
    min-height:48px;
    padding:9px 18px;
    border:1px solid rgba(219,175,78,.78);
    border-radius:999px;
    color:#ffe5a0;
    background:linear-gradient(180deg,#14251f,#06120e);
    box-shadow:inset 0 1px 0 rgba(255,240,185,.23),inset 0 -4px 9px rgba(0,0,0,.5);
    font-size:15px;
    font-weight:900;
    list-style:none;
    cursor:pointer;
  }

  #pokerScreen.poker-reference .mobile-overflow-menu > summary::-webkit-details-marker { display:none; }

  #pokerScreen.poker-reference .mobile-overflow-panel {
    position:absolute;
    z-index:700000;
    top:calc(100% + 8px);
    left:0;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;
    width:min(520px,calc(100vw - 24px));
    max-height:70vh;
    padding:12px;
    overflow-y:auto;
    border:1px solid rgba(221,177,79,.84);
    border-radius:18px;
    background:linear-gradient(160deg,#102a20,#03130e 70%);
    box-shadow:0 18px 45px rgba(0,0,0,.72);
  }

  #pokerScreen.poker-reference .mobile-core-actions { display:contents; }
  #pokerScreen.poker-reference .mobile-status-grid { grid-column:1/-1; }

  #pokerScreen.poker-reference .table-info {
    display:flex !important;
    align-items:center;
    flex:0 0 auto;
    margin-left:auto;
  }

  #pokerScreen.poker-reference .table-info > * { display:none !important; }
  #pokerScreen.poker-reference .table-info > .wallet-spotlight {
    display:flex !important;
    align-items:center;
    min-height:48px;
    padding:8px 18px;
    border:1px solid rgba(222,177,76,.82);
    border-radius:999px;
    color:#fff1c3;
    background:linear-gradient(180deg,#123c2c,#061b14);
    box-shadow:inset 0 1px 0 rgba(255,244,201,.23),0 0 16px rgba(230,180,67,.24);
    font-size:13px;
  }

  #pokerScreen.poker-reference .table-info > .wallet-spotlight strong {
    margin-left:8px;
    color:#ffd05d;
    font-size:22px;
  }

  #pokerScreen.poker-reference .poker-reference-layout {
    display:grid !important;
    grid-template-columns:clamp(240px,18vw,340px) minmax(520px,1fr) clamp(290px,21vw,360px) !important;
    grid-template-areas:"leaderboard table chat" !important;
    grid-template-rows:minmax(0,1fr) !important;
    align-items:stretch;
    gap:clamp(12px,1.2vw,22px);
    flex:1 1 auto;
    width:100%;
    max-width:1880px;
    min-height:0;
    margin:0 auto;
    padding:clamp(10px,1vw,18px);
  }

  #pokerScreen.poker-reference .poker-reference-layout > .poker-participants {
    grid-area:leaderboard !important;
    position:relative !important;
    inset:auto !important;
    align-self:start;
    width:100%;
    max-height:100%;
    overflow:auto;
  }

  #pokerScreen.poker-reference .poker-reference-layout > .poker-participants h3,
  #pokerScreen.poker-reference .poker-reference-layout > .poker-participants .poker-leaderboard-title {
    font-size:clamp(18px,1.35vw,23px) !important;
  }

  #pokerScreen.poker-reference .poker-reference-layout > .poker-participants .poker-participant {
    min-height:62px;
    padding:10px 12px;
  }

  #pokerScreen.poker-reference .poker-reference-layout > .poker-participants .poker-participant > strong {
    font-size:clamp(14px,1vw,17px) !important;
  }

  #pokerScreen.poker-reference .poker-reference-layout > .poker-chat-panel {
    grid-area:chat !important;
    position:relative !important;
    inset:auto !important;
    z-index:10;
    display:grid !important;
    grid-template-rows:auto minmax(150px,1fr) auto;
    align-self:stretch;
    width:100% !important;
    height:auto !important;
    min-width:0;
    max-height:none !important;
    margin:0 !important;
    transform:none !important;
    overflow:hidden;
  }

  #pokerScreen.poker-reference .poker-chat-head {
    min-height:56px;
    padding:10px 8px;
  }

  #pokerScreen.poker-reference .poker-chat-head h3 { font-size:16px; }

  #pokerScreen.poker-reference .poker-chat-log {
    min-height:190px;
    max-height:none !important;
    padding:12px !important;
    font-size:14px;
    overflow-y:auto;
  }

  #pokerScreen.poker-reference .poker-chat-line {
    padding:10px 12px;
  }

  #pokerScreen.poker-reference .poker-chat-line .chat-charm {
    width:44px;
    height:44px;
    margin:-3px 2px -3px -2px;
    background:transparent !important;
    box-shadow:none !important;
  }

  #pokerScreen.poker-reference .poker-chat-text { padding-left:52px; }

  #pokerScreen.poker-reference .poker-chat-form {
    gap:8px;
    padding:10px !important;
  }

  #pokerScreen.poker-reference .poker-chat-form input,
  #pokerScreen.poker-reference .poker-chat-form button {
    min-height:44px;
    font-size:14px;
  }

  /* The hardware hangs outside each name badge, inside the table stage's
     reserved edge space. This keeps larger charms away from cards and controls. */
  #pokerScreen.poker-reference .player-seat .lucky-charm-attachment {
    --lucky-charm-size:clamp(62px,5vw,82px) !important;
    --lucky-charm-chain-length:12px !important;
    --lucky-charm-top:-12px !important;
    --lucky-charm-right:-34px !important;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="left"] .lucky-charm-attachment,
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="right"] .lucky-charm-attachment {
    --lucky-charm-right:-18px !important;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="bottom"] .lucky-charm-attachment,
  #pokerScreen.poker-reference .player-seat.is-local-seat .lucky-charm-attachment {
    --lucky-charm-size:clamp(68px,5.6vw,92px) !important;
    --lucky-charm-top:-14px !important;
    --lucky-charm-right:-40px !important;
  }

  #pokerScreen.poker-reference .poker-chat-close,
  #pokerScreen.poker-reference .poker-chat-unread { display:none !important; }

  #pokerScreen.poker-reference .poker-reference-center {
    grid-area:table !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:minmax(0,1fr) auto;
    gap:8px;
    min-width:0;
    min-height:0;
  }

  #pokerScreen.poker-reference .table-wrapper {
    grid-column:1;
    grid-row:1;
    display:grid;
    place-items:center;
    width:100%;
    min-height:0;
    overflow:visible;
    container-type:size;
  }

  #pokerScreen.poker-reference .poker-table {
    width:min(100cqw,calc(100cqh * 36 / 17)) !important;
    height:auto !important;
    max-width:none !important;
    aspect-ratio:36 / 17 !important;
    margin:auto !important;
  }

  #pokerScreen.poker-reference .table-center {
    top:43% !important;
    width:68% !important;
  }

  #pokerScreen.poker-reference .table-center .pot { margin-bottom:2px !important; }
  #pokerScreen.poker-reference .table-center .pot strong { font-size:clamp(24px,2.3vw,38px) !important; }
  #pokerScreen.poker-reference .community-cards { gap:clamp(5px,.5vw,9px) !important;min-height:0 !important; }
  #pokerScreen.poker-reference .community-cards .card,
  #pokerScreen.poker-reference .community-cards .card-slot {
    width:clamp(46px,4.3vw,72px) !important;
    height:auto !important;
    aspect-ratio:5/7;
  }

  #pokerScreen.poker-reference .player-seat {
    display:block !important;
    left:var(--mobile-seat-left,50%) !important;
    top:var(--mobile-seat-top,50%) !important;
    width:clamp(94px,8vw,130px) !important;
    transform:translate(-50%,-50%) !important;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="left"] {
    left:0 !important;
    transform:translate(-24%,-50%) !important;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="right"] {
    left:100% !important;
    transform:translate(-76%,-50%) !important;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="top"] {
    top:0 !important;
    transform:translate(-50%,-54%) !important;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="bottom"],
  #pokerScreen.poker-reference .player-seat.is-local-seat {
    top:100% !important;
    transform:translate(-50%,8px) !important;
  }

  #pokerScreen.poker-reference .player-seat .player-name { font-size:clamp(12px,1vw,16px) !important; }
  #pokerScreen.poker-reference .player-seat .player-chips { font-size:clamp(11px,.86vw,14px) !important; }
  #pokerScreen.poker-reference .player-seat .player-status { font-size:clamp(8px,.66vw,10px) !important; }

  #pokerScreen.poker-reference #playerCardZone {
    position:relative !important;
    z-index:8;
    grid-column:1;
    grid-row:1;
    align-self:end;
    justify-self:center;
    width:auto !important;
    min-height:0 !important;
    margin:0 0 clamp(78px,13cqh,132px) !important;
    padding:0 !important;
    transform:none !important;
    pointer-events:none;
  }

  #pokerScreen.poker-reference #playerCardZone .your-hand { margin:0 !important;pointer-events:auto; }
  #pokerScreen.poker-reference .your-hand { gap:clamp(8px,.7vw,12px) !important;min-height:0 !important; }
  #pokerScreen.poker-reference .your-hand .card,
  #pokerScreen.poker-reference .your-hand .card-slot {
    width:clamp(52px,4vw,66px) !important;
    height:auto !important;
    aspect-ratio:5/7;
  }

  /* One relevant themed squishy at each lower table edge. They sit outside
     the cards and controls, and their transparent stage never catches input. */
  body.poker-mascots-ready:not(.theme-without-mascot) #pokerScreen.poker-reference #playerCardZone #squishyMascots {
    position:absolute !important;
    z-index:6;
    left:50% !important;
    bottom:clamp(-78px,-8cqh,-48px) !important;
    display:block !important;
    width:min(92cqw,980px) !important;
    height:clamp(76px,12cqh,118px) !important;
    transform:translateX(-50%) !important;
    pointer-events:none !important;
  }

  body.poker-mascots-ready #pokerScreen.poker-reference #squishyMascots .clickable-mascot {
    top:auto !important;
    bottom:0 !important;
    display:block !important;
    width:clamp(58px,5vw,78px) !important;
  }

  body.poker-mascots-ready #pokerScreen.poker-reference #squishyMascots .clickable-mascot--left { left:0 !important; }
  body.poker-mascots-ready #pokerScreen.poker-reference #squishyMascots .clickable-mascot--right { right:0 !important; }

  #pokerScreen.poker-reference .poker-turn-pop { display:none !important; }

  #pokerScreen.poker-reference .controls {
    position:static !important;
    grid-column:1;
    grid-row:2;
    display:grid !important;
    grid-template-columns:minmax(0,1fr);
    gap:7px;
    width:min(100%,1080px) !important;
    max-width:none !important;
    margin:0 auto !important;
    padding:10px 14px 12px !important;
    transform:none !important;
  }

  #pokerScreen.poker-reference .controls-row {
    display:grid !important;
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    gap:clamp(7px,.7vw,12px) !important;
  }

  #pokerScreen.poker-reference .controls-row .action-button {
    min-height:52px !important;
    padding:8px 5px !important;
    font-size:clamp(14px,1vw,18px) !important;
  }

  #pokerScreen.poker-reference .poker-inline-bet,
  #pokerScreen.poker-reference .poker-chip-row { width:100% !important;max-width:none !important; }

  #pokerScreen.poker-reference .poker-chip-row {
    display:grid !important;
    grid-template-columns:minmax(440px,1fr) minmax(230px,32%) !important;
    align-items:center;
    gap:14px !important;
  }

  #pokerScreen.poker-reference #pokerChips {
    display:flex !important;
    align-items:center;
    justify-content:center !important;
    gap:clamp(8px,.8vw,14px) !important;
    width:100% !important;
    overflow:visible !important;
  }

  #pokerScreen.poker-reference #pokerChips > .chip-option {
    width:clamp(66px,4.6vw,86px) !important;
    min-width:clamp(66px,4.6vw,86px) !important;
    max-width:86px !important;
    min-height:clamp(66px,4.6vw,86px) !important;
    padding:2px !important;
  }

  #pokerScreen.poker-reference .poker-bet-tools {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:8px !important;
  }

  #pokerScreen.poker-reference #betAmount { width:100% !important;min-height:48px !important;font-size:20px !important; }
  #pokerScreen.poker-reference .poker-bet-tool-row { display:grid !important;grid-template-columns:repeat(2,minmax(74px,1fr));gap:6px !important; }
  #pokerScreen.poker-reference .poker-bet-tool-row .action-button { min-height:46px !important;padding:5px 8px !important;font-size:11px !important; }
  #pokerScreen.poker-reference .controls #gameMessage { margin:0 !important;min-height:20px;font-size:12px !important; }
}

@media (min-width:861px) and (max-width:1220px) {
  #pokerScreen.poker-reference .poker-reference-layout {
    grid-template-columns:minmax(0,1fr) clamp(220px,23vw,270px) !important;
    grid-template-areas:"table chat" !important;
  }
  #pokerScreen.poker-reference .poker-participants { display:none !important; }
  #pokerScreen.poker-reference .poker-chip-row { grid-template-columns:minmax(0,1fr) !important;gap:6px !important; }
  #pokerScreen.poker-reference .poker-bet-tools { grid-template-columns:minmax(0,1fr) auto !important; }
  #pokerScreen.poker-reference #pokerChips > .chip-option {
    width:clamp(60px,6.2vw,76px) !important;
    min-width:clamp(60px,6.2vw,76px) !important;
    min-height:clamp(60px,6.2vw,76px) !important;
  }
}

@media (max-width:860px) {
  body.poker-table-view {
    min-height:100dvh;
    height:auto;
    padding-bottom:0 !important;
    overflow-x:clip !important;
    overflow-y:auto !important;
    background-attachment:scroll;
  }

  body.poker-table-view #pokerScreen.poker-reference {
    display:block !important;
    height:auto;
    min-height:100dvh;
    overflow:visible;
  }

  #pokerScreen.poker-reference .topbar { min-height:54px;padding:6px 8px; }
  #pokerScreen.poker-reference .topbar .brand,
  #pokerScreen.poker-reference .table-info { display:none !important; }
  #pokerScreen.poker-reference .mobile-table-nav,
  #pokerScreen.poker-reference .mobile-overflow-menu,
  #pokerScreen.poker-reference .mobile-overflow-menu > summary { width:100%;max-width:100%; }
  #pokerScreen.poker-reference .mobile-overflow-menu > summary { min-height:48px;padding:9px 16px;font-size:14px; }

  #pokerScreen.poker-reference .poker-reference-layout {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    grid-template-areas:"table" "chat" !important;
    gap:8px;
    width:min(calc(100% - 12px),520px) !important;
    max-width:520px;
    margin:0 auto !important;
    padding:clamp(26px,8vw,38px) 0 max(8px,env(safe-area-inset-bottom)) !important;
  }

  #pokerScreen.poker-reference .poker-participants { display:none !important; }

  #pokerScreen.poker-reference .poker-reference-center {
    grid-area:table !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto;
    gap:7px;
    width:100%;
    min-width:0;
  }

  #pokerScreen.poker-reference .table-wrapper {
    grid-column:1;
    grid-row:1;
    display:grid;
    place-items:center;
    width:100%;
    min-height:0;
    padding:0 0 clamp(30px,9vw,42px) !important;
    overflow:visible !important;
  }

  #pokerScreen.poker-reference .poker-table,
  body.poker-theme-active #pokerScreen.poker-reference .poker-table {
    width:min(70vw,390px) !important;
    height:auto !important;
    max-width:390px !important;
    aspect-ratio:3 / 4 !important;
    margin:0 auto !important;
  }

  #pokerScreen.poker-reference .desktop-poker-frame { display:none; }
  #pokerScreen.poker-reference .mobile-poker-frame { display:block; }
  #pokerScreen.poker-reference .mobile-poker-content {
    position:absolute;
    inset:0;
    z-index:2;
    display:block;
    min-width:0;
  }

  #pokerScreen.poker-reference #squishyMascots,
  #pokerScreen.poker-reference .table-inner { display:none !important; }

  #pokerScreen.poker-reference .table-center { top:40% !important;width:77% !important; }
  #pokerScreen.poker-reference .table-center .pot { margin:0 0 7px !important;font-size:clamp(10px,2.7vw,13px) !important; }
  #pokerScreen.poker-reference .table-center .pot strong { font-size:clamp(24px,7vw,31px) !important; }
  #pokerScreen.poker-reference .community-cards { min-height:0 !important;margin:0 !important;gap:clamp(2px,.8vw,4px) !important; }
  #pokerScreen.poker-reference .community-cards .card,
  #pokerScreen.poker-reference .community-cards .card-slot {
    width:clamp(36px,10vw,49px) !important;
    height:auto !important;
    aspect-ratio:5/7 !important;
    border-radius:5px !important;
  }
  #pokerScreen.poker-reference .community-cards .card-rank { font-size:clamp(16px,4.4vw,21px) !important; }
  #pokerScreen.poker-reference .community-cards .card-suit { font-size:clamp(18px,5vw,24px) !important; }

  #pokerScreen.poker-reference .player-seat {
    display:block !important;
    left:var(--mobile-seat-left,50%) !important;
    top:var(--mobile-seat-top,50%) !important;
    width:clamp(42px,12.5vw,48px) !important;
    z-index:12 !important;
    transform:translate(-50%,-50%) !important;
    pointer-events:none;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="top"] {
    width:clamp(52px,16vw,68px) !important;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="bottom"],
  #pokerScreen.poker-reference .player-seat.is-local-seat {
    width:clamp(96px,30vw,118px) !important;
    transform:translate(-50%,6px) !important;
  }

  #pokerScreen.poker-reference .player-seat .player-box,
  #pokerScreen.poker-reference .player-seat .player-box.lucky-charm-host {
    padding:4px 3px !important;
    border-radius:11px !important;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="left"] .player-box,
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="right"] .player-box {
    padding:2px 0 !important;
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }

  #pokerScreen.poker-reference .player-seat .player-name {
    font-size:clamp(9px,2.45vw,10px) !important;
    text-shadow:
      -1px -1px 0 #001a10,1px -1px 0 #001a10,-1px 1px 0 #001a10,1px 1px 0 #001a10,
      0 0 4px rgba(72,234,148,.92) !important;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="top"] .player-name,
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="bottom"] .player-name,
  #pokerScreen.poker-reference .player-seat.is-local-seat .player-name {
    font-size:clamp(11px,3vw,14px) !important;
  }

  #pokerScreen.poker-reference .player-seat .player-chips { margin-top:2px !important;font-size:clamp(8px,2.2vw,9px) !important; }
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="top"] .player-chips,
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="bottom"] .player-chips,
  #pokerScreen.poker-reference .player-seat.is-local-seat .player-chips { font-size:clamp(10px,2.7vw,12px) !important; }
  #pokerScreen.poker-reference .player-seat .player-status { display:none !important; }
  #pokerScreen.poker-reference .player-seat .showdown-cards { display:none !important; }

  #pokerScreen.poker-reference .player-seat .lucky-charm-attachment {
    --lucky-charm-size:clamp(32px,8vw,40px) !important;
    --lucky-charm-chain-length:7px !important;
    --lucky-charm-top:-5px !important;
    --lucky-charm-right:-18px !important;
  }
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="left"] .lucky-charm-attachment {
    --lucky-charm-right:28px !important;
  }
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="right"] .lucky-charm-attachment {
    --lucky-charm-right:-18px !important;
  }
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="bottom"] .lucky-charm-attachment,
  #pokerScreen.poker-reference .player-seat.is-local-seat .lucky-charm-attachment {
    --lucky-charm-size:clamp(32px,8.5vw,42px) !important;
    --lucky-charm-top:-7px !important;
    --lucky-charm-right:-13px !important;
  }
  #pokerScreen.poker-reference .player-seat .lucky-charm-host .player-name { padding-right:0 !important; }

  #pokerScreen.poker-reference #playerCardZone {
    position:relative !important;
    z-index:10;
    grid-column:1;
    grid-row:1;
    align-self:end;
    justify-self:center;
    width:auto !important;
    min-height:0 !important;
    margin:0 0 clamp(52px,15vw,72px) !important;
    padding:0 !important;
    transform:none !important;
    pointer-events:none;
  }

  #pokerScreen.poker-reference .your-hand {
    min-height:0 !important;
    margin:0 !important;
    gap:clamp(7px,2vw,10px) !important;
    pointer-events:auto;
  }
  #pokerScreen.poker-reference .your-hand .card,
  #pokerScreen.poker-reference .your-hand .card-slot {
    width:clamp(46px,13vw,62px) !important;
    height:auto !important;
    aspect-ratio:5/7 !important;
  }
  #pokerScreen.poker-reference .your-hand .card-rank { font-size:clamp(21px,6vw,28px) !important; }
  #pokerScreen.poker-reference .your-hand .card-suit { font-size:clamp(24px,6.7vw,31px) !important; }
  #pokerScreen.poker-reference .poker-turn-pop { display:none !important; }

  #pokerScreen.poker-reference .controls {
    position:static !important;
    inset:auto !important;
    grid-column:1;
    grid-row:2;
    display:flex !important;
    flex-direction:column;
    gap:7px !important;
    width:100% !important;
    max-width:none !important;
    margin:0 auto !important;
    padding:9px !important;
    transform:none !important;
  }
  #pokerScreen.poker-reference .controls #gameMessage {
    order:-1;
    min-height:22px;
    margin:0 !important;
    padding:2px 6px !important;
    font-size:clamp(11px,2.8vw,13px) !important;
    line-height:1.25;
  }
  #pokerScreen.poker-reference .controls-row {
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:6px !important;
  }
  #pokerScreen.poker-reference .controls-row .action-button {
    min-height:48px !important;
    padding:6px 2px !important;
    font-size:clamp(12px,3.25vw,15px) !important;
  }
  #pokerScreen.poker-reference .poker-inline-bet,
  #pokerScreen.poker-reference .poker-chip-row,
  #pokerScreen.poker-reference #pokerChips { width:100% !important;min-width:0 !important;max-width:100% !important; }
  #pokerScreen.poker-reference .poker-inline-bet { gap:7px;padding:7px !important; }
  #pokerScreen.poker-reference #pokerChips {
    display:flex !important;
    justify-content:center !important;
    gap:clamp(3px,1vw,6px) !important;
    overflow:visible !important;
  }
  #pokerScreen.poker-reference #pokerChips > .chip-option {
    width:clamp(48px,14vw,64px) !important;
    min-width:0 !important;
    max-width:64px !important;
    min-height:clamp(48px,14vw,64px) !important;
    padding:1px !important;
  }
  #pokerScreen.poker-reference .poker-bet-tools {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(130px,42%) !important;
    align-items:center;
    gap:7px !important;
  }
  #pokerScreen.poker-reference #betAmount { width:100% !important;min-height:46px !important;font-size:19px !important; }
  #pokerScreen.poker-reference .poker-bet-tool-row { display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px !important; }
  #pokerScreen.poker-reference .poker-bet-tool-row .action-button { min-height:44px !important;padding:4px 2px !important;font-size:clamp(9px,2.5vw,11px) !important; }

  #pokerScreen.poker-reference .poker-reference-layout > .poker-chat-panel {
    grid-area:chat !important;
    position:relative !important;
    inset:auto !important;
    z-index:20;
    display:block !important;
    width:calc(100% - 14px) !important;
    height:56px;
    max-height:56px !important;
    margin:0 7px !important;
    padding:0 10px !important;
    overflow:hidden;
    transform:none !important;
    border-radius:18px !important;
    border-color:rgba(71,246,161,.72) !important;
    box-shadow:inset 0 1px 0 rgba(255,235,174,.17),0 0 18px rgba(45,231,143,.28),0 8px 20px rgba(0,0,0,.45) !important;
  }
  #pokerScreen.poker-reference .poker-chat-head {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    min-height:54px;
    cursor:pointer;
    outline:none;
  }
  #pokerScreen.poker-reference .poker-chat-head h3 { margin:0;font-size:15px; }
  #pokerScreen.poker-reference .poker-chat-unread {
    display:grid;
    place-items:center;
    min-width:25px;
    height:25px;
    padding:0 6px;
    border-radius:999px;
    color:#fff9dc;
    background:#087042;
    font-size:11px;
    font-weight:900;
  }
  #pokerScreen.poker-reference .poker-chat-unread[hidden] { display:none; }
  #pokerScreen.poker-reference .poker-chat-panel:not(.is-open) .poker-chat-log,
  #pokerScreen.poker-reference .poker-chat-panel:not(.is-open) .poker-chat-form,
  #pokerScreen.poker-reference .poker-chat-panel:not(.is-open) .poker-chat-close { display:none !important; }
  #pokerScreen.poker-reference .poker-reference-layout > .poker-chat-panel.is-open {
    position:fixed !important;
    z-index:500000 !important;
    right:10px !important;
    bottom:max(8px,env(safe-area-inset-bottom)) !important;
    left:10px !important;
    display:grid !important;
    grid-template-rows:auto minmax(80px,1fr) auto;
    width:auto !important;
    height:min(40vh,340px);
    max-height:40vh !important;
    margin:0 !important;
    padding:8px 10px 10px !important;
  }
  #pokerScreen.poker-reference .poker-chat-panel.is-open .poker-chat-head { justify-content:space-between; }
  #pokerScreen.poker-reference .poker-chat-panel.is-open .poker-chat-log,
  #pokerScreen.poker-reference .poker-chat-panel.is-open .poker-chat-form,
  #pokerScreen.poker-reference .poker-chat-panel.is-open .poker-chat-close { display:grid !important; }
}

@media (max-width:374px) {
  #pokerScreen.poker-reference .poker-reference-layout { padding-top:24px !important; }
  #pokerScreen.poker-reference .controls { padding:7px !important;gap:5px !important; }
  #pokerScreen.poker-reference .controls-row { gap:5px !important; }
  #pokerScreen.poker-reference #pokerChips { gap:2px !important; }
  #pokerScreen.poker-reference #pokerChips > .chip-option {
    width:clamp(46px,13.4vw,54px) !important;
    min-height:clamp(46px,13.4vw,54px) !important;
  }
}

@media (prefers-reduced-motion:reduce) {
  #pokerScreen.poker-reference *,
  #pokerScreen.poker-reference *::before,
  #pokerScreen.poker-reference *::after {
    scroll-behavior:auto !important;
    transition-duration:.01ms !important;
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
  }
}


/* Desktop seat safety rails. Side names stay in the reserved black space but
   no longer trespass into the leaderboard/chat columns. The local name badge
   gets its own breathing room above the action buttons. */
@media (min-width:901px) {
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="left"] {
    left:clamp(8px,1vw,16px) !important;
    right:auto !important;
    transform:translate(0,-50%) !important;
  }

  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="right"] {
    left:auto !important;
    right:clamp(8px,1vw,16px) !important;
    transform:translate(0,-50%) !important;
  }

  #pokerScreen.poker-reference .controls {
    margin:clamp(62px,4.5vw,78px) auto 0 !important;
  }
}
/* poker-spacing-20260906 */ @media (min-width:861px){#pokerScreen.poker-reference #playerCardZone{margin-bottom:clamp(38px,7cqh,72px)!important;}}

/* ------------------------------------------------------------------
   Lucky Charms on phones. A seat here is a name badge a few characters
   wide, so a keychain hanging beside it lands on the name, the chips, or
   the cards. On phones the charm becomes a small badge inside the seat's
   right edge, and the seat reserves the room for it. Desktop keeps the
   keychain, which has space.
   ------------------------------------------------------------------ */
@media (max-width:860px) {
  #pokerScreen.poker-reference .player-seat .player-box.lucky-charm-host {
    padding-right:34px !important;
    min-height:0 !important;
  }
  #pokerScreen.poker-reference .player-seat .player-box.lucky-charm-host .dealer-button {
    right:auto !important;
    left:-9px !important;
  }
  #pokerScreen.poker-reference .player-seat .lucky-charm-attachment {
    --lucky-charm-size:26px !important;
    --lucky-charm-chain-length:0px !important;
    --lucky-charm-hang-x:0px !important;
    top:50% !important;
    right:3px !important;
    left:auto !important;
    width:26px !important;
    height:26px !important;
    transform:translateY(-50%) !important;
    transform-origin:50% 50% !important;
    animation:none !important;
  }
  #pokerScreen.poker-reference .player-seat .lucky-charm-attachment .charm-pin,
  #pokerScreen.poker-reference .player-seat .lucky-charm-attachment .charm-chain {
    display:none !important;
  }
  #pokerScreen.poker-reference .player-seat .lucky-charm-attachment .lucky-charm-touch-target {
    top:0 !important;
    left:50% !important;
    width:26px !important;
    height:26px !important;
    transform:translateX(-50%) !important;
  }
  #pokerScreen.poker-reference .player-seat .lucky-charm-attachment .charm-image {
    width:26px !important;
    height:26px !important;
    animation:none !important;
    filter:drop-shadow(0 0 3px rgba(255,216,91,.7)) !important;
  }
  #pokerScreen.poker-reference .player-seat .lucky-charm-attachment .lucky-charm-touch-target::before,
  #pokerScreen.poker-reference .player-seat .lucky-charm-attachment .lucky-charm-touch-target::after {
    display:none !important;
  }
}
