:root{
  --felt1:#0f4f2a;
  --felt2:#0a2f1c;
  --ink:#e9f6ef;
  --muted:rgba(233,246,239,.74);
  --stroke:rgba(255,255,255,.14);

  --card-width: clamp(44px, min(12vw, 9.8svh), 90px);
  --card-height: calc(var(--card-width) * 1.42);
}

*{box-sizing:border-box}
html,body{min-height:100%; max-width:100%; overflow-x:hidden}
body{
  margin:0;
  color:var(--ink);
  font-family: var(--font-ui, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial);
  background:
    radial-gradient(900px 640px at 20% 0%, rgba(0,0,0,.18), transparent 58%),
    radial-gradient(900px 640px at 80% 0%, rgba(0,0,0,.16), transparent 58%),
    linear-gradient(180deg, var(--felt1), var(--felt2) 65%, rgba(0,0,0,.10));
  overflow-x:hidden;
  overflow-y:auto;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

/* Never allow card transparency */
.card,
.card.face-up,
.card.face-down,
.playing-card,
.human-hand .card,
.opponent-hand .card{
  opacity: 1 !important;
  mix-blend-mode: normal !important;
}

.app{
  min-height: 100dvh;
  display:flex;
  flex-direction: column;
}

.topbar{ position: sticky; top:0; z-index: 10; background: transparent; }
.topbar-scroll{
  display:flex;
  align-items:center;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 12px;
  -webkit-overflow-scrolling: touch;
}

.back{
  color: rgba(255,255,255,.92);
  text-decoration: none;
  font-weight: 900;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.16);
  white-space: nowrap;
}

.title{
  margin: 0 6px 0 0;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: .02em;
  white-space: nowrap;
}

.hudItem{
  display:flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.14);
  white-space: nowrap;
}
.hudItem .k{ color: rgba(255,255,255,.72); font-weight: 900; font-size: 12px; }
.hudItem .v{ font-weight: 950; font-variant-numeric: tabular-nums; }

.btn{
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.10);
  color: rgba(255,255,255,.94);
  font-weight: 950;
  cursor:pointer;
  white-space: nowrap;
}
.btn:disabled{opacity:.45; cursor: default}
.btn.primary{
  background: linear-gradient(180deg, #f6d777, #b57b1d);
  color: #141008;
  border-color: rgba(255,255,255,.30);
}

.statusRow{ padding: 8px 12px; }
.status{ min-height: 20px; color: rgba(255,255,255,.84); font-weight: 850; }

.c8-table{ flex: 1 1 auto; min-height: 0; }
.c8-scroll{
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 22px;
  display:flex;
  flex-direction: column;
  gap: 14px;
  align-items:center;
}

.cpu-area{
  width: min(980px, 98vw);
  display:flex;
  justify-content:center;
  gap: clamp(8px, 1.4vw, 16px);
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 6px;
}

.seat{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.10);
  padding: 10px;
  min-width: 0;
}
.cpu-seat{ width: clamp(140px, 20vw, 210px); }
.is-hidden{ display:none !important; }

.seat-head{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}
.seat-name{
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seat-meta{
  white-space: nowrap;
  font-weight: 900;
  color: rgba(255,255,255,.76);
  font-variant-numeric: tabular-nums;
}
.seat-sub{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,.72);
  font-weight: 850;
}

.hand-back-row{
  display:flex;
  align-items:center;
  gap: 10px;
}
.mini-deck{
  width: calc(var(--card-width) * 0.55);
  height: calc(var(--card-height) * 0.55);
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(0,0,0,.12);
  overflow:hidden;
}
.mini-deck .card{
  width: 100%;
  height: 100%;
}

.center-area{
  width: min(980px, 98vw);
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 2vw, 18px);
  align-items: start;
}

.pile-area,
.message-area{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.10);
  padding: 10px;
}
.message-area{ grid-column: 1 / span 2; }

