/* gambling mode: same look as the rest of the site (black page, white text, dark buttons, grey links) */
body { background: black; color: white; margin: 0; padding: 34px 10px 24px; font-family: sans-serif; text-align: center; }
[hidden] { display: none !important; }
:root { --common: #aaa; --uncommon: #2fbf5a; --rare: #4a90ff; --legendary: #ffc21a; }
.common { color: var(--common); } .uncommon { color: var(--uncommon); } .rare { color: var(--rare); } .legendary { color: var(--legendary); }
#bucks { font-size: 20px; margin: 0; }
#freecount { color: #ccc; }
#bonusbar { color: #777; font-size: 13px; min-height: 1.2em; margin: 2px 0 10px; }
#dextip { margin: -4px 0 10px; }
#dextip a { color: #aaa; }

/* the three reels */
#machine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 620px; margin: 0 auto; }
.reel { position: relative; aspect-ratio: 475 / 562; overflow: hidden; background: #111; border: 2px solid #222;
        border-radius: 4px; cursor: zoom-in; transition: border-color 0.3s, box-shadow 0.3s; }
.strip { position: absolute; top: 0; left: 0; width: 100%; will-change: transform; }
.strip img { display: block; width: 100%; aspect-ratio: 475 / 562; object-fit: cover; background: #111; }
.strip img.final { object-fit: contain; }
/* while spinning: a loop of blurred Brians (the strip holds the same Brians twice, so -50% wraps seamlessly) */
.spinning { cursor: default; }
.spinning .strip { animation: roll 0.3s linear infinite; filter: blur(2px) brightness(0.8); }
@keyframes roll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.stop { transition: transform 0.55s cubic-bezier(0.2, 0.85, 0.3, 1.12); }
.tier { font-size: 13px; margin-top: 5px; min-height: 1.2em; }
.reel.common { border-color: #444; }
.reel.uncommon { border-color: var(--uncommon); }
.reel.rare { border-color: var(--rare); box-shadow: 0 0 10px #4a90ff88; }
.reel.legendary { border-color: var(--legendary); animation: glow 1.1s ease-in-out infinite alternate; }
@keyframes glow { from { box-shadow: 0 0 8px #ffc21a88; } to { box-shadow: 0 0 24px #ffc21a; } }
#row { margin: 14px 0 0; }
/* Spin with a ▾ on its left: the menu under it spins 5, 10 or 100 times in a row */
#spingroup { position: relative; display: inline-flex; vertical-align: middle; }
#spinmore { border-radius: 6px 0 0 6px; padding: 5px 9px; }
#spingroup #spin { border-radius: 0 6px 6px 0; margin-left: -1px; }
#spinmore[aria-expanded="true"] { background: #3a3a3a; color: #fff; }
#spinmenu { position: absolute; top: calc(100% + 5px); left: 0; z-index: 5; display: flex; flex-direction: column; gap: 5px;
            padding: 6px; background: #141414; border: 1px solid #444; border-radius: 8px; box-shadow: 0 6px 20px #000c; }
#spinmenu button { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; white-space: nowrap; min-width: 210px; padding: 7px 10px; }
#spinmenu small { color: #ffc21a; font-size: 12.5px; }
#spinmenu small.free { color: #8c8; }
#spinmenu button:disabled small { color: #666; }
/* after a run: what it cost, the Brians by tier, and the legendaries it won */
#haultext { color: #999; font-size: 13px; margin: 6px 0 0; }
#haulpics { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px auto 0; max-width: 620px; }
#haulpics img { width: 64px; aspect-ratio: 475 / 562; object-fit: cover; border: 2px solid var(--legendary); border-radius: 4px; cursor: zoom-in; background: #111; }

#msg { min-height: 1.2em; margin: 12px 0 0; }
#msg.legendary { color: var(--legendary); }
.right { color: var(--uncommon); }
#small { color: #666; font-size: 13px; margin: 26px 0 0; line-height: 1.7; }
#freeinfo { color: #888; font-size: 13px; min-height: 1.2em; margin: 8px 0 0; }
#bonusmsg { min-height: 1.2em; margin: 4px 0 0; color: var(--legendary); }
#bonuses { margin: 4px auto 0; max-width: 520px; }
#bonuses summary { cursor: pointer; color: #888; width: fit-content; margin: 0 auto; }
#bonuses summary:hover { color: #bbb; }
#bonuslist { list-style: none; padding: 0; margin: 4px 0 0; }

/* dark buttons, same as the site */
button { background: #222; color: #ddd; border: 1px solid #444; border-radius: 6px; padding: 5px 10px; font: 14px sans-serif; cursor: pointer; }
button:hover { background: #2e2e2e; color: #fff; border-color: #555; }
button:active { background: #3a3a3a; }
button:disabled { color: #777; cursor: default; background: #222; border-color: #444; }
button.nudge { border-color: var(--uncommon); color: #fff; }

/* tap a reel to see its Brian big, same as scroll mode */
#big { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92); display: flex; flex-direction: column;
       align-items: center; justify-content: center; gap: 8px; cursor: zoom-out; padding: 10px; box-sizing: border-box; }
#big img { max-width: 96vw; max-height: calc(90vh - 110px); object-fit: contain; }
#bigbar { cursor: default; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
#bigbar button { cursor: pointer; }
#bigwhy { font-size: 13px; margin: 0; max-width: 90vw; }
#retier { cursor: default; color: #777; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
#retier button { font-size: 13px; padding: 4px 8px; }

/* the Brian-Dex and the leaderboard, under the machine */
section { max-width: 700px; margin: 34px auto 0; }
h2 { font: bold 17px sans-serif; margin: 0 0 4px; }
#dextoggle { font-size: 12px; padding: 2px 9px; margin-left: 6px; vertical-align: 2px; color: #aaa; }
.sub { color: #777; font-size: 13px; margin: 0 0 10px; min-height: 1.2em; }
#dq { width: min(100%, 360px); box-sizing: border-box; color-scheme: dark; background: #161616; color: #eee; border: 1px solid #444;
      border-radius: 6px; padding: 7px 10px; font: 16px sans-serif; }  /* 16px: phones don't zoom in on it */
#dq:focus { outline: none; border-color: #777; }
#dexfilter { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
#dexfilter button { font-size: 13px; padding: 4px 10px; color: #999; }
#dexfilter button.on { color: #fff; border-color: #888; background: #2e2e2e; }
#dexfilter button.on[data-tier="common"] { color: var(--common); border-color: var(--common); }
#dexfilter button.on[data-tier="uncommon"] { color: var(--uncommon); border-color: var(--uncommon); }
#dexfilter button.on[data-tier="rare"] { color: var(--rare); border-color: var(--rare); }
#dexfilter button.on[data-tier="legendary"] { color: var(--legendary); border-color: var(--legendary); }
#sellrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
#sellrow button { min-width: 170px; padding: 6px 12px; }
#sellrow small { display: block; font-size: 11px; color: #8c8; margin-top: 2px; }
#sellrow button:disabled small { color: #666; }
#dexmsg, #boardmsg { min-height: 1.2em; margin: 8px 0; font-size: 14px; }
#dexgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.card { position: relative; padding: 0; aspect-ratio: 475 / 562; overflow: hidden; background: #111; border: 2px solid #333; border-radius: 4px; }
.card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card.common { border-color: #444; } .card.uncommon { border-color: var(--uncommon); }
.card.rare { border-color: var(--rare); } .card.legendary { border-color: var(--legendary); }
.card .count { position: absolute; right: 3px; bottom: 3px; padding: 0 5px; border-radius: 8px; background: rgba(0, 0, 0, 0.8);
               color: #fff; font: bold 12px/18px sans-serif; }
.card .lock { position: absolute; right: 3px; top: 3px; padding: 2px 4px; border-radius: 7px; background: rgba(0, 0, 0, 0.85);
              box-shadow: 0 0 0 1px #ffffff55; font-size: 16px; line-height: 20px; }
#dexmore { margin-top: 10px; }
#board { list-style: none; counter-reset: rank; padding: 0; margin: 8px auto; max-width: 480px; text-align: left; }
#board li { counter-increment: rank; display: flex; gap: 8px; padding: 4px 6px; border-bottom: 1px solid #1c1c1c; font-size: 14px; }
#board li::before { content: counter(rank) "."; color: #666; min-width: 2em; }
#board li.empty { color: #666; justify-content: center; }
#board li.empty::before { content: none; }
#board li.head::before { content: ""; }
#board li.you { color: var(--legendary); }
#board .who { flex: 1; overflow-wrap: anywhere; }
#board .amount { font-variant-numeric: tabular-nums; min-width: 4em; text-align: right; }
#board li.head { counter-increment: none; color: #666; font-size: 12px; border-bottom-color: #333; }
#board .dexcol { min-width: 6.5em; }
#board .total { font-weight: bold; }
#board li.head .total { font-weight: normal; }
#board .dexcol small { color: #777; font-size: 12px; }
#boardform { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; font-size: 14px; color: #bbb; }
#boardform label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
#boardon { accent-color: #777; width: 16px; height: 16px; margin: 0; }
#boardname { width: 150px; color-scheme: dark; background: #161616; color: #eee; border: 1px solid #444; border-radius: 6px;
             padding: 5px 8px; font: 16px sans-serif; }
@media (max-width: 440px) { #machine { gap: 5px; } .tier { font-size: 11px; } #dexgrid { grid-template-columns: repeat(3, 1fr); } }

/* Link progress: a small pop-up under the leaderboard's button */
#linkrow { margin: 14px 0 0; }
#linkbox { position: fixed; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center;
           padding: 12px; background: rgba(0, 0, 0, 0.85); }
#linkbox .panel { width: min(100%, 420px); max-height: 92vh; overflow-y: auto; box-sizing: border-box; padding: 16px 18px;
                  background: #161616; border: 1px solid #444; border-radius: 8px; font-size: 14px; }
#linkbox h3 { margin: 0 0 4px; font-size: 17px; }
#linkbox .part { border-top: 1px solid #2a2a2a; padding: 10px 0; }
#linkbox .part p { margin: 0 0 8px; }
#codeout { display: flex; flex-direction: column; gap: 2px; }
#code { font: bold 30px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 3px; color: var(--legendary); user-select: all; }
#codein { width: 130px; color-scheme: dark; background: #0d0d0d; color: #eee; border: 1px solid #444; border-radius: 6px; padding: 6px 8px;
          font: 18px ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; text-align: center; text-transform: uppercase; }
#codewarn { margin-top: 8px; color: #e8b04a; }
#linkmsg { min-height: 1.2em; margin: 8px 0 0 !important; }
#devlist { list-style: none; padding: 0; margin: 0; text-align: left; }
#devlist li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 6px 0; border-bottom: 1px solid #222; }
#devlist .dev { flex: 1 1 100%; }
#devlist .sub { flex: 1; margin: 0; }
#devlist button { font-size: 12px; padding: 3px 8px; }
#bulkrow { margin: 10px 0 0; }
#bulkbtn { font-size: 13px; padding: 4px 12px; color: #bbb; }
#bulkbtn[aria-expanded="true"] { color: #fff; border-color: #888; background: #2e2e2e; }
#bulk { margin: 8px auto 0; padding: 10px; border: 1px solid #333; border-radius: 8px; max-width: 420px; }
#bulk[hidden] { display: none; }
#bulk .row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
#bulk .row button { flex: 1 1 0; min-width: 140px; padding: 6px 10px; }
#bulk small { display: block; font-size: 11px; color: #aaa; margin-top: 2px; }
#bulk .row + .row { margin-top: 8px; }
#bulk .sell small { color: #8c8; }
#bulk button:disabled small { color: #666; }
#autolockrow { display: inline-flex; gap: 6px; align-items: center; margin: 10px 0 0; color: #bbb; font-size: 14px; cursor: pointer; user-select: none; }
#autolock { accent-color: #ffc21a; width: 16px; height: 16px; margin: 0; cursor: pointer; }

#colorrow { margin: 14px auto 0; max-width: 560px; }
#colorrow .sub { margin: 0 0 6px; }
/* the name colour picker: plain, any one colour, or any two as a sliding gradient */
#colormodes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
#colormodes button { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 96px; padding: 5px 10px; }
#colormodes button.on { border-color: #bbb; background: #2a2a2a; color: #fff; }
#colormodes small { color: #888; font-size: 11px; }
#colorpick { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin: 10px 0 0; }
#colorpick .pick { display: inline-flex; align-items: center; gap: 6px; }
#colorpick input[type="color"] { width: 44px; height: 32px; padding: 1px 2px; border: 1px solid #444; border-radius: 6px; background: #222; cursor: pointer; }
.hex { width: 6.2em; box-sizing: border-box; background: #111; color: #ddd; border: 1px solid #444; border-radius: 6px; padding: 6px 8px;
       font: 15px monospace; }
.hex.bad { border-color: #d44; }
#colorpreview { margin: 10px 0 0; font-weight: bold; font-size: 20px; min-height: 1.3em; overflow-wrap: anywhere; }
#colorsave { margin: 8px 0 0; }
/* the icon shop: none, the earned stars (dim until won), then the icons by price */
#iconrow { margin: 18px auto 0; max-width: 560px; }
#iconrow .sub { margin: 0 0 6px; }
#icons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
#icons button { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-width: 62px; padding: 6px 6px 4px; }
#icons button .nicon { height: 26px; margin: 0; }
#icons button.on { border-color: #bbb; background: #2a2a2a; }
#icons button.locked .nicon { opacity: 0.35; filter: grayscale(1); }
#icons small { color: #888; font-size: 11px; white-space: nowrap; }
#icons button.pricey small { color: #555; }
#icons .noicon { height: 26px; line-height: 26px; color: #777; font-size: 12px; }
#iconmsg { min-height: 1.2em; margin: 8px 0 4px; font-size: 14px; }
#iconcredit { color: #555; font-size: 11px; margin: 2px 0 0; }
#iconcredit a { color: #777; }
#colormsg { min-height: 1.2em; margin: 8px 0; font-size: 14px; }
