/* Lilita One (chunky + cute). It loads from Google Fonts (see index.html). To keep it working offline / where Google is blocked,
   put LilitaOne-Regular.woff2 (or .ttf) in assets/fonts/ and it is used first. */
@font-face { font-family: "Lilita One"; font-style: normal; font-weight: 400; font-display: swap;
  src: local("Lilita One"), local("LilitaOne"), url("assets/fonts/LilitaOne-Regular.woff2") format("woff2"), url("assets/fonts/LilitaOne-Regular.ttf") format("truetype"); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font-family: inherit; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #7ec8ff;
  font-family: var(--font-fancy);
  font-synthesis: none;            /* Lilita One is already chunky: never fake a bolder version */
  letter-spacing: .2px;
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #7ec8ff;
  font-size: 28px;
  letter-spacing: 2px;
}

#hud {
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  pointer-events: none;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .55);
}

#title { font-size: 22px; font-weight: bold; letter-spacing: 3px; }
#mode { font-size: 14px; margin-top: 2px; }
#help { font-size: 12px; margin-top: 6px; opacity: .9; line-height: 1.5; }

#hudRight {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .55);
}
#who { font-size: 12px; margin-right: 4px; }
.hud-btn {
  font: inherit;
  font-size: 12px;
  color: #fff;
  background: rgba(20, 24, 40, .6);
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: 4px;
  padding: 5px 9px;
  cursor: pointer;
}
.hud-btn:hover { border-color: #ffd84a; }

/* ---------- Login screen ---------- */
.auth {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: linear-gradient(#6fc0fb, #d6f0ff);
  touch-action: auto;
}
.auth[hidden], .auth-field[hidden] { display: none; }

.auth-card {
  width: min(100%, 340px);
  margin: auto;
  padding: 22px 22px 18px;
  text-align: center;
  background: rgba(20, 24, 40, .9);
  border: 2px solid rgba(255, 255, 255, .25);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.auth-card h1 {
  margin: 4px 0 14px;
  font-size: 26px;
  letter-spacing: 6px;
  padding-left: 6px;
}

/* the player, built from the same body and arm sprites the game uses (whole-number zoom: 3x, or 2x on short screens) */
.auth-sprite { position: relative; width: 81px; height: 111px; margin: 0 auto; }
.auth-sprite .spr { position: absolute; image-rendering: pixelated; image-rendering: crisp-edges; }
.auth-sprite .body { left: 0; top: 0; width: 81px; height: 111px; z-index: 1; }
.auth-sprite .arm-back { left: 57px; top: 63px; width: 18px; height: 30px; z-index: 0; }
.auth-sprite .arm-front { left: 9px; top: 63px; width: 18px; height: 30px; z-index: 2; }
@media (max-height: 640px) {
  .auth-sprite { width: 54px; height: 74px; }
  .auth-sprite .body { width: 54px; height: 74px; }
  .auth-sprite .arm-back { left: 38px; top: 42px; width: 12px; height: 20px; }
  .auth-sprite .arm-front { left: 6px; top: 42px; width: 12px; height: 20px; }
  .auth-card { padding-top: 16px; padding-bottom: 14px; }
  .auth-card h1 { margin-bottom: 10px; }
  .auth-field { margin-bottom: 9px; }
  .auth-field input { padding: 8px 10px; }
  .auth-tabs { margin-bottom: 10px; }
}

.auth-tabs { display: flex; margin-bottom: 14px; border-bottom: 2px solid rgba(255, 255, 255, .15); }
.auth-tab {
  flex: 1;
  padding: 8px 4px;
  font: inherit;
  font-size: 14px;
  color: rgba(255, 255, 255, .6);
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
}
.auth-tab.active { color: #fff; border-bottom-color: #ffd84a; }

.auth-field { display: block; margin-bottom: 12px; text-align: left; font-size: 13px; color: rgba(255, 255, 255, .8); }
.auth-field input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 11px;
  font: inherit;
  font-size: 16px;               /* 16px stops phones from zooming in on focus */
  color: #fff;
  background: rgba(0, 0, 0, .3);
  border: 2px solid rgba(255, 255, 255, .25);
  border-radius: 6px;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.auth-field input:focus { border-color: #ffd84a; }

.auth-error { min-height: 20px; margin: -2px 0 8px; font-size: 13px; color: #ff9a9a; text-align: left; }
.auth-submit {
  width: 100%;
  padding: 11px;
  font: inherit;
  font-size: 16px;
  font-weight: bold;
  color: #2a2a2a;
  background: #ffd84a;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.auth-submit:hover { background: #ffe477; }
.auth-submit:disabled { opacity: .6; cursor: default; }
.auth-note { margin: 12px 0 0; font-size: 11px; color: rgba(255, 255, 255, .5); }

body.auth-open { touch-action: auto; }   /* lets the login card scroll on small phones */

/* nothing from the game shows while the login screen is open */
body.auth-open #hud, body.auth-open #hudRight, body.auth-open #dock, body.auth-open #invDialog, body.auth-open #touch, body.auth-open #chat { display: none !important; }

#dock {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: rgba(20, 24, 40, .6);
  border: 2px solid rgba(255, 255, 255, .35);
  border-radius: 6px;
  z-index: 6;
  translate: 0 var(--dock-y, 0px);              /* pushed down by dragging the handle (hides the hotbar) */
  transition: translate .2s ease;
}
#dock.dragging { transition: none; }
#hotbar { display: flex; gap: 8px; }

.slot {
  position: relative;
  width: 66px;
  height: 66px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-radius: 4px;
  background: rgba(0, 0, 0, .25);
  cursor: pointer;
}
.slot.selected { border-color: #ffd84a; background: rgba(255, 216, 74, .22); }
.slot img { width: 100%; height: 100%; image-rendering: pixelated; display: block; padding: 5px; }
.slot .key { position: absolute; top: 2px; left: 6px; font-size: 13px; opacity: .9; text-shadow: 1px 1px 0 #000; }
.slot .count {
  position: absolute;
  right: 5px;
  bottom: 2px;
  font-size: 19px;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: 3px #0a1e46;
  paint-order: stroke fill;
}
.slot.empty img { opacity: .35; }
.slot.blank img, .slot.blank .count { display: none; }
.slot.blank { opacity: .55; cursor: default; }

#touch {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 74px;
  display: none;
  justify-content: space-between;
  padding: 0 14px;
  pointer-events: none;
}
#touch .pad { display: flex; gap: 12px; }
#touch button {
  pointer-events: auto;
  width: 64px;
  height: 64px;
  font-size: 26px;
  color: #fff;
  background: rgba(20, 24, 40, .55);
  border: 2px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  touch-action: none;
}
#touch button:active, #touch button.down { background: rgba(255, 216, 74, .45); }

@media (pointer: coarse) {
  #touch { display: flex; }
  #help { display: none; }
}

@media (max-width: 520px) {
  .slot { width: 46px; height: 46px; }
  #hotbar { gap: 4px; }
  #dock { padding: 4px; }
}

/* ---------- Chat (top of the screen: All / System / World / Private) ---------- */
:root { --chat-h: 224px; }
#chat {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1010px, calc(100vw - 200px));          /* leaves room for the button column on the right */
  height: var(--chat-h);
  display: grid;                                   /* the channel buttons sit in a column down the left side; log, box and hint stack on the right */
  grid-template-columns: auto 1fr;
  grid-template-rows: minmax(0, 1fr) auto auto;
  font-size: 18px;
  line-height: 1.35;
  z-index: 5;
  background: rgba(20, 30, 62, .72);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  overflow: hidden;
  translate: 0 var(--chat-y, 0px);                 /* slid up by dragging the grip underneath (see #chatGrip) */
  transition: translate .22s ease;
}
#chat.dragging, #chatGrip.dragging { transition: none; }
#chat.slid { pointer-events: none; }
#chatGrip {
  position: fixed; z-index: 6; width: 104px; height: 28px; padding: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(#24539f, #173a73); border: 2px solid #5b9ae6; border-top: 0; border-radius: 0 0 12px 12px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: top .22s ease;
}
#chatGrip i { display: block; width: 40px; height: 4px; background: #fff; border-radius: 2px; opacity: .9; }
#chatGrip:hover i { background: #ffd84a; }
#chatGrip:active { cursor: grabbing; }
#chatGrip.unread::after { content: ""; position: absolute; right: 8px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #ff4d5a; border: 2px solid #fff; }
body.auth-open #chatGrip { display: none !important; }
#chatTabs { grid-row: 1 / -1; grid-column: 1; display: flex; flex-direction: column; gap: 6px; padding: 8px 6px 8px 8px; overflow-y: auto; scrollbar-width: none; background: rgba(6, 18, 48, .28); border-right: 2px solid rgba(127, 180, 242, .35); }
.ctab {
  position: relative;
  font: inherit; font-size: 17px; font-weight: bold;
  color: #cfd8f0; background: rgba(255, 255, 255, .08);
  border: 0; border-radius: 6px 6px 0 0; padding: 5px 12px; line-height: 1.15; cursor: pointer; width: 112px; text-align: center;
}
.ctab:hover { background: rgba(255, 255, 255, .16); }
.ctab.active { color: #fff; background: #11a8ff; }
.ctab .badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: #ff4d5e; color: #fff; font-size: 13px; line-height: 20px; text-align: center; }
#chatLog {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 14px;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .6);
  word-break: break-word;
  scrollbar-width: thin;
  user-select: text;
  -webkit-user-select: text;
}
.chat-line { margin: 0 0 1px; }
.chat-line b { color: #ffd84a; }
.chat-line.system { color: #9df0b0; }
.chat-line.staff { color: #ffa8e8; }
.chat-line.private { color: #ffa8e8; }
.chat-line.private b { color: #ff7ad9; }
#chatInput {
  display: none;
  flex: none;
  width: 100%;
  padding: 9px 14px;
  font: inherit;
  font-size: 19px;
  color: #fff;
  background: rgba(8, 12, 30, .85);
  border: 0;
  border-top: 2px solid #ffd84a;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
#chat.open #chatInput { display: block; }
#chatHint { flex: none; padding: 2px 14px 6px; font-size: 14px; color: rgba(255, 255, 255, .6); }
#chat.open #chatHint { display: none; }
@media (pointer: coarse) { #chatHint { display: none; } }
/* the title / mode / help text is gone; the chat sits top-centre, below the buttons on narrower screens */
#hud { display: none; }
#chat { top: 150px; }                                           /* wide chat sits below the player card and menu button... */
@media (min-width: 1650px) { #chat { top: 8px; } }               /* ...until the screen is wide enough to fit beside them */
@media (max-height: 800px) { :root { --chat-h: 176px; } .ctab { font-size: 15px; padding: 2px 10px; width: 96px; } #chatTabs { gap: 4px; padding: 6px 5px 6px 6px; } }          /* shorter chat on short screens so it stays clear of the player */

/* ---------- Inventory panel ---------- */
#invHandle {
  position: absolute;
  left: 50%;
  top: -26px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  width: 64px; height: 26px; padding: 0;
  background: rgba(20, 24, 40, .75);
  border: 2px solid rgba(255, 255, 255, .35);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  cursor: ns-resize;
  touch-action: none;
}
#invHandle i { display: block; width: 30px; height: 4px; background: #fff; border-radius: 2px; opacity: .9; }
#invHandle:hover i { background: #ffd84a; }

#invPanel {
  display: none;
  width: min(1010px, calc(100vw - 36px));
  height: 0;
  overflow: hidden;
  gap: 8px;
  box-sizing: border-box;
}
#invPanel.shown { display: flex; margin-bottom: 8px; }
.inv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: rgba(23, 58, 115, .92); border: 2px solid var(--ui-border, #5b9ae6); border-radius: 14px; }
.inv-search-row { display: flex; align-items: center; gap: 6px; }
.inv-search-icon { font-size: 16px; }
#invSearch {
  flex: 1; min-width: 0; padding: 6px 9px; font: inherit; font-size: 14px; color: #fff;
  background: rgba(40, 110, 150, .75); border: 2px solid #3b94c4; border-radius: 4px; outline: none;
  user-select: text; -webkit-user-select: text;
}
#invSearch::placeholder { color: rgba(255, 255, 255, .8); }
#invSearch:focus { border-color: #ffd84a; }
#invGrid {
  flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(10, 1fr); gap: 7px; align-content: start;
  scrollbar-width: thin; touch-action: pan-y;
}
.inv-cell {
  position: relative; aspect-ratio: 1; width: 100%;
  background: rgba(20, 50, 70, .85); border: 2px solid rgba(190, 200, 210, .55); border-radius: 4px; cursor: pointer;
}
.inv-cell.blank { cursor: default; opacity: .7; }
.inv-cell.look.worn { border-color: #5cd66b; background: rgba(92, 214, 107, .22); }
.inv-cell .count.worntag, .inv-cell .wornTag { font-size: 14px; }
.inv-cell.sel { border-color: #ffd84a; background: rgba(255, 216, 74, .22); }
.inv-cell img { width: 100%; height: 100%; display: block; padding: 3px; image-rendering: pixelated; }
.inv-cell .count { position: absolute; right: 5px; bottom: 2px; font-size: 17px; line-height: 1; color: #fff; -webkit-text-stroke: 3px #0a1e46; paint-order: stroke fill; }

.inv-side { width: 132px; display: flex; flex-direction: column; gap: 8px; flex: none; padding: 10px; background: rgba(23, 58, 115, .92); border: 2px solid var(--ui-border, #5b9ae6); border-radius: 14px; align-self: flex-start; }
#invName { min-height: 34px; font-size: 14px; text-align: center; color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,.6); word-break: break-word; }
.inv-act {
  font: inherit; font-size: 18px; color: #fff; padding: 9px 4px;
  background: #5ba7d0; border: 2px solid #b9e0f5; border-radius: 4px; cursor: pointer;
}
.inv-act:hover:not(:disabled) { background: #6fbbe6; }
.inv-act:disabled { opacity: .45; cursor: default; }

#invDialog { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .4); }
#invDialog[hidden] { display: none; }
.dlg-box { width: min(300px, 90vw); padding: 16px; text-align: center; background: rgba(20, 24, 40, .96); border: 2px solid rgba(255,255,255,.3); border-radius: 10px; }
#dlgTitle { font-size: 18px; font-weight: bold; margin-bottom: 8px; }
#dlgBody { font-size: 13px; line-height: 1.4; margin-bottom: 10px; color: rgba(255,255,255,.85); }
#dlgAmt { width: 100%; padding: 9px; margin-bottom: 10px; font: inherit; font-size: 16px; text-align: center; color: #fff; background: rgba(0,0,0,.3); border: 2px solid rgba(255,255,255,.25); border-radius: 6px; outline: none; user-select: text; -webkit-user-select: text; }
#dlgAmt[hidden] { display: none; }
#dlgAmtRow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
#dlgAmtRow[hidden] { display: none; }
#dlgAmtRow #dlgAmt { width: 76px; flex: none; margin: 0; padding: 7px 4px; }
#dlgAll { flex: none; padding: 8px 10px; font: inherit; font-size: 14px; color: #fff; background: var(--ui-btn); border: 2px solid #cfe9ff; border-bottom-color: #1a4a9a; border-radius: 8px; cursor: pointer; }
#dlgAll:active { transform: translateY(1px); }
#dlgSlider { flex: 1; min-width: 0; height: 28px; accent-color: #ffd84a; cursor: pointer; touch-action: pan-y; }
.dlg-btns { display: flex; gap: 8px; }
.dlg-btns button { flex: 1; padding: 9px; font: inherit; font-size: 14px; font-weight: bold; border: 0; border-radius: 6px; cursor: pointer; color: #fff; background: rgba(255,255,255,.18); }
.dlg-btns button#dlgOk { color: #2a2a2a; background: #ffd84a; }
.dlg-btns button[hidden] { display: none; }

/* fist / wrench slot + toast */
.slot.tool img { padding: 4px; }
#toast {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%);
  padding: 7px 14px; font-size: 14px; color: #fff;
  background: rgba(20, 24, 40, .85); border: 2px solid rgba(255, 255, 255, .3); border-radius: 18px;
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 8;
}
#toast.show { opacity: 1; }
body.auth-open #toast { display: none; }

/* tap-and-hold menu on a hotbar item */
#slotMenu { position: fixed; z-index: 30; display: flex; gap: 4px; padding: 5px; background: rgba(20, 30, 62, .95); border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
#slotMenu[hidden] { display: none; }
#slotMenu button { font: inherit; font-size: 14px; font-weight: bold; color: #fff; background: #2f6fd6; border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; }
#slotMenu button:nth-child(3) { background: #c6424f; }
#slotMenu button:hover:not(:disabled) { filter: brightness(1.15); }
#slotMenu button:disabled { opacity: .4; cursor: default; }
.slot { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

/* the circle that fills while you hold an item */
.slot { position: relative; }
.hold-ring { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; pointer-events: none; transform: rotate(-90deg); z-index: 3; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .7)); }
.hold-ring circle { fill: none; stroke-width: 4; }
.hold-ring .hr-bg { stroke: rgba(255, 255, 255, .25); }
.hold-ring .hr-fg { stroke: #ffd84a; stroke-linecap: round; stroke-dasharray: 100.53; stroke-dashoffset: 100.53; animation: hold-fill linear forwards; }
@keyframes hold-fill { to { stroke-dashoffset: 0; } }

/* player card, top-left */
#playerCard { position: fixed; top: 8px; left: 10px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; background: linear-gradient(#2c5aa8, #1f3f7d); border: 3px solid #5b8fe0; border-radius: 16px; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); color: #fff; user-select: none; -webkit-user-select: none; }
#pcAvatar { width: 76px; height: 76px; image-rendering: pixelated; background: #8ec5ff; border: 3px solid #fff; border-radius: 10px; flex: none; }
.pc-main { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pc-top { display: flex; align-items: center; gap: 9px; }
#pcName { font-size: 23px; color: #7be37b; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 1px 2px 0 rgba(0, 0, 0, .5); }
#pcLevel { font-size: 15px; color: #4a3200; background: #ffd84a; border-radius: 8px; padding: 2px 9px; }
.pc-gems { display: flex; align-items: center; gap: 9px; background: rgba(10, 20, 50, .55); border-radius: 11px; padding: 5px 6px 5px 11px; }
.pc-gem { width: 19px; height: 19px; background: #ff3d5a; transform: rotate(45deg) scale(.8); border-radius: 4px; border: 2px solid #ffb3c0; box-sizing: border-box; flex: none; }
#pcGems { font-size: 22px; min-width: 70px; font-variant-numeric: tabular-nums; }
#pcPlus { width: 34px; height: 34px; padding: 0; font: inherit; font-size: 26px; line-height: 30px; color: #fff; background: #35c25a; border: 0; border-radius: 9px; cursor: pointer; }
#pcPlus:hover { filter: brightness(1.15); }
@media (max-height: 480px), (max-width: 700px) {      /* small screens: a bit smaller, still bigger than before */
  #playerCard { padding: 7px 11px 7px 7px; gap: 9px; }
  #pcAvatar { width: 56px; height: 56px; }
  #pcName { font-size: 18px; max-width: 110px; } #pcLevel { font-size: 12px; }
  #pcGems { font-size: 17px; min-width: 54px; } .pc-xp { height: 16px; } .pc-xp span { font-size: 11px; line-height: 16px; } .pc-main { gap: 5px; } .pc-gem { width: 15px; height: 15px; } #pcPlus { width: 26px; height: 26px; font-size: 20px; line-height: 22px; }
}


/* =====================================================================
   Blue game-UI look: panels, buttons, the shop
   ===================================================================== */
:root {
  --ui-panel: linear-gradient(#24539f, #173a73);
  --ui-border: #5b9ae6;
  --ui-btn: linear-gradient(#52b0f5, #2a77d0);
  --ui-btn-edge: #9bd2ff;
  --ui-green: linear-gradient(#58d46f, #2a9d45);
  --ui-red: linear-gradient(#f0606c, #bd3040);
}
/* buttons */
.hud-btn, .inv-act, .ctab, #slotMenu button, .dlg-btns button {
  font-family: inherit; font-weight: bold; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .45);
  background: var(--ui-btn); border: 2px solid var(--ui-btn-edge); border-bottom-color: #1d5aa8;
  border-radius: 9px; box-shadow: 0 2px 0 rgba(10, 30, 70, .45);
}
.hud-btn:hover, .inv-act:hover:not(:disabled), .dlg-btns button:hover { background: var(--ui-btn); filter: brightness(1.12); border-color: #cfe9ff; }
.hud-btn:active, .inv-act:active:not(:disabled), .dlg-btns button:active, #slotMenu button:active { transform: translateY(1px); box-shadow: none; }
.hud-btn { padding: 6px 12px; font-size: 13px; }
.dlg-btns button#dlgOk, #slotMenu button:first-child { background: var(--ui-green); border-color: #a9f0b8; border-bottom-color: #1d7a34; color: #fff; }
#slotMenu button:nth-child(3) { background: var(--ui-red); border-color: #ffb3ba; border-bottom-color: #8e2431; }
#slotMenu button:nth-child(3):hover { filter: brightness(1.12); }
#invTrash { background: var(--ui-red); border-color: #ffb3ba; border-bottom-color: #8e2431; }
.ctab { flex: none; border-radius: 9px; border-bottom-width: 4px; box-shadow: none; }
.ctab.active { background: var(--ui-green); border-color: #a9f0b8; }
/* panels */
#chat, .dlg-box, #slotMenu { border: 2px solid var(--ui-border); }
#chat { background: rgba(23, 58, 115, .82); border-radius: 12px; }
.dlg-box { background: var(--ui-panel); border-radius: 14px; box-shadow: 0 6px 22px rgba(0, 0, 0, .5); }
#slotMenu { background: var(--ui-panel); border-radius: 12px; }
#dlgAmt { background: #0f2a57; border: 2px solid var(--ui-border); border-radius: 8px; color: #fff; }
#hotbar .slot, .inv-cell { background: rgba(14, 40, 88, .75); border-color: #2f7ff0; border-width: 3px; border-radius: 10px; }
#hotbar .slot.selected, .inv-cell.sel { border-color: #ffd84a; background: rgba(255, 216, 74, .25); }
#invSearch { background: #0f2a57; border-color: var(--ui-border); border-radius: 8px; }

/* round close button */
.round-x { position: absolute; top: -12px; right: -12px; z-index: 3; width: 36px; height: 36px; padding: 0; font: inherit; font-size: 26px; line-height: 30px; font-weight: bold; color: #fff; background: radial-gradient(circle at 35% 30%, #5dbbff, #1f6fd0); border: 3px solid #cfe9ff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); cursor: pointer; }
.round-x:hover { filter: brightness(1.15); }

/* ---------- Shop ---------- */
#shop { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(5, 12, 30, .6); }
#shop[hidden] { display: none; }
.shop-box { position: relative; width: min(760px, 100%); height: min(520px, 100%); display: flex; flex-direction: column; background: var(--ui-panel); border: 3px solid #7fb4f2; border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); color: #fff; }
.shop-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 56px 12px 18px; background: linear-gradient(#ffb93d, #f08a14); border-radius: 13px 13px 0 0; border-bottom: 3px solid #fcd98c; }
.shop-title { font-size: 24px; font-weight: 900; letter-spacing: 1px; color: #fff; text-shadow: 0 2px 0 rgba(120, 60, 0, .7); }
.shop-sub { font-size: 12px; color: #fff4d6; text-shadow: 0 1px 0 rgba(120, 60, 0, .6); }
.shop-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.shop-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; font-size: 12px; color: #fff; background: rgba(60, 30, 0, .55); border: 1px solid rgba(255, 220, 150, .6); border-radius: 14px; }
.shop-chip b { font-size: 14px; }
.shop-body { flex: 1; min-height: 0; display: flex; gap: 10px; padding: 10px; }
#shopCats { flex: none; width: 150px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 2px; }
.shop-cat { font: inherit; font-size: 14px; font-weight: bold; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .45); padding: 10px 8px; cursor: pointer; background: var(--ui-btn); border: 2px solid var(--ui-btn-edge); border-bottom-color: #1d5aa8; border-radius: 9px; box-shadow: 0 2px 0 rgba(10, 30, 70, .45); }
.shop-cat:hover { filter: brightness(1.12); }
.shop-cat.active { background: var(--ui-green); border-color: #ffd84a; box-shadow: 0 0 0 2px #ffd84a; }
#shopGrid { flex: 1; min-width: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; align-content: start; padding: 10px; background: rgba(8, 24, 60, .55); border: 2px solid #2d5ca5; border-radius: 12px; scrollbar-width: thin; }
.shop-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; text-align: center; background: linear-gradient(#173a73, #112b58); border: 2px solid #2d5ca5; border-radius: 12px; }
.shop-icon { position: relative; width: 62px; height: 62px; flex: none; background: linear-gradient(#6cc3ff, #2d8be0); border: 2px solid #bfe3ff; border-radius: 12px; box-shadow: 0 2px 0 rgba(10, 30, 70, .5); }
.shop-icon img { width: 100%; height: 100%; padding: 10px; box-sizing: border-box; image-rendering: pixelated; display: block; }
.shop-plus { position: absolute; top: -2px; right: 3px; font-size: 16px; font-weight: 900; color: #fff; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.shop-name { font-size: 14px; font-weight: bold; color: #ffe08a; }
.shop-desc { flex: 1; font-size: 12px; line-height: 1.35; color: #dbe9ff; }
.shop-qty { display: flex; align-items: center; gap: 3px; }
.shop-qty button { width: 26px; height: 26px; padding: 0; font: inherit; font-weight: bold; font-size: 15px; line-height: 22px; color: #fff; background: var(--ui-btn); border: 2px solid var(--ui-btn-edge); border-bottom-color: #1d5aa8; border-radius: 6px; cursor: pointer; }
.shop-qty button:last-child { width: auto; padding: 0 7px; font-size: 12px; }
.shop-qty input { width: 52px; height: 26px; padding: 0 4px; text-align: center; font: inherit; font-size: 14px; color: #fff; background: #0c2250; border: 2px solid #2d5ca5; border-radius: 6px; outline: none; }
.shop-qty input:focus { border-color: #ffd84a; }
.shop-buy { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 7px 8px; font: inherit; font-size: 14px; color: #fff; cursor: pointer; background: var(--ui-green); border: 2px solid #a9f0b8; border-bottom-color: #1d7a34; border-radius: 9px; box-shadow: 0 2px 0 rgba(10, 60, 30, .5); text-shadow: 0 1px 0 rgba(0, 0, 0, .45); }
.shop-buy b { font-size: 14px; }
.shop-buy span { margin-left: 4px; padding-left: 8px; border-left: 2px solid rgba(255, 255, 255, .4); font-weight: bold; }
.shop-buy:hover:not(:disabled) { filter: brightness(1.1); }
.shop-buy:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.shop-buy:disabled { background: linear-gradient(#7d8aa0, #5a667a); border-color: #aab4c6; border-bottom-color: #434d5e; cursor: default; }
.shop-empty { grid-column: 1 / -1; padding: 40px 10px; text-align: center; color: #cfe0ff; }
@media (max-width: 600px), (max-height: 480px) {
  #shop { padding: 8px; }
  .shop-box { height: 100%; }
  .shop-head { padding: 6px 50px 6px 12px; }
  .shop-title { font-size: 18px; }
  .shop-sub { display: none; }
  #shopCats { width: 104px; }
  .shop-cat { padding: 7px 4px; font-size: 13px; }
  #shopGrid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; padding: 8px; }
  .shop-card { padding: 7px; gap: 4px; }
  .shop-icon { width: 46px; height: 46px; }
}

/* ---------- Phones: landscape only ---------- */
#rotate { position: fixed; inset: 0; z-index: 200; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; color: #fff; background: linear-gradient(#173a73, #0d2250); }
.rot-phone { width: 54px; height: 96px; border: 5px solid #fff; border-radius: 12px; animation: rot-turn 2.4s ease-in-out infinite; }
.rot-text { font-size: 20px; font-weight: bold; }
.rot-sub { font-size: 14px; color: #bcd4ff; }
@keyframes rot-turn { 0%, 20% { transform: rotate(0deg); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) and (max-width: 820px) { #rotate { display: flex; } }

/* short screens (a phone held sideways): smaller chat, tucked under the player card */
@media (max-height: 480px) {
  :root { --chat-h: 104px; }
  #chat { left: 10px; transform: none; top: 104px; width: min(380px, 50vw); font-size: 14px; }
  .ctab { font-size: 12px; padding: 2px 8px; width: 74px; border-bottom-width: 3px; }
  #chatTabs { gap: 3px; padding: 4px; }
  #chatGrip { width: 80px; height: 22px; }
  #chatHint { display: none; }
}

.chat-line.clan { color: #ffc27a; }
.chat-line.clan b { color: #ff9d3d; }
.chat-empty { margin-top: 18px; padding: 0 12px; text-align: center; color: rgba(255, 255, 255, .7); text-shadow: none; }

/* wide inventory: 10 columns, buttons in their own panel on the right (fewer columns on narrow screens) */
@media (max-width: 760px) { #invPanel { width: calc(100vw - 20px); } .inv-side { width: 92px; } .inv-act { font-size: 15px; } #invGrid { grid-template-columns: repeat(6, 1fr); gap: 5px; } .inv-cell .count { font-size: 13px; } }
#dock:has(#invPanel.shown) { background: none; border-color: transparent; }     /* the open inventory has its own panels */
@media (max-height: 480px) {          /* short screens (phone held sideways): compact side panel so all four buttons fit */
  .inv-side { padding: 6px; gap: 5px; width: 104px; overflow-y: auto; }
  #invName { display: none; }
  .inv-act { padding: 5px 4px; font-size: 15px; }
  .inv-main { padding: 7px; gap: 6px; }
}

/* ---------- menu button (top right) and the centre menu ---------- */
.hbtn { width: 72px; height: 72px; padding: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; background: linear-gradient(#32b6ff, #1685e6); border: 3px solid #bfe6ff; border-bottom-color: #0f5db3; border-radius: 16px; box-shadow: 0 3px 0 rgba(10, 30, 70, .5), 0 4px 10px rgba(0, 0, 0, .3); }
.hbtn img { image-rendering: pixelated; display: block; }
.hbtn:hover { filter: brightness(1.1); }
.hbtn:active { transform: translateY(2px); box-shadow: none; }
@media (max-height: 520px), (max-width: 520px) { .hbtn { width: 54px; height: 54px; border-radius: 12px; } .hbtn svg { width: 34px; height: 34px; } .hbtn img { width: 39px; height: 28px; } }
#hudRight { top: 10px; right: 10px; flex-direction: column; gap: 12px; }   /* the buttons stack down the right edge */
#worldTag { font-size: 16px; }
.gm-back { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(6, 10, 30, .6); }
.gm-back[hidden] { display: none; }
.gm-box {
  position: relative; width: min(330px, 88vw); max-height: 94vh; overflow-y: auto; padding: 104px 26px 22px; border: 3px solid #0e0e38; border-radius: 16px; text-align: center;
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.06) 0 38px, transparent 39px),
    radial-gradient(circle at 12% 46%, rgba(255,255,255,.06) 0 52px, transparent 53px),
    radial-gradient(circle at 78% 70%, rgba(255,255,255,.06) 0 64px, transparent 65px),
    radial-gradient(circle at 20% 92%, rgba(255,255,255,.06) 0 44px, transparent 45px),
    linear-gradient(#272a78, #1b1c52);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
}
.gm-title { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); width: 82%; padding: 9px 12px; font-size: 26px; letter-spacing: .5px; color: #fff; background: linear-gradient(#1d8cf0, #0b62c4); border: 2px solid #0a3f8c; border-radius: 4px; box-shadow: 0 5px 0 rgba(5, 15, 60, .6); -webkit-text-stroke: 5px #0a2a66; paint-order: stroke fill; }
.gm-title::before, .gm-title::after { content: ""; position: absolute; top: 8px; width: 26px; height: 100%; background: #0a58b5; z-index: -1; }
.gm-title::before { left: -20px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 30% 50%); }
.gm-title::after { right: -20px; clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%); }
.gm-btn { display: block; width: 100%; margin: 0 0 16px; padding: 11px 6px 12px; font: inherit; font-size: 25px; line-height: 1.1; color: #fff; -webkit-text-stroke: 5px #0b2a5c; paint-order: stroke fill; cursor: pointer;
  background: linear-gradient(#27cbff 0 50%, #00b4ff 50% 100%); border: 0; border-bottom: 5px solid #0a74c4; border-radius: 4px; box-shadow: 0 6px 0 rgba(8, 10, 40, .55); }
.gm-btn:hover { filter: brightness(1.1); }
.gm-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(8, 10, 40, .55); }
.gm-close { margin-top: 26px; margin-bottom: 4px; }
@media (max-height: 520px) { .gm-box { padding-top: 84px; } .gm-btn { font-size: 21px; padding: 7px 6px 8px; margin-bottom: 10px; } .gm-close { margin-top: 14px; } .gm-title { font-size: 21px; } }

@media (max-height: 480px) { .slot { width: 54px; height: 54px; } .slot .count { font-size: 16px; } #dock { padding: 6px; bottom: 8px; } }   /* phone held sideways */
#worldTag, #who { display: none; }   /* the world name / player text beside the buttons is gone */

/* ---- Social (friends / ignored) ---- */
.soc-back { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(6, 10, 30, .6); }
.soc-back[hidden] { display: none; }
.soc-box { position: relative; width: min(620px, 100%); height: min(640px, 100%); display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--ui-panel); border: 3px solid #7fb4f2; border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); color: #fff; }
.soc-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.soc-title { font-size: 30px; letter-spacing: .5px; -webkit-text-stroke: 4px #0a1e46; paint-order: stroke fill; }
.soc-red, .soc-x, .soc-del, .soc-go, #socAddBtn { font: inherit; color: #fff; cursor: pointer; border-radius: 9px; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.soc-red { font-size: 20px; padding: 6px 16px 8px; background: var(--ui-red); border: 2px solid #ffb3ba; border-bottom: 4px solid #8e2431; -webkit-text-stroke: 3px #5a0f1a; paint-order: stroke fill; }
.soc-x { width: 46px; height: 46px; font-size: 26px; line-height: 1; background: var(--ui-red); border: 2px solid #ffb3ba; border-bottom: 4px solid #8e2431; }
.soc-red:hover, .soc-x:hover, .soc-del:hover, .soc-go:hover:not(:disabled), #socAddBtn:hover { filter: brightness(1.12); }
.soc-add { flex: none; display: flex; gap: 8px; }
#socName { flex: 1; min-width: 0; font: inherit; font-size: 20px; color: #fff; padding: 8px 12px; background: rgba(8, 20, 50, .7); border: 2px solid #4b83d6; border-radius: 9px; outline: none; }
#socName:focus { border-color: #ffd84a; }
#socAddBtn { font-size: 20px; padding: 6px 16px 8px; background: var(--ui-green); border: 2px solid #a9f0b8; border-bottom: 4px solid #1d7a34; }
.soc-msg { flex: none; min-height: 22px; font-size: 18px; color: #ffd0d4; text-align: center; }
.soc-msg.ok { color: #b8f5c4; }
.soc-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; scrollbar-width: thin; }
.soc-row { flex: none; display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: rgba(9, 27, 66, .75); border: 2px solid #234c93; border-radius: 12px; }
.soc-row img { flex: none; width: 62px; height: 46px; image-rendering: pixelated; }
.soc-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.soc-name { font-size: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 2px 0 rgba(0, 0, 0, .55); }
.soc-on { color: #46e063; } .soc-off { color: #ff4d4d; }
.soc-go { font-size: 22px; padding: 6px 10px 8px; background: linear-gradient(#35b6ff, #1481e0); border: 2px solid #8fd2ff; border-bottom: 4px solid #0f5db3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-go:disabled { cursor: default; background: #1d4f93; border-color: #2c63ad; border-bottom-color: #153a70; color: #e4eeff; }
.soc-world { color: #46e063; }
.soc-del { flex: none; width: 60px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--ui-red); border: 2px solid #ffb3ba; border-bottom: 4px solid #8e2431; }
.soc-del svg { width: 26px; height: 26px; }
.soc-empty { padding: 30px 14px; text-align: center; font-size: 20px; color: #bcd4ff; }
@media (max-height: 520px) { .soc-box { gap: 6px; padding: 8px; } .soc-title { font-size: 24px; } .soc-row { padding: 6px 10px; } .soc-row img { width: 46px; height: 34px; } .soc-name, .soc-go { font-size: 17px; } }
#chatLog, #chatInput, #chatHint { grid-column: 2; }

/* ---- Mod Tools ---- */
.mt-role { cursor: default; background: linear-gradient(#a56cff, #6a3fd0); border-color: #d9c2ff; border-bottom-color: #3f2394; }
.mt-sub { flex: none; font-size: 20px; color: #bcd4ff; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.mt-reqs { flex: none; display: flex; flex-direction: column; gap: 8px; max-height: 26%; overflow-y: auto; }
.mt-reqs:empty { display: none; }
.mt-row { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: rgba(9, 27, 66, .75); border: 2px solid #234c93; border-radius: 12px; font-size: 17px; }
.mt-row .mt-text { flex: 1; min-width: 160px; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.mt-row .mt-text small { display: block; font-size: 14px; color: #9fc0f5; }
.mt-act { color: #ffd84a; }
.mt-btn { font: inherit; font-size: 16px; padding: 4px 10px 6px; color: #fff; cursor: pointer; background: linear-gradient(#35b6ff, #1481e0); border: 2px solid #8fd2ff; border-bottom: 4px solid #0f5db3; border-radius: 9px; text-shadow: 0 2px 0 rgba(0, 0, 0, .45); }
.mt-btn.green { background: var(--ui-green); border-color: #a9f0b8; border-bottom-color: #1d7a34; }
.mt-btn.red { background: var(--ui-red); border-color: #ffb3ba; border-bottom-color: #8e2431; }
.mt-btn:hover { filter: brightness(1.12); }
.mt-detail { flex: none; max-height: 34%; overflow-y: auto; padding: 10px 14px; background: rgba(6, 18, 48, .85); border: 2px solid #4b83d6; border-radius: 12px; font-size: 16px; line-height: 1.5; }
.mt-detail b { color: #ffd84a; }
.mt-detail[hidden] { display: none; }
.shop-buy span:only-child { margin: 0; padding: 0; border: 0; }
.inv-cell.look img { object-fit: contain; padding: 6px; }
#dlgAmt { -moz-appearance: textfield; appearance: textfield; }
#dlgAmt::-webkit-outer-spin-button, #dlgAmt::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.slot.tool img[src*="wrench"] { image-rendering: auto; }

.pc-xp { position: relative; height: 20px; background: rgba(10, 20, 50, .55); border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 2px rgba(10, 20, 50, .35); }
.pc-xp i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(#8bf08f, #35c25a); border-radius: 10px; transition: width .35s ease; }
.pc-xp span { position: relative; display: block; text-align: center; font-size: 13px; line-height: 20px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); font-variant-numeric: tabular-nums; }


.pf-friend { margin: 14px 0 10px; text-align: center; }
.pf-friend > .btn { display: block; width: 100%; box-sizing: border-box; }       /* same size as the Close button below it */
.pf-ask { font-size: 18px; margin-bottom: 10px; }
.pf-friend-btns { display: flex; gap: 10px; }
.pf-friend-btns .btn { flex: 1; box-sizing: border-box; }
#profileBtn { position: relative; }
#profileBtn .badge { position: absolute; top: -6px; right: -6px; min-width: 26px; height: 26px; padding: 0 6px; box-sizing: border-box; border-radius: 13px; background: #ff3b4e; border: 3px solid #fff; color: #fff; font-size: 15px; line-height: 20px; text-align: center; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); pointer-events: none; }
.soc-sec { padding: 8px 4px 4px; font-size: 17px; color: #ffd84a; text-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.soc-req-btns { display: flex; gap: 8px; }
.soc-req-btns button { flex: 1; font: inherit; font-size: 17px; color: #fff; border: 0; border-radius: 8px; padding: 6px 0 7px; cursor: pointer; text-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.soc-acc { background: #35c25a; box-shadow: 0 3px 0 #1f8a3c; }
.soc-rej { background: #e5484d; box-shadow: 0 3px 0 #a02a2e; }
.soc-req-btns button:hover { filter: brightness(1.1); }

.inv-cell .worntag { position: absolute; left: 4px; top: 3px; font-size: 12px; font-weight: 700; color: #fff; background: #2fae48; border-radius: 6px; padding: 0 5px; line-height: 16px; }
.inv-cell { position: relative; }

.mp-tabs { flex: none; display: flex; gap: 8px; }
.mp-tabs .mt-btn { flex: 1; font-size: 19px; padding: 7px 10px 9px; }
.mp-tabs .mt-btn.on { background: var(--ui-green); border-color: #a9f0b8; border-bottom-color: #1d7a34; }
.mp-tabs .mt-btn:disabled { opacity: .45; cursor: default; filter: none; }
.mp-form { flex: none; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-height: 44px; }
.mp-form input, .mp-form select { flex: 1; min-width: 110px; font: inherit; font-size: 17px; color: #fff; padding: 7px 10px; background: #0d2150; border: 2px solid #2f5fb8; border-radius: 10px; }
.mp-form input.mp-n { flex: 0 0 90px; min-width: 0; }
.mp-status { flex: none; min-height: 22px; font-size: 16px; color: #cfe3ff; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.mp-cats { flex: 0 0 100%; display: flex; gap: 8px; }
.mp-cats .mt-btn { flex: 1; }
.mp-cats .mt-btn.on { background: var(--ui-green); border-color: #a9f0b8; border-bottom-color: #1d7a34; }

.mp-pick { flex: 1; min-width: 120px; font-size: 17px; color: #ffe27a; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.mp-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px; font: inherit; font-size: 13px; color: #fff; cursor: pointer; background: rgba(14, 40, 88, .75); border: 3px solid #2f7ff0; border-radius: 10px; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); }
.mp-item img { width: 40px; height: 40px; object-fit: contain; image-rendering: pixelated; }
.mp-item.sel { border-color: #ffd84a; background: rgba(255, 216, 74, .25); }
.mp-item:hover { filter: brightness(1.15); }

#restartBanner { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px; max-width: min(560px, calc(100vw - 20px)); padding: 10px 18px 10px 12px; color: #fff; background: linear-gradient(#ff9d19, #e66a00); border: 3px solid #ffd38a; border-bottom-width: 5px; border-radius: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); animation: rb-in .35s ease-out; }
#restartBanner[hidden] { display: none; }
#restartBanner .rb-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #e66a00; font: 900 24px/34px sans-serif; text-align: center; text-shadow: none; }
#restartBanner .rb-text b { display: block; font-size: 20px; }
#restartBanner .rb-text small { display: block; font-size: 14px; opacity: .95; }
#restartBanner.soon { animation: rb-pulse 1s ease-in-out infinite; background: linear-gradient(#ff5a4f, #c8211c); border-color: #ffb3ae; }
@keyframes rb-in { from { transform: translate(-50%, -140%); } to { transform: translate(-50%, 0); } }
@keyframes rb-pulse { 50% { filter: brightness(1.18); } }
.mp-restart { flex: 0 0 100%; display: flex; gap: 8px; flex-wrap: wrap; }
