:root {
  --sky: #8fd0f5;
  --panel: #fffdf7;
  --ink: #1d2b4f;
  --muted: #5a6a8e;
  --soft: #eaf1fb;
  --coin: #ffd23f;
  --go: #2bb673;
  --rain: #3d8bff;
  --absorb: #bfe6ff;
  --raincol: #a9c2ff;
  --danger: #e5484d;
  --display: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif;
  --body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}

:root {
  --ink: #1b2340;
  --body: 'Fredoka', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --red: #ff3b4e;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 700;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}

#layer,
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

#ui * {
  pointer-events: auto;
}

#ui .passive,
#ui .passive * {
  pointer-events: none;
}

.tiny {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.big {
  font-family: var(--display);
  font-size: 20px;
}

.next {
  font-size: 12px;
  color: #6a3fc0;
  font-weight: 800;
}

.lbl {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.num {
  font-variant-numeric: tabular-nums;
}

#game.looking {
  cursor: grabbing;
}

.msg {
  font-size: 13px;
  color: var(--danger);
  min-height: 18px;
}

body {
  font-weight: 600;
  color: var(--ink);
}

.stroke {
  color: #fff;
  -webkit-text-stroke: 4px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}

.panel {
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
}

.panel {
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.8), 0 5px 0 var(--ink);
}

.toy {
  position: relative;
  border: 3px solid var(--ink);
  background: var(--c, #fff);
  cursor: pointer;
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.45), inset 0 -6px 0 var(--d, #cfd6e6), 0 5px 0 var(--ink);
}
.toy:active {
  transform: translateY(3px);
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.45), inset 0 -6px 0 var(--d, #cfd6e6), 0 2px 0 var(--ink);
}
.toy:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.toy.glow {
  animation: pulse 1.1s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .toy.glow {
    animation: none;
  }
}
.cnt {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  margin-left: 6px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 800;
  border: 2px solid var(--ink);
  vertical-align: 2px;
}

.btn.glow {
  background: #ffe58a;
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    transform: translateY(-3px);
  }
}
.btn.warn {
  background: var(--danger);
  color: #fff;
}

.btn {
  font-family: var(--display);
  font-size: 16px;
  color: var(--ink);
  background: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  touch-action: none;
  line-height: 1.1;
}
.btn:active, .btn.on {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}
.btn:focus-visible {
  outline: 3px solid var(--rain);
  outline-offset: 2px;
}
.btn .key {
  font-family: var(--body);
  font-size: 11px;
  color: var(--muted);
  display: block;
  font-weight: 800;
}

.small {
  font-size: 14px;
  padding: 6px 10px;
}

@media (prefers-reduced-motion: reduce) {
  .btn.glow {
    animation: none;
  }
}
.btn {
  font-family: var(--display);
  border-radius: 14px;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.6), inset 0 -4px 0 #d5dcea, 0 4px 0 var(--ink);
}

.cnt {
  background: var(--red);
  border: 2.5px solid var(--ink);
  min-width: 22px;
  height: 22px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 13px;
  box-shadow: 0 2px 0 var(--ink);
}

/* scrollbars: a chunky blue toy pill in a soft groove */
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}

::-webkit-scrollbar-track {
  margin: 14px 0;
  border-radius: 999px;
  background: #e3e9f5;
  box-shadow: inset 0 2px 0 rgba(27, 35, 64, 0.15);
}

::-webkit-scrollbar-thumb {
  min-height: 48px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #2fa8ff;
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.5), inset -3px 0 0 #1468c7;
}

::-webkit-scrollbar-thumb:hover {
  background: #4cb8ff;
}

::-webkit-scrollbar-thumb:active {
  background: #1f8fe6;
}

::-webkit-scrollbar-button,
::-webkit-scrollbar-corner {
  display: none;
  background: transparent;
}

/* Firefox has no scrollbar pseudo-elements, so just color it */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-color: #2fa8ff #e3e9f5;
  }
}
/* rarity skins: each rarity has its own color AND pattern, so they read apart even without color */
.rar {
  border: 2.5px solid var(--rc);
  border-radius: 10px;
  background-color: var(--rbg);
}

