:root {
  --panel: rgba(22, 26, 40, 0.82);
  --panel-border: rgba(255, 255, 255, 0.12);
  --accent: #7b6cf6;
  --accent2: #06d6a0;
  --text: #eef1f8;
  --muted: #aab2c5;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: #0e1320;
  user-select: none;
}
#stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: pointer;
}

.hud {
  position: fixed;
  z-index: 10;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.panel h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel h3.mt {
  margin-top: 14px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-head h3 {
  margin: 0;
}
.collapse-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.collapse-btn:hover {
  color: #fff;
}
#panel-you.collapsed #panel-you-body {
  display: none;
}
/* generic utility — hide any element tagged with the `hidden` class */
.hidden {
  display: none !important;
}

/* top bar */
#topbar {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 8px 18px;
  backdrop-filter: blur(8px);
  font-size: 14px;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.sep {
  width: 1px;
  height: 16px;
  background: var(--panel-border);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd166;
}

/* left panel */
#panel-you {
  top: 70px;
  left: 12px;
  width: 220px;
  max-height: calc(100vh - 88px); /* never run off-screen — scroll if it ever needs to */
  overflow-y: auto;
}
.row {
  display: flex;
  gap: 6px;
}
input {
  flex: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  padding: 7px 9px;
  font-size: 13px;
  outline: none;
}
input:focus {
  border-color: var(--accent);
}
.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn:disabled {
  background: #3a4055;
  color: var(--muted);
  cursor: default;
  filter: none;
}
.btn.wide {
  width: 100%;
  margin-top: 8px;
}
.muted {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0;
  line-height: 1.4;
}
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
}
.swatch:hover {
  transform: scale(1.1);
}

/* compact "Your avatar" panel — collapsible profile edit + icon-grid quick actions */
.profile-edit {
  margin-bottom: 2px;
}
.profile-edit > summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 2px;
}
.profile-edit > summary::-webkit-details-marker {
  display: none;
}
.profile-edit > summary::marker {
  content: "";
}
.profile-edit > summary:hover {
  color: #fff;
}
.profile-edit[open] > summary {
  color: var(--text);
  margin-bottom: 6px;
}
.profile-edit .row {
  margin-bottom: 6px;
}
.profile-edit .row:last-child {
  margin-bottom: 0;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.icon-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.icon-btn.on {
  background: var(--accent);
  border-color: var(--accent);
}
.icon-btn .pill-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  margin: 0;
  min-width: 16px;
  padding: 0 4px;
  font-size: 10px;
  line-height: 16px;
}
#panel-you-body > .wallet {
  margin-top: 8px;
}

/* players */
#players {
  top: 70px;
  right: 12px;
  width: 180px;
  max-height: 40vh;
  overflow: auto;
}
.player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

/* toolbar */
#bottombar {
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column; /* plot-tools popup stacks above the toolbar, both anchored bottom-left */
  gap: 8px;
}
#toolbar,
#plot-tools {
  width: 320px;
}
.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.toolbar-modes {
  grid-template-columns: repeat(2, 1fr); /* Inventory + Catalog */
}
.plot-modes {
  grid-template-columns: repeat(3, 1fr); /* Raise / Lower / Paint */
  margin-top: 8px;
}
.plot-tools-head {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.mode-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 4px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.mode-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
}
kbd {
  font-size: 10px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
  padding: 0 4px;
  color: var(--muted);
}
.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  max-height: 168px;
  overflow: auto;
}
.palette.hidden {
  display: none;
}
.pal-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
}
.pal-btn.furni {
  flex-direction: column;
  width: 64px;
  gap: 0;
  padding: 2px;
}
.pal-btn:hover {
  background: rgba(255, 255, 255, 0.13);
}
.pal-btn.sel {
  border-color: var(--accent2);
  box-shadow: 0 0 0 2px var(--accent2) inset;
}
.pal-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.furni-name {
  font-size: 10px;
  color: var(--muted);
}
.help {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

/* chat */
#chat {
  right: 12px;
  bottom: 12px;
  width: 360px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
#chat-log {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px 12px;
  height: 172px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.45;
  backdrop-filter: blur(8px);
}
.chat-line {
  margin: 1px 0;
  word-wrap: break-word;
}
.chat-line.system {
  color: var(--muted);
  font-style: italic;
}
/* Habbo/maple-style long pill typing bar: the form IS the pill, the input sits
   transparent inside it, and Send is a round button at the right end. */
