/* Wide map mode: side content panels are hidden until they become image/button popups. */
.left-panels,
.right-panels {
  display: none !important;
}

.shell {
  padding: 0;
}

.game-frame {
  width: 100vw;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}

.play-layout {
  grid-template-columns: 82px minmax(0, 1fr) 84px;
  gap: 8px;
  padding: 8px;
}

.stage,
#farmCanvas {
  min-height: calc(100vh - 164px);
}

.stage {
  border-radius: 8px;
}

.rail {
  position: relative;
  z-index: 4;
}



@media (max-width: 1460px) {
  .play-layout {
    grid-template-columns: 76px minmax(0, 1fr) 78px;
  }

  .right-rail {
    display: grid;
  }
}

@media (max-width: 1120px) {
  .play-layout {
    grid-template-columns: 1fr;
  }

  .left-rail,
  .right-rail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stage,
  #farmCanvas {
    min-height: 620px;
  }
}

@media (max-width: 720px) {
  .stage,
  #farmCanvas {
    min-height: 520px;
  }
}


/* Image-backed buttons generated for the wide map UI. */
.image-button {
  min-height: 98px;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.image-button:hover {
  border-color: transparent;
  box-shadow: none;
}

.image-button img {
  display: block;
  width: min(82px, 100%);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 9px 10px rgba(86, 56, 15, 0.26));
}

.shop-cta.image-button {
  align-content: center;
  min-height: 104px;
}

@media (max-width: 1120px) {
  .shop-cta.image-button {
    min-height: 66px;
  }

  .shop-cta.image-button img {
    width: 66px;
  }
}

/* Large in-map XP bar. The fill width is driven from game.js using current XP. */
.stage-xp {
  position: absolute;
  left: clamp(12px, 1.6vw, 24px);
  top: clamp(10px, 1.4vw, 20px);
  z-index: 4;
  width: clamp(286px, 31vw, 500px);
  height: clamp(78px, 8vw, 116px);
  pointer-events: none;
  filter: drop-shadow(0 11px 13px rgba(45, 33, 14, 0.2));
}

.stage-xp-track {
  position: absolute;
  left: 17.5%;
  right: 0;
  top: 38%;
  height: 28%;
  overflow: hidden;
  border: clamp(3px, 0.35vw, 6px) solid #9d6517;
  border-radius: 999px;
  background: linear-gradient(180deg, #372205, #5d3907 54%, #281704);
  box-shadow:
    inset 0 2px 0 rgba(255, 226, 104, 0.22),
    inset 0 -3px 0 rgba(24, 10, 0, 0.36),
    0 2px 0 #513008;
}

.stage-xp-track::before {
  content: "";
  position: absolute;
  inset: 9% 2% auto 2%;
  height: 25%;
  border-radius: 999px;
  background: rgba(255, 224, 116, 0.14);
  z-index: 2;
}

.stage-xp-fill {
  position: relative;
  z-index: 1;
  display: block;
  width: 0%;
  height: 100%;
  min-width: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0) 36%),
    linear-gradient(90deg, #fff07a 0%, #ffd23f 45%, #ffc107 100%);
  box-shadow:
    inset 0 -5px 0 rgba(198, 118, 0, 0.18),
    0 0 12px rgba(255, 209, 34, 0.32);
  transition: width 240ms ease;
}

