/* Hide injected Texas quick actions outside mobile landscape. */
.texas-mobile-menu-intro,
.texas-mobile-quick-actions{
  display:none;
}

/* Texas mobile table-first layout.
   Mobile landscape only. Keeps game logic untouched and moves rare actions
   into the existing settings menu. */
@media (max-width:900px) and (orientation:landscape){
  .texas-page{height:100dvh;overflow:hidden}
  .texas-shell{
    width:100vw;height:100dvh;display:flex;flex-direction:column;
    overflow:hidden;border-width:1px
  }
  .texas-shell > header,
  .texas-player-panel,
  .texas-table-sport-link,
  .texas-shell > p{display:none !important}
  .texas-table{
    flex:1 1 auto;min-height:0;aspect-ratio:auto;
    background-size:122% auto;background-position:center 42%
  }
  .texas-settings{right:6px;bottom:6px;z-index:60}
  .texas-settings-toggle{
    width:34px;height:34px;min-width:34px;min-height:34px;font-size:19px
  }
  .texas-settings-menu{
    width:min(330px,72vw);max-height:78dvh;overflow:auto;
    padding:8px;bottom:calc(100% + 6px)
  }
  .texas-mobile-menu-intro{
    display:flex;align-items:center;justify-content:space-between;gap:8px;
    margin-bottom:7px;padding:6px 7px;border:1px solid rgba(255,201,40,.45);
    border-radius:8px;background:#0b1724
  }
  .texas-mobile-menu-intro strong{color:#ffc928;font-size:10px}
  .texas-mobile-menu-intro span{color:#abc4d2;font-size:8px}
  .texas-mobile-quick-actions{
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;margin-bottom:8px
  }
  .texas-mobile-quick-actions a,
  .texas-mobile-quick-actions button{
    min-height:34px;padding:6px 7px;border:1px solid #ffc928;
    border-radius:7px;background:#15283a;color:#fff;font:inherit;
    font-size:8px;font-weight:900;line-height:1.05;text-align:center;
    text-decoration:none
  }
  .texas-mobile-quick-actions a:first-child{background:#ffc928;color:#111}
  .texas-shell .texas-action-bar{
    flex:0 0 auto;min-height:44px;max-height:52px;display:flex;
    align-items:center;gap:3px;padding:3px 5px;overflow:hidden;
    border-top:1px solid #ba9a5c
  }
  .texas-action-bar .texas-action-key{
    flex:0 0 auto;min-width:54px;min-height:36px;padding:2px 5px;
    border-radius:6px;font-size:8px
  }
  .texas-action-bar .texas-action-key::before{
    margin-bottom:1px;font-size:13px
  }
  .texas-action-bar .texas-raise-preview{
    flex:1 1 auto;min-width:150px;gap:4px;padding:3px 5px;font-size:8px
  }
  .texas-action-bar .texas-raise-preview input{min-width:70px;width:100%}
  .texas-action-bar .texas-stake-step{width:24px;height:26px;font-size:15px}
  .texas-action-bar .texas-raise-preview output{min-width:28px;font-size:11px}
  .texas-action-bar > span[role="status"]{display:none}
  .texas-action-exit,.texas-action-rebuy{
    flex:0 0 auto;min-height:34px;padding:4px 7px;font-size:8px
  }
  .texas-opponents{top:5%}
  .texas-player{bottom:8%}
  .texas-own-hand-label{bottom:4%;font-size:8px;padding:2px 6px}
}
@media (max-width:700px) and (orientation:landscape){
  .texas-settings-menu{width:min(310px,78vw)}
  .texas-shell .texas-action-bar{gap:2px;padding:2px 4px}
  .texas-action-bar .texas-action-key{min-width:48px;min-height:34px;font-size:7px}
  .texas-action-bar .texas-raise-preview{min-width:135px}
}


/* Mobile Texas menu polish: all content aligned inside the settings panel. */
@media (max-width:900px) and (orientation:landscape){
  .texas-settings{
    right:6px;
    bottom:6px;
  }

  .texas-settings-menu{
    width:min(300px,74vw);
    max-width:300px;
    max-height:76dvh;
    padding:8px;
    overflow:auto;
    border-radius:12px;
    box-sizing:border-box;
  }

  .texas-mobile-menu-intro{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:6px;
    margin:0 0 7px;
    padding:6px 7px;
    border-radius:8px;
  }

  .texas-mobile-menu-intro strong{
    min-width:0;
    overflow:hidden;
    color:#ffc928;
    font-size:8px;
    line-height:1.1;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .texas-mobile-menu-intro span{
    color:#b9c9d7;
    font-size:7px;
    line-height:1;
    white-space:nowrap;
  }

  .texas-mobile-quick-actions{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
    margin:0 0 8px;
  }

  .texas-mobile-quick-actions a,
  .texas-mobile-quick-actions button{
    min-width:0;
    min-height:32px;
    padding:5px 4px;
    border-width:1px;
    border-radius:7px;
    font-size:7px;
    line-height:1.05;
    white-space:normal;
    word-break:normal;
    overflow-wrap:anywhere;
  }

  .texas-mobile-quick-actions a:first-child{
    background:#ffc928;
    color:#111;
  }

  .texas-format-heading{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:end;
    gap:6px;
    margin:0 0 6px;
  }

  .texas-format-heading strong{
    min-width:0;
    font-size:9px;
    line-height:1.05;
    letter-spacing:.03em;
  }

  .texas-format-heading span{
    font-size:7px;
    line-height:1;
    white-space:nowrap;
  }

  .texas-format-cards{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:5px;
  }

  .texas-format-card{
    min-width:0;
    min-height:62px;
    padding:5px 3px;
    border-width:1px;
    border-radius:8px;
    align-content:start;
    justify-items:center;
    text-align:center;
  }

  .texas-format-card > strong{
    font-size:18px;
    line-height:.9;
  }

  .texas-format-card > span{
    margin-top:3px;
    font-size:7px;
    line-height:1.05;
  }

  .texas-format-card > small{
    display:none;
  }

  .texas-format-card::after{
    right:4px;
    bottom:-8px;
    font-size:30px;
  }
}

@media (max-width:700px) and (orientation:landscape){
  .texas-settings-menu{
    width:min(282px,78vw);
    max-width:282px;
    padding:7px;
  }

  .texas-mobile-quick-actions{
    gap:4px;
  }

  .texas-mobile-quick-actions a,
  .texas-mobile-quick-actions button{
    min-height:30px;
    padding:4px 3px;
    font-size:6.5px;
  }

  .texas-format-cards{
    gap:4px;
  }

  .texas-format-card{
    min-height:58px;
    padding:4px 2px;
  }

  .texas-format-card > strong{
    font-size:17px;
  }

  .texas-format-card > span{
    font-size:6.5px;
  }
}


/* Final sizing for Texas mobile quick actions:
   content-sized controls, centered text, no oversized empty boxes. */
@media (max-width:900px) and (orientation:landscape){
  .texas-mobile-quick-actions{
    display:flex;
    align-items:center;
    justify-content:center;
    flex-wrap:wrap;
    gap:5px;
    margin:0 0 8px;
  }

  .texas-mobile-quick-actions a,
  .texas-mobile-quick-actions button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 auto;
    width:auto;
    min-width:0;
    min-height:28px;
    padding:4px 8px;
    border-radius:6px;
    font-size:7px;
    line-height:1;
    text-align:center;
    white-space:nowrap;
  }

  .texas-mobile-quick-actions a:first-child{
    min-width:54px;
  }

  .texas-mobile-quick-actions a:nth-child(2){
    min-width:104px;
  }

  .texas-mobile-quick-actions button{
    min-width:92px;
  }
}

@media (max-width:700px) and (orientation:landscape){
  .texas-mobile-quick-actions{
    gap:4px;
  }

  .texas-mobile-quick-actions a,
  .texas-mobile-quick-actions button{
    min-height:26px;
    padding:3px 7px;
    font-size:6.5px;
  }

  .texas-mobile-quick-actions a:first-child{
    min-width:50px;
  }

  .texas-mobile-quick-actions a:nth-child(2){
    min-width:96px;
  }

  .texas-mobile-quick-actions button{
    min-width:86px;
  }
}


/* Equal Texas mobile menu actions: three aligned controls, same shape and size. */
@media (max-width:900px) and (orientation:landscape){
  .texas-settings-menu{
    width:min(306px,76vw);
    max-width:306px;
    padding:9px;
    border-radius:13px;
  }

  .texas-mobile-menu-intro{
    margin-bottom:8px;
    padding:6px 8px;
  }

  .texas-mobile-menu-intro strong{
    font-size:8.5px;
  }

  .texas-mobile-quick-actions{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
    margin:0 0 8px;
  }

  .texas-mobile-quick-actions a,
  .texas-mobile-quick-actions button,
  .texas-mobile-quick-actions a:first-child,
  .texas-mobile-quick-actions a:nth-child(2){
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-width:0;
    min-height:30px;
    padding:4px 5px;
    border:1px solid #ffc928;
    border-radius:7px;
    background:#15283a;
    color:#fff;
    box-sizing:border-box;
    font-size:6.8px;
    font-weight:900;
    line-height:1;
    text-align:center;
    white-space:nowrap;
  }

  .texas-mobile-quick-actions a:first-child{
    background:#15283a;
    color:#fff;
  }

  .texas-mobile-quick-actions a:hover,
  .texas-mobile-quick-actions button:hover{
    background:#1d344a;
  }

  .texas-format-cards{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:5px;
  }
}

@media (max-width:700px) and (orientation:landscape){
  .texas-settings-menu{
    width:min(292px,80vw);
    max-width:292px;
    padding:8px;
  }

  .texas-mobile-quick-actions{
    gap:4px;
  }

  .texas-mobile-quick-actions a,
  .texas-mobile-quick-actions button,
  .texas-mobile-quick-actions a:first-child,
  .texas-mobile-quick-actions a:nth-child(2){
    min-height:28px;
    padding:3px 4px;
    font-size:6.3px;
  }
}

/* Casino floor and balanced seating for mobile landscape only. */
@media (max-width:900px) and (orientation:landscape){
  .texas-table{
    background-color:#24121d;
    background-image:
      radial-gradient(ellipse at 50% 45%,transparent 25%,rgba(6,4,10,.65) 100%),
      repeating-linear-gradient(45deg,transparent 0 23px,rgba(193,151,79,.12) 23px 24px,transparent 24px 48px),
      repeating-linear-gradient(-45deg,transparent 0 23px,rgba(193,151,79,.12) 23px 24px,transparent 24px 48px),
      radial-gradient(ellipse at 50% 40%,#482337,#20131d);
    background-size:auto;
    background-position:center;
    box-shadow:inset 0 0 45px rgba(0,0,0,.45);
  }
  .texas-table::before,
  .texas-table[data-seat-limit="10"]::before{
    box-sizing:border-box;
    top:50%;
    width:76%;
    height:64%;
    transform:translate(-50%,-50%);
    border:clamp(8px,2.2vh,13px) solid #201b19;
    border-radius:50%;
    background:
      radial-gradient(ellipse at 50% 30%,rgba(109,222,170,.16),transparent 65%),
      repeating-linear-gradient(0deg,rgba(255,255,255,.025) 0 1px,transparent 1px 3px),
      linear-gradient(165deg,#16795b,#09513e 75%,#073c30);
    box-shadow:
      0 0 0 1px #b6985c,
      inset 0 0 0 2px rgba(204,183,111,.65),
      inset 0 0 0 5px rgba(8,48,36,.55),
      inset 0 10px 20px rgba(0,0,0,.22),
      0 7px 0 #100d10,
      0 16px 20px rgba(0,0,0,.65);
  }
  .texas-opponents .texas-roster-seat{
    width:clamp(60px,9vw,80px);
    gap:2px;
  }
  .texas-roster-portrait{gap:4px}
  .texas-roster-cards{gap:3px;padding:0}
  .texas-roster-cards img{
    width:clamp(22px,5.6vh,32px);
    margin-left:0;
  }
  .texas-roster-seat--revealed .texas-roster-cards img{
    width:clamp(24px,6vh,34px);
  }
  .texas-roster-name{
    padding:2px 5px;
    border-color:#c5ab6a;
    border-radius:6px;
    background:rgba(10,15,23,.95);
  }
  .texas-roster-seat--empty .texas-roster-avatar{
    border-color:#d6ba76;
    background:radial-gradient(circle at 35% 25%,#27343c,#111922);
    box-shadow:0 3px 7px #0008;
  }
  .texas-table[data-seat-limit="10"] .texas-opponents > .texas-roster-seat:nth-child(1){left:28% !important;top:86% !important}
  .texas-table[data-seat-limit="10"] .texas-opponents > .texas-roster-seat:nth-child(2){left:9% !important;top:69% !important}
  .texas-table[data-seat-limit="10"] .texas-opponents > .texas-roster-seat:nth-child(3){left:9% !important;top:31% !important}
  .texas-table[data-seat-limit="10"] .texas-opponents > .texas-roster-seat:nth-child(4){left:28% !important;top:14% !important}
  .texas-table[data-seat-limit="10"] .texas-opponents > .texas-roster-seat:nth-child(5){left:50% !important;top:14% !important}
  .texas-table[data-seat-limit="10"] .texas-opponents > .texas-roster-seat:nth-child(6){left:72% !important;top:14% !important}
  .texas-table[data-seat-limit="10"] .texas-opponents > .texas-roster-seat:nth-child(7){left:91% !important;top:31% !important}
  .texas-table[data-seat-limit="10"] .texas-opponents > .texas-roster-seat:nth-child(8){left:91% !important;top:69% !important}
  .texas-table[data-seat-limit="10"] .texas-opponents > .texas-roster-seat:nth-child(9){left:72% !important;top:86% !important}
  .texas-table[data-seat-limit="10"] .texas-opponents > .texas-roster-seat:nth-child(10){left:50% !important;top:86% !important}
  .texas-table[data-seat-limit="10"] .texas-board{
    top:47%;
    gap:clamp(4px,.7vw,7px);
  }
  .texas-table[data-seat-limit="10"] .texas-board span{
    width:clamp(32px,9vh,52px);
  }
}

/* Mobile card legibility, central pot and wagers kept on the felt. */
@media (max-width:900px) and (orientation:landscape){
  .texas-table{container-type:size}
  .texas-table .texas-board,
  .texas-table[data-seat-limit="10"] .texas-board{
    top:45%;
    gap:clamp(4px,.65vw,7px);
  }
  .texas-table .texas-board span,
  .texas-table[data-seat-limit="10"] .texas-board span{
    box-sizing:border-box;
    width:clamp(40px,12.4vh,58px);
    box-shadow:0 4px 8px #0006;
  }
  .texas-table .texas-roster-seat .texas-roster-cards img{
    box-sizing:border-box;
    width:clamp(26px,7.2vh,34px);
    margin-left:0;
    border-width:1px;
  }
  /* Only public showdown cards get the larger size. */
  .texas-table .texas-roster-seat--revealed .texas-roster-cards img{
    width:clamp(34px,9.6vh,44px);
    border-radius:3px;
    box-shadow:0 4px 8px #0008;
  }
  .texas-table .texas-roster-seat--revealed .texas-roster-avatar{
    width:clamp(25px,5.8vh,34px);
    height:clamp(25px,5.8vh,34px);
  }
  .texas-table .texas-roster-pot{
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    gap:6px;
    top:60% !important;
    left:50% !important;
    transform:translate(-50%,-50%);
    z-index:7;
    padding:4px 10px;
    border:1px solid #d8bc73;
    border-radius:8px;
    background:rgba(6,26,24,.94);
    color:#fff0bc;
    font-size:clamp(11px,2.8vh,14px);
    line-height:1.1;
    font-variant-numeric:tabular-nums;
    white-space:nowrap;
    box-shadow:0 3px 8px #0006;
  }
  .texas-table .texas-roster-pot::before{
    content:"";
    width:14px;height:14px;flex:none;
    border:2px dashed #fff0bc;
    border-radius:50%;
    background:#238b73;
    box-shadow:0 2px 0 #0b5143;
  }
  .texas-player-panel .texas-panel-pot{display:none !important}
  .texas-table .texas-roster-seat .texas-turn-clock{
    top:auto;bottom:0;right:auto;left:calc(100% + 4px);
    min-width:24px;box-sizing:border-box;
    padding:2px 4px;
    font-size:10px;line-height:1.1;
    z-index:9;
  }
  .texas-table .texas-roster-seat[data-mobile-zone="right"] .texas-turn-clock{
    left:auto;right:calc(100% + 4px);
  }
  .texas-shell .texas-table .texas-opponents .texas-roster-seat[data-seat-no] > .texas-roster-bet{
    top:calc(50% + var(--mobile-wager-dy,0cqh)) !important;
    left:calc(50% + var(--mobile-wager-dx,0cqw)) !important;
    right:auto !important;bottom:auto !important;
    transform:translate(-50%,-50%) !important;
    gap:4px;padding:3px 5px 5px;
    font-size:clamp(10px,2.6vh,12px);
    line-height:1.1;
    border-radius:6px;
    background:#092b24ed;
  }
  .texas-table .texas-roster-bet-disc{
    width:17px;height:17px;
    box-shadow:0 2px var(--bet-edge),0 4px var(--bet-chip),0 5px 4px #0006;
  }
  .texas-table .texas-roster-seat[data-mobile-zone="left"]{--mobile-wager-dx:15cqw}
  .texas-table .texas-roster-seat[data-mobile-zone="right"]{--mobile-wager-dx:-15cqw}
  .texas-table .texas-roster-seat[data-mobile-zone="top"]{--mobile-wager-dy:16cqh}
  .texas-table .texas-roster-seat[data-mobile-zone="bottom"]{--mobile-wager-dy:-16cqh}

  /* Clockwise visual order: bottom-left, left-lower, left-upper, top row,
     right-upper, right-lower, bottom-right, local/spectator reference. */
  .texas-table[data-seat-limit="10"] .texas-roster-seat:nth-child(2){--mobile-wager-dy:-10cqh}
  .texas-table[data-seat-limit="10"] .texas-roster-seat:nth-child(3){--mobile-wager-dy:10cqh}
  .texas-table[data-seat-limit="10"] .texas-roster-seat:nth-child(5){--mobile-wager-dy:15cqh}
  .texas-table[data-seat-limit="10"] .texas-roster-seat:nth-child(7){--mobile-wager-dy:10cqh}
  .texas-table[data-seat-limit="10"] .texas-roster-seat:nth-child(8){--mobile-wager-dy:-10cqh}
  .texas-table[data-seat-limit="10"] .texas-roster-seat:nth-child(10){--mobile-wager-dy:-17cqh}

  .texas-table[data-seat-limit="5"] .texas-roster-seat:nth-child(1){--mobile-wager-dx:14cqw;--mobile-wager-dy:5cqh}
  .texas-table[data-seat-limit="5"] .texas-roster-seat:nth-child(2){--mobile-wager-dx:-14cqw;--mobile-wager-dy:5cqh}
  .texas-table[data-seat-limit="5"] .texas-roster-seat:nth-child(3){--mobile-wager-dx:-14cqw;--mobile-wager-dy:-10cqh}
  .texas-table[data-seat-limit="5"] .texas-roster-seat:nth-child(4){--mobile-wager-dx:14cqw;--mobile-wager-dy:-10cqh}
  .texas-table[data-seat-limit="5"] .texas-roster-seat:nth-child(5){top:86% !important;--mobile-wager-dx:0cqw;--mobile-wager-dy:-17cqh}
  .texas-table[data-seat-limit="4"] .texas-roster-seat:nth-child(2){--mobile-wager-dy:11cqh}
  .texas-table[data-seat-limit="4"] .texas-roster-seat:nth-child(4){--mobile-wager-dx:14cqw;--mobile-wager-dy:-14cqh}
  .texas-table > .texas-own-wager{
    top:69% !important;left:50% !important;
    right:auto !important;bottom:auto !important;
    transform:translate(-50%,-50%) !important;
    padding:3px 5px 5px;gap:4px;
    font-size:clamp(10px,2.6vh,12px);
  }
  .texas-table[data-seat-limit="2"] > .texas-own-wager{
    top:65% !important;left:69% !important;
  }
}

@media (max-width:900px) and (orientation:landscape){
  .texas-table:not([data-seat-limit="2"]):not(.texas-table--spectating) .texas-player{
    top:77%;bottom:auto;
    left:calc(50% + clamp(36px,5vw,50px));
    gap:4px;transform:none;
  }
  .texas-table:not([data-seat-limit="2"]):not(.texas-table--spectating) .texas-player img{
    width:clamp(34px,9.5vh,46px);
  }
  .texas-table:not([data-seat-limit="2"]) .texas-own-hand-label{
    bottom:1.5%;
  }
}

@media (max-width:900px) and (orientation:landscape){
  .texas-table[data-seat-limit="10"] .texas-roster-seat:nth-child(1){--mobile-wager-dx:6cqw;--mobile-wager-dy:-17cqh}
  .texas-table[data-seat-limit="10"] .texas-roster-seat:nth-child(4){--mobile-wager-dx:6cqw}
  .texas-table[data-seat-limit="10"] .texas-roster-seat:nth-child(6){--mobile-wager-dx:-6cqw}
  .texas-table[data-seat-limit="10"] .texas-roster-seat:nth-child(9){--mobile-wager-dx:-6cqw;--mobile-wager-dy:-17cqh}
  .texas-table[data-seat-limit="4"] > .texas-own-wager{left:64% !important}
}

/* Entry gate: the table stays visible until fullscreen is activated. */
.texas-fullscreen-gate[hidden]{display:none}
.texas-fullscreen-gate{
  position:fixed;inset:0;z-index:10000;
  display:grid;place-items:center;
  box-sizing:border-box;padding:16px;
  background:rgba(2,6,13,.35);
}
.texas-fullscreen-gate-panel{
  display:grid;justify-items:center;gap:12px;
  box-sizing:border-box;width:min(340px,90vw);
  padding:20px 22px;border:1px solid #d8bc73;
  border-radius:16px;
  background:linear-gradient(145deg,rgba(9,31,35,.97),rgba(5,17,27,.97));
  box-shadow:0 12px 36px #0009;
  color:#fff;text-align:center;
  font-family:Arial,Helvetica,sans-serif;
}
.texas-fullscreen-gate-panel > strong{
  color:#f2d484;font-size:13px;letter-spacing:.06em;
}
.texas-fullscreen-gate-button{
  display:flex;align-items:center;justify-content:center;
  width:100%;min-height:48px;padding:12px 16px;
  border:1px solid #ffe5a1;border-radius:10px;
  background:linear-gradient(180deg,#ffe49a,#d7ae4b);
  box-shadow:0 3px 0 #765b20;
  color:#14201f;font:800 16px/1.15 Arial,Helvetica,sans-serif;
  text-align:center;cursor:pointer;touch-action:manipulation;
}
.texas-fullscreen-gate-button:focus-visible{outline:3px solid #fff;outline-offset:4px}
.texas-fullscreen-gate-button:disabled{opacity:.7;cursor:wait}
.texas-fullscreen-gate-panel > p{
  margin:0;color:#d1e0df;font-size:12px;line-height:1.4;
}
.texas-fullscreen-required .texas-shell{pointer-events:none}
@media (max-width:900px) and (orientation:portrait){
  .texas-page.texas-fullscreen-required::before{display:none}
}
