:root {
  --bg1: #15124a;
  --bg2: #2c2391;
  --bg3: #5b3fd1;
  --panel: rgba(22, 17, 72, 0.72);
  --panel-border: rgba(255, 255, 255, 0.12);
  --blue: #5b7cff;
  --blue2: #7aa2ff;
  --pink: #ff5fa8;
  --gold: #ffcc3d;
  --green: #4fe39a;
  --text: #f4f1ff;
  --muted: #b3a9e6;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg1);
  color: var(--text);
  font-family: 'Fredoka', system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.ico {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.28em;
  flex-shrink: 0;
  overflow: visible;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.85)) drop-shadow(0 2px 0 rgba(20, 8, 60, 0.35));
}
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

kbd {
  display: inline-block;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  border-bottom: 2px solid rgba(0, 0, 0, 0.35);
  font-family: inherit;
  font-size: 0.85em;
}

/* Background */
#bg {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 35%, var(--bg3) 0%, var(--bg2) 45%, var(--bg1) 100%);
  overflow: hidden;
  transition: filter 0.8s;
}
.stars {
  position: absolute;
  inset: -50%;
  background-repeat: repeat;
  animation: drift 120s linear infinite;
}
.stars.s1 {
  background-image: radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 80px, #fff, transparent), radial-gradient(1.5px 1.5px at 200px 160px, #cfd8ff, transparent),
    radial-gradient(1px 1px at 60px 190px, #fff, transparent), radial-gradient(2px 2px at 260px 40px, #fff, transparent);
  background-size: 300px 220px;
  opacity: 0.7;
}
.stars.s2 {
  background-image: radial-gradient(1px 1px at 50px 50px, #fff, transparent), radial-gradient(1px 1px at 150px 120px, #ffd6f0, transparent),
    radial-gradient(1.5px 1.5px at 90px 170px, #fff, transparent);
  background-size: 200px 200px;
  opacity: 0.45;
  animation-duration: 200s;
}
@keyframes drift {
  to {
    transform: translate(150px, 80px);
  }
}
.halo {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 900px;
  height: 900px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(160, 120, 255, 0.35), transparent 60%);
}
body.fx-cave #bg {
  filter: hue-rotate(-60deg) saturate(1.5);
}
body.fx-gold #bg {
  filter: hue-rotate(150deg) saturate(1.4) brightness(1.15);
}
body.fx-frenzy #bg {
  animation: rainbow 2s linear infinite;
}
@keyframes rainbow {
  to {
    filter: hue-rotate(360deg);
  }
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: grab;
}
#game.grabbing {
  cursor: grabbing;
}

/* Header */
#top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  pointer-events: none;
  z-index: 5;
}
#top > * {
  pointer-events: auto;
}
.logo {
  font-family: 'Lilita One', 'Fredoka', sans-serif;
  font-size: 40px;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 4px 0 #2a1d8a, 0 8px 20px rgba(0, 0, 0, 0.4);
  -webkit-text-stroke: 2px #1d1466;
}
.logo.big {
  font-size: 72px;
  text-align: center;
}
.bank {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.coins {
  font-family: 'Lilita One', sans-serif;
  font-size: 46px;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 2px #1d1466;
  text-shadow: 0 4px 0 #2a1d8a;
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: center;
}
.coins.bump {
  animation: bump 0.18s ease-out;
}
@keyframes bump {
  50% {
    transform: scale(1.08);
  }
}
.coins small {
  font-size: 18px;
  color: var(--gold);
  -webkit-text-stroke: 1px #1d1466;
}
.coin-ic {
  font-size: 34px;
  -webkit-text-stroke: 0;
}
.bank .sub {
  margin-top: 4px;
  font-weight: 600;
  color: var(--muted);
  font-size: 15px;
}
.bank .dot {
  margin: 0 8px;
  opacity: 0.6;
}
#multi {
  color: var(--gold);
}
.top-btns {
  display: flex;
  gap: 8px;
}
.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  font-size: 22px;
  background: var(--blue);
  box-shadow: 0 4px 0 #2b3ab8, 0 8px 18px rgba(0, 0, 0, 0.3);
  transition: transform 0.08s;
}
.icon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #2b3ab8;
}
.mobile-only {
  display: none;
}