.stage-level-badge {
  position: absolute;
  left: 0;
  top: 4%;
  z-index: 3;
  width: 23%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0%, 61% 34%, 98% 35%, 68% 56%, 79% 92%, 50% 70%, 21% 92%, 32% 56%, 2% 35%, 39% 34%);
  color: #5b3306;
  font-size: clamp(1.28rem, 2.4vw, 2.32rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 244, 157, 0.9), 0 2px 0 rgba(113, 61, 0, 0.18);
  background:
    radial-gradient(circle at 34% 25%, #fffef2 0 7%, transparent 9%),
    radial-gradient(circle at 41% 32%, #fff58b 0 14%, transparent 18%),
    linear-gradient(145deg, #fff06c 0%, #ffc21d 56%, #e38a05 100%);
  filter:
    drop-shadow(0 0 0 #6f3f08)
    drop-shadow(0 4px 0 #714006)
    drop-shadow(0 8px 11px rgba(58, 28, 0, 0.32));
}

.stage-xp-text {
  position: absolute;
  left: 26%;
  top: 70%;
  min-width: 7.5em;
  padding: 3px 9px 4px;
  border-radius: 999px;
  color: #51300b;
  background: rgba(255, 246, 190, 0.88);
  border: 1px solid rgba(129, 81, 16, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 4px 8px rgba(65, 39, 10, 0.12);
  font-size: clamp(0.68rem, 0.92vw, 0.82rem);
  font-weight: 950;
  white-space: nowrap;
}

.action-hint {
  top: clamp(92px, 10vw, 134px);
}

.level-chip .xp-track span {
  background: linear-gradient(90deg, #fff06c, #ffc107);
}

@media (max-width: 720px) {
  .stage-xp {
    width: min(340px, calc(100% - 24px));
    height: 82px;
  }

  .action-hint {
    top: 96px;
  }
}

/* The large in-map XP bar replaces the compact header version. */
.hud .level-chip {
  display: none;
}


/* Asset-backed XP bar using the generated frame and fill images. */
.stage-xp {
  --xp-right: 79.4%;
  width: clamp(390px, 31vw, 620px);
  height: auto;
  aspect-ratio: 2172 / 724;
  filter: drop-shadow(0 11px 12px rgba(45, 33, 14, 0.2));
}

.stage-xp-base,
.stage-xp-fill-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.stage-xp-base {
  z-index: 1;
}

.stage-xp-fill-image {
  z-index: 2;
  opacity: 0;
  clip-path: inset(33.8% var(--xp-right, 79.4%) 31.2% 20.6% round 999px);
  transition: clip-path 240ms ease, opacity 180ms ease;
}

.stage-level-badge {
  left: 12.8%;
  top: 43.2%;
  transform: translate(-50%, -50%);
  width: 8.6%;
  height: 18%;
  aspect-ratio: auto;
  display: grid;
  place-items: center;
  clip-path: none;
  background: transparent;
  filter: none;
  color: #5f3605;
  font-size: clamp(1.32rem, 2vw, 2.55rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 239, 125, 0.82), 0 4px 0 rgba(119, 64, 0, 0.18);
}

.stage-xp-text {
  z-index: 4;
  left: 24.5%;
  top: 62%;
  padding: 4px 11px 5px;
  color: #563209;
  background: rgba(255, 244, 177, 0.9);
  border-color: rgba(129, 81, 16, 0.28);
  font-size: clamp(0.68rem, 0.82vw, 0.86rem);
}

.action-hint {
  top: clamp(122px, 10.8vw, 184px);
}

@media (max-width: 720px) {
  .stage-xp {
    width: min(390px, calc(100% - 18px));
  }

  .stage-level-badge {
    font-size: clamp(1.18rem, 7vw, 1.75rem);
  }

  .action-hint {
    top: 124px;
  }
}


/* Place XP amount inside the generated bar frame. */
.stage-xp-text {
  left: 26.2%;
  top: 45%;
  transform: none;
  z-index: 4;
  min-width: 7.2em;
  padding: 3px 10px 4px;
  border: 2px solid rgba(180, 111, 13, 0.78);
  border-radius: 999px;
  color: #4d2b05;
  background: linear-gradient(180deg, rgba(255, 250, 190, 0.98), rgba(255, 217, 85, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -2px 0 rgba(168, 97, 0, 0.18),
    0 2px 4px rgba(31, 18, 4, 0.22);
  font-size: clamp(0.66rem, 0.78vw, 0.82rem);
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 221, 0.75);
}

@media (max-width: 720px) {
  .stage-xp-text {
    left: 26.5%;
    top: 44%;
    min-width: 6.6em;
    padding: 2px 8px 3px;
    font-size: 0.64rem;
  }
}

/* Cleaner XP text: integrated into the generated bar instead of a separate pill. */
.stage-xp-text {
  left: 58%;
  top: 51.5%;
  transform: translate(-50%, -50%);
  z-index: 4;
  min-width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #fff0a8;
  background: transparent;
  box-shadow: none;
  font-size: clamp(0.76rem, 0.95vw, 1rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 2px 0 #3b2103,
    0 -1px 0 rgba(255, 255, 224, 0.62),
    1px 0 0 #3b2103,
    -1px 0 0 #3b2103;
}

@media (max-width: 720px) {
  .stage-xp-text {
    left: 58%;
    top: 51.5%;
    min-width: auto;
    padding: 0;
    font-size: clamp(0.66rem, 3vw, 0.82rem);
  }
}


/* Avatar beside XP, matching the classic farm-game header composition. */
.stage-xp {
  --avatar-size: clamp(72px, 6.2vw, 102px);
  --avatar-gap: clamp(2px, 0.35vw, 8px);
  left: clamp(12px, 1.2vw, 20px);
  top: clamp(8px, 1.1vw, 16px);
  width: clamp(520px, 43vw, 760px);
  height: clamp(106px, 10.3vw, 172px);
  aspect-ratio: auto;
}

.stage-avatar {
  position: absolute;
  left: 0;
  top: 51%;
  z-index: 6;
  width: var(--avatar-size);
  height: var(--avatar-size);
  object-fit: contain;
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 7px 8px rgba(46, 31, 10, 0.26));
}

.stage-xp-art {
  position: absolute;
  left: calc(var(--avatar-size) + var(--avatar-gap));
  top: 50%;
  width: calc(100% - var(--avatar-size) - var(--avatar-gap));
  aspect-ratio: 2172 / 724;
  transform: translateY(-50%);
}

.stage-xp-base,
.stage-xp-fill-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.action-hint {
  top: clamp(122px, 10.8vw, 184px);
}

@media (max-width: 720px) {
  .stage-xp {
    --avatar-size: clamp(58px, 15vw, 72px);
    width: min(480px, calc(100% - 16px));
    height: 116px;
  }

  .action-hint {
    top: 112px;
  }
}

/* Balance the avatar against the large XP star. */
.stage-xp {
  --avatar-size: clamp(96px, 8.8vw, 122px);
  --avatar-gap: clamp(0px, 0.18vw, 4px);
}

.stage-avatar {
  top: 50%;
}

@media (max-width: 720px) {
  .stage-xp {
    --avatar-size: clamp(82px, 21vw, 98px);
    --avatar-gap: 0px;
    height: 128px;
  }
}


/* Asset-backed currency counter. The middle section stretches with the number. */
.currency-stat {
  position: relative;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.currency-icon {
  position: relative;
  z-index: 3;
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-right: -13px;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 5px 5px rgba(63, 36, 7, 0.28));
}

.currency-frame {
  --coin-width: 78px;
  --counter-height: 32px;
  --counter-cap: 20px;
  position: relative;
  z-index: 2;
  width: var(--coin-width);
  height: var(--counter-height);
  display: grid;
  place-items: center;
  padding: 0 calc(var(--counter-cap) * 0.72) 0 calc(var(--counter-cap) * 0.96);
  isolation: isolate;
}

.currency-frame,
.currency-frame::before,
.currency-frame::after {
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.currency-frame {
  background-image: url("../assets/optimized/coin-counter-middle.webp");
}

.currency-frame::before,
.currency-frame::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--counter-cap);
  z-index: 0;
  pointer-events: none;
}

.currency-frame::before {
  left: 0;
  background-image: url("../assets/optimized/coin-counter-left.webp");
}

.currency-frame::after {
  right: 0;
  background-image: url("../assets/optimized/coin-counter-right.webp");
}

.currency-value {
  position: relative;
  z-index: 1;
  min-width: 1ch;
  color: #fff7df;
  font-size: 0.96rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-shadow:
    0 2px 0 #2d1a05,
    1px 0 0 #2d1a05,
    -1px 0 0 #2d1a05,
    0 -1px 0 rgba(255, 255, 229, 0.5);
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .currency-stat {
    min-height: 42px;
  }

  .currency-icon {
    width: 42px;
    height: 42px;
    margin-right: -11px;
  }

  .currency-frame {
    --counter-height: 29px;
    --counter-cap: 18px;
  }

  .currency-value {
    font-size: 0.86rem;
  }
}


/* Coins live beside the level/XP cluster, matching the original farm HUD layout. */
.stage-xp {
  --xp-art-width: clamp(390px, 31vw, 560px);
  --coin-gap: clamp(8px, 0.8vw, 18px);
  width: clamp(720px, 58vw, 980px);
}

.stage-xp-art {
  width: var(--xp-art-width);
}

.stage-coin-counter {
  position: absolute;
  left: calc(var(--avatar-size) + var(--avatar-gap) + var(--xp-art-width) + var(--coin-gap));
  top: 50%;
  z-index: 7;
  transform: translateY(-50%);
  pointer-events: none;
}

.stage-coin-counter .currency-icon {
  width: clamp(46px, 3.9vw, 58px);
  height: clamp(46px, 3.9vw, 58px);
  margin-right: clamp(-16px, -1vw, -12px);
}

.stage-coin-counter .currency-frame {
  --counter-height: clamp(30px, 2.45vw, 38px);
  --counter-cap: clamp(18px, 1.5vw, 24px);
}

.stage-coin-counter .currency-value {
  font-size: clamp(0.9rem, 1vw, 1.12rem);
}

@media (max-width: 1120px) {
  .stage-xp {
    --xp-art-width: clamp(320px, 44vw, 470px);
    width: min(760px, calc(100% - 18px));
  }
}

@media (max-width: 720px) {
  .stage-xp {
    --xp-art-width: min(330px, calc(100% - var(--avatar-size) - 6px));
    width: min(560px, calc(100% - 16px));
    height: 132px;
  }

  .stage-coin-counter {
    left: calc(var(--avatar-size) + 8px);
    top: 84%;
  }

  .stage-coin-counter .currency-icon {
    width: 38px;
    height: 38px;
    margin-right: -10px;
  }

  .stage-coin-counter .currency-frame {
    --counter-height: 27px;
    --counter-cap: 17px;
  }

  .stage-coin-counter .currency-value {
    font-size: 0.78rem;
  }
}


/* Rebalance coin counter beside XP so it reads as a full HUD element. */
.stage-xp {
  --coin-gap: clamp(6px, 0.55vw, 12px);
  --xp-art-width: clamp(390px, 31vw, 560px);
}

.stage-coin-counter {
  top: 51%;
}

.stage-coin-counter .currency-icon {
  width: clamp(64px, 4.7vw, 78px);
  height: clamp(64px, 4.7vw, 78px);
  margin-right: clamp(-24px, -1.35vw, -18px);
  filter: drop-shadow(0 7px 7px rgba(50, 31, 8, 0.28));
}

.stage-coin-counter .currency-frame {
  --coin-width: 124px;
  --counter-height: clamp(38px, 3.05vw, 48px);
  --counter-cap: clamp(25px, 2vw, 31px);
  padding-left: calc(var(--counter-cap) * 1.02);
  padding-right: calc(var(--counter-cap) * 0.9);
}

.stage-coin-counter .currency-value {
  font-size: clamp(1.04rem, 1.18vw, 1.34rem);
  transform: translateY(-2px);
}

@media (max-width: 1120px) {
  .stage-xp {
    --xp-art-width: clamp(310px, 42vw, 450px);
    width: min(790px, calc(100% - 18px));
  }

  .stage-coin-counter .currency-icon {
    width: 60px;
    height: 60px;
    margin-right: -18px;
  }

  .stage-coin-counter .currency-frame {
    --counter-height: 38px;
    --counter-cap: 25px;
  }
}

@media (max-width: 720px) {
  .stage-coin-counter {
    top: 84%;
  }

  .stage-coin-counter .currency-icon {
    width: 44px;
    height: 44px;
    margin-right: -12px;
  }

  .stage-coin-counter .currency-frame {
    --coin-width: 112px;
    --counter-height: 30px;
    --counter-cap: 19px;
  }

  .stage-coin-counter .currency-value {
    font-size: 0.88rem;
    transform: translateY(-1px);
  }
}


/* Use the complete coin counter artwork so the rounded right end stays clean. */
.currency-frame {
  --coin-width: 138px;
  --counter-height: 36px;
  --counter-cap: 0px;
  width: var(--coin-width);
  height: var(--counter-height);
  padding: 0 20px 0 31px;
  background: url("../assets/optimized/coin-counter-full.webp") center / 100% 100% no-repeat;
}

.currency-frame::before,
.currency-frame::after {
  display: none;
}

.stage-coin-counter {
  top: 50%;
}

.stage-coin-counter .currency-icon {
  width: clamp(56px, 4.05vw, 68px);
  height: clamp(56px, 4.05vw, 68px);
  margin-right: clamp(-18px, -1vw, -14px);
}

.stage-coin-counter .currency-frame {
  --counter-height: clamp(34px, 2.55vw, 42px);
  padding-left: clamp(30px, 2.1vw, 36px);
  padding-right: clamp(18px, 1.35vw, 23px);
}

.stage-coin-counter .currency-value {
  font-size: clamp(0.98rem, 1.02vw, 1.18rem);
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .stage-coin-counter {
    top: 84%;
  }

  .stage-coin-counter .currency-icon {
    width: 42px;
    height: 42px;
    margin-right: -12px;
  }

  .stage-coin-counter .currency-frame {
    --coin-width: 124px;
    --counter-height: 30px;
    padding-left: 27px;
    padding-right: 16px;
  }

  .stage-coin-counter .currency-value {
    font-size: 0.84rem;
  }
}

/* Keep HUD numeric values optically consistent across XP and currencies. */
.stage-xp-text,
.stage-coin-counter .currency-value {
  font-size: clamp(1rem, 1.05vw, 1.18rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  color: #fff2b6;
  text-align: center;
  text-shadow:
    0 2px 0 #392003,
    1px 0 0 #392003,
    -1px 0 0 #392003,
    0 -1px 0 rgba(255, 255, 224, 0.6);
}

.stage-xp-text {
  top: 51%;
  min-width: 8.8em;
}

.stage-coin-counter .currency-value {
  min-width: 3ch;
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .stage-xp-text,
  .stage-coin-counter .currency-value {
    font-size: 0.84rem;
  }

  .stage-xp-text {
    min-width: 8.2em;
  }
}


/* Scale the coin counter artwork to match the XP track weight. */
.stage-xp {
  --coin-gap: clamp(16px, 1.05vw, 26px);
  width: clamp(790px, 63vw, 1080px);
}

.stage-coin-counter {
  top: 50%;
  transform: translateY(-50%);
}

.stage-coin-counter .currency-icon {
  width: clamp(72px, 5.05vw, 88px);
  height: clamp(72px, 5.05vw, 88px);
  margin-right: clamp(-25px, -1.35vw, -20px);
}

.stage-coin-counter .currency-frame {
  --counter-height: clamp(45px, 3.15vw, 56px);
  padding-left: clamp(41px, 2.75vw, 50px);
  padding-right: clamp(24px, 1.7vw, 31px);
}

.stage-xp-text,
.stage-coin-counter .currency-value {
  font-size: clamp(1.06rem, 1.08vw, 1.24rem);
}

@media (max-width: 1120px) {
  .stage-xp {
    width: min(860px, calc(100% - 18px));
  }

  .stage-coin-counter .currency-icon {
    width: 68px;
    height: 68px;
    margin-right: -20px;
  }

  .stage-coin-counter .currency-frame {
    --counter-height: 44px;
    padding-left: 39px;
    padding-right: 24px;
  }
}

@media (max-width: 720px) {
  .stage-xp {
    width: min(600px, calc(100% - 16px));
  }

  .stage-coin-counter {
    top: 84%;
  }

  .stage-coin-counter .currency-icon {
    width: 50px;
    height: 50px;
    margin-right: -15px;
  }

  .stage-coin-counter .currency-frame {
    --coin-width: 148px;
    --counter-height: 36px;
    padding-left: 32px;
    padding-right: 18px;
  }

  .stage-xp-text,
  .stage-coin-counter .currency-value {
    font-size: 0.9rem;
  }
}


/* Clean game frame: remove outer chrome and keep Shop inside the map. */
.game-frame {
  min-height: 100vh;
  overflow: hidden;
}

.game-tabs,
.hud,
.left-rail,
.right-rail,
.action-hint {
  display: none !important;
}

.play-layout {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
}

.stage {
  border: 0;
  border-radius: 0;
  min-height: 100vh;
  overflow: hidden;
}

.stage,
#farmCanvas {
  min-height: 100vh !important;
}

.friends-dock {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 9;
  width: min(980px, 72vw);
  min-height: 116px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px auto;
  align-items: center;
  gap: 10px;
  padding: 22px 14px 10px;
  border: 2px solid rgba(66, 113, 57, 0.58);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background:
    radial-gradient(circle at 50% 0, rgba(224, 244, 133, 0.36), transparent 42%),
    linear-gradient(180deg, rgba(255, 253, 226, 0.97), rgba(227, 217, 160, 0.97));
  box-shadow: 0 -12px 30px rgba(34, 68, 37, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.78);
  transform: translateX(-50%);
  pointer-events: auto;
}

.friends-dock-title {
  position: absolute;
  top: 0;
  left: 22px;
  margin: 0;
  padding: 7px 18px 8px;
  border: 2px solid rgba(49, 102, 45, 0.64);
  border-radius: 12px;
  color: #fffce7;
  font-size: 0.8rem;
  font-weight: 1000;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #64b84d, #33863e);
  box-shadow: 0 5px 12px rgba(35, 79, 39, 0.24), inset 0 -3px 0 rgba(25, 83, 39, 0.2);
  transform: translateY(-50%);
}

.friends-carousel {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow: hidden;
  padding: 3px 2px;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.friends-carousel::-webkit-scrollbar {
  display: none;
}

.friends-arrow {
  width: 38px;
  height: 62px;
  border: 2px solid rgba(44, 114, 88, 0.42);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(180deg, #53b8a8, #258a7f);
  box-shadow: inset 0 -4px 0 rgba(10, 77, 70, 0.2), 0 5px 10px rgba(50, 85, 52, 0.16);
  cursor: pointer;
  font-size: 2rem;
  font-weight: 1000;
  line-height: 1;
}

.friends-arrow:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.friend-card {
  position: relative;
  flex: 0 0 78px;
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 4px 5px 3px;
  border: 1px solid rgba(99, 88, 47, 0.22);
  border-radius: 12px;
  color: #304632;
  background: rgba(255, 254, 237, 0.78);
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff, 0 4px 9px rgba(75, 77, 43, 0.1);
}

.friend-card:hover {
  border-color: rgba(52, 139, 80, 0.54);
  background: #fffdf0;
  transform: translateY(-2px);
}

.friend-level {
  position: absolute;
  top: -5px;
  left: -4px;
  z-index: 2;
  min-width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #fff3b2;
  border-radius: 50%;
  color: #4c3811;
  background: #ffc847;
  font-size: 0.66rem;
  font-weight: 1000;
  box-shadow: 0 2px 5px rgba(93, 57, 13, 0.24);
}

.friend-avatar {
  position: relative;
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid #fff7cf;
  border-radius: 14px 14px 14px 5px;
  color: #fff;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.42), transparent 25%),
    linear-gradient(145deg, var(--friend-color), color-mix(in srgb, var(--friend-color), #203e2c 28%));
  box-shadow: 0 4px 8px rgba(52, 69, 39, 0.2);
  font-size: 0.78rem;
  font-weight: 1000;
}

.friend-avatar::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -5px;
  width: 22px;
  height: 13px;
  border-radius: 100% 0;
  background: rgba(225, 247, 130, 0.72);
  transform: rotate(-20deg);
}

.friend-avatar span {
  position: relative;
  z-index: 1;
}

.friend-card strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-card small {
  display: flex;
  align-items: center;
  gap: 3px;
  color: #71806d;
  font-size: 0.55rem;
  font-weight: 800;
}

.friend-card small i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #49b66d;
  box-shadow: 0 0 0 2px rgba(73, 182, 109, 0.16);
}

.friend-card small.offline i {
  background: #9aa295;
  box-shadow: 0 0 0 2px rgba(118, 128, 113, 0.14);
}

.friend-empty-state {
  display: flex;
  flex: 0 0 210px;
  min-height: 82px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed rgba(75, 125, 70, 0.32);
  border-radius: 13px;
  color: #445e42;
  background: rgba(255, 253, 226, 0.66);
  text-align: left;
}

.friend-empty-state > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #5cc97b, #2f9556);
  font-size: 1.6rem;
  font-weight: 900;
}

.friend-empty-state strong,
.friend-empty-state small {
  display: block;
}

.friend-empty-state small {
  margin-top: 2px;
  color: #73806f;
  font-size: 0.62rem;
  font-weight: 750;
}

.empty-friends-note {
  margin: 8px 0 0;
  color: #72806d;
  font-size: 0.74rem;
  font-weight: 750;
}

.friends-dock-actions {
  display: grid;
  gap: 6px;
}

.invite-friend-button,
.more-friends-button {
  min-width: 94px;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(180deg, #55b96d, #2f8d51);
  box-shadow: inset 0 -3px 0 rgba(22, 83, 43, 0.22);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 950;
}

.invite-friend-button span {
  margin-right: 3px;
  font-size: 1rem;
}

.more-friends-button {
  color: #38513a;
  background: rgba(255, 253, 232, 0.84);
  box-shadow: inset 0 0 0 1px rgba(55, 105, 57, 0.24);
}

.friend-request-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 4px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #e8573f;
  box-shadow: 0 2px 5px rgba(107, 35, 24, 0.22);
  font-size: 0.62rem;
}

.friend-request-count[hidden] {
  display: none;
}

.friend-message-input {
  width: 100%;
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
  border: 1px solid rgba(83, 116, 76, 0.3);
  border-radius: 11px;
  color: #2d4330;
  background: rgba(255, 255, 246, 0.88);
  font: inherit;
}

.friend-message-input:focus {
  border-color: #45a86a;
  outline: 3px solid rgba(69, 168, 106, 0.16);
}

.friend-request-status {
  margin: 9px 0 0;
  color: #60715d;
  font-size: 0.75rem;
  font-weight: 750;
}

.friend-requests-section + .friend-requests-section {
  margin-top: 18px;
}

.friend-requests-section h3 {
  margin: 0 0 8px;
  color: #3e593e;
  font-size: 0.85rem;
}

.friend-request-card,
.outgoing-friend-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(83, 116, 76, 0.2);
  border-radius: 11px;
  background: rgba(255, 255, 242, 0.72);
}

.friend-request-card + .friend-request-card,
.outgoing-friend-request + .outgoing-friend-request {
  margin-top: 7px;
}

.friend-request-card > div:first-child span,
.outgoing-friend-request small {
  display: block;
  margin-top: 2px;
  color: #768174;
  font-size: 0.67rem;
}

.friend-request-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.friend-request-actions button {
  min-width: 72px;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #d35645;
  cursor: pointer;
  font-weight: 850;
}

.friend-request-actions button[data-friend-action="accept"] {
  background: #3da766;
}

.outgoing-friend-request > span {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.outgoing-friend-request em {
  flex: 0 0 auto;
  color: #9a7734;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 850;
}

.friend-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.friend-avatar.large {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  font-size: 1rem;
}

@media (max-width: 720px) {
  .friends-dock {
    width: calc(100% - 16px);
    min-height: 108px;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 6px;
    padding: 21px 8px 8px;
  }

  .friends-dock-title {
    left: 14px;
    font-size: 0.68rem;
  }

  .friends-arrow {
    width: 32px;
    height: 58px;
  }

  .friends-dock-actions {
    position: absolute;
    top: -18px;
    right: 10px;
    display: flex;
    gap: 5px;
  }

  .invite-friend-button,
  .more-friends-button {
    min-width: auto;
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.6rem;
  }

  .friend-card {
    flex-basis: 68px;
  }
}


/* Cash counter beside coins, sharing one aligned HUD row. */
.stage-resource-counters {
  position: absolute;
  left: calc(var(--avatar-size) + var(--avatar-gap) + var(--xp-art-width) + var(--coin-gap));
  top: 50%;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: clamp(14px, 1vw, 24px);
  transform: translateY(-50%);
  pointer-events: none;
}

.stage-resource-counters .currency-stat,
.stage-resource-counters .stage-coin-counter {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  z-index: auto;
  flex: 0 0 auto;
}

.stage-resource-counters .currency-frame {
  --counter-height: clamp(45px, 3.15vw, 56px);
  padding-left: clamp(41px, 2.75vw, 50px);
  padding-right: clamp(24px, 1.7vw, 31px);
}

.stage-resource-counters .cash-frame {
  background-image: url("../assets/optimized/cash-counter-bg.webp");
}

.stage-resource-counters .coin-counter-icon {
  width: clamp(72px, 5.05vw, 88px);
  height: clamp(72px, 5.05vw, 88px);
  margin-right: clamp(-25px, -1.35vw, -20px);
}

.stage-resource-counters .cash-counter-icon {
  width: clamp(86px, 6vw, 112px);
  height: clamp(64px, 4.7vw, 84px);
  margin-right: clamp(-31px, -1.8vw, -24px);
  transform: translateY(2px);
}

.stage-resource-counters .currency-value {
  font-size: clamp(1.06rem, 1.08vw, 1.24rem);
}

@media (max-width: 1120px) {
  .stage-resource-counters {
    gap: 12px;
  }

  .stage-resource-counters .currency-frame {
    --counter-height: 44px;
    padding-left: 39px;
    padding-right: 24px;
  }

  .stage-resource-counters .coin-counter-icon {
    width: 68px;
    height: 68px;
    margin-right: -20px;
  }

  .stage-resource-counters .cash-counter-icon {
    width: 92px;
    height: 68px;
    margin-right: -26px;
  }
}

@media (max-width: 720px) {
  .stage-resource-counters {
    left: calc(var(--avatar-size) + 8px);
    top: 84%;
    gap: 8px;
  }

  .stage-resource-counters .currency-frame {
    --coin-width: 148px;
    --counter-height: 36px;
    padding-left: 32px;
    padding-right: 18px;
  }

  .stage-resource-counters .coin-counter-icon {
    width: 50px;
    height: 50px;
    margin-right: -15px;
  }

  .stage-resource-counters .cash-counter-icon {
    width: 64px;
    height: 48px;
    margin-right: -18px;
  }

  .stage-resource-counters .currency-value {
    font-size: 0.9rem;
  }
}

/* Final resource scale: cash and coin counters should feel like the original HUD assets. */
.stage-resource-counters {
  gap: clamp(18px, 1.3vw, 30px);
}

.stage-resource-counters .currency-frame {
  --counter-height: clamp(54px, 3.75vw, 66px);
  padding-left: clamp(54px, 3.45vw, 64px);
  padding-right: clamp(28px, 1.9vw, 36px);
}

.stage-resource-counters .coin-counter-icon {
  width: clamp(86px, 6.1vw, 104px);
  height: clamp(86px, 6.1vw, 104px);
  margin-right: clamp(-34px, -2vw, -28px);
}

.stage-resource-counters .cash-counter-icon {
  width: clamp(118px, 8.2vw, 150px);
  height: clamp(90px, 6.2vw, 116px);
  margin-right: clamp(-58px, -3.55vw, -46px);
  transform: translateY(2px);
}

.stage-resource-counters .currency-value {
  font-size: clamp(1.18rem, 1.22vw, 1.42rem);
  transform: translateY(-1px);
}

@media (max-width: 1120px) {
  .stage-resource-counters {
    gap: 16px;
  }

  .stage-resource-counters .currency-frame {
    --counter-height: 54px;
    padding-left: 52px;
    padding-right: 28px;
  }

  .stage-resource-counters .coin-counter-icon {
    width: 86px;
    height: 86px;
    margin-right: -30px;
  }

  .stage-resource-counters .cash-counter-icon {
    width: 124px;
    height: 94px;
    margin-right: -50px;
  }

  .stage-resource-counters .currency-value {
    font-size: 1.18rem;
  }
}

@media (max-width: 720px) {
  .stage-resource-counters {
    gap: 10px;
  }

  .stage-resource-counters .currency-frame {
    --coin-width: 166px;
    --counter-height: 42px;
    padding-left: 40px;
    padding-right: 21px;
  }

  .stage-resource-counters .coin-counter-icon {
    width: 62px;
    height: 62px;
    margin-right: -22px;
  }

  .stage-resource-counters .cash-counter-icon {
    width: 86px;
    height: 66px;
    margin-right: -34px;
  }

  .stage-resource-counters .currency-value {
    font-size: 1rem;
  }
}

/* One final text treatment for every value inside the glossy HUD counters. */
.stage-xp-text,
.stage-resource-counters .currency-value,
.stage-coin-counter .currency-value,
.stage-cash-counter .currency-value {
  color: #fff2b6;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 #392003,
    1px 0 0 #392003,
    -1px 0 0 #392003,
    0 -1px 0 rgba(255, 255, 224, 0.6);
}


/* Pink B counter uses the same scale as the resource counters. */
.stage-resource-counters .bucks-frame {
  background-image: url("../assets/optimized/cash-counter-bg.webp");
}

.stage-resource-counters .bucks-counter-icon {
  width: clamp(86px, 6.1vw, 104px);
  height: clamp(86px, 6.1vw, 104px);
  margin-right: clamp(-34px, -2vw, -28px);
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .stage-resource-counters .bucks-counter-icon {
    width: 86px;
    height: 86px;
    margin-right: -30px;
  }
}

@media (max-width: 720px) {
  .stage-resource-counters .bucks-counter-icon {
    width: 62px;
    height: 62px;
    margin-right: -22px;
  }
}


/* Stage quick action buttons in the opposite corner of the resource HUD. */
.stage-actions {
  position: absolute;
  top: clamp(24px, 3vw, 48px);
  right: clamp(22px, 3vw, 52px);
  z-index: 8;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1vw, 20px);
  pointer-events: auto;
}

.stage-action-button {
  width: clamp(58px, 4.2vw, 76px);
  height: clamp(58px, 4.2vw, 76px);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.stage-action-button img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(43, 34, 23, 0.28));
  pointer-events: none;
}

.stage-action-button:hover {
  transform: translateY(-2px) scale(1.04);
}

.stage-action-button:focus-visible {
  outline: 3px solid rgba(255, 241, 156, 0.9);
  outline-offset: 3px;
  border-radius: 14px;
}

@media (max-width: 720px) {
  .stage-actions {
    top: 14px;
    right: 12px;
    gap: 8px;
  }

  .stage-action-button {
    width: 46px;
    height: 46px;
  }
}


/* Mail notification badge over the envelope action button. */
.stage-action-button {
  position: relative;
}

.mail-notification-badge {
  position: absolute;
  top: -12%;
  right: -13%;
  width: clamp(24px, 1.8vw, 34px);
  height: clamp(24px, 1.8vw, 34px);
  display: grid;
  place-items: center;
  pointer-events: none;
  filter: drop-shadow(0 5px 5px rgba(74, 31, 7, 0.28));
}

.mail-notification-badge[hidden] {
  display: none !important;
}

.mail-notification-badge.is-wide {
  width: clamp(31px, 2.25vw, 43px);
}

.mail-notification-badge img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.mail-notification-badge span {
  position: relative;
  z-index: 1;
  color: #fff7df;
  font-size: clamp(0.72rem, 0.72vw, 0.92rem);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 2px 0 #8b1b10,
    1px 0 0 #8b1b10,
    -1px 0 0 #8b1b10;
  transform: translateY(-1px);
}

.mail-notification-badge.is-wide span {
  font-size: clamp(0.66rem, 0.64vw, 0.82rem);
}

@media (max-width: 720px) {
  .mail-notification-badge {
    width: 22px;
    height: 22px;
    top: -10%;
    right: -10%;
  }

  .mail-notification-badge.is-wide {
    width: 29px;
  }

  .mail-notification-badge span {
    font-size: 0.68rem;
  }
}

/* Fine tune the mail action: envelope scale and badge placement. */
#stageMailButton > img:first-child {
  max-width: none;
  width: 112%;
  height: auto;
  transform: translateY(1px);
}

#stageMailButton .mail-notification-badge {
  top: -4%;
  right: -4%;
  width: clamp(25px, 1.75vw, 33px);
  height: clamp(25px, 1.75vw, 33px);
}

#stageMailButton .mail-notification-badge.is-wide {
  width: clamp(34px, 2.25vw, 44px);
}

@media (max-width: 720px) {
  #stageMailButton > img:first-child {
    width: 112%;
  }

  #stageMailButton .mail-notification-badge {
    top: -3%;
    right: -3%;
    width: 22px;
    height: 22px;
  }

  #stageMailButton .mail-notification-badge.is-wide {
    width: 30px;
  }
}
/* Compact stage HUD after map scale-up. */
.stage-xp {
  --avatar-size: clamp(56px, 4.15vw, 74px);
  --avatar-gap: clamp(0px, 0.14vw, 4px);
  --xp-art-width: clamp(280px, 22vw, 405px);
  --coin-gap: clamp(10px, 0.7vw, 16px);
  left: clamp(10px, 0.9vw, 16px);
  top: clamp(8px, 0.75vw, 14px);
  width: min(calc(100% - 210px), clamp(760px, 63vw, 1080px));
  height: clamp(88px, 7.2vw, 126px);
  filter: drop-shadow(0 7px 8px rgba(45, 33, 14, 0.18));
}

