* { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --lime: #b6ff5c;
  --gold: #ffd84a;
  --red: #ff6b4a;
  --text: #eef6e6;
  --dim: rgba(238, 246, 230, .55);
  --shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 12px rgba(0, 0, 0, .6);
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #101a14;
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  user-select: none;
}

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- full-screen layers (menu, pause, results) ---------- */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at center, rgba(6, 14, 9, .72), rgba(4, 9, 6, .94));
  z-index: 10;
}
.panel { width: min(400px, 100%); text-align: center; }

h1 {
  margin: 0;
  font-size: 58px; font-weight: 800; line-height: .95; letter-spacing: 6px;
  color: var(--lime);
}
h1 span { display: block; color: var(--gold); }
h2 { margin: 0 0 10px; font-size: 30px; font-weight: 800; letter-spacing: 5px; color: var(--lime); }
.tagline { margin: 12px 0 34px; color: var(--dim); letter-spacing: 5px; text-transform: uppercase; font-size: 12px; }

/* Buttons are plain text; the primary one is just bigger and brighter. */
button {
  display: block; width: 100%;
  margin: 4px 0;
  padding: 10px;
  font: inherit; font-size: 14px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase;
  color: var(--dim);
  background: none; border: 0;
  cursor: pointer;
  transition: color .12s, letter-spacing .12s;
}
button:hover { color: var(--text); letter-spacing: 4px; }
button.big { font-size: 22px; font-weight: 800; color: var(--lime); padding: 12px; }
button.big:hover { color: #dcffad; }

.field { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; text-align: left; }
.field > span { flex: 0 0 62px; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--dim); }
input {
  flex: 1; min-width: 0;
  padding: 6px 0;
  font: inherit; font-size: 20px; font-weight: 700;
  color: var(--text);
  background: none;
  border: 0; border-bottom: 2px solid rgba(238, 246, 230, .25);
  outline: none;
}
input:focus { border-bottom-color: var(--lime); }
input::placeholder { color: rgba(238, 246, 230, .25); }

#colorRow { flex: 1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swatch {
  width: 24px; height: 24px; margin: 0; padding: 0;
  border-radius: 50%;
  opacity: .55;
  transition: transform .12s, opacity .12s;
}
.swatch:hover { opacity: 1; letter-spacing: 0; }
.swatch.on { opacity: 1; transform: scale(1.3); box-shadow: 0 0 0 2px #101a14, 0 0 0 4px var(--text); }

.joinRow { display: flex; align-items: baseline; gap: 12px; margin: 6px 0; }
.joinRow input { font-size: 22px; letter-spacing: 8px; text-align: center; text-transform: uppercase; color: var(--gold); }
.joinRow button { width: auto; padding: 10px 6px; color: var(--lime); }

#menuMain button.big { margin-top: 10px; }
.label { margin: 26px 0 8px; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--dim); text-align: left; }
#lobbyList { text-align: left; max-height: 132px; overflow-y: auto; }
#lobbyList .none { margin: 0; font-size: 14px; color: var(--dim); }
.lobby { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 17px; }
.lobby b { font-weight: 800; }
.lobby span { color: var(--dim); font-size: 13px; }
.lobby button { width: auto; margin: 0; padding: 4px 0 4px 12px; color: var(--lime); }
#hostHint { color: var(--dim); font-size: 14px; line-height: 1.5; }

