/* Beta audit v2 responsive and screen polish. */

@media (min-width: 600px) and (min-height: 361px) {
  .compact-panel-items {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
  }
  .compact-panel-item:not(.icon-only) {
    flex: 0 1 auto;
    width: auto;
    min-width: 74px;
    max-width: 190px;
    height: auto;
  }
  .compact-panel-item b,
  .compact-panel-item em {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .compact-panel-item.icon-only {
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    max-width: 34px;
  }
  .compact-panel-item.event {
    flex: 0 0 34px;
    width: 34px;
  }
}

.clan-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  position: sticky;
  top: 0;
  z-index: 20;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding: 6px 2px 8px;
  background: #101a17;
  box-shadow: 0 8px 12px -10px #000;
}
.clan-tabs::-webkit-scrollbar { display: none; }
.clan-tabs button {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 clamp(108px, 16vw, 146px);
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  min-height: 48px;
  padding: 7px 8px 7px 42px;
  white-space: normal;
}
.clan-tabs button:before {
  left: 8px;
  width: 27px;
  height: 27px;
}
.clan-tabs button:after { display: none; }

.shop-content {
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}
.shop-categories {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  max-height: calc(var(--cf-viewport-height, 100dvh) - 136px);
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  align-content: start;
  padding: 8px clamp(8px, 1.5vw, 18px) 18px;
}
@media (min-width: 600px) {
  .shop-page { display: flex; justify-content: center; }
  .shop-frame {
    width: min(100%, 780px);
    max-width: min(100vw, 780px);
  }
}

.inventory-page.pet-inventory-page {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
  background-color: #0b140f;
  background-image: none !important;
}
.inventory-page.pet-inventory-page:before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  left: 50%;
  width: min(100%, 480px);
  transform: translateX(-50%);
  background: url("/assets/petscene-CHEdO83W.png") center / cover no-repeat;
}
.pet-inventory-page .inventory-frame {
  position: relative;
  z-index: 0;
}

.training-row-text { position: relative; }
.training-row-meta { position: static; }
.training-row-meta .training-price {
  position: absolute;
  top: 50%;
  right: 3px;
  transform: translateY(-50%);
  white-space: nowrap;
}

.arena-opponent-card .arena-compare-stats {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}
.arena-opponent-card .arena-compare-stats div {
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  padding: 5px 8px;
  text-align: left;
}
.arena-opponent-card .arena-compare-stats div b { margin-left: auto; }

.cf-newcomer-message-reward img {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  object-fit: contain;
  vertical-align: middle;
}

.cf-hourly-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}
.cf-hourly-reward-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cf-hourly-reward-item img {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.cf-hourly-reward-item b { font-weight: 900; }

/* Active battle avatars and larger attack targets. */
.arena-battle-active .arena-fighter-card { position: relative; padding-right: 52px; }
.arena-battle-active .arena-fighter-name { max-width: calc(100% - 2px); padding-right: 0; }
.arena-battle-active .arena-fighter-avatar-wrap {
  position: absolute;
  top: 23px;
  right: 7px;
  width: 40px;
  height: 40px;
}
.arena-battle-active .arena-fighter-avatar {
  display: block;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(255, 222, 145, .82);
  border-radius: 50%;
  object-fit: cover;
  background: #17261b;
  box-shadow: 0 2px 8px #0009;
}
.arena-battle-active .arena-fighter-pet-avatar {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border: 2px solid #ffe0a0;
  border-radius: 50%;
  object-fit: cover;
  background: #20392a;
  box-shadow: 0 2px 6px #000a;
}
.arena-battle-active .arena-zone-buttons button {
  min-height: clamp(38px, 8vh, 54px);
  padding: 8px 5px;
  font-size: clamp(12px, 3.5vw, 15px);
  font-weight: 900;
}
@media (max-height: 480px) {
  .arena-battle-active .arena-fighter-card { padding-right: 46px; }
  .arena-battle-active .arena-fighter-avatar-wrap { top: 17px; right: 6px; width: 34px; height: 34px; }
  .arena-battle-active .arena-fighter-pet-avatar { width: 17px; height: 17px; }
  .arena-battle-active .arena-zone-buttons button { min-height: 36px; padding: 5px 4px; }
}


/* Beta audit v2.3: task art, animal markers, and clearer stat rows. */
.arena-opponent-card .arena-compare-stats {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 5px;
}
.arena-opponent-card .arena-compare-stats > div {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 5px 9px;
  text-align: left;
}
.arena-opponent-card .arena-compare-stats > div img {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
}
.arena-opponent-card .arena-compare-stats > div b {
  margin-left: auto;
  font-size: 12px;
}
.training-page .training-row { position: relative; }
.training-row .training-price {
  position: absolute;
  top: 50%;
  right: 58px;
  transform: translateY(-50%);
  margin: 0;
  white-space: nowrap;
}
.petprofile-profile-menu .petprofile-profile-toggle {
  border-color: rgba(235, 199, 126, .88);
  color: #fff0c7;
  background: linear-gradient(145deg, #31583c, #182f22);
  box-shadow: inset 0 1px rgba(255,255,255,.13), 0 4px 12px rgba(0,0,0,.3);
}
.petprofile-profile-menu .petprofile-nav-icon {
  filter: brightness(1.25) contrast(1.3) drop-shadow(0 2px 3px rgba(0,0,0,.8));
}
.petprofile-profile-menu .petprofile-door-icon {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}
.petstats-icon {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
}
.petstats-icon::after,
.training-page.pettraining-page .training-icon-wrap::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -4px;
  z-index: 2;
  width: 17px;
  height: 17px;
  border: 1px solid #e8c77d;
  border-radius: 50%;
  background: #183323 url("/assets/pet-paw-badge-v20261023-1.svg") center / 12px 12px no-repeat;
  box-shadow: 0 2px 4px #0009;
}
.training-page.pettraining-page .training-icon-wrap { position: relative; }
.cf-newcomer-overlay {
  background: rgba(3, 8, 5, .76);
}
.cf-newcomer-panel {
  background:
    linear-gradient(rgba(17, 32, 22, .66), rgba(8, 18, 12, .82)),
    url("/assets/profile_bg-B6XpkAXh.png") center / cover;
}
.cf-newcomer-launcher-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
}
.cf-newcomer-launcher-icon .cf-task-icon {
  display: block;
  width: 32px;
  height: 32px;
  color: #f3d78f;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.9));
}
@media (max-width: 360px) {
  .training-row .training-price { right: 50px; }
}