.stage-avatar {
  filter: drop-shadow(0 5px 5px rgba(46, 31, 10, 0.22));
}

.stage-xp-text,
.stage-resource-counters .currency-value,
.stage-coin-counter .currency-value,
.stage-cash-counter .currency-value {
  font-size: clamp(0.82rem, 0.78vw, 1rem);
  text-shadow:
    0 2px 0 #392003,
    1px 0 0 #392003,
    -1px 0 0 #392003,
    0 -1px 0 rgba(255, 255, 224, 0.58);
}

.stage-level-badge {
  font-size: clamp(1rem, 1.42vw, 1.7rem);
}

.stage-resource-counters {
  gap: clamp(10px, 0.8vw, 18px);
}

.stage-resource-counters .currency-frame {
  --coin-width: clamp(104px, 6.5vw, 124px);
  --counter-height: clamp(34px, 2.35vw, 42px);
  padding-left: clamp(31px, 2vw, 38px);
  padding-right: clamp(17px, 1.15vw, 22px);
}

.stage-resource-counters .coin-counter-icon,
.stage-resource-counters .bucks-counter-icon {
  width: clamp(56px, 3.85vw, 70px);
  height: clamp(56px, 3.85vw, 70px);
  margin-right: clamp(-22px, -1.28vw, -17px);
  filter: drop-shadow(0 5px 6px rgba(50, 31, 8, 0.24));
}