#hostCode {
  margin: 6px 0 12px;
  font-size: 64px; font-weight: 800; letter-spacing: 14px; text-indent: 14px;
  color: var(--gold);
  user-select: text;
}
.waiting { color: var(--dim); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

#menuStatus { min-height: 20px; margin: 14px 0 0; color: #ffb36b; font-size: 14px; }
.controls { margin-top: 26px; font-size: 12px; line-height: 2; color: var(--dim); }
.controls b { color: var(--text); font-weight: 600; }

/* ---------- HUD: text straight on the world, no panels ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; text-shadow: var(--shadow); }

#crosshair {
  position: absolute; left: 50%; top: 50%;
  width: 5px; height: 5px; margin: -2.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55);
}
#ammo {
  position: absolute; left: 50%; top: calc(50% + 26px); transform: translateX(-50%);
  font-size: 15px; font-weight: 700; letter-spacing: 4px; white-space: nowrap;
  color: var(--gold);
}
#ammo.empty { color: var(--red); }
#hitmarker {
  position: absolute; left: 50%; top: 50%;
  width: 26px; height: 26px; margin: -13px;
  opacity: 0;
  background:
    linear-gradient(45deg, transparent 46%, #fff 46%, #fff 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, #fff 46%, #fff 54%, transparent 54%);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px);
          mask: radial-gradient(circle, transparent 5px, #000 6px);
}
#hitmarker.show { animation: hit .22s ease-out; }
@keyframes hit { from { opacity: 1; transform: scale(1.3); } to { opacity: 0; transform: scale(.9); } }

#vignette {
  position: absolute; inset: 0;
  opacity: 0;
  box-shadow: inset 0 0 180px 60px rgba(255, 30, 20, .75);
  transition: opacity .35s;
}

#scoreboard {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 0 22px;
  white-space: nowrap;
}
#scoreboard .side { display: flex; align-items: baseline; gap: 12px; font-size: 40px; font-weight: 800; line-height: 1; }
#scoreboard .side small { font-size: 12px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
#scoreboard .me { color: var(--lime); justify-content: flex-end; }
#scoreboard .foe { color: #ff9a7c; }
#scoreboard .mid { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--dim); }

#health { position: absolute; left: 28px; bottom: 24px; }
#healthText { font-size: 52px; font-weight: 800; line-height: 1; }
#healthText::after { content: " HP"; font-size: 13px; font-weight: 600; letter-spacing: 3px; color: var(--dim); }
#healthBar { width: 190px; height: 3px; margin-top: 8px; background: rgba(255, 255, 255, .2); }
#healthFill { height: 100%; width: 100%; background: var(--lime); transition: width .15s; }
#health.low #healthText { color: var(--red); }
#health.low #healthFill { background: var(--red); }

#weapons { position: absolute; right: 28px; bottom: 24px; text-align: right; }
.slot { margin-top: 6px; font-size: 14px; color: var(--dim); transition: font-size .1s; }
.slot kbd { font: inherit; font-size: 11px; margin-right: 10px; opacity: .7; }
.slot span { font-weight: 600; letter-spacing: 1px; }
.slot em { display: inline-block; min-width: 68px; margin-left: 10px; font-style: normal; font-size: 11px; letter-spacing: 2px; }
.slot.active { font-size: 20px; color: var(--text); }
.slot.active span { font-weight: 800; }
.slot.active em { color: var(--gold); }

#effects { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; gap: 22px; white-space: nowrap; }
.fx { font-size: 13px; font-weight: 800; letter-spacing: 3px; }

#toast {
  position: absolute; left: 50%; top: 62%; transform: translateX(-50%);
  font-size: 22px; font-weight: 800; letter-spacing: 5px; white-space: nowrap;
  opacity: 0; transition: opacity .3s;
}
#toast.show { opacity: 1; }

#countdown {
  position: absolute; left: 50%; top: 30%; transform: translateX(-50%);
  font-size: 120px; font-weight: 800; letter-spacing: 6px; white-space: nowrap;
  color: var(--gold);
}

/* ---------- class picker ---------- */
#classPick {
  position: fixed; inset: 0; z-index: 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 16px;
  background: rgba(4, 9, 6, .78);
  text-align: center;
}
#classPick h2 { margin: 0; font-size: 22px; }
#pickCards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 44px; transition: opacity .25s; }
#classPick.arming #pickCards { opacity: .35; pointer-events: none; }   /* briefly inert when it opens */
.card {
  width: 210px;
  padding-bottom: 12px;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  opacity: .7;
  transition: opacity .12s, transform .12s, border-color .12s;
}
.card:hover { opacity: 1; transform: translateY(-4px); }
.card.chosen { opacity: 1; border-bottom-color: var(--gold); }
.card img { display: block; width: 130px; height: 130px; margin: 0 auto; }
.card h3 { margin: 4px 0 6px; font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.card.chosen h3 { color: var(--gold); }
.card h3 kbd { font: inherit; font-size: 12px; font-weight: 600; margin-right: 10px; color: var(--dim); vertical-align: middle; }
.card p { margin: 0 0 10px; font-size: 13px; line-height: 1.45; color: var(--dim); min-height: 38px; }
.card ul { margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.8; }
.card li b { color: var(--gold); margin-right: 8px; font-weight: 600; }
#pickNote { margin: 0; min-height: 20px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); }

/* ---------- chat ---------- */
#chat { position: fixed; left: 28px; bottom: 112px; width: min(380px, 70vw); z-index: 12; pointer-events: none; text-shadow: var(--shadow); }
#chatLog { display: flex; flex-direction: column; justify-content: flex-end; max-height: 190px; overflow: hidden; }
.msg { margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; transition: opacity .6s; user-select: text; }
.msg.old { opacity: 0; }
#chat.open .msg.old { opacity: .8; }
.msg b { margin-right: 6px; }
.msg.me b { color: var(--lime); }
.msg.foe b { color: #ff9a7c; }
.msg.sys { color: var(--gold); font-size: 12px; letter-spacing: 1px; }
#chatInput { width: 100%; margin-top: 8px; font-size: 15px; font-weight: 500; pointer-events: auto; border-bottom-color: var(--lime); }
#chatHint { margin-top: 6px; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); opacity: .7; }
#chatHint b { color: var(--text); }
#chat.open #chatHint { display: none; }

@media (max-width: 820px) {
  h1 { font-size: 44px; }
  #pickCards { gap: 6px 20px; }
  .card { width: 150px; }
  .card img { width: 84px; height: 84px; }
  .card p { display: none; }
  #scoreboard .side { font-size: 28px; }
  #healthText { font-size: 38px; }
  .slot em { display: none; }
}

/* ---------- account bar, log in, leaderboard, shop ---------- */
#account { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; white-space: nowrap; min-height: 22px; margin: -8px 0 26px; font-size: 13px; color: var(--dim); }
#account .who b { color: var(--text); font-weight: 800; margin-right: 10px; }
#account .coins, #shopCoins { color: var(--gold); font-weight: 700; margin-right: 10px; }
#account .links { display: flex; gap: 14px; }
button.link { width: auto; margin: 0; padding: 0; font-size: 11px; }
button.link:hover { letter-spacing: 3px; color: var(--lime); }
button:disabled { opacity: .35; cursor: default; }
button:disabled:hover { color: var(--dim); letter-spacing: 3px; }
.field > span { flex-basis: 76px; }
.note { margin: 6px 0 14px; min-height: 18px; font-size: 13px; line-height: 1.5; color: var(--dim); text-align: left; }
#authNote { color: #ffb36b; }
.rows { text-align: left; max-height: 46vh; overflow-y: auto; margin-bottom: 14px; font-size: 15px; color: var(--dim); }
.rows .label { margin-top: 16px; }
.row { display: flex; align-items: baseline; gap: 12px; padding: 4px 0; color: var(--text); }
.row .rank { flex: 0 0 22px; color: var(--dim); font-size: 12px; }
.row .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .name i { display: inline-block; width: 12px; height: 12px; margin-right: 10px; border-radius: 50%; vertical-align: -1px; }
.row .num { flex: 0 0 48px; text-align: right; font-size: 13px; color: var(--dim); }
.row.mine .name { color: var(--lime); }
.row .owned { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--dim); }
.row button.link { color: var(--gold); }
#accRow { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 14px; }
#accRow button.link { font-size: 12px; }
#accRow button.link.on { color: var(--lime); }
#endReward { min-height: 20px; margin: 0 0 14px; color: var(--gold); font-weight: 700; letter-spacing: 1px; }
/* ---------- centred home screen, clearer navigation, coin icon ---------- */
.panel { width: min(440px, 100%); }
.tagline { margin-bottom: 24px; }
#account { display: block; margin: 0 0 24px; text-align: center; white-space: normal; font-size: 15px; }
#account .who { display: flex; justify-content: center; align-items: center; gap: 16px; margin-bottom: 14px; }
#account .who b { margin: 0; font-size: 19px; }
#account .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
#account .cta { margin-bottom: 14px; }
button.pill {
  width: auto; margin: 0; padding: 9px 20px;
  font-size: 12px; color: var(--text);
  border: 1.5px solid rgba(238, 246, 230, .4); border-radius: 999px;
}
button.pill:hover { border-color: var(--lime); color: var(--lime); letter-spacing: 3px; }
button.pill.on { border-color: var(--gold); color: var(--gold); }
button.cta {
  width: auto; margin: 0 auto; padding: 15px 38px;
  font-size: 21px; font-weight: 800; color: #10200c;
  background: var(--lime); border-radius: 999px;
}
button.cta:hover { color: #10200c; background: #d6ff9c; letter-spacing: 3px; }
.coins { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--gold); font-size: 18px; font-weight: 800; }
.coin {
  display: inline-block; width: 1.1em; height: 1.1em; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff5b8, #ffcf3a 45%, #c98a12 100%);
  box-shadow: inset 0 0 0 .13em #b87a10, 0 0 10px rgba(255, 200, 60, .55);
}
.field { justify-content: center; margin-bottom: 12px; }
.field input { flex: 0 1 260px; text-align: center; }
input:disabled { border-bottom-color: transparent; }
#colorRow, #accRow { flex: 0 1 auto; justify-content: center; }
.label, .note, #lobbyList { text-align: center; }
.lobby { justify-content: center; gap: 16px; }
.joinRow { justify-content: center; }
.joinRow input { flex: 0 1 150px; }
#shopCoins { margin: 0 0 14px; }
#shopCoins .coins { font-size: 26px; }
.tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.rows { max-height: 40vh; }
.row button.buy { width: auto; margin: 0; padding: 2px 0 2px 12px; letter-spacing: 0; }
.row button.buy .coins { font-size: 15px; }
.row button.buy:hover { letter-spacing: 0; }
#endReward .coins { font-size: 26px; }
#btnHelp { margin-top: 14px; }
#helpText { max-height: 56vh; overflow-y: auto; margin-bottom: 12px; text-align: left; font-size: 13px; line-height: 1.6; color: var(--dim); }
#helpText h4 { margin: 16px 0 4px; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--lime); }
#helpText h4:first-child { margin-top: 0; }
#helpText p { margin: 0 0 6px; }
#helpText b { color: var(--text); font-weight: 600; }.screen { align-items: flex-start; overflow-y: auto; }
.screen .panel { margin: auto; }
.rows, #helpText, #lobbyList { scrollbar-width: thin; scrollbar-color: rgba(238, 246, 230, .3) transparent; padding-right: 6px; }
/* five classes */
#pickCards { gap: 12px 22px; }
.card { width: 178px; }
.card img { width: 112px; height: 112px; }
.card h3 { font-size: 18px; letter-spacing: 1px; }
.card p { font-size: 12px; min-height: 52px; }

/* ---------- touch screens ---------- */
html, body { overscroll-behavior: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
#touch { position: fixed; inset: 0; z-index: 6; touch-action: none; }
#touch button {
  position: absolute; width: auto; margin: 0; padding: 0;
  font-size: 12px; font-weight: 700; letter-spacing: 2px; color: #fff;
  background: rgba(10, 20, 14, .35);
  border: 2px solid rgba(255, 255, 255, .45); border-radius: 50%;
  text-shadow: var(--shadow);
}
#touch #tFire { right: max(26px, env(safe-area-inset-right)); bottom: 30px; width: 96px; height: 96px; border-color: var(--lime) !important; color: var(--lime) !important; }
#touch #tJump { right: calc(max(26px, env(safe-area-inset-right)) + 112px); bottom: 22px; width: 72px; height: 72px; }
#tSlots { position: absolute; right: max(22px, env(safe-area-inset-right)); bottom: 142px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#touch #tSlots button { position: static; padding: 9px 14px; font-size: 11px; letter-spacing: 1px; white-space: nowrap; border-radius: 999px; }
#touch #tSlots button.on { border-color: var(--gold); color: var(--gold); }
#stickBase { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); background: rgba(10, 20, 14, .25); pointer-events: none; }
#stickKnob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
#touchTop { position: fixed; left: max(12px, env(safe-area-inset-left)); top: 10px; z-index: 13; display: flex; gap: 8px; }
#touchTop button { width: auto; margin: 0; padding: 7px 12px; font-size: 10px; color: #fff; background: rgba(10, 20, 14, .35); border: 1.5px solid rgba(255, 255, 255, .4); border-radius: 999px; }
#rotate { display: none; }
body.touch #weapons { display: none; }
body.touch #health { left: max(16px, env(safe-area-inset-left)); bottom: auto; top: 50px; }
body.touch #healthText { font-size: 30px; }
body.touch #healthBar { width: 120px; margin-top: 4px; }
body.touch #chat { left: max(16px, env(safe-area-inset-left)); bottom: auto; top: 108px; width: min(300px, 46vw); }
body.touch #chatLog { max-height: 80px; }
body.touch #effects { bottom: 10px; }
@media (orientation: portrait) {
  body.touch.inmatch #rotate {
    display: flex; position: fixed; inset: 0; z-index: 20; align-items: center; justify-content: center; padding: 24px;
    background: rgba(4, 9, 6, .94); color: var(--lime); font-size: 18px; font-weight: 800; letter-spacing: 4px; text-transform: uppercase; text-align: center;
  }
}
/* short screens: a phone on its side */
@media (max-height: 520px) {
  h1 { font-size: 36px; }
  .tagline { margin: 6px 0 14px; }
  #account { margin-bottom: 14px; }
  button.cta { padding: 11px 28px; font-size: 17px; }
  .label { margin-top: 14px; }
  #classPick { gap: 8px; padding: 8px; }
  #classPick h2 { font-size: 16px; }
  #pickCards { gap: 6px 12px; }
  .card { width: 112px; padding-bottom: 6px; }
  .card img { width: 62px; height: 62px; }
  .card h3 { margin: 2px 0; font-size: 12px; letter-spacing: 0; }
  .card h3 kbd, .card p, .card ul { display: none; }
  #scoreboard { top: 8px; }
  #scoreboard .side { font-size: 26px; }
  #countdown { font-size: 70px; }
  #toast { font-size: 16px; }
}
/* ---------- game mode picker, waiting room, team deathmatch clock ---------- */
#modeTabs { margin: 4px 0 0; flex-wrap: wrap; }
#roomList { max-height: 30vh; margin: 14px 0; }
.row .team { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; }
.row .team.t0 { color: var(--lime); }
.row .team.t1 { color: #ff9a7c; }
#scoreboard .mid.clock { font-size: 22px; font-weight: 800; letter-spacing: 2px; color: var(--text); }
/* seven classes */
#pickCards { gap: 12px 14px; max-width: 1240px; }
.card { width: 158px; }
.card img { width: 96px; height: 96px; }
.card h3 { font-size: 16px; }
.card p { min-height: 64px; }
.card ul { font-size: 12px; }
@media (max-height: 520px) { .card { width: 96px; } .card img { width: 52px; height: 52px; } .card h3 { font-size: 11px; } }

/* eight classes */
#pickCards { max-width: 1280px; gap: 12px 10px; }
.card { width: 146px; }
.card img { width: 90px; height: 90px; }
.card p { min-height: 76px; }

/* nine classes */
#pickCards { max-width: 1320px; gap: 10px 8px; }
.card { width: 134px; }
.card img { width: 84px; height: 84px; }
.card h3 { font-size: 15px; }
.card p { min-height: 86px; }

/* ten classes: two rows of five, with every card's name, blurb and abilities on the same lines */
#pickCards { display: grid; grid-template-columns: repeat(5, minmax(0, 212px)); justify-content: center; align-items: start; max-width: none; gap: 16px 14px; }
#pickCards .card { width: auto; }
#pickCards .card img { width: 96px; height: 96px; }
#pickCards .card h3 { font-size: 16px; letter-spacing: 1px; white-space: nowrap; }
#pickCards .card p { min-height: 54px; font-size: 12px; }
#pickCards .card li { white-space: nowrap; }
@media (max-height: 700px) {
  #pickCards { gap: 10px 14px; }
  #pickCards .card img { width: 72px; height: 72px; }
  #pickCards .card p { display: none; }
}
@media (max-width: 1000px), (max-height: 520px) {
  #pickCards { gap: 6px 8px; }
  #pickCards .card { padding-bottom: 6px; }
  #pickCards .card img { width: 52px; height: 52px; }
  #pickCards .card h3 { margin: 2px 0; font-size: 11px; letter-spacing: 0; white-space: normal; }
  #pickCards .card h3 kbd, #pickCards .card p, #pickCards .card ul { display: none; }
}
.card.boon p { min-height: 58px; }

/* ---------- Defend the Lotus HUD ---------- */
#lotusHud { display: none; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: min(580px, 92vw); text-align: center; }
#hud.solo #lotusHud { display: block; }
#hud.solo #scoreboard { display: none; }
#lhTop { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 22px; }
#lhLives { justify-self: end; font-size: 28px; letter-spacing: 5px; line-height: 1; color: #ff6b7c; }
#lhWave { font-size: 50px; font-weight: 800; letter-spacing: 7px; line-height: 1; color: var(--gold); white-space: nowrap; }
#lhSub { min-height: 16px; margin-top: 5px; font-size: 12px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; color: var(--text); opacity: .8; }
#lhCoins { justify-self: start; }
#lhCoins .coins { font-size: 26px; }
#lhLotus { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
#lhLotus .lbl { font-size: 13px; font-weight: 800; letter-spacing: 4px; text-transform: uppercase; color: #ff9ac8; }
#lhLotus .bar { flex: 1; height: 18px; border-radius: 9px; background: rgba(0, 0, 0, .6); box-shadow: 0 0 0 2px rgba(255, 154, 200, .4); overflow: hidden; transition: box-shadow .15s; }
#lhFill { width: 100%; height: 100%; border-radius: 9px; background: linear-gradient(90deg, #ff4f9a, #ffb6d8); box-shadow: 0 0 16px rgba(255, 110, 175, .8); transition: width .2s; }
#lhNum { min-width: 92px; text-align: right; font-size: 16px; font-weight: 800; color: #ffd0e6; }
#lhLotus.hit .bar { box-shadow: 0 0 0 2px #fff, 0 0 20px #ff4f9a; }
#lhLotus.low #lhFill { background: linear-gradient(90deg, #ff2a1a, #ff8a5a); box-shadow: 0 0 16px rgba(255, 70, 40, .9); animation: pulse .6s ease-in-out infinite; }
#lhLotus.low .lbl, #lhLotus.low #lhNum { color: var(--red); }
#lhAlert { margin-top: 7px; font-size: 12px; font-weight: 800; letter-spacing: 4px; text-transform: uppercase; color: var(--red); opacity: 0; transition: opacity .2s; }
#lhAlert.show { opacity: 1; }
#bossBar { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); width: min(460px, 78vw); text-align: center; }
#bossBar span { font-size: 12px; font-weight: 800; letter-spacing: 5px; text-transform: uppercase; color: var(--red); }
#bossBar .bar { height: 12px; margin-top: 5px; border-radius: 6px; background: rgba(0, 0, 0, .6); box-shadow: 0 0 0 2px rgba(255, 90, 60, .45); overflow: hidden; }
#bossFill { width: 100%; height: 100%; background: linear-gradient(90deg, #b0121e, #ff6b4a); transition: width .15s; }
#waveBanner { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); font-size: 88px; font-weight: 800; letter-spacing: 12px; white-space: nowrap; opacity: 0; }
#waveBanner.show { animation: waveIn 2.4s ease-out; }
@keyframes waveIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(.96); }
}
@media (max-width: 820px), (max-height: 520px) {
  #lotusHud { top: 6px; width: min(440px, 62vw); }
  #lhWave { font-size: 28px; letter-spacing: 4px; }
  #lhLives { font-size: 18px; letter-spacing: 2px; }
  #lhCoins .coins { font-size: 18px; }
  #lhLotus { margin-top: 5px; }
  #lhLotus .bar { height: 12px; }
  #lhNum { min-width: 70px; font-size: 13px; }
  #waveBanner { font-size: 44px; letter-spacing: 6px; }
  #bossBar { bottom: 40px; }
}
/* ---------- smaller Lotus bar, boons ---------- */
#lhLotus { width: min(330px, 100%); margin: 8px auto 0; gap: 9px; }
#lhLotus .lbl { font-size: 10px; letter-spacing: 3px; }
#lhLotus .bar { height: 9px; border-radius: 5px; box-shadow: 0 0 0 1.5px rgba(255, 154, 200, .4); }
#lhFill { border-radius: 5px; box-shadow: 0 0 10px rgba(255, 110, 175, .7); }
#lhNum { min-width: 66px; font-size: 12px; }
#lhBuffs { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 16px; }
#lhBuffs b { margin-left: 2px; font-size: 11px; font-weight: 800; color: var(--gold); vertical-align: super; }
#buffPick {
  position: fixed; inset: 0; z-index: 9;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 16px;
  background: rgba(4, 9, 6, .8);
  text-align: center;
}
#buffPick h2 { margin: 0; font-size: 24px; color: var(--gold); }
#buffCards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 22px; max-width: 1200px; transition: opacity .25s; }
#buffPick.arming #buffCards { opacity: .35; pointer-events: none; }
.card.boon { width: 190px; }
.card.boon .icon {
  width: 86px; height: 86px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; line-height: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(182, 255, 92, .28), rgba(20, 40, 26, .9));
  box-shadow: 0 0 0 2px rgba(182, 255, 92, .35), 0 0 22px rgba(182, 255, 92, .2);
}
.card.boon.chosen .icon { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgba(255, 216, 74, .5); }
.card.boon h3 { font-size: 19px; }
.card.boon .level { margin-bottom: 8px; font-size: 11px; font-weight: 800; letter-spacing: 3px; color: var(--gold); }
.card.boon p { min-height: 58px; display: block; }
#buffNote { margin: 0; min-height: 20px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--dim); }
@media (max-width: 820px), (max-height: 520px) {
  #lhLotus { width: min(240px, 100%); margin-top: 4px; }
  #lhLotus .bar { height: 7px; }
  #buffPick { gap: 8px; padding: 8px; }
  #buffPick h2 { font-size: 16px; }
  #buffCards { gap: 6px 10px; }
  .card.boon { width: 128px; padding-bottom: 4px; }
  .card.boon .icon { width: 46px; height: 46px; font-size: 24px; margin-bottom: 3px; }
  .card.boon h3 { font-size: 12px; }
  .card.boon h3 kbd { display: none; }
  .card.boon .level { margin-bottom: 3px; font-size: 9px; }
  .card.boon p { min-height: 0; margin: 0; font-size: 10px; line-height: 1.3; }
}
/* =====================================================================
   Title screen: a play menu in a bar on the left, lobbies top right,
   logo bottom right. The swamp turns behind it.
   ===================================================================== */