#chat-form {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 5px 6px 5px 10px;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#chat-form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(123, 108, 246, 0.35);
}
#chat-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 9px 6px;
  font-size: 14px;
  color: var(--text);
}
#chat-input:focus {
  border: none;
  outline: none;
}
#chat-form .chat-send {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
}
.chat-colors {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 0 2px;
}
.chat-color {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  padding: 0;
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
}
.chat-color:hover {
  transform: scale(1.14);
}
.chat-color.sel {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent2);
}

/* misc */
#toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent2);
  color: #03261c;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 30;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#controls-hint {
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11.5px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 5px 12px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

@media (max-width: 760px) {
  #players,
  #controls-hint {
    display: none;
  }
  #toolbar,
  #plot-tools,
  #chat {
    width: 44vw;
  }
}

/* wardrobe / dressing-room modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 9, 18, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.modal.hidden {
  display: none;
}
.modal-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  width: 600px;
  max-width: 94vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--panel-border);
}
.modal-head h3 {
  margin: 0;
  font-size: 16px;
}
.x-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.x-btn:hover {
  color: #fff;
}
.ward-body {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  overflow: auto;
}
.ward-preview {
  flex: none;
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
#ward-canvas {
  background: linear-gradient(180deg, #2a3350, #1a2036);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
}
.ward-rotate {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.ward-rotate .btn {
  padding: 4px 10px;
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.08);
}
.ward-slots {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.ward-slot {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}
.ward-slot-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.ward-styles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 6px;
}
.ward-style {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
}
.ward-style:hover {
  background: rgba(255, 255, 255, 0.13);
}
.ward-style.sel {
  background: var(--accent);
  border-color: var(--accent);
}
.ward-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.ward-color {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.25);
  padding: 0;
}
.ward-color:hover {
  transform: scale(1.12);
}
.ward-color.sel {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent2);
}
@media (max-width: 620px) {
  .ward-body {
    flex-direction: column;
    align-items: center;
  }
}

/* plot settings + rights */
.modal-card.sm {
  width: 380px;
}
.plot-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}
.fld {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}
.fld .muted {
  text-transform: none;
  letter-spacing: 0;
}
.mode-row {
  display: flex;
  gap: 6px;
}
.mode-row button {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 12px;
  cursor: pointer;
}
.mode-row button:hover {
  background: rgba(255, 255, 255, 0.13);
}
.mode-row button.sel {
  background: var(--accent);
  border-color: var(--accent);
}
.rights-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow: auto;
}
.right-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.btn.on {
  background: var(--accent2);
  color: #03261c;
}

/* staff + clickable players */
.staff-name {
  color: #ffd23f;
  font-weight: 600;
}
.player-row.clickable {
  cursor: pointer;
  border-radius: 6px;
  padding: 3px 4px;
}
.player-row.clickable:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* player context menu */
.player-menu {
  position: fixed;
  z-index: 60;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
  padding: 6px;
  min-width: 172px;
  backdrop-filter: blur(8px);
}
.pm-head {
  font-weight: 700;
  font-size: 13px;
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 4px;
}
.pm-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
}
.pm-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* compact furniture controls — small Habbo-style pill */
.furni-bar {
  position: fixed;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  padding: 4px 6px 4px 12px;
  backdrop-filter: blur(8px);
}
.fb-name {
  font-weight: 700;
  font-size: 12px;
  margin-right: 4px;
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fb-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 50%;
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s;
}
.fb-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.fb-btn.fb-close:hover {
  background: rgba(239, 71, 111, 0.55);
}

