:root {
  --ink: #2a1b2e;
  --pink: #ff5fa2;
  --pink2: #ffd1e6;
  --blue: #4a7cff;
  --yellow: #ffd23f;
  --green: #4cd27a;
  --paper: #fffaf3;
  --red: #ff4d5e;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: 'M PLUS Rounded 1c', system-ui, sans-serif; color: var(--ink);
  background: radial-gradient(circle at 30% 20%, #fff0f7, #ffd6ea 55%, #e4d4ff);
  user-select: none; -webkit-user-select: none;
}
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; }
.hidden { display: none !important; }
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; font: 800 28px 'M PLUS Rounded 1c'; gap: 10px; background: #ffe3f0; z-index: 100; }

button {
  font-family: inherit; font-weight: 800; font-size: 14px; color: var(--ink); cursor: pointer;
  border: 3px solid var(--ink); background: #fff; border-radius: 10px; padding: 6px 10px;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .08s, box-shadow .08s;
}
button:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
button:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
button:disabled { opacity: .4; cursor: not-allowed; }
button.go { background: var(--pink); color: #fff; }
button.blue { background: var(--blue); color: #fff; }
button.yel { background: var(--yellow); }
button.grn { background: var(--green); color: #fff; }
kbd { font-size: 10px; background: rgba(0,0,0,.15); border-radius: 4px; padding: 0 4px; margin-left: 4px; font-family: inherit; }
select, input {
  font-family: inherit; font-weight: 800; border: 3px solid var(--ink); border-radius: 8px; padding: 4px 6px; background: #fff; color: var(--ink);
}
input[type=number] { width: 80px; }

/* ---------- HUD ---------- */
#hud { position: fixed; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; pointer-events: none; gap: 8px; z-index: 5; }
.hud-l, .hud-r { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.badge {
  background: #fff; border: 3px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink);
  padding: 4px 12px; display: flex; align-items: center; gap: 6px; font-weight: 800; white-space: nowrap;
}
.badge small { font-size: 11px; opacity: .7; }
.badge.day { background: var(--pink); color: #fff; font-family: 'Bangers', sans-serif; font-size: 22px; letter-spacing: 1px; }
.badge.day small { font-family: 'Bangers'; font-size: 14px; opacity: .9; }
.badge.money b { font-size: 20px; }
.badge.money.flash { animation: flash .4s; }
@keyframes flash { 50% { background: var(--yellow); transform: scale(1.08); } }
.badge.clock { flex-direction: column; gap: 2px; padding: 3px 12px; justify-content: center; }
.badge.clock b { font-size: 17px; }
.bar { width: 90px; height: 7px; background: #eee; border: 2px solid var(--ink); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow), var(--pink)); }
.badge.lvl .bar { width: 70px; }
.badge.lvl b { font-size: 18px; }
.badge.rent.danger { background: #ffe0e3; color: #c0001a; animation: wobble 1s infinite; }
@keyframes wobble { 50% { transform: rotate(-2deg); } }
.badge.rep span { color: #ffb300; font-size: 16px; text-shadow: 1px 1px 0 var(--ink); }
.badge.ev { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }

#combo {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%) rotate(-4deg); z-index: 6;
  font-family: 'Bangers', sans-serif; font-size: 42px; color: var(--yellow); letter-spacing: 2px;
  -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 var(--pink); pointer-events: none;
}
#combo.bump { animation: bump .35s; }
@keyframes bump { 40% { transform: translateX(-50%) rotate(-4deg) scale(1.35); } }

/* ---------- toolbar ---------- */
#toolbar { position: fixed; top: 70px; right: 10px; display: flex; flex-direction: column; gap: 8px; z-index: 5; align-items: stretch; }
#toolbar > button { display: flex; flex-direction: column; align-items: center; width: 78px; padding: 4px 4px 3px; border-radius: 14px; font-size: 11px; line-height: 1.15; }
#toolbar > button span { font-size: 24px; line-height: 1.1; }
#toolbar > button small { font-size: 10px; opacity: .6; }
#toolbar > button.on { background: var(--pink2); }
.speed { display: flex; gap: 4px; }
.speed button { padding: 2px 4px; flex: 1; }

#openBtn {
  position: fixed; bottom: 300px; left: 50%; transform: translateX(-50%) rotate(-2deg); z-index: 6;
  font-family: 'Dela Gothic One', sans-serif; font-size: 26px; padding: 12px 30px; background: var(--pink); color: #fff;
  border-width: 4px; box-shadow: 6px 6px 0 var(--ink); animation: breathe 1.4s infinite;
}
#openBtn:hover { transform: translateX(-50%) rotate(-2deg) scale(1.05); }
@keyframes breathe { 50% { transform: translateX(-50%) rotate(-2deg) scale(1.06); } }
#hint {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 5; background: #fff; border: 3px solid var(--ink);
  border-radius: 18px; padding: 8px 16px; font-weight: 800; box-shadow: 3px 3px 0 var(--ink); max-width: 560px; text-align: center; font-size: 14px; pointer-events: none;
}

/* ---------- side panel ---------- */
#panel {
  position: fixed; top: 72px; right: 98px; bottom: 12px; width: 420px; max-width: calc(100vw - 24px); z-index: 8;
  background: var(--paper); border: 4px solid var(--ink); border-radius: 16px; box-shadow: 7px 7px 0 var(--ink);
  display: flex; flex-direction: column; overflow: hidden; animation: slideIn .2s ease-out;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
#panel header {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 4px solid var(--ink);
  background: radial-gradient(circle, rgba(255,255,255,.35) 2px, transparent 2.5px) 0 0/10px 10px, var(--pink);
}
#panel h2 { margin: 0; font-family: 'Dela Gothic One', sans-serif; color: #fff; font-size: 20px; -webkit-text-stroke: 1px var(--ink); text-shadow: 2px 2px 0 var(--ink); }
#panel .x { padding: 2px 8px; }
#pBody { padding: 12px; overflow-y: auto; flex: 1; }
.sub { margin: 0 0 10px; font-size: 13px; opacity: .8; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; margin-bottom: 8px; }
.row.locked { opacity: .5; filter: grayscale(.6); }
.ic { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 24px; border-radius: 10px; border: 3px solid var(--ink); background: var(--c, #fff); }
.info { flex: 1; min-width: 0; }
.info b { font-size: 14px; }
.info small { opacity: .6; font-size: 11px; }
.meta { font-size: 12px; opacity: .85; margin-top: 2px; }
.good { color: #11a65a; font-weight: 800; }
.bad { color: #e0283e; font-weight: 800; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; }
.btns button { font-size: 12px; padding: 4px 8px; line-height: 1.2; }
.lock { font-weight: 800; font-size: 13px; }
.price-ctl { display: flex; align-items: center; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.price-ctl button { padding: 1px 7px; font-size: 12px; box-shadow: 2px 2px 0 var(--ink); }
.price-ctl input { width: 76px; padding: 2px 4px; }
.tip { background: #fff7d1; border: 3px dashed var(--ink); border-radius: 12px; padding: 8px 10px; font-size: 13px; margin-bottom: 10px; }
.theme { background: linear-gradient(90deg, #ffe066, #ff9ec0); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 10px; font-weight: 800; margin-bottom: 10px; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot { border: 3px solid var(--ink); border-radius: 12px; background: #fff; padding: 8px; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.slot .sl-h { font-size: 11px; font-weight: 800; opacity: .6; align-self: flex-start; }
.slot .big { font-size: 34px; }
.slot .qty { font-weight: 800; }
.slot .empty { opacity: .5; font-weight: 800; padding: 16px 0; }
.slot select { width: 100%; font-size: 12px; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button.on { background: var(--yellow); }
h3 { font-family: 'Dela Gothic One', sans-serif; font-size: 16px; margin: 14px 0 8px; }
.series-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; border: 3px solid var(--ink); border-radius: 10px; color: #fff; font-weight: 800; text-shadow: 1px 1px 0 var(--ink); }
.series-h.done { box-shadow: 0 0 0 3px var(--yellow); }
.setgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 6px 0 4px; }
.setgrid .cell { aspect-ratio: 4/5; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; background: #ddd; position: relative; }
.setgrid .cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.setgrid .cell.no img { filter: brightness(0) opacity(.35); }
.setgrid .cell .n { position: absolute; right: 2px; bottom: 1px; font-size: 10px; font-weight: 800; color: #fff; text-shadow: 1px 1px 0 #000; }
.setbonus { font-size: 12px; margin-bottom: 8px; }
.cardlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.cardlist .cwrap { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.cardlist .cwrap .btns button { font-size: 10px; padding: 2px 5px; box-shadow: 2px 2px 0 var(--ink); }
.perk-row { display: flex; gap: 10px; align-items: center; padding: 8px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; margin-bottom: 8px; }
.perk-row .pi { font-size: 28px; }
.perk-row .cnt { font-weight: 800; background: var(--yellow); border: 2px solid var(--ink); border-radius: 8px; padding: 0 6px; }
.free-pack { width: 100%; padding: 14px; font-size: 18px; margin-bottom: 10px; background: linear-gradient(90deg, #ffe066, #ff9ec0, #b9a4ff); animation: shimmer 2s infinite; background-size: 200% 100%; }
@keyframes shimmer { 50% { background-position: 100% 0; } }

/* ---------- Register ---------- */
#register {
  position: fixed; left: 12px; bottom: 12px; width: 320px; z-index: 9;
  background: var(--paper); border: 4px solid var(--ink); border-radius: 16px; box-shadow: 7px 7px 0 var(--ink);
  padding: 10px; animation: popIn .2s;
}
@keyframes popIn { from { transform: scale(.85); opacity: 0; } }
#register.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.rg-h { display: flex; justify-content: space-between; font-family: 'Dela Gothic One', sans-serif; font-size: 15px; margin-bottom: 4px; }
.patbar { height: 8px; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; background: #eee; margin-bottom: 6px; }
.patbar i { display: block; height: 100%; background: var(--green); transition: width .2s; }
.items { list-style: none; margin: 0 0 6px; padding: 6px 8px; background: #fff; border: 2px dashed var(--ink); border-radius: 8px; max-height: 110px; overflow-y: auto; font-size: 13px; }
.items li { display: flex; justify-content: space-between; gap: 6px; }
.total { font-family: 'Bangers', sans-serif; font-size: 26px; letter-spacing: 1px; text-align: right; }
.paycard { text-align: center; font-weight: 800; margin: 6px 0; }
#register .big { width: 100%; font-size: 18px; padding: 10px; }
.cash { display: flex; flex-direction: column; gap: 6px; }
.due { font-size: 18px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 10px; padding: 4px 8px; text-align: center; }
.given { text-align: center; font-size: 15px; }
.given.ok { color: #11a65a; }
.given.over { color: #e0283e; }
.tray { min-height: 26px; display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.tray .coin { font-size: 10px; padding: 2px 5px; border: 2px solid var(--ink); border-radius: 12px; font-weight: 800; }
.denoms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.denoms button { padding: 6px 4px; font-size: 14px; }
.coin.c5000 { background: #d6b4ff; } .coin.c1000 { background: #a4d8ff; }
.coin.c500 { background: #ffd36e; } .coin.c100 { background: #e6e6e6; }
.coin.c50 { background: #f0f0f0; } .coin.c10 { background: #f3b27a; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 6px; }
.cmb { text-align: center; font-family: 'Bangers'; font-size: 22px; color: var(--pink); }

/* ---------- Modal ---------- */
#modal {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(42,27,46,.25) 1.5px, transparent 2px) 0 0/8px 8px, rgba(42,27,46,.35);
}
#mBox {
  background: var(--paper); border: 4px solid var(--ink); border-radius: 20px; box-shadow: 9px 9px 0 var(--ink);
  padding: 20px 24px; max-width: min(860px, 94vw); max-height: 90vh; overflow-y: auto; animation: popIn .25s; text-align: center;
}
#mBox h1 { font-family: 'Dela Gothic One', sans-serif; margin: 0 0 6px; font-size: 34px; color: var(--pink); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); }
#mBox h2 { font-family: 'Dela Gothic One', sans-serif; margin: 6px 0; }
#mBox p { margin: 6px 0; }
.mbtns { display: flex; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.mbtns button { font-size: 17px; padding: 10px 20px; }
.logo { font-family: 'Dela Gothic One', sans-serif; font-size: 64px; line-height: 1; color: #fff; -webkit-text-stroke: 3px var(--ink); text-shadow: 6px 6px 0 var(--pink), 10px 10px 0 var(--ink); transform: rotate(-3deg); margin: 4px 0 8px; }
.logo2 { font-family: 'Bangers', sans-serif; font-size: 40px; letter-spacing: 3px; color: var(--yellow); -webkit-text-stroke: 2px var(--ink); text-shadow: 4px 4px 0 var(--ink); }
.tagline { font-weight: 800; opacity: .75; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; text-align: left; margin-top: 10px; }
.meta-grid .row { margin: 0; }
.pips { color: var(--pink); letter-spacing: 2px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.stat { border: 3px solid var(--ink); border-radius: 12px; background: #fff; padding: 8px; }
.stat b { display: block; font-size: 22px; }
.stat small { opacity: .7; font-weight: 800; }
.rentbox { border: 4px solid var(--ink); border-radius: 14px; padding: 10px; margin: 10px 0; font-weight: 800; font-size: 18px; }
.rentbox.ok { background: #d9ffe6; }
.rentbox.no { background: #ffe0e3; }
.draft { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.perk {
  width: 210px; min-height: 260px; border: 4px solid var(--ink); border-radius: 16px; background: #fff; padding: 14px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; box-shadow: 5px 5px 0 var(--ink); transition: transform .12s; position: relative; overflow: hidden;
}
.perk:hover { transform: translateY(-6px) rotate(-1deg); }
.perk .pi { font-size: 54px; margin-top: 6px; }
.perk .pn { font-family: 'Dela Gothic One', sans-serif; font-size: 17px; }
.perk .pj { font-size: 12px; opacity: .6; }
.perk .pd { font-size: 14px; font-weight: 800; }
.perk .rr { position: absolute; top: 8px; right: -30px; transform: rotate(35deg); width: 120px; font-size: 11px; font-weight: 800; color: #fff; border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.perk.common { background: linear-gradient(#fff, #f2f2f2); } .perk.common .rr { background: #9aa0a6; }
.perk.rare { background: linear-gradient(#fff, #dcefff); } .perk.rare .rr { background: #3fa7ff; }
.perk.epic { background: linear-gradient(#fff, #f0e0ff); } .perk.epic .rr { background: #b46bff; }
.perk.cursed { background: linear-gradient(#fff, #ffe0e0); } .perk.cursed .rr { background: #c0001a; }
.event-big { font-size: 80px; animation: popIn .5s; }
.day-splash { font-family: 'Bangers', sans-serif; font-size: 80px; letter-spacing: 4px; color: var(--yellow); -webkit-text-stroke: 3px var(--ink); text-shadow: 6px 6px 0 var(--pink); line-height: 1; transform: rotate(-3deg); }
.howto { text-align: left; font-size: 14px; line-height: 1.6; }
.howto li { margin-bottom: 4px; }

/* ---------- Cards ---------- */
.card { width: 150px; height: 210px; perspective: 900px; flex: none; position: relative; }
.card.small { width: 92px; height: 129px; }
.card .ci { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.3,1.4,.5,1); transform-style: preserve-3d; }
.card.down .ci { transform: rotateY(180deg); }
.card .cf, .card .cb { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px; border: 4px solid var(--ink); overflow: hidden; }
.card .cf { background: var(--rc); padding: 5px; }
.card .cf img { width: 100%; height: 76%; object-fit: cover; display: block; border-radius: 5px; border: 2px solid var(--ink); }
.card .cb { transform: rotateY(180deg); background: repeating-linear-gradient(45deg, #ff5fa2 0 10px, #ff8cc0 10px 20px); display: flex; align-items: center; justify-content: center; font-size: 54px; color: #fff; text-shadow: 3px 3px 0 var(--ink); }
.card .cr { position: absolute; top: 8px; left: 8px; background: var(--ink); color: var(--rc); font-family: 'Bangers'; font-size: 18px; padding: 0 6px; border-radius: 6px; letter-spacing: 1px; }
.card .cn { font-weight: 800; font-size: 12px; color: #fff; text-shadow: 1px 1px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cs { font-size: 9px; color: #fff; font-weight: 800; opacity: .9; }
.card .cv { position: absolute; right: 8px; bottom: 6px; font-weight: 800; font-size: 12px; background: #fff; border: 2px solid var(--ink); border-radius: 6px; padding: 0 4px; }
.card .new { position: absolute; top: 6px; right: 6px; background: var(--red); color: #fff; font-family: 'Bangers'; padding: 0 6px; border: 2px solid var(--ink); border-radius: 6px; transform: rotate(8deg); }
.card.small .cr { font-size: 12px; top: 5px; left: 5px; }
.card.small .cn { font-size: 9px; }
.card.small .cs { display: none; }
.card.small .cv { font-size: 9px; right: 4px; bottom: 3px; }
.card.small .cf { padding: 3px; }
.card.small .cf, .card.small .cb { border-width: 3px; }
.card.r-SR .cf::after, .card.r-SSR .cf::after, .card.r-UR .cf::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.85) 40%, rgba(120,220,255,.6) 50%, rgba(255,120,220,.6) 60%, transparent 80%);
  background-size: 250% 250%; animation: holo 2.4s linear infinite;
}
.card.r-UR .cf { background: linear-gradient(135deg, #ff5f6d, #ffc371, #7bff9a, #59c3ff, #b46bff, #ff5fa2); background-size: 300% 300%; animation: rainbow 3s linear infinite; }
@keyframes holo { from { background-position: 100% 100%; } to { background-position: 0 0; } }
@keyframes rainbow { 50% { background-position: 100% 100%; } }

/* ---------- Gacha ---------- */
#gacha { position: fixed; inset: 0; z-index: 30; background: radial-gradient(circle, #3a2350, #160c1f); display: flex; align-items: center; justify-content: center; overflow: hidden; }
#gacha.shake { animation: shake .4s; }
.g-lines { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.10) 0 2deg, transparent 2deg 9deg); animation: spin 30s linear infinite; }
#gacha.ur .g-lines { background: repeating-conic-gradient(from 0deg, rgba(255,95,162,.35) 0 3deg, rgba(89,195,255,.25) 3deg 6deg, transparent 6deg 10deg); animation-duration: 6s; }
#gacha.ssr .g-lines { background: repeating-conic-gradient(from 0deg, rgba(255,210,63,.3) 0 3deg, transparent 3deg 9deg); animation-duration: 10s; }
@keyframes spin { to { transform: rotate(360deg); } }
.g-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.g-tip { color: #fff; font-weight: 800; font-size: 18px; text-shadow: 2px 2px 0 var(--ink); animation: breathe2 1.2s infinite; }
@keyframes breathe2 { 50% { opacity: .5; } }
.pack {
  width: 220px; height: 330px; border: 5px solid var(--ink); border-radius: 14px; position: relative; cursor: pointer; overflow: hidden;
  background: linear-gradient(160deg, var(--c), var(--d)); box-shadow: 0 0 40px var(--c), 8px 8px 0 #000; animation: float 2s ease-in-out infinite;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 16px; color: #fff; text-align: center;
}
.pack img { position: absolute; top: 34px; left: 20px; width: 170px; border: 4px solid #fff; border-radius: 10px; transform: rotate(-4deg); }
.pack .pk-top { position: absolute; top: 0; left: 0; right: 0; height: 26px; background: repeating-linear-gradient(90deg, #fff 0 8px, #ddd 8px 16px); border-bottom: 4px solid var(--ink); transition: transform .5s; }
.pack .pk-foil { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.45) 45%, transparent 60%); background-size: 250% 250%; animation: holo 2s linear infinite; }
.pack .pk-jp { font-family: 'Dela Gothic One'; font-size: 26px; -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); position: relative; }
.pack .pk-en { font-family: 'Bangers'; font-size: 20px; letter-spacing: 1px; text-shadow: 2px 2px 0 var(--ink); position: relative; }
.pack .pk-sub { font-size: 11px; font-weight: 800; background: var(--ink); padding: 2px 8px; border-radius: 6px; position: relative; }
.pack:hover { animation: jiggle .3s infinite; }
.pack.torn { animation: tear .65s forwards; }
.pack.torn .pk-top { transform: translate(60px, -60px) rotate(30deg); }
@keyframes float { 50% { transform: translateY(-10px) rotate(1deg); } }
@keyframes jiggle { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
@keyframes tear { 30% { transform: scale(1.1) rotate(-3deg); } 100% { transform: scale(1.6) translateY(60px); opacity: 0; filter: brightness(3); } }
.g-cards { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; max-width: 92vw; }
.gslot { cursor: pointer; animation: dealIn .45s backwards; }
.gslot:hover .card.down { transform: translateY(-8px); transition: transform .15s; }
@keyframes dealIn { from { transform: translateY(-300px) rotate(-40deg); opacity: 0; } }
.g-foot { display: flex; gap: 10px; align-items: center; color: #fff; font-weight: 800; flex-wrap: wrap; justify-content: center; }
.g-foot .sum { font-size: 18px; text-shadow: 2px 2px 0 var(--ink); }
.burst { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 40; }
.burst span {
  font-family: 'Dela Gothic One', sans-serif; font-size: 76px; color: #fff; -webkit-text-stroke: 3px var(--ink);
  text-shadow: 6px 6px 0 var(--rc), 12px 12px 0 var(--ink); animation: slam 1.1s forwards; white-space: nowrap;
}
.burst::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle, var(--rc), transparent 60%); opacity: 0; animation: flashbg .8s; }
@keyframes flashbg { 10% { opacity: .9; } }
@keyframes slam { 0% { transform: scale(3) rotate(-10deg); opacity: 0; } 15% { transform: scale(.9) rotate(-6deg); opacity: 1; } 25% { transform: scale(1.05) rotate(-6deg); } 75% { opacity: 1; } 100% { transform: scale(1.1) rotate(-6deg); opacity: 0; } }

/* ---------- In-world overlays ---------- */
#overlay { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.cu { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cu .say { font-size: 26px; opacity: 0; filter: drop-shadow(2px 2px 0 #fff); }
.cu .say.pop { animation: say 1.6s; }
@keyframes say { 0% { opacity: 0; transform: translateY(10px) scale(.4); } 12% { opacity: 1; transform: translateY(0) scale(1.25); } 22% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.cu .pat { width: 46px; height: 8px; border: 2px solid var(--ink); background: #fff; border-radius: 5px; overflow: hidden; }
.cu .pat i { display: block; height: 100%; background: var(--green); }
.float {
  position: absolute; transform: translate(-50%, -50%); font-family: 'Bangers', sans-serif; font-size: 30px; letter-spacing: 1px;
  color: var(--yellow); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); animation: floatUp 1.4s forwards; white-space: nowrap;
}
.float.perfect { color: #fff; text-shadow: 3px 3px 0 var(--pink); font-size: 38px; }
.float.bad { color: var(--red); }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -20px) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -110px) scale(1); } }

#fx { position: fixed; inset: 0; pointer-events: none; z-index: 25; }
.splash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.splash b {
  font-family: 'Dela Gothic One', sans-serif; font-size: 64px; color: var(--yellow); -webkit-text-stroke: 3px var(--ink);
  text-shadow: 6px 6px 0 var(--pink), 10px 10px 0 var(--ink); animation: slam 1.8s forwards;
}
.splash small { font-weight: 800; font-size: 20px; background: #fff; border: 3px solid var(--ink); padding: 4px 14px; border-radius: 12px; animation: slam 1.8s forwards; margin-top: 10px; }

#toasts { position: fixed; top: 108px; left: 50%; transform: translateX(-50%); align-items: center; z-index: 15; display: flex; flex-direction: column; gap: 6px; pointer-events: none; max-width: 360px; }
.toast { background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 6px 12px; font-weight: 800; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); animation: toastIn .25s, toastOut .4s 2.6s forwards; }
.toast.good { background: #d9ffe6; } .toast.bad { background: #ffe0e3; } .toast.gold { background: #fff1b3; }
@keyframes toastIn { from { transform: translateX(-40px); opacity: 0; } }
@keyframes toastOut { to { transform: translateX(-40px); opacity: 0; } }

@media (max-width: 760px) {
  #toolbar > button { min-width: 64px; font-size: 10px; }
  #toolbar > button small { display: none; }
  #panel { top: 110px; }
  #register { width: calc(100vw - 24px); }
  .logo { font-size: 40px; }
  .badge.ev { display: none; }
}

/* ================= SLOT MACHINE ================= */
#slot {
  position: fixed; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 7; width: 320px;
  background: linear-gradient(160deg, #ff7ac8, #b46bff); border: 4px solid var(--ink); border-radius: 22px;
  box-shadow: 7px 7px 0 var(--ink); padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px;
}
#slot::before { content: ''; position: absolute; inset: 0; border-radius: 18px; pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.28) 1.5px, transparent 2px) 0 0/9px 9px; }
#slot.fevering { animation: feverGlow .6s linear infinite; background: linear-gradient(160deg, #ffd23f, #ff5fa2, #b46bff, #59c3ff); background-size: 300% 300%; }
@keyframes feverGlow { 0% { box-shadow: 7px 7px 0 var(--ink), 0 0 18px #ffd23f; background-position: 0 0; } 50% { box-shadow: 7px 7px 0 var(--ink), 0 0 40px #ff5fa2; background-position: 100% 100%; } 100% { box-shadow: 7px 7px 0 var(--ink), 0 0 18px #ffd23f; background-position: 0 0; } }
#slot.bigwin { animation: slotWin .5s; }
@keyframes slotWin { 30% { scale: 1.06; rotate: -1deg; } 60% { scale: .98; rotate: 1deg; } }
.sl-top { display: flex; align-items: center; justify-content: space-between; position: relative; }
.sl-title { font-family: 'Bangers', sans-serif; font-size: 24px; letter-spacing: 2px; color: var(--yellow); -webkit-text-stroke: 1.5px var(--ink); text-shadow: 3px 3px 0 var(--ink); }
#slFree { font-weight: 800; color: #fff; text-shadow: 1px 1px 0 var(--ink); font-size: 13px; }
.sl-top .q { padding: 0 8px; border-radius: 50%; font-size: 14px; box-shadow: 2px 2px 0 var(--ink); }
.sl-body { display: flex; gap: 6px; position: relative; }
#reels { --cell: 62px; position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; flex: 1;
  background: var(--ink); padding: 5px; border-radius: 14px; }
.reel { height: calc(var(--cell) * 3); overflow: hidden; background: #fffaf3; border-radius: 9px; position: relative; }
.reel.holdable { cursor: pointer; }
.reel .lock { position: absolute; inset: 0; display: none; align-items: flex-start; justify-content: flex-end; font-size: 18px; padding: 2px; background: rgba(89,195,255,.25); box-shadow: inset 0 0 0 4px #59c3ff; border-radius: 9px; pointer-events: none; }
.reel.locked .lock { display: flex; }
.strip { will-change: transform; }
.strip .cell { height: var(--cell); display: flex; align-items: center; justify-content: center; font-size: 36px; line-height: 1;
  border-bottom: 2px dashed rgba(42,27,46,.12); position: relative; }
.cell.s-wild { background: radial-gradient(circle, #ffe0ef 30%, transparent 70%); }
.cell.s-star { background: radial-gradient(circle, #fff3b0 30%, transparent 70%); }
.cell.fire { animation: cellFire .35s; }
@keyframes cellFire { 40% { transform: scale(1.3) rotate(-8deg); } }
.cell.win { background: radial-gradient(circle, #fff, #ffd23f 70%); animation: cellWin .6s infinite alternate; z-index: 1; }
@keyframes cellWin { to { transform: scale(1.12); filter: brightness(1.15); } }
.cell.shatter { animation: shatter .38s forwards; }
@keyframes shatter { to { transform: scale(1.8) rotate(25deg); opacity: 0; filter: brightness(3); } }
.cell.drop { animation: dropIn .3s; }
@keyframes dropIn { from { transform: translateY(-60px); opacity: 0; } }
#slLines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
#slLines line { stroke-dasharray: 400; stroke-dashoffset: 400; animation: drawLine .35s forwards; opacity: .9; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.sl-side { width: 24px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fever-bar { flex: 1; width: 18px; background: #fff; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; display: flex; align-items: flex-end; }
.fever-bar i { display: block; width: 100%; height: 0; background: linear-gradient(0deg, #ff5fa2, #ffd23f); transition: height .3s; }
#slot.fevering .fever-bar i { animation: rainbowBar .5s infinite alternate; }
@keyframes rainbowBar { to { filter: hue-rotate(120deg); } }
.sl-side small { writing-mode: vertical-rl; font-size: 10px; font-weight: 800; color: #fff; text-shadow: 1px 1px 0 var(--ink); }
#spinBtn { font-family: 'Dela Gothic One', sans-serif; font-size: 20px; padding: 8px; background: var(--yellow); border-width: 4px; box-shadow: 4px 4px 0 var(--ink); position: relative; }
#spinBtn:not(:disabled) { animation: spinPulse 1.2s infinite; }
@keyframes spinPulse { 50% { background: #fff27a; } }
#slLog { min-height: 18px; text-align: center; font-weight: 800; color: #fff; text-shadow: 1px 1px 0 var(--ink); font-size: 14px; position: relative; }
body.fever #stage { filter: saturate(1.35) brightness(1.04); }
body.fever .badge.day { background: linear-gradient(90deg, #ffd23f, #ff5fa2, #b46bff); }
.paytable { text-align: left; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 6px; }
.paytable .row { margin: 0; }
.fx2 { font-size: 18px; color: var(--pink); }

/* staff cashier */
.staffrow { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; margin: 4px 0; }
.sbar { flex: 1; height: 12px; border: 2px solid var(--ink); border-radius: 7px; background: #eee; overflow: hidden; }
.sbar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(45deg, #59c3ff 0 8px, #8fd3ff 8px 16px); }
.row2 { display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; }
.row2 button { font-size: 13px; padding: 8px 4px; }

/* alchemy */
.alch { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: 'Bangers'; font-size: 28px; }
.alch.boom { animation: slotWin .5s; }
.aslot { width: 92px; height: 92px; border: 3px dashed var(--ink); border-radius: 16px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 38px; cursor: pointer; font-family: inherit; }
.aslot small { font-size: 10px; font-family: 'M PLUS Rounded 1c'; font-weight: 800; text-align: center; padding: 0 3px; line-height: 1.1; }
.aslot.out { border-style: solid; background: radial-gradient(circle, #fff, #ffe4f1); cursor: default; }
.itemgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.itm { display: flex; flex-direction: column; align-items: center; font-size: 10px; padding: 4px; gap: 1px; box-shadow: 2px 2px 0 var(--ink); }
.itm span { font-size: 26px; }
.free-pack.holo { background: linear-gradient(90deg, #59c3ff, #b46bff, #ff5fa2, #ffd23f); background-size: 200% 100%; color: #fff; text-shadow: 1px 1px 0 var(--ink); }

@media (max-width: 1100px) {
  #slot { left: auto; right: 98px; transform: none; }
  #register { width: 290px; max-height: calc(100vh - 80px); overflow-y: auto; padding: 8px; }
  #register .items { max-height: 64px; }
  #openBtn { left: auto; right: 98px; transform: rotate(-2deg); font-size: 20px; }
  #openBtn:hover { transform: rotate(-2deg) scale(1.05); }
  @keyframes breathe { 50% { transform: rotate(-2deg) scale(1.06); } }
}