.stage-resource-counters .cash-counter-icon {
  width: clamp(78px, 5.25vw, 96px);
  height: clamp(59px, 4vw, 74px);
  margin-right: clamp(-38px, -2.35vw, -30px);
  transform: translateY(1px);
}

.stage-actions {
  top: clamp(12px, 1.25vw, 24px);
  right: clamp(14px, 1.5vw, 28px);
  gap: clamp(7px, 0.65vw, 12px);
}

.stage-action-button {
  width: clamp(42px, 3vw, 58px);
  height: clamp(42px, 3vw, 58px);
}

.stage-action-button img {
  filter: drop-shadow(0 5px 7px rgba(43, 34, 23, 0.23));
}

#stageMailButton .mail-notification-badge {
  top: -7%;
  right: -7%;
  width: clamp(20px, 1.35vw, 26px);
  height: clamp(20px, 1.35vw, 26px);
}

#stageMailButton .mail-notification-badge.is-wide {
  width: clamp(28px, 1.8vw, 36px);
}

.mail-notification-badge span {
  font-size: clamp(0.58rem, 0.55vw, 0.74rem);
}

@media (max-width: 1120px) {
  .stage-xp {
    --avatar-size: 58px;
    --xp-art-width: clamp(250px, 32vw, 330px);
    width: min(calc(100% - 138px), 760px);
    height: 94px;
  }

  .stage-resource-counters {
    gap: 8px;
  }

  .stage-resource-counters .currency-frame {
    --coin-width: 104px;
    --counter-height: 34px;
    padding-left: 30px;
    padding-right: 16px;
  }

  .stage-resource-counters .coin-counter-icon,
  .stage-resource-counters .bucks-counter-icon {
    width: 54px;
    height: 54px;
    margin-right: -17px;
  }

  .stage-resource-counters .cash-counter-icon {
    width: 74px;
    height: 56px;
    margin-right: -28px;
  }
}

