/* Casino mini-games: the blackjack table and the 3-reel slot machines (panels inside the casino). */

/* ------------------------------------------------------------ shared */
.bj [hidden], .sl [hidden] { display: none !important; }
.cg-msg { min-height: 42px; text-align: center; font-weight: 700; line-height: 1.35; color: var(--text); padding: 0 4px; }
.cg-msg b { color: var(--primary); }
.cg-row { display: flex; gap: 8px; }
.cg-row .choice { flex: 1; padding: 13px 0; }
.bj .choice:disabled, .sl .choice:disabled { opacity: 0.35; cursor: default; }
.choice.cg-on { background: color-mix(in srgb, #40c057 22%, var(--seg)); }
.choice.cg-hint { box-shadow: inset 0 0 0 3px #40c057; }
.cg-seg { display: flex; flex: 1; background: var(--seg); border-radius: 999px; padding: 4px; gap: 4px; }
.cg-seg button { flex: 1; padding: 9px 0; border-radius: 999px; font-weight: 800; font-size: 14px; }
.cg-seg button.on { background: var(--card); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.cg-seg button:disabled { opacity: 0.35; }

/* ------------------------------------------------------------ blackjack */
.bj { display: grid; gap: 12px; --cw: 56px; }
.bj-felt {
  border-radius: 24px;
  padding: 12px 12px 14px;
  color: #fff;
  background: radial-gradient(120% 90% at 50% 0%, #2f9e44, #1b6e33 60%, #0f4d22);
  display: grid;
  gap: 8px;
}
.bj-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 13px; }
.bj-shoe { font-weight: 700; font-size: 12px; opacity: 0.75; }
.bj-felt-rules { text-align: center; font-size: 11px; font-weight: 700; color: rgba(255, 240, 180, 0.8); }
.bj-hand { display: flex; min-height: calc(var(--cw) * 1.42); align-items: flex-start; }
.bj-seat { display: grid; gap: 6px; justify-items: start; padding: 6px; border-radius: 18px; transition: background 0.2s; }
.bj-seat.active { background: rgba(255, 255, 255, 0.12); }
.bj-hands { display: grid; gap: 4px; grid-template-columns: 1fr; }
.bj-hands.split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bj.small { --cw: 42px; }
.bj-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 24px; }
.bj-pill { border-radius: 999px; padding: 3px 10px; font-weight: 800; font-size: 13px; background: rgba(0, 0, 0, 0.28); }
.bj-pill:empty { display: none; }
.bj-pill.bet { background: rgba(255, 255, 255, 0.16); }
.bj-pill.win { background: #ffd43b; color: #3b2a00; }
.bj-pill.lose { background: rgba(0, 0, 0, 0.45); color: #ffc9c9; }
.bj-pill.push { background: rgba(255, 255, 255, 0.85); color: #16131c; }

.bj-card {
  width: var(--cw);
  height: calc(var(--cw) * 1.42);
  margin-left: calc(var(--cw) * -0.52);
  flex: none;
  border-radius: calc(var(--cw) * 0.18);
  background: #fff;
  color: #16131c;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  font-weight: 800;
  animation: bj-in 0.34s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}
.bj-card:first-child { margin-left: 0; }
.bj-card.static { animation: none; }
.bj-card .ix { position: absolute; left: 6%; top: 3%; display: grid; justify-items: center; line-height: 1; font-size: calc(var(--cw) * 0.3); }
.bj-card .ix i { font-style: normal; font-size: calc(var(--cw) * 0.26); }
.bj-card .pip { position: absolute; right: 10%; bottom: 6%; font-size: calc(var(--cw) * 0.56); line-height: 1; }
.bj-card.red { color: #e03131; }
.bj-card.back { background: repeating-linear-gradient(45deg, #ff2d87 0 5px, #c2185b 5px 10px); }
.bj-card.back > * { visibility: hidden; }
.bj-card.back::after {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: calc(var(--cw) * 0.1);
  border: 2px solid rgba(255, 255, 255, 0.55);
}
.bj-card.flip { animation: bj-flip 0.38s ease both; }
@keyframes bj-in { from { transform: translate(90px, -70px) rotate(14deg); opacity: 0; } }
@keyframes bj-flip { from { transform: rotateY(90deg); } }

.bj-betbar { display: flex; align-items: center; justify-content: center; gap: 12px; }
.bj-betbar .amount { font-size: 30px; font-weight: 800; min-width: 92px; text-align: center; }
.bj-betbar .label { font-size: 13px; font-weight: 700; color: var(--muted); }
.bj-chips { display: flex; justify-content: center; gap: 10px; }
.bj-chip {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-weight: 800;
  color: #fff;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, var(--c) 0 50%, rgba(255, 255, 255, 0.95) 51% 58%, var(--c) 59%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s;
}
.bj-chip:active:not(:disabled) { transform: scale(0.92); }
.bj-chip:disabled { opacity: 0.3; }
.bj-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bj-actions .choice { padding: 13px 0; }

/* ------------------------------------------------------------ slots */
.sl { display: grid; gap: 12px; --cell: 54px; }
.sl-cabinet {
  border-radius: 24px;
  padding: 14px;
  background: linear-gradient(160deg, #2b1055, #7b1fa2 55%, #ff2d87);
  color: #fff;
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
}
.sl-lights {
  position: absolute;
  inset: 5px;
  border-radius: 20px;
  pointer-events: none;
  background: radial-gradient(circle, #ffe066 0 3px, transparent 4px) 0 0 / 22px 22px;
  opacity: 0.5;
  padding: 4px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: sl-chase 0.6s steps(2) infinite;
}
.sl-cabinet.win .sl-lights { animation-duration: 0.18s; opacity: 0.9; }
@keyframes sl-chase { to { background-position: 11px 0; } }
.sl-marquee { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; position: relative; }
.sl-marquee b { font-size: 21px; font-weight: 800; }
.sl-marquee small { font-size: 12px; font-weight: 700; opacity: 0.8; text-align: right; }
.sl-window { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #0e0820; border-radius: 18px; padding: 6px; }
.sl-reel {
  height: calc(var(--cell) * 3);
  overflow: hidden;
  border-radius: 12px;
  position: relative;
  background: linear-gradient(#bdb6c8, #fff 28%, #fff 72%, #bdb6c8);
}
.sl-strip { will-change: transform; }
.sl-cell { height: var(--cell); display: grid; place-items: center; }
.sl-payline {
  position: absolute;
  left: 2px;
  right: 2px;
  top: calc(6px + var(--cell));
  height: var(--cell);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(255, 45, 135, 0.8);
  pointer-events: none;
}
.sl-cabinet.win .sl-payline { animation: sl-flash 0.25s 6 alternate; }
@keyframes sl-flash { to { box-shadow: inset 0 0 0 4px #ffe066, 0 0 22px #ffe066; } }
.sl-cell.hit .sym { animation: sl-pop 0.5s 3 alternate; }
@keyframes sl-pop { to { transform: scale(1.18); } }

.sym { display: grid; place-items: center; }
.sym svg { width: 40px; height: 40px; display: block; }
.sym.seven { font-size: 40px; font-weight: 800; font-style: italic; color: #e03131; line-height: 1; text-shadow: 2px 2px 0 rgba(224, 49, 49, 0.25); }
.sym.bars { gap: 2px; }
.sym.bars span { display: block; width: 46px; padding: 1px 0; border-radius: 6px; background: #16131c; color: #fff; font-size: 9px; font-weight: 800; text-align: center; line-height: 1.1; }
.sym.coin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3bf, #fab005 60%, #e67700);
  color: #7a3e00;
  font-size: 22px;
  font-weight: 800;
}

.sl-meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; position: relative; }
.sl-meter { background: rgba(14, 8, 32, 0.72); border-radius: 14px; padding: 6px 8px; text-align: center; }
.sl-meter small { display: block; font-size: 11px; font-weight: 700; opacity: 0.7; }
.sl-meter b { font-size: 20px; font-weight: 800; color: #ffe066; font-variant-numeric: tabular-nums; }

.sl-pay { display: grid; gap: 4px; font-size: 14px; }
.sl-pay[hidden] { display: none; }
.sl-pay-row { display: grid; grid-template-columns: 1fr repeat(3, 44px); align-items: center; gap: 4px; background: var(--seg); border-radius: 14px; padding: 4px 10px; }
.sl-pay-row.head { background: none; font-size: 12px; font-weight: 700; color: var(--muted); padding: 0 10px; }
.sl-pay-row.won { background: color-mix(in srgb, #ffd43b 45%, var(--seg)); }
.sl-pay-row span { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.sl-pay-row span.on { color: var(--primary); font-weight: 800; }
.sl-pay-syms { display: flex; gap: 2px; align-items: center; }
.sl-pay-syms .sym { transform: scale(0.6); margin: -9px -8px; }
.sl-pay-syms .sym.seven { margin: -9px -1px; }
.sl-pay-syms .any { font-size: 11px; font-weight: 700; color: var(--muted); width: 26px; text-align: center; }
.sl-pay-note { font-size: 12px; color: var(--muted); text-align: center; font-weight: 600; }

@media (max-width: 400px) {
  .bj { --cw: 50px; }
  .bj.small { --cw: 38px; }
  .bj-chip { width: 50px; height: 50px; }
  .sl { --cell: 50px; }
}

/* Phones on their side (html.is-compact): the panel is only ~280px tall, so the felt / cabinet
   sits on the left and the message and buttons on the right, all visible without scrolling. */
html.is-compact .sheet:has(.bj, .sl) { width: min(720px, calc(100% - 16px)); }
html.is-compact .bj,
html.is-compact .sl {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-rows: repeat(4, auto) 1fr;
  align-items: start;
  column-gap: 14px;
  row-gap: 8px;
}
html.is-compact .bj-felt,
html.is-compact .sl-cabinet { grid-column: 1; grid-row: 1 / -1; }
html.is-compact .bj > :not(.bj-felt),
html.is-compact .sl > :not(.sl-cabinet) { grid-column: 2; }
html.is-compact .bj { --cw: 46px; }
html.is-compact .bj.small { --cw: 36px; }
html.is-compact .bj > .bj-group { gap: 8px !important; }
html.is-compact .bj-betbar .amount { font-size: 24px; min-width: 70px; }
html.is-compact .bj-chip { width: 44px; height: 44px; }
html.is-compact .bj-chips { gap: 8px; }
html.is-compact .cg-row .choice,
html.is-compact .bj-actions .choice { padding: 10px 0; }
html.is-compact .sl { --cell: 44px; }
html.is-compact .sl-cabinet { padding: 10px; gap: 8px; }
html.is-compact .cg-msg { min-height: 0; font-size: 14px; }