/* Inventory equipment stats use icon chips instead of labels. */
.inventory-details-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 3px;
}
.inventory-stat-chip {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(232,199,125,.34);
  border-radius: 10px;
  color: #fff0c7;
  background: linear-gradient(145deg, rgba(47,82,55,.88), rgba(24,45,32,.94));
}
.inventory-stat-chip img {
  display: block;
  width: 21px;
  height: 21px;
  object-fit: contain;
}
.inventory-stat-chip b { font-size: 12px; font-weight: 900; }


/* Shop selection styling in the game's armory palette. */
.shop-page {
  background-image:
    linear-gradient(180deg, rgba(7, 17, 11, .46), rgba(6, 14, 9, .78)),
    url("/assets/profile_bg-B6XpkAXh.png");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
}
.shop-frame {
  border: 1px solid rgba(235, 199, 126, .48);
  background: rgba(10, 24, 16, .62);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 12px 36px rgba(0,0,0,.4);
  backdrop-filter: blur(5px);
}
.shop-categories {
  border: 1px solid rgba(235, 199, 126, .28);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(9, 23, 15, .78), rgba(7, 18, 12, .86));
  box-shadow: inset 0 2px 12px rgba(0,0,0,.35);
}
.shop-categories::before {
  min-height: 38px;
  padding-left: 42px;
  background: url("/assets/menu-shop-v20261021-1.png") left center / 36px 36px no-repeat;
}
.shop-category {
  color: #fff1c7;
  background: linear-gradient(145deg, rgba(47, 83, 55, .97), rgba(18, 37, 26, .98));
  border-color: rgba(235, 199, 126, .48);
}
.shop-category:hover {
  background: linear-gradient(145deg, rgba(64, 105, 68, .98), rgba(24, 47, 32, .99));
}
.shop-category-icon {
  border-color: rgba(235, 199, 126, .75);
  border-radius: 19px;
  background: radial-gradient(circle at 30% 24%, rgba(235, 199, 126, .56), rgba(12, 29, 19, .97) 78%);
  box-shadow: inset 0 1px rgba(255,255,255,.24), 0 4px 10px rgba(0,0,0,.42);
}
.shop-category-icon img {
  width: 82%;
  height: 82%;
  filter: saturate(1.12) drop-shadow(0 2px 4px rgba(0,0,0,.85));
}


/* Arena log equipment stats use the same stat icons as the player profile. */
.arena-detail-item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.arena-detail-item-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 6px;
  border: 1px solid rgba(232,199,125,.34);
  border-radius: 8px;
  color: #fff0c7;
  background: linear-gradient(145deg, rgba(47,82,55,.88), rgba(24,45,32,.94));
  font-size: 11px;
  font-weight: 850;
}
.arena-detail-item-stat img {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
}
.arena-detail-item-stat b { line-height: 1; }