@media (max-width: 720px) {
  .stage-xp {
    --avatar-size: 50px;
    --xp-art-width: min(255px, calc(100% - var(--avatar-size) - 6px));
    width: min(520px, calc(100% - 14px));
    height: 112px;
  }

  .stage-resource-counters {
    left: calc(var(--avatar-size) + 8px);
    top: 82%;
    gap: 7px;
  }

  .stage-resource-counters .currency-frame {
    --coin-width: 106px;
    --counter-height: 30px;
    padding-left: 27px;
    padding-right: 14px;
  }

  .stage-resource-counters .coin-counter-icon,
  .stage-resource-counters .bucks-counter-icon {
    width: 44px;
    height: 44px;
    margin-right: -13px;
  }

  .stage-resource-counters .cash-counter-icon {
    width: 58px;
    height: 44px;
    margin-right: -20px;
  }

  .stage-xp-text,
  .stage-resource-counters .currency-value {
    font-size: 0.78rem;
  }

  .stage-actions {
    top: 10px;
    right: 10px;
  }

  .stage-action-button {
    width: 40px;
    height: 40px;
  }
}
/* End compact stage HUD. */
/* Compact in-map action buttons after map scale-up. */
.stage-action-button {
  width: clamp(36px, 2.45vw, 48px);
  height: clamp(36px, 2.45vw, 48px);
}