/* Panels */
.panel {
  position: fixed;
  top: 92px;
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  width: 330px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(22, 17, 72, 0.88);
  border: 2px solid var(--panel-border);
  backdrop-filter: blur(12px);
  overflow-y: auto;
  z-index: 10;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.15), opacity 0.25s;
  opacity: 0;
  pointer-events: none;
}
#left {
  left: 20px;
  transform: translateX(calc(-100% - 40px));
}
#right {
  right: 20px;
  display: flex;
  flex-direction: column;
  transform: translateX(calc(100% + 40px));
}
#left.open,
#right.open {
  transform: none;
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Lilita One', sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.5px;
}
.panel-head h2 .ico {
  width: 30px;
  height: 30px;
}
.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.15s, transform 0.08s;
}
.close-btn:hover {
  background: #ff5f7a;
}
.close-btn:active {
  transform: scale(0.92);
}
.chal-list {
  margin-top: 12px;
}
.panel h3 {
  margin: 16px 4px 8px;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.muted {
  color: var(--muted);
}
.tiny {
  font-size: 12px;
}
.link-btn {
  background: none;
  border: none;
  color: var(--blue2);
  font-size: 13px;
  font-weight: 600;
}

.rank-card {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
}
.rank-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  display: grid;
  place-items: center;
  font-size: 24px;
  border: 3px solid #fff;
}
.player-name {
  font-weight: 700;
  font-size: 17px;
}
.rank-title {
  color: var(--gold);
  font-weight: 600;
  font-size: 13px;
}

.bar {
  height: 12px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.bar.small {
  height: 8px;
  margin-bottom: 4px;
}
.bar .fill {
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--blue2), var(--pink));
  transition: width 0.25s;
}

