/* Squishy Swap — bright, bubbly, glossy */
:root {
  --ink: #3b2a5c;
  --ink-soft: #7a6a99;
  --pink: #ff4fa0;
  --purple: #8a4dff;
  --blue: #2f9bff;
  --yellow: #ffc21a;
  --green: #22c578;
  --card: rgba(255, 255, 255, .82);
  --shadow: 0 6px 0 rgba(90, 50, 150, .12), 0 14px 28px rgba(90, 50, 150, .12);
  --common: #8FA8C8;
  --rare: #A45CFF;
  --epic: #FFC21A;
  --rainbow: linear-gradient(90deg, #ff4d5e, #ff9a3c, #ffe04a, #5fd068, #4da8ff, #a56bff, #ff4d5e, #ff9a3c, #ffe04a, #5fd068, #4da8ff, #a56bff, #ff4d5e);
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Varela Round", "Trebuchet MS", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  background: linear-gradient(160deg, #ffd3ea 0%, #e6d8ff 45%, #c9ecff 100%) fixed;
  min-height: 100vh;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0 0 10px; line-height: 1.15; }
h3 { font-size: 20px; }
p { margin: 0 0 10px; }
small { font-size: 14px; }

/* floating background bubbles */
#bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
#bubbles i {
  position: absolute; bottom: -120px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(255,255,255,.15) 45%, rgba(255,255,255,.05) 70%);
  border: 2px solid rgba(255,255,255,.5);
  animation: rise 18s linear infinite;
}
#bubbles i:nth-child(1) { left: 5%; width: 60px; height: 60px; animation-duration: 19s; }
#bubbles i:nth-child(2) { left: 20%; width: 26px; height: 26px; animation-duration: 13s; animation-delay: -4s; }
#bubbles i:nth-child(3) { left: 38%; width: 80px; height: 80px; animation-duration: 24s; animation-delay: -10s; }
#bubbles i:nth-child(4) { left: 55%; width: 34px; height: 34px; animation-duration: 15s; animation-delay: -2s; }
#bubbles i:nth-child(5) { left: 70%; width: 54px; height: 54px; animation-duration: 21s; animation-delay: -14s; }
#bubbles i:nth-child(6) { left: 85%; width: 22px; height: 22px; animation-duration: 12s; animation-delay: -7s; }
#bubbles i:nth-child(7) { left: 92%; width: 70px; height: 70px; animation-duration: 26s; animation-delay: -18s; }
#bubbles i:nth-child(8) { left: 47%; width: 18px; height: 18px; animation-duration: 11s; animation-delay: -5s; }
@keyframes rise { from { transform: translateY(0) translateX(0); } 50% { transform: translateY(-60vh) translateX(20px); } to { transform: translateY(-125vh) translateX(-10px); } }

#app { position: relative; z-index: 1; max-width: 1060px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
#main { flex: 1; padding: 14px 14px 120px; }
.no-chrome #main { padding-bottom: 30px; }