.stage-actions {
  top: clamp(10px, 1vw, 18px);
  right: clamp(12px, 1.2vw, 22px);
  gap: clamp(6px, 0.45vw, 9px);
}

#stageMailButton .mail-notification-badge {
  width: clamp(18px, 1.15vw, 23px);
  height: clamp(18px, 1.15vw, 23px);
}

#stageMailButton .mail-notification-badge.is-wide {
  width: clamp(25px, 1.55vw, 31px);
}

@media (max-width: 720px) {
  .stage-action-button {
    width: 34px;
    height: 34px;
  }
}
/* End compact in-map asset buttons. */

/* Painted farm HUD imported from the user-provided Hollow Acres reference. */
.friends-dock {
  left: 0;
  width: 100%;
  min-height: 74px;
  grid-template-columns: 106px 30px minmax(0, 1fr) 30px auto;
  gap: 7px;
  padding: 6px 10px;
  border: 0;
  border-top: 3px solid #8a5a2b;
  border-radius: 0;
  background: linear-gradient(180deg, #f5e7b9, #dfc486);
  box-shadow: 0 -5px 14px rgba(48, 31, 15, 0.25), inset 0 2px 0 rgba(255, 252, 221, 0.78);
  transform: none;
}

.friends-dock-title {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #4f3821;
  background: transparent;
  box-shadow: none;
  transform: none;
  font-size: 0.72rem;
  line-height: 1.15;
  text-align: left;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.friends-carousel {
  gap: 6px;
  padding: 0 2px;
}

.friend-card {
  flex: 0 0 64px;
  min-height: 56px;
  padding: 3px;
  border-color: #b68a4d;
  border-radius: 8px;
  background: #fff8dc;
}

.friend-avatar {
  width: 31px;
  height: 31px;
}

.friend-level {
  top: -5px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  font-size: 0.58rem;
}

.friend-card strong { font-size: 0.59rem; }
.friend-card small { font-size: 0.5rem; }

.friend-empty-state {
  flex-basis: 188px;
  min-height: 54px;
  border-color: rgba(138, 90, 43, 0.36);
  border-radius: 8px;
  background: rgba(255, 248, 220, 0.8);
}

.friends-arrow {
  width: 28px;
  height: 48px;
  border-color: #13497f;
  border-radius: 7px;
  background: linear-gradient(180deg, #52a8f2, #2b78c8);
}

.friends-dock-actions {
  display: flex;
  gap: 5px;
}

.invite-friend-button,
.more-friends-button {
  min-width: 86px;
  min-height: 42px;
  padding: 0 9px;
  border: 2px solid #2e742f;
  border-radius: 8px;
  font-size: 0.65rem;
}

.more-friends-button {
  border-color: #9e7a42;
  background: #fff8dc;
}

.tooldock {
  position: fixed;
  left: 50%;
  bottom: 84px;
  z-index: 12;
  display: flex !important;
  width: auto;
  max-width: calc(100vw - 190px);
  justify-content: center;
  gap: 7px;
  padding: 7px 9px;
  border: 3px solid #8a5a2b;
  border-radius: 14px;
  background: linear-gradient(180deg, #ecd49a, #d6b374);
  box-shadow: inset 0 2px 0 #fff6cf, inset 0 -3px 0 #b98a4a, 0 5px 14px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%);
}

.tooldock .tools {
  flex-wrap: nowrap;
  gap: 5px;
}

.tooldock .tool {
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 5px;
  border: 2px solid #b98a4a;
  border-radius: 9px;
  background: linear-gradient(180deg, #fff8dc, #f0dda0);
  box-shadow: inset 0 -3px 0 #d8bd7a;
}

.tooldock .tool > span:last-child:not(.tool-icon) {
  display: none;
}

.tooldock .tool-icon {
  width: 36px;
  height: 36px;
}

.tooldock .tool.active {
  border-color: #3d7a1c;
  background: linear-gradient(180deg, #b9ec82, #82cc4c);
  box-shadow: inset 0 3px 0 #66ab35, 0 0 0 2px rgba(255, 255, 255, 0.4);
  transform: translateY(-3px);
}

.tooldock .tool:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.45);
}

.seed-bag-tray {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  min-width: 290px;
  max-width: min(620px, calc(100vw - 24px));
  min-height: 78px;
  padding: 9px 42px 9px 11px;
  border: 4px solid #9c6a31;
  border-radius: 14px;
  background: linear-gradient(180deg, #f5d994, #e8c574);
  box-shadow: inset 0 3px 0 #fff0bd, inset 0 -3px 0 #c5924c, 0 8px 20px rgba(46, 33, 17, 0.36);
  transform: translateX(-50%);
}

.seed-bag-items {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.seed-bag-item {
  position: relative;
  flex: 0 0 62px;
  width: 62px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 9px;
  color: #4f3619;
  background: rgba(255, 244, 199, 0.36);
  cursor: pointer;
}

.seed-bag-item:hover,
.seed-bag-item:focus-visible,
.seed-bag-item.active {
  border-color: #65933c;
  outline: none;
  background: linear-gradient(180deg, #e7f5a8, #b9dd72);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.72);
}

.seed-bag-art {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
}

.seed-bag-art img {
  width: 43px;
  height: 43px;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px rgba(60, 39, 18, 0.22));
}

.seed-bag-art > span { font-size: 2rem; }

.seed-bag-count {
  position: absolute;
  right: 2px;
  bottom: 1px;
  min-width: 20px;
  padding: 1px 4px;
  border: 1px solid #9a6a2f;
  border-radius: 999px;
  color: #553714;
  background: #fff3bd;
  font-size: 0.7rem;
  line-height: 1.2;
  text-align: center;
}

.seed-bag-close {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  border: 2px solid #9e3e2c;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(180deg, #ed7355, #c44531);
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 950;
  line-height: 1;
}

.seed-bag-empty {
  min-width: 230px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #6c4a22;
  font-size: 0.78rem;
  font-weight: 850;
}

.seed-bag-empty button {
  min-height: 34px;
  padding: 6px 10px;
  border: 2px solid #3d7833;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, #78c75b, #409238);
  cursor: pointer;
  font-weight: 900;
}