.rar-Common {
  --rc: #8a94a6;
  --rbg: #f1f3f7;
}

.rar-Uncommon {
  --rc: #2bb673;
  --rbg: #e7f8ef;
  background-image: radial-gradient(rgba(43, 182, 115, 0.32) 1.7px, transparent 2px);
  background-size: 9px 9px;
}

.rar-Rare {
  --rc: #2f7bea;
  --rbg: #e8f0fd;
  background-image: repeating-linear-gradient(45deg, rgba(47, 123, 234, 0.17) 0 5px, transparent 5px 11px);
}

.rar-Epic {
  --rc: #8b4df0;
  --rbg: #f1eafe;
  background-image: linear-gradient(135deg, rgba(139, 77, 240, 0.2) 25%, transparent 25%), linear-gradient(225deg, rgba(139, 77, 240, 0.2) 25%, transparent 25%);
  background-size: 14px 14px;
}

.rar-Legendary {
  --rc: #f08a1c;
  --rbg: #fff2d6;
  background-image: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.85) 48%, transparent 60%), repeating-linear-gradient(-45deg, rgba(240, 138, 28, 0.22) 0 4px, transparent 4px 9px);
  background-size: 260% 100%, auto;
  animation: shine 2.6s linear infinite;
}

@keyframes shine {
  from {
    background-position: 160% 0, 0 0;
  }
  to {
    background-position: -110% 0, 0 0;
  }
}
.rarTag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--rc);
  color: #fff;
  border: 2px solid var(--ink);
}

.card.rar {
  border-color: var(--rc);
}

