/* =============================================================
   BitBlox
   Chunky, blocky, bright. Every button is a block with a hard shadow
   under it that it presses down into. Nothing under 16px.
   ============================================================= */
:root{
  --ink: #1b2233;
  --ink-2: #3a4560;
  --paper: #fffaf0;
  --paper-2: #f3ead6;
  --paper-3: #e6dbc2;
  --sky: #8ecbff;
  --grass: #5cc23a;
  --grass-d: #3f9a25;
  --sun: #ffe600;
  --red: #ff5b5b;
  --blue: #00a6f0;
  --pink: #ff7afa;
  --muted: #6b6558;
  --r: 14px;
  --shadow: 0 5px 0 var(--ink);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

*{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body{ margin: 0; height: 100%; }
body{
  background: var(--sky);
  color: var(--ink);
  font: 800 17px/1.35 Nunito, system-ui, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
input{ user-select: text; -webkit-user-select: text; }
button{ font: inherit; color: inherit; cursor: pointer; }
a{ color: inherit; }
[hidden]{ display: none !important; }
img{ -webkit-user-drag: none; }

/* ---------------- splash ---------------- */
#splash{
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: linear-gradient(#8ecbff, #cdeaff 70%, #5cc23a 70%, #4fb030);
  transition: opacity .45s;
}
#splash.gone{ opacity: 0; pointer-events: none; }
#splash.behind{ z-index: 5; }
.splash-mark{ width: 132px; height: 132px; object-fit: contain; animation: hop 1.1s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(27,34,51,.25)); }
.splash-name{ font: 400 54px/1 'Lilita One', sans-serif; letter-spacing: .5px; color: var(--paper);
  text-shadow: 0 4px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink); }
.splash-bar{ width: 220px; height: 18px; border: 3px solid var(--ink); border-radius: 6px; background: var(--paper); overflow: hidden; }
.splash-bar i{ display: block; height: 100%; width: 5%; background: var(--sun); transition: width .3s; }
.splash-err{ font: 400 26px 'Lilita One', sans-serif; color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink); border-radius: var(--r); padding: 12px 20px; box-shadow: var(--shadow); }
.splash-detail{ font-size: 18px; color: var(--ink); }
@keyframes hop{ 0%,100%{ transform: translateY(0) } 45%{ transform: translateY(-16px) rotate(-4deg) } 60%{ transform: translateY(0) scaleY(.92) } }

/* ---------------- the game screen ---------------- */
.game{ position: fixed; inset: 0; }
#canvas{ display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }

.hud-top-left{
  position: absolute; top: calc(12px + var(--safe-t)); left: calc(12px + var(--safe-l));
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; z-index: 3;
}
.pill{
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 16px 0 10px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink);
  font: 400 21px 'Lilita One', sans-serif;
}
.pill svg{ width: 28px; height: 28px; }
.pill:active{ transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

.lead-card{
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink);
  min-width: 190px; text-align: left;
}
.lead-card img{ width: 50px; height: 50px; border-radius: 8px; background: var(--paper-2); }
.lead-meta{ display: flex; flex-direction: column; gap: 5px; flex: 1; }
.lead-name{ font: 400 17px 'Lilita One', sans-serif; white-space: nowrap; }
.hpbar, .bar{ display: block; height: 12px; border: 2.5px solid var(--ink); border-radius: 6px; background: #d9d2c2; overflow: hidden; }
.hpbar i, .bar i{ display: block; height: 100%; width: 100%; background: #35c759; transition: width .55s ease, background .3s; }
.bar.xp i{ background: var(--blue); }
.bar.sm{ height: 10px; }

.today{
  position: absolute; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  z-index: 3; padding: 0 16px; background: var(--sun);
}
.today:active{ transform: translateX(-50%) translateY(3px); }
.today-rank{ background: var(--ink); color: var(--sun); border-radius: 7px; padding: 1px 8px; font-size: 18px; }

.hud-right{
  position: absolute; top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r));
  display: flex; flex-direction: column; gap: 10px; z-index: 3;
}
.hud-btn{
  width: 58px; height: 58px; display: grid; place-items: center;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
}
.hud-btn svg{ width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.hud-btn:active{ transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
#btnParty{ background: #ffe08a; }
#btnRanks{ background: #ffffff; border-radius: 16px; }
#btnRanks .ranks-ico{ width: 34px; height: 34px; stroke-width: 1.8; }
#btnWallet{ background: #c9f2b8; }

.hud-bottom-left{ position: absolute; left: calc(14px + var(--safe-l)); bottom: calc(18px + var(--safe-b)); z-index: 3; }
.round-btn{
  width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
}
.round-btn svg{ width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.round-btn.on{ background: var(--grass); }
.round-btn.busy{ opacity: .6; }

.act-btn{
  position: absolute; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%);
  min-width: 170px; min-height: 64px; padding: 0 30px; z-index: 3;
  font: 400 28px 'Lilita One', sans-serif; color: var(--paper);
  background: var(--red); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 6px 0 var(--ink);
  text-shadow: 0 2px 0 rgba(27,34,51,.35);
  animation: pop .25s ease-out;
}
.act-btn:active{ transform: translateX(-50%) translateY(4px); box-shadow: 0 2px 0 var(--ink); }
@keyframes pop{ from{ transform: translateX(-50%) scale(.6); } to{ transform: translateX(-50%) scale(1); } }

.game.in-battle .hud-top-left, .game.in-battle .hud-right, .game.in-battle .today,
.game.in-battle .hud-bottom-left, .game.in-battle .act-btn{ display: none; }

/* ---------------- the block wipe between world and battle ---------------- */
.wipe{
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(12, 1fr);
}
.wipe i{ background: var(--ink); transform: scale(0); }
.wipe.in i{ animation: wipeIn .42s cubic-bezier(.5,0,.5,1) forwards; }
.wipe.out i{ transform: scale(1.02); animation: wipeOut .42s cubic-bezier(.5,0,.5,1) forwards; }
@keyframes wipeIn{ to{ transform: scale(1.02); } }
@keyframes wipeOut{ to{ transform: scale(0); } }

/* ---------------- battle overlay ---------------- */
.battle{ position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.battle > *{ pointer-events: auto; }
.b-card{
  position: absolute; width: min(340px, 58vw);
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink);
  padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 6px;
  border-left: 12px solid var(--type, #ccc);
  animation: slideIn .35s ease-out;
}
.b-wild{ top: calc(16px + var(--safe-t)); left: calc(14px + var(--safe-l)); }
.b-mine{ right: calc(14px + var(--safe-r)); bottom: calc(262px + var(--safe-b)); }
@keyframes slideIn{ from{ opacity: 0; transform: translateY(-10px); } }
.b-row{ display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.b-name{ font: 400 23px 'Lilita One', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-lv{ font: 400 20px 'Lilita One', sans-serif; color: var(--ink-2); }
.b-hp{ display: flex; align-items: center; gap: 8px; }
.b-hp .bar{ flex: 1; height: 14px; }
.b-hp-k{ font: 400 16px 'Lilita One', sans-serif; background: var(--ink); color: var(--sun); padding: 0 6px; border-radius: 5px; }
.b-hpnum{ text-align: right; font: 400 20px 'Lilita One', sans-serif; }
.b-xp{ height: 8px; background: #d9d2c2; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; }
.b-xp i{ display: block; height: 100%; width: 0; background: var(--blue); transition: width .6s ease; }

.b-panel{
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l));
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(transparent, rgba(27,34,51,.25));
}
.b-msg{
  width: 100%; max-width: 760px; margin: 0 auto; min-height: 76px; text-align: left;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink);
  padding: 14px 18px; font: 800 21px/1.3 Nunito, sans-serif;
}
.b-msg.talking::after{ content: ''; float: right; width: 12px; height: 12px; margin-top: 8px;
  border-right: 4px solid var(--ink); border-bottom: 4px solid var(--ink); transform: rotate(45deg); }
.b-menu{ width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.b-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.b-btn{
  min-height: 62px; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink);
  font: 400 25px 'Lilita One', sans-serif; color: var(--paper); text-shadow: 0 2px 0 rgba(27,34,51,.35);
}
.b-btn:active{ transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.b-btn:disabled{ opacity: .45; }
.b-btn.fight{ background: var(--red); }
.b-btn.bag{ background: #f5a623; }
.b-btn.blox{ background: var(--grass); }
.b-btn.run{ background: var(--blue); }
.b-btn.back{ background: var(--paper); color: var(--ink); text-shadow: none; min-height: 54px; font-size: 21px; }
.b-btn.move{
  background: var(--paper); color: var(--ink); text-shadow: none; text-align: left;
  padding: 8px 14px; display: flex; flex-direction: column; gap: 2px; border-left: 12px solid var(--type);
}
.mv-name{ font-size: 22px; line-height: 1.1; }
.mv-meta{ display: flex; justify-content: space-between; font: 800 16px Nunito, sans-serif; color: var(--ink-2); }
.b-list{ display: flex; flex-direction: column; gap: 8px; max-height: 44vh; overflow: auto; }
.b-row-btn{
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 14px 6px 8px; text-align: left;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
  font: 400 21px 'Lilita One', sans-serif;
}
.b-row-btn:disabled{ opacity: .45; }
.b-row-btn .grow{ display: flex; flex-direction: column; gap: 5px; }
.pm-lv{ color: var(--ink-2); font-size: 18px; margin-left: 6px; }
.b-empty{ padding: 18px; text-align: center; font: 400 22px 'Lilita One', sans-serif; background: var(--paper);
  border: 3px solid var(--ink); border-radius: 14px; }

/* ---------------- common pieces ---------------- */
.grow{ flex: 1; min-width: 0; }
.qty{ font: 400 21px 'Lilita One', sans-serif; }
.thumb{ width: 56px; height: 56px; border-radius: 10px; background: var(--paper-2); object-fit: contain; flex: none; }
.thumb.lg{ width: 76px; height: 76px; }
.thumb.sm{ width: 44px; height: 44px; border-radius: 9px; }
.stack{ display: flex; flex-direction: column; gap: 10px; }
.sub{ font: 400 22px 'Lilita One', sans-serif; margin: 20px 0 10px; }
.muted-line{ color: var(--muted); font-size: 17px; margin: -4px 0 8px; }

.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 20px; text-decoration: none;
  background: var(--sun); color: var(--ink);
  border: 3px solid var(--ink); border-radius: 13px; box-shadow: var(--shadow);
  font: 400 21px 'Lilita One', sans-serif; letter-spacing: .2px;
}
.btn:active{ transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled{ opacity: .45; }
.btn.ghost{ background: var(--paper); }
.btn.blue{ background: var(--blue); color: var(--paper); }
.btn.block{ width: 100%; }
.btn.big{ min-height: 64px; font-size: 26px; }
.btn.busy{ opacity: .7; pointer-events: none; }
.btn.busy::after{ content: ''; width: 18px; height: 18px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 4px; animation: spin .7s linear infinite; }
.btn-row{ display: flex; gap: 10px; margin-top: 16px; }
.btn-row.wrap{ flex-wrap: wrap; }
.btn-row.wrap .btn{ flex: 1 1 140px; }
.btn-row.grid2{ display: grid; grid-template-columns: 1fr 1fr; }
.file-btn{ cursor: pointer; }

.input{
  width: 100%; min-height: 56px; padding: 0 16px;
  background: #fff; color: var(--ink); border: 3px solid var(--ink); border-radius: 13px;
  font: 800 19px Nunito, sans-serif; outline: none;
}
.input:focus{ box-shadow: 0 0 0 4px rgba(61,123,255,.35); }
.input.big{ min-height: 64px; font-size: 24px; }
.field{ display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.field > span{ font: 400 19px 'Lilita One', sans-serif; }
.amount-wrap{ display: flex; gap: 8px; }
.amount-wrap .input{ flex: 1; }
.btn.max{ padding: 0 14px; }
.avail{ font: 400 19px 'Lilita One', sans-serif; color: var(--ink-2); text-align: right; margin: -6px 0 10px; }

.kv{ display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 6px; font-size: 18px; }
.kv b{ font: 400 20px 'Lilita One', sans-serif; font-weight: 400; }
.row-between{ display: flex; align-items: center; justify-content: space-between; margin: 10px 0 2px; }
.big-lv{ font: 400 30px 'Lilita One', sans-serif; }

.type-chip{
  display: inline-block; width: max-content; padding: 1px 10px; border-radius: 8px;
  background: var(--type, #ccc); border: 2.5px solid var(--ink);
  font: 400 16px 'Lilita One', sans-serif; letter-spacing: .5px;
}
.type-chip.lg{ font-size: 19px; padding: 3px 14px; }

.spin{ width: 38px; height: 38px; margin: 26px auto; border: 5px solid var(--ink); border-right-color: transparent; border-radius: 8px; animation: spin .8s linear infinite; }
@keyframes spin{ to{ transform: rotate(360deg); } }
.empty-big{ padding: 30px 10px; text-align: center; font: 400 23px 'Lilita One', sans-serif; color: var(--ink-2); }

/* ---------------- sheets ---------------- */
.scrim{
  position: fixed; inset: 0; z-index: 30; background: rgba(27,34,51,.42);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .2s ease-out;
}
.scrim.closing{ animation: fadeOut .25s ease-in forwards; }
@keyframes fade{ from{ opacity: 0; } }
@keyframes fadeOut{ to{ opacity: 0; } }
.sheet{
  width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--paper); border: 3px solid var(--ink); border-bottom: 0; border-radius: 22px 22px 0 0;
  box-shadow: 0 -4px 0 rgba(27,34,51,.15);
  animation: rise .28s cubic-bezier(.2,.9,.3,1.15);
  padding-bottom: var(--safe-b);
}
.sheet.wide{ max-width: 680px; }
.sheet.closing{ animation: sink .25s ease-in forwards; }
@keyframes rise{ from{ transform: translateY(100%); } }
@keyframes sink{ to{ transform: translateY(100%); } }
.grabber{ width: 56px; height: 7px; border-radius: 4px; background: var(--paper-3); margin: 10px auto 0; flex: none; }
.sheet-head{ display: flex; align-items: center; justify-content: space-between; padding: 6px 16px 8px 20px; flex: none; }
.sheet-head h2{ margin: 0; font: 400 30px 'Lilita One', sans-serif; letter-spacing: .3px; }
.x-btn{
  width: 50px; height: 50px; display: grid; place-items: center; flex: none;
  background: var(--paper-2); border: 3px solid var(--ink); border-radius: 13px; box-shadow: 0 3px 0 var(--ink);
}
.x-btn svg{ width: 24px; height: 24px; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; }
.x-btn:active{ transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.sheet-body{ padding: 6px 20px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-foot{ display: flex; gap: 10px; padding: 12px 20px 18px; border-top: 3px solid var(--paper-3); flex: none; }
.sheet-foot .btn{ flex: 1; }
.lead-text{ font-size: 19px; margin: 4px 0 8px; }
@media (min-width: 720px){
  .scrim{ align-items: center; }
  .sheet{ border-bottom: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 var(--ink); max-height: 84vh; }
  .grabber{ display: none; }
  .sheet-head{ padding-top: 16px; }
}

/* ---------------- party ---------------- */
.blox-card{
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px 10px 10px; text-align: left;
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink);
}
.blox-card:active{ transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.blox-card.down{ background: #f1e4e4; }
.blox-card.off, .blox-card:disabled{ opacity: .45; }
.blox-card .grow{ display: flex; flex-direction: column; gap: 6px; }
.bc-top{ display: flex; justify-content: space-between; gap: 8px; }
.bc-name{ font: 400 22px 'Lilita One', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-lv{ font: 400 20px 'Lilita One', sans-serif; color: var(--ink-2); flex: none; }
.bc-hp{ font: 400 17px 'Lilita One', sans-serif; color: var(--ink-2); align-self: flex-end; }
.blox-hero{
  display: grid; place-items: center; height: 210px; border-radius: 18px; border: 3px solid var(--ink);
  background: radial-gradient(circle at 50% 70%, #fff 0 30%, transparent 31%), linear-gradient(var(--type), #fff 160%);
}
.blox-hero img{ width: 200px; height: 200px; }
.stat-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.stat-grid div{ display: flex; flex-direction: column; padding: 10px 14px; background: var(--paper-2); border: 3px solid var(--ink); border-radius: 13px; }
.stat-grid span{ font-size: 16px; color: var(--ink-2); }
.stat-grid b{ font: 400 24px 'Lilita One', sans-serif; font-weight: 400; }
.move-row{
  display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px;
  background: #fff; border: 3px solid var(--ink); border-left: 12px solid var(--type); border-radius: 13px;
  font: 400 20px 'Lilita One', sans-serif;
}
.move-row .pp{ min-width: 54px; text-align: right; }

/* ---------------- items ---------------- */
.item-row, .shop-row{
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 70px; padding: 8px 12px; text-align: left;
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink);
  font: 400 21px 'Lilita One', sans-serif;
}
.item-row:not([data-static]):active{ transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.shop-row{ flex-wrap: wrap; }
.shop-name{ display: block; font: 400 21px 'Lilita One', sans-serif; }
.shop-meta{ display: flex; align-items: center; gap: 6px; font: 400 19px 'Lilita One', sans-serif; color: var(--ink-2); }
.have{ margin-left: 8px; background: var(--paper-2); border-radius: 7px; padding: 0 8px; }
.stepper{ display: inline-flex; align-items: center; gap: 4px; }
.step{
  width: 46px; height: 46px; border: 3px solid var(--ink); border-radius: 11px; background: var(--paper-2);
  font: 400 26px/1 'Lilita One', sans-serif; box-shadow: 0 3px 0 var(--ink);
}
.step:active{ transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.step-n{ min-width: 34px; text-align: center; font: 400 22px 'Lilita One', sans-serif; }
.btn.buy{ min-width: 100px; }
@media (max-width: 460px){
  .shop-row .stepper{ margin-left: 56px; }
  .shop-row .btn.buy{ flex: 1; }
}
.wallet-pill{
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 16px;
  background: var(--sun); border: 3px solid var(--ink); border-radius: 12px; font: 400 24px 'Lilita One', sans-serif;
}
.coin-ico{ width: 24px; height: 24px; border: 3px solid var(--ink); border-radius: 5px; background: var(--sun) linear-gradient(var(--ink), var(--ink)) center / 4px 10px no-repeat; flex: none; }
.coin-ico.sm{ width: 20px; height: 20px; border-width: 2.5px; background-size: 3px 8px; }

.item-ico{ position: relative; width: 48px; height: 48px; flex: none; border: 3px solid var(--ink); border-radius: 9px; overflow: hidden;
  background: linear-gradient(var(--top, var(--red)) 0 44%, var(--ink) 44% 56%, #fffaf0 56%); }
.item-ico::after{ content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; transform: translate(-50%, -50%);
  background: #fffaf0; border: 3px solid var(--ink); border-radius: 3px; }
.item-ico.super_tokeblock{ --top: var(--blue); }
.item-ico.ultra_tokeblock{ --top: #2b2b2b; background: linear-gradient(#2b2b2b 0 20%, var(--sun) 20% 30%, #2b2b2b 30% 44%, var(--ink) 44% 56%, #fffaf0 56%); }
.item-ico.potion, .item-ico.super_potion, .item-ico.revive{ border-radius: 9px 9px 12px 12px; background: linear-gradient(#e6dbc2 0 26%, var(--pot, #b36bff) 26%); }
.item-ico.super_potion{ --pot: #ffb020; }
.item-ico.revive{ --pot: var(--sun); background: linear-gradient(#e6dbc2 0 26%, #fff 26% 30%, var(--sun) 30%); }
.item-ico.potion::after, .item-ico.super_potion::after, .item-ico.revive::after{ width: 16px; height: 6px; top: 12%; border-width: 2.5px; background: #b9ab8c; }

/* ---------------- leaderboard ---------------- */
.tabs{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.tab{
  min-height: 50px; border: 3px solid var(--ink); border-radius: 12px; background: var(--paper-2);
  font: 400 19px 'Lilita One', sans-serif; box-shadow: 0 3px 0 var(--ink);
}
.tab.on{ background: var(--sun); }
.pool-card{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.pool-card > div{ display: flex; flex-direction: column; padding: 10px 14px; background: var(--ink); color: var(--paper); border-radius: 14px; }
.pool-card .k{ font-size: 16px; color: #c8cfdf; }
.pool-card .v{ font: 400 28px 'Lilita One', sans-serif; color: var(--sun); }
.me-card{ padding: 12px 14px; margin-bottom: 12px; background: var(--sun); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); }
.me-top{ display: flex; align-items: center; gap: 12px; font: 400 24px 'Lilita One', sans-serif; }
.me-split{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rank-list{ display: flex; flex-direction: column; gap: 8px; }
.rank-row{
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px;
}
.rank-row.me{ background: #fff4c7; }
.place{
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  background: var(--paper-2); border: 3px solid var(--ink); border-radius: 10px; font: 400 21px 'Lilita One', sans-serif;
}
.place.p1{ background: var(--sun); }
.place.p2{ background: #dfe6ef; }
.place.p3{ background: #f0b27a; }
.thumb.person{ background: #dbeeff; }
.r-name{ display: block; font: 400 20px 'Lilita One', sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-sub{ display: block; font-size: 16px; color: var(--ink-2); }
.r-split{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sp-chip{ display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 2px; background: var(--paper-2); border: 2px solid var(--ink); border-radius: 9px; font: 400 16px 'Lilita One', sans-serif; }
.sp-chip img{ width: 26px; height: 26px; }
.sp-chip.lg{ font-size: 18px; background: var(--paper); }
.sp-chip.lg img{ width: 32px; height: 32px; }
.r-right{ display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.r-xp{ font: 400 19px 'Lilita One', sans-serif; }
.r-prize{ font: 400 19px 'Lilita One', sans-serif; color: #1f8f3a; }
.r-prize.big{ font-size: 26px; color: var(--ink); }
.paid{ font: 400 16px 'Lilita One', sans-serif; padding: 2px 10px; border-radius: 8px; border: 2px solid var(--ink); background: var(--paper-2); text-decoration: none; }
.paid.paid{ background: #b8f0c4; }
.paid.failed{ background: #ffd0d0; }
.prize-row{ display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; text-decoration: none; }
.link-row{ display: block; margin-top: 14px; text-align: center; font: 400 19px 'Lilita One', sans-serif; }

/* ---------------- wallet ---------------- */
.acct-card{ padding: 14px; background: var(--ink); color: var(--paper); border-radius: 16px; }
.acct-id{ font: 400 26px 'Lilita One', sans-serif; letter-spacing: .5px; word-break: break-all; }
.acct-card .btn-row{ margin-top: 12px; }
.acct-card .btn{ flex: 1; padding: 0 10px; font-size: 19px; }
.qr{ margin-top: 12px; background: #fff; border-radius: 12px; padding: 8px; }
.qr svg{ display: block; width: 100%; max-width: 280px; margin: 0 auto; height: auto; }
.bal-list{ margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.bal-total{ font: 400 40px 'Lilita One', sans-serif; text-align: center; margin: 4px 0; }
.bal-row{ display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 6px 14px 6px 8px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; font: 400 21px 'Lilita One', sans-serif; }
.bal-n{ display: flex; flex-direction: column; align-items: flex-end; }
.bal-n b{ font-weight: 400; }
.bal-n span{ font-size: 16px; color: var(--ink-2); font-family: Nunito, sans-serif; font-weight: 800; }
.near-ico{ width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: var(--ink); color: #fff; border-radius: 22px; font: 400 24px 'Lilita One', sans-serif; }
.asset-pick{ display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 8px; margin-bottom: 14px; }
.asset-btn{ display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 4px 10px 4px 6px; background: #fff; border: 3px solid var(--ink); border-radius: 13px; font: 400 19px 'Lilita One', sans-serif; box-shadow: 0 3px 0 var(--ink); }
.asset-btn.on{ background: var(--sun); }
.quote{ padding: 4px 14px 10px; background: var(--paper-2); border: 3px solid var(--ink); border-radius: 14px; }

/* ---------------- settings ---------------- */
.look-grid{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 16px; }
.look{ aspect-ratio: 1; padding: 0; background: #dbeeff; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 0 3px 0 var(--ink); }
.look img{ width: 100%; height: 100%; display: block; }
.look.on{ background: var(--sun); outline: 4px solid var(--blue); outline-offset: 2px; }
.toggle-row{ display: flex; align-items: center; justify-content: space-between; min-height: 60px; font: 400 21px 'Lilita One', sans-serif; margin-bottom: 12px; }
.switch{ width: 72px; height: 42px; border: 3px solid var(--ink); border-radius: 22px; background: var(--paper-3); position: relative; padding: 0; }
.switch i{ position: absolute; top: 3px; left: 3px; width: 30px; height: 30px; border-radius: 15px; background: #fff; border: 3px solid var(--ink); transition: left .18s; }
.switch.on{ background: var(--grass); }
.switch.on i{ left: 33px; }

/* ---------------- first run ---------------- */
.onboard{
  position: fixed; inset: 0; z-index: 45; overflow-y: auto;
  display: flex; align-items: center; justify-content: center; padding: calc(20px + var(--safe-t)) 16px calc(20px + var(--safe-b));
  background: linear-gradient(#8ecbff, #cdeaff 72%, #5cc23a 72%, #4fb030);
}
.ob-card{ width: 100%; max-width: 460px; padding: 22px 20px; background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 var(--ink); }
.ob-card.wide{ max-width: 640px; }
.ob-logo{ font: 400 48px/1 'Lilita One', sans-serif; text-align: center; margin: 0 0 18px; color: var(--red);
  text-shadow: 0 4px 0 var(--ink); -webkit-text-stroke: 2px var(--ink); }
.ob-title{ font: 400 32px 'Lilita One', sans-serif; text-align: center; margin-bottom: 16px; }
.starter-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.starter{
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 12px;
  background: #fff; border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink);
}
.starter img{ width: 100%; max-width: 150px; aspect-ratio: 1; }
.starter.on{ background: color-mix(in srgb, var(--type) 40%, #fff); outline: 4px solid var(--ink); }
.st-name{ font: 400 22px 'Lilita One', sans-serif; }
.st-coin{ font: 400 17px 'Lilita One', sans-serif; color: var(--ink-2); }
@media (max-width: 420px){
  .starter-grid{ grid-template-columns: 1fr; }
  .starter{ flex-direction: row; padding: 8px 14px 8px 8px; }
  .starter img{ width: 84px; }
  .st-name{ flex: 1; text-align: left; }
}

/* ---------------- toasts ---------------- */
.toasts{ position: fixed; left: 0; right: 0; top: calc(78px + var(--safe-t)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast{
  max-width: 520px; padding: 12px 20px; background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink);
  font: 400 20px 'Lilita One', sans-serif; text-align: center; animation: toastIn .25s cubic-bezier(.2,.9,.3,1.3);
}
.toast.ok{ background: #c9f2b8; }
.toast.err{ background: #ffd0d0; }
.toast.gone{ opacity: 0; transform: translateY(-8px); transition: .3s; }
@keyframes toastIn{ from{ opacity: 0; transform: translateY(-14px) scale(.9); } }

/* ---------------- small phones ---------------- */
@media (max-width: 420px){
  .pill{ min-height: 46px; font-size: 19px; padding: 0 12px 0 8px; }
  .hud-btn{ width: 54px; height: 54px; }
  .lead-card{ min-width: 0; max-width: 200px; }
  .lead-name{ font-size: 16px; }
  .today{ top: auto; bottom: calc(18px + var(--safe-b)); left: auto; right: calc(12px + var(--safe-r)); transform: none; }
  .today:active{ transform: translateY(3px); }
  .b-card{ width: 64vw; }
  .b-name{ font-size: 20px; }
  .b-mine{ bottom: calc(250px + var(--safe-b)); }
  .act-btn{ bottom: calc(90px + var(--safe-b)); }
}
@media (max-height: 520px) and (orientation: landscape){
  .b-mine{ bottom: auto; top: calc(16px + var(--safe-t)); right: calc(14px + var(--safe-r)); }
  .b-grid{ grid-template-columns: repeat(4, 1fr); }
  .b-grid.moves{ grid-template-columns: 1fr 1fr; }
  .b-list{ max-height: 36vh; }
}

/* ---------------- money, chests, jumping, clothes ---------------- */
.coin-ico{ width: 30px; height: 20px; border: 2.5px solid var(--ink); border-radius: 4px;
  background: #2fbf5a linear-gradient(#fff, #fff) center / 5px 100% no-repeat; flex: none; }
.coin-ico.sm{ width: 24px; height: 16px; border-width: 2px; background-size: 4px 100%; }

.pop-text{
  position: absolute; z-index: 4; transform: translate(-50%, -50%); pointer-events: none;
  font: 400 30px 'Lilita One', sans-serif; color: #2fbf5a;
  text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink);
  animation: popUp 1.1s ease-out forwards;
}
@keyframes popUp{ from{ opacity: 1; margin-top: 0; } to{ opacity: 0; margin-top: -70px; } }

/* hold to open: a ring fills round the button */
.act-btn.holdable{ background: conic-gradient(var(--sun) calc(var(--p, 0) * 360deg), var(--red) 0); color: var(--paper); }
.act-btn.hot{ background: var(--grass); animation: hot .5s ease-in-out infinite alternate; }
@keyframes hot{ from{ transform: translateX(-50%) scale(1); } to{ transform: translateX(-50%) scale(1.08); } }

.jump-btn{
  position: absolute; right: calc(16px + var(--safe-r)); bottom: calc(22px + var(--safe-b)); z-index: 3;
  width: 84px; height: 84px; border-radius: 22px; display: grid; place-items: center;
  background: var(--sun); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); touch-action: none;
}
.jump-btn svg{ width: 40px; height: 40px; fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.jump-btn:active{ transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.game.in-battle .jump-btn{ display: none; }
@media (hover: none) and (pointer: coarse){
  .today{ top: auto; bottom: calc(18px + var(--safe-b)); left: calc(88px + var(--safe-l)); right: auto; transform: none; }
  .today:active{ transform: translateY(3px); }
  .act-btn{ bottom: calc(118px + var(--safe-b)); }
}

.tabs.four{ grid-template-columns: repeat(4, 1fr); }
.btn-row .span2{ grid-column: span 2; }
.sui-ico{ width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: #4da2ff; border-radius: 22px; }
.sui-ico svg{ width: 24px; height: 24px; fill: #fff; }

.wear-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.wear-card{
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px;
  background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink);
}
.wear-card.on{ background: #fff4c7; }
.wear-card img{ width: 100%; aspect-ratio: 1; background: #dbeeff; border-radius: 10px; }
.wear-name{ font: 400 19px 'Lilita One', sans-serif; text-align: center; min-height: 48px; display: grid; place-items: center; line-height: 1.1; }
.wear-card .btn{ min-height: 48px; font-size: 19px; padding: 0 8px; }

/* ---------------- level, skills, achievements ---------------- */
.level-pill{ gap: 10px; padding: 0 14px; background: var(--paper); }
.level-pill .mini-xp{ width: 64px; height: 12px; border: 2.5px solid var(--ink); border-radius: 6px; background: #d9d2c2; overflow: hidden; }
.level-pill .mini-xp i{ display: block; height: 100%; background: var(--blue); }
.level-pill.points{ background: var(--sun); }
.lvl-card{ padding: 12px 14px; margin-bottom: 14px; background: var(--ink); color: var(--paper); border-radius: 16px; }
.lvl-top{ display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.lvl-n{ font: 400 30px 'Lilita One', sans-serif; color: var(--sun); }
.lvl-title{ font: 400 22px 'Lilita One', sans-serif; flex: 1; }
.lvl-pts{ font: 400 18px 'Lilita One', sans-serif; background: var(--pink); color: var(--ink); border-radius: 8px; padding: 1px 10px; }
.lvl-pts:empty{ display: none; }
.lvl-card .bar{ border-color: var(--paper); }
.lvl-xp{ text-align: right; font-size: 16px; margin-top: 4px; color: #c8cfdf; }
.tabs.five{ grid-template-columns: repeat(5, 1fr); }
.tabs.five .tab{ font-size: 16px; padding: 0 2px; }
.tabs.five .tab.on{ background: var(--tc); }
.skill-card{ display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; background: #fff;
  border: 3px solid var(--ink); border-left: 12px solid var(--tc); border-radius: 14px; }
.skill-card .grow{ display: flex; flex-direction: column; gap: 4px; }
.sk-name{ font: 400 22px 'Lilita One', sans-serif; }
.sk-eff{ font-size: 17px; color: var(--ink-2); }
.pips{ display: flex; gap: 5px; }
.pips i{ width: 22px; height: 14px; border: 2.5px solid var(--ink); border-radius: 4px; background: var(--paper-2); }
.pips i.on{ background: var(--tc); }
.sk-btn{ min-width: 92px; }
.sk-btn.locked{ font-size: 16px; }
.ach-count{ font: 400 26px 'Lilita One', sans-serif; text-align: center; margin-bottom: 12px; }
.ach-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach-card{ position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; }
.ach-card.done{ background: #e9fbe6; }
.ach-badge{ position: absolute; top: -10px; right: -10px; width: 34px; height: 34px; border-radius: 10px; border: 3px solid var(--ink); background: var(--paper-2); display: grid; place-items: center; }
.ach-card.done .ach-badge{ background: #35c759; }
.ach-badge svg{ width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.ach-name{ font: 400 20px 'Lilita One', sans-serif; padding-right: 22px; }
.ach-meta{ font-size: 16px; color: var(--ink-2); }
.ach-reward{ display: flex; align-items: center; gap: 6px; font: 400 18px 'Lilita One', sans-serif; }

/* ---------------- resources ---------------- */
.res-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.res-cell{ display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; }
.res-ico{ width: 34px; height: 34px; border: 3px solid var(--ink); border-radius: 8px; background: var(--c); }
.res-n{ font: 400 24px 'Lilita One', sans-serif; }
.res-name{ font-size: 16px; color: var(--ink-2); }

/* ---------------- building ---------------- */
.build-bar{
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 10px calc(12px + var(--safe-r)) calc(12px + var(--safe-b)) calc(12px + var(--safe-l));
  background: linear-gradient(transparent, rgba(27,34,51,.35)); display: flex; flex-direction: column; gap: 10px;
}
.bb-swatches{ display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; -webkit-overflow-scrolling: touch; }
.bb-sw{ position: relative; flex: none; width: 58px; height: 58px; border: 3px solid var(--ink); border-radius: 12px; background: var(--c); box-shadow: 0 4px 0 var(--ink); }
.bb-sw.on{ outline: 4px solid var(--sun); outline-offset: 2px; }
.bb-sw.poor{ opacity: .45; }
.bb-n{ position: absolute; right: -6px; bottom: -8px; min-width: 26px; padding: 0 5px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 8px; font: 400 16px 'Lilita One', sans-serif; }
.bb-row{ display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; max-width: 520px; width: 100%; margin: 0 auto; }
.btn.red{ background: var(--red); color: var(--paper); }
.game.building .act-btn, .game.building .jump-btn, .game.building .hud-bottom-left, .game.building .today{ display: none; }

/* ---------------- vehicles ---------------- */
.speedo{
  position: absolute; left: 50%; top: calc(80px + var(--safe-t)); transform: translateX(-50%); z-index: 3;
  display: flex; align-items: baseline; gap: 8px; padding: 6px 18px;
  background: var(--ink); color: var(--paper); border-radius: 14px; box-shadow: 0 4px 0 rgba(27,34,51,.35);
}
.sp-n{ font: 400 34px 'Lilita One', sans-serif; color: var(--sun); }
.sp-u{ font: 400 18px 'Lilita One', sans-serif; }
.sp-alt{ font: 400 22px 'Lilita One', sans-serif; color: #8ff0ff; }
.sp-alt:empty{ display: none; }
.jump-btn.down{ bottom: calc(118px + var(--safe-b)); background: var(--paper); }
.veh-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.veh-card{ display: flex; flex-direction: column; gap: 8px; padding: 10px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); text-align: center; }
.veh-card.own{ background: #eef9ff; }
.veh-card img{ width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #dbeeff; border-radius: 10px; }
.veh-name{ font: 400 21px 'Lilita One', sans-serif; }
.btn-row.tight{ margin-top: 0; }
.btn-row.tight .btn{ flex: 1; padding: 0 8px; font-size: 18px; }
.veh-hero{ background: #dbeeff; border: 3px solid var(--ink); border-radius: 18px; }
.veh-hero img{ display: block; width: 100%; max-height: 260px; object-fit: contain; }
.swatches{ display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch{ aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 12px; }
.swatch.on{ outline: 4px solid var(--ink); outline-offset: 2px; }
.mod-row{ display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 6px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; font: 400 21px 'Lilita One', sans-serif; text-align: left; }
.mod-price{ display: flex; align-items: center; gap: 6px; font-size: 18px; }
.mod-row .switch{ pointer-events: none; }

/* ---------------- logo ---------------- */
.ob-logo{ display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--blue); }
.ob-logo img{ width: 64px; height: 64px; }
.logo-ico{ background: #fff; object-fit: contain; }
@media (max-width: 420px){
  .level-pill .mini-xp{ width: 44px; }
  .tabs.five .tab{ font-size: 14px; }
  .speedo{ top: auto; bottom: calc(210px + var(--safe-b)); }
}

/* ---------------- beta gate ---------------- */
.gate{ position: fixed; inset: 0; z-index: 48; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; background: #1b2233; }
.gate-video{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gate-shade{ position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(27,34,51,.15), rgba(27,34,51,.65)); }
.gate-card{ position: relative; width: 100%; max-width: 420px; padding: 22px 20px; display: flex; flex-direction: column; gap: 12px;
  background: rgba(255,250,240,.96); border: 3px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 var(--ink); }
.gate-brand{ display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.gate-brand img{ width: 64px; height: 64px; }
.gate-brand span{ font: 400 46px/1 'Lilita One', sans-serif; color: var(--blue); text-shadow: 0 3px 0 var(--ink); -webkit-text-stroke: 2px var(--ink); }
.beta-chip{ font: 400 18px 'Lilita One', sans-serif; background: var(--pink); border: 3px solid var(--ink); border-radius: 9px; padding: 2px 10px; transform: rotate(-6deg); }
.code-input{ text-align: center; letter-spacing: 6px; font: 400 32px 'Lilita One', sans-serif; text-transform: uppercase; }
.btn.social{ gap: 12px; white-space: nowrap; padding-inline: 14px; }
@media (max-width: 400px){ .btn.social{ font-size: 19px; } }
.btn.social svg{ width: 26px; height: 26px; }
.btn.social.google{ background: #fff; }
.btn.social.x{ background: #000; color: #fff; }

/* ---------------- chat ---------------- */
.hud-bottom-left{ display: flex; gap: 10px; }
.chat-btn{ position: relative; }
.chat-btn svg{ fill: none; }
.badge{ position: absolute; top: -8px; right: -8px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 9px;
  background: var(--red); color: #fff; border: 2.5px solid var(--ink); font: 400 16px/21px 'Lilita One', sans-serif; }
.chat-list{ display: flex; flex-direction: column; gap: 10px; min-height: 40vh; max-height: 56vh; overflow-y: auto; padding: 4px 2px; }
.chat-row{ display: flex; gap: 10px; align-items: flex-start; }
.chat-pfp{ flex: none; width: 50px; height: 50px; padding: 0; border: 3px solid var(--ink); border-radius: 12px; background: #dbeeff; overflow: hidden; }
.chat-pfp img{ width: 100%; height: 100%; display: block; }
.chat-body{ flex: 1; min-width: 0; padding: 8px 12px; background: #fff; border: 3px solid var(--ink); border-radius: 14px; }
.chat-row.mine .chat-body{ background: #fff4c7; }
.chat-head{ display: flex; align-items: center; gap: 8px; padding: 0; background: none; border: 0; }
.chat-name{ font: 400 18px 'Lilita One', sans-serif; }
.chat-lv{ font: 400 15px 'Lilita One', sans-serif; background: var(--ink); color: var(--sun); border-radius: 6px; padding: 0 7px; }
.chat-text{ font-size: 18px; line-height: 1.35; word-break: break-word; margin-top: 2px; user-select: text; }
.sheet-foot .chat-input{ flex: 1; }
.sheet-foot .chat-send{ flex: none; width: 64px; padding: 0; }
.chat-send svg{ width: 26px; height: 26px; fill: var(--ink); }

/* ---------------- profiles ---------------- */
.pf-top{ display: flex; gap: 14px; align-items: stretch; }
.pf-av{ width: 150px; height: 150px; flex: none; background: #dbeeff; border: 3px solid var(--ink); border-radius: 18px; }
.pf-meta{ flex: 1; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.pf-lv{ display: flex; align-items: baseline; gap: 10px; }
.pf-lv .lvl-n{ color: var(--blue); }
.pf-rank{ font: 400 22px 'Lilita One', sans-serif; }
.pf-follow{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pf-follow div{ display: flex; flex-direction: column; align-items: center; padding: 6px; background: var(--paper-2); border: 3px solid var(--ink); border-radius: 12px; }
.pf-follow b{ font: 400 24px 'Lilita One', sans-serif; font-weight: 400; }
.pf-follow span{ font-size: 15px; color: var(--ink-2); }
.stat-grid.four{ grid-template-columns: repeat(4, 1fr); }
.stat-grid.four b{ font-size: 21px; }
.pf-party{ display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pf-blox{ display: flex; flex-direction: column; align-items: center; padding: 6px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; }
.pf-blox img{ width: 72px; height: 72px; }
.pf-blox span{ font: 400 16px 'Lilita One', sans-serif; }
.pf-blox b{ font-size: 15px; color: var(--ink-2); }
.rank-row.tap{ cursor: pointer; }
.ask-who{ display: flex; align-items: center; gap: 12px; font: 400 24px 'Lilita One', sans-serif; }
.ask-who img{ width: 72px; height: 72px; background: #dbeeff; border: 3px solid var(--ink); border-radius: 14px; }
.ask-who b{ font-size: 18px; background: var(--ink); color: var(--sun); border-radius: 7px; padding: 1px 8px; }

/* ---------------- trading ---------------- */
.tr-cols{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tr-col{ display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tr-head{ display: flex; align-items: center; justify-content: space-between; font: 400 22px 'Lilita One', sans-serif; padding-bottom: 6px; border-bottom: 3px solid var(--paper-3); }
.ready-mark{ width: 30px; height: 30px; border: 3px solid var(--ink); border-radius: 9px; background: var(--paper-2); }
.ready-mark.on{ background: #35c759; }
.tr-line{ display: flex; align-items: center; gap: 8px; min-height: 52px; font: 400 18px 'Lilita One', sans-serif; }
.tr-line .item-ico{ width: 38px; height: 38px; }
.res-ico.sm{ width: 30px; height: 30px; }
.tr-blox{ display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.tr-bx{ display: flex; flex-direction: column; align-items: center; padding: 4px; background: #fff; border: 3px solid var(--ink); border-radius: 12px; font: 400 15px 'Lilita One', sans-serif; }
.tr-bx img{ width: 58px; height: 58px; }
.tr-bx.on{ background: var(--sun); }
.tr-empty{ padding: 16px 0; color: var(--ink-2); font: 400 19px 'Lilita One', sans-serif; text-align: center; }
.d-left{ font: 400 16px 'Lilita One', sans-serif; color: var(--ink-2); }
@media (max-width: 520px){
  .tr-cols{ grid-template-columns: 1fr; }
  .pf-av{ width: 110px; height: 110px; }
  .stat-grid.four{ grid-template-columns: repeat(2, 1fr); }
}
@media (hover: none) and (pointer: coarse){
  .today{ left: calc(160px + var(--safe-l)); }
}

/* ---------------- time of day, health ---------------- */
.phase-pill{ font-size: 20px; }
.phase-pill.night{ background: #26305a; color: var(--paper); }
.hp-pill{ display: flex; align-items: center; gap: 8px; padding: 6px 12px; min-width: 180px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink);
  font: 400 20px 'Lilita One', sans-serif; }
.hp-k{ color: var(--red); }
.hp-bar{ flex: 1; height: 16px; border: 2.5px solid var(--ink); border-radius: 7px; background: #d9d2c2; overflow: hidden; }
.hp-bar i{ display: block; height: 100%; width: 100%; background: var(--red); transition: width .15s; }
.hurt-flash{ position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0;
  box-shadow: inset 0 0 120px 40px rgba(255,40,40,.85); transition: opacity .25s; }
.hurt-flash.on{ opacity: 1; transition: none; }

/* ---------------- guns ---------------- */
.gun-bar{ position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(104px + var(--safe-b)); z-index: 3;
  display: flex; gap: 8px; max-width: calc(100vw - 180px); overflow-x: auto; padding: 4px 4px 8px; scrollbar-width: none; }
.gun-bar::-webkit-scrollbar{ display: none; }
.gun-slot{ position: relative; flex: none; width: 70px; height: 58px; display: grid; place-items: center;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; box-shadow: 0 4px 0 var(--ink); }
.gun-slot img{ width: 60px; height: 48px; object-fit: contain; }
.gun-slot.on{ background: var(--sun); transform: translateY(-4px); }
.gun-slot .slot-n{ position: absolute; top: -9px; left: -7px; min-width: 24px; height: 24px; border-radius: 8px;
  background: var(--ink); color: var(--paper); font: 400 16px/24px 'Lilita One', sans-serif; text-align: center; }
.gun-slot .hands{ width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fire-btn{ position: absolute; right: calc(18px + var(--safe-r)); bottom: calc(110px + var(--safe-b)); z-index: 3;
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: var(--red); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); touch-action: none; }
.fire-btn svg{ width: 46px; height: 46px; fill: none; stroke: var(--paper); stroke-width: 2.6; stroke-linecap: round; }
.fire-btn.down{ transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.fire-ammo{ position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); min-width: 52px; padding: 0 8px;
  background: var(--ink); color: var(--paper); border-radius: 9px; font: 400 20px/30px 'Lilita One', sans-serif; text-align: center; }
.scope-btn{ position: absolute; right: calc(126px + var(--safe-r)); bottom: calc(128px + var(--safe-b)); z-index: 3;
  width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center;
  background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.scope-btn svg{ width: 34px; height: 34px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; }
.scope-btn.on{ background: var(--sun); }
.crosshair{ position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 2; pointer-events: none; }
.crosshair i{ position: absolute; background: #fff; box-shadow: 0 0 0 2px var(--ink); border-radius: 2px; }
.crosshair i:nth-child(1){ width: 4px; height: 12px; left: -2px; top: -20px; }
.crosshair i:nth-child(2){ width: 4px; height: 12px; left: -2px; top: 8px; }
.crosshair i:nth-child(3){ width: 12px; height: 4px; left: -20px; top: -2px; }
.crosshair i:nth-child(4){ width: 12px; height: 4px; left: 8px; top: -2px; }
.crosshair.hit i{ background: var(--red); }
.scope-view{ position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 0 34vmin, rgba(10,12,18,.96) 34.4vmin); }
.scope-view::before, .scope-view::after{ content: ''; position: absolute; background: rgba(10,12,18,.85); }
.scope-view::before{ left: 50%; top: 16vmin; bottom: 16vmin; width: 3px; transform: translateX(-50%); }
.scope-view::after{ top: 50%; left: calc(50% - 34vmin); right: calc(50% - 34vmin); height: 3px; transform: translateY(-50%); }
.game.armed .act-btn{ bottom: calc(26px + var(--safe-b)); }
.game.in-battle .gun-bar, .game.in-battle .fire-btn, .game.in-battle .scope-btn, .game.in-battle .crosshair,
.game.in-battle .hp-pill, .game.building .gun-bar, .game.building .fire-btn{ display: none; }

/* the armory */
.seg{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 14px; }
.seg-b{ min-height: 50px; font: 400 22px 'Lilita One', sans-serif; color: var(--ink); background: var(--paper-2);
  border: 3px solid var(--ink); border-radius: 12px; }
.seg-b.on{ background: var(--sun); }
.gun-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.gun-card{ position: relative; display: flex; flex-direction: column; gap: 8px; padding: 12px; align-items: stretch;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); }
.gun-card img{ width: 100%; height: 96px; object-fit: contain; background: var(--paper-2); border-radius: 10px; }
.gun-name{ font: 400 22px 'Lilita One', sans-serif; }
.gun-ammo{ font-size: 17px; color: var(--muted); font-weight: 700; }
.gun-tier{ position: absolute; top: 18px; left: 18px; padding: 2px 10px; border-radius: 8px; font: 400 16px/24px 'Lilita One', sans-serif;
  background: #c9d1dd; color: var(--ink); z-index: 1; }
.tier-rare .gun-tier{ background: var(--blue); color: var(--paper); }
.tier-epic .gun-tier{ background: #9b6bff; color: var(--paper); }
.tier-legendary .gun-tier{ background: #ffb11a; color: var(--ink); }
.tier-legendary{ background: #fff4d6; }
.gun-card.own{ background: #eaf8e2; }
.ammo-list{ display: flex; flex-direction: column; gap: 10px; }
.ammo-row{ display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 12px; }
.ammo-row b{ font: 400 21px 'Lilita One', sans-serif; display: block; }
.ammo-have{ font-size: 17px; font-weight: 700; color: var(--muted); }
.ammo-row .btn{ min-height: 48px; }

/* the daily spin */
.wheel-wrap{ position: relative; width: min(84vw, 380px); margin: 6px auto 0; aspect-ratio: 1; }
.wheel-wrap canvas{ width: 100%; height: 100%; display: block; }
.wheel-pin{ position: absolute; left: 50%; top: -6px; transform: translateX(-50%); width: 0; height: 0;
  border-left: 18px solid transparent; border-right: 18px solid transparent; border-top: 34px solid var(--ink); }
.wheel-prize{ min-height: 40px; margin-top: 12px; text-align: center; font: 400 30px 'Lilita One', sans-serif; }
#btnSpin{ background: #ffd6f5; position: relative; }

/* emotes */
.emote-scrim{ position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(27,34,51,.25); }
.emote-wheel{ position: relative; width: 340px; height: 340px; border-radius: 50%;
  background: rgba(255,250,240,.92); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
.emote-b{ position: absolute; left: 50%; top: 50%; width: 92px; height: 58px; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y)));
  font: 400 19px 'Lilita One', sans-serif; color: var(--ink); background: var(--sun); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 var(--ink); }
.emote-b.locked{ background: #d9d2c2; color: var(--muted); }
.emote-mid{ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 86px; height: 86px; border-radius: 50%;
  font: 400 20px 'Lilita One', sans-serif; color: var(--paper); background: var(--ink); border: 3px solid var(--ink); }
#btnEmote{ margin-left: 0; }

/* profiles: pictures and tips */
.pf-av.photo, .pfp-big.photo, .chat-pfp img.photo{ object-fit: cover; }
.pfp-row{ display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.pfp-big{ width: 104px; height: 104px; border-radius: 16px; border: 3px solid var(--ink); background: #d9eeff; flex: none; }
.pfp-btns{ flex: 1; display: flex; flex-direction: column; gap: 8px; }
.file-btn{ display: grid; place-items: center; cursor: pointer; }
.btn-row.grid3{ display: grid; grid-template-columns: 1fr 1fr 1fr; }
.btn.green{ background: var(--grass); color: var(--paper); }
.tip-grid{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.tip-amt.on{ background: var(--sun); }
@media (max-width: 420px){ .tip-grid{ grid-template-columns: 1fr 1fr; } .emote-wheel{ width: 310px; height: 310px; } .emote-b{ width: 84px; } }

/* phones: three round buttons now sit bottom left, the guns sit above them,
   clear of the Fire button on the right */
@media (hover: none) and (pointer: coarse){
  .today{ left: calc(232px + var(--safe-l)); }
  .gun-bar{ left: calc(10px + var(--safe-l)); transform: none; bottom: calc(92px + var(--safe-b)); max-width: calc(100vw - 150px); }
  .gun-slot{ width: 62px; height: 54px; }
  .gun-slot img{ width: 52px; height: 42px; }
  .scope-btn{ right: calc(34px + var(--safe-r)); bottom: calc(222px + var(--safe-b)); }
}
.gun-slot .slot-ammo{ position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); min-width: 36px; padding: 0 6px;
  background: var(--ink); color: var(--paper); border-radius: 8px; font: 400 16px/22px 'Lilita One', sans-serif; text-align: center; }

/* =============================================================
   HUD layout (round 4): profile, level, money and spin top left;
   today's XP and the leaderboard top right; backpack, map, build,
   vehicles and guns down the right; chat, emotes, voice stacked
   bottom left. Kept last so it wins over the older positions.
   ============================================================= */
.hud-row{ display: flex; align-items: center; gap: 10px; }
.me-btn{ width: 64px; height: 64px; padding: 0; overflow: hidden; flex: none;
  background: #d9eeff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); }
.me-btn img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.me-btn:active{ transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
#btnSpin{ position: relative; }
.hud-top-right{ position: absolute; top: calc(12px + var(--safe-t)); right: calc(12px + var(--safe-r)); z-index: 3;
  display: flex; align-items: center; gap: 10px; }
.today, .today:active{ position: static; top: auto; bottom: auto; left: auto; right: auto; transform: none; }
.today:active{ transform: translateY(3px); }
.hud-right{ top: calc(82px + var(--safe-t)); }
.hud-bottom-left{ flex-direction: column-reverse; align-items: flex-start; }
.gun-wrap{ position: relative; }
.gun-fly{ position: absolute; right: calc(100% + 10px); top: 0; display: flex; flex-direction: row-reverse; gap: 8px;
  max-width: calc(100vw - 110px); overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; }
.gun-fly::-webkit-scrollbar{ display: none; }
#btnGuns.on{ background: var(--sun); }
.game.in-battle .hud-top-right, .game.in-battle .gun-fly{ display: none; }
@media (max-width: 420px){
  .me-btn{ width: 58px; height: 58px; }
  .hud-right{ top: calc(78px + var(--safe-t)); }
}
.map-wrap canvas{ width: 100%; height: auto; display: block; border: 3px solid var(--ink); border-radius: 14px; }
.bag-top{ display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.bag-top .seg{ flex: 1; margin: 0; }
.bag-map{ display: inline-flex; align-items: center; gap: 8px; min-height: 50px; }
.bag-map svg{ width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }
.tone-grid{ display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 6px 0 12px; }
.tone{ aspect-ratio: 1; border-radius: 14px; background: var(--c); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); min-height: 52px; }
.tone.on{ outline: 4px solid var(--sun); outline-offset: 2px; }
.w-total{ display: flex; flex-direction: column; align-items: center; padding: 10px 0 6px; }
.w-total-k{ font: 400 18px 'Lilita One', sans-serif; color: var(--muted); }
.w-total-n{ font: 400 44px/1.1 'Lilita One', sans-serif; }
.pf-me-top{ display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.pfp-big-btn{ padding: 0; border: 0; background: none; flex: none; }
.pfp-big-btn .pfp-big{ width: 120px; height: 120px; display: block; }
.pf-me-meta{ flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sheet h2 .me-name{ vertical-align: middle; }
.icon-btn.pencil{ display: inline-grid; place-items: center; width: 44px; height: 44px; margin-left: 10px; vertical-align: middle;
  background: var(--paper-2); border: 3px solid var(--ink); border-radius: 12px; }
.icon-btn.pencil svg{ width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
@media (max-width: 420px){ .pfp-big-btn .pfp-big{ width: 96px; height: 96px; } }
.tabs.five{ grid-template-columns: repeat(5, 1fr); }
#wardBody{ margin-top: 0; }
.sheet .tabs:has(> .tab:nth-child(4)):not(.five){ grid-template-columns: repeat(4, 1fr); }
@media (max-width: 420px){ .tabs.five .tab, .tabs .tab{ font-size: 16px; padding-inline: 2px; } }
.bb-cats{ display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.bb-cats::-webkit-scrollbar{ display: none; }
.bb-cat{ flex: none; min-height: 44px; padding: 0 14px; font: 400 18px 'Lilita One', sans-serif; color: var(--ink);
  background: var(--paper-2); border: 3px solid var(--ink); border-radius: 12px; }
.bb-cat.on{ background: var(--sun); }
.bb-sw.piece{ background: var(--paper); }
.bb-sw.piece img{ width: 100%; height: 100%; object-fit: contain; display: block; }
.map-key{ display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font: 400 18px 'Lilita One', sans-serif; }
.map-key span{ display: inline-flex; align-items: center; gap: 6px; }
.map-key i{ width: 20px; height: 20px; border: 2.5px solid var(--ink); border-radius: 5px; display: inline-block; }
.map-key i.dot{ border-radius: 50%; background: #ffcf33; }
.map-key i.dot.you{ background: #ff5b5b; border-radius: 4px; }
#btnGuns{ position: relative; }
#btnGuns .guns-held{ width: 46px; height: 40px; object-fit: contain; }
#btnGuns .slot-ammo{ position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); min-width: 34px; padding: 0 6px;
  background: var(--ink); color: var(--paper); border-radius: 8px; font: 400 15px/21px 'Lilita One', sans-serif; text-align: center; }
.pf-me-meta .btn-row.grid2 .btn{ min-width: 0; padding-inline: 8px; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px){ .pf-me-meta .btn-row.grid2{ grid-template-columns: 1fr; } }
.sp-chip.tasks svg{ width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }

/* front screens: the game's own footage behind them, and the name in white */
#splash, .onboard{ background: #1b2233; }
.bg-video{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; pointer-events: none; }
.bg-shade{ position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(27,34,51,.15), rgba(27,34,51,.6)); }
#splash > :not(.bg-video):not(.bg-shade), .onboard > :not(.bg-video):not(.bg-shade){ position: relative; z-index: 1; }
.onboard{ overflow: hidden auto; }
.splash-name, .gate-brand span, .ob-logo{
  color: #fffaf0 !important; -webkit-text-stroke: 2.5px var(--ink); paint-order: stroke fill;
  text-shadow: 0 4px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink); }
/* the side buttons sit in the middle of the right edge; the leaderboard stays in the corner */
.hud-right{ top: 50%; transform: translateY(-50%); }
@media (max-width: 420px){ .hud-right{ top: 50%; } }
.ob-stage{ display: block; width: 100%; height: min(38vh, 300px); margin: -4px 0 6px; }
.ob-card .tone-grid{ margin-top: 10px; }
.me-stage-wrap{ display: flex; flex-direction: column; align-items: center; margin: 4px 0 6px;
  background: radial-gradient(ellipse at 50% 70%, #d9eeff, #eef6ff 60%, transparent 72%); border-radius: 18px; }
.me-stage{ display: block; width: 100%; height: min(42vh, 340px); }
.me-custom{ min-width: 220px; margin-top: -6px; }
.cz-stage{ display: block; width: 100%; height: min(34vh, 280px); background: radial-gradient(ellipse at 50% 70%, #d9eeff, transparent 70%); border-radius: 16px; }
.cz-tabs{ margin-top: 8px; }
.cz-grid{ display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.cz-item{ position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px 10px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 3px 0 var(--ink); min-height: 120px; }
.cz-item img{ width: 100%; height: 82px; object-fit: contain; background: var(--paper-2); border-radius: 10px; }
.cz-item.on{ background: var(--sun); }
.cz-item.own .cz-name::after{ content: ''; }
.cz-name{ font: 400 17px/1.1 'Lilita One', sans-serif; text-align: center; }
.cz-price{ display: inline-flex; align-items: center; gap: 4px; font: 400 16px 'Lilita One', sans-serif; color: var(--muted); }
.cz-none{ margin: auto; font: 400 22px 'Lilita One', sans-serif; color: var(--muted); }
.cz-foot{ width: 100%; }
.tabs.six{ grid-template-columns: repeat(3, 1fr); }
@media (min-width: 560px){ .tabs.six{ grid-template-columns: repeat(6, 1fr); } }

/* ---------------- round 6 HUD ---------------- */
.me-btn{ position: relative; width: 74px; height: 74px; padding: 9px; background: transparent; border: 0; box-shadow: none; overflow: visible; }
.me-btn img{ width: 56px; height: 56px; border: 3px solid var(--ink); border-radius: 15px; background: #d9eeff; box-shadow: 0 3px 0 var(--ink); }
.lv-ring{ position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lv-ring rect{ fill: none; stroke-width: 7; }
.lv-track{ stroke: rgba(27,34,51,.28); }
.lv-fill{ stroke: var(--blue); stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray .5s; }
.lv-badge{ position: absolute; top: -4px; right: -6px; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 10px;
  background: var(--ink); color: var(--paper); border: 2.5px solid var(--paper); font: 400 18px/25px 'Lilita One', sans-serif; text-align: center; }
.me-btn.points .lv-badge{ background: var(--pink); color: var(--ink); border-color: var(--ink); }
.hud-btn svg.icon-color{ width: 38px; height: 38px; fill: none; stroke: none; }
.hud-btn:has(svg.icon-color){ background: var(--paper); }
#btnSpin svg.icon-color{ width: 40px; height: 40px; }
.gun-fly{ top: -12px; padding: 14px 4px 16px; }
@media (hover: none) and (pointer: coarse){
  .hud-bottom-left{ gap: 7px; }
  .hud-bottom-left .round-btn{ width: 42px; height: 42px; border-radius: 12px; border-width: 2.5px; box-shadow: 0 3px 0 var(--ink); }
  .hud-bottom-left .round-btn svg{ width: 30px; height: 30px; }
  .hud-bottom-left .badge{ top: -9px; right: -10px; }
}
@media (max-width: 420px){ .me-btn{ width: 70px; height: 70px; padding: 8px; } .me-btn img{ width: 54px; height: 54px; } }
.map-online{ display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font: 400 21px "Lilita One", sans-serif; } .map-online svg{ width: 30px; height: 30px; }
.sui-logo{ width: 22px; height: 27px; flex: none; vertical-align: -5px; margin-right: 6px; }
.pool-v{ display: inline-flex; align-items: center; }
.pool-card .v.clock{ font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.link-row .sui-logo{ width: 18px; height: 22px; }
.round-pick{ display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.round-pick::-webkit-scrollbar{ display: none; }
.round-chip{ flex: none; min-height: 44px; padding: 0 14px; font: 400 18px 'Lilita One', sans-serif; color: var(--ink);
  background: var(--paper-2); border: 3px solid var(--ink); border-radius: 12px; }
.round-chip.on{ background: var(--sun); }
.sp-chip .sui-logo{ width: 16px; height: 20px; margin-right: 4px; }

/* ---------------- the action button: white and glossy, and when you hold
   it (mine, chop, open) a blue border fills up round the edge ---------------- */
.act-btn, .act-btn.holdable{
  overflow: visible; color: var(--ink); text-shadow: none;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 46%, #eef3fb 54%, #e3eaf5 100%);
  box-shadow: 0 6px 0 var(--ink), 0 0 0 0 rgba(0,166,240,0), inset 0 -4px 0 rgba(27,34,51,.08);
}
.act-btn::before{ content: ''; position: absolute; left: 10px; right: 10px; top: 5px; height: 38%; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,0)); pointer-events: none; }
.act-btn::after{ content: ''; position: absolute; inset: 0; border-radius: 13px; pointer-events: none; overflow: hidden;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.85) 45%, transparent 60%) no-repeat;
  background-size: 250% 100%; animation: actShine 3.2s ease-in-out infinite; }
@keyframes actShine{ 0%, 55%{ background-position: 140% 0; } 100%{ background-position: -60% 0; } }
.act-label{ position: relative; z-index: 1; }
/* placed from the padding box, so step back over the 3px border too */
.act-ring{ position: absolute; left: -12px; top: -12px; width: calc(100% + 24px); height: calc(100% + 24px); pointer-events: none; overflow: visible; }
.act-ring rect{ fill: none; stroke-width: 7; }
/* one-tap actions (drive, heal, jet skis) have no ring at all; only held ones fill */
.act-btn:not(.holdable) .act-ring{ display: none; }
.act-track{ stroke: transparent; }
.act-btn.holdable .act-track{ stroke: rgba(27,34,51,.18); }
.act-fill{ stroke: var(--blue); stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(0,166,240,.85)); }
.act-btn.holdable{ box-shadow: 0 6px 0 var(--ink), 0 0 calc(var(--p, 0) * 26px) rgba(0,166,240,.75), inset 0 -4px 0 rgba(27,34,51,.08); }
.act-btn.hot{ background: linear-gradient(180deg, #e9ffe0, #c6f5b0); animation: hot .5s ease-in-out infinite alternate; }

/* chat, emotes and voice: just the icons, no button backs */
.hud-bottom-left .round-btn, .hud-bottom-left .round-btn:active{ background: transparent !important; border: 0 !important; box-shadow: none !important; }
.hud-bottom-left .round-btn svg{ width: 34px; height: 34px; stroke: #fffaf0; stroke-width: 2.6;
  filter: drop-shadow(0 2px 0 #1b2233) drop-shadow(0 0 3px rgba(27,34,51,.9)); }
.hud-bottom-left .round-btn.on svg{ stroke: #5cf06b; }
.hud-bottom-left .round-btn svg rect[fill="currentColor"]{ fill: #fffaf0; }

/* ---------------- profile menu ---------------- */
.me-sheet{ position: relative; }
.me-sheet .sheet-head{ position: absolute; top: 16px; right: 16px; z-index: 2; padding: 0; border: 0; background: none; }
.me-sheet .sheet-head h2{ display: none; }
.pf2-top{ display: flex; gap: 16px; align-items: stretch; margin: 4px 0 14px; }
.pf2-pic{ flex: none; padding: 0; border: 0; background: none; }
.pf2-pic img{ display: block; width: 156px; height: 156px; border: 3px solid var(--ink); border-radius: 22px; background: #d9eeff; box-shadow: 0 4px 0 var(--ink); object-fit: cover; }
.pf2-side{ flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.pf2-name{ display: flex; align-items: center; gap: 10px; padding-right: 62px; min-height: 52px; }
.pf2-name .me-name{ font: 400 32px/1.1 'Lilita One', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf2-name .icon-btn.pencil{ margin-left: 0; flex: none; }
.pf2-lv .lvl-card, .pf2-lv > *{ margin: 0; }
.pf2-tabs{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.pf2-tab{ min-height: 64px; display: grid; place-items: center; background: var(--paper); border: 3px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); }
.pf2-tab svg{ width: 40px; height: 40px; }
.pf2-tab.on{ background: var(--sun); }
.pf2-tab:active{ transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
@media (max-width: 420px){
  .pf2-pic img{ width: 120px; height: 120px; }
  .pf2-name{ padding-right: 54px; }
  .pf2-name .me-name{ font-size: 26px; }
}
.key-box{ margin: 12px 0; padding: 14px; font: 700 17px/1.4 ui-monospace, Menlo, monospace; word-break: break-all; user-select: all; -webkit-user-select: all; background: var(--paper-2); border: 3px solid var(--ink); border-radius: 12px; }
.r-sui{ display: inline-flex; align-items: center; font: 400 15px "Lilita One", sans-serif; color: var(--muted); } .r-sui .sui-logo{ width: 13px; height: 16px; margin-right: 3px; } .pool-sui{ display: block; font: 400 16px "Lilita One", sans-serif; opacity: .8; }

/* a menu opened from the profile has a back arrow on the left of its title */
.sheet-head .back-btn{ margin-right: 12px; }
.sheet-head .back-btn svg{ fill: none; stroke-linejoin: round; }
.sheet-head:has(.back-btn) h2{ flex: 1; }

/* ---------------- chat as a window (computers only) ---------------- */
.chat-win{
  position: fixed; z-index: 20; display: flex; flex-direction: column; min-width: 300px; min-height: 260px;
  background: rgba(255,250,240,.96); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 6px 0 var(--ink);
  overflow: hidden; animation: chatIn .2s ease-out;
}
@keyframes chatIn{ from{ opacity: 0; transform: translateY(12px) scale(.97); } }
.chat-win.moving{ opacity: .92; box-shadow: 0 10px 0 var(--ink), 0 18px 40px rgba(27,34,51,.25); }
.chat-win-head{
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 16px; flex: none;
  background: var(--sun); border-bottom: 3px solid var(--ink); cursor: grab; touch-action: none;
}
.chat-win.moving .chat-win-head{ cursor: grabbing; }
.chat-win-title{ font: 400 24px 'Lilita One', sans-serif; }
.chat-win-head .x-btn{ width: 44px; height: 44px; }
.chat-win .chat-list{ flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; max-height: none; }
.chat-win-foot{ display: flex; gap: 8px; padding: 10px; border-top: 3px solid var(--paper-3); flex: none; }
.chat-win-foot .chat-input{ flex: 1; min-width: 0; }
.chat-win-foot .chat-send{ flex: none; width: 56px; padding: 0; }
.chat-win-grip{
  position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 50%, var(--ink) 50%, var(--ink) 58%, transparent 58%, transparent 68%, var(--ink) 68%, var(--ink) 76%, transparent 76%);
}

/* ---------------- the leaderboard ----------------
   On a computer it opens down the right side of the screen. */
@media (min-width: 900px) and (hover: hover){
  .scrim:has(.ranks-sheet){ justify-content: flex-end; align-items: stretch; background: rgba(27,34,51,.22); }
  .sheet.ranks-sheet{
    max-width: 500px; width: 42vw; max-height: none; height: 100%;
    border: 3px solid var(--ink); border-right: 0; border-radius: 24px 0 0 24px;
    box-shadow: -6px 0 0 rgba(27,34,51,.18); animation: fromRight .32s cubic-bezier(.2,.9,.3,1.1);
  }
  .sheet.ranks-sheet.closing{ animation: toRight .25s ease-in forwards; }
  .ranks-sheet .grabber{ display: none; }
  .ranks-sheet .sheet-head{ padding-top: 16px; }
}
@keyframes fromRight{ from{ transform: translateX(100%); } }
@keyframes toRight{ to{ transform: translateX(100%); } }

/* the podium: second, first, third */
.podium{ display: grid; grid-template-columns: 1fr 1.2fr 1fr; align-items: end; gap: 8px; margin: 6px 0 14px; padding-top: 34px; }
.pd-spot{
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  background: none; border: 0; padding: 0; text-align: center; animation: pdUp .55s cubic-bezier(.2,.9,.3,1.25) backwards; animation-delay: var(--d);
}
.pd-spot.empty{ visibility: hidden; }
@keyframes pdUp{ from{ opacity: 0; transform: translateY(40px) scale(.85); } }
.pd-pic{
  position: relative; z-index: 1; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 18px; overflow: hidden;
  background: #bfe3ff; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink);
}
.pd1 .pd-pic{ width: 96px; height: 96px; border-radius: 22px; background: #fff4c7; border-color: #1b2233;
  box-shadow: 0 5px 0 var(--ink), 0 0 0 4px var(--sun), 0 0 26px 6px rgba(255,217,61,.75); animation: pdGlow 2.4s ease-in-out infinite; }
.pd2 .pd-pic{ background: #e9eef5; box-shadow: 0 4px 0 var(--ink), 0 0 0 3px #c9d3e0; }
.pd3 .pd-pic{ background: #ffe1c4; box-shadow: 0 4px 0 var(--ink), 0 0 0 3px #f0b27a; }
@keyframes pdGlow{ 50%{ box-shadow: 0 5px 0 var(--ink), 0 0 0 4px var(--sun), 0 0 40px 12px rgba(255,217,61,.9); } }
.pd-pic img{ width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.pd-pic img.photo{ image-rendering: auto; }
.pd-crown{ position: absolute; top: -30px; left: 50%; width: 52px; height: 34px; transform: translateX(-50%) rotate(-8deg); z-index: 2;
  filter: drop-shadow(0 3px 0 rgba(27,34,51,.3)); animation: crown 2.2s ease-in-out infinite; }
@keyframes crown{ 50%{ transform: translateX(-50%) translateY(-5px) rotate(6deg); } }
.pd-rays{
  position: absolute; top: -22px; left: 50%; width: 170px; height: 170px; margin-left: -85px; border-radius: 50%; z-index: 0; pointer-events: none;
  background: repeating-conic-gradient(rgba(255,217,61,.55) 0 12deg, transparent 12deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%);
  animation: rays 9s linear infinite;
}
@keyframes rays{ to{ transform: rotate(360deg); } }
.pd-name{ max-width: 100%; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 20px 'Lilita One', sans-serif; }
.pd1 .pd-name{ font-size: 24px; }
.pd-xp{ font-size: 16px; color: var(--ink-2); }
.pd-prize{ font: 400 22px 'Lilita One', sans-serif; color: #1f9d3a; }
.pd1 .pd-prize{ font-size: 26px; }
.pd-sui{ display: inline-flex; align-items: center; font-size: 16px; }
.pd-sui .sui-logo{ width: 14px; height: 18px; margin-right: 4px; }
.pd-block{
  position: relative; overflow: hidden; display: grid; place-items: center; width: 100%; margin-top: 8px;
  border: 3px solid var(--ink); border-bottom: 0; border-radius: 14px 14px 0 0; transform-origin: bottom;
  animation: pdRise .6s cubic-bezier(.2,.9,.3,1.15) backwards; animation-delay: calc(var(--d) + .1s);
}
.pd1 .pd-block{ height: 96px; background: linear-gradient(#ffe866, #ffcf33); }
.pd2 .pd-block{ height: 70px; background: linear-gradient(#f4f7fb, #c9d3e0); }
.pd3 .pd-block{ height: 52px; background: linear-gradient(#ffd2a8, #f0b27a); }
@keyframes pdRise{ from{ transform: scaleY(0); } }
.pd-block::after{
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.85) 48%, transparent 60%) no-repeat;
  background-size: 260% 100%; animation: pdShine 3.4s ease-in-out infinite; animation-delay: var(--d);
}
@keyframes pdShine{ 0%, 60%{ background-position: 140% 0; } 100%{ background-position: -60% 0; } }
.pd-num{ font: 400 40px 'Lilita One', sans-serif; color: var(--paper); text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); }
.pd1 .pd-num{ font-size: 52px; }
.pd-spot:active .pd-pic{ transform: translateY(3px); }
.podium + .rank-list .rank-row{ animation: rowIn .35s ease-out backwards; }
.podium + .rank-list .rank-row:nth-child(1){ animation-delay: .35s; } .podium + .rank-list .rank-row:nth-child(2){ animation-delay: .4s; }
.podium + .rank-list .rank-row:nth-child(3){ animation-delay: .45s; } .podium + .rank-list .rank-row:nth-child(n+4){ animation-delay: .5s; }
@keyframes rowIn{ from{ opacity: 0; transform: translateX(24px); } }
.again .pd-spot, .again .pd-block, .again .rank-row{ animation: none !important; }