/* Gifts and curses profile refresh */
.cf-social-effects-layout {
  display: grid;
  gap: 13px;
}

.cf-social-effects-section {
  margin-top: 14px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(224, 191, 111, .3);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(20, 35, 24, .96), rgba(8, 17, 12, .97));
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 238, 182, .04);
}

.cf-social-effects-section h3 {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(224, 191, 111, .18);
  color: #f8e7b1;
  font-size: 15px;
  line-height: 1.25;
  background: linear-gradient(105deg, rgba(78, 101, 57, .32), rgba(20, 36, 24, .22));
}

.cf-social-effects-section.curse h3 {
  border-bottom-color: rgba(235, 135, 119, .2);
  color: #ffd3c8;
  background: linear-gradient(105deg, rgba(115, 54, 49, .34), rgba(34, 21, 20, .2));
}

.cf-social-effects-heading-icon {
  display: block;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(246, 218, 144, .58);
  border-radius: 11px;
  background-color: rgba(92, 77, 42, .55);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 34px;
  box-shadow: inset 0 1px 4px rgba(255, 238, 178, .18), 0 4px 12px rgba(0, 0, 0, .35);
}

.cf-social-effects-heading-icon.gift {
  background-image: url('/assets/gift-DktIutTj.png');
}

.cf-social-effects-heading-icon.curse {
  border-color: rgba(236, 154, 135, .62);
  background-color: rgba(94, 49, 44, .7);
  background-image: url('/assets/curse-BRpV8ivd.png');
}

.cf-social-effects-count {
  min-width: 42px;
  padding: 4px 8px;
  border: 1px solid rgba(237, 212, 147, .34);
  border-radius: 999px;
  color: #ffe9ae;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  background: rgba(8, 17, 12, .65);
}

.cf-social-effects-section.curse .cf-social-effects-count {
  border-color: rgba(236, 154, 135, .35);
  color: #ffc5b7;
}

.cf-social-effects-section > .cf-social-stat-list {
  padding: 11px 12px 0;
}

.cf-social-effects-section > .cf-social-empty {
  margin: 11px 12px 12px;
}

.cf-social-effects-section .cf-social-stat-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.cf-social-effects-section .cf-social-stat-row {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(224, 191, 111, .13);
  border-radius: 10px;
  background: rgba(3, 10, 6, .38);
}

.cf-social-effects-section .cf-social-stat-label {
  min-width: 0;
  gap: 6px;
}

.cf-social-effects-section .cf-social-stat-label img {
  width: 18px;
  height: 18px;
}

.cf-social-effects-section .cf-social-stat-label span {
  overflow: hidden;
  color: #d8dfc9;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-social-effects-section .cf-social-stat-row > b {
  flex: 0 0 auto;
  color: #eef0db;
  font-size: 12px;
}

.cf-social-effect-items {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin: 11px 0 0;
  padding: 11px 12px 12px;
  border-top: 1px solid rgba(224, 191, 111, .15);
}

.cf-social-effects-section.curse .cf-social-effect-items {
  border-top-color: rgba(235, 135, 119, .17);
}

.cf-social-effect-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: repeat(4, auto);
  align-items: center;
  align-content: center;
  gap: 4px 10px;
  padding: 9px;
  border-color: rgba(226, 199, 128, .28);
  border-radius: 13px;
  text-align: left;
  background: linear-gradient(135deg, rgba(45, 61, 39, .82), rgba(16, 27, 19, .94));
  box-shadow: inset 0 1px rgba(255, 244, 202, .04), 0 5px 12px rgba(0, 0, 0, .2);
}

.cf-social-effect-card--curse {
  border-color: rgba(219, 135, 121, .38);
  background: linear-gradient(135deg, rgba(67, 39, 37, .82), rgba(25, 20, 18, .95));
}

.cf-social-effect-card > img {
  grid-column: 1;
  grid-row: 1 / 5;
  width: 58px;
  height: 58px;
  padding: 4px;
  border: 1px solid rgba(223, 197, 129, .22);
  border-radius: 11px;
  object-fit: contain;
  background: radial-gradient(circle at 50% 35%, rgba(232, 216, 156, .12), rgba(5, 11, 7, .7));
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .42));
}

.cf-social-effect-card > b {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: #f8edce;
  font-size: 13px;
  line-height: 1.25;
}

.cf-social-effect-card > .cf-social-effect-delta {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 3px 7px;
  border: 1px solid rgba(127, 220, 147, .24);
  border-radius: 999px;
  color: #a2efae;
  font-size: 11px;
  line-height: 1.2;
  background: rgba(7, 27, 13, .6);
}