.card.unknown .rarTag {
  opacity: 0.75;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.legend .rar {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
}

@media (prefers-reduced-motion: reduce) {
  .rar-Legendary {
    animation: none;
  }
}
.rarTag {
  border-width: 2.5px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 12px;
}

.legend button {
  font-family: var(--display);
  font-weight: 400;
  font-size: 13px;
  padding: 3px 10px;
  cursor: pointer;
  color: var(--ink);
}

.legend button.allBtn {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
}

.legend button.on {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
}

.legend button:focus-visible {
  outline: 3px solid var(--rain);
  outline-offset: 2px;
}

.bar {
  height: 8px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  overflow: hidden;
  background: var(--soft);
}
.bar i {
  display: block;
  height: 100%;
  background: var(--go);
  transition: width 0.2s;
}
.bar.evap i {
  background: #7fd3ff;
}

.hudL {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  left: calc(10px + env(safe-area-inset-left, 0px));
  width: min(230px, 60vw - 24px);
  padding: 8px 10px;
  display: grid;
  gap: 5px;
  border-width: 2.5px;
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
}

.tankRow {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tankRow .tank {
  flex: 1;
  height: 14px;
}

.rainRow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.lvl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.lvnum {
  font-family: var(--display);
  font-size: 18px;
  line-height: 1;
}

.bar.xp {
  height: 12px;
}

.bar.xp i {
  background: linear-gradient(90deg, #8b4df0, #ff6fb5);
}

.mix {
  display: grid;
  gap: 4px;
  padding: 5px 7px;
}
.mix.empty {
  border: 2px dashed rgba(29, 43, 79, 0.25);
  border-radius: 10px;
}

.tank {
  display: flex;
  height: 18px;
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  background: var(--soft);
}
.tank > div {
  height: 100%;
  transition: width 0.15s;
}
.tank > div + div {
  border-left: 2px solid var(--ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  margin-right: 4px;
  vertical-align: -1px;
}

.rainName {
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.1;
  text-wrap: balance;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.badge {
  font-size: 11px;
  padding: 0 7px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  color: #fff;
  font-weight: 800;
}

.hint {
  font-size: 12px;
  background: var(--soft);
  border-radius: 8px;
  padding: 4px 7px;
  line-height: 1.35;
}

@media (max-width: 520px) {
  .rainName {
    font-size: 17px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tank > div,
  .bar i {
    transition: none;
  }
}
.hudL {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  width: min(280px, 60vw - 20px);
  gap: 9px;
}

.lvl {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lvlBadge {
  --c: #a35bff;
  --d: #6b2bd1;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  cursor: default;
}
.lvlBadge span {
  font-family: var(--display);
  font-size: 25px;
  line-height: 1;
}
.lvlBadge small {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--display);
  font-size: 10px;
  letter-spacing: 0.05em;
  background: var(--ink);
  color: #fff;
  border-radius: 8px;
  padding: 1px 7px;
}

.xpWrap {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.bar.xp {
  height: 20px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #2a3358;
  box-shadow: 0 3px 0 var(--ink);
}

.bar.xp i {
  background: repeating-linear-gradient(-45deg, #7cf06a 0 9px, #4bd447 9px 18px);
  border-radius: 9px;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.45);
}

.xpTxt {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--display);
  font-size: 12px;
  -webkit-text-stroke: 3px var(--ink);
  text-shadow: 0 2px 0 var(--ink);
  white-space: nowrap;
  overflow: hidden;
}

.tankRow {
  gap: 8px;
}
.tankRow .tank {
  height: 18px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #2a3358;
  box-shadow: 0 3px 0 var(--ink);
}

.tankNum {
  font-family: var(--display);
  font-size: 14px;
  -webkit-text-stroke: 3px var(--ink);
  text-shadow: 0 2px 0 var(--ink);
}

.mix {
  border-width: 3px !important;
  border-radius: 15px;
  box-shadow: 0 4px 0 var(--ink);
  padding: 6px;
}
.mix.empty {
  background: rgba(255, 253, 247, 0.85);
  border: 3px dashed rgba(27, 35, 64, 0.45) !important;
  box-shadow: none;
}

.rainName {
  font-size: 17px;
  color: var(--ink);
}

.badge {
  border-width: 2.5px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 12px;
}

.hint {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 520px) {
  .lvlBadge {
    width: 48px;
    height: 48px;
  }
}
/* long mix names stay inside the card */
.mix,
.mix .liqLabel,
.rainRow {
  min-width: 0;
  max-width: 100%;
}

.rainRow .rainName {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rainRow .tiny {
  flex: none;
}

.radRow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 15px;
}
.radRow .stroke {
  -webkit-text-stroke: 3px var(--ink);
  text-shadow: 0 2px 0 var(--ink);
}
.radRow .radNum {
  font-size: 20px;
  color: #7cf06a;
  margin-left: auto;
}

.radIcon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px dashed #fff;
  outline: 2.5px solid var(--ink);
  outline-offset: 0;
  flex: none;
}

/* the empty-tank button next to the tank meter (the rest of the HUD ignores clicks) */
#ui .passive .emptyBtn,
#ui .passive .emptyBtn * {
  pointer-events: auto;
}

.emptyBtn {
  --c: #ff5f6d;
  --d: #c92b3a;
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 4px;
  padding: 0;
  border-radius: 10px;
}
.emptyBtn svg {
  width: 18px;
  height: 18px;
}
.emptyBtn:disabled {
  --c: #c3cadb;
  --d: #8f99b5;
  cursor: default;
  opacity: 0.6;
}
.emptyBtn:disabled:active {
  transform: none;
}

.rightCol {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: calc(10px + env(safe-area-inset-right, 0px));
  display: grid;
  gap: 6px;
  justify-items: end;
}

.coinPill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 5px;
  border-radius: 999px;
  border-width: 2.5px;
  box-shadow: 0 3px 0 var(--ink);
}

.coinIcon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffc93c;
  border: 2.5px solid var(--ink);
  box-shadow: inset 0 -4px 0 #e09a12;
  position: relative;
  flex: none;
}
.coinIcon::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 2px solid #e09a12;
}

.chipR {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
}
.chipR.soft {
  background: rgba(255, 253, 247, 0.85);
  border: 2px solid rgba(29, 43, 79, 0.25);
  color: var(--ink);
}
.chipR.combo {
  color: #e0557f;
  border-width: 2.5px;
  box-shadow: 0 3px 0 var(--ink);
  display: grid;
  gap: 3px;
  min-width: 96px;
  text-align: center;
  font-size: 14px;
}

.cntSoft {
  margin-left: 6px;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.hudR {
  padding: 8px 14px;
  text-align: right;
  display: grid;
  gap: 2px;
}

.comboBar {
  height: 5px;
  border-radius: 3px;
  background: var(--soft);
  overflow: hidden;
  margin-left: auto;
  width: 100%;
}
.comboBar i {
  display: block;
  height: 100%;
  background: #e0557f;
}

.bonus {
  font-size: 12px;
  color: var(--muted);
}
.bonus b {
  color: var(--ink);
}

.coins {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1;
}
.coins small {
  font-size: 16px;
  color: var(--muted);
}

.combo {
  font-family: var(--display);
  font-size: 18px;
  color: #e0557f;
}

@media (max-width: 520px) {
  .coins {
    font-size: 24px;
  }
}
.rightCol {
  gap: 8px;
}

.coinPill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 4px 4px;
  border-radius: 999px;
  background: rgba(27, 35, 64, 0.55);
  border: 3px solid var(--ink);
  box-shadow: none;
}

.coinIcon {
  width: 38px;
  height: 38px;
  border: 3px solid var(--ink);
  box-shadow: inset 0 -5px 0 #e09a12, inset 0 4px 0 rgba(255, 255, 255, 0.6);
}

.coins {
  font-size: 30px;
  color: #fff;
}

.chipR.soft {
  background: #fff;
  border: 2.5px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: 13px;
  color: var(--ink);
}

.chipR.combo {
  --c: #ffc928;
  --d: #d99400;
  border-radius: 14px;
  padding: 4px 12px;
  min-width: 120px;
  font-family: var(--display);
  font-size: 16px;
  cursor: default;
}

.chipR.combo .comboBar {
  height: 7px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: #2a3358;
}

.chipR.combo .comboBar i {
  background: #ff5fa8;
}

.quests {
  padding: 8px 12px;
  display: grid;
  gap: 8px;
}
.quests h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 17px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.quest {
  display: grid;
  gap: 3px;
  font-size: 12.5px;
  line-height: 1.3;
}
.quest .qrow {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.quest .qrew {
  color: #9a6408;
  font-weight: 800;
  white-space: nowrap;
}
.quest.done {
  color: var(--go);
}

.bottom {
  flex-wrap: wrap;
}
.bottom > .rightBtns {
  display: grid;
  justify-items: end;
  gap: 8px;
  margin-left: auto;
}
.bottom > .menu {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.menu .btn {
  font-size: 13px;
  padding: 4px 8px 4px 10px;
  text-align: left;
  display: flex;
  align-items: center;
  border-width: 2.5px;
  border-radius: 11px;
  box-shadow: 0 3px 0 var(--ink);
}

.menu .btn:active,
.menu .btn.on {
  box-shadow: 0 1px 0 var(--ink);
}

.menu kbd {
  margin-left: auto;
  padding-left: 10px;
  font-family: var(--body);
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

.menu .cnt {
  margin-left: 6px;
}

.menu .iconBtn {
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 13px;
}

.iconBtn svg {
  width: 24px;
  height: 24px;
}

.menu .iconBtn .cnt {
  position: absolute;
  top: -8px;
  right: -8px;
  margin: 0;
}

.bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 calc(12px + env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) calc(12px + env(safe-area-inset-left, 0px));
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none !important;
}
.bottom > div {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.bottom > .menu {
  gap: 20px;
  padding-bottom: 6px;
}

.menu .iconBtn {
  width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 17px;
  display: grid;
  place-items: center;
}

.menu .iconBtn svg {
  width: 30px;
  height: 30px;
}

.iconBtn .mLbl {
  position: absolute;
  left: 50%;
  bottom: -13px;
  transform: translateX(-50%);
  font-family: var(--display);
  font-size: 12px;
  white-space: nowrap;
  -webkit-text-stroke: 3px var(--ink);
  text-shadow: 0 2px 0 var(--ink);
  pointer-events: none;
}

.menu .iconBtn .cnt {
  position: absolute;
  top: -9px;
  right: -9px;
  margin: 0;
}

@media (max-width: 520px) {
  .menu .iconBtn {
    width: 50px;
    height: 50px;
  }
}
.abils {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.perkCall {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #8b4df0;
  color: #fff;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}
.perkCall .pcNum {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1;
  min-width: 34px;
  text-align: center;
}
.perkCall b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
}
.perkCall span span {
  font-size: 13px;
  opacity: 0.95;
}
.perkCall.none {
  background: var(--soft);
  color: var(--ink);
  box-shadow: none;
  border-color: rgba(29, 43, 79, 0.25);
}

.holds {
  display: flex;
  gap: 8px;
}

@media (max-width: 520px) {
  .abil {
    width: 54px;
    height: 54px;
    font-size: 11px;
  }
}
.abil {
  position: relative;
  overflow: hidden;
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 16px;
  display: grid;
  place-content: center;
  text-align: center;
  font-size: 13px;
}
.abil .cdm {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(29, 43, 79, 0.35);
  pointer-events: none;
}
.abil .cdt {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  pointer-events: none;
}
.abil.locked {
  background: var(--soft);
  color: var(--muted);
}
.abil.ready {
  background: #e9ddff;
}

.storm {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  font-family: var(--display);
  font-size: 22px;
  background: #2b3a67;
  color: #ffe04a;
}

.hold {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-content: center;
  text-align: center;
  font-size: 17px;
}
.hold.absorb {
  background: var(--absorb);
}
.hold.rain {
  background: var(--raincol);
}

@media (max-width: 520px) {
  .hold {
    width: 72px;
    height: 72px;
    font-size: 15px;
  }
}
.abils {
  gap: 9px;
}

.abil {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-content: center;
  overflow: hidden;
  font-family: var(--display);
}
.abil .cdm {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.abil .aName {
  position: relative;
  font-size: 14px;
  -webkit-text-stroke: 3px var(--ink);
  text-shadow: 0 2px 0 var(--ink);
}
.abil .aKey {
  position: relative;
  font-size: 10px;
  -webkit-text-stroke: 2.5px var(--ink);
  text-shadow: none;
}
.abil.locked {
  cursor: default;
}

.btn.hold {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-content: center;
  gap: 2px;
  font-family: var(--display);
  font-size: 21px;
  line-height: 1;
  background: var(--c);
  box-shadow: inset 0 7px 0 rgba(255, 255, 255, 0.45), inset 0 -7px 0 var(--d), 0 6px 0 var(--ink);
}

.btn.hold.absorb {
  --c: #3fe0f0;
  --d: #119aae;
}

.btn.hold.rain {
  --c: #2fa8ff;
  --d: #1468c7;
}

.btn.hold .key {
  font-family: var(--display);
  font-size: 11px;
  color: #fff;
  -webkit-text-stroke: 2.5px var(--ink);
  text-shadow: none;
}

.btn.hold:active,
.btn.hold.on {
  transform: translateY(4px);
  box-shadow: inset 0 7px 0 rgba(255, 255, 255, 0.45), inset 0 -7px 0 var(--d), 0 2px 0 var(--ink);
}

.storm {
  border-width: 3px;
}

@media (max-width: 520px) {
  .btn.hold {
    width: 76px;
    height: 76px;
    font-size: 17px;
  }
  .abil {
    width: 54px;
    height: 54px;
  }
}
/* liquid textures sit behind a light label so text stays readable */
.liq {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.card.liq {
  padding: 10px;
  min-height: 96px;
}

.liqLabel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  justify-self: start;
  align-self: start;
  background: rgba(255, 253, 247, 0.9);
  border-radius: 8px;
  padding: 4px 8px;
  box-shadow: 0 1px 0 rgba(29, 43, 79, 0.2);
}

.mix.liq {
  padding: 6px;
}

.mix .liqLabel {
  justify-self: stretch;
}

.toast.liq {
  padding: 10px;
}

.toast .liqLabel {
  justify-self: center;
  text-align: center;
  padding: 4px 12px;
}

.liq.rar-Legendary::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.6) 48%, transparent 60%);
  background-size: 260% 100%;
  animation: shine1 2.6s linear infinite;
}

@keyframes shine1 {
  from {
    background-position: 160% 0;
  }
  to {
    background-position: -110% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .liq.rar-Legendary::after {
    animation: none;
  }
}
.liqLabel {
  border: 2.5px solid var(--ink);
  border-radius: 10px;
}

.mix .liqLabel {
  width: 100%;
  box-sizing: border-box;
}

.toast.rar {
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--rc);
}

.toast {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  text-align: center;
  max-width: min(460px, 100% - 32px);
}

/* on narrow screens the bottom corners are full of buttons, so sit above them */
@media (max-width: 900px) {
  .toast {
    bottom: calc(170px + env(safe-area-inset-bottom, 0px));
  }
}
.toast b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  color: var(--ink);
}

.toast span {
  font-size: 13px;
  color: #854f0b;
}

.toast:not(.liq) {
  --c: #a35bff;
  --d: #6b2bd1;
  background: var(--c);
  border: 3px solid var(--ink);
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.4), inset 0 -5px 0 var(--d), 0 5px 0 var(--ink);
}

.toast:not(.liq) b,
.toast:not(.liq) span {
  color: #fff;
  -webkit-text-stroke: 3.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}

.toast:not(.liq) b {
  font-size: 24px;
}

.toast:not(.liq) span {
  -webkit-text-stroke: 2.5px var(--ink);
  text-shadow: none;
}

.ft {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--display);
  font-size: 20px;
  color: var(--coin);
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  white-space: nowrap;
  will-change: transform;
}
.ft.big {
  font-size: 32px;
  color: #ff6fb5;
}
.ft.weak {
  font-size: 18px;
  color: #ffffff;
}
.ft.soak {
  font-size: 24px;
  color: #7fd3ff;
}
.ft.banner {
  font-size: 40px;
  color: var(--coin);
}
.ft.pickup {
  font-size: 22px;
}

