/* v45 keeps the cabinet controls, with a single clear play hierarchy. */
#playHubOverlay .play-hub-panel {width:min(calc(680px * var(--gui-scale,1)),94vw)!important;}
.play-hub-panel {padding:28px!important;}
.play-hub-panel h2 {font-size:clamp(27px,4vw,39px);margin:4px 36px 20px;line-height:1.15;}
.play-hub-panel .play-hub-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;}
.play-hub-panel .play-mode-card {min-height:68px;padding:12px 16px;display:flex;align-items:center;gap:13px;border-radius:10px;border:2px solid #51483d;background:linear-gradient(#37312a,#28231f);box-shadow:0 4px 0 #100d0b,inset 0 1px #ffffff0d;}
.play-hub-panel .play-mode-card img {width:34px!important;height:34px!important;flex:0 0 34px;object-fit:contain;image-rendering:pixelated;}
.play-hub-panel .play-mode-card strong {font-size:21px;line-height:1.1;align-self:center;}
.play-hub-panel #btnQuickPlay {grid-column:1/-1;min-height:96px;margin:2px 0 9px;justify-content:center;background:linear-gradient(180deg,var(--ui-primary-hi),var(--ui-primary));border:3px solid #65431c;box-shadow:0 6px 0 var(--ui-primary-shadow),inset 0 2px #ffe9a45c;color:#241c16;}
.play-hub-panel #btnQuickPlay strong {color:#241c16;font-size:30px;}
.play-hub-panel #btnQuickPlay img {width:43px!important;height:43px!important;flex-basis:43px;}
.play-hub-panel .practice-mode {grid-column:auto;min-height:68px;}
.seg.game-picker,.seg.help-game-tabs {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;justify-content:stretch;flex-wrap:nowrap;padding:5px;margin:0 0 19px;background:#15120f66;border:2px solid #ffffff0d;border-radius:10px;box-shadow:inset 0 2px 0 #0003;}
.seg.game-picker button,.seg.help-game-tabs button {font-family:var(--ui-display);font-size:20px;min-height:45px;padding:9px 6px;line-height:1.05;border-radius:6px;background:linear-gradient(#39312b,#2c251f);color:var(--cream);border:2px solid #665845;box-shadow:0 3px 0 #100d0b;cursor:pointer;min-width:0;}
.seg.game-picker button.active,.seg.help-game-tabs button.active {background:linear-gradient(var(--ui-primary-hi),var(--ui-primary));color:#241c16;border-color:#805822;box-shadow:0 2px 0 var(--ui-primary-shadow),inset 0 1px #ffe9a466;transform:translateY(1px);}
.seg.game-picker button:active,.seg.help-game-tabs button:active {transform:translateY(2px);box-shadow:0 1px 0 #100d0b;}
.seg.game-picker button:focus-visible,.seg.help-game-tabs button:focus-visible,.guide-chapters button:focus-visible {outline:3px solid var(--gold);outline-offset:3px;}
body.light .play-hub-panel .play-mode-card {background:linear-gradient(#f1e5cb,#e4d6b9);border-color:#ac9771;color:#35281b;box-shadow:0 4px 0 #a58e68,inset 0 1px #fff9;}
body.light .seg.game-picker,body.light .seg.help-game-tabs {background:#b6a27d33;border-color:#8c74452b;}
body.light .seg.game-picker button,body.light .seg.help-game-tabs button {background:linear-gradient(#eee2c9,#dfcfac);border-color:#ac9771;color:#35281b;box-shadow:0 3px 0 #a58e68;}
body.light .seg.game-picker button.active,body.light .seg.help-game-tabs button.active {background:linear-gradient(var(--ui-primary-hi),var(--ui-primary));border-color:#805822;box-shadow:0 2px 0 var(--ui-primary-shadow);}
body.light #btnQuickPlay {background:linear-gradient(var(--ui-primary-hi),var(--ui-primary))!important;border-color:#805822!important;box-shadow:0 5px 0 var(--ui-primary-shadow),inset 0 1px #fff4!important;}
body.light #btnQuickPlay strong {color:#241c16!important;}
body.light .seg.game-picker button.active,body.light .seg.help-game-tabs button.active {background:linear-gradient(var(--ui-primary-hi),var(--ui-primary))!important;color:#241c16!important;border-color:#805822!important;box-shadow:0 2px 0 var(--ui-primary-shadow)!important;}
body.light .play-hub-panel .play-mode-card img,body.light #btnProgressBack img {background:#403039;padding:3px;border-radius:4px;}

/* A bounded body scrolls independently; header, game tabs and Done stay put. */
#modal-help .help-modal-v29 {position:relative;height:min(860px,92dvh);max-height:92dvh!important;overflow:hidden!important;gap:12px;padding:20px!important;}
#modal-help .help-head-v29,#modal-help .help-game-tabs,#modal-help .help-done-v29 {flex:0 0 auto;}
#modal-help .help-head-v29 {padding-right:45px;min-height:41px;}
#modal-help .section-title {font-size:clamp(23px,3vw,35px);line-height:1.15;padding-block:0;}
#modal-help .help-head-v29 .settings-close-v12 {position:absolute;top:16px;right:16px;}
#modal-help .help-game-tabs {width:min(500px,100%);align-self:center;margin:0 0 3px;}
.help-scroll {min-height:0;flex:1 1 auto;overflow:auto;overscroll-behavior:contain;padding:4px 5px 8px;scrollbar-color:#756047 #211c18;scrollbar-width:thin;}
#modal-help .help-flow-v29 {margin-bottom:14px;}
#modal-help .help-grid-v29 {overflow:visible;min-height:auto;}
#modal-help .help-done-v29 {margin:0 3px 5px;min-height:43px;font-size:18px;}
#partnershipGuide {display:block;min-width:0;}
#partnershipGuide.hidden {display:none;}
.guide-chapters {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-bottom:18px;}
.guide-chapters button {display:flex;align-items:center;justify-content:center;gap:7px;background:transparent;border:0;border-bottom:3px solid #ffffff16;padding:8px 3px;color:var(--cream);font:600 14px/1.15 var(--ui-display);cursor:pointer;min-width:0;}
.guide-chapters button b {display:grid;place-items:center;width:24px;height:24px;flex:0 0 24px;border:2px solid #736044;border-radius:5px;color:var(--gold);}
.guide-chapters button.active {border-bottom-color:var(--gold);}
.guide-chapters button.active b {background:var(--gold);color:#2b2119;}
.guide-lesson {padding:14px 18px 18px;border:2px solid #ffffff12;border-radius:12px;background:#0002;min-width:0;}
#partnershipGuide .guide-lesson h3 {margin:0 0 13px;text-align:center;color:var(--cream);font-size:23px;line-height:1.2;}
#partnershipGuide .guide-copy {font:500 16px/1.45 var(--ui-display);color:var(--cream);max-width:730px;margin:13px auto 0;text-align:center;}
.guide-facts {display:flex;justify-content:center;flex-wrap:wrap;gap:10px;margin:16px auto 0;}
.guide-facts>span {background:#ffffff08;border:1px solid #ffffff16;border-radius:5px;padding:8px 11px;font-size:15px;line-height:1.2;color:var(--cream);}
.guide-pager {display:flex;align-items:center;justify-content:space-between;gap:14px;margin:16px 2px 24px;}
.guide-pager .btn {font-size:16px;min-height:41px;padding:8px 18px;}
.guide-pager>span {font-size:14px;color:var(--gold);}
.guide-full-rules,.guide-bombs {border:1px solid #ffffff1a;border-radius:8px;padding:12px 14px;}
.guide-full-rules summary,.guide-bombs summary {font:700 16px/1.3 var(--ui-display);cursor:pointer;color:var(--gold);}
.guide-full-rules section {margin:17px 0;}
.guide-full-rules h4 {font-size:17px;margin:0 0 6px;color:var(--gold);}
#partnershipGuide .guide-full-rules p {font-size:15px;line-height:1.45;margin:0;color:var(--cream);}
.guide-hand {display:flex;justify-content:center;align-items:center;gap:6px;min-width:0;}
.guide-card.card {position:relative;width:62px!important;height:88px!important;flex:0 0 62px;margin:0!important;display:block;--card-w:62px;--card-h:88px;transform:none!important;box-shadow:0 3px 0 #0005;cursor:default;pointer-events:none;touch-action:pan-y;}
.guide-legal {outline:3px solid #87c891;outline-offset:3px;}
.guide-comparison {display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:25px;margin:10px auto;}
.guide-sample {display:flex;flex-direction:column;align-items:center;gap:12px;min-width:0;}
.guide-sample>strong {font:600 15px/1.25 var(--ui-display);text-align:center;color:var(--cream);}
.guide-bid-example {display:flex;align-items:center;justify-content:center;gap:25px;padding:10px;}
.guide-bid {font-size:37px;color:#e8b363;background:#0002;padding:12px 20px;border:2px solid #b28b40;border-radius:9px;}
.guide-arrow {font-size:26px;color:var(--gold);}
.guide-rank-order {display:grid;grid-template-columns:auto 1fr;gap:9px 20px;margin:16px auto 0;width:max-content;max-width:100%;font-size:15px;color:var(--cream);}
.guide-rank-order strong {color:var(--gold);}
.guide-case-tabs {display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-bottom:12px;}
.guide-case-tabs .btn {font-size:15px;min-height:38px;padding:7px 12px;}
.guide-seats {display:grid;grid-template-columns:1fr 1fr 1fr;grid-template-rows:90px 80px 90px;width:340px;max-width:100%;margin:5px auto 12px;position:relative;}
.guide-seat {display:flex;align-items:center;justify-content:center;flex-direction:column;gap:8px;z-index:1;}
.guide-seat>span {width:52px;height:52px;padding:4px;border:2px solid transparent;}
.guide-seat>span svg {display:block;width:100%;height:100%;}
.guide-seat.teammate>span {border-color:#80b795;background:#264a3b55;border-radius:7px;}
.guide-seat strong {font-size:14px;line-height:1.15;text-align:center;color:var(--cream);}
.guide-seat.seat-0 {grid-column:2;grid-row:3;}
.guide-seat.seat-1 {grid-column:3;grid-row:2;}
.guide-seat.seat-2 {grid-column:2;grid-row:1;}
.guide-seat.seat-3 {grid-column:1;grid-row:2;}
.guide-team-link {grid-column:2;grid-row:2;align-self:center;justify-self:center;font-size:40px;color:#80b795;}
.guide-deal {display:flex;align-items:center;justify-content:center;gap:18px;margin:10px auto;}
.guide-deal span {background:#f9eac9;border:3px solid #31222d;border-radius:7px;color:#31222d;font-size:35px;padding:14px 20px;box-shadow:0 4px 0 #0003;}
.guide-deal b {font-size:22px;color:var(--gold);}
.guide-exchange {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin:22px auto;max-width:480px;}
.guide-exchange>div {display:flex;align-items:center;flex-direction:column;gap:8px;}
.guide-exchange>div>span:not(.card) {width:44px;height:44px;}
.guide-exchange svg {width:100%;height:100%;display:block;}
.guide-exchange b {color:var(--gold);font-size:18px;}
.guide-exchange strong {font-size:14px;color:var(--cream);text-align:center;}
.guide-combo-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 10px;}
.guide-combo-grid .guide-card.card {width:56px!important;height:80px!important;flex-basis:56px;--card-w:56px;--card-h:80px;}
.guide-combo-grid .guide-hand {gap:0;padding-left:12px;}
.guide-combo-grid .guide-card.card {margin-left:-12px!important;}
.guide-bombs {margin-top:18px;}
.guide-bombs .guide-hand {margin:15px 0;}
.guide-special-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;}
.guide-special-grid>div {display:grid;grid-template-columns:70px 1fr;grid-template-rows:auto 1fr;gap:5px 12px;padding:12px;border-radius:7px;background:#ffffff06;}
.guide-special-grid .card {grid-row:1/3;}
.guide-special-grid h4 {font-size:18px;line-height:1.2;color:var(--gold);margin:0;}
#partnershipGuide .guide-special-grid p {font-size:14px;line-height:1.4;color:var(--cream);margin:0;}
.guide-score-demo {display:flex;justify-content:center;gap:14px;flex-wrap:wrap;}
.guide-score-demo span {background:#ffffff08;padding:15px;border-radius:7px;text-align:center;font-size:15px;color:var(--cream);}
.guide-score-demo b {display:block;color:var(--gold);font-size:31px;line-height:1;margin-top:12px;}
body.light .guide-lesson,body.light .guide-special-grid>div {background:#ffffff30;border-color:#74572c26;}
body.light .guide-facts>span {background:#7a633310;border-color:#74572c33;}

/* Partner identity is explicit and survives turn and offline styling. */
#playerRail .pchip.is-teammate {box-shadow:inset 4px 0 0 #8fc3a0;}
#playerRail .pchip.is-partner {border-color:#74ad89!important;}
#playerRail .pchip.is-partner.is-turn {border-color:var(--gold)!important;}
#playerRail .pchip .pchip-role {font:700 11px/1 var(--ui-display);padding:4px 6px;background:#335640;color:#d7efcf;border:1px solid #7ca78b;border-radius:4px;white-space:nowrap;}
#playerRail .pchip-score[hidden] {display:none!important;}
#playerRail .pchip.is-partner .pchip-meta {flex-wrap:wrap;column-gap:5px!important;row-gap:3px;}
.team-score {align-items:center;line-height:1;min-height:39px;}
.team-score>span,.team-score>strong {display:block;line-height:1;}
.team-score>span {translate:0 -1px;}

/* Preview materials share the table's actual image, texture and blend. */
body .cosmetic-table-preview,body .locker-table-preview {background-image:var(--preview-art)!important;background-size:100% 100%!important;background-repeat:no-repeat!important;}
.cosmetic-table-preview::before,.locker-table-preview::before {content:'';position:absolute;inset:0;z-index:0;mix-blend-mode:soft-light;pointer-events:none;background-size:128px 128px;image-rendering:pixelated;opacity:.18;}
[data-texture="weave"]::before {background-image:url('../assets/art/texture-weave-v44.webp');}
[data-texture="baize"]::before {background-image:url('../assets/art/texture-baize-v44.webp');opacity:.14;}
[data-texture="linen"]::before {background-image:url('../assets/art/texture-linen-v44.webp');opacity:.2;}
[data-texture="plain"]::before {display:none;}
.cosmetic-preview-stage .cosmetic-stage-inner {min-width:0;min-height:0;}
.cosmetic-deck-showcase {display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:17px 12px;width:min(420px,90%)!important;height:auto!important;transform:none!important;container-type:normal!important;}
.cosmetic-deck-showcase .cosmetic-preview-card-real,.cosmetic-deck-showcase .cosmetic-preview-back-real {position:relative!important;left:auto!important;top:auto!important;transform:none!important;margin:0!important;width:100%!important;height:auto!important;aspect-ratio:5/7;max-width:130px;justify-self:center;container-type:normal!important;border:var(--deck-border)!important;border-radius:var(--deck-radius)!important;box-shadow:var(--deck-shadow)!important;opacity:1;}
.cosmetic-deck-showcase .cosmetic-preview-back-real {background:var(--card-back);}
.cosmetic-deck-showcase .card {pointer-events:none;touch-action:pan-y;cursor:default;}
.cosmetic-stage-characters {flex-direction:column;gap:25px;padding:20px;}
.cosmetic-stage-characters .cosmetic-character-card {width:100%;grid-template-columns:110px minmax(0,1fr);gap:15px;padding:18px;min-height:155px;}
.cosmetic-stage-characters .cosmetic-character-avatar {width:105px;height:105px;}
.cosmetic-stage-characters .cosmetic-character-card strong {font-size:30px;}
.cosmetic-stage-characters .cosmetic-character-reactions {position:static;transform:none;gap:10px;}
.cosmetic-stage-characters .cosmetic-reaction-sample {display:block;flex:0 0 70px;width:70px;height:70px;background-size:500% 200%!important;animation:reactionSpritePlayV24 var(--reaction-duration,1.2s) linear infinite!important;}
.progress-back-v12 {padding:0!important;}
.progress-back-v12 img {margin:0!important;object-position:center;flex:0 0 auto;}
#btnProgressBack {display:flex!important;align-items:center!important;justify-content:center!important;}
#btnProgressBack img {width:28px!important;height:28px!important;margin:0!important;}
@media(max-width:760px) {
  .play-hub-panel {padding:23px 14px 18px!important;}
  .play-hub-panel .play-mode-card {min-height:65px;padding:11px 9px;gap:8px;}
  .play-hub-panel .play-mode-card strong {font-size:17px;}
  .play-hub-panel .play-mode-card img {width:28px!important;height:28px!important;flex-basis:28px;}
  .play-hub-panel .play-hub-grid {gap:12px 9px;}
  .seg.game-picker button,.seg.help-game-tabs button {font-size:17px;}
  .play-hub-panel #btnQuickPlay {min-height:83px;}
  .play-hub-panel #btnQuickPlay strong {font-size:27px;}
  #modal-help .help-modal-v29 {height:94dvh;max-height:94dvh!important;padding:13px!important;gap:10px;}
  #modal-help .help-head-v29 .settings-close-v12 {top:10px;right:10px;}
  .guide-chapters {gap:3px;margin-bottom:10px;}
  .guide-chapters button {flex-direction:column;gap:5px;font-size:10px;padding:5px 0;}
  .guide-chapters button b {width:22px;height:22px;flex-basis:22px;font-size:12px;}
  .guide-lesson {padding:12px 9px;}
  #partnershipGuide .guide-lesson h3 {font-size:20px;}
  #partnershipGuide .guide-copy {font-size:14px;line-height:1.4;}
  .guide-facts {gap:6px;}
  .guide-facts>span {font-size:12px;padding:6px 8px;}
  .guide-card.card {width:49px!important;height:70px!important;flex-basis:49px;--card-w:49px;--card-h:70px;}
  .guide-comparison {gap:16px;}
  .guide-sample>strong {font-size:13px;}
  .guide-rank-order {font-size:12px;gap:8px;grid-template-columns:1fr;justify-items:center;}
  .guide-combo-grid {grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 7px;}
  .guide-combo-grid .guide-card.card {width:38px!important;height:55px!important;flex-basis:38px;--card-w:38px;--card-h:55px;}
  .guide-special-grid {grid-template-columns:1fr;gap:10px;}
  .guide-special-grid>div {grid-template-columns:58px 1fr;}
  .guide-seats {grid-template-rows:77px 55px 77px;width:280px;}
  .guide-seat>span {width:44px;height:44px;}
  .guide-seat strong {font-size:12px;}
  .guide-deal {gap:10px;}.guide-deal span {font-size:25px;padding:10px 12px;}
  .guide-exchange {gap:7px;}.guide-exchange strong {font-size:11px;}
  .guide-bid-example {gap:12px;}.guide-bid {font-size:26px;padding:10px;}
  .guide-pager .btn {font-size:14px;padding:8px 12px;}
  .guide-case-tabs .btn {font-size:12px;padding:7px;}
  #playerRail .pchip .pchip-role {font-size:9px;padding:3px 4px;}
  .team-score {min-height:30px;}
  .cosmetic-deck-showcase {width:min(320px,92%)!important;gap:12px 9px;}
  .cosmetic-preview-stage {min-height:330px;}
  .cosmetic-stage-characters {gap:15px;padding:12px;}
  .cosmetic-stage-characters .cosmetic-character-card {grid-template-columns:75px minmax(0,1fr);gap:10px;padding:12px;min-height:110px;}
  .cosmetic-stage-characters .cosmetic-character-avatar {width:73px;height:73px;padding:6px;border-width:3px;}
  .cosmetic-stage-characters .cosmetic-character-card strong {font-size:23px;}
  .cosmetic-stage-characters .cosmetic-character-card small {font-size:12px;}
  .cosmetic-stage-characters .cosmetic-reaction-sample {width:52px;height:52px;flex-basis:52px;}
}
@media(max-width:360px) {
  .play-hub-panel .play-mode-card {flex-direction:column;justify-content:center;gap:5px;}
  .play-hub-panel #btnQuickPlay {flex-direction:row;}
  .play-hub-panel .play-mode-card strong {font-size:15px;}
  .guide-combo-grid .guide-card.card {width:32px!important;height:46px!important;flex-basis:32px;}
}
.title-card-fan .hero-fan-art {z-index:2;animation:none!important;}
.title-card-fan .hero-orbit-sprite {position:absolute;inset:auto;display:block;max-width:none;pointer-events:none;image-rendering:pixelated;object-fit:contain;height:auto;will-change:transform;}
.title-card-fan .orbit-head {width:2.7%;}
.title-card-fan .orbit-trail {width:4.1%;}
.title-card-fan[data-orbit-active="false"] .hero-orbit-sprite {display:none;}
@media(prefers-reduced-motion:reduce){.title-card-fan .hero-orbit-sprite{display:none!important;}}
@media(max-height:520px) and (min-width:600px) {
  .play-hub-panel {padding:16px 20px!important;}
  .play-hub-panel h2 {font-size:25px;margin-bottom:12px;}
  .seg.game-picker {margin-bottom:12px;}
  .play-hub-panel .play-mode-card {min-height:48px;padding:6px 14px;}
  .play-hub-panel #btnQuickPlay {min-height:58px;margin-bottom:3px;}
  .play-hub-panel .play-hub-grid {gap:10px;}
  .play-hub-panel #btnQuickPlay strong {font-size:25px;}
  #screen-game .team-score {min-height:21px;}
}