.center-label{
  font-weight: 950;
  letter-spacing: .10em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(255,255,255,.80);
  margin-bottom: 8px;
}
.center-sub{
  margin-top: 8px;
  color: rgba(255,255,255,.72);
  font-weight: 850;
}

.pile.slot{
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(0,0,0,.12);
  overflow:hidden;
}
.pile-btn{
  cursor: pointer;
  padding: 0;
  display:block;
}

.message-title{
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.message-line{
  color: rgba(255,255,255,.82);
  font-weight: 850;
}

.human-area{
  width: min(980px, 98vw);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.10);
  padding: 12px;
}

.human-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.human-title{ font-weight: 950; }
.human-sub{ color: rgba(255,255,255,.72); font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }

.hand-row{
  display:flex;
  gap: 10px;
  align-items:center;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.hand-card{
  cursor:pointer;
  transform: translateZ(0);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.hand-card.selected{
  transform: translateY(-10px);
  outline: 3px solid rgba(255,235,150,.92);
  outline-offset: 3px;
  box-shadow: 0 0 22px rgba(255,215,90,.42);
}
.hand-card.playable{
  box-shadow: 0 0 0 2px rgba(119, 255, 205, .35), 0 16px 34px rgba(0,0,0,.25);
}

.control-row{
  display:flex;
  justify-content:center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.actionBtn{ min-width: 132px; }

/* Cards */
.card{
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(0,0,0,.25);
  background-color: transparent;
  background-repeat:no-repeat;
  background-position:center;
  flex: 0 0 auto;
  position: relative;
}

.card-corner-helper{
  position:absolute;
  top: 4px;
  left: 4px;
  padding: 1px 4px;
  border-radius: 5px;
  background: rgba(255,255,255,.90);
  font-size: clamp(10px, 1.4vw, 13px);
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
  z-index: 2;
}
.card-corner-helper.red{color:#b80e1f}
.card-corner-helper.black{color:#111}

/* Sheets */
.sheet-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.58);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 6000;
}
.sheet-panel{
  position: fixed;
  inset: 18px;
  width: min(720px, calc(100vw - 36px));
  max-width: 720px;
  max-height: calc(100dvh - 36px);
  margin: auto;
  display:flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 6010;
  background:
    radial-gradient(circle at top left, rgba(21,114,70,0.24), transparent 38%),
    linear-gradient(180deg, #121815 0%, #050807 100%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 22px;
  box-shadow: 0 28px 90px rgba(0,0,0,0.72);
}
.sheet-panel[hidden], .sheet-backdrop[hidden]{ display:none !important; }
.sheet-header{
  flex: 0 0 auto;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, #121815 0%, rgba(18,24,21,0.96) 100%);
}
.sheet-h2{ margin:0; font-size: 20px; }
.sheet-sub{ margin:3px 0 0; color: rgba(255,255,255,0.68); font-size: 13px; }
.sheet-close{
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  font-weight: 900;
  cursor:pointer;
}
.sheet-scroll{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px;
  max-height: 85vh;
}
.sheet-group + .sheet-group{
  margin-top: 16px;
  padding-top: 16px;
  border-top: 2px solid rgba(255,255,255,0.16);
}
.sheet-group h3{
  margin: 0 0 6px;
  color: #d7ffe9;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.sheet-group p{ margin: 8px 0 0; color: rgba(255,255,255,.82); font-weight: 820; line-height: 1.5; }
.sheet-group ul{ margin: 8px 0 0; padding-left: 18px; color: rgba(255,255,255,.82); font-weight: 820; }
.sheet-group li{ margin: 6px 0; }

.setting-row{
  display:grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items:center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.setting-row:last-child{ border-bottom: 0; }
.setting-label{ font-weight: 900; }
.setting-help{ margin-top: 3px; color: rgba(255,255,255,0.68); font-size: 12px; }
.setting-control{ display:flex; gap: 6px; flex-wrap: wrap; justify-content:flex-end; }
.setting-chip{
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.86);
  font-weight: 900;
  cursor:pointer;
}
.setting-chip.active, .setting-chip[aria-pressed="true"]{
  background: linear-gradient(180deg, #f6d777, #b57b1d);
  color: #141008;
  border-color: rgba(255,255,255,0.4);
}

/* Suit chooser */
.suit-panel{ max-width: 540px; }
.suit-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.suit-choice{
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.94);
  font-weight: 950;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
}
.suit-choice .sym{ font-size: 18px; font-weight: 950; }
.suit-choice .red{ color: #ff8092; }
.suit-choice .black{ color: #e8f1ff; }

@media (max-width: 740px){
  .center-area{ grid-template-columns: 1fr; }
  .message-area{ grid-column: auto; }
  .cpu-area{ justify-content:flex-start; }
}


/* BWG_CARD_TABLE_REFRESH_START */
:root{
  --bwg-felt-bright:#2fe37a;
  --bwg-felt:#18a34a;
  --bwg-felt-mid:#0f7d39;
  --bwg-felt-dark:#074b22;
  --bwg-panel:rgba(0,0,0,.24);
  --bwg-line:rgba(255,255,255,.14);
  --bwg-text:#f8fff9;
  --bwg-muted:#d7f5df;
  --bwg-gold:#ffd166;
  --bwg-gold-2:#f59f00;
  --bwg-shadow:0 24px 70px rgba(0,0,0,.45);
}

html,
body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  color:var(--bwg-text);
  background:
    radial-gradient(circle at center,
      var(--bwg-felt-bright) 0%,
      var(--bwg-felt) 24%,
      var(--bwg-felt-mid) 58%,
      var(--bwg-felt-dark) 100%) !important;
}

.app,
.game-shell,
.holdem-game,
.gofish-game,
.spades-game,
.poker-game,
.c8-game,
.draw-game,
.blackjack-game,
.war-game,
.hearts-game{
  background:transparent !important;
}

.table,
.table-area,
.table-scroll,
.poker-table,
.blackjack-table,
.war-table,
.gofish-table,
.c8-table,
.spades-game .table,
.hearts-game .table,
.holdem-game .table,
.draw-game .table,
.poker-game .table,
.freecellTableau,
.spiderTableau,
.pyramid-board,
.playWrap,
.blackjack-board{
  background:
    radial-gradient(circle at center,
      #37ef81 0%,
      #18b358 20%,
      #0d8a42 54%,
      #065428 100%) !important;
  border:2px solid rgba(255,255,255,.14) !important;
  border-radius:32px !important;
  box-shadow:
    inset 0 2px 10px rgba(255,255,255,.14),
    inset 0 -20px 50px rgba(0,0,0,.22),
    var(--bwg-shadow) !important;
}

.topbar,
.hud,
.statusRow,
.scoreboard,
.action-panel,
.controls-area,
.message-area,
.pot-box,
.raise-box,
.bet-zone,
.bid-panel,
.chip-ui,
.asset-test,
.hudItem,
.hudPill{
  background:rgba(0,0,0,.22) !important;
  border:1px solid var(--bwg-line) !important;
  box-shadow:var(--bwg-shadow) !important;
  backdrop-filter:blur(12px);
}

.btn,
.actionBtn,
.game-btn,
.primary,
.primary-btn,
.secondary-btn,
.chipBtn,
.betBtn,
.targetBtn,
.pile-btn{
  border-radius:14px !important;
  font-family:"Space Grotesk",sans-serif !important;
  font-weight:800 !important;
}

.primary,
.primary-btn,
.btn.primary,
.actionBtn.primary{
  color:#1d1200 !important;
  background:linear-gradient(135deg,var(--bwg-gold),var(--bwg-gold-2)) !important;
}

.card,
.playing-card,
.hand-card,
.card-slot,
.slot,
.pile,
.pile-slot,
.foundation-pile,
.freecell,
.completed-pile,
.removed-pile,
.deck-pile,
.battle-card-wrap{
  max-width:100%;
}

.card,
.playing-card,
.hand-card{
  border-radius:14px !important;
  box-shadow:0 12px 28px rgba(0,0,0,.45) !important;
}

.card-face,
.card-back{
  border-radius:inherit !important;
}

.card-corner-helper,
.k,
.v,
.sym,
.red,
.black{
  display:block !important;
  opacity:1 !important;
  visibility:visible !important;
  z-index:10 !important;
  text-shadow:
    0 1px 0 rgba(255,255,255,.8),
    0 2px 4px rgba(0,0,0,.28);
}

.card-corner-helper{
  position:absolute !important;
  top:5px !important;
  left:5px !important;
  background:rgba(255,255,255,.9) !important;
  border-radius:8px !important;
  padding:3px 5px !important;
  font-size:clamp(.58rem,1.4vw,.82rem) !important;
  line-height:1 !important;
  font-weight:900 !important;
  pointer-events:none !important;
}

.hand-row,
.cards-row,
.player-cards,
.community-cards,
.human-hand,
.human-cards,
.seat-cards,
.opp-hand,
.cpu-hand,
.player-hand,
.tableau,
.tableauWrap,
.freecellTableau,
.spiderTableau{
  max-width:100% !important;
  min-width:0 !important;
}

.drawer-panel,
.sheet-panel,
.rules-panel,
.settings-panel,
.suit-panel{
  max-height:min(86vh,760px) !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
}

.drawer-header,
.sheet-header,
.rules-header,
.settings-header{
  flex:0 0 auto !important;
  position:sticky !important;
  top:0 !important;
  z-index:5 !important;
}

.drawer-scroll,
.sheet-scroll,
.rules-scroll,
.settings-scroll,
.suit-scroll{
  overflow-y:auto !important;
  -webkit-overflow-scrolling:touch !important;
  max-height:calc(86vh - 90px) !important;
  padding-right:10px !important;
}

.drawer-backdrop,
.sheet-backdrop,
.rules-backdrop,
.settings-backdrop,
.suit-choice{
  overflow-y:auto !important;
  padding:12px !important;
}

@media (max-width:1050px){
  .topbar{
    grid-template-columns:1fr !important;
    text-align:center !important;
  }

  .topbar-scroll{
    overflow-x:auto !important;
    max-width:100% !important;
  }
}

@media (max-width:820px){
  :root{
    --card-w:clamp(34px,11vw,72px);
  }

  .table,
  .table-area,
  .poker-table,
  .blackjack-table,
  .war-table,
  .gofish-table,
  .c8-table,
  .blackjack-board{
    border-radius:24px !important;
    padding:clamp(10px,3vw,20px) !important;
  }

  .hud,
  .statusRow,
  .scoreboard{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }

  .card,
  .playing-card,
  .hand-card{
    width:var(--card-w) !important;
  }

  .drawer-panel,
  .sheet-panel,
  .rules-panel,
  .settings-panel,
  .suit-panel{
    width:100% !important;
    max-height:92vh !important;
    border-radius:20px !important;
  }

  .drawer-scroll,
  .sheet-scroll,
  .rules-scroll,
  .settings-scroll,
  .suit-scroll{
    max-height:calc(92vh - 82px) !important;
  }
}

@media (max-width:520px){
  :root{
    --card-w:clamp(28px,13.5vw,56px);
  }

  .app,
  .game-shell{
    padding:8px !important;
  }

  .card,
  .playing-card,
  .hand-card{
    width:var(--card-w) !important;
  }

  .card-corner-helper{
    top:3px !important;
    left:3px !important;
    padding:2px 4px !important;
    border-radius:6px !important;
  }

  .btn,
  .actionBtn,
  .primary,
  .primary-btn,
  .secondary-btn{
    padding:11px 13px !important;
    font-size:.9rem !important;
  }
}
/* BWG_CARD_TABLE_REFRESH_END */