/* Challenges */
.chal {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
  border: 2px solid transparent;
}
.chal.done {
  border-color: var(--green);
  animation: pop 0.4s;
}
.chal-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.chal-reward {
  color: var(--gold);
  white-space: nowrap;
}
.chal .bar {
  height: 8px;
}
.chal .bar .fill {
  background: linear-gradient(90deg, var(--green), #b4ff6b);
}
.chal-prog {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  text-align: right;
}

/* Leaderboard */
.lb {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lb li {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 14px;
}
.lb li:nth-child(odd) {
  background: rgba(255, 255, 255, 0.04);
}
.lb li.you {
  background: rgba(91, 124, 255, 0.35);
  font-weight: 700;
}
.lb .r {
  width: 26px;
  font-weight: 700;
  color: var(--muted);
}
.lb .n {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb .s {
  color: var(--gold);
  font-weight: 600;
}
.lb .sep {
  justify-content: center;
  color: var(--muted);
  background: none !important;
  padding: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 14px;
}
.stats div {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
}
.stats b {
  display: block;
  font-size: 18px;
}
.stats span {
  font-size: 11px;
  color: var(--muted);
}

/* Shop */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.tab {
  flex: 1;
  padding: 9px 4px;
  border-radius: 12px;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.08);
}
.tab.active {
  background: var(--blue);
  box-shadow: 0 3px 0 #2b3ab8;
}
.shop {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.item {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  text-align: left;
  overflow: hidden;
  transition: transform 0.08s, background 0.15s;
}
.item:hover {
  background: rgba(255, 255, 255, 0.12);
}
.item:active {
  transform: scale(0.98);
}
.item.cant {
  opacity: 0.5;
}
.item.maxed {
  opacity: 0.45;
  pointer-events: none;
}
.item.afford {
  border-color: rgba(255, 204, 61, 0.55);
}
.item.active-fx {
  border-color: var(--pink);
  box-shadow: 0 0 16px rgba(255, 95, 168, 0.4);
}
.item-ic {
  font-size: 30px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
.item-body {
  flex: 1;
  min-width: 0;
}
.item-name {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.item-lvl {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.item-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.25;
  margin: 2px 0 4px;
}
.item-cost {
  font-weight: 700;
  color: var(--gold);
  font-size: 14px;
}
.item-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  background: var(--pink);
  width: 0;
}

/* Bottom HUD */
#bottom {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px));
  text-align: center;
  z-index: 4;
  pointer-events: none;
}
#activeFx {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fx-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 99px;
  background: rgba(255, 95, 168, 0.85);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 3px 0 #a3226a;
  animation: pop 0.3s;
}
.fx-chip .ic {
  font-size: 18px;
}
.combo {
  font-family: 'Lilita One', sans-serif;
  font-size: 30px;
  color: var(--gold);
  -webkit-text-stroke: 1.5px #5a2a00;
  text-shadow: 0 3px 0 #a1520a;
  height: 38px;
  transition: opacity 0.3s;
}
.combo.hot {
  color: #ff7b3d;
  animation: shakeX 0.25s infinite;
}
@keyframes shakeX {
  25% {
    transform: translateX(-1px) rotate(-1deg);
  }
  75% {
    transform: translateX(1px) rotate(1deg);
  }
}
.meter {
  position: relative;
  height: 34px;
  border-radius: 99px;
  background: rgba(10, 8, 40, 0.75);
  border: 3px solid #fff;
  overflow: hidden;
  box-shadow: 0 6px 0 #2a1d8a, 0 10px 24px rgba(0, 0, 0, 0.35);
}
.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #ff8ccf, #ff4f9a, #ffd36e);
  transition: width 0.15s;
}
.meter.edge .meter-fill {
  animation: pulse 0.5s infinite;
}
@keyframes pulse {
  50% {
    filter: brightness(1.4);
  }
}
.meter-label {
  position: relative;
  line-height: 28px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
}
.hint {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
  transition: opacity 0.5s;
}

/* Cooldown */
#cooldown {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 6;
  animation: pop 0.4s;
}
.cd-title {
  font-family: 'Lilita One', sans-serif;
  font-size: 28px;
  color: var(--blue2);
  -webkit-text-stroke: 1.5px #1d1466;
}
.cd-time {
  font-family: 'Lilita One', sans-serif;
  font-size: 90px;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 3px #1d1466;
  text-shadow: 0 6px 0 #2a1d8a;
}
.cd-sub {
  color: var(--muted);
  margin-bottom: 10px;
  font-weight: 600;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 16px;
  padding: 12px 22px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  box-shadow: 0 5px 0 #2b3ab8, 0 10px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.08s;
}
.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #2b3ab8;
}
.btn.pink {
  background: var(--pink);
  box-shadow: 0 5px 0 #a3226a, 0 10px 20px rgba(0, 0, 0, 0.3);
}
.btn.big {
  width: 100%;
  font-size: 22px;
  padding: 16px;
  font-family: 'Lilita One', sans-serif;
  letter-spacing: 1px;
}