#menu {
  position: fixed; inset: 0; z-index: 10;
  background: linear-gradient(90deg, rgba(4, 9, 6, .5) 0%, rgba(4, 9, 6, .1) 50%, rgba(4, 9, 6, .5) 100%);
}
#menuBar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 33%; min-width: 350px; max-width: 520px;
  display: flex; flex-direction: column;
  padding: 38px 0 22px;
  background: linear-gradient(180deg, rgba(6, 14, 9, .94), rgba(6, 14, 9, .84));
  border-right: 2px solid rgba(182, 255, 92, .6);
  box-shadow: 10px 0 44px rgba(0, 0, 0, .5);
}
#menuTop { flex: 1; min-height: 0; overflow-y: auto; padding: 0 34px 10px 42px; scrollbar-width: thin; scrollbar-color: rgba(238, 246, 230, .3) transparent; }
#menuBar .view { text-align: left; }
#menuBar .heading { margin: 0 0 18px; font-size: 13px; font-weight: 800; letter-spacing: 7px; text-transform: uppercase; color: var(--lime); }
#menuBar .heading::after { content: ""; display: block; width: 46px; height: 3px; margin-top: 9px; background: var(--lime); }

/* the big stacked menu entries */
button.item {
  display: block; width: calc(100% + 42px); margin: 3px 0 3px -42px;
  padding: 13px 14px 13px 38px;
  text-align: left; font-size: 25px; font-weight: 800; letter-spacing: 2px; line-height: 1.1;
  color: var(--text);
  border-left: 4px solid transparent;
  transition: background .1s, color .1s, padding-left .1s;
}
button.item small { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: 2px; color: var(--dim); }
button.item:hover { letter-spacing: 2px; color: #10200c; background: var(--lime); border-left-color: #fff; padding-left: 48px; }
button.item:hover small { color: rgba(16, 32, 12, .75); }

/* everything else inside the bar reads left to right */
#menuBar .back, #menuBar #btnCopy, #menuBar #btnRegister { width: auto; margin: 10px 0 0; padding: 8px 0; text-align: left; }
#menuBar .back { margin-top: 18px; color: var(--dim); }
#menuBar button.big { width: auto; margin: 6px 0 0; padding: 8px 0; text-align: left; }
#menuBar .field { justify-content: flex-start; }
#menuBar .field input { flex: 1; text-align: left; }
#menuBar .label, #menuBar .note { text-align: left; }
#menuBar .label { margin: 16px 0 8px; }
#menuBar #colorRow, #menuBar #accRow { justify-content: flex-start; }
#menuBar .tabs { justify-content: flex-start; }
#menuBar #shopCoins { margin-bottom: 12px; }
#menuBar .rows { max-height: none; }
#menuBar #helpText { max-height: none; margin-bottom: 4px; }
#menuBar #hostCode { margin: 2px 0 6px; font-size: 52px; letter-spacing: 10px; text-indent: 0; }
#menuBar #hostHint { margin: 0; }
#menuBar .waiting { margin: 12px 0 0; }
#menuBar .joinRow { justify-content: flex-start; margin: 2px 0 10px; }
#menuBar .joinRow input { flex: 0 1 170px; text-align: left; }
#menuStatus { min-height: 20px; margin: 14px 0 0; text-align: left; }

/* account, customize, help: pinned to the bottom of the bar */
#menuBar #account { display: block; margin: 0; padding: 16px 34px 0 42px; border-top: 1px solid rgba(238, 246, 230, .12); text-align: left; white-space: normal; }
#menuBar #account .who { display: flex; justify-content: flex-start; align-items: center; gap: 14px; margin-bottom: 10px; }
#menuBar #account .who b { font-size: 18px; }
#menuBar #account .who span { font-size: 13px; color: var(--dim); }
#menuBar #account .who .coins { color: var(--gold); font-size: 17px; }
.nav { display: flex; flex-direction: column; align-items: flex-start; }
button.navItem { width: auto; margin: 0; padding: 6px 0; text-align: left; font-size: 13px; font-weight: 700; letter-spacing: 3px; color: var(--dim); }
button.navItem:hover { color: var(--lime); letter-spacing: 3px; }
button.navItem.login { margin-bottom: 4px; font-size: 17px; font-weight: 800; color: var(--lime); }
button.navItem.login:hover { color: #dcffad; }

/* open lobbies, top right */
#lobbyBox { position: absolute; top: 28px; right: 32px; width: min(430px, 42vw); text-align: right; }
#btnLobbies {
  display: inline-block; width: auto; margin: 0; padding: 11px 18px;
  font-size: 13px; font-weight: 800; letter-spacing: 4px; color: var(--text);
  background: rgba(6, 14, 9, .88);
  border: 1px solid rgba(182, 255, 92, .55);
}
#btnLobbies:hover { letter-spacing: 4px; color: var(--lime); }
#lobbyCount { display: inline-block; min-width: 22px; margin-left: 8px; padding: 1px 6px; text-align: center; letter-spacing: 0; color: #10200c; background: var(--lime); border-radius: 10px; }
#lobbyPanel { margin-top: 8px; padding: 12px 16px; text-align: left; background: rgba(6, 14, 9, .88); border: 1px solid rgba(238, 246, 230, .14); }
.lobbyHead, #lobbyList .lobby { display: grid; grid-template-columns: 1fr 64px 84px 54px; align-items: center; gap: 10px; }
.lobbyHead { padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid rgba(238, 246, 230, .12); font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--dim); }
#lobbyList { max-height: 40vh; overflow-y: auto; text-align: left; padding: 0; }
#lobbyList .lobby { padding: 6px 0; justify-content: stretch; font-size: 15px; }
#lobbyList .lobby b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lobbyList .lobby span { font-size: 13px; color: var(--text); opacity: .8; }
#lobbyList .lobby button { margin: 0; padding: 4px 0; text-align: right; color: var(--lime); }
#lobbyList .none { margin: 6px 0 2px; text-align: left; }

