/* Styles for loans/debt collector, history, and the newer games */

/* ---------- Mines: queued + picked tiles ---------- */
/* Fixed-size cells: rows don't grow when an emoji appears, and boxes never scale */
.mines-grid { grid-template-rows: repeat(5, minmax(0, 1fr)); }
.mines-grid .tile { min-width: 0; min-height: 0; overflow: hidden; line-height: 1; padding: 0; }
.mines-grid .tile.revealed { animation: none; }
.mines-grid .tile .gem { display: inline-block; animation: pop .2s ease; }
.tile.pending { animation: glow .5s ease-in-out infinite alternate; background: #2c4655; }
@keyframes glow { from { filter: brightness(1); } to { filter: brightness(1.45); } }
.tile.revealed.picked { box-shadow: inset 0 0 0 2px var(--green); background: #0e2a1c; }
.tile.revealed.dim { opacity: .35; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(.92); } }

/* ---------- Win coins / debt collector ---------- */
.fly-coin { position: fixed; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; z-index: 300; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #fff6c4 0 15%, #ffd34d 35%, #d99a0b 75%, #a86f00 100%); box-shadow: 0 0 10px #ffc94a99, inset 0 0 0 2px #e8a90f; }
.balance.bump { animation: bump .25s ease; }
@keyframes bump { 50% { transform: scale(1.08); box-shadow: 0 0 0 2px var(--gold), 0 0 20px #ffc94a66; } }
.collector { position: fixed; left: 0; z-index: 310; pointer-events: none; filter: drop-shadow(0 8px 10px rgba(0,0,0,.5)); }
.collector svg { display: block; }
.collector .sack { opacity: 0; transition: opacity .2s; }
.collector.grab .sack, .collector.leaving .sack { opacity: 1; }
.collector.walking .leg.l { animation: legA .28s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: top center; }
.collector.walking .leg.r { animation: legB .28s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: top center; }
.collector.walking svg { animation: bob .28s ease-in-out infinite alternate; }
@keyframes legA { from { transform: rotate(22deg); } to { transform: rotate(-22deg); } }
@keyframes legB { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes bob { to { transform: translateY(-3px); } }
.collector .led { animation: blink .5s steps(2) infinite; }
.collector .led.b { animation-delay: .25s; }
@keyframes blink { 50% { opacity: .2; } }
.collector-bubble { position: absolute; left: 64px; top: 4px; background: #fff; color: #111; font-weight: 700; font-size: 13px; padding: 8px 12px; border-radius: 12px;
  white-space: nowrap; opacity: 0; transform: scale(.6); transform-origin: left center; transition: opacity .15s, transform .2s cubic-bezier(.3,1.6,.5,1); }
.collector-bubble.show { opacity: 1; transform: scale(1); }
.collector-bubble b { color: #d61f1f; }
.collector-bubble small { display: block; color: #666; font-weight: 600; font-size: 11px; }
.collector-bubble::before { content: ""; position: absolute; left: -7px; top: 14px; border: 7px solid transparent; border-left: 0; border-right-color: #fff; }
.collector.leaving .collector-bubble { display: none; }
.float-minus { position: fixed; z-index: 305; color: var(--red); font-weight: 800; font-size: 18px; pointer-events: none; animation: floatDown 1.2s ease-out forwards; text-shadow: 0 2px 6px #000; }
@keyframes floatDown { from { transform: translateY(0); opacity: 1; } to { transform: translateY(60px); opacity: 0; } }
.debt-pill { background: #3a1418; color: #ff8a8a; border: 1px solid #ff4e4e55; padding: 7px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.debt-pill span { margin-left: 4px; }

/* ---------- Modal / contract ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(4,10,15,.75); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 200; padding: 16px; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { background: var(--panel); border-radius: 16px; padding: 24px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .25s; }
.modal.contract { background: #f6efdc; color: #2b2418; font-family: Georgia, "Times New Roman", serif; position: relative; border: 6px double #b8a476; }
.contract h2 { text-align: center; text-transform: uppercase; letter-spacing: 3px; margin: 4px 0 10px; font-size: 22px; }
.contract-seal { position: absolute; right: 18px; top: 14px; font-size: 28px; transform: rotate(12deg); background: #c0392b; border-radius: 50%; width: 56px; height: 56px; display: grid; place-items: center; box-shadow: 0 0 0 4px #e8b4ad; }
.contract-meta { font-style: italic; margin-bottom: 8px; font-size: 14px; padding-right: 60px; }
.contract ol { padding-left: 20px; line-height: 1.55; font-size: 14px; }
.contract li { margin-bottom: 6px; }
.contract li.fine { font-size: 10px; color: #7a6d55; }
.contract .input.inline { display: inline-block; width: auto; padding: 2px 26px 2px 8px; background-color: #fff; color: #2b2418; border-color: #b8a476; font-family: inherit; }
.sig-label { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin: 10px 0 6px; font-size: 13px; }
.sig-label .btn { color: #2b2418; border-color: #b8a476; font-family: Inter, sans-serif; }
.sig-pad { width: 100%; height: 120px; background: #fffdf5 linear-gradient(transparent 85%, #b8a47688 85%, #b8a47688 86%, transparent 86%); border: 1px dashed #b8a476; border-radius: 8px; touch-action: none; cursor: crosshair; display: block; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; font-family: Inter, sans-serif; }
.contract .modal-actions .btn.ghost { color: #2b2418; border-color: #b8a476; }

/* ---------- History ---------- */
.input.inline { width: auto; display: inline-block; padding: 6px 30px 6px 10px; }
.hist-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.hist-head h2 { margin: 0; margin-right: auto; }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; cursor: pointer; }
.check input { accent-color: var(--green); }
.hist-wrap { max-height: 520px; overflow-y: auto; }
.bal-svg { width: 100%; height: 220px; display: block; }
.bal-range { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 6px; }

/* ---------- Roulette ---------- */
.chip-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.rchip { aspect-ratio: 1; border-radius: 50%; font-weight: 800; font-size: 12px; color: #fff; border: 3px dashed rgba(255,255,255,.6); box-shadow: 0 3px 0 rgba(0,0,0,.35); transition: transform .1s; }
.rchip.active { transform: translateY(-3px) scale(1.08); box-shadow: 0 0 0 3px #fff, 0 6px 0 rgba(0,0,0,.35); }
.rchip.c1 { background: #8a9aa6; } .rchip.c5 { background: #d63a3a; } .rchip.c10 { background: #1f6fd6; }
.rchip.c25 { background: #1a9a4a; } .rchip.c100 { background: #222; } .rchip.c500 { background: #8a3ad6; }
.rwheel { width: 280px; height: 280px; max-width: 100%; }
.rboard { display: grid; grid-template-columns: minmax(0, 1.1fr) repeat(12, minmax(0, 1fr)) minmax(0, 1.2fr); grid-template-rows: repeat(3, 44px) 38px 38px; gap: 3px; width: 100%; max-width: 760px; }
.rcell { position: relative; min-width: 0; padding: 0; overflow: visible; border-radius: 5px; font-weight: 800; font-size: 14px; color: #fff; background: #0f5a2c; border: 1px solid #ffffff22; transition: filter .1s; }
.rcell:hover { filter: brightness(1.25); }
.rcell.red { background: #c8102e; } .rcell.black { background: #1d1d1d; } .rcell.green { background: #0f8a3c; }
.rcell.out { background: #155c33; font-size: 12px; }
.rcell.swatch span { display: inline-block; width: 26px; height: 16px; border-radius: 3px; font-size: 0; vertical-align: middle; }
.rcell.swatch.red span { background: #e01e3c; } .rcell.swatch.black span { background: #111; outline: 1px solid #666; }
.rcell.winner { outline: 3px solid var(--gold); animation: pop .3s; z-index: 1; box-shadow: 0 0 18px #ffc94a; }
.bchip { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); min-width: 26px; height: 26px; padding: 0 4px; border-radius: 13px; background: var(--gold); color: #2a1d00;
  font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px dashed #fff; box-shadow: 0 3px 6px rgba(0,0,0,.5); pointer-events: none; }
.history .h.rn-red { background: #c8102e; color: #fff; }
.history .h.rn-black { background: #1d1d1d; color: #fff; }
.history .h.rn-green { background: #0f8a3c; color: #fff; }

/* ---------- Slots ---------- */
.paytable, .pk-table { display: flex; flex-direction: column; gap: 3px; background: var(--input); border-radius: 8px; padding: 8px; }
.pt-row, .pk-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 6px; border-radius: 5px; }
.pt-row b, .pk-row b { font-variant-numeric: tabular-nums; }
.pk-row.hit { background: var(--green); color: #05220a; }
.slots-cabinet { background: linear-gradient(180deg, #7a1fa2, #3d0c5a); padding: 16px 18px 18px; border-radius: 22px; box-shadow: 0 0 0 4px #ffc94a, 0 20px 50px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.slots-top { font-weight: 900; letter-spacing: 3px; color: var(--gold); text-shadow: 0 0 12px #ffc94a; font-size: 18px; }
.slots { position: relative; display: flex; gap: 10px; background: #12051a; padding: 10px; border-radius: 14px; }
.reel { width: 104px; height: 288px; overflow: hidden; background: linear-gradient(180deg, #ddd 0%, #fff 30%, #fff 70%, #ddd 100%); border-radius: 10px; position: relative; }
.reel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), transparent 30%, transparent 70%, rgba(0,0,0,.35)); pointer-events: none; }
.strip { will-change: transform; }
.sym { height: 96px; display: grid; place-items: center; font-size: 54px; }
.payline { position: absolute; left: 4px; right: 4px; top: 50%; height: 96px; transform: translateY(-50%); border: 3px solid #ffc94a55; border-radius: 8px; z-index: 2; pointer-events: none; transition: border-color .2s, box-shadow .2s; }
.slots.win .payline { border-color: var(--green); box-shadow: 0 0 22px var(--green); }
.slots.big .payline { border-color: var(--gold); box-shadow: 0 0 30px var(--gold); }
.slots-msg { font-weight: 800; color: #fff; min-height: 20px; }

/* ---------- Wheel ---------- */
.wheel-canvas { width: 320px; height: 320px; max-width: 100%; }
.wheel-legend { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; width: 100%; max-width: 560px; }
.wl { flex: 1; min-width: 70px; background: var(--panel-2); border-top: 4px solid; border-radius: 6px; padding: 8px 6px; text-align: center; font-weight: 800; font-size: 13px; }
.wl small { display: block; color: var(--muted); font-weight: 600; font-size: 11px; }
.wl.hit { background: #2f4f3f; box-shadow: 0 0 0 2px var(--green); }

/* ---------- Coin flip ---------- */
.coin-wrap { perspective: 800px; }
.flipcoin { width: 170px; height: 170px; position: relative; transform-style: preserve-3d; }
.flipcoin .face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; font-size: 76px; backface-visibility: hidden;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #f2c230 45%, #b8860b 100%); box-shadow: inset 0 0 0 8px #d9a420, inset 0 0 0 11px #f7d968, 0 12px 30px rgba(0,0,0,.45); }
.flipcoin .tails { transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #f1f4f6, #b9c4cc 45%, #6f7d87 100%); box-shadow: inset 0 0 0 8px #9aa8b1, inset 0 0 0 11px #dfe6ea, 0 12px 30px rgba(0,0,0,.45); }
.flip-label { font-weight: 800; font-size: 20px; }
.flip-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: 520px; }
.fdot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.fdot.win { background: var(--green); color: #05220a; }
.fdot.lose { background: var(--red); }

/* ---------- Video poker ---------- */
.pk-hand { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.pk-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; transition: transform .15s; }
.pk-slot.clickable { cursor: pointer; }
.pk-slot.clickable:hover { transform: translateY(-4px); }
.pk-slot.held { transform: translateY(-12px); }
.pk-slot.held .card { box-shadow: 0 0 0 3px var(--gold), 0 10px 24px rgba(0,0,0,.5); }
.pk-held { font-weight: 800; font-size: 12px; letter-spacing: 1px; color: var(--gold); visibility: hidden; }
.pk-slot.held .pk-held { visibility: visible; }
.pk-rank { font-size: 22px; font-weight: 800; min-height: 30px; text-align: center; }

@media (max-width: 900px) {
  .game { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .slots-cabinet { padding: 12px; }
  .slots { gap: 6px; padding: 6px; }
  .wheel-canvas { width: 280px; height: 280px; }
  .rboard { grid-template-rows: repeat(3, 34px) 32px 32px; gap: 2px; }
  .rcell { font-size: 10px; }
  .rcell.out { font-size: 9px; }
  .rcell.swatch span { width: 14px; height: 10px; }
  .bchip { min-width: 20px; height: 20px; font-size: 9px; }
  .reel { width: 78px; height: 216px; }
  .sym { height: 72px; font-size: 40px; }
  .payline { height: 72px; }
  .flipcoin { width: 130px; height: 130px; }
  .flipcoin .face { font-size: 58px; }
  .pk-hand { gap: 6px; }
  .pk-hand .card.big { width: 60px; height: 86px; }
  .pk-hand .card.big .cr { font-size: 18px; }
  .pk-hand .card.big .cs { font-size: 26px; }
  .debt-pill { padding: 6px 8px; font-size: 12px; }
}