.wetbar {
  position: absolute;
  left: 0;
  top: 0;
  width: 38px;
  height: 9px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
}
.wetbar i {
  display: block;
  height: 100%;
  background: var(--rain);
}

.gbar {
  position: absolute;
  left: 0;
  top: 0;
  width: 160px;
  padding: 4px 7px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--panel);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  gap: 3px;
  text-align: center;
  color: var(--ink);
}
.gbar .track {
  height: 9px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  overflow: hidden;
  background: var(--soft);
}
.gbar .track i {
  display: block;
  height: 100%;
  background: var(--rain);
}
.gbar.full .track i {
  background: #ff6fb5;
}

.bubble {
  position: absolute;
  left: 0;
  top: 0;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 3px 9px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--ink);
}

.tag {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--display);
  font-size: 15px;
  color: #fff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  white-space: nowrap;
}

.ft {
  -webkit-text-stroke: 4px var(--ink);
  text-shadow: 0 3px 0 var(--ink);
}
.ft.big {
  font-size: 36px;
  color: #ffc928;
}
.ft.banner {
  font-size: 44px;
}

.bubble {
  border-width: 3px;
  box-shadow: 0 3px 0 var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: 14px;
}

.tag {
  -webkit-text-stroke: 3.5px var(--ink);
}