/* logo, bottom right */
#logo { position: absolute; right: 46px; bottom: 34px; text-align: right; pointer-events: none; }
#logo h1 { font-size: 78px; letter-spacing: 8px; text-shadow: 0 4px 24px rgba(0, 0, 0, .6); }
#logo .tagline { margin: 12px 0 0; font-size: 15px; letter-spacing: 9px; color: var(--text); opacity: .75; }

@media (max-width: 820px) {
  #menuBar { width: 100%; max-width: none; min-width: 0; }
  #logo { display: none; }
  #lobbyBox { top: 10px; right: 10px; width: min(330px, 80vw); }
  #lobbyPanel { max-height: 50vh; }
}
@media (max-height: 520px) {
  #menuBar { padding: 14px 0 10px; }
  #menuTop { padding-left: 26px; }
  #menuBar .heading { margin-bottom: 8px; }
  button.item { width: calc(100% + 26px); margin-left: -26px; padding: 7px 10px 7px 22px; font-size: 18px; }
  button.item small { font-size: 9px; margin-top: 2px; }
  #menuBar #account { padding: 8px 20px 0 26px; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 0 16px; }
  button.navItem { font-size: 11px; padding: 4px 0; }
  #logo h1 { font-size: 40px; }
  #logo .tagline { font-size: 11px; margin-top: 6px; }
  #logo { right: 20px; bottom: 14px; }
}
/* leaderboard sections */
#menuBoard .tabs { margin-bottom: 12px; flex-wrap: wrap; }
.row .num.wide { flex-basis: 90px; color: var(--gold); font-weight: 700; }
.rows .best { margin-bottom: 10px; font-size: 14px; font-weight: 700; color: var(--lime); }

