/* ---------------------------------------------------------------- Pai Gow Poker (#pgp-ui) and Let It Ride (#lir-ui) */
/* Both games share the .cg-* classes. Sits above #hud (z 10), below #screen (20), #modal (30) and #loading (100). */
.cg-root {
  position: fixed; inset: 0; z-index: 12; pointer-events: none;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif; color: var(--text);
}
.cg-root button { pointer-events: auto; }
.cg-root .hidden { display: none !important; }
.cg-root .cg-k { font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }

/* ---- status strip (top-left) */
.cg-status {
  position: absolute; top: 12px; left: 12px; pointer-events: auto;
  display: flex; flex-direction: column; gap: 6px; min-width: 200px; padding: 9px 14px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  backdrop-filter: blur(8px); box-shadow: 0 10px 28px rgba(0,0,0,.45);
}
.cg-stat { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.cg-stat.hidden { display: none !important; }
.cg-v { font: 700 15px Georgia, serif; color: var(--gold-2); white-space: nowrap; }
.cg-progress { flex-basis: 100%; height: 4px; margin-top: 4px; border-radius: 2px; overflow: hidden; background: rgba(255,255,255,.1); }
.cg-progress i { display: block; height: 100%; width: 0; border-radius: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); transition: width .4s ease; }

/* ---- paytable (Let It Ride, top-right) */
.cg-paytable {
  position: absolute; top: 12px; right: 12px; pointer-events: none; display: flex; flex-direction: column; gap: 2px;
  min-width: 200px; padding: 9px 14px; font-size: 12px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; backdrop-filter: blur(8px);
}
.cg-pay-row { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); }
.cg-pay-row b { color: var(--gold-2); font-family: Georgia, serif; }

/* ---- bottom panels */
.cg-bottom {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(600px, calc(100% - 24px)); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none;
}
.cg-panel {
  pointer-events: auto; width: 100%; padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 12px; align-items: center;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 18px;
  backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: cgPanelIn .3s cubic-bezier(.2,1.3,.4,1);
}
.cg-panel.hidden { display: none !important; }
@keyframes cgPanelIn { from { opacity: 0; transform: translateY(24px); } }
.cg-panel-title { font: 700 16px Georgia, serif; color: var(--gold-2); letter-spacing: .5px; }
.cg-question { font-size: 14px; color: var(--muted); text-align: center; }
.cg-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; }
.cg-amount { font: 700 26px Georgia, serif; color: var(--gold-2); text-shadow: 0 2px 10px rgba(0,0,0,.6); min-width: 90px; text-align: center; }

.cg-btn { min-width: 0; padding: 10px 16px; flex-direction: row; gap: 8px; font-size: 14px; }
.cg-btn span { white-space: nowrap; }
.cg-btn kbd { margin-left: 0; }
.cg-btn.big { padding: 14px 34px; font-size: 18px; min-width: 180px; }
.cg-btn.cg-tool { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.cg-btn.cg-go { padding: 12px 28px; font-size: 16px; }
.cg-btn:disabled { opacity: .4; }

/* ride / pull buttons */
.cg-decision .cg-buttons .cg-btn { flex: 1 1 180px; padding: 14px 16px; border: none; color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.2); }
.cg-btn.cg-play { background: linear-gradient(180deg, #2f7d4c, #1b4f2f); }
.cg-btn.cg-fold { background: linear-gradient(180deg, #6b2b33, #44161c); }
.cg-btn.cg-play:hover:not(:disabled), .cg-btn.cg-fold:hover:not(:disabled) { filter: brightness(1.15); }

/* chips */
.cg-chip-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cg-chip {
  position: relative; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; padding: 0;
  display: grid; place-items: center; font: 800 13px/1 Consolas, monospace; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.85);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--chip) 70%, white), var(--chip));
  box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 0 4px var(--chip), 0 0 0 6px rgba(255,255,255,.12), 0 8px 16px rgba(0,0,0,.5);
  transition: transform .12s, filter .15s;
}
.cg-chip:hover:not(:disabled) { transform: translateY(-3px) scale(1.06); filter: brightness(1.1); }
.cg-chip:active:not(:disabled) { transform: translateY(0) scale(.97); }
.cg-chip:disabled { opacity: .35; cursor: default; filter: grayscale(.5); }
.cg-chip-key { position: absolute; right: -4px; top: -4px; margin: 0; font-size: 9px; padding: 2px 4px; border-radius: 4px; background: rgba(0,0,0,.75); color: var(--muted); }

/* Pai Gow arrange: 7 tappable cards */
.cg-hand-cards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cg-card {
  min-width: 56px; padding: 14px 6px; border-radius: 8px; cursor: pointer; font: 700 20px Georgia, serif;
  background: #f6f3ea; color: #15151a; border: 2px solid #b9b19a; box-shadow: 0 4px 10px rgba(0,0,0,.4);
  transition: transform .12s, border-color .12s;
}
.cg-card.red { color: #b3202c; }
.cg-card:hover { transform: translateY(-3px); }
.cg-card.low { transform: translateY(8px); border-color: var(--gold-2); box-shadow: 0 0 0 3px rgba(233,200,105,.45), 0 4px 10px rgba(0,0,0,.4); }
.cg-preview { font-size: 13px; color: var(--text); text-align: center; min-height: 18px; }
.cg-warn { font-size: 13px; color: #ff8d8d; text-align: center; min-height: 16px; }

/* ---- small screens */
@media (max-width: 760px) {
  .cg-status { top: 8px; left: 8px; right: 8px; min-width: 0; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; padding: 7px 10px; }
  .cg-stat { gap: 4px; }
  .cg-stat .cg-k { font-size: 10px; }
  .cg-progress { order: 10; }
  .cg-v { font-size: 13px; }
  .cg-paytable { display: none; }
  .cg-bottom { bottom: 10px; width: calc(100% - 16px); }
  .cg-panel { padding: 12px 12px 14px; border-radius: 16px; }
  .cg-chip { width: 46px; height: 46px; font-size: 11px; }
  .cg-chip-row { gap: 8px; }
  .cg-card { min-width: 44px; padding: 12px 4px; font-size: 17px; }
  .cg-btn.big { min-width: 0; flex: 1 1 100%; }
  .cg-decision .cg-buttons .cg-btn { flex: 1 1 40%; padding: 12px 8px; font-size: 14px; }
}