.cf-social-effect-card > .cf-social-effect-delta.curse {
  border-color: rgba(248, 142, 127, .25);
  color: #ffb2a3;
  background: rgba(43, 13, 11, .58);
}

.cf-social-effect-card > small:first-of-type {
  grid-column: 2;
  grid-row: 3;
}

.cf-social-effect-card > small:nth-of-type(2) {
  grid-column: 2;
  grid-row: 4;
}

.cf-social-effect-card > small {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 0;
  color: #b9c3b1;
  font-size: 11px;
  line-height: 1.3;
}

.cf-social-effect-card .cf-social-card-name {
  padding: 0;
  border: 0;
  color: #ffe6a0;
  text-align: left;
  font: inherit;
  text-decoration: underline;
  background: transparent;
}

.cf-social-effect-card .cf-social-card-name:hover,
.cf-social-effect-card .cf-social-card-name:focus-visible {
  color: #fff5d2;
}

@media (max-width: 560px) {
  .cf-social-effects-section h3 {
    grid-template-columns: 35px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 10px;
    font-size: 14px;
  }
  .cf-social-effects-heading-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background-size: 30px;
  }
  .cf-social-effects-section > .cf-social-stat-list {
    padding: 9px 9px 0;
  }
  .cf-social-effects-section > .cf-social-empty {
    margin: 9px;
  }
  .cf-social-effects-section .cf-social-stat-list,
  .cf-social-effect-items {
    grid-template-columns: 1fr;
  }
  .cf-social-effect-items {
    padding: 9px;
  }
}

/* Audit v2.4: deterministic three-row hotbar and a separate event strip. */
.compact-panel-items {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 4px;
}

.compact-panel-row {
  display: grid;
  min-width: 0;
  align-items: stretch;
  gap: 4px;
}

.compact-panel-row-main {
  grid-template-columns: 34px minmax(0, 1.45fr) minmax(48px, .62fr) minmax(62px, .9fr) minmax(54px, .75fr);
}

.compact-panel-row-resources {
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(74px, 1.18fr);
}

.compact-panel-row-tools {
  grid-template-columns: minmax(0, 1fr) repeat(3, 34px);
}

.compact-panel-row .compact-panel-item,
.compact-panel-row .compact-panel-item.icon-only {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: auto;
  min-height: 30px;
}

.compact-panel-row .compact-panel-item b,
.compact-panel-row .compact-panel-item em {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  text-overflow: clip;
  line-height: 1.05;
}

.compact-panel-notices {
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow: hidden;
}

.compact-panel-notices .compact-notice:not(.compact-notice-more) {
  display: inline-flex;
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  height: auto;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 6px;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  line-height: 1.08;
}

.compact-notice-icon {
  display: block;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .72));
}

.compact-notice.event {
  border-color: rgba(255, 218, 120, .82);
  background: linear-gradient(145deg, #285d67, #0b2734);
}

.compact-notice.event.dragon {
  background: linear-gradient(145deg, #743d22, #29130d);
}

.compact-notice.event.tasks {
  background: linear-gradient(145deg, #315f3a, #102a19);
}

.compact-notice.event.achievements {
  background: linear-gradient(145deg, #6f5a1d, #2e2108);
}

.compact-panel-notices .compact-notice-more {
  flex: 0 0 34px;
  align-self: stretch;
  height: auto;
  min-height: 24px;
}

@media (max-width: 390px) {
  .compact-panel-items,
  .compact-panel-row,
  .compact-panel-notices {
    gap: 3px;
  }

  .compact-panel-row-main {
    grid-template-columns: 31px minmax(0, 1.45fr) minmax(43px, .62fr) minmax(55px, .9fr) minmax(48px, .75fr);
  }

  .compact-panel-row-resources {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(66px, 1.18fr);
  }

  .compact-panel-row-tools {
    grid-template-columns: minmax(0, 1fr) repeat(3, 31px);
  }

  .compact-panel-row .compact-panel-item,
  .compact-panel-row .compact-panel-item.icon-only {
    min-height: 28px;
  }

  .compact-panel-notices .compact-notice:not(.compact-notice-more) {
    min-height: 22px;
    padding: 2px 4px;
    font-size: 9px;
  }

  .compact-notice-icon {
    flex-basis: 15px;
    width: 15px;
    height: 15px;
  }

  .compact-panel-notices .compact-notice-more {
    flex-basis: 31px;
    min-width: 31px;
    max-width: 31px;
  }
}

@media (orientation: landscape) and (max-height: 360px) {
  .compact-panel-items {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .compact-panel-row,
  .compact-panel-notices {
    gap: 2px;
  }

  .compact-panel-row .compact-panel-item,
  .compact-panel-row .compact-panel-item.icon-only {
    height: auto;
    min-height: 22px;
  }
}