/* top bar */
#topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin: 0 8px;
  background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 0 0 26px 26px; box-shadow: var(--shadow);
}
.no-chrome #topbar, .no-chrome #nav { display: none; }
.me { display: flex; align-items: center; gap: 8px; border: 0; background: #fff; border-radius: 999px; padding: 6px 14px 6px 6px; box-shadow: inset 0 -3px 0 #eadfff; min-height: 52px; max-width: 60%; min-width: 0; flex: 0 1 auto; }
.me .avatar { font-size: 30px; width: 40px; height: 40px; display: grid; place-items: center; background: linear-gradient(180deg, #ffe9f6, #efe4ff); border-radius: 50%; }
.nick { font-weight: 900; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coins { margin-left: auto; display: flex; align-items: center; gap: 6px; font-weight: 900; font-size: 22px; background: linear-gradient(180deg, #fff6c9, #ffe27a); border-radius: 999px; padding: 8px 16px; box-shadow: inset 0 -3px 0 #f2c33b, 0 3px 8px rgba(240,180,0,.25); color: #7a4b00; }
.coins.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: scale(1.25); } 60% { transform: scale(.95); } }
.icon-btn { border: 0; background: #fff; border-radius: 50%; width: 48px; height: 48px; font-size: 22px; box-shadow: inset 0 -3px 0 #eadfff; flex: none; }
.icon-btn.off { opacity: .45; filter: grayscale(1); }

/* bottom nav */
#nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: center; gap: 2px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 26px 26px 0 0; box-shadow: 0 -6px 24px rgba(90,50,150,.14);
}
.nav-btn { flex: 1; max-width: 120px; border: 0; background: transparent; border-radius: 18px; padding: 6px 2px; font-weight: 900; font-size: 12px; color: var(--ink-soft); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 62px; transition: transform .15s; }
.nav-btn .ico { font-size: 27px; line-height: 1; }
.nav-btn.on { background: linear-gradient(180deg, #ffe3f3, #efe2ff); color: var(--pink); transform: translateY(-3px); }
.nav-btn:active { transform: scale(.92); }

/* type */
.logo { text-align: center; font-size: clamp(40px, 9vw, 64px); font-weight: 900; letter-spacing: -1px; margin: 6px 0 12px; color: #ff4fa0; text-shadow: 0 4px 0 #fff, 0 8px 0 rgba(160,70,200,.25); }
.logo span { color: #7b4dff; margin-left: 8px; }
.title { text-align: center; font-size: clamp(30px, 6vw, 42px); font-weight: 900; color: #6b3fe0; text-shadow: 0 3px 0 #fff; margin: 6px 0 12px; }
.big-hint { text-align: center; font-size: 21px; font-weight: 800; color: var(--ink); }
.hint { color: var(--ink-soft); font-size: 16px; font-weight: 700; }
.center { text-align: center; }
.empty { text-align: center; font-weight: 800; color: var(--ink-soft); padding: 20px; grid-column: 1 / -1; }
.row { display: flex; align-items: center; }
.row.center { justify-content: center; }
.row.gap { gap: 12px; }
.row.wrap { flex-wrap: wrap; }

.card { background: var(--card); border-radius: 28px; padding: 18px; margin: 0 0 18px; box-shadow: var(--shadow); border: 3px solid rgba(255,255,255,.9); }

/* glossy buttons */
.btn {
  position: relative; border: 0; font-weight: 900; font-size: 20px; color: #fff;
  padding: 14px 26px; min-height: 60px; border-radius: 999px;
  background: linear-gradient(180deg, #ff8fca, #ff4fa0);
  box-shadow: 0 6px 0 #d12f7c, 0 12px 20px rgba(255,79,160,.3);
  text-shadow: 0 2px 0 rgba(0,0,0,.14);
  transition: transform .08s, box-shadow .08s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  overflow: hidden; margin: 6px 0 12px;
}
.btn::after { content: ""; position: absolute; left: 10%; right: 10%; top: 5px; height: 40%; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.6), rgba(255,255,255,0)); pointer-events: none; }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 #d12f7c, 0 4px 10px rgba(255,79,160,.3); }
.btn:disabled { filter: grayscale(.8); opacity: .55; cursor: default; }
.btn.huge { font-size: 24px; min-height: 72px; padding: 16px 34px; }
.btn.wide { display: flex; width: 100%; max-width: 560px; margin: 8px auto 18px; }
.btn.small { font-size: 16px; min-height: 46px; padding: 8px 18px; margin: 0; }
.btn small { font-size: 16px; opacity: .9; background: rgba(255,255,255,.25); border-radius: 999px; padding: 3px 10px; }
.btn.blue { background: linear-gradient(180deg, #7cc6ff, #2f8fff); box-shadow: 0 6px 0 #1b68d6, 0 12px 20px rgba(47,143,255,.3); }
.btn.green { background: linear-gradient(180deg, #6ff0a6, #1fbf6e); box-shadow: 0 6px 0 #11934f, 0 12px 20px rgba(31,191,110,.3); }
.btn.yellow { background: linear-gradient(180deg, #ffe27a, #ffb300); box-shadow: 0 6px 0 #d18a00, 0 12px 20px rgba(255,179,0,.3); color: #6b3d00; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.btn.pink { background: linear-gradient(180deg, #ff9fd6, #ff5fb4); }
.btn.purple { background: linear-gradient(180deg, #b994ff, #7b4dff); box-shadow: 0 6px 0 #5a2fd1, 0 12px 20px rgba(123,77,255,.3); }
.btn.ghost { background: #fff; color: var(--ink); text-shadow: none; box-shadow: 0 6px 0 #e2d6f7, 0 10px 16px rgba(90,50,150,.12); }
.link-btn { border: 0; background: none; color: var(--purple); font-weight: 900; text-decoration: underline; font-size: 16px; }

/* progress */
.progress { position: relative; height: 38px; border-radius: 999px; background: #fff; box-shadow: inset 0 3px 6px rgba(90,50,150,.15); overflow: hidden; margin: 8px auto 16px; max-width: 560px; }
.progress .bar { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #ff8fca, #b17bff, #5fc7ff); min-width: 38px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08), inset 0 4px 0 rgba(255,255,255,.4); transition: width .6s cubic-bezier(.3,1.4,.5,1); }
.progress span { position: relative; display: block; text-align: center; line-height: 38px; font-weight: 900; font-size: 18px; color: var(--ink); text-shadow: 0 1px 0 #fff, 0 0 6px #fff; }

/* chips */
.chip-row, .chip-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.chip { border: 3px solid #fff; background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 900; font-size: 16px; min-height: 46px; box-shadow: 0 3px 0 #e2d6f7; }
.chip.on { background: linear-gradient(180deg, #ff9fd6, #ff5fb4); color: #fff; box-shadow: 0 3px 0 #d12f7c; }
.chip.rc-common { border-color: var(--common); }
.chip.rc-rare { border-color: var(--rare); }
.chip.rc-epic { border-color: var(--epic); }
.chip.rc-legendary { border-color: #ff9a3c; background-image: none; }
.chip.rc-legendary.on { background: var(--rainbow); background-size: 200% 100%; animation: rainbowSlide 3s linear infinite; }
.avatar-chip { font-size: 30px; width: 58px; height: 58px; padding: 0; }
.swatch { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 3px 0 #e2d6f7, inset 0 -6px 8px rgba(0,0,0,.1), inset 0 6px 6px rgba(255,255,255,.5); }
.swatch.on { outline: 4px solid var(--pink); outline-offset: 2px; transform: scale(1.08); }

/* pills */
.pill { display: inline-block; font-weight: 900; font-size: 14px; padding: 5px 12px; border-radius: 999px; color: #fff; text-transform: uppercase; letter-spacing: .5px; }
.pill.r-common { background: var(--common); }
.pill.r-rare { background: var(--rare); }
.pill.r-epic { background: var(--epic); color: #6b3d00; }
.pill.r-legendary { background: var(--rainbow); background-size: 200% 100%; animation: rainbowSlide 3s linear infinite; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pill.playing { background: var(--green); }

/* cubes */
.cube-wrap { width: 100%; aspect-ratio: 1; }
.cube-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.wobble { animation: wobble 2.8s ease-in-out infinite; transform-origin: 50% 92%; }
@keyframes wobble {
  0%, 100% { transform: scale(1, 1); }
  20% { transform: scale(1.045, .955); }
  40% { transform: scale(.97, 1.03) rotate(-1.2deg); }
  60% { transform: scale(1.02, .98) rotate(1deg); }
  80% { transform: scale(.99, 1.01); }
}
.boing { animation: boing .6s cubic-bezier(.3,1.6,.5,1) !important; }
@keyframes boing { 0% { transform: scale(1.3, .65); } 40% { transform: scale(.88, 1.14); } 70% { transform: scale(1.05, .96); } 100% { transform: scale(1, 1); } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px; }
.cube-card {
  position: relative; border: 4px solid var(--rc, var(--common)); border-radius: 24px;
  background: linear-gradient(180deg, #fff, #f7f2ff);
  padding: 8px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 5px 0 rgba(90,50,150,.12), 0 10px 18px rgba(90,50,150,.1);
  transition: transform .12s;
}
.cube-card:active { transform: scale(.94); }
.cube-card.r-common { --rc: var(--common); }
.cube-card.r-rare { --rc: var(--rare); box-shadow: 0 5px 0 rgba(164,92,255,.25), 0 0 18px rgba(164,92,255,.25); }
.cube-card.r-epic { --rc: var(--epic); box-shadow: 0 5px 0 rgba(240,170,0,.3), 0 0 20px rgba(255,194,26,.35); background: linear-gradient(180deg, #fffdf2, #fff6d8); }
.cube-card.r-legendary, .mini.r-legendary, .lab-pick.r-legendary, .detail.r-legendary .detail-cube {
  border-color: transparent;
  background: linear-gradient(180deg, #fff, #fbf3ff) padding-box, var(--rainbow) border-box;
  background-size: 100% 100%, 200% 100%;
  animation: rainbowBorder 2.5s linear infinite;
}
@keyframes rainbowBorder { from { background-position: 0 0, 0% 0; } to { background-position: 0 0, 100% 0; } }
@keyframes rainbowSlide { from { background-position: 0% 0; } to { background-position: 100% 0; } }
.cube-card .cube-name { font-weight: 900; font-size: 14px; text-align: center; line-height: 1.15; min-height: 2.3em; display: flex; align-items: center; }
.cube-card.locked { background: linear-gradient(180deg, #f4f0fb, #ebe4f7); }
.cube-card.locked .cube-name { opacity: .55; }
.cube-card.used { opacity: .45; }
.dupes { position: absolute; top: -10px; right: -8px; background: linear-gradient(180deg, #ff8fca, #ff4fa0); color: #fff; font-weight: 900; font-size: 13px; border-radius: 999px; padding: 4px 9px; border: 3px solid #fff; box-shadow: 0 3px 6px rgba(209,47,124,.35); white-space: nowrap; }
.have { position: absolute; top: -10px; right: -8px; background: #6b3fe0; color: #fff; font-weight: 900; font-size: 14px; border-radius: 999px; padding: 3px 9px; border: 3px solid #fff; }
.spare { position: absolute; top: -10px; left: -8px; background: var(--green); color: #fff; font-weight: 900; font-size: 12px; border-radius: 999px; padding: 3px 8px; border: 3px solid #fff; }
.wish-badge { position: absolute; bottom: 38px; right: 4px; font-size: 22px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.wish-glow { animation: wishGlow 1.1s ease-in-out infinite alternate; }
@keyframes wishGlow { from { box-shadow: 0 0 0 3px #fff, 0 0 10px 4px rgba(255,79,160,.45); } to { box-shadow: 0 0 0 3px #fff, 0 0 26px 10px rgba(255,79,160,.8); } }
.cube-card.wished { outline: 4px dashed #ff6fb5; outline-offset: 3px; }

/* shelves */
.shelf { position: relative; background: rgba(255,255,255,.55); border-radius: 28px; padding: 14px 14px 0; margin-bottom: 26px; border: 3px solid rgba(255,255,255,.85); }
.shelf-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.shelf-count { font-weight: 900; font-size: 18px; color: var(--ink-soft); }
.shelf .grid { padding-bottom: 18px; }
.ledge { height: 18px; margin: 0 -14px; border-radius: 0 0 25px 25px; background: linear-gradient(180deg, #ffd2ec, #f1a8d6); box-shadow: inset 0 4px 0 rgba(255,255,255,.6); }
.s-rare .ledge { background: linear-gradient(180deg, #dcc4ff, #b88cff); }
.s-epic .ledge { background: linear-gradient(180deg, #ffeaa0, #ffc93d); }
.s-legendary .ledge { background: var(--rainbow); background-size: 200% 100%; animation: rainbowSlide 4s linear infinite; }
.filters { margin-bottom: 14px; }

/* home */
.home-hero { display: flex; align-items: center; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.hero-cube { width: min(46vw, 210px); cursor: pointer; filter: drop-shadow(0 12px 18px rgba(120,60,180,.25)); }
.hello { flex: 1; min-width: 240px; max-width: 520px; }
.hello p { font-size: 24px; font-weight: 800; }
.hello .sub { font-size: 17px; color: var(--ink-soft); }
.daily { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 26px; padding: 12px 16px; box-shadow: var(--shadow); max-width: 560px; margin: 0 auto 18px; border: 3px solid #fff; }
.daily b { display: block; font-size: 18px; }
.daily small { color: var(--ink-soft); font-weight: 700; }
.daily > div { flex: 1; }
.daily .btn { margin: 0; }
.daily.ready { background: linear-gradient(180deg, #fffbe0, #fff0b3); border-color: #ffe27a; }
.daily.small { padding: 8px 14px; margin-bottom: 10px; }
.gift { font-size: 40px; animation: giftHop 1.4s ease-in-out infinite; }
.gift.sleep { animation: none; filter: grayscale(.6); opacity: .7; }
@keyframes giftHop { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-8px) rotate(-8deg); } 60% { transform: translateY(0) rotate(6deg); } }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; max-width: 760px; margin: 0 auto; }
.tile { border: 0; border-radius: 26px; padding: 16px 10px; min-height: 110px; font-weight: 900; font-size: 18px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 6px 0 rgba(0,0,0,.12), 0 12px 20px rgba(90,50,150,.15); text-shadow: 0 2px 0 rgba(0,0,0,.15); position: relative; overflow: hidden; }
.tile::after { content: ""; position: absolute; left: 12%; right: 12%; top: 6px; height: 34%; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0)); }
.tile span { font-size: 40px; }
.tile:active { transform: translateY(4px); }
.t-collection { background: linear-gradient(180deg, #7cc6ff, #3a8dff); }
.t-lab { background: linear-gradient(180deg, #6ff0a6, #1fbf6e); }
.t-trade { background: linear-gradient(180deg, #ffb37a, #ff7a3c); }
.t-wishlist { background: linear-gradient(180deg, #ff9fd6, #ff4fa0); }
.t-trophies { background: linear-gradient(180deg, #ffe27a, #ffb300); color: #6b3d00; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.t-players { background: linear-gradient(180deg, #c3a6ff, #7b4dff); }

/* mystery box */
.mystery-box { width: min(68vw, 280px); margin: 6px auto 4px; cursor: pointer; filter: drop-shadow(0 14px 18px rgba(120,60,180,.3)); transform-origin: 50% 90%; }
.mystery-box.idle { opacity: .9; animation: floaty 3s ease-in-out infinite; cursor: default; }
.mystery-box.ready { animation: readyGlow 1.6s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes readyGlow { 0%, 100% { transform: scale(1); filter: drop-shadow(0 14px 18px rgba(120,60,180,.3)) drop-shadow(0 0 0 #fff); } 50% { transform: scale(1.04); filter: drop-shadow(0 14px 18px rgba(120,60,180,.3)) drop-shadow(0 0 22px #fff6a8); } }
.mystery-box.shake { animation: shake .45s ease-in-out; }
@keyframes shake { 0% { transform: rotate(0); } 15% { transform: rotate(-12deg) translateX(-8px); } 35% { transform: rotate(10deg) translateX(8px); } 55% { transform: rotate(-8deg) translateX(-5px); } 75% { transform: rotate(5deg) translateX(3px); } 100% { transform: rotate(0); } }
.mystery-box.pop { animation: popBox .55s ease-in forwards; }
.mystery-box.pop .lid { animation: lidOff .4s ease-out forwards; }
@keyframes popBox { 0% { transform: scale(1); } 40% { transform: scale(1.25, .8); } 70% { transform: scale(.9, 1.2); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes lidOff { to { transform: translateY(-60px) rotate(-25deg); } }
.box-svg .lid { transform-box: fill-box; transform-origin: center; }
.tap-dots { display: flex; justify-content: center; gap: 12px; margin: 8px 0; }
.tap-dots i { width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: inset 0 3px 4px rgba(90,50,150,.2); }
.tap-dots i.on { background: radial-gradient(circle at 35% 35%, #fff 0 15%, #ff6fb5 30%, #d12f7c); box-shadow: 0 0 10px #ff6fb5; }
.box-buttons { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 10px 0 18px; }
.odds { max-width: 480px; margin: 0 auto 18px; }
.odd { display: grid; grid-template-columns: 120px 1fr 52px; align-items: center; gap: 10px; margin: 8px 0; }
.odd b { text-align: right; font-size: 18px; }
.odd-bar { height: 16px; border-radius: 999px; background: #f0e9fb; overflow: hidden; }
.odd-bar i { display: block; height: 100%; border-radius: 999px; min-width: 6px; }
.odd-bar.r-common i { background: var(--common); }
.odd-bar.r-rare i { background: var(--rare); }
.odd-bar.r-epic i { background: var(--epic); }
.odd-bar.r-legendary i { background: var(--rainbow); background-size: 400% 100%; }

/* reveal */
.reveal { position: relative; text-align: center; padding: 10px 0 10px; overflow: hidden; border-radius: 30px; }
.rays { position: absolute; left: 50%; top: 190px; width: 900px; height: 900px; margin: -450px 0 0 -450px; z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,255,255,.7) 0 10deg, rgba(255,255,255,0) 10deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 60%); mask-image: radial-gradient(circle, #000 20%, transparent 60%);
  animation: spin 14s linear infinite; }
.reveal.r-rare .rays { background: repeating-conic-gradient(rgba(190,140,255,.6) 0 10deg, rgba(255,255,255,0) 10deg 20deg); }
.reveal.r-epic .rays { background: repeating-conic-gradient(rgba(255,205,60,.65) 0 10deg, rgba(255,255,255,0) 10deg 20deg); }
.reveal.r-legendary .rays { background: repeating-conic-gradient(#ff5f7e 0 8deg, #ffd21f 8deg 16deg, #5fd068 16deg 24deg, #4da8ff 24deg 32deg, #a56bff 32deg 40deg); animation-duration: 6s; opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }
.banner-stars { font-size: .8em; }
.coin-ico { display: inline-block; position: relative; width: 1em; height: 1em; border-radius: 50%; vertical-align: -.14em; background: radial-gradient(circle at 35% 30%, #fffbd6, #ffd21f 45%, #e8a000); box-shadow: inset 0 0 0 .07em #f0a800, inset 0 -.08em 0 rgba(150,80,0,.25), 0 .05em .1em rgba(150,80,0,.3); }
.coin-ico::after { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; font-size: .58em; font-style: normal; color: #d88a00; text-shadow: 0 1px 0 rgba(255,255,255,.6); }
.coins .coin-ico { font-size: 26px; }
.rarity-banner { display: inline-block; font-weight: 900; font-size: 26px; padding: 8px 22px; border-radius: 999px; color: #fff; background: var(--common); box-shadow: 0 5px 0 rgba(0,0,0,.12); animation: dropIn .5s cubic-bezier(.3,1.6,.5,1); }
.reveal.r-rare .rarity-banner { background: var(--rare); }
.reveal.r-epic .rarity-banner { background: var(--epic); color: #6b3d00; }
.reveal.r-legendary .rarity-banner { background: var(--rainbow); background-size: 200% 100%; animation: dropIn .5s cubic-bezier(.3,1.6,.5,1), rainbowSlide 2s linear infinite; text-shadow: 0 2px 3px rgba(0,0,0,.3); }
.reveal-cube { width: min(62vw, 260px); margin: 10px auto 0; animation: popIn .7s cubic-bezier(.3,1.7,.5,1); filter: drop-shadow(0 16px 20px rgba(120,60,180,.3)); }
@keyframes popIn { 0% { transform: scale(0) rotate(-20deg); } 70% { transform: scale(1.12) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes dropIn { 0% { transform: translateY(-40px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.reveal-name { font-size: 34px; font-weight: 900; margin: 8px 0; text-shadow: 0 3px 0 #fff; }
.sticker { display: inline-block; font-weight: 900; padding: 6px 16px; border-radius: 14px; margin: 0 4px 10px; transform: rotate(-3deg); box-shadow: 0 4px 0 rgba(0,0,0,.1); }
.sticker.new { background: #ff4fa0; color: #fff; font-size: 22px; animation: wiggle 1s ease-in-out infinite; }
.sticker.dup { background: #fff; color: var(--ink); font-size: 17px; }
.sticker.wish { background: #ffe3f3; color: #d12f7c; font-size: 17px; }
@keyframes wiggle { 0%, 100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.08); } }
.fact { font-size: 19px; font-weight: 700; max-width: 460px; margin: 6px auto 12px; color: var(--ink); background: rgba(255,255,255,.7); border-radius: 18px; padding: 10px 16px; }
.squish-meter { display: flex; align-items: center; gap: 10px; max-width: 420px; margin: 0 auto 12px; font-weight: 900; }
.squish-meter .sbar { flex: 1; height: 18px; border-radius: 999px; background: #fff; box-shadow: inset 0 2px 4px rgba(90,50,150,.2); overflow: hidden; }
.squish-meter .sbar i { display: block; height: 100%; background: linear-gradient(90deg, #5fd0ff, #ff6fb5); border-radius: 999px; }
.squish-meter b { font-size: 24px; color: #d12f7c; min-width: 40px; }

/* modal */
#modal-root { position: relative; z-index: 60; }
.modal-back { position: fixed; inset: 0; background: rgba(60,30,110,.4); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 60; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { background: linear-gradient(180deg, #fff, #f8f2ff); border-radius: 32px; max-width: 460px; width: 100%; max-height: 92vh; overflow: auto; padding: 22px; text-align: center; animation: popIn .4s cubic-bezier(.3,1.5,.5,1); box-shadow: 0 20px 50px rgba(60,30,110,.35); border: 4px solid #fff; }
.detail-cube { width: min(56vw, 220px); margin: 0 auto 8px; border-radius: 30px; padding: 6px; border: 4px solid transparent; cursor: pointer; }
.detail h2 { font-size: 30px; font-weight: 900; }
.detail .stars { font-size: 20px; }
.detail .btn { display: flex; width: 100%; }
.owned-line { font-size: 18px; font-weight: 800; }

/* lab */
.lab-picker { display: flex; gap: 10px; overflow-x: auto; padding: 8px 4px 12px; margin-bottom: 4px; scrollbar-width: thin; }
.lab-pick { flex: none; width: 70px; height: 70px; border-radius: 18px; border: 4px solid var(--common); background: #fff; padding: 4px; }
.lab-pick.r-rare { border-color: var(--rare); }
.lab-pick.r-epic { border-color: var(--epic); }
.lab-pick.on { transform: scale(1.12); box-shadow: 0 0 0 4px #ff6fb5; }
.lab-stage { display: flex; align-items: flex-end; justify-content: center; gap: 26px; padding: 20px 0 10px; }
.meter { position: relative; width: 52px; height: 280px; border-radius: 26px; background: #fff; border: 5px solid #fff; box-shadow: inset 0 4px 8px rgba(90,50,150,.2), var(--shadow); overflow: visible; }
.meter .fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; border-radius: 22px; background: linear-gradient(0deg, #5fd0ff, #b17bff 50%, #ff4fa0); box-shadow: inset 0 4px 0 rgba(255,255,255,.4); }
.meter .target { position: absolute; left: -14px; right: -14px; height: 6px; margin-bottom: -3px; background: #ffc21a; border-radius: 3px; box-shadow: 0 0 10px #ffd21f; transition: bottom .3s; }
.meter .target span { position: absolute; right: -30px; top: -14px; font-size: 26px; }
.lab-cube-area { position: relative; width: min(56vw, 260px); }
.lab-cube { width: 100%; aspect-ratio: 1; transform-origin: 50% 96%; touch-action: none; cursor: pointer; filter: drop-shadow(0 14px 16px rgba(120,60,180,.3)); outline: none; }
.lab-pop { position: absolute; left: 0; right: 0; top: -10px; text-align: center; font-weight: 900; font-size: 24px; color: #d12f7c; opacity: 0; pointer-events: none; text-shadow: 0 2px 0 #fff; }
.lab-pop b { font-size: 40px; }
.lab-pop.show { animation: floatUp 1.1s ease-out; }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(20px) scale(.6); } 20% { opacity: 1; transform: translateY(0) scale(1.1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px); } }
.score-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.score-chips span { background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 800; box-shadow: 0 3px 0 #e2d6f7; }
.score-chips span.done { background: linear-gradient(180deg, #e8fff1, #c4f5d8); }
.lab-result { text-align: center; max-width: 480px; margin: 0 auto; }
.result-cube { width: 180px; margin: 0 auto; }
.result-word { font-size: 30px; font-weight: 900; color: #ff4fa0; margin: 8px 0; }
.big-score { font-size: 22px; font-weight: 900; }
.big-score b { display: block; font-size: 64px; color: #6b3fe0; line-height: 1; text-shadow: 0 4px 0 #fff; }
.earned { font-size: 30px; font-weight: 900; color: #b07800; margin: 6px 0; }
.earned small { display: block; font-size: 14px; color: var(--ink-soft); }

/* trade */
.my-code { text-align: center; }
.my-code p { font-weight: 900; font-size: 18px; margin-bottom: 6px; }
.code-big, .code-slots { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }
.code-big span, .code-slots .slot { width: 58px; height: 68px; display: grid; place-items: center; border-radius: 18px; font-size: 38px; font-weight: 900; }
.code-big span { background: linear-gradient(180deg, #b994ff, #7b4dff); color: #fff; box-shadow: 0 5px 0 #5a2fd1; text-shadow: 0 2px 0 rgba(0,0,0,.2); }
.code-slots .slot { background: #fff; border: 4px dashed #d9c9f5; color: #6b3fe0; }
.code-slots .slot.full { border-style: solid; border-color: #b994ff; animation: popIn .3s; }
.keypad { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; max-width: 520px; margin: 12px auto 6px; }
.key { border: 0; min-height: 54px; border-radius: 16px; background: #fff; font-weight: 900; font-size: 24px; box-shadow: 0 4px 0 #e2d6f7; }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 #e2d6f7; }
.key.back { background: #ffe3f3; grid-column: span 1; }
.pretend-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.pretend { border: 0; background: #fff; border-radius: 22px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 5px 0 #e2d6f7; min-height: 120px; }
.pretend .avatar { font-size: 44px; }
.pretend b { font-size: 17px; }
.pretend small { color: var(--ink-soft); font-weight: 800; }
.hist { background: #fff; border-radius: 20px; padding: 10px 14px; margin-bottom: 10px; }
.hist-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.hist-head .avatar { font-size: 26px; }
.hist-head small { margin-left: auto; color: var(--ink-soft); font-weight: 800; }
.hist-row { display: flex; align-items: center; gap: 10px; margin: 4px 0; }
.hist-row > span { width: 44px; font-weight: 900; color: var(--ink-soft); }
.minis { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.hist .minis { justify-content: flex-start; }
.mini { position: relative; display: inline-block; width: 52px; height: 52px; border-radius: 14px; border: 3px solid var(--common); background: #fff; padding: 2px; }
.mini.r-rare { border-color: var(--rare); }
.mini.r-epic { border-color: var(--epic); }
.mini .x { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; background: #ff4fa0; color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; border: 2px solid #fff; }
.mini .cnt { position: absolute; bottom: -8px; right: -8px; background: #22c578; color: #fff; font-size: 12px; font-weight: 900; border-radius: 999px; padding: 1px 6px; border: 2px solid #fff; }
.trade-head { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 26px; padding: 10px 14px; box-shadow: var(--shadow); margin-bottom: 12px; flex-wrap: wrap; }
.who-box { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who-box .avatar { font-size: 36px; flex: none; }
.who-box b { display: block; font-size: 18px; line-height: 1.1; }
.who-box small { display: block; color: var(--ink-soft); font-weight: 800; font-size: 13px; }
.trade-head { flex-wrap: nowrap; }
.swap-arrow { font-size: 32px; font-weight: 900; color: #ff4fa0; }
.trade-head .leave { margin-left: auto; }
.chat { display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.6); border-radius: 22px; padding: 10px 12px; min-height: 64px; margin-bottom: 8px; }
.bubble { display: flex; align-items: center; gap: 8px; max-width: 80%; animation: popIn .3s; }
.bubble .txt { background: #fff; padding: 8px 14px; border-radius: 18px 18px 18px 4px; font-weight: 800; font-size: 17px; box-shadow: 0 3px 0 #e2d6f7; }
.bubble .who { font-size: 26px; }
.bubble.me { align-self: flex-end; flex-direction: row-reverse; }
.bubble.me .txt { background: linear-gradient(180deg, #ffd6ee, #ffb3dc); border-radius: 18px 18px 4px 18px; }
.phrases { margin-bottom: 14px; }
.phrase-row { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.phrase-row::-webkit-scrollbar { display: none; }
.phrase-row.emojis > :first-child { margin-left: auto; }
.phrase-row.emojis > :last-child { margin-right: auto; }
.card .grid { padding: 8px 6px; margin-bottom: 8px; }
.phrase { flex: none; white-space: nowrap; }
.phrase { border: 0; background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 15px; min-height: 44px; box-shadow: 0 3px 0 #e2d6f7; }
.phrase.emoji { font-size: 22px; padding: 4px 10px; }
.phrase:active { transform: translateY(2px); }
.trade-trays { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side { background: var(--card); border-radius: 24px; padding: 12px; box-shadow: var(--shadow); }
.side.give { border: 4px solid #ffb3dc; }
.side.get { border: 4px solid #a9d6ff; }
.side h3 { display: flex; justify-content: space-between; align-items: baseline; }
.side h3 small { color: var(--ink-soft); }
.tray { display: flex; flex-wrap: wrap; gap: 10px; min-height: 66px; align-items: center; padding: 6px; background: rgba(255,255,255,.7); border-radius: 18px; }
.tray-item { border: 0; background: none; padding: 0; }
.tray-empty { color: var(--ink-soft); font-weight: 700; font-size: 14px; width: 100%; text-align: center; }
.accept-status { margin-top: 8px; font-weight: 900; font-size: 15px; }
.accept-status .ok { color: #11934f; }
.accept-status .wait { color: var(--ink-soft); }
.fair-meter { max-width: 560px; margin: 16px auto 6px; text-align: center; }
.fm-track { position: relative; display: flex; justify-content: space-between; height: 34px; border-radius: 999px; background: linear-gradient(90deg, #ffa14d, #ffe27a 30%, #6ff0a6 50%, #ffb3dc 72%, #ff4fa0); padding: 0 14px; align-items: center; font-weight: 900; font-size: 13px; color: rgba(60,30,90,.75); box-shadow: inset 0 3px 6px rgba(0,0,0,.12); }
.needle { position: absolute; top: -8px; width: 14px; height: 50px; margin-left: -7px; border-radius: 8px; background: #fff; border: 4px solid #6b3fe0; box-shadow: 0 3px 6px rgba(0,0,0,.25); transition: left .45s cubic-bezier(.3,1.5,.5,1); }
.fm-label { font-weight: 900; font-size: 24px; margin-top: 12px; }
.fair-meter.fair .fm-label { color: #11934f; }
.fair-meter.gen .fm-label, .fair-meter.super .fm-label { color: #d12f7c; }
.fair-meter.uneven .fm-label, .fair-meter.uneven2 .fm-label { color: #d06a00; }
.accept-row .btn { margin-bottom: 4px; }
.tabs { display: flex; gap: 8px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.tab { border: 0; border-radius: 999px; padding: 10px 20px; font-weight: 900; font-size: 17px; background: #fff; box-shadow: 0 4px 0 #e2d6f7; min-height: 50px; }
.tab.on { background: linear-gradient(180deg, #7cc6ff, #2f8fff); color: #fff; box-shadow: 0 4px 0 #1b68d6; }
.pick-grid { background: rgba(255,255,255,.5); border-radius: 24px; padding: 16px 12px; }
.trade-done { text-align: center; max-width: 560px; margin: 0 auto; }
.trade-done h2 { font-size: 30px; color: #ff4fa0; }
.swap-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 12px 0; }
.swap-row > div:not(.swap-arrow) { flex: 1; background: #fff; border-radius: 20px; padding: 10px; }
.swap-row p { font-weight: 900; margin-bottom: 6px; }
.handoff h2 { font-size: 28px; font-weight: 900; }
.handoff .btn { display: flex; width: 100%; }
.handoff .row .btn { width: auto; flex: 1; }
.pass-anim { font-size: 70px; animation: giftHop 1.2s ease-in-out infinite; }

/* wishlist */
.spare-row { background: #fff; border-radius: 22px; padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.spare-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.spare-head .avatar { font-size: 32px; }
.spare-head small { color: var(--ink-soft); font-weight: 800; }
.wish-glow-wrap { display: inline-block; border-radius: 16px; animation: wishGlow 1.1s ease-in-out infinite alternate; }

/* trophies */
.trophy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.trophy { background: rgba(255,255,255,.6); border-radius: 24px; padding: 14px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 4px solid rgba(255,255,255,.8); }
.trophy .medal { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-size: 40px; background: #ebe4f7; filter: grayscale(1); opacity: .6; }
.trophy.on { background: linear-gradient(180deg, #fffbe6, #fff0b8); border-color: #ffe27a; box-shadow: 0 6px 0 rgba(240,170,0,.25), 0 0 22px rgba(255,210,31,.35); }
.trophy.on .medal { filter: none; opacity: 1; background: radial-gradient(circle at 35% 30%, #fff8c8, #ffd21f 55%, #f0a800); box-shadow: 0 5px 0 #d18a00, inset 0 -4px 0 rgba(0,0,0,.1); animation: medalShine 3s ease-in-out infinite; }
@keyframes medalShine { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-6deg) scale(1.05); } }
.trophy b { font-size: 16px; }
.trophy small { color: var(--ink-soft); font-weight: 700; font-size: 13px; }
.trophy .when { font-size: 12px; font-weight: 900; color: #b07800; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat-grid div { background: #fff; border-radius: 18px; padding: 12px; text-align: center; }
.stat-grid b { display: block; font-size: 32px; color: #6b3fe0; }
.stat-grid small { font-weight: 800; color: var(--ink-soft); }

/* players + setup */
.player-list { display: flex; flex-direction: column; gap: 12px; max-width: 620px; margin: 0 auto 16px; }
.player { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 24px; padding: 12px 14px; box-shadow: var(--shadow); border: 4px solid #fff; }
.player.on { border-color: #ffb3dc; }
.player .pinfo { flex: 1; min-width: 0; }
.player .pinfo b { display: block; font-size: 19px; }
.player .pinfo small { color: var(--ink-soft); font-weight: 800; }
.avatar.big { font-size: 44px; }
.screen-setup .card { max-width: 640px; margin: 0 auto; text-align: center; }
.setup-hero { width: 150px; margin: 0 auto 10px; }
.preview { display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff; border-radius: 22px; padding: 10px; margin-bottom: 14px; font-size: 24px; }

/* toasts and effects */
#toasts { position: fixed; top: 84px; left: 0; right: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 12px; }
.toast { background: #fff; color: var(--ink); font-weight: 900; font-size: 18px; padding: 12px 20px; border-radius: 999px; box-shadow: 0 10px 24px rgba(60,30,110,.25); animation: dropIn .4s cubic-bezier(.3,1.6,.5,1); transition: opacity .4s, transform .4s; text-align: center; }
.toast.gold { background: linear-gradient(180deg, #fffbe0, #ffe27a); }
.toast .t-emoji { font-size: 24px; }
.toast.out { opacity: 0; transform: translateY(-20px); }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
#fx i { position: absolute; border-radius: 50%; animation: confetti 1.2s cubic-bezier(.2,.7,.4,1) forwards; }
@keyframes confetti { 0% { transform: translate(-50%, -50%) scale(.4); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 120px)) rotate(540deg) scale(1); opacity: 0; } }

#selftest-output { position: fixed; left: 8px; right: 8px; bottom: 90px; z-index: 100; background: #fff; border-radius: 16px; padding: 12px; font-size: 12px; max-height: 40vh; overflow: auto; white-space: pre-wrap; }

/* small phones */
@media (max-width: 520px) {
  #main { padding: 10px 10px 118px; }
  .trade-trays { gap: 8px; }
  .side { padding: 10px 8px; }
  .side h3 { font-size: 17px; }
  .mini { width: 46px; height: 46px; }
  .tray { gap: 8px; }
  .trade-head { padding: 8px 10px; gap: 6px; }
  .who-box .avatar { font-size: 28px; }
  .who-box b { font-size: 15px; }
  .swap-arrow { font-size: 24px; }
  .rarity-banner { font-size: 22px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 12px; }
  .cube-card .cube-name { font-size: 13px; }
  .nav-btn { font-size: 11px; }
  .nav-btn .ico { font-size: 24px; }
  .keypad { grid-template-columns: repeat(5, 1fr); }
  .code-big span, .code-slots .slot { width: 52px; height: 62px; font-size: 32px; }
  .odd { grid-template-columns: 104px 1fr 46px; }
  .nick { font-size: 15px; }
  .coins { font-size: 19px; padding: 7px 12px; }
  #topbar { gap: 6px; padding: 8px 10px; }
  .me { padding-right: 10px; }
  .icon-btn { width: 42px; height: 42px; font-size: 19px; }
  .btn.huge { font-size: 21px; padding: 14px 24px; }
  .lab-stage { gap: 18px; }
  .meter { height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .wobble, #bubbles i { animation: none; }
}

/* ---------- Daily Coin Pack ---------- */
.pack-card { max-width: 560px; margin: 0 auto 18px; padding: 14px 16px; }
.pack-card.ready { background: linear-gradient(180deg, #fffbe0, #fff0b3); border-color: #ffe27a; }
.pack-head { display: flex; align-items: center; gap: 12px; }
.pack-head > div { flex: 1; }
.pack-head b { display: block; font-size: 19px; }
.pack-head .btn { margin: 0; }
.pack-ico { font-size: 34px; }
.pack-card.ready .pack-ico { animation: wiggle 1.2s ease-in-out infinite; display: inline-block; }
.streak { display: inline-block; font-weight: 900; font-size: 15px; color: #e0570b; }
.streak.big { font-size: 24px; margin: 4px 0; }
.pack-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin: 12px 0 4px; }
.pday { background: #fff; border-radius: 14px; padding: 6px 2px; text-align: center; box-shadow: inset 0 -3px 0 #eadfff; }
.pday small { display: block; font-size: 11px; font-weight: 800; color: var(--ink-soft); }
.pday b { font-size: 17px; font-weight: 900; color: #b07800; }
.pday.got { background: #d9f8e6; box-shadow: inset 0 -3px 0 #9fe3bb; }
.pday.got b { color: #11934f; }
.pday.today { background: #ffe27a; box-shadow: inset 0 -3px 0 #f2c33b, 0 0 0 3px #ffb300; animation: bump 1.4s ease-in-out infinite; }
.pday.big:not(.got) { background: linear-gradient(180deg, #fff3a0, #ffc21a); }
.pack-reveal h2 { margin-top: 0; }
.coin-pack { border: 0; width: 180px; height: 230px; margin: 10px auto 18px; display: grid; place-items: center; border-radius: 26px; cursor: pointer;
  background: linear-gradient(160deg, #ffe27a, #ffb300 55%, #ff9a3c); box-shadow: 0 10px 0 #d18a00, 0 20px 34px rgba(255,170,0,.4), inset 0 0 0 6px rgba(255,255,255,.5);
  animation: wiggle 1.4s ease-in-out infinite; }
.coin-pack span { font-size: 92px; line-height: 1; }
.coin-pack small { font-weight: 900; font-size: 22px; color: #6b3d00; letter-spacing: 2px; }
.coin-pack.gold { background: linear-gradient(160deg, #fff6c9, #ffd21f 40%, #ff5fa8 75%, #a56bff); }
.coin-pack.pop { animation: popBox .55s ease-in forwards; }
.earned.big { font-size: 54px; }

/* ---------- Squish Lab help ---------- */
.lab-help { max-width: 560px; margin: 0 auto 14px; text-align: center; }
.lab-help h3 { margin: 0 0 8px; }
.steps { list-style: none; padding: 0; margin: 0 0 12px; text-align: left; display: grid; gap: 8px; }
.steps li { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 18px; padding: 8px 12px; font-size: 16px; }
.steps li span { font-size: 28px; flex: none; width: 36px; text-align: center; }
.lab-rounds { text-align: center; font-weight: 800; color: #7a4b00; background: #fff6c9; border-radius: 999px; padding: 6px 14px; width: fit-content; margin: 0 auto 6px; }
.lab-rounds.none { background: #f1ecfa; color: var(--ink-soft); }
.lab-call { min-height: 1.4em; transition: transform .15s; }
.lab-call.now { color: #e0207a; transform: scale(1.12); }
.meter .target.near { background: #ff4fa0; box-shadow: 0 0 18px #ff4fa0; height: 10px; margin-bottom: -5px; }
.hold-me { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); background: #ff4fa0; color: #fff; font-weight: 900; padding: 6px 14px; border-radius: 999px; pointer-events: none; animation: bounceHint 1s ease-in-out infinite; white-space: nowrap; box-shadow: 0 4px 0 #c42d78; }
@keyframes bounceHint { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8px); } }

/* ---------- Trade: friend's answer (no chat) ---------- */
.friend-note { text-align: center; background: #fff; border-radius: 18px; padding: 8px 14px; font-weight: 700; width: fit-content; margin: 0 auto 10px; }

/* ---------- Share ---------- */
.share-btn { margin-top: 8px; }
.share-box h2 { margin-top: 0; }
.share-preview img { width: 100%; max-width: 320px; border-radius: 18px; box-shadow: var(--shadow); }
.share-box .btn { display: inline-flex; text-decoration: none; margin: 8px 4px; }
@media (prefers-reduced-motion: reduce) { .pday.today, .coin-pack, .hold-me, .pack-card.ready .pack-ico { animation: none; } }

/* ---------- SquishTrade brand ---------- */
.slogan { text-align: center; font-weight: 900; color: #7a5aa8; letter-spacing: .5px; margin: -8px 0 14px; font-size: 17px; }
.logo span { margin-left: 0; }

/* ---------- Install card ---------- */
.install-card { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 auto 18px; padding: 12px 14px; position: relative; }
.install-card > div { flex: 1; }
.install-card b { display: block; font-size: 17px; }
.install-card small { color: var(--ink-soft); font-weight: 700; }
.install-card .btn { margin: 0; }
.ic-ico { font-size: 30px; }
.x-btn { border: 0; background: transparent; font-size: 18px; color: var(--ink-soft); cursor: pointer; padding: 4px 6px; }

/* ---------- Phone-to-phone trading ---------- */
.phone-trade { text-align: center; }
.phone-trade h3 { margin-top: 0; }
.phone-trade h4 { margin: 16px 0 6px; }
.pending { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff; border-radius: 18px; padding: 6px 10px; margin: 6px 0; flex-wrap: wrap; }
.pending .mini { width: 38px; height: 38px; display: inline-block; vertical-align: middle; }
.pending .btn { margin: 0; }
.link-maker h2, .incoming h2 { margin-top: 0; }
.pick-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; max-height: 46vh; overflow: auto; padding: 4px; margin: 8px 0 12px; }
.lm-pick { border: 0; background: #fff; border-radius: 18px; padding: 8px 4px; cursor: pointer; box-shadow: inset 0 -3px 0 #eadfff; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lm-pick .mini { width: 56px; height: 56px; position: relative; display: block; }
.lm-pick small { font-size: 12px; font-weight: 800; line-height: 1.1; }
.lm-pick.wished { box-shadow: inset 0 -3px 0 #ffb3dc, 0 0 0 3px #ff8fd0; }
.link-share { margin: 10px 0; }
.link-share .btn { display: inline-flex; text-decoration: none; margin: 6px 4px; }
.incoming .swap-row small { display: block; font-weight: 800; }
.incoming .result-cube, .link-maker .result-cube { width: 150px; margin: 6px auto; }
.mystery-box.small-box { width: 180px; margin: 0 auto; cursor: pointer; }

/* ---------- Christmas Drop ---------- */
.xmas-btn { background: linear-gradient(180deg, #ff6b78, #e0283c); box-shadow: 0 6px 0 #a3172a, 0 12px 20px rgba(224,40,60,.3); }
.xmas-btn small { background: rgba(255,255,255,.25); border-radius: 999px; padding: 2px 10px; margin-left: 6px; }
.xmas-banner { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 auto 18px; padding: 12px 16px; background: linear-gradient(135deg, #e9fff1, #ffe9ec); border-color: #ffd0d6; }
.xmas-banner > div { flex: 1; }
.xmas-banner b { display: block; font-size: 18px; color: #c41d33; }
.xmas-banner small { color: var(--ink-soft); font-weight: 700; }
.xmas-banner .btn { margin: 0; }
.xb-ico { font-size: 36px; }
.xmas-pill { background: linear-gradient(90deg, #e0283c, #1fae5b); color: #fff; }
.shelf.s-xmas { background: linear-gradient(180deg, rgba(255,240,242,.7), rgba(234,255,242,.7)); border-radius: 26px; }
#snow { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
#snow i { position: absolute; top: -30px; color: #fff; text-shadow: 0 0 6px rgba(140,170,255,.8); font-style: normal; animation: snowfall linear infinite; opacity: .9; }
@keyframes snowfall { 0% { transform: translateY(-30px) rotate(0); } 100% { transform: translateY(110vh) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #snow { display: none; } }

/* ---------- Welcome page and setup steps ---------- */
.screen-welcome { max-width: 560px; margin: 0 auto; padding-top: 18px; text-align: center; }
.welcome-cubes { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: 4px 0 14px; }
.welcome-cubes .cube-wrap { width: 92px; }
.welcome-cubes .cube-wrap.mid { width: 128px; }
.welcome-card { text-align: left; }
.how { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.how li { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 20px; padding: 10px 14px; }
.how li span { font-size: 32px; flex: none; }
.how b { display: block; font-size: 18px; }
.how small { color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.small-print { text-align: center; font-size: 13px; margin: 10px 0 0; }
.gift-waiting { text-align: center; background: linear-gradient(180deg, #fffbe0, #fff0b3); border-color: #ffe27a; font-size: 17px; }
.small-logo { font-size: clamp(32px, 7vw, 44px); margin: 14px 0 10px; }
.steps-dots { display: flex; justify-content: center; gap: 8px; margin: -4px 0 12px; }
.steps-dots i { width: 34px; height: 8px; border-radius: 4px; background: #e6dcf7; }
.steps-dots i.on { background: #ff5fb4; }
.chip-grid.second { margin-top: 10px; }
.welcome-modal h2 { margin: 6px 0; }

/* ---------- First steps checklist ---------- */
.steps-card { max-width: 560px; margin: 0 auto 18px; padding: 14px 16px; border-color: #d9f8e6; }
.steps-head { display: flex; align-items: center; justify-content: space-between; }
.steps-head h3, .steps-card h3 { margin: 0 0 8px; }
.steps-head span { font-weight: 900; color: #11934f; background: #d9f8e6; border-radius: 999px; padding: 2px 12px; }
.step-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: #fff; border-radius: 16px; padding: 10px 12px; margin: 6px 0; font: inherit; font-weight: 800; color: var(--ink); text-align: left; cursor: pointer; box-shadow: inset 0 -3px 0 #eadfff; }
.step-row span:nth-child(2) { flex: 1; }
.step-row i { font-style: normal; font-size: 22px; color: var(--ink-soft); }
.step-row .tick { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #f4effc; font-size: 18px; flex: none; }
.step-row.ok { opacity: .7; cursor: default; box-shadow: none; }
.step-row.ok .tick { background: #1fbf6e; color: #fff; font-weight: 900; }
.step-row.ok span:nth-child(2) { text-decoration: line-through; }
.steps-card.all-done { text-align: center; background: linear-gradient(180deg, #fffbe0, #fff0b3); border-color: #ffe27a; }

/* ---------- Home footer ---------- */
.home-foot { text-align: center; color: var(--ink-soft); font-weight: 700; font-size: 14px; margin: 18px 0 8px; }
.home-foot a, .small-print a, .screen-players a { color: #7b4dff; }

/* ---------- Trade screen tidy-up (phones) ---------- */
.fm-track { margin-bottom: 26px; }
.fm-track > span { position: relative; top: 30px; font-size: 12px; color: var(--ink-soft); }
.fm-label { margin-top: 4px; }
.tabs { flex-wrap: nowrap; }
.tabs .tab { flex: 1 1 0; min-width: 0; padding: 8px 10px; font-size: 15px; line-height: 1.15; white-space: normal; }
.friend-note { max-width: 92%; }

/* ---------- Advent calendar ---------- */
.advent-card { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 auto 18px; padding: 12px 16px; background: linear-gradient(135deg, #fff1f3, #effff4); border-color: #ffd0d6; }
.advent-card > div { flex: 1; }
.advent-card b { display: block; font-size: 17px; color: #c41d33; }
.advent-card small { color: var(--ink-soft); font-weight: 700; }
.advent-card .btn { margin: 0; }
.advent-card.ready .ac-ico { animation: wiggle 1.2s ease-in-out infinite; display: inline-block; }
.ac-ico { font-size: 32px; }
.advent-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 520px; margin: 10px auto 14px; padding: 12px; border-radius: 26px;
  background: linear-gradient(160deg, #1f7a46, #145c34); box-shadow: inset 0 0 0 4px #ffd21f, var(--shadow); }
.door { position: relative; aspect-ratio: 1; border: 0; border-radius: 14px; display: grid; place-items: center; font: inherit; color: #fff; cursor: default;
  background: linear-gradient(160deg, #e0283c, #a3172a); box-shadow: inset 0 -4px 0 rgba(0,0,0,.2); }
.door .dn { font-weight: 900; font-size: 22px; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.door .dl { position: absolute; bottom: 4px; right: 6px; font-size: 12px; opacity: .8; }
.door.locked { filter: saturate(.6) brightness(.85); }
.door.ready { cursor: pointer; background: linear-gradient(160deg, #ffd21f, #f0a800); color: #6b3d00; box-shadow: inset 0 -4px 0 #c47f00, 0 0 0 3px #fff6c8; }
.door.ready .dn { text-shadow: 0 1px 0 #fff6c8; }
.door.today { animation: bump 1.4s ease-in-out infinite; }
.door.opened { background: #f3fff6; color: #145c34; box-shadow: inset 0 0 0 3px #9fe3bb; }
.door.opened .dn { position: absolute; top: 4px; left: 8px; font-size: 13px; text-shadow: none; }
.door.opened .dr { font-size: 26px; }
.door.swing { animation: doorSwing .45s ease-in forwards; transform-origin: left center; }
@keyframes doorSwing { to { transform: perspective(300px) rotateY(-80deg); opacity: .4; } }
.advent-reveal .ar-ico { font-size: 72px; margin: 6px 0; }
.advent-reveal .result-cube { width: 150px; margin: 6px auto; }

/* ---------- Showcase ---------- */
.showcase { max-width: 560px; margin: 0 auto 14px; text-align: center; padding: 12px 14px; background: linear-gradient(180deg, #fffbe0, #fff6d0); border-color: #ffe27a; }
.showcase h3 { margin: 0 0 8px; }
.sc-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 6px; }
.sc-slot { aspect-ratio: 1; border-radius: 20px; display: grid; place-items: center; }
.sc-slot.full { border: 0; background: #fff; cursor: pointer; padding: 6px; box-shadow: inset 0 -3px 0 #f2c33b; }
.sc-slot.sc-open { border: 3px dashed #f2c33b; color: #e0a800; font-size: 32px; font-weight: 900; }
.designer-badge { display: inline-block; margin: 8px 0 0; background: linear-gradient(90deg, #ff9fd6, #b49bff); color: #fff; font-weight: 900; border-radius: 999px; padding: 4px 14px; }

/* ---------- Backup ---------- */
.backup-card { max-width: 560px; margin: 18px auto; text-align: center; }
.backup-card h3 { margin-top: 0; }
.code-box { width: 100%; min-height: 110px; border-radius: 16px; border: 2px solid #e6dcf7; padding: 10px; font: 13px/1.4 ui-monospace, Menlo, monospace; word-break: break-all; resize: vertical; margin: 8px 0; }
.file-btn { display: inline-flex; cursor: pointer; margin: 4px 0; }
.hint.error { color: #d1243a; min-height: 1.2em; }
.backup-nudge { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 0 auto 18px; padding: 12px 16px; }
.backup-nudge > span { font-size: 30px; }
.backup-nudge > div { flex: 1; }
.backup-nudge b { display: block; }
.backup-nudge small { color: var(--ink-soft); font-weight: 700; }
.backup-nudge .btn { margin: 0; }
.link-btn { border: 0; background: none; color: #7b4dff; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- News (next drop + Sophia's Pick) ---------- */
.news-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 560px; margin: 0 auto 18px; }
.news-row.one { grid-template-columns: 1fr; }
.news { margin: 0; padding: 12px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 3px solid #fff; font: inherit; color: var(--ink); }
.news b { font-size: 16px; }
.news small { color: var(--ink-soft); font-weight: 700; font-size: 12.5px; line-height: 1.3; }
.news small a { color: #7b4dff; word-break: break-all; }
.news-tag { font-size: 12px; font-weight: 900; color: #fff; background: linear-gradient(90deg, #ff5fb4, #a56bff); border-radius: 999px; padding: 3px 10px; }
.news.drop { background: linear-gradient(180deg, #fff0f6, #ffe1ee); border-color: #ffc2dc; }
.news.drop .news-tag { background: linear-gradient(90deg, #ff4f8a, #ff8fb8); }
.news-emoji { font-size: 44px; line-height: 1.1; }
.news-cube { width: 70px; }
button.news { cursor: pointer; }
.next-drop-line { text-align: center; font-weight: 800; color: #d12f7c; margin: 4px 0 0; }
.install-card small b { display: inline; font-size: inherit; }
