/* ============================================================
   The Gambler (Keep tab, js/gamble.js). Everything is prefixed .gmb-
   ============================================================ */
.gmb-root { display: flex; flex-direction: column; gap: 16px; }
.gmb-small { font-size: 12px; margin-top: 4px; }
.gmb-lbl { color: #b8a27a; font-size: 13px; min-width: 40px; }
.gmb-center { justify-content: center; }

/* ---------- Nell Ninefingers ---------- */
.gmb-npc { flex: 1 1 300px; max-width: 420px; }
.gmb-npc h2 .muted { font-size: 13px; font-style: italic; letter-spacing: 0; }
.gmb-npcrow { display: flex; gap: 12px; align-items: center; }
.gmb-portrait { width: 120px; height: 140px; flex: none; border: 1px solid #5a4428; border-radius: 6px; box-shadow: inset 0 0 18px #000, 0 0 14px rgba(255,160,60,.12); }
.gmb-eye { animation: gmb-blink 6s infinite; }
.gmb-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: gmb-flicker .9s ease-in-out infinite alternate; }
.gmb-pcoin { animation: gmb-glint 3.2s ease-in-out infinite; }
@keyframes gmb-blink { 0%, 95%, 100% { opacity: 1; } 97% { opacity: .08; } }
@keyframes gmb-flicker { from { transform: scaleY(1) skewX(-3deg); } to { transform: scaleY(1.18) skewX(4deg); } }
@keyframes gmb-glint { 50% { fill: #fff2b0; } }
.gmb-bubble {
  position: relative; flex: 1; padding: 10px 12px; font-style: italic; font-size: 14px; line-height: 1.45; color: #f0dfb8;
  background: #1a130d; border: 1px solid #6a5232; border-radius: 8px; box-shadow: inset 0 0 12px #000;
}
.gmb-bubble::before { content: ''; position: absolute; left: -8px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-left: 0; border-right-color: #6a5232; }
.gmb-lore { font-size: 13px !important; font-style: italic; }
.gmb-log { list-style: none; margin: 0 !important; font-size: 13px !important; }
.gmb-log li { padding: 3px 0; border-bottom: 1px solid #2a2016; }

/* ---------- gear gambling ---------- */
.gmb-gear { flex: 2 1 600px; }
.gmb-pickrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.gmb-pickrow .btn { padding: 4px 11px; font-size: 13px; }
.gmb-gearbody { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; margin-top: 10px; }
.gmb-odds { flex: 1 1 430px; width: auto; }
.gmb-odds th { vertical-align: bottom; }
.gmb-odds th b { color: #f0d9a8; font-size: 14px; }
.gmb-odds th .muted { font-size: 11.5px; }
.gmb-odds td small { font-size: 11px; white-space: nowrap; }
.gmb-odds .gmb-tr5 td, .gmb-odds .gmb-tr6 td, .gmb-odds .gmb-tr7 td { background: rgba(255,157,46,.04); }
.gmb-odds .gmb-sum td { color: #ffcf8a; font-size: 12px; }
.gmb-odds .gmb-price td { font-size: 14px; }

/* the reveal stage */
.gmb-stage { position: relative; display: flex; align-items: center; justify-content: center; }
.gmb-gstage {
  flex: 0 0 230px; min-height: 230px; flex-direction: column; gap: 6px; padding: 12px; overflow: hidden; text-align: center;
  background: radial-gradient(ellipse at 50% 55%, #241a11, #0d0907 75%); border: 1px solid #4a3822; border-radius: 8px;
  box-shadow: inset 0 0 30px #000;
}
.gmb-gstage.gmb-g5, .gmb-gstage.gmb-g6, .gmb-gstage.gmb-g7 { box-shadow: inset 0 0 40px color-mix(in srgb, var(--tc) 35%, transparent), inset 0 0 30px #000; }
.gmb-gstage.gmb-g7 { animation: holy-edge 3s linear infinite; }
.gmb-shroud {
  width: 80px; height: 90px; display: flex; align-items: center; justify-content: center; font-size: 34px; color: #2a1d10; font-weight: bold;
  background: radial-gradient(ellipse at 40% 30%, #a0805a, #5a4228 70%); border-radius: 42% 42% 30% 30% / 30% 30% 50% 50%;
  box-shadow: 0 6px 14px #000, inset 0 -8px 16px rgba(0,0,0,.5);
}
.gmb-shroud.anim {
  position: absolute; left: 50%; top: 50%; margin: -45px 0 0 -40px; z-index: 3;
  animation: gmb-shake 1.25s ease-in both, gmb-fadeout .25s ease-in both;
}
@keyframes gmb-shake {
  0% { transform: rotate(0) scale(1); }
  10% { transform: rotate(-6deg); } 20% { transform: rotate(6deg); } 30% { transform: rotate(-8deg) scale(1.03); }
  40% { transform: rotate(8deg); } 50% { transform: rotate(-11deg) scale(1.06); } 60% { transform: rotate(11deg); }
  70% { transform: rotate(-14deg) scale(1.1); } 80% { transform: rotate(14deg) translateY(-3px); } 90% { transform: rotate(-16deg) scale(1.14); }
  100% { transform: rotate(0) scale(1.18); }
}
@keyframes gmb-fadeout { to { opacity: 0; transform: scale(1.5); filter: blur(3px); } }
.gmb-burst {
  position: absolute; left: 50%; top: 42%; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, var(--tc) 0%, transparent 65%);
  animation: gmb-burst .9s ease-out both;
}
.gmb-g5 .gmb-burst, .gmb-g6 .gmb-burst {
  width: 260px; height: 260px; margin: -130px 0 0 -130px;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc) 70%, transparent) 0 8deg, transparent 8deg 22deg), radial-gradient(circle, var(--tc), transparent 60%);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation-duration: 1.4s;
}
.gmb-g7 .gmb-burst {
  width: 320px; height: 320px; margin: -160px 0 0 -160px;
  background: conic-gradient(#ff4a4a, #ffb02a, #fff04a, #4aff7a, #4ad8ff, #7a6aff, #ff4ad8, #ff4a4a);
  -webkit-mask: repeating-conic-gradient(#000 0 7deg, transparent 7deg 15deg), radial-gradient(circle, #000 25%, transparent 70%);
  mask: radial-gradient(circle, #000 25%, transparent 70%);
  animation-duration: 2.2s;
}
@keyframes gmb-burst { 0% { transform: scale(.15) rotate(0); opacity: 1; } 70% { opacity: .85; } 100% { transform: scale(1.6) rotate(40deg); opacity: 0; } }
.gmb-reveal { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 4px; animation: gmb-pop .5s cubic-bezier(.2,1.6,.4,1) both; }
.gmb-reveal .item-cell { width: 58px; height: 58px; }
.gmb-reveal .item-cell img { width: 52px; height: 52px; }
@keyframes gmb-pop { 0% { opacity: 0; transform: scale(.3); } 100% { opacity: 1; transform: scale(1); } }
.gmb-iname { font-size: 16px; letter-spacing: 1px; text-shadow: 0 0 10px currentColor; }

/* ---------- games ---------- */
.gmb-games { padding: 14px 16px; }
.gmb-stake { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.gmb-stake .btn { padding: 4px 10px; font-size: 13px; }
.gmb-stake input {
  width: 92px; padding: 5px 8px; font-size: 15px; color: #ffe6b0; text-align: right; user-select: text;
  background: #120d09; border: 1px solid #6a5232; border-radius: 3px; box-shadow: inset 0 0 6px #000;
}
.gmb-stake input:focus { outline: 1px solid #ffb25a; }
.gmb-stake .gmb-small { flex-basis: 100%; margin-top: 2px; }
.gmb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px; }
.gmb-game { background: #17110c; border: 1px solid #4a3822; border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.gmb-game h3 { margin: 0 !important; font-size: 17px !important; letter-spacing: 1px; color: #ffcf8a !important; }
.gmb-rules { font-size: 13px !important; margin: 0 !important; }
.gmb-ot { font-size: 12.5px; }
.gmb-ot td, .gmb-ot th { padding: 3px 6px; }
.gmb-ot tr.gmb-lit td { background: rgba(255,215,106,.12); color: #ffe6b0; }
.gmb-res { min-height: 40px; text-align: center; font-size: 14px; padding: 6px 4px; border-radius: 4px; }
.gmb-res.win { background: rgba(143,224,138,.07); }
.gmb-res.lose { background: rgba(255,122,106,.05); }

/* coin */
.gmb-cstage { height: 140px; perspective: 600px; }
.gmb-coinwrap.anim { animation: gmb-toss 1.7s ease-in-out both; }
@keyframes gmb-toss {
  0% { transform: translateY(0) scale(1); } 40% { transform: translateY(-44px) scale(1.2); }
  82% { transform: translateY(0) scale(1); } 90% { transform: translateY(-7px); } 100% { transform: translateY(0) scale(1); }
}
.gmb-coin { position: relative; width: 78px; height: 78px; transform-style: preserve-3d; }
.gmb-coin.anim { animation: gmb-flip 1.7s cubic-bezier(.25,.55,.25,1) both; }
@keyframes gmb-flip { from { transform: rotateY(var(--from)); } to { transform: rotateY(var(--to)); } }
.gmb-face {
  position: absolute; inset: 0; border-radius: 50%; backface-visibility: hidden; display: flex; align-items: center; justify-content: center;
  font-size: 38px; border: 3px solid #a8862a; box-shadow: inset 0 0 0 3px #e8c04a, inset 0 0 14px rgba(0,0,0,.45), 0 0 16px rgba(255,200,80,.35);
}
.gmb-face.sun { background: radial-gradient(circle at 38% 34%, #fff0a8, #e8b438 55%, #9a6a14); color: #7a4a08; transform: translateZ(3px); }
.gmb-face.moon { background: radial-gradient(circle at 38% 34%, #e8e4f0, #9a98b0 55%, #4a4860); color: #2a2840; border-color: #6a6880; transform: rotateY(180deg) translateZ(3px); }
.gmb-rim { position: absolute; left: 50%; top: 4%; width: 6px; height: 92%; margin-left: -3px; border-radius: 3px; background: linear-gradient(#e8c04a, #8a6a1a); transform: rotateY(90deg); }

/* dice */
.gmb-dstage { height: 140px; gap: 18px; }
.gmb-dside { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gmb-dlbl { font-size: 13px; color: #b8a27a; }
.gmb-dlbl b { color: #fff0d0; font-size: 18px; margin-left: 4px; }
.gmb-dice { display: flex; gap: 8px; }
.gmb-dstage.anim .gmb-dice { animation: gmb-rattle .28s linear infinite; }
.gmb-dstage.anim .gmb-dside:last-child .gmb-dice { animation-direction: reverse; }
@keyframes gmb-rattle { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-3px, -7px) rotate(-12deg); } 50% { transform: translate(2px, 0) rotate(8deg); } 75% { transform: translate(3px, -5px) rotate(14deg); } 100% { transform: translate(0, 0) rotate(0); } }
.gmb-die {
  width: 40px; height: 40px; padding: 5px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px;
  background: linear-gradient(145deg, #f2e8d0, #c8b892); border-radius: 8px; box-shadow: 0 3px 6px #000, inset 0 -2px 4px rgba(0,0,0,.25);
}
.gmb-die.house { background: linear-gradient(145deg, #d8c8b0, #9a8466); }
.gmb-die i.on { border-radius: 50%; background: radial-gradient(circle at 40% 35%, #5a2a1a, #1a0a06); }
.gmb-die.house i.on { background: radial-gradient(circle at 40% 35%, #a02a1a, #3a0806); }
.gmb-vs { font-style: italic; color: #8a7c63; }

/* wheel */
.gmb-wstage { width: 210px; height: 210px; margin: 8px auto 2px; }
.gmb-wheel {
  position: absolute; inset: 0; border-radius: 50%; border: 4px solid #8a6a3e;
  box-shadow: 0 0 0 2px #2e2316, 0 6px 18px #000, inset 0 0 24px rgba(0,0,0,.65);
}
.gmb-wheel.anim { animation: gmb-spin 3.4s cubic-bezier(.12,.6,.08,1) both; }
@keyframes gmb-spin { from { transform: rotate(var(--from)); } to { transform: rotate(var(--to)); } }
.gmb-wl { position: absolute; left: 50%; top: 0; width: 30px; height: 50%; margin-left: -15px; transform-origin: 50% 100%; text-align: center; padding-top: 7px; pointer-events: none; }
.gmb-wl b { display: inline-block; font-size: 11px; }
.gmb-wl b.z { color: #6a5a48; }
.gmb-wl b.m { color: #fff3d6; text-shadow: 0 1px 2px #000; }
.gmb-pointer {
  position: absolute; left: 50%; top: -10px; margin-left: -10px; z-index: 2; width: 0; height: 0;
  border: 10px solid transparent; border-top: 22px solid #ffd76a; border-bottom: 0; filter: drop-shadow(0 2px 3px #000);
}
.gmb-hub { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; z-index: 1; background: radial-gradient(circle at 40% 35%, #ffe08a, #8a5a1a); box-shadow: 0 0 10px #000; }
