:root {
  --ink: #3b2748;
  --ink2: #6b5680;
  --pink: #ff8fab;
  --pink-d: #e0668a;
  --blue: #7ec8ff;
  --blue-d: #4fa3e0;
  --yellow: #ffd166;
  --green: #95e06c;
  --lilac: #c59bff;
  --cream: #fffaf2;
  --card: rgba(255, 250, 242, 0.93);
  --shadow: 0 6px 0 rgba(59, 39, 72, 0.18), 0 14px 30px rgba(59, 39, 72, 0.18);
  --r: 22px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #ffd9ae;
  color: var(--ink);
  font-family: 'Fredoka', 'Baloo 2', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body { touch-action: none; user-select: none; -webkit-user-select: none; }
.hidden { display: none !important; }

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; }
#numbers { position: fixed; inset: 0; pointer-events: none; width: 100%; height: 100%; }
.labels { position: fixed; inset: 0; pointer-events: none; }
#vignette {
  position: fixed; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgba(255, 80, 120, 0) 55%, rgba(255, 60, 110, 0.55) 100%);
  transition: opacity 0.35s ease-out;
}
#vignette.on { opacity: 1; transition: none; }

/* ---------- buttons and cards ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: 18px; color: #fff;
  border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer;
  background: var(--ink2); box-shadow: 0 5px 0 rgba(59, 39, 72, 0.35);
  text-shadow: 0 2px 0 rgba(59, 39, 72, 0.3);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(59, 39, 72, 0.35); }
.btn.big { font-size: 22px; padding: 14px 30px; width: 100%; }
.btn.small { font-size: 15px; padding: 8px 16px; }
.btn.pink { background: linear-gradient(#ffa3bb, var(--pink)); box-shadow: 0 5px 0 var(--pink-d); }
.btn.blue { background: linear-gradient(#9ad5ff, var(--blue)); box-shadow: 0 5px 0 var(--blue-d); }
.btn.ghost { background: transparent; color: var(--ink2); box-shadow: none; text-shadow: none; text-decoration: underline; }
.btn:disabled { filter: grayscale(0.6) opacity(0.6); cursor: default; }

.card {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  border: 3px solid rgba(255, 255, 255, 0.9);
  padding: 20px; width: min(380px, calc(100vw - 32px));
  backdrop-filter: blur(4px);
}
input {
  font: inherit; font-size: 18px; color: var(--ink); font-weight: 500;
  border: 3px solid #eadff5; border-radius: 14px; padding: 10px 14px; width: 100%;
  background: #fff; outline: none;
}
input:focus { border-color: var(--lilac); }

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 16px; overflow-y: auto; z-index: 5;
}
.logo {
  margin: 0; line-height: 0.9; text-align: center; font-weight: 700;
  font-size: clamp(52px, 13vw, 96px); letter-spacing: 1px;
  display: flex; flex-direction: column; align-items: center;
}
.logo span { display: block; white-space: nowrap; }
.logo b {
  display: inline-block; color: #fff;
  text-shadow: 0 4px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink),
    2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 10px 0 rgba(59, 39, 72, 0.2);
  animation: bob 2.4s ease-in-out infinite;
}
.logo .w1 b:nth-child(6n+1) { color: var(--pink); }
.logo .w1 b:nth-child(6n+2) { color: var(--yellow); }
.logo .w1 b:nth-child(6n+3) { color: var(--blue); }
.logo .w1 b:nth-child(6n+4) { color: var(--green); }
.logo .w1 b:nth-child(6n+5) { color: var(--lilac); }
.logo .w1 b:nth-child(6n+6) { color: #ffa45c; }
.logo .w2 b:nth-child(6n+1) { color: var(--green); }
.logo .w2 b:nth-child(6n+2) { color: #ffa45c; }
.logo .w2 b:nth-child(6n+3) { color: var(--pink); }
.logo .w2 b:nth-child(6n+4) { color: var(--yellow); }
.logo .w2 b:nth-child(6n+5) { color: var(--blue); }
.logo .w2 b:nth-child(6n+6) { color: var(--lilac); }
.logo b:nth-child(2) { animation-delay: -0.2s; } .logo b:nth-child(3) { animation-delay: -0.4s; }
.logo b:nth-child(4) { animation-delay: -0.6s; } .logo b:nth-child(5) { animation-delay: -0.8s; }
.logo b:nth-child(6) { animation-delay: -1s; }
.logo .w2 { margin-top: 4px; transform: rotate(-3deg); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }

.tag, .hint {
  margin: 0; text-align: center; font-weight: 600; color: #fff; max-width: 420px;
  text-shadow: 0 2px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink);
}
.hint { font-size: 14px; font-weight: 500; opacity: 0.95; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--ink2); margin: 0 0 5px 4px; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch {
  width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; cursor: pointer; padding: 0;
  box-shadow: 0 3px 0 rgba(59, 39, 72, 0.25); transition: transform 0.12s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: 0 0 0 3px var(--ink), 0 3px 0 rgba(59, 39, 72, 0.25); transform: scale(1.12); }
.or { text-align: center; margin: 14px 0 10px; color: var(--ink2); font-size: 14px; font-weight: 600; position: relative; }
.or::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed #e6d9f2; }
.or span { background: var(--cream); padding: 0 10px; position: relative; border-radius: 8px; }
.joinrow { display: flex; gap: 8px; }
.joinrow input { text-transform: uppercase; letter-spacing: 5px; text-align: center; font-weight: 700; width: 0; flex: 1; min-width: 0; }
.joinrow .btn { flex: none; }
.msg { min-height: 20px; margin-top: 10px; text-align: center; color: #d6456f; font-weight: 600; font-size: 15px; }

.lobby { text-align: center; }
.lbl { font-weight: 600; color: var(--ink2); font-size: 15px; }
.code {
  font-size: 64px; font-weight: 700; letter-spacing: 10px; line-height: 1.05; margin: 2px 0 8px; padding-left: 10px;
  color: var(--pink); text-shadow: 0 4px 0 var(--pink-d);
}
.plist { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.plist li {
  display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 8px 12px;
  font-weight: 600; font-size: 18px; box-shadow: 0 3px 0 rgba(59, 39, 72, 0.1); animation: popin 0.3s ease-out;
}
.plist .dot { width: 26px; height: 30px; border-radius: 50% 50% 45% 45%; border: 3px solid var(--ink); flex: none; position: relative; }
.plist .dot::after { content: ''; position: absolute; left: 6px; top: -9px; width: 10px; height: 6px; background: #6fd06b; border-radius: 50%; border: 2px solid var(--ink); }
.plist .tagx { margin-left: auto; font-size: 12px; background: var(--yellow); border-radius: 999px; padding: 2px 8px; }
.plist .you { font-size: 12px; background: #e6f4ff; border-radius: 999px; padding: 2px 8px; }
.wait { color: var(--ink2); font-weight: 600; margin: 8px 0; }
.dots i { font-style: normal; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: 0.2s; } .dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }
@keyframes popin { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#leave, #leave2 { margin-top: 8px; }

/* ---------- world labels ---------- */
.nametag {
  font-weight: 700; font-size: 15px; color: #fff; white-space: nowrap; transform: translateY(-50%);
  text-shadow: 0 2px 0 var(--ink), 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 0 -1.5px 0 var(--ink),
    1px 1px 0 var(--ink), -1px -1px 0 var(--ink), 1px -1px 0 var(--ink), -1px 1px 0 var(--ink);
  border-bottom: 3px solid var(--pc); padding: 0 4px 1px; line-height: 1.1;
}
.nametag.me { font-size: 16px; }
.nametag.down { opacity: 0.7; }
.nametag .think { margin-left: 3px; font-size: 14px; display: none; animation: bob 1s ease-in-out infinite; }
.hpbar {
  width: 46px; height: 8px; border-radius: 99px; background: rgba(59, 39, 72, 0.55); border: 2px solid #fff;
  overflow: hidden; transform: translateY(22px);
}
.hpbar i { display: block; height: 100%; background: linear-gradient(#b6f28f, #6fcf5a); border-radius: 99px; transition: width 0.2s; }
.hpbar.low i { background: linear-gradient(#ff9fb6, #ff5c80); }

/* ---------- hud ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
#xp {
  position: absolute; left: 12px; right: 12px; top: max(10px, env(safe-area-inset-top)); height: 20px;
  background: rgba(59, 39, 72, 0.55); border-radius: 99px; border: 3px solid #fff; overflow: hidden;
  box-shadow: 0 3px 0 rgba(59, 39, 72, 0.2);
}
#xp .fill { height: 100%; width: 0%; background: linear-gradient(90deg, #7ec8ff, #c59bff 60%, #ff8fab); border-radius: 99px; transition: width 0.25s; }
#xp .lv {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff;
  text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink);
}
.toprow {
  position: absolute; left: 12px; right: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 30px);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.pill {
  background: var(--card); border-radius: 999px; padding: 4px 12px; font-weight: 700; box-shadow: 0 3px 0 rgba(59, 39, 72, 0.18);
  display: flex; align-items: center; gap: 6px; height: 34px;
}
#hp { flex: 0 1 230px; min-width: 0; }
#hp .heart { color: #ff5c80; font-size: 20px; }
#hp .bar { flex: 1; height: 12px; background: #f1e6f7; border-radius: 99px; overflow: hidden; min-width: 40px; }
#hp .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(#ffa3bb, #ff5c80); border-radius: 99px; transition: width 0.2s; }
#hp .num { font-size: 14px; min-width: 26px; text-align: right; }
#timer { font-size: 22px; padding: 4px 16px; letter-spacing: 1px; }
#timer.late { color: #7a4ad0; }
#kills .ico { color: var(--pink); }
#kills { min-width: 70px; justify-content: center; }

#bossbar {
  position: absolute; left: 50%; top: calc(max(10px, env(safe-area-inset-top)) + 74px); transform: translateX(-50%);
  width: min(520px, calc(100vw - 32px)); text-align: center;
}
#bossbar .name {
  color: #fff; font-weight: 700; font-size: 18px;
  text-shadow: 0 2px 0 var(--ink), 1.5px 0 0 var(--ink), -1.5px 0 0 var(--ink), 0 -1.5px 0 var(--ink);
}
#bossbar .bar { height: 18px; border-radius: 99px; background: rgba(59, 39, 72, 0.6); border: 3px solid #fff; overflow: hidden; margin-top: 2px; }
#bossbar .bar i { display: block; height: 100%; width: 100%; background: linear-gradient(#c59bff, #8a5ae0); transition: width 0.2s; }

#loadout { position: absolute; left: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 74px); display: flex; flex-direction: column; gap: 6px; }
#loadout .row { display: flex; gap: 5px; flex-wrap: wrap; max-width: 250px; }
.slot {
  width: 38px; height: 38px; border-radius: 12px; background: var(--card); position: relative;
  display: flex; align-items: center; justify-content: center; font-size: 21px; box-shadow: 0 3px 0 rgba(59, 39, 72, 0.18);
}
.slot.passive { border-radius: 50%; width: 32px; height: 32px; font-size: 17px; }
.slot b {
  position: absolute; right: -4px; bottom: -4px; background: var(--ink); color: #fff; font-size: 10px; border-radius: 99px;
  min-width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; padding: 0 3px;
}
.slot.new { animation: popin 0.4s ease-out; }

#team { position: absolute; right: 12px; top: calc(max(10px, env(safe-area-inset-top)) + 74px); display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.mate {
  background: var(--card); border-radius: 12px; padding: 3px 8px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; box-shadow: 0 2px 0 rgba(59, 39, 72, 0.15); max-width: 170px;
}
.mate .d { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.mate .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80px; }
.mate .b { width: 44px; height: 6px; background: #eadff5; border-radius: 99px; overflow: hidden; flex: none; }
.mate .b i { display: block; height: 100%; background: #6fcf5a; }
.mate .s { font-size: 12px; }
.mate.down { opacity: 0.75; }
#ping {
  position: absolute; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); font-size: 12px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink); margin-right: 52px; line-height: 40px;
}
#joystick {
  position: absolute; left: 24px; bottom: calc(max(24px, env(safe-area-inset-bottom)) + 8px); width: 128px; height: 128px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.28); border: 3px solid rgba(255, 255, 255, 0.75); pointer-events: auto; touch-action: none;
}
#joystick .knob {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  background: linear-gradient(#ffb8ca, var(--pink)); border: 3px solid #fff; box-shadow: 0 4px 0 var(--pink-d);
}

.roundbtn {
  position: fixed; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: var(--card); box-shadow: 0 3px 0 rgba(59, 39, 72, 0.2); font-size: 19px; cursor: pointer; z-index: 20;
  display: flex; align-items: center; justify-content: center; padding: 0;
}

/* ---------- level up: a compact tray docked at the bottom so the sprout stays in view ---------- */
#levelup {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; pointer-events: none;
  display: flex; justify-content: center; padding: 0 16px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(rgba(59, 39, 72, 0), rgba(59, 39, 72, 0.28));
  animation: trayin 0.3s cubic-bezier(0.3, 1.4, 0.6, 1);
}
@keyframes trayin { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.lu-tray { width: min(860px, 100%); display: flex; flex-direction: column; gap: 6px; }
.lu-head { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.lu-head h2 {
  margin: 0; font-size: 26px; color: var(--yellow); line-height: 1;
  text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 1.5px 1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px -1.5px 0 var(--ink);
}
.lu-secs { background: var(--pink); color: #fff; font-weight: 700; border-radius: 99px; padding: 1px 9px; font-size: 15px; box-shadow: 0 2px 0 var(--pink-d); }
.lu-hint { color: #fff; font-weight: 600; font-size: 13px; text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink); }
.lu-timer { flex: 1; min-width: 40px; height: 7px; background: rgba(255, 255, 255, 0.55); border-radius: 99px; overflow: hidden; }
.lu-timer i { display: block; height: 100%; background: var(--yellow); width: 100%; }
.cards { display: flex; gap: 10px; pointer-events: auto; }
.lcard {
  flex: 1 1 0; min-width: 0; background: var(--cream); border-radius: 18px; padding: 10px 12px 10px 10px; cursor: pointer; position: relative;
  border: 3px solid #fff; box-shadow: 0 5px 0 rgba(59, 39, 72, 0.28), 0 10px 20px rgba(59, 39, 72, 0.2);
  display: grid; grid-template-columns: 54px 1fr; column-gap: 10px; align-items: center; text-align: left;
  transition: transform 0.12s; animation: cardin 0.3s cubic-bezier(0.3, 1.6, 0.6, 1) both; font: inherit; color: inherit;
}
.lcard:nth-child(2) { animation-delay: 0.05s; } .lcard:nth-child(3) { animation-delay: 0.1s; }
@keyframes cardin { from { transform: translateY(30px) scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
.lcard:hover { transform: translateY(-4px); }
.lcard:active { transform: translateY(2px); }
.lcard .key {
  position: absolute; right: 8px; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.lcard .ic {
  grid-row: 1 / span 3; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: radial-gradient(circle at 35% 30%, #fff, var(--cc, #ffe0ea)); box-shadow: inset 0 -4px 0 rgba(59, 39, 72, 0.1);
}
.lcard .nm { font-weight: 700; font-size: 17px; line-height: 1.1; padding-right: 22px; }
.lcard .lv { display: inline-block; margin: 3px 0; font-size: 11px; font-weight: 700; color: #fff; background: var(--cc2, var(--pink)); border-radius: 99px; padding: 1px 8px; }
.lcard .lv.new { background: var(--green); }
.lcard .ds { font-size: 13px; color: var(--ink2); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lcard.weapon { --cc: #ffd9e4; --cc2: #ff7aa2; }
.lcard.passive { --cc: #dcecff; --cc2: #4fa3e0; }
.lcard.snack { --cc: #fff0c8; --cc2: #e0a030; }
.lcard.picked { transform: scale(1.04); box-shadow: 0 0 0 4px var(--yellow), 0 5px 0 rgba(59, 39, 72, 0.28); }

/* ---------- banner, results, toasts ---------- */
#banner {
  position: fixed; left: 50%; top: 190px; transform: translate(-50%, -50%); z-index: 9; text-align: center; pointer-events: none;
  width: calc(100vw - 32px); animation: bannerin 0.5s cubic-bezier(0.3, 1.6, 0.6, 1);
}
#banner.out { animation: bannerout 0.4s ease-in forwards; }
#banner .t {
  font-size: clamp(28px, 6vw, 52px); font-weight: 700; color: #fff; line-height: 1.05;
  text-shadow: 0 5px 0 var(--ink), 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 -3px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink);
}
#banner .s {
  display: inline-block; margin-top: 8px; background: var(--card); border-radius: 99px; padding: 4px 16px; font-weight: 600; font-size: 17px;
  box-shadow: 0 3px 0 rgba(59, 39, 72, 0.2);
}
#banner .s:empty { display: none; }
@keyframes bannerin { from { transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
@keyframes bannerout { to { transform: translate(-50%, -80%) scale(0.9); opacity: 0; } }

#results { background: radial-gradient(ellipse at center, rgba(59, 39, 72, 0.25), rgba(59, 39, 72, 0.05)); }
.results { text-align: center; width: min(520px, calc(100vw - 32px)); }
.results .headline { margin: 0; font-size: 38px; line-height: 1.05; }
.results.won .headline { color: #f0a020; text-shadow: 0 3px 0 rgba(59, 39, 72, 0.15); }
.results.lost .headline { color: var(--lilac); text-shadow: 0 3px 0 rgba(59, 39, 72, 0.15); }
.results .sub { color: var(--ink2); font-weight: 600; margin: 6px 0 12px; }
.stats { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin-bottom: 14px; font-size: 16px; }
.stats th { font-size: 12px; color: var(--ink2); font-weight: 600; text-align: right; padding: 0 8px; }
.stats th:first-child, .stats td:first-child { text-align: left; }
.stats td { background: #fff; padding: 8px; text-align: right; font-weight: 600; }
.stats td:first-child { border-radius: 12px 0 0 12px; }
.stats td:last-child { border-radius: 0 12px 12px 0; }
.stats .who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stats .who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.stats .d { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.stats tr.best td { background: #fff6d6; }

#conn, #toast {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 30; background: var(--ink); color: #fff;
  border-radius: 999px; padding: 10px 20px; font-weight: 600; box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100vw - 32px);
  overflow: hidden; text-overflow: ellipsis;
}
#conn { top: calc(max(10px, env(safe-area-inset-top)) + 34px); bottom: auto; background: var(--pink); }
.spin { display: inline-block; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- small screens ---------- */
@media (max-width: 700px) {
  #levelup { padding-bottom: calc(max(24px, env(safe-area-inset-bottom)) + 150px); background: none; }
  .lu-head h2 { font-size: 22px; }
  .lu-hint { display: none; }
  .cards { gap: 6px; }
  .lcard { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 8px 6px 8px; border-radius: 16px; row-gap: 1px; }
  .lcard .ic { grid-row: auto; width: 36px; height: 36px; font-size: 20px; }
  .lcard .key { right: 5px; top: 5px; width: 17px; height: 17px; font-size: 10px; }
  .lcard .nm { font-size: 13px; padding: 0; }
  .lcard .lv { margin: 1px 0; font-size: 10px; }
  .lcard .ds { font-size: 10.5px; line-height: 1.2; }

  #timer { font-size: 18px; padding: 4px 10px; }
  .pill { height: 30px; padding: 3px 10px; }
  #hp .num { display: none; }
  .slot { width: 30px; height: 30px; font-size: 16px; border-radius: 10px; }
  .slot.passive { width: 26px; height: 26px; font-size: 14px; }
  #loadout .row { max-width: 180px; }
  .mate { font-size: 12px; padding: 2px 6px; }
  .mate .b { width: 30px; }
  .mate .n { max-width: 56px; }
  #bossbar { top: calc(max(10px, env(safe-area-inset-top)) + 70px); }
  #bossbar .name { font-size: 15px; }
  .code { font-size: 52px; }
  .nametag { font-size: 13px; }
}
@media (max-height: 560px) {
  .logo { font-size: 44px; }
  .tag { display: none; }
}
#hud.hasboss #loadout, #hud.hasboss #team { top: calc(max(10px, env(safe-area-inset-top)) + 126px); }
@media (max-height: 700px) {
  #banner { top: 170px; }
}
@media (max-height: 560px) {
  #banner { top: 90px; }
}