/* the boss bar and wave announcements exist only in Defend the Lotus */
#hud:not(.solo) #bossBar, #hud:not(.solo) #waveBanner { display: none !important; }

/* the dip to black between shots of the title screen show */
#menuFade { position: absolute; inset: 0; background: #050a07; opacity: 0; pointer-events: none; transition: opacity .65s ease; }

/* ---------- settings page, donate link ---------- */
#menuSettings input[type=range] { display: block; width: 100%; max-width: 300px; margin: 0; padding: 0; height: 22px; border: 0; accent-color: var(--lime); cursor: pointer; }
#menuSettings .label b { margin-left: 8px; color: var(--text); letter-spacing: 1px; }
#menuSettings .note { margin: 10px 0 0; max-width: 320px; font-size: 12px; line-height: 1.5; color: var(--dim); }
#menuBar #setReset { width: auto; margin: 16px 0 0; padding: 8px 0; text-align: left; }
/* a gold button standing just outside the bar, at its foot */
#btnDonate {
  position: absolute; left: calc(100% + 26px); bottom: 34px;
  padding: 11px 26px;
  font-size: 16px; font-weight: 900; letter-spacing: 4px; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  color: #fff; text-shadow: 0 1px 0 #7a4a00, 0 2px 4px rgba(60, 34, 0, .85), 0 0 2px #7a4a00;
  background: linear-gradient(180deg, #f5b921, #d9900a 55%, #b96f00);
  border: 2px solid #ffe27a; border-radius: 999px;
  box-shadow: 0 0 26px rgba(255, 216, 74, .45), 0 6px 18px rgba(0, 0, 0, .5);
  transition: transform .12s, box-shadow .12s;
}
#btnDonate[hidden] { display: none; }
#btnDonate span { margin-left: 6px; }
#btnDonate:hover { transform: translateY(-3px); box-shadow: 0 0 38px rgba(255, 216, 74, .75), 0 8px 20px rgba(0, 0, 0, .5); }
@media (max-width: 1100px), (max-height: 520px) { #btnDonate { left: calc(100% + 14px); bottom: 16px; padding: 8px 16px; font-size: 12px; letter-spacing: 2px; } }
@media (max-width: 820px) { #btnDonate { left: auto; right: 12px; bottom: 12px; } }   /* the bar fills the screen: tuck it in the corner */

/* ---------- stats page ---------- */
#statsList { max-width: 380px; font-size: 14px; color: var(--dim); }
#statsList h4 { margin: 18px 0 6px; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--lime); }
#statsList h4:first-child { margin-top: 0; }
.stat { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 6px 0; border-bottom: 1px solid rgba(238, 246, 230, .08); }
.stat b { color: var(--text); font-weight: 800; white-space: nowrap; }
.stat .coins { color: var(--gold); margin: 0; }