/* profile card (click an avatar) */
.profile-card {
  position: fixed;
  z-index: 60;
  width: 256px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.55);
  padding: 14px;
  backdrop-filter: blur(10px);
}
.pc-top {
  display: flex;
  gap: 12px;
}
.pc-avatar {
  flex: none;
  background: linear-gradient(180deg, #2a3350, #1a2036);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
}
.pc-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.pc-name {
  font-weight: 800;
  font-size: 15px;
  word-break: break-word;
}
.pc-rank {
  font-size: 12px;
  font-weight: 700;
}
.pc-motto {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  word-break: break-word;
}
.pc-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 12px 0;
  padding: 11px 0;
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
}
.pc-stats > div {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}
.pc-stats span {
  color: var(--muted);
}
.pc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.pc-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}
.pc-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* earned achievement medallions on the profile card */
.pc-medals {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.pc-medal {
  cursor: help;
}

/* achievement unlock popup */
.ach-popup {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translate(-50%, 30px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 12px 12px;
  background: linear-gradient(135deg, rgba(30, 36, 56, 0.97), rgba(20, 24, 40, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  z-index: 60;
}
.ach-popup.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.ach-popup-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.ach-popup-name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}
.ach-popup-reward {
  font-size: 13px;
  font-weight: 800;
  color: #34c759;
  margin-top: 2px;
}

/* trophy case (achievements modal) */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px 18px;
  overflow-y: auto;
}
.ach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
}
.ach-item.locked {
  opacity: 0.6;
}
.ach-name {
  font-size: 12.5px;
  font-weight: 700;
  margin-top: 2px;
}
.ach-item.locked .ach-name {
  color: var(--muted);
}
.ach-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.ach-hint {
  padding: 10px 18px 0;
  font-size: 11.5px;
}
.ach-item.selectable {
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.ach-item.selectable:hover {
  border-color: rgba(255, 255, 255, 0.25);
}
.ach-item.displayed {
  border-color: rgba(39, 174, 96, 0.6);
  box-shadow: inset 0 0 0 1px rgba(39, 174, 96, 0.4);
}
.ach-shown-tag {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.ach-shown-tag.on {
  background: #27ae60;
  color: #fff;
}
/* badge hover tooltip (profile card) */
.badge-tip {
  position: fixed;
  z-index: 70;
  max-width: 220px;
  padding: 7px 10px;
  background: rgba(16, 20, 31, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.badge-tip-title {
  font-weight: 800;
  font-size: 12.5px;
}
.badge-tip-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.3;
}

/* drop-an-item picker */
.drop-hint {
  padding: 10px 18px 0;
  font-size: 11.5px;
}
.drop-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 18px;
}

/* groups modal */
.groups-body {
  padding: 12px 18px 18px;
  overflow-y: auto;
}
.group-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}
.group-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.group-color.sel {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
}
.groups-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}
.group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
}
.group-info {
  flex: 1;
  min-width: 0;
}
.group-name-lbl {
  font-weight: 700;
  font-size: 13px;
}
.group-row .btn {
  flex: 0 0 auto;
}
.group-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid;
  margin-right: 4px;
  vertical-align: middle;
  background: rgba(255, 255, 255, 0.05);
}
.group-desc-input {
  width: 100%;
  margin-top: 6px;
}
.group-desc {
  font-style: italic;
  margin: 1px 0;
}

/* mod panel */
.mod-hint {
  padding: 10px 18px 0;
  font-size: 11.5px;
}
.mod-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 18px 18px;
  overflow-y: auto;
}
.mod-row {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 8px 10px;
}
.mod-name {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}
.mod-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.btn.tiny {
  font-size: 11px;
  padding: 4px 8px;
}
.btn.danger {
  background: #c0392b;
}
.btn.danger:hover {
  background: #d9483b;
}

/* group detail (members + owner controls) */
.gd-body {
  padding: 12px 18px 18px;
  overflow-y: auto;
}
.gd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.gd-desc {
  font-style: italic;
  font-size: 12px;
}
.gd-members {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.gd-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  font-size: 13px;
}
.gd-controls {
  margin-top: 10px;
}

