/* Poker Trainer v0.12 — reference layout composition layer. */
body.component-ui {
  --table-max-width:920px;
  --seat-0-x:50%; --seat-0-y:86.5%;
  --seat-1-x:14%; --seat-1-y:67%;
  --seat-2-x:9%;  --seat-2-y:36%;
  --seat-3-x:23%; --seat-3-y:12%;
  --seat-4-x:77%; --seat-4-y:12%;
  --seat-5-x:91%; --seat-5-y:36%;
  --seat-6-x:86%; --seat-6-y:67%;
  --pot-y:31.5%; --pot-chips-y:39.5%; --board-y:50%;
  --hud-y:1.6%; --hud-edge:8px;
}
body.component-ui .seat[data-visual-seat="0"]{left:var(--seat-0-x)!important;top:var(--seat-0-y)!important}
body.component-ui .seat[data-visual-seat="1"]{left:var(--seat-1-x)!important;top:var(--seat-1-y)!important}
body.component-ui .seat[data-visual-seat="2"]{left:var(--seat-2-x)!important;top:var(--seat-2-y)!important}
body.component-ui .seat[data-visual-seat="3"]{left:var(--seat-3-x)!important;top:var(--seat-3-y)!important}
body.component-ui .seat[data-visual-seat="4"]{left:var(--seat-4-x)!important;top:var(--seat-4-y)!important}
body.component-ui .seat[data-visual-seat="5"]{left:var(--seat-5-x)!important;top:var(--seat-5-y)!important}
body.component-ui .seat[data-visual-seat="6"]{left:var(--seat-6-x)!important;top:var(--seat-6-y)!important}
body.component-ui .pot-total{top:var(--pot-y)!important}
body.component-ui .pot-chips{top:var(--pot-chips-y)!important}
body.component-ui .board-cards{top:var(--board-y)!important}
body.component-ui .mobile-hud-card{bottom:var(--hud-y)!important}
body.component-ui .mobile-timer-card{left:var(--hud-edge)!important}
body.component-ui .mobile-selected-card{right:var(--hud-edge)!important}

