/* Slot machine lesson. All rules scoped under .sm-* */
:root { --sm-h: 52px; }

/* three-reel machine */
.sm-machine { display: flex; flex-direction: column; gap: 8px; }
.sm-rng {
  display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px;
  background: #06080f; border: 1px solid var(--line); font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.sm-rng.on { display: flex; animation: copyIn .3s both; }
.sm-rng .lbl { font-family: var(--sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.sm-rng .num { font-size: 22px; color: var(--mint); letter-spacing: .04em; }
.sm-rng.frozen .num { color: var(--gold); text-shadow: 0 0 14px rgba(252,192,80,.7); }
.sm-rng .stamp { font-family: var(--sans); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); border: 1.5px solid var(--gold); padding: 3px 7px; border-radius: 6px; opacity: 0; transform: scale(1.6) rotate(-8deg); }
.sm-rng.frozen .stamp { animation: smStamp .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes smStamp { to { opacity: 1; transform: rotate(-6deg); } }
.sm-reels {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; border-radius: 18px;
  background: linear-gradient(180deg, #2a1c5e, #170f3a); border: 2px solid rgba(252,192,80,.5); box-shadow: inset 0 0 0 4px #0d0a24, 0 10px 30px rgba(0,0,0,.5);
}
.sm-reels .reel { height: calc(var(--sm-h) * 3); border-radius: 10px; background: #f6efe2; overflow: hidden; position: relative; box-shadow: inset 0 10px 14px rgba(0,0,0,.28), inset 0 -10px 14px rgba(0,0,0,.28); }
.sm-reels .strip { position: absolute; left: 0; right: 0; top: 0; transition: transform 1.1s cubic-bezier(.15,.9,.25,1); }
.sm-reels .sym { height: var(--sm-h); display: grid; place-items: center; font-size: 28px; font-weight: 900; font-family: var(--sans); color: #1b1b1b; line-height: 1; }
.sm-reels .sym.seven { color: #d43a2a; font-size: 38px; text-shadow: 2px 2px 0 #f9d976; }
.sm-reels .sym.bar span { font-size: 13px; letter-spacing: .06em; background: linear-gradient(#111, #333); color: #f4d27a; padding: 4px 7px; border-radius: 4px; }
.sm-reels .reel::before, .sm-reels .reel::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: rgba(212,58,42,.4); pointer-events: none; }
.sm-reels .reel::before { top: var(--sm-h); } .sm-reels .reel::after { top: calc(var(--sm-h) * 2); }
.sm-marq { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 13px; color: var(--dim); padding: 0 4px; font-variant-numeric: tabular-nums; min-height: 18px; }
.sm-marq b { color: var(--gold); }
.sm-marq .lose { color: #FF8A8A; }
.btn.sm-spin {
  min-height: 60px; border-radius: 20px; font-size: 19px; letter-spacing: .1em;
  background: radial-gradient(circle at 50% 30%, #ff6b5b, #c62a1c 70%); color: #fff; box-shadow: 0 7px 0 #7a1810, 0 12px 30px rgba(198,42,28,.35);
}
.btn.sm-spin:active { box-shadow: 0 2px 0 #7a1810; }

/* the map: numbers dealt to twelve stops, then a hundred landings */
.sm-map { display: flex; flex-direction: column; gap: 4px; }
.sm-map .cap { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); min-height: 14px; transition: opacity .3s; }
.sm-map .cap.down { text-align: right; }
.sm-map .cap.hide { opacity: 0; }
.sm-map .bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; height: 84px; }
.sm-map .bars .col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; min-width: 0; }
.sm-map .bars.down .col { justify-content: flex-start; }
.sm-map .bars .col i { display: block; width: 100%; height: 0; border-radius: 4px 4px 0 0; background: var(--gold); transition: height .12s; }
.sm-map .bars.down .col i { border-radius: 0 0 4px 4px; background: var(--violet-bright); }
.sm-map .bars .col b { font-family: var(--mono); font-size: 12px; color: var(--dim); line-height: 1; font-variant-numeric: tabular-nums; }
.sm-map .strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; background: #f6efe2; border-radius: 10px; padding: 4px; }
.sm-map .strip .st { height: 30px; border-radius: 5px; display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #1b1b1b; background: #fff; border: 1px solid rgba(0,0,0,.08); line-height: 1; }
.sm-map .strip .st.gap { background: #efe7d6; }
.sm-map .strip .st.seven { color: #d43a2a; font-size: 17px; }
.sm-map .strip .st.bar { font-size: 12px; letter-spacing: -.04em; }
.sm-map .bars.up .col.near i { background: var(--violet-bright); }
.sm-map .bars.up .col.near b { color: var(--violet-bright); }
.sm-map .strip .st.hit { animation: smHit .3s ease-out; }
@keyframes smHit { 0% { background: var(--gold); transform: scale(1.12); } }
.sm-tally { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 700; color: var(--dim); padding-top: 4px; min-height: 22px; }
.sm-tally b { font-family: var(--mono); color: var(--text); font-size: 14px; }
.sm-tally .n { color: var(--violet-bright); }

/* balance trace */
.sm-trace { width: 100%; max-width: 320px; height: auto; display: block; }
.sm-trace .ax { stroke: var(--line-strong); stroke-width: 1; }
.sm-trace text { fill: var(--faint); font: 700 13px var(--mono); }
.sm-trace .p { fill: none; stroke: var(--mint); stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: smDash 1.6s .1s ease-out forwards; }
@keyframes smDash { to { stroke-dashoffset: 0; } }
.sm-trace .you { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 4 3; }
.sm-trace .youl { fill: var(--gold); }
.sm-trace .end { fill: var(--text); text-anchor: end; }

/* video slot: fifteen cells, twenty lines */
.sm-video { display: flex; flex-direction: column; gap: 8px; }
.sm-video .grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 8px; border-radius: 16px; background: linear-gradient(180deg, #2a1c5e, #170f3a); border: 2px solid rgba(252,192,80,.5); position: relative; }
.sm-video .c { height: 54px; border-radius: 8px; background: #f6efe2; display: grid; place-items: center; font-size: 24px; font-weight: 900; font-family: var(--sans); color: #1b1b1b; line-height: 1; transition: background .2s, box-shadow .2s; }
.sm-video.small .c { height: 44px; font-size: 20px; }
.sm-video .c.seven { color: #d43a2a; font-size: 28px; }
.sm-video .c.bar span { font-size: 12px; letter-spacing: .04em; background: linear-gradient(#111, #333); color: #f4d27a; padding: 3px 5px; border-radius: 4px; }
.sm-video .c.lit { background: #ffe9a8; box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(252,192,80,.8); }
.sm-video .c.spin { animation: smBlur .4s linear infinite; }
@keyframes smBlur { 0% { filter: blur(0); } 50% { filter: blur(3px); transform: translateY(3px); } }
.sm-video .banner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.sm-video .banner.on { animation: smBanner .45s cubic-bezier(.34,1.56,.64,1) both; }
.sm-video .banner.flash { animation: smFlash .22s ease-out both; }
@keyframes smBanner { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes smFlash { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.sm-video .banner b { font-family: var(--sans); font-size: 38px; font-weight: 900; color: var(--gold); -webkit-text-stroke: 2px #6b3d00; text-shadow: 0 6px 0 #6b3d00, 0 0 30px rgba(252,192,80,.9); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sm-video.small .banner b { font-size: 30px; }
.sm-video .marq-n b { color: var(--gold); }
.sm-video .marq-n { font-family: var(--mono); font-size: 12px; color: var(--faint); text-align: center; min-height: 16px; font-variant-numeric: tabular-nums; }

/* the take */
.sm-take { display: flex; flex-direction: column; gap: 12px; }

/* the night's count */
.sm-count { display: flex; flex-direction: column; gap: 8px; }
.sm-count .r { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--dim); animation: cardIn .25s both; }
.sm-count .r b { font-family: var(--mono); font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.sm-count .r.music b { color: var(--gold); }
.sm-count .r.wins b { color: var(--mint); }
.sm-count .r.bal b, .sm-count .r.ldw b { color: #FF8A8A; }
.sm-count .r { padding: 8px 14px; }

/* the first spin again */
.sm-first { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.sm-fl { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); text-align: center; }
.sm-fr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; border-radius: 18px; background: linear-gradient(180deg, #2a1c5e, #170f3a); border: 2px solid rgba(252,192,80,.5); }
.sm-fr span { display: grid; grid-template-rows: 48px 56px; border-radius: 10px; background: #f6efe2; overflow: hidden; }
.sm-fr i, .sm-fr b { display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 28px; color: #1b1b1b; line-height: 1; }
.sm-fr i { opacity: .55; }
.sm-fr b { border-top: 2px solid rgba(212,58,42,.5); }
.sm-fr .seven { color: #d43a2a; font-size: 36px; }
.sm-fr span:last-child i { opacity: 1; box-shadow: inset 0 0 0 3px var(--gold); }

@media (max-height: 700px) {
  :root { --sm-h: 42px; }
  .sm-reels .sym { font-size: 24px; } .sm-reels .sym.seven { font-size: 32px; }
  .sm-map .bars { height: 56px; } .sm-map .strip .st { height: 26px; }
  .sm-video .c { height: 44px; font-size: 20px; } .sm-video.small .c { height: 36px; font-size: 17px; }
}