/* auth gate (login / register) */
body:not(.in-game) .hud {
  display: none !important;
}
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 25%, #1b2440, #0b0f1c);
}
.auth-screen.hidden {
  display: none;
}
.auth-card {
  width: 340px;
  max-width: 90vw;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  text-align: center;
  backdrop-filter: blur(8px);
}
.auth-brand {
  font-size: 26px;
  font-weight: 800;
}
.auth-tagline {
  color: var(--muted);
  margin: 4px 0 20px;
  font-size: 14px;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 9px;
  padding: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
.auth-tab.active {
  background: var(--accent);
  border-color: var(--accent);
}
#auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#auth-form input {
  width: 100%;
  padding: 11px 12px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  color: var(--text);
  outline: none;
}
#auth-form input:focus {
  border-color: var(--accent);
}
.auth-error {
  color: #ff8088;
  font-size: 13px;
  min-height: 17px;
  text-align: left;
}
.auth-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.auth-hint a {
  color: var(--accent2);
  cursor: pointer;
  text-decoration: underline;
}
.link-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}
.link-btn:hover {
  color: #fff;
  text-decoration: underline;
}
.online-time {
  margin-top: 8px;
  font-size: 12.5px;
}
.wallet {
  display: flex;
  align-items: center;
  gap: 14px;
}
.money {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
}
.money b {
  font-weight: 800;
}
.money.cents {
  font-size: 12.5px;
  color: var(--muted);
}
.money-icon {
  display: block;
}

/* catalog (shop) */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
  padding: 16px 18px;
  overflow: auto;
}
.cat-item {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
/* items you already own get a clear green "Owned" badge + outline */
.cat-item.owned {
  border-color: rgba(39, 174, 96, 0.55);
  box-shadow: inset 0 0 0 1px rgba(39, 174, 96, 0.35);
}
.owned-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  background: #27ae60;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  letter-spacing: 0.2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.cat-name {
  font-size: 12.5px;
  font-weight: 600;
}
.cat-price {
  font-size: 11.5px;
  color: var(--accent2);
  font-weight: 700;
  margin-bottom: 5px;
  text-align: center;
}
.cat-item .btn {
  width: 100%;
}
.catalog-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 18px 0;
}
.cat-tab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.cat-tab:hover {
  background: rgba(255, 255, 255, 0.13);
}
.cat-tab.sel {
  background: var(--accent);
  border-color: var(--accent);
}

