* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #0b1220 0%, #12203a 55%, #1a2c48 100%);
  color: #e8eef7;
  user-select: none; -webkit-user-select: none;
  overflow: hidden;
}
#app { height: 100%; display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; }

#topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; font-size: 15px;
}
.coins b { color: #ffd75e; }
.mult { color: #9fd0ff; }
.rank { color: #b7c4d8; font-size: 13px; }

.tab { display: none; flex: 1; overflow-y: auto; padding: 0 14px 74px; }
.tab.active { display: block; }
#tab-hunt.active { display: flex; flex-direction: column; overflow: hidden; }

.mname { text-align: center; font-size: 19px; font-weight: 700; margin-top: 2px; }
.mname.golden { color: #ffd75e; text-shadow: 0 0 12px #ffb70066; }

.hpbar {
  position: relative; height: 22px; margin: 8px 0 4px;
  background: #0a0f1a; border: 1px solid #2b3c58; border-radius: 11px; overflow: hidden;
}
.hpfill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #d33c3c, #ff7a4f);
  transition: width .25s ease;
}
.hpbar.great .hpfill { background: linear-gradient(90deg, #b86e00, #ffd75e); }
.hpbar span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000;
}
.hunters { text-align: center; font-size: 12px; color: #8fa3bd; }

#mammoth-zone {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; min-height: 180px; cursor: pointer; touch-action: manipulation;
}
#mammoth {
  font-size: 130px; line-height: 1;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,.5));
  transition: transform .06s ease;
}
#mammoth-zone:active #mammoth { transform: scale(.93) rotate(-2deg); }
#mammoth.golden { filter: drop-shadow(0 0 26px #ffd75e) sepia(1) saturate(3) hue-rotate(-12deg); }

#hitfeed {
  position: absolute; left: 8px; bottom: 8px; right: 8px;
  display: flex; flex-direction: column; gap: 2px; pointer-events: none;
  font-size: 11px; color: #9fd0ff; max-height: 90px; overflow: hidden;
}
#hitfeed .fh { opacity: .85; animation: feedin .3s ease; text-shadow: 0 1px 2px #000; }
#hitfeed .fh b { color: #ffd75e; }
@keyframes feedin { from { opacity: 0; transform: translateX(-8px); } to { opacity: .85; } }

.floatdmg {
  position: absolute; font-weight: 800; font-size: 20px; color: #ffd75e;
  pointer-events: none; animation: floatup .8s ease-out forwards; text-shadow: 0 1px 3px #000;
}
@keyframes floatup {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-70px) scale(1.25); }
}

.energybar {
  position: relative; height: 16px; margin: 4px 0;
  background: #0a0f1a; border: 1px solid #2b3c58; border-radius: 8px; overflow: hidden;
}
.enfill { height: 100%; background: linear-gradient(90deg, #2e86ff, #6fd0ff); transition: width .3s; }
.energybar span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; text-shadow: 0 1px 2px #000;
}
.mystats { text-align: center; font-size: 13px; color: #b7c4d8; margin: 2px 0 6px; }
.mystats b { color: #fff; }

.leaders { background: #0e1626cc; border: 1px solid #22304a; border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.ltitle { font-size: 12px; color: #8fa3bd; margin-bottom: 4px; }
.leaders ol { list-style: none; font-size: 13px; }
.leaders li { display: flex; justify-content: space-between; padding: 2px 0; }
.leaders li.me { color: #ffd75e; font-weight: 700; }
.leaders li .n { color: #8fa3bd; margin-right: 6px; }

h2 { font-size: 16px; margin: 14px 0 8px; }
.card {
  background: #0e1626cc; border: 1px solid #22304a; border-radius: 14px;
  padding: 14px; margin-bottom: 10px; font-size: 14px;
}
.card .row { display: flex; gap: 8px; margin-top: 10px; }
input {
  flex: 1; min-width: 0; background: #0a0f1a; border: 1px solid #2b3c58; border-radius: 10px;
  color: #e8eef7; padding: 10px 12px; font-size: 14px;
}
button {
  background: linear-gradient(180deg, #2e86ff, #1f5fd0); color: #fff; border: 0;
  border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 700; cursor: pointer;
}
button:active { transform: translateY(1px); }
button.big { display: block; width: 100%; margin-top: 10px; padding: 13px; font-size: 15px; }
button:disabled { opacity: .45; }
.dim { color: #8fa3bd; font-size: 13px; margin-top: 6px; }
.glow { color: #ffd75e; font-weight: 700; margin-top: 8px; text-align: center; }
.ttitle { font-size: 17px; font-weight: 800; margin-bottom: 6px; }

.loyalty-box { background: #0a0f1a; border: 1px solid #2b3c58; border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 13px; line-height: 1.9; }
.recruit { padding: 6px 0; border-bottom: 1px solid #1a2740; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.recruit:last-child { border-bottom: 0; }
.recruit.on { color: #ffd75e; }

.chron-item { background: #0e1626cc; border: 1px solid #22304a; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; }
.chron-item b { display: block; font-size: 14px; }
.chron-item.golden b { color: #ffd75e; }
.chron-item .dim { margin-top: 2px; }

#tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; display: flex;
  background: #0a1120f2; border-top: 1px solid #22304a;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
#tabs button {
  flex: 1; background: none; border: 0; color: #8fa3bd; font-size: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
}
#tabs button span { font-size: 10px; font-weight: 600; }
#tabs button.active { color: #ffd75e; }

.modal {
  position: fixed; inset: 0; background: #000a; display: flex;
  align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-body {
  background: linear-gradient(180deg, #16233c, #0e1626); border: 1px solid #35507a;
  border-radius: 18px; padding: 22px; text-align: center; max-width: 360px; width: 100%;
}
.skullart { font-size: 64px; }
#death-rewards { margin: 12px 0; font-size: 15px; line-height: 1.7; }
#death-rewards .trophy { color: #ffd75e; font-weight: 800; font-size: 17px; }

.shake { animation: shake .3s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px) rotate(-1deg); }
  75% { transform: translateX(6px) rotate(1deg); }
}