.radTag {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--display);
  font-size: 17px;
  color: #fff;
  background: rgba(27, 35, 64, 0.6);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 2px 12px;
  white-space: nowrap;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  will-change: transform;
}
.radTag.bad {
  background: #ff3b4e;
  box-shadow: 0 3px 0 var(--ink);
}

.ft.nope {
  font-size: 26px;
  color: #ff5a6a;
}

.ft.zap {
  font-size: 26px;
  color: #ffe04a;
}

.joy {
  position: absolute;
  width: 110px;
  height: 110px;
  margin: -55px 0 0 -55px;
  border-radius: 50%;
  border: 3px solid rgba(29, 43, 79, 0.5);
  background: rgba(255, 255, 255, 0.25);
}
.joy i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: 3px solid var(--ink);
}

.focusHint {
  --c: #ffc928;
  --d: #d99400;
  position: absolute;
  top: calc(84px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 16px;
  font-family: var(--display);
  font-size: 18px;
  white-space: nowrap;
  cursor: default;
}

.tabbed {
  width: min(560px, 100%);
  display: grid;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 0 14px;
  position: relative;
  z-index: 1;
  margin-bottom: -3px;
}

.tab {
  font-family: var(--display);
  font-size: 16px;
  color: var(--muted);
  background: var(--soft);
  border: 3px solid var(--ink);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  padding: 6px 14px;
  cursor: pointer;
}
.tab.on {
  background: var(--panel);
  color: var(--ink);
}
.tab:focus-visible {
  outline: 3px solid var(--rain);
  outline-offset: 2px;
}

.tabbed .modal {
  width: 100%;
}

.closeX {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--danger);
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  padding: 0;
}
.closeX:hover {
  background: #c9363b;
}
.closeX:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}
.closeX:focus-visible {
  outline: 3px solid var(--rain);
  outline-offset: 2px;
}