/* Floaters / big text / toasts */
#floaters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  overflow: hidden;
}
.floater {
  position: absolute;
  font-family: 'Lilita One', sans-serif;
  font-size: 30px;
  color: var(--gold);
  -webkit-text-stroke: 1.5px #5a2a00;
  text-shadow: 0 3px 0 #a1520a;
  white-space: nowrap;
  animation: floatUp 0.9s ease-out forwards;
}
.floater.small {
  font-size: 20px;
  color: #fff;
  -webkit-text-stroke: 1px #1d1466;
  text-shadow: 0 2px 0 #2a1d8a;
}
.floater.pink {
  color: #ff8fd0;
  -webkit-text-stroke: 1.5px #5a0a3a;
  text-shadow: 0 3px 0 #a3226a;
}
@keyframes floatUp {
  0% {
    transform: translate(-50%, 0) scale(0.6);
    opacity: 0;
  }
  15% {
    transform: translate(-50%, -14px) scale(1.15);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -90px) scale(1);
    opacity: 0;
  }
}
#bigText {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 8;
  text-align: center;
}
.big-msg {
  font-family: 'Lilita One', sans-serif;
  font-size: 96px;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 4px #1d1466;
  text-shadow: 0 8px 0 #ff4f9a, 0 16px 30px rgba(0, 0, 0, 0.4);
  animation: bigPop 1.8s ease-out forwards;
  white-space: nowrap;
}
.big-msg small {
  display: block;
  font-size: 40px;
  color: var(--gold);
  text-shadow: 0 4px 0 #a1520a;
  -webkit-text-stroke: 2px #5a2a00;
  margin-top: 10px;
}
@keyframes bigPop {
  0% {
    transform: scale(0.2) rotate(-8deg);
    opacity: 0;
  }
  15% {
    transform: scale(1.15) rotate(3deg);
    opacity: 1;
  }
  25% {
    transform: scale(1) rotate(0);
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: scale(1.05) translateY(-30px);
    opacity: 0;
  }
}
@keyframes pop {
  0% {
    transform: scale(0.7);
    opacity: 0;
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
#cooldown {
  animation: none;
}
#toasts {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  z-index: 9;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(22, 17, 72, 0.92);
  border: 2px solid var(--blue2);
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  animation: toastIn 3.2s ease forwards;
  max-width: 90vw;
  text-align: center;
}
.toast.good {
  border-color: var(--green);
}
.toast.gold {
  border-color: var(--gold);
}
@keyframes toastIn {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }
  10%,
  85% {
    transform: none;
    opacity: 1;
  }
  100% {
    transform: translateY(-10px);
    opacity: 0;
  }
}