@media (max-width:780px){
  /* Fix the old full-viewport left column that pushed controls below the screen. */
  body.v012:not(.poker8-v2-sixmax) .app-shell{min-height:0!important;padding-top:60px!important}
  body.v012:not(.poker8-v2-sixmax) .layout,body.v012:not(.poker8-v2-sixmax) .left-column{min-height:0!important;height:auto!important;flex:none!important}
  body.v012:not(.poker8-v2-sixmax) .sidebar{display:block!important;width:100%!important;margin:0!important;padding:0!important}

  /* Header */
  body.v012:not(.poker8-v2-sixmax) .mobile-game-header{height:60px!important;padding:8px 10px!important;gap:8px}
  body.v012:not(.poker8-v2-sixmax) .mobile-menu-button{width:44px!important;height:44px!important;border-radius:14px!important}
  body.v012:not(.poker8-v2-sixmax) .mobile-street-pill{height:44px!important;min-width:128px!important;padding:0 14px!important;border-radius:17px!important}
  body.v012:not(.poker8-v2-sixmax) .mobile-street-pill strong{font-size:15px!important}
  body.v012:not(.poker8-v2-sixmax) .mobile-street-dots{gap:6px!important}
  body.v012:not(.poker8-v2-sixmax) .mobile-street-dots i{width:9px!important;height:9px!important}
  body.v012:not(.poker8-v2-sixmax) .mobile-primary-action{height:44px!important;min-width:124px!important;padding-inline:12px!important;border-radius:14px!important;font-size:10px!important}

  /* Table stage. On 402x874 this lands around 519px, leaving room for controls. */
  body.v012:not(.poker8-v2-sixmax) .table-frame{box-sizing:border-box!important;width:100%!important;max-width:var(--table-max-width)!important;height:clamp(455px,calc(100dvh - 355px),520px)!important;min-height:455px!important;margin:0 auto!important;padding:3px 7px 0!important;overflow:visible!important}
  body.v012:not(.poker8-v2-sixmax) .felt{border-radius:47% / 33%!important;background:radial-gradient(ellipse at 50% 49%,rgba(7,65,100,.98) 0,rgba(9,42,73,.98) 49%,rgba(4,20,42,.99) 77%,rgba(8,13,26,1) 100%)!important;box-shadow:inset 0 0 72px rgba(8,13,26,.58),0 0 0 4px rgba(4,12,31,.9),0 0 22px rgba(31,174,255,.28),0 0 35px rgba(190,39,255,.16)!important}

  /* Opponent seats */
  body.v012:not(.poker8-v2-sixmax) .seat{width:91px!important;min-height:108px!important}
  body.v012:not(.poker8-v2-sixmax) .seat-card{min-height:108px!important;padding:24px 6px 6px!important;border-radius:17px!important;background:linear-gradient(180deg,rgba(4,12,31,.90),rgba(2,6,18,.95))!important;border-color:rgba(72,128,207,.38)!important;box-shadow:0 8px 24px rgba(0,0,0,.34)!important}
  body.v012:not(.poker8-v2-sixmax) .player-avatar{width:46px!important;height:46px!important;font-size:15px!important}
  body.v012:not(.poker8-v2-sixmax) .avatar-wrap{top:-21px!important}
  body.v012:not(.poker8-v2-sixmax) .seat-name{max-width:70px!important;font-size:10px!important;line-height:1.05!important}
  body.v012:not(.poker8-v2-sixmax) .position-chip{top:-10px!important;left:calc(50% + 20px)!important;font-size:10px!important;padding:3px 5px!important}
  body.v012:not(.poker8-v2-sixmax) .seat-stack{margin:3px 0 4px!important;font-size:12px!important;line-height:1!important}
  body.v012:not(.poker8-v2-sixmax) .player-cards{min-height:46px!important;gap:4px!important}
  body.v012:not(.poker8-v2-sixmax) .player-cards .card{width:34px!important;height:47px!important;font-size:12px!important}

  /* Hero */
  body.v012:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"]{width:140px!important}
  /* Same masking problem as the seat-0 negation trick above: an exact hero
     selector this specific (4 classes) beats v038's own per-property hero
     rules wherever v038 doesn't happen to add an equal or higher-specificity
     class of its own for that particular property. Scoped away from sixmax. */
  body.v012:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .seat-card.viewer-seat{min-height:102px!important;padding:27px 7px 7px!important;border-radius:18px!important;border-color:rgba(52,214,255,.82)!important;box-shadow:0 0 20px rgba(53,191,255,.20),0 0 26px rgba(154,54,255,.12)!important}
  body.v012:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .player-avatar{width:56px!important;height:56px!important;font-size:20px!important;background:radial-gradient(circle at 35% 28%,#6647db,#24103e 70%)!important;border-color:#b345ff!important;box-shadow:0 0 20px rgba(73,202,255,.38),0 0 14px rgba(191,59,255,.38)!important}
  body.v012:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .avatar-wrap{top:-28px!important}
  body.v012:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .seat-name{font-size:15px!important;max-width:104px!important}
  body.v012:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .seat-stack{font-size:15px!important}
  body.v012:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .player-cards{position:absolute!important;left:50%!important;bottom:91px!important;transform:translateX(-50%)!important;min-height:0!important;gap:5px!important;z-index:30!important}
  body.v012:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .player-cards .card{width:54px!important;height:78px!important;font-size:20px!important;border-radius:8px!important}

  /* If physical seat 0 is not the viewer, normalize it back to opponent
     dimensions. Scoped away from v038/sixmax for the same reason as the v013
     copy of this same trick below: :not([data-visual-seat="0"]) outranks
     v038's own flat sizing by one specificity point, so it was silently
     winning on the current table -- shrinking whichever seat DOM-slot-0 held
     (a bot, or, once spectators got real avatars, any spectator seat). */
  body.v012:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .seat-card{min-height:108px!important;padding:24px 6px 6px!important}
  body.v012:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .player-avatar{width:46px!important;height:46px!important;font-size:15px!important}
  body.v012:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .avatar-wrap{top:-21px!important}
  body.v012:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .seat-name{font-size:10px!important;max-width:70px!important}
  body.v012:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .seat-stack{font-size:12px!important}
  body.v012:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .player-cards{position:static!important;transform:none!important;min-height:46px!important}
  body.v012:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .player-cards .card{width:34px!important;height:47px!important;font-size:12px!important}

  body.v012:not(.poker8-v2-sixmax) .seat-empty{width:40px!important;min-height:40px!important;opacity:.42!important}
  body.v012:not(.poker8-v2-sixmax) .seat-empty strong{display:none!important}

  /* Center */
  body.v012:not(.poker8-v2-sixmax) .pot-total{min-width:140px!important}
  body.v012:not(.poker8-v2-sixmax) .pot-total-label{font-size:10px!important;font-weight:800!important;letter-spacing:.08em!important}
  body.v012:not(.poker8-v2-sixmax) .pot-total strong{font-size:27px!important}
  body.v012:not(.poker8-v2-sixmax) .pot-chips{width:116px!important;height:48px!important}
  body.v012:not(.poker8-v2-sixmax) .pot-chips .poker-chip{transform:scale(1.08)!important}
  body.v012:not(.poker8-v2-sixmax) .board-cards{min-height:73px!important;gap:5px!important}
  body.v012:not(.poker8-v2-sixmax) .board-cards .card{width:51px!important;height:73px!important;font-size:20px!important;border-radius:8px!important}

  /* Hero HUD */
  body.v012:not(.poker8-v2-sixmax) .mobile-hud-card{width:108px!important;min-height:72px!important;border-radius:16px!important;background:rgba(2,6,18,.91)!important}
  body.v012:not(.poker8-v2-sixmax) .mobile-hud-card>span{font-size:10px!important}
  body.v012:not(.poker8-v2-sixmax) .mobile-hud-card strong{font-size:20px!important}
  body.v012:not(.poker8-v2-sixmax) .mobile-selected-card strong{font-size:15px!important}
  body.v012:not(.poker8-v2-sixmax) .mobile-selected-card b{font-size:15px!important}
  body.v012:not(.poker8-v2-sixmax) .mobile-timer-track{margin-top:7px!important}

  /* Permanent bottom controls in normal document flow. */
  body.v012:not(.poker8-v2-sixmax) .action-panel,body.v012:not(.poker8-v2-sixmax).local-player-active .sidebar .action-panel,body.v012:not(.poker8-v2-sixmax).human-turn .sidebar .action-panel{box-sizing:border-box!important;display:block!important;position:relative!important;inset:auto!important;left:auto!important;right:auto!important;bottom:auto!important;transform:none!important;width:100%!important;max-width:var(--table-max-width)!important;min-height:0!important;max-height:none!important;margin:0 auto!important;padding:8px 10px calc(9px + env(safe-area-inset-bottom))!important;border:0!important;border-top:1px solid rgba(67,129,218,.25)!important;border-radius:0!important;background:linear-gradient(180deg,rgba(2,6,18,.97),rgba(1,3,10,.995))!important;box-shadow:0 -10px 30px rgba(0,0,0,.34)!important;backdrop-filter:none!important;z-index:100!important}
  body.v012:not(.poker8-v2-sixmax) .action-panel .panel-kicker,body.v012:not(.poker8-v2-sixmax) .action-panel #turnTitle,body.v012:not(.poker8-v2-sixmax) .action-panel #hint,body.v012:not(.poker8-v2-sixmax) .action-panel .turn-meta{display:none!important}
  body.v012:not(.poker8-v2-sixmax) .action-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;margin:0!important}
  body.v012:not(.poker8-v2-sixmax) .action-grid .action-slot{min-height:58px!important;padding:7px 3px!important;border-radius:13px!important;font-size:10px!important;line-height:1.12!important}
  body.v012:not(.poker8-v2-sixmax) .action-grid .action-slot:disabled{opacity:.62!important;filter:saturate(.72)!important}

  /* Reference order: main actions -> presets -> amount -> slider. */
  body.v012:not(.poker8-v2-sixmax) .sizing-wrap{display:flex!important;flex-direction:column!important;margin:7px 0 0!important;padding:0!important;gap:6px!important}
  body.v012:not(.poker8-v2-sixmax) .quick-sizes{order:1!important;display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:6px!important;margin:0!important}
  body.v012:not(.poker8-v2-sixmax) .quick-sizes button{min-height:42px!important;padding:4px 2px!important;border-radius:11px!important}
  body.v012:not(.poker8-v2-sixmax) .quick-sizes button strong{font-size:12px!important}
  body.v012:not(.poker8-v2-sixmax) .quick-sizes button small{margin-top:2px!important;font-size:10px!important}
  body.v012:not(.poker8-v2-sixmax) .amount-row{order:2!important;grid-template-columns:42px 1fr 42px!important;gap:8px!important;margin-top:16px!important;padding:0 8px!important}
  body.v012:not(.poker8-v2-sixmax) .amount-row::before{top:-15px!important;font-size:10px!important}
  body.v012:not(.poker8-v2-sixmax) .amount-step{width:42px!important;height:42px!important;border-radius:10px!important;font-size:20px!important}
  body.v012:not(.poker8-v2-sixmax) .amount-row input[type=number]{height:42px!important;font-size:20px!important}
  body.v012:not(.poker8-v2-sixmax) .bet-slider-row{order:3!important;margin-top:-1px!important;padding:0 8px!important;gap:7px!important}
  body.v012:not(.poker8-v2-sixmax) .bet-slider-row span{font-size:10px!important}
  body.v012:not(.poker8-v2-sixmax) #amountSlider{height:30px!important}
  body.v012:not(.poker8-v2-sixmax) #amountSlider::-webkit-slider-thumb{width:22px!important;height:22px!important;margin-top:-8px!important}
  body.v012:not(.poker8-v2-sixmax) #amountSlider::-moz-range-thumb{width:22px!important;height:22px!important}

  /* Auto-action information bar. */
  body.v012:not(.poker8-v2-sixmax) .mobile-auto-action{display:flex;align-items:center;gap:9px;min-height:46px;margin-top:6px;padding:6px 10px;border:1px solid rgba(76,124,198,.32);border-radius:12px;background:rgba(2,6,18,.84);color:#d8e6f3}
  body.v012:not(.poker8-v2-sixmax) .mobile-auto-action-icon{flex:0 0 27px;width:27px;height:27px;display:grid;place-items:center;border:1px solid rgba(108,167,255,.72);border-radius:50%;color:#b4d2ff;font-size:12px;font-weight:900}
  body.v012:not(.poker8-v2-sixmax) .mobile-auto-action>div{min-width:0}
  body.v012:not(.poker8-v2-sixmax) .mobile-auto-action strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:1.15}
  body.v012:not(.poker8-v2-sixmax) .mobile-auto-action small{display:block;margin-top:2px;color:#7e91ab;font-size:10px;line-height:1.2}
  body.v012:not(.poker8-v2-sixmax) .mobile-auto-action.active{border-color:rgba(143,69,255,.52);box-shadow:inset 0 0 18px rgba(121,58,255,.08)}
  body.v012:not(.poker8-v2-sixmax) .mobile-auto-action.active strong{color:#dcb6ff}
  body.v012:not(.poker8-v2-sixmax) .mobile-auto-action.invalid{border-color:rgba(255,77,112,.48)}
  body.v012:not(.poker8-v2-sixmax) .mobile-auto-action.invalid strong{color:#ff9caf}
}

@media (max-width:370px){
  body.v012 .mobile-game-header{padding-left:7px!important;padding-right:7px!important}
  body.v012 .mobile-primary-action{min-width:105px!important;padding-inline:8px!important;font-size:10px!important}
  body.v012 .mobile-street-pill{min-width:108px!important;padding-inline:9px!important}
  body.v012 .table-frame{height:450px!important;min-height:450px!important}
  body.v012 .seat{width:84px!important}
  body.v012 .seat[data-visual-seat="0"]{width:132px!important}
  body.v012 .board-cards .card{width:47px!important;height:68px!important;font-size:15px!important}
  body.v012 .mobile-hud-card{width:101px!important;min-height:67px!important}
  body.v012 .action-grid .action-slot{min-height:54px!important;font-size:10px!important}
  body.v012 .quick-sizes button{min-height:39px!important}
}

/* ========================================================================== 
   Poker Trainer v0.13 — pixel pass against the supplied 920×1640 reference.
   The v0.12 rules remain as the compatibility base; these overrides tighten
   the mobile geometry without touching game logic.
   ========================================================================== */
@media (max-width:780px){
  body.v013:not(.poker8-v2-sixmax) {
    --seat-0-x:50%; --seat-0-y:89%;
    --seat-1-x:14%; --seat-1-y:66%;
    --seat-2-x:8.5%; --seat-2-y:37%;
    --seat-3-x:23%; --seat-3-y:15.5%;
    --seat-4-x:77%; --seat-4-y:15.5%;
    --seat-5-x:91.5%; --seat-5-y:37%;
    --seat-6-x:86%; --seat-6-y:66%;
    --pot-y:32%; --pot-chips-y:41%; --board-y:56%;
    --hud-y:1.1%; --hud-edge:7px;
  }

  /* Reference header is deliberately compact so it never competes with seats. */
  body.v013:not(.poker8-v2-sixmax) .app-shell{padding-top:52px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-game-header{height:52px!important;padding:6px 9px!important;gap:7px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-menu-button{width:40px!important;height:40px!important;border-radius:13px!important;padding-inline:10px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-menu-button span{height:2px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-street-pill{height:40px!important;min-width:120px!important;padding:0 12px!important;border-radius:16px!important;gap:8px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-street-pill strong{font-size:12px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-street-dots{gap:5px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-street-dots i{width:8px!important;height:8px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-primary-action{height:40px!important;min-width:116px!important;padding-inline:10px!important;border-radius:13px!important;font-size:10px!important}

  /* The reference table is ~1.1× as tall as it is wide, not 1.3×. */
  body.v013:not(.poker8-v2-sixmax) .table-frame{
    height:clamp(438px,51.5dvh,468px)!important;
    min-height:438px!important;
    padding:2px 5px 0!important;
  }
  body.v013:not(.poker8-v2-sixmax) .felt{
    border-radius:47% / 36%!important;
    border-width:1.5px!important;
    outline-color:rgba(165,56,255,.30)!important;
    background:radial-gradient(ellipse at 50% 50%,rgba(7,65,100,.99) 0,rgba(3,36,66,.99) 51%,rgba(4,20,42,.995) 78%,rgba(2,6,18,1) 100%)!important;
    box-shadow:inset 0 0 60px rgba(2,6,18,.54),0 0 0 4px rgba(4,12,31,.88),0 0 19px rgba(31,174,255,.27),0 0 29px rgba(190,39,255,.13)!important;
  }
  body.v013:not(.poker8-v2-sixmax) .felt::before{inset:6px!important}

  /* Opponent boxes now match the reference proportions: shorter body, smaller halo. */
  body.v013:not(.poker8-v2-sixmax) .seat{width:82px!important;min-height:86px!important}
  body.v013:not(.poker8-v2-sixmax) .seat-card{min-height:86px!important;padding:18px 5px 5px!important;border-radius:14px!important}
  body.v013:not(.poker8-v2-sixmax) .player-avatar{width:35px!important;height:35px!important;font-size:15px!important;border-width:1.5px!important}
  body.v013:not(.poker8-v2-sixmax) .avatar-wrap{top:-16px!important}
  body.v013:not(.poker8-v2-sixmax) .seat-name{max-width:64px!important;font-size:10px!important;line-height:1.05!important}
  body.v013:not(.poker8-v2-sixmax) .position-chip{top:-8px!important;left:calc(50% + 16px)!important;font-size:10px!important;padding:2px 4px!important}
  body.v013:not(.poker8-v2-sixmax) .seat-stack{margin:2px 0 3px!important;font-size:10px!important;line-height:1!important}
  body.v013:not(.poker8-v2-sixmax) .player-cards{min-height:38px!important;gap:3px!important}
  body.v013:not(.poker8-v2-sixmax) .player-cards .card{width:28px!important;height:39px!important;font-size:12px!important;border-radius:5px!important}

  /* Normalize physical seat zero if a bot happens to occupy it. Scoped away
     from the v038/sixmax table: its :not([data-visual-seat="0"]) trick outranks
     v038's own flat sizing by one specificity point (4 classes vs 3), so on the
     current mobile table it was silently overriding the seat holding the DOM's
     first slot -- shrinking and mispositioning it -- whenever that slot wasn't
     also the hero (any bot there, or, once spectators got real avatars, every
     spectator seat). v038/v040 own this geometry now; v013 only needs it for
     its own, now-superseded layout. */
  body.v013:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]){width:82px!important;min-height:86px!important}
  body.v013:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .seat-card{min-height:86px!important;padding:18px 5px 5px!important}
  body.v013:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .player-avatar{width:35px!important;height:35px!important;font-size:15px!important}
  body.v013:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .avatar-wrap{top:-16px!important}
  body.v013:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .seat-name{font-size:10px!important;max-width:64px!important}
  body.v013:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .seat-stack{font-size:10px!important}
  body.v013:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .player-cards{min-height:38px!important}
  body.v013:not(.poker8-v2-sixmax) .seat-0:not([data-visual-seat="0"]) .player-cards .card{width:28px!important;height:39px!important;font-size:12px!important}

  /* Hero stays wide, but loses the oversized v0.12 body/avatar. */
  body.v013:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"]{width:138px!important;min-height:78px!important}
  /* Same masking problem as the two blocks above -- scoped away from sixmax. */
  body.v013:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .seat-card.viewer-seat{min-height:78px!important;padding:21px 6px 6px!important;border-radius:16px!important}
  body.v013:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .player-avatar{width:43px!important;height:43px!important;font-size:15px!important}
  body.v013:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .avatar-wrap{top:-21px!important}
  body.v013:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .seat-name{font-size:12px!important;max-width:100px!important}
  body.v013:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .seat-stack{font-size:15px!important;margin-top:2px!important}
  body.v013:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .position-chip{left:calc(50% + 21px)!important;top:-7px!important}
  body.v013:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .player-cards{bottom:71px!important;gap:4px!important}
  body.v013:not(.poker8-v2-sixmax) .seat[data-visual-seat="0"] .viewer-seat .player-cards .card{width:48px!important;height:68px!important;font-size:15px!important;border-radius:7px!important}
  body.v013:not(.poker8-v2-sixmax) .dealer-button{width:24px!important;height:24px!important;right:-13px!important;bottom:32px!important;font-size:10px!important}

  /* Center hierarchy. */
  body.v013:not(.poker8-v2-sixmax) .pot-total{min-width:124px!important}
  body.v013:not(.poker8-v2-sixmax) .pot-total-label{font-size:10px!important}
  body.v013:not(.poker8-v2-sixmax) .pot-total strong{font-size:20px!important}
  body.v013:not(.poker8-v2-sixmax) .pot-chips{width:104px!important;height:43px!important}
  body.v013:not(.poker8-v2-sixmax) .pot-chips .poker-chip{transform:scale(.96)!important}
  body.v013:not(.poker8-v2-sixmax) .board-cards{min-height:66px!important;gap:4px!important}
  body.v013:not(.poker8-v2-sixmax) .board-cards .card{width:46px!important;height:66px!important;font-size:15px!important;border-radius:7px!important}
  body.v013:not(.poker8-v2-sixmax) .deck-anchor{top:49%!important;transform:translate(-50%,-50%) scale(.67)!important}

  /* Timer / selected cards are side widgets, not equal competitors to the hero. */
  body.v013:not(.poker8-v2-sixmax) .mobile-hud-card{width:96px!important;min-height:60px!important;border-radius:14px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-hud-card>span{font-size:10px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-hud-card strong{font-size:20px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-selected-card strong{font-size:15px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-selected-card b{font-size:12px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-timer-track{height:4px!important;margin-top:6px!important}

  /* Bottom controls use the same visual rhythm as the reference. */
  body.v013:not(.poker8-v2-sixmax) .action-panel,
  body.v013:not(.poker8-v2-sixmax).local-player-active .sidebar .action-panel,
  body.v013:not(.poker8-v2-sixmax).human-turn .sidebar .action-panel{
    padding:7px 9px calc(8px + env(safe-area-inset-bottom))!important;
  }
  body.v013:not(.poker8-v2-sixmax) .action-grid{gap:5px!important}
  body.v013:not(.poker8-v2-sixmax) .action-grid .action-slot{min-height:49px!important;padding:6px 3px!important;border-radius:12px!important;font-size:10px!important;line-height:1.1!important}
  body.v013:not(.poker8-v2-sixmax) .action-grid .action-slot.queued::after{width:21px!important;height:21px!important;top:-7px!important;right:-4px!important;font-size:10px!important}

  body.v013:not(.poker8-v2-sixmax) .sizing-wrap{margin-top:6px!important;gap:5px!important}
  body.v013:not(.poker8-v2-sixmax) .quick-sizes{gap:5px!important}
  body.v013:not(.poker8-v2-sixmax) .quick-sizes button{min-height:37px!important;border-radius:10px!important;padding:3px 2px!important}
  body.v013:not(.poker8-v2-sixmax) .quick-sizes button strong{font-size:12px!important}
  body.v013:not(.poker8-v2-sixmax) .quick-sizes button small{font-size:10px!important;margin-top:1px!important}
  body.v013:not(.poker8-v2-sixmax) .amount-row{grid-template-columns:40px 1fr 40px!important;gap:7px!important;margin-top:15px!important;padding:0 7px!important}
  body.v013:not(.poker8-v2-sixmax) .amount-row::before{top:-13px!important;font-size:10px!important}
  body.v013:not(.poker8-v2-sixmax) .amount-step{width:40px!important;height:40px!important;border-radius:9px!important;font-size:20px!important}
  body.v013:not(.poker8-v2-sixmax) .amount-row input[type=number]{height:40px!important;font-size:20px!important}
  body.v013:not(.poker8-v2-sixmax) .bet-slider-row{margin-top:-2px!important;padding:0 7px!important;gap:6px!important}
  body.v013:not(.poker8-v2-sixmax) .bet-slider-row span{font-size:10px!important}
  body.v013:not(.poker8-v2-sixmax) #amountSlider{height:26px!important}
  body.v013:not(.poker8-v2-sixmax) #amountSlider::-webkit-slider-thumb{width:20px!important;height:20px!important;margin-top:-7px!important}
  body.v013:not(.poker8-v2-sixmax) #amountSlider::-moz-range-thumb{width:20px!important;height:20px!important}

  body.v013:not(.poker8-v2-sixmax) .mobile-auto-action{min-height:39px!important;margin-top:4px!important;padding:5px 8px!important;border-radius:11px!important;gap:7px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-auto-action-icon{flex-basis:24px!important;width:24px!important;height:24px!important;font-size:10px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-auto-action strong{font-size:10px!important}
  body.v013:not(.poker8-v2-sixmax) .mobile-auto-action small{font-size:10px!important;margin-top:1px!important}
}

@media (max-width:370px){
  body.v013 .table-frame{height:430px!important;min-height:430px!important}
  body.v013 .seat{width:77px!important}
  body.v013 .seat[data-visual-seat="0"]{width:130px!important}
  body.v013 .mobile-hud-card{width:90px!important}
  body.v013 .mobile-primary-action{min-width:104px!important;font-size:10px!important}
  body.v013 .mobile-street-pill{min-width:107px!important}
}

/* ========================================================================== 
   Poker Trainer v0.14 — 402×874 mobile fill pass.
   Keep v0.13 component scale, but use the taller phone viewport instead of
   letterboxing the 920×1640 reference by width.
   ========================================================================== */
@media (max-width:780px){
  body.v014 {
    --table-stage-h: clamp(490px, calc(100dvh - 350px), 540px);
    --seat-0-x:50%; --seat-0-y:89.2%;
    --seat-1-x:14.5%; --seat-1-y:68%;
    --seat-2-x:8.5%; --seat-2-y:38.5%;
    --seat-3-x:24%; --seat-3-y:15.2%;
    --seat-4-x:76%; --seat-4-y:15.2%;
    --seat-5-x:91.5%; --seat-5-y:38.5%;
    --seat-6-x:85.5%; --seat-6-y:68%;
    --pot-y:32.5%; --pot-chips-y:40.5%; --board-y:50.5%;
    --hud-y:1.2%; --hud-edge:8px;
  }

  /* Use the whole phone height. The dock now finishes at the bottom of 402×874. */
  body.v014 .app-shell{min-height:100dvh!important;padding-top:52px!important}
  body.v014 .table-frame{
    width:100%!important;
    height:var(--table-stage-h)!important;
    min-height:var(--table-stage-h)!important;
    padding:2px 13px 0!important;
    box-sizing:border-box!important;
  }
  body.v014 .felt{
    border-radius:47% / 34%!important;
    box-shadow:inset 0 0 70px rgba(2,6,18,.56),0 0 0 4px rgba(4,12,31,.88),0 0 21px rgba(31,174,255,.30),0 0 31px rgba(190,39,255,.15)!important;
  }

  /* The component scale from v0.13 was already close to the reference. */
  body.v014 .seat[data-visual-seat="0"]{width:132px!important}
  body.v014 .mobile-hud-card{width:92px!important}
  body.v014 .pot-total strong{font-size:27px!important}
  body.v014 .deck-anchor{top:50.5%!important}

  /* Fill remaining viewport with the control surface rather than black canvas. */
  body.v014 .action-panel,
  body.v014.local-player-active .sidebar .action-panel,
  body.v014.human-turn .sidebar .action-panel{
    min-height:calc(100dvh - 52px - var(--table-stage-h))!important;
    display:flex!important;
    flex-direction:column!important;
    padding:8px 9px calc(10px + env(safe-area-inset-bottom))!important;
    background:linear-gradient(180deg,rgba(2,6,18,.98),rgba(1,3,10,1))!important;
  }
  body.v014 .action-grid .action-slot{min-height:51px!important}
  body.v014 .quick-sizes button{min-height:39px!important}
  body.v014 .amount-row{margin-top:17px!important}
  body.v014 .amount-step{width:42px!important;height:42px!important}
  body.v014 .amount-row{grid-template-columns:42px 1fr 42px!important}
  body.v014 .amount-row input[type=number]{height:42px!important;font-size:20px!important}
  body.v014 #amountSlider{height:30px!important}
  body.v014 .mobile-auto-action{
    margin-top:auto!important;
    min-height:42px!important;
    padding:6px 8px!important;
  }

  /* Slightly cleaner reference-style labels. */
  body.v014 .position-chip{letter-spacing:.04em!important}
}

@media (max-width:370px){
  body.v014{--table-stage-h:clamp(465px,calc(100dvh - 335px),505px)}
  body.v014 .table-frame{padding-inline:10px!important}
  body.v014 .seat[data-visual-seat="0"]{width:126px!important}
  body.v014 .mobile-hud-card{width:88px!important}
}

/* Showdown comparison; only the seat lane is phone-specific. */
    @media (max-width:780px){
      /* Keep the five-card board as a protected center lane during showdown. */
      body.v014.v025-showdown-layout .seat[data-visual-seat="2"]{left:4.5% !important;}
      body.v014.v025-showdown-layout .seat[data-visual-seat="5"]{left:95.5% !important;}
      body.v014.v025-showdown-layout .seat[data-visual-seat="2"] .player-cards .card,
      body.v014.v025-showdown-layout .seat[data-visual-seat="5"] .player-cards .card{
        width:31px !important;
        height:43px !important;
        font-size:12px !important;
      }
    }

    /* Everything below was inside that phone block too, so on desktop the card
       was appended to <body> with no rules at all -- the win/loss readout
       simply did not exist there, while the JS that builds it ran at every
       width. Only the two seat rules above are about the phone's ring; this is
       a fixed card over the page. */
    .v025-showdown-modal{
        position:fixed;
        top:58px;
        left:50%;
        z-index:4600;
        width:min(400px,calc(100vw - 16px));
        transform:translateX(-50%);
        pointer-events:none;
      }
      .v025-showdown-modal[hidden]{display:none !important;}
      .v025-showdown-modal>section{
        position:relative;
        pointer-events:auto;
        padding:13px 13px 14px;
        border:1px solid rgba(79,182,255,.48);
        border-radius:17px;
        background:linear-gradient(180deg,rgba(4,12,31,.985),rgba(2,6,18,.995));
        box-shadow:0 16px 42px rgba(0,0,0,.52),0 0 22px rgba(70,164,255,.12),inset 0 0 22px rgba(82,143,255,.04);
        backdrop-filter:blur(10px);
      }
      .v025-close{
        position:absolute;
        top:7px;
        right:8px;
        width:27px;
        height:27px;
        border:0;
        border-radius:9px;
        background:rgba(255,255,255,.055);
        color:#9db0c9;
        font-size:20px;
        line-height:1;
      }
      .v025-head{padding:0 36px 10px 1px;border-bottom:1px solid rgba(96,133,190,.28);}
      .v025-head strong{display:block;font-size:20px;line-height:1;font-weight:950;letter-spacing:.08em;}
      .v025-head span{display:block;margin-top:5px;color:#c4d3e7;font-size:12px;font-weight:800;}
      .v025-head.win strong{color:#72f0bd;}
      .v025-head.loss strong{color:#ff91a8;}
      .v025-head.tie strong{color:#ffd37c;}

      .v025-compare-row{
        display:grid;
        grid-template-columns:84px 75px minmax(0,1fr);
        align-items:center;
        gap:9px;
        min-height:56px;
        padding:9px 1px;
      }
      .v025-who small{display:block;color:#8ba2c3;font-size:10px;font-weight:900;letter-spacing:.11em;}
      .v025-who b{display:block;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#e9f6ff;font-size:12px;font-weight:900;}
      .v025-cards{display:flex;gap:5px;}
      .v025-mini-card{
        width:34px;
        height:46px;
        display:grid;
        place-items:center;
        align-content:center;
        border-radius:5px;
        border:1px solid rgba(0,0,0,.17);
        background:linear-gradient(160deg,#ffffff,#eef4f8);
        color:#0d131c;
        box-shadow:0 3px 8px rgba(0,0,0,.28);
        line-height:.8;
      }
      .v025-mini-card.red{color:#ce3245;}
      .v025-mini-card b{font-size:15px;}
      .v025-mini-card i{font-size:15px;font-style:normal;}
      .v025-hand{color:#d8e6f3;font-size:12px;font-weight:850;line-height:1.28;}
      .v025-versus{
        height:1px;
        position:relative;
        background:linear-gradient(90deg,transparent,rgba(96,133,190,.26),transparent);
        color:#66809f;
        font-size:10px;
        font-weight:950;
        text-align:center;
      }
      .v025-versus::after{content:"VS";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:0 6px;background:#040c1f;}
      .v025-reason{
        margin-top:5px;
        padding:8px 10px;
        border-radius:8px;
        background:rgba(62,94,145,.10);
        color:#9db3d0;
        font-size:10px;
        font-weight:800;
      text-align:center;
    }

    /* Clear of the desktop bar, which is in normal flow and taller than the
       phone's 52px fixed header -- same 96px v039 gives the chat panel. */
    @media (min-width:781px){
      .v025-showdown-modal{top:96px;}
    }