.modalWrap {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(29, 43, 79, 0.45);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal {
  width: min(560px, 100%);
  max-height: min(82vh, 720px);
  overflow: auto;
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  align-content: start;
}
.modal h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
}

.mhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.modal {
  border-radius: 22px;
  padding: 16px 18px;
}
.modal h2 {
  font-size: 30px;
}

.tab {
  border-radius: 14px 14px 0 0;
  font-size: 17px;
}
.tab.on {
  background: #fffdf7;
}

/* three tabs side by side on a phone: keep each label on one line */
.tab {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .tabs {
    gap: 4px;
    padding: 0 8px;
  }
  .tab {
    font-size: 14px;
    padding: 6px 9px;
  }
}
.help {
  position: absolute;
  left: 50%;
  bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 12px 16px;
  width: min(380px, 100% - 32px);
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
}
.help h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
}
.help kbd {
  font-family: var(--body);
  font-weight: 800;
  font-size: 12px;
  background: var(--soft);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 0 5px;
}

.help {
  border-radius: 20px;
}
.help .btn {
  --c: #3ddc5a;
  --d: #1e9e37;
  background: var(--c);
  color: #fff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.45), inset 0 -4px 0 var(--d), 0 4px 0 var(--ink);
}

.upg {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 2px solid var(--soft);
  border-radius: 12px;
}
.upg .name {
  font-family: var(--display);
  font-size: 17px;
}
.upg .eff {
  font-size: 12px;
  color: var(--muted);
}
.upg .btn {
  min-width: 96px;
}
.upg .btn.poor {
  background: var(--soft);
  color: var(--muted);
}

