﻿/* Lunchbanditen (/banditen): a red and gold slot machine with three reels. Only this page loads this file;
   js/banditen.js turns the reels. */

/* the reels' font: every letter equally wide, so the three parts of a name join up (SIL Open Font License) */
@font-face {
    font-family: 'Courier Prime';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/courier-prime-latin-700.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Courier Prime';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/courier-prime-latin-ext-700.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.banditpg { --brass: #e9cf8e; padding: 34px 0 80px; }
.banditpg h1 { font: 800 42px/1.05 var(--serif); letter-spacing: -.02em; margin: 6px 0 0; }
.banditpg .lead { font-size: 17px; color: var(--ink-2); max-width: 62ch; margin: 10px 0 0; }
.banditpg .stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; margin-top: 26px; }
.banditpg .visual { display: grid; place-items: center; min-width: 0; }
.banditpg .panel { display: grid; gap: 14px; min-width: 0; }
.banditpg .go { margin-top: 0; }
.banditpg .go:disabled { opacity: .6; cursor: default; }
.banditpg .opt { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; cursor: pointer; padding: 0 2px; margin: 0; }
.banditpg .opt input { width: 18px; height: 18px; accent-color: var(--olive); margin-top: 1px; flex: none; }
.banditpg .opt small { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.banditpg .result { background: var(--card); border: 1px solid var(--olive); border-radius: var(--radius); padding: 20px; box-shadow: inset 4px 0 0 var(--olive), var(--shadow); }
.banditpg .result .nm { font: 800 32px/1.1 var(--serif); margin: 4px 0 6px; overflow-wrap: break-word; hyphens: auto; }
.banditpg .result .meta { font-size: 13px; color: var(--ink-2); }
.banditpg .result p { margin: 10px 0 0; }
.banditpg .result a { font-weight: 700; }
.banditpg .result.pop { animation: bd-pop .45s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes bd-pop { from { transform: scale(.94); opacity: 0; } }

/* ---------- the machine ---------- */
.banditpg .machine { position: relative; width: min(680px, 100%); background: radial-gradient(circle at 50% 0, #b8321f, #7a1a10 75%); border-radius: 26px; padding: 16px 86px 22px 20px;
    box-shadow: 0 0 0 5px var(--brass), 0 0 0 8px #7a1a10, 0 26px 44px -22px #2b2420cc; }
.banditpg .marquee { position: relative; background: #1b1210; border: 3px solid var(--brass); border-radius: 16px; padding: 16px 10px 14px; text-align: center; margin: 0 0 16px; }
.banditpg .marquee b { display: block; font: 900 italic 36px/1 var(--serif); color: #ffd76a; letter-spacing: .06em; text-shadow: 0 0 14px #ffb300aa, 0 3px 0 #7a1a10; }
.banditpg .marquee small { display: block; color: #f3d9a0; font: 700 10px var(--sans); letter-spacing: .32em; text-transform: uppercase; margin-top: 6px; }
.banditpg .frame { position: relative; padding: 18px; border-radius: 20px; background: #1b1210; border: 3px solid var(--brass); }

/* the bulbs chase each other round the sign and the window, faster while the reels spin, and flash at a win */
.banditpg .bulbs { position: absolute; display: flex; justify-content: space-between; pointer-events: none; }
.banditpg .bulbs.t { top: 5px; left: 14px; right: 14px; }
.banditpg .bulbs.b { bottom: 5px; left: 14px; right: 14px; }
.banditpg .bulbs.l { left: 5px; top: 14px; bottom: 14px; flex-direction: column; }
.banditpg .bulbs.r { right: 5px; top: 14px; bottom: 14px; flex-direction: column; }
.banditpg .marquee .bulbs.t { top: 4px; }
.banditpg .marquee .bulbs.b { bottom: 4px; }
.banditpg .bulbs i { width: 8px; height: 8px; border-radius: 50%; animation: bd-chase 1.2s steps(1) infinite; }
.banditpg .bulbs i:nth-child(3n+2) { animation-delay: -.4s; }
.banditpg .bulbs i:nth-child(3n) { animation-delay: -.8s; }
.banditpg .spinning .bulbs i { animation-duration: .36s; }
.banditpg .spinning .bulbs i:nth-child(3n+2) { animation-delay: -.12s; }
.banditpg .spinning .bulbs i:nth-child(3n) { animation-delay: -.24s; }
.banditpg .won .bulbs i { animation: bd-flash .3s steps(2) 6; background: #fff2b8; box-shadow: 0 0 8px #ffd76a; }
@keyframes bd-chase { 0% { background: #fff2b8; box-shadow: 0 0 8px #ffd76a; } 33.3%, 100% { background: #6b4a1c; box-shadow: none; } }
@keyframes bd-flash { 50% { background: #6b4a1c; box-shadow: none; } }

/* three reels side by side, joined into one window */
.banditpg .wins { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 14px; overflow: hidden; container-type: inline-size;
    background: var(--card); box-shadow: inset 0 0 0 3px var(--gold); }
.banditpg .reel { position: relative; height: 340px; overflow: hidden; perspective: 900px; }
.banditpg .reel + .reel { border-left: 2px solid #8d6b2088; }
.banditpg .reel.stop { animation: bd-clunk .28s ease-out; }
@keyframes bd-clunk { 30% { transform: translateY(4px); } }
.banditpg .drum { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(-181px); }
/* seven letters per reel (Courier Prime's letters are .6 em wide), so the three parts join into one name */
.banditpg .row { position: absolute; left: 0; right: 0; top: 50%; height: 64px; margin-top: -32px; text-align: center; white-space: pre; overflow: hidden; backface-visibility: hidden;
    font: 700 calc((100cqw / 3 - 2px) / 4.25)/64px 'Courier Prime', 'Courier New', monospace; color: var(--ink); transition: color .3s; }
.banditpg .won .drum .row:nth-child(5) { color: var(--tomato); }
.banditpg .shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(#5a120bd9, transparent 30%, transparent 70%, #5a120bd9); }
.banditpg .rail { position: absolute; left: -2px; right: -2px; height: 4px; background: linear-gradient(var(--brass), #8d6b20); top: calc(50% - 36px); pointer-events: none; }
.banditpg .rail.b { top: calc(50% + 32px); }
.banditpg .marker { position: absolute; top: 50%; width: 0; height: 0; border: 12px solid transparent; margin-top: -12px; pointer-events: none; }
.banditpg .marker.l { left: 0; border-left-color: var(--tomato); }
.banditpg .marker.r { right: 0; border-right-color: var(--tomato); }
.banditpg .lever { position: absolute; right: 18px; top: 70px; width: 52px; height: 250px; border: 0; background: none; padding: 0; }
.banditpg .lever:disabled { cursor: default; }
.banditpg .lever .arm { transform-origin: 26px 210px; }
.banditpg .lever.pull .arm { animation: bd-pull .7s ease; }
@keyframes bd-pull { 40% { transform: scaleY(-.55); } 100% { transform: none; } }

@media (max-width: 860px) {
    .banditpg .stage { grid-template-columns: 1fr; }
    .banditpg h1 { font-size: 36px; }
}
@media (max-width: 520px) {
    .banditpg .machine { padding: 12px 12px 16px; }
    .banditpg .lever { display: none; }
    .banditpg .marquee b { font-size: 26px; }
    .banditpg .frame { padding: 16px 14px; }
    .banditpg .reel { height: 300px; }
}
@media (prefers-reduced-motion: reduce) {
    .banditpg .bulbs i, .banditpg .won .bulbs i { animation: none; }
}