/* Golden eggplant */
#golden {
  position: fixed;
  z-index: 6;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: none;
  font-size: 48px;
  background: radial-gradient(circle, rgba(255, 220, 90, 0.9), rgba(255, 170, 0, 0.3) 60%, transparent 70%);
  filter: drop-shadow(0 0 14px #ffd34d) sepia(1) saturate(4) hue-rotate(-10deg) brightness(1.15);
  animation: goldenFloat 1.6s ease-in-out infinite;
}
@keyframes goldenFloat {
  50% {
    transform: translateY(-14px) rotate(12deg) scale(1.08);
  }
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(8, 6, 30, 0.65);
  backdrop-filter: blur(6px);
}
.modal.closed {
  display: none;
}
.modal-card {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 26px;
  background: linear-gradient(180deg, #2b2394, #1b1660);
  border: 3px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: pop 0.35s;
}
.modal-card h2 {
  margin-top: 0;
  font-family: 'Lilita One', sans-serif;
  font-size: 32px;
}
.tagline {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  margin-top: 0;
}
.howto {
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1.4;
}
.howto li {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}
.name-label {
  display: block;
  font-weight: 700;
  margin: 14px 0 6px;
}
#nameInput {
  width: 100%;
  padding: 14px 16px;
  font-size: 18px;
  font-family: inherit;
  font-weight: 600;
  border-radius: 14px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
#nameInput:focus {
  border-color: var(--blue2);
}
.error {
  color: #ff7b93;
  font-weight: 600;
  min-height: 22px;
  font-size: 14px;
  margin: 4px 0 8px;
}
.board-wrap {
  max-height: 60vh;
  overflow-y: auto;
  margin-bottom: 16px;
}
.board {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.board th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  padding: 6px;
  position: sticky;
  top: 0;
  background: #2b2394;
}
.board td {
  padding: 8px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.board tr.you td {
  background: rgba(91, 124, 255, 0.35);
  font-weight: 700;
}
.board td:nth-child(3) {
  color: var(--gold);
  font-weight: 700;
}

.machine-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 16px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 15px;
  background: rgba(22, 17, 72, 0.9);
  border: 2px solid var(--blue2);
  box-shadow: 0 4px 0 #2a1d8a;
  animation: hintPulse 1.2s ease-in-out infinite;
}
.machine-hint .ico {
  width: 26px;
  height: 26px;
}
.machine-hint.turbo {
  background: linear-gradient(90deg, #ff7b3d, #ff4f9a);
  border-color: #ffd23c;
  font-family: 'Lilita One', sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  animation: shakeX 0.18s infinite;
}
@keyframes hintPulse {
  50% {
    transform: scale(1.05);
  }
}

/* Icon placements */
.coin-ic .ico {
  width: 40px;
  height: 40px;
  vertical-align: middle;
}
.icon-btn {
  display: grid;
  place-items: center;
  padding: 0;
}
.icon-btn {
  position: relative;
}
.icon-btn.active {
  background: var(--pink, #ff4fa3);
  box-shadow: 0 4px 0 #a82a6c, 0 8px 18px rgba(0, 0, 0, 0.3);
}
.dot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #1d1466;
  animation: dotPulse 1.2s ease-in-out infinite;
}
@keyframes dotPulse {
  50% {
    transform: scale(1.3);
  }
}

/* Round / payouts */
.round-pill {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 99px;
  border: 2px solid rgba(255, 211, 77, 0.5);
  background: rgba(20, 14, 70, 0.6);
  color: #fff;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.round-pill b {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.round-pill .ico {
  width: 20px;
  height: 20px;
}
.round-pill:hover {
  border-color: var(--gold);
}
.round-pill.urgent {
  border-color: #ff5f7a;
  animation: dotPulse 1s ease-in-out infinite;
}
.round-box {
  text-align: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 12px;
}
.round-timer {
  font-family: 'Lilita One', sans-serif;
  font-size: 44px;
  color: var(--gold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.round-explain {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}
.round-meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}
.round-meta:has(span:empty + span:empty) {
  display: none;
}
#loyaltyText {
  color: var(--gold);
}
.round-meta a,
.last-round a {
  color: #8fb0ff;
}
.shares {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.share-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 14px;
}
.share-chip .ico {
  width: 20px;
  height: 20px;
}
.board .pay {
  color: #6dffb0;
  font-weight: 700;
}
.board tr.paid td:first-child {
  font-weight: 700;
}
.board td .ico {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}
.last-round {
  margin-bottom: 14px;
  font-size: 14px;
}
.last-round:empty {
  display: none;
}
.last-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 8px;
}
.last-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.04);
}
.field {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  border-radius: 14px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
  margin-bottom: 8px;
}
.field:focus {
  border-color: var(--blue2);
}
.field.mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
}
.field-label {
  display: block;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  margin: 4px 2px;
}
.icon-btn .ico {
  width: 30px;
  height: 30px;
}
.avatar .ico {
  width: 32px;
  height: 32px;
}
.panel h3 > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.panel h3 .ico {
  width: 24px;
  height: 24px;
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab .ico {
  width: 22px;
  height: 22px;
}
.item-ic {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(180deg, #a996ff, #6c55e6);
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 -4px 0 rgba(30, 10, 90, 0.35), 0 3px 0 rgba(10, 5, 40, 0.4);
}
.item-ic .ico {
  width: 40px;
  height: 40px;
}
.item.cant .item-ic {
  filter: saturate(0.5);
}
.item-cost {
  display: flex;
  align-items: center;
  gap: 4px;
}
.item-cost .ico,
.chal-reward .ico {
  width: 17px;
  height: 17px;
  filter: none;
}
.chal-name {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chal-name .ico {
  width: 22px;
  height: 22px;
}
.chal-reward {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.chal-prog .ico {
  width: 14px;
  height: 14px;
  filter: none;
}
.lb .r .ico {
  width: 24px;
  height: 24px;
}
.fx-chip {
  animation: none;
}
.fx-chip .ico {
  width: 22px;
  height: 22px;
}
.combo .ico {
  width: 34px;
  height: 34px;
  margin-right: 4px;
  vertical-align: -6px;
}
.hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(22, 17, 72, 0.7);
  color: var(--text);
  font-weight: 600;
}
.hint.dim {
  opacity: 0.6;
}
.hint .ico {
  width: 22px;
  height: 22px;
  filter: none;
}
.cd-sub .ico {
  width: 26px;
  height: 26px;
}
#cdViagra {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#cdViagra .ico {
  width: 24px;
  height: 24px;
}
#startBtn .ico {
  width: 30px;
  height: 30px;
  vertical-align: -7px;
}
.modal-card h2 .ico {
  width: 34px;
  height: 34px;
  vertical-align: -5px;
}
.howto li {
  display: flex;
  gap: 10px;
  align-items: center;
}
.howto li > .ico,
.howto li > [data-icon] .ico {
  width: 30px;
  height: 30px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast .ico {
  width: 26px;
  height: 26px;
}
.floater .ico {
  width: 1.1em;
  height: 1.1em;
  margin-right: 4px;
}
.big-msg .big-ico {
  display: block;
  width: 110px;
  height: 110px;
  margin: 0 auto 6px;
  filter: drop-shadow(0 6px 0 rgba(20, 8, 60, 0.4));
}
#golden {
  background: radial-gradient(circle, rgba(255, 220, 90, 0.75), rgba(255, 170, 0, 0.25) 55%, transparent 70%);
  filter: drop-shadow(0 0 16px #ffd34d);
}
#golden .ico {
  width: 58px;
  height: 58px;
}

/* Responsive — mobile only; desktop layout is untouched above */
@media (max-width: 900px) {
  #top {
    padding: 10px 14px;
    flex-wrap: nowrap;
    align-items: flex-start;
    min-height: 0;
  }
  .logo {
    font-size: 22px;
    line-height: 1;
    margin-top: 4px;
  }
  .bank {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
  }
  .coins {
    font-size: 30px;
  }
  .coin-ic {
    font-size: 22px;
  }
  .bank .sub {
    font-size: 11px;
  }
  .round-pill {
    font-size: 11px;
    padding: 4px 10px;
    margin-top: 4px;
  }

  /* Bottom nav dock — challenges / shop / board / mute */
  .top-btns {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 12;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    gap: 4px;
    margin: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(18, 12, 58, 0.72), rgba(10, 6, 36, 0.96));
    border-top: 2px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
  }
  .top-btns .icon-btn {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    max-width: 72px;
    box-shadow: 0 4px 0 #2b3ab8, 0 8px 16px rgba(0, 0, 0, 0.28);
  }
  .top-btns .icon-btn .ico {
    width: 26px;
    height: 26px;
  }
  .top-btns .icon-btn::after {
    content: attr(data-nav);
    font-family: 'Fredoka', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    color: rgba(255, 255, 255, 0.92);
    text-transform: uppercase;
  }
  .top-btns .icon-btn.active {
    transform: translateY(-2px);
  }
  .top-btns .dot-badge {
    top: 2px;
    right: 8px;
  }

  /* Pleasure / combo sit above the dock */
  #bottom {
    width: calc(100vw - 20px);
    min-width: 0;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
  }
  #bottom .hint {
    display: none;
  }
  #bottom .combo {
    font-size: 24px;
    height: 30px;
  }
  #bottom .meter {
    height: 30px;
  }
  #bottom .meter-label {
    font-size: 12px;
  }
  #bottom .machine-hint {
    font-size: 12px;
    padding: 6px 12px;
  }

  .panel {
    top: 118px;
    max-height: calc(100vh - 118px - 88px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 118px - 88px - env(safe-area-inset-bottom, 0px));
    width: min(360px, calc(100vw - 24px));
  }
  #left {
    left: 12px;
  }
  #right {
    right: 12px;
  }

  .big-msg {
    font-size: 60px;
  }
  .big-msg small {
    font-size: 26px;
  }
  .logo.big {
    font-size: 52px;
  }

  /* Cool-down overlay clears the dock */
  #cooldown {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }
}