.upg {
  border: 2.5px solid #e3e9f4;
  border-radius: 14px;
  background: #fff;
}
.upg .btn {
  --c: #3ddc5a;
  --d: #1e9e37;
  background: var(--c);
  color: #fff;
  -webkit-text-stroke: 3px var(--ink);
  paint-order: stroke fill;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.45), inset 0 -4px 0 var(--d), 0 4px 0 var(--ink);
}
.upg .btn.poor {
  --c: #c3cadb;
  --d: #8f99b5;
}

.perkGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.perk {
  font-family: var(--body);
  font-weight: 700;
  color: var(--ink);
  background: var(--panel);
  border: 3px solid;
  border-radius: 14px;
  padding: 12px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 6px;
  box-shadow: 0 4px 0 var(--ink);
}
.perk:hover {
  transform: translateY(-2px);
}
.perk:focus-visible {
  outline: 3px solid var(--rain);
  outline-offset: 2px;
}
.perk .pn {
  font-family: var(--display);
  font-size: 19px;
}
.perk .pd {
  font-size: 13px;
}

.mine {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mine span {
  font-size: 12px;
  border: 2px solid var(--soft);
  border-radius: 999px;
  padding: 2px 8px;
}

.perk {
  border-width: 3px;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.8), 0 5px 0 var(--ink);
}

