* { box-sizing: border-box; }
body { margin: 0; font-family: "Nunito", system-ui, sans-serif; background: radial-gradient(circle at 50% 0, #3a2b05, #000 65%); color: #f4f1e4; min-height: 100vh; }
button, input, select { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #ffd54a; outline-offset: 2px; }
.lw { max-width: 720px; margin: 0 auto; padding: 16px; padding-bottom: 80px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { font-size: 1.5rem; font-weight: 900; color: #ffd54a; }
.name { background: #0003; border: 1px solid #fff3; color: #fff; border-radius: 999px; padding: 6px 14px; width: 160px; max-width: 100%; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.stat { background: #0003; border-radius: 14px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 1.4rem; color: #ffd54a; }
.stat span { font-size: .8rem; opacity: .8; }
.machine { position: relative; overflow: hidden; background: linear-gradient(#1c1606, #000); border: 3px solid #ffd54a; border-radius: 24px; padding: 20px; text-align: center; box-shadow: 0 10px 30px #0006; }
.machine.hot { box-shadow: 0 0 30px #ffd54a99; }
.reel { width: 130px; height: 130px; margin: 0 auto; border-radius: 22px; background: #fffbe8; display: grid; place-items: center; font-size: 72px; border: 4px solid #ccc; }
.reel.spin { animation: shake .15s infinite; }
.reel.r-Rare { border-color: #4aa3ff; } .reel.r-Epic { border-color: #b46cff; } .reel.r-Legendary { border-color: #ffb300; box-shadow: 0 0 30px #ffb300; }
@keyframes shake { 0% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } 100% { transform: rotate(-6deg); } }
.result { margin: 14px 0; min-height: 1.6em; }
.tag { font-style: normal; font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: #ffffff22; display: inline-block; }
.tag.r-Rare { background: #4aa3ff; } .tag.r-Epic { background: #b46cff; } .tag.r-Legendary { background: #ffb300; color: #3a2a00; }
.big { background: #ffd54a; color: #3a2a00; border: 0; border-radius: 999px; padding: 14px 30px; font-weight: 900; font-size: 1.1rem; cursor: pointer; box-shadow: 0 5px 0 #b38f1a; }
.big:active { transform: translateY(3px); box-shadow: 0 2px 0 #b38f1a; }
button:disabled { opacity: .5; cursor: not-allowed; }
.boostline { margin-top: 10px; color: #ffd54a; font-weight: 700; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.actions button, .tabs button, .addf button { background: #0004; color: #fff; border: 1px solid #fff3; border-radius: 12px; padding: 10px; cursor: pointer; font-weight: 700; }
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tabs button { flex: 1; }
.tabs button.on { background: #ffd54a; color: #3a2a00; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.charm { position: relative; background: #fffbe8; color: #2a2a1a; border-radius: 16px; padding: 10px 6px; text-align: center; border: 3px solid #ccc; }
.charm.r-Rare { border-color: #4aa3ff; } .charm.r-Epic { border-color: #b46cff; } .charm.r-Legendary { border-color: #ffb300; }
.charm.locked { opacity: .45; }
.charm .emoji { font-size: 38px; }
.charm .cn { font-weight: 800; font-size: .85rem; margin: 4px 0; }
.charm .tag { color: #fff; background: #999; }
.charm .count { position: absolute; top: 6px; right: 8px; font-weight: 900; font-size: .8rem; }
.mini { margin-top: 6px; font-size: .72rem; border: 0; border-radius: 8px; background: #19583a; color: #fff; padding: 4px 8px; cursor: pointer; }
.panel { background: #0003; border-radius: 16px; padding: 14px; }
.addf { display: flex; gap: 8px; margin-bottom: 10px; }
.addf input { flex: 1; min-width: 0; border-radius: 12px; border: 1px solid #fff3; background: #0003; color: #fff; padding: 10px; }
.friend { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #fff2; flex-wrap: wrap; }
.friend select { border-radius: 10px; padding: 6px; max-width: 100%; }
.trade { font-size: .9rem; padding: 4px 0; opacity: .9; }
.muted { opacity: .7; }
.mini { background: #5a4300; }
.machine > *:not(.stars) { position: relative; z-index: 1; }
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars span { position: absolute; color: #ffe27a; font-size: 16px; opacity: 0; animation: starfall .6s linear infinite; }
@keyframes starfall { from { opacity: 0; transform: translateY(-30px) scale(.4); } 50% { opacity: 1; } to { opacity: 0; transform: translateY(40px) scale(1.4); } }
.spinrow { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.autob { background: #0006; color: #ffd54a; border: 2px solid #ffd54a; border-radius: 999px; padding: 12px 20px; font-weight: 800; cursor: pointer; }
.autob.on { background: #ffd54a; color: #3a2a00; }
.spintotal { text-align: center; margin-top: 20px; font-size: 1.05rem; color: #ffd54a; }
.idxh { margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.grid.sm { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.charm.sm { padding: 8px 4px; }
.charm.sm .emoji { font-size: 28px; }
.charm.sm .cn { font-size: .68rem; }
.charm.locked .emoji { filter: grayscale(.6); }
.shop { display: grid; gap: 10px; }
.shopitem { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.shopitem b { display: block; }
.reel[class*="r-"] { animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.reel.r-Uncommon { border-color: #4ade80; box-shadow: 0 0 22px #4ade80; }
.reel.r-Rare { border-color: #4aa3ff; box-shadow: 0 0 36px 6px #4aa3ff; }
.reel.r-Epic { border-color: #b46cff; box-shadow: 0 0 40px 8px #b46cff; }
.reel.r-Legendary { box-shadow: 0 0 46px 10px #ffb300; }
.reel.r-Rainbow { animation: pop .5s ease-out, rb 1.5s linear infinite; border-width: 5px; }
.reel.r-Ultra { border-color: #ff3d81; box-shadow: 0 0 60px 14px #ff3d81; }
.reel.r-Mega { border-color: #38f9ff; box-shadow: 0 0 80px 22px #38f9ff, 0 0 30px 6px #fff; }
@keyframes rb { 0% { border-color: #f33; box-shadow: 0 0 50px 10px #f33; } 20% { border-color: #fc3; box-shadow: 0 0 50px 10px #fc3; }
  40% { border-color: #3f6; box-shadow: 0 0 50px 10px #3f6; } 60% { border-color: #3cf; box-shadow: 0 0 50px 10px #3cf; }
  80% { border-color: #c6f; box-shadow: 0 0 50px 10px #c6f; } 100% { border-color: #f33; box-shadow: 0 0 50px 10px #f33; } }
.tag.r-Uncommon { background: #22a35a; }
.tag.r-Rainbow { background: linear-gradient(90deg, #f33, #fc3, #3f6, #3cf, #c6f); color: #111; font-weight: 800; }
.tag.r-Ultra { background: #ff3d81; }
.tag.r-Mega { background: #38f9ff; color: #002b2e; font-weight: 800; }
.charm.r-Uncommon { border-color: #4ade80; }
.charm.r-Rainbow { animation: rb 2s linear infinite; }
.charm.r-Ultra { border-color: #ff3d81; }
.charm.r-Mega { border-color: #38f9ff; }
.saved { text-align: center; font-size: .8rem; opacity: .7; margin-top: 20px; }
/* shared state helpers (src/ui.tsx) */
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 24px; opacity: .85; }
.spinner { width: 22px; height: 22px; border: 3px solid #fff3; border-top-color: #ffd54a; border-radius: 50%; animation: lwspin .8s linear infinite; }
@keyframes lwspin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 24px 12px; opacity: .85; }
.empty-title { font-weight: 800; margin-bottom: 4px; }
.hint { font-size: .85rem; opacity: .75; }
.alert { border-radius: 12px; padding: 10px 14px; margin: 10px 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.alert-error { background: #7a1f1f; border: 1px solid #ff8a8a; color: #fff; }
.btn { background: #ffd54a; color: #3a2a00; border: 0; border-radius: 12px; padding: 8px 14px; font-weight: 800; cursor: pointer; }
.btn-secondary { background: #0004; color: #fff; border: 1px solid #fff3; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #ffd54a; color: #3a2a00; padding: 10px 18px; border-radius: 999px; font-weight: 800; max-width: 90vw; }