/* ===== limited-edition rares (LTD) ===== */
/* rare cards get a gilded look so they read as special in the ✨ Rares tab */
.cat-item.ltd {
  border-color: rgba(232, 193, 74, 0.6);
  background: linear-gradient(180deg, rgba(232, 193, 74, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(232, 193, 74, 0.28), 0 2px 10px rgba(232, 193, 74, 0.12);
}
.cat-item.ltd.owned {
  /* keep the green owned outline but warm it toward gold */
  border-color: rgba(39, 174, 96, 0.55);
}
/* the "N / total left" supply counter */
.ltd-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #f4d35e;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
/* a placed rare's serial, shown in the furni interaction bar */
.fb-serial {
  font-size: 11px;
  font-weight: 800;
  color: #1a1305;
  background: linear-gradient(180deg, #f6dd7a, #e8c14a);
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 6px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* ===== fishing: NPC shops, fishmonger, the fishing-bag collection, catches ===== */
.modal-card.wide { width: 760px; }
.modal-card.npc-shop { width: 380px; }
.npc-shop-body { padding: 16px 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.npc-shop-body .cat-item { width: 160px; }
.npc-line { margin: 0; font-style: italic; color: var(--muted); font-size: 12.5px; text-align: center; line-height: 1.4; padding: 6px 18px 0; }
.npc-hint { font-size: 11.5px; text-align: center; }

.monger-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 18px 0; font-size: 13px; }
.monger-total b { color: var(--accent2); }
.monger-total .btn { white-space: nowrap; }

.fish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; padding: 14px 18px; }
.fish-bag-grid { overflow-y: auto; max-height: 64vh; }
.fish-bag-grid .fish-grid { padding-top: 6px; padding-bottom: 4px; }
.fish-cell { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 8px 6px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--panel-border); border-radius: 11px; }
.fish-cell.locked { opacity: 0.5; }
.fish-cell.rare { border-color: rgba(58, 166, 214, 0.5); }
.fish-cell.ultra { border-color: rgba(255, 206, 58, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 206, 58, 0.3); }
.fish-cell.locked.rare, .fish-cell.locked.ultra { border-color: var(--panel-border); box-shadow: none; }
.fish-name { font-size: 11px; font-weight: 600; line-height: 1.15; }
.fish-cell.locked .fish-name { color: var(--muted); }
.fish-qty { position: absolute; top: 5px; right: 6px; background: var(--accent2); color: #0b1020; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; }
.fish-cell .btn.tiny { width: 100%; }
.btn.tiny { padding: 4px 8px; font-size: 10.5px; }

.fish-group-head { font-size: 12px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: var(--muted); padding: 14px 18px 2px; }
.fish-group-head.rare { color: #3aa6d6; }
.fish-group-head.ultra { color: #ffce3a; }

/* fishing level + XP bar + daily energy header (top of the Fishing Bag) */
.fish-stats { padding: 8px 4px 4px; display: flex; flex-direction: column; gap: 5px; }
.fish-stat-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; }
.fish-level { font-weight: 800; color: #ffd86b; }
.fish-energy { font-weight: 700; color: #5bc0e8; }
.fish-energy.empty { color: #e8896b; }
.fish-bar { height: 7px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.fish-bar-fill { height: 100%; border-radius: 5px; transition: width 0.3s ease; }
.fish-bar-fill.xp { background: linear-gradient(90deg, #ffce3a, #ffb02e); }
.fish-bar-fill.energy { background: linear-gradient(90deg, #3aa6d6, #5bc0e8); }
.fish-bar-fill.energy.empty { background: #6b3a2a; }
.fish-popup.levelup { border-color: rgba(255, 206, 58, 0.7); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 206, 58, 0.35); }
.fish-popup.levelup .fish-popup-kicker { color: #ffd86b; }

/* the held-rod tool button in the inventory bar, when equipped */
.pal-btn.tool.sel { border-color: #1f8fb0; box-shadow: 0 0 0 2px #1f8fb0 inset; }

/* catch celebration popup (a sibling of .ach-popup) */
.fish-popup {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 30px);
  display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px;
  background: linear-gradient(135deg, rgba(30, 36, 56, 0.97), rgba(20, 24, 40, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  z-index: 60;
}
.fish-popup.show { opacity: 1; transform: translate(-50%, 0); }
.fish-popup.rare { border-color: rgba(58, 166, 214, 0.6); }
.fish-popup.ultra { border-color: rgba(255, 206, 58, 0.7); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 22px rgba(255, 206, 58, 0.3); }
.fish-popup-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.fish-popup.rare .fish-popup-kicker { color: #5bc0e8; }
.fish-popup.ultra .fish-popup-kicker { color: #ffd86b; }
.fish-popup-name { font-size: 16px; font-weight: 800; color: #fff; }
.fish-popup-val { font-size: 12.5px; font-weight: 700; color: #34c759; margin-top: 2px; }
.fish-popup.away { border-color: rgba(232, 137, 107, 0.6); }
.fish-popup.away .fish-popup-kicker { color: #e8896b; }
.fish-popup.away .fish-popup-val { color: var(--muted); }

/* ===== settings: top-right cog, panel, FPS meter ===== */
#settings-cog {
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  line-height: 1;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text);
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, filter 0.15s ease;
}
#settings-cog:hover {
  filter: brightness(1.12);
  transform: rotate(45deg);
}

#fps-meter {
  top: 16px;
  right: 60px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  color: var(--text);
}
#fps-meter.good { color: #4cd964; }
#fps-meter.ok { color: #ffd166; }
#fps-meter.bad { color: #ff6b6b; }

.settings-body {
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
}
.set-section {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.set-section:first-child { margin-top: 0; }
.set-row { display: flex; flex-direction: column; gap: 7px; }
.set-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.set-label { font-size: 13.5px; }
.set-val {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent2);
  font-variant-numeric: tabular-nums;
}
.set-hint { font-size: 11px; color: var(--muted); }
.set-row-toggle { flex-direction: row; align-items: center; justify-content: space-between; }
.set-toggle-right { display: flex; align-items: center; gap: 8px; }

/* range slider */
.set-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  padding: 0;
  cursor: pointer;
}
.set-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.set-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: pointer;
}

/* toggle switch */
.set-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  padding: 0;
  transition: background 0.18s ease;
  flex: none;
}
.set-switch.on { background: var(--accent2); }
.set-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}
.set-switch.on .set-knob { transform: translateX(18px); }

.set-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.set-actions .btn { flex: 1; margin-top: 0; }

/* ===== friends + messenger ===== */
/* little count badge on the Friends panel button */
.pill-badge {
  display: inline-block;
  min-width: 17px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: #ff5a5a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  vertical-align: middle;
}

.friends-card { width: 640px; }
.friends-body { display: flex; min-height: 0; height: 460px; max-height: 76vh; }
.friends-left {
  width: 240px;
  flex: none;
  border-right: 1px solid var(--panel-border);
  padding: 12px 12px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.friends-right { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.friends-add { display: flex; gap: 6px; }
.friends-add input { flex: 1; }
.friends-add .btn { flex: none; }
.fld { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.friend-requests { display: flex; flex-direction: column; gap: 6px; }
.req-row {
  display: flex; align-items: center; gap: 6px;
  background: rgba(123, 108, 246, 0.14);
  border: 1px solid rgba(123, 108, 246, 0.35);
  border-radius: 9px; padding: 6px 8px;
}
.req-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.friends-list { display: flex; flex-direction: column; gap: 2px; }
.friends-none { line-height: 1.4; padding: 4px 2px; }
.friend-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 9px; cursor: pointer;
}
.friend-row:hover { background: rgba(255, 255, 255, 0.06); }
.friend-row.sel { background: rgba(123, 108, 246, 0.22); }
.fr-dot { width: 9px; height: 9px; border-radius: 50%; background: #5a6072; flex: none; }
.fr-dot.on { background: #34c759; box-shadow: 0 0 6px rgba(52, 199, 89, 0.7); }
.fr-name { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-unread { background: #ff5a5a; color: #fff; font-size: 10px; font-weight: 800; min-width: 17px; text-align: center; padding: 1px 5px; border-radius: 999px; }
.fr-remove { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 12px; opacity: 0; padding: 0 2px; }
.friend-row:hover .fr-remove { opacity: 1; }
.fr-remove:hover { color: #ff6b6b; }

.friends-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }
.friends-convo { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.convo-head { padding: 12px 16px; border-bottom: 1px solid var(--panel-border); display: flex; align-items: baseline; gap: 8px; }
#convo-name { font-weight: 800; font-size: 15px; }
#convo-status { font-size: 11.5px; }
#convo-status.online { color: #34c759; }
.convo-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.dm-line { display: flex; }
.dm-line.mine { justify-content: flex-end; }
.dm-bubble {
  max-width: 78%; padding: 7px 11px; border-radius: 13px; font-size: 13px; line-height: 1.35;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.dm-line.theirs .dm-bubble { background: rgba(255, 255, 255, 0.1); border-bottom-left-radius: 4px; }
.dm-line.mine .dm-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.convo-typing {
  height: 16px;
  padding: 0 14px;
  font-size: 11.5px;
  font-style: italic;
  color: var(--accent2);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.convo-typing.show { opacity: 1; }
.convo-form { display: flex; gap: 8px; padding: 8px 14px 10px; border-top: 1px solid var(--panel-border); }
.convo-form input { flex: 1; }
.convo-form .btn { flex: none; }

@media (max-width: 680px) {
  .friends-card { width: 94vw; }
  .friends-left { width: 42%; }
}

/* ===== user-to-user trading ===== */
.trade-invite {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(30, 36, 56, 0.98), rgba(20, 24, 40, 0.98));
  border: 1px solid rgba(123, 108, 246, 0.55);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}
.trade-invite-txt { font-size: 14px; }
.trade-invite-acts { display: flex; gap: 8px; }
.trade-invite-acts .btn { padding: 6px 14px; }

.trade-card { width: 640px; }
.trade-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.trade-cols { display: flex; gap: 12px; }
.trade-col {
  flex: 1; min-width: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.trade-col-head { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.trade-tag { font-size: 11px; font-weight: 800; color: var(--muted); }
.trade-tag.on { color: var(--accent2); }
.trade-offer {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 112px;
  align-content: flex-start;
}
.trade-empty { width: 100%; text-align: center; padding: 38px 0; font-size: 12px; }
.trade-cash { font-size: 13px; font-weight: 700; color: var(--accent2); min-height: 18px; }

.trade-tile {
  position: relative;
  width: 50px; height: 50px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.trade-tile:hover:not(.static):not(.depleted) { border-color: var(--accent); }
.trade-tile.static { cursor: default; }
.trade-tile.depleted { opacity: 0.35; cursor: default; }
.trade-tile-q {
  position: absolute; bottom: 1px; right: 3px;
  font-size: 10px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.trade-status {
  text-align: center; font-size: 13px; font-weight: 600;
  padding: 7px; border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
}
.trade-edit { display: flex; flex-direction: column; gap: 8px; }
.trade-edit.locked { opacity: 0.5; pointer-events: none; }
.trade-add-head { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.trade-inv {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 124px; overflow-y: auto;
  padding: 2px;
}
.trade-cash-edit { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.trade-cash-edit input { flex: none; width: 110px; }
.trade-actions { display: flex; gap: 8px; }
.trade-actions .btn { flex: 1; margin-top: 0; }
.trade-actions #trade-confirm { flex: 1.4; background: var(--accent2); color: #03261c; }
.trade-actions .btn.ghost { flex: 0.7; }

@media (max-width: 680px) {
  .trade-card { width: 94vw; }
}

/* ===== emote / dance menu ===== */
.emote-menu {
  position: fixed;
  z-index: 40;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}
.emote-cap {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2px 2px 5px;
}
.emote-cap + .emote-row { margin-bottom: 8px; }
.emote-row { display: flex; gap: 6px; }
.emote-opt {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.06);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, background 0.12s ease;
}
.emote-opt:hover { background: rgba(123, 108, 246, 0.3); transform: translateY(-2px); }
.emote-opt.stop { background: rgba(255, 90, 90, 0.18); border-color: rgba(255, 90, 90, 0.4); }

/* "keep it on the line" reel minigame (public/js/fishingmini.js) */
.reel-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 11, 20, 0.45); backdrop-filter: blur(2px);
  cursor: pointer; touch-action: none; user-select: none;
}
.reel-panel {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 22px 16px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(30, 36, 56, 0.98), rgba(18, 22, 38, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
  animation: reel-pop 0.18s ease;
}
@keyframes reel-pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.reel-panel.rare { border-color: rgba(58, 166, 214, 0.6); }
.reel-panel.ultra { border-color: rgba(255, 206, 58, 0.7); box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55), 0 0 26px rgba(255, 206, 58, 0.28); }
.reel-title { font-size: 15px; font-weight: 800; color: #fff; }
.reel-panel.ultra .reel-title { color: #ffd86b; }
.reel-canvas { display: block; }
.reel-hint { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.reel-panel.won { border-color: #5dc77a; box-shadow: 0 0 0 2px rgba(93, 199, 122, 0.5), 0 18px 48px rgba(0, 0, 0, 0.55); }
.reel-panel.lost { border-color: #e8896b; box-shadow: 0 0 0 2px rgba(232, 137, 107, 0.5), 0 18px 48px rgba(0, 0, 0, 0.55); }
.reel-panel.won .reel-title::after { content: '  ✓ landed!'; color: #5dc77a; }
.reel-panel.lost .reel-title::after { content: '  ✗ got away'; color: #e8896b; }

/* ----- farming (seed shop, market, seed pouch + harvest) ----- */
.crop-card { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.crop-meta { font-size: 10.5px; text-align: center; line-height: 1.25; }
.crop-lock { font-size: 11px; font-weight: 600; color: #c98a3a; margin-top: 2px; }
/* the seed you've selected to plant glows green in the pouch */
.fish-cell.seed-cell.active-seed { border-color: #5dc77a; box-shadow: 0 0 0 2px rgba(93, 199, 122, 0.5); }
.fish-cell.seed-cell .btn.tiny { margin-top: 4px; }

/* ----- count-achievement progress (X / N bar on locked count badges + toast milestone) ----- */
.ach-progress { width: 100%; margin-top: 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ach-progress-bar { width: 84%; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, 0.18); overflow: hidden; }
.ach-progress-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #f0a500, #f2c94c); }
.ach-progress-txt { font-size: 10px; font-weight: 600; color: var(--muted); }
.ach-popup-goal { font-size: 11.5px; font-weight: 600; color: #f0a500; margin-top: 1px; }