.perkLeft {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.perkLeft b {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 13px;
  background: #a35bff;
  color: #fff;
  border: 2.5px solid var(--ink);
  font-family: var(--display);
  font-weight: 400;
  font-size: 15px;
}

.perkNote {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.mine span {
  position: relative;
  cursor: help;
  background: #fff;
}

.mine span[data-tip]:hover::after,
.mine span[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 5;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
}

.mine span:focus-visible {
  outline: 3px solid var(--rain);
  outline-offset: 2px;
}

.ach {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 8px 10px;
  border: 2px solid var(--soft);
  border-radius: 12px;
}
.ach .name {
  font-family: var(--display);
  font-size: 17px;
}
.ach .eff {
  font-size: 12px;
  color: var(--muted);
}
.ach .bar {
  grid-column: 1/-1;
}

.stars {
  font-size: 15px;
  letter-spacing: 2px;
  color: #c9cfdb;
}
.stars b {
  color: #f0a500;
  font-weight: 400;
}

.secret {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 6px 10px;
  border: 2px dashed var(--muted);
  border-radius: 10px;
  color: var(--muted);
}
.secret.got {
  border: 2px solid var(--go);
  color: var(--ink);
}

.setRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 2px solid var(--soft);
  border-radius: 12px;
  cursor: pointer;
}
.setRow b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 16px;
}
.setRow .eff {
  font-size: 12px;
  color: var(--muted);
}
.setRow input[type=checkbox] {
  width: 22px;
  height: 22px;
  accent-color: var(--rain);
  cursor: pointer;
}
.setRow input[type=range] {
  width: min(160px, 38vw);
  accent-color: var(--rain);
}
.setRow input:focus-visible {
  outline: 3px solid var(--rain);
  outline-offset: 2px;
}

.danger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 2px dashed var(--danger);
  border-radius: 12px;
  margin-top: 4px;
}
.danger b {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 16px;
  color: var(--danger);
}
.danger .eff {
  font-size: 12px;
  color: var(--muted);
}

.reset {
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  justify-self: start;
  padding: 4px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.card {
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
  align-content: start;
}
.card.unknown {
  border-style: dashed;
  border-color: var(--muted);
  color: var(--muted);
}
.card .cn {
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.1;
}
.card .ch {
  font-size: 12px;
  line-height: 1.3;
}

.pips {
  display: flex;
  gap: 4px;
}

.pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--soft);
}

/* Mutations tab: one row per mutation with a big colored multiplier badge */
.mutIntro {
  font-size: 14px;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft);
}

.mut {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 0 var(--ink);
}

.mutX {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--mc);
  box-shadow: inset 0 5px 0 rgba(255, 255, 255, 0.5), inset 0 -5px 0 rgba(27, 35, 64, 0.2), 0 3px 0 var(--ink);
  font-family: var(--display);
  font-size: 21px;
  color: #fff;
  -webkit-text-stroke: 3.5px var(--ink);
  paint-order: stroke fill;
}

.mutBody {
  display: grid;
  gap: 3px;
}

.mut .name {
  font-family: var(--display);
  font-size: 19px;
}

.mut .eff {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.mutMeta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.mutWhere {
  padding: 1px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--mc);
}

.mut.locked {
  border-style: dashed;
  box-shadow: none;
  background: var(--soft);
}

.mut.locked .mutX {
  filter: grayscale(1);
  opacity: 0.6;
}

#travel {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: linear-gradient(#3fb4ff, #aee6ff);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#travel.on {
  opacity: 1;
  pointer-events: auto;
}
#travel .tvIn {
  display: grid;
  justify-items: center;
  gap: 10px;
}
#travel b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 42px;
  color: #fff;
  -webkit-text-stroke: 6px #1b2340;
  paint-order: stroke fill;
  text-shadow: 0 4px 0 #1b2340;
}
#travel span {
  font-family: var(--display);
  font-size: 18px;
  color: #fff;
  -webkit-text-stroke: 3px #1b2340;
  paint-order: stroke fill;
}
#travel .tvCloud {
  width: 90px;
  height: 46px;
  border-radius: 30px;
  background: #fff;
  border: 4px solid #1b2340;
  position: relative;
  animation: bob 0.8s ease-in-out infinite alternate;
}
#travel .tvCloud::before {
  content: "";
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #1b2340;
  border-bottom-color: transparent;
  border-right-color: transparent;
  transform: rotate(45deg);
  left: 18px;
  top: -24px;
}

@keyframes bob {
  to {
    transform: translateY(-8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #travel .tvCloud {
    animation: none;
  }
}
