.deal {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 4;
}

.deal.open {
  display: block;
}

.deal-veil {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52vh;
  background: linear-gradient(180deg, rgba(9, 6, 2, 0) 0%, rgba(9, 6, 2, 0.42) 46%, rgba(6, 4, 1, 0.8) 100%);
  animation: dealVeil 0.55s ease both;
}

.deal-counter {
  position: absolute;
  left: 50%;
  bottom: 4.2vh;
  width: fit-content;
  min-width: 41rem;
  max-width: 82vw;
  transform: translateX(-50%);
  animation: dealRise 0.54s cubic-bezier(0.2, 0.9, 0.24, 1.04) both;
}

.deal-flower {
  position: absolute;
  left: -3.4rem;
  bottom: -2.1rem;
  width: 7.4rem;
  z-index: 2;
  pointer-events: none;
  transform-origin: 50% 100%;
  animation: dealFlowerIn 0.6s cubic-bezier(0.22, 1, 0.32, 1) 0.26s both;
}

.deal-bee {
  position: absolute;
  right: 3.4rem;
  top: -2.9rem;
  width: 2.7rem;
  z-index: 2;
  pointer-events: none;
  animation:
    dealBeeIn 0.6s cubic-bezier(0.22, 1, 0.32, 1) 0.15s both,
    dealBee 5.5s ease-in-out 0.8s infinite;
}

.deal-panel {
  position: relative;
  z-index: 1;
  padding: 1.7rem 1.5rem 1.25rem;
  border-radius: 0.4rem;
  background:
    linear-gradient(180deg, rgba(255, 176, 42, 0.09) 0%, rgba(255, 176, 42, 0) 3.2rem),
    linear-gradient(180deg, rgba(32, 21, 10, 0.9) 0%, rgba(14, 9, 4, 0.95) 100%),
    url(images/panel-wood.webp) center / cover;
  border: 0.09rem solid rgba(255, 211, 66, 0.22);
  box-shadow:
    inset 0 0 3.2rem rgba(0, 0, 0, 0.55),
    0 1.1rem 2.8rem rgba(0, 0, 0, 0.6);
}

.deal-drip {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
}

.deal-drop {
  position: absolute;
  top: 0;
  transform-origin: 50% 0;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background: linear-gradient(180deg, rgba(226, 158, 30, 0.85) 0%, rgba(190, 120, 12, 0.72) 100%);
  animation: dealDrop 0.5s cubic-bezier(0.34, 1.12, 0.45, 1) both;
}

.deal-drop:nth-child(1) { left: 11%; width: 0.5rem; height: 0.62rem; animation-delay: 0.34s; }
.deal-drop:nth-child(2) { left: 29%; width: 0.62rem; height: 1.15rem; animation-delay: 0.42s; }
.deal-drop:nth-child(3) { left: 46%; width: 0.42rem; height: 0.46rem; animation-delay: 0.38s; }
.deal-drop:nth-child(4) { left: 68%; width: 0.55rem; height: 0.85rem; animation-delay: 0.48s; }

.deal-fall {
  position: absolute;
  left: 29.3%;
  top: 0;
  width: 0.42rem;
  height: 0.58rem;
  border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
  background: linear-gradient(180deg, rgba(240, 186, 70, 0.9) 0%, rgba(200, 128, 14, 0.8) 100%);
  opacity: 0;
}

.deal.open .deal-fall {
  animation: dealFall 6.5s ease-in 1.6s infinite;
}

.deal-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 1.05rem;
  border-bottom: 0.07rem solid var(--line);
}

.deal-who {
  flex: 0 0 auto;
  animation: dealHeadIn 0.34s ease 0.14s both;
}

.deal-over {
  margin-bottom: 0.4rem;
  font-family: Arame-Thin, sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  color: rgba(255, 255, 255, 0.44);
}

.deal-over b {
  font-weight: normal;
  color: rgba(255, 211, 66, 0.62);
}

.deal-nameline {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.deal-name {
  font-family: Arame-Thin, sans-serif;
  font-size: 1.5rem;
  line-height: 1;
  color: #fff;
}

.deal-name b {
  font-weight: normal;
  color: var(--gold);
}

.deal-role {
  padding-left: 0.7rem;
  border-left: 0.07rem solid rgba(255, 255, 255, 0.12);
  font-family: Arame-Thin, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: rgba(255, 211, 66, 0.55);
}

.deal-say {
  flex: 1;
  animation: dealHeadIn 0.34s ease 0.2s both;
  min-width: 11rem;
  max-width: 21.5rem;
  padding-left: 1.15rem;
  border-left: 0.07rem solid var(--line);
  font-size: 0.88rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--white-dim);
}

.deal-wallet {
  flex: 0 0 auto;
  animation: dealHeadIn 0.34s ease 0.25s both;
  margin-right: 0.5rem;
  text-align: right;
}

.deal-wallet span {
  display: block;
  font-family: Arame-Thin, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--white-dim);
}

.deal-wallet em {
  font-style: normal;
  font-size: 1.15rem;
  color: #fff;
}

.deal-close {
  flex: 0 0 auto;
  animation: dealHeadIn 0.34s ease 0.3s both;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.24rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 65, 68, 0.09);
  transition: 0.25s ease background;
}

.deal-close img {
  width: 0.95rem;
  height: 0.95rem;
}

.deal-close:hover {
  background: rgba(255, 65, 68, 0.34);
}

.deal-body {
  display: flex;
  gap: 1.35rem;
  padding-top: 1.15rem;
}

.deal-goods {
  flex: 0 1 auto;
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.35rem;
}

.deal-goods::-webkit-scrollbar {
  height: 0.28rem;
}

.deal-goods::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.deal-goods::-webkit-scrollbar-thumb {
  background: rgba(255, 211, 66, 0.3);
  border-radius: 0.2rem;
}

.good {
  flex: 0 0 auto;
  width: 10.2rem;
  padding: 0.85rem 0.7rem 0.75rem;
  border-radius: 0.3rem;
  display: flex;
  flex-direction: column;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.028);
  border: 0.07rem solid transparent;
  transition: 0.22s ease background, 0.22s ease border-color;
  animation: goodIn 0.42s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--i) * 0.07s + 0.26s);
}

.good:hover {
  background: rgba(255, 211, 66, 0.06);
  border-color: rgba(255, 211, 66, 0.22);
}

.good.picked {
  background: rgba(255, 211, 66, 0.09);
  border-color: rgba(255, 211, 66, 0.4);
}

.good.gone {
  cursor: default;
  opacity: 0.4;
}

.good.gone:hover {
  background: rgba(255, 255, 255, 0.028);
  border-color: transparent;
}

.good-hex {
  position: relative;
  width: 4.6rem;
  height: 5.3rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(255, 211, 66, 0.22);
  transition: 0.22s ease background;
}

.good.picked .good-hex {
  background: linear-gradient(160deg, rgba(255, 211, 66, 0.9) 0%, rgba(224, 145, 15, 0.7) 100%);
}

.good-hex::before {
  content: "";
  position: absolute;
  inset: 0.1rem;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(165deg, #2c1e0d 0%, #150e06 100%);
}

.good-hex img {
  position: relative;
  width: 62%;
  filter: drop-shadow(0 0.25rem 0.5rem rgba(0, 0, 0, 0.55));
}

.good-name {
  margin-top: 0.6rem;
  font-family: Arame-Thin, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.good-have {
  margin-top: 0.28rem;
  font-size: 0.7rem;
  color: var(--white-dim);
}

.good.gone .good-have {
  color: rgba(255, 65, 68, 0.7);
}

.good-price {
  margin-top: 0.3rem;
  font-size: 0.92rem;
  color: var(--gold);
}

.good-price span {
  font-size: 0.66rem;
  color: var(--white-dim);
}

.good-step {
  margin-top: auto;
  padding-top: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.good-btn {
  flex: 0 0 auto;
  width: 1.65rem;
  height: 1.65rem;
  border: 0;
  border-radius: 0.18rem;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  transition: 0.2s ease all;
}

.good-btn:hover {
  color: #241a0c;
  background: var(--gold);
}

.good.gone .good-btn,
.good.gone .good-val,
.good.gone .good-max {
  pointer-events: none;
}

.good-val {
  flex: 1;
  min-width: 0;
  height: 1.65rem;
  border: 0;
  border-radius: 0.18rem;
  outline: none;
  text-align: center;
  font-family: Gilroy-Regular, sans-serif;
  font-size: 0.88rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.34);
}

.good-val:focus {
  box-shadow: inset 0 0 0 0.07rem rgba(255, 211, 66, 0.45);
}

.good-max {
  flex: 0 0 auto;
  height: 1.65rem;
  padding: 0 0.42rem;
  border: 0;
  border-radius: 0.18rem;
  cursor: pointer;
  font-family: Arame-Thin, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: rgba(255, 211, 66, 0.8);
  background: rgba(255, 211, 66, 0.1);
  transition: 0.2s ease all;
}

.good-max:hover {
  color: #241a0c;
  background: var(--gold);
}

.deal-pay {
  flex: 1 1 13rem;
  min-width: 13rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-left: 1.35rem;
  border-left: 0.07rem solid var(--line);
}

.deal-payout {
  animation: dealHeadIn 0.34s ease 0.3s both;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.deal-payout span {
  font-family: Arame-Thin, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--white-dim);
}

.deal-payout b {
  font-weight: normal;
  font-size: 1.75rem;
  color: var(--gold);
  transition: 0.2s ease transform;
}

.deal-payout b.bump {
  animation: dealBump 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.deal-methods {
  animation: dealHeadIn 0.34s ease 0.42s both;
  margin-top: 0.95rem;
}

.deal-methods.single {
  display: none;
}

.deal-methods span {
  display: block;
  margin-bottom: 0.45rem;
  font-family: Arame-Thin, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--white-dim);
}

.deal-method-row {
  display: flex;
  gap: 0.4rem;
}

.deal-method {
  flex: 1;
  height: 2.1rem;
  border: 0.07rem solid rgba(255, 255, 255, 0.07);
  border-radius: 0.18rem;
  cursor: pointer;
  font-family: Arame-Thin, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.03);
  transition: 0.22s ease all;
}

.deal-method:hover {
  color: #fff;
}

.deal-method.on {
  color: var(--gold);
  border-color: rgba(255, 211, 66, 0.45);
  background: rgba(255, 211, 66, 0.11);
}

.deal-ticket {
  animation: dealHeadIn 0.34s ease 0.36s both;
  flex: 0 1 auto;
  max-height: 8.5rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  padding-right: 0.25rem;
  border-top: 0.07rem solid var(--line);
  overflow-y: auto;
}

.deal-ticket::-webkit-scrollbar {
  width: 0.22rem;
}

.deal-ticket::-webkit-scrollbar-thumb {
  background: rgba(255, 211, 66, 0.28);
  border-radius: 0.2rem;
}

.deal-ticket.blank {
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.42);
}

.deal-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.3rem 0;
  border-bottom: 0.07rem dashed rgba(255, 255, 255, 0.07);
  animation: lineIn 0.28s ease both;
}

.deal-line span {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-line em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--gold);
}

.deal-sell {
  animation: dealHeadIn 0.34s ease 0.48s both;
  margin-top: 0.95rem;
  height: 2.85rem;
  border: 0;
  border-radius: 0.18rem;
  cursor: pointer;
  font-family: Arame-Thin, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: #9a9a9a;
  background: rgba(255, 255, 255, 0.05);
  transition: 0.25s ease all;
}

.deal-sell.ready {
  color: #241a0c;
  background: var(--amber);
}

.deal-sell.ready:hover {
  box-shadow: 0 0 1.8rem rgba(255, 160, 28, 0.5), inset 0 0 0.6rem rgba(255, 255, 255, 0.3);
}

@keyframes dealVeil {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dealRise {
  from {
    opacity: 0;
    transform: translate(-50%, 4.2rem);
  }
  55% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes dealDrop {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes dealHeadIn {
  from {
    opacity: 0;
    transform: translateY(0.45rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dealFlowerIn {
  from {
    opacity: 0;
    transform: translateY(1.2rem) rotate(-14deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

@keyframes dealBeeIn {
  from {
    opacity: 0;
    transform: translate(5rem, 1.6rem) rotate(16deg);
  }
  to {
    opacity: 1;
    transform: translate(0, 0) rotate(-6deg);
  }
}

@keyframes goodIn {
  from {
    opacity: 0;
    transform: scale(0.93);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes dealBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@keyframes dealBee {
  0%, 100% { transform: translate(0, 0) rotate(-6deg); }
  35% { transform: translate(-2.2rem, 0.9rem) rotate(8deg); }
  70% { transform: translate(1.4rem, -0.6rem) rotate(-3deg); }
}

@keyframes dealFall {
  0% {
    opacity: 0;
    transform: translateY(0.9rem) scaleY(0.6);
  }
  4% {
    opacity: 1;
    transform: translateY(1.2rem) scaleY(1);
  }
  16% {
    opacity: 1;
    transform: translateY(9rem) scaleY(1.5);
  }
  22%, 100% {
    opacity: 0;
    transform: translateY(13rem) scaleY(1.6);
  }
}

@keyframes lineIn {
  from {
    opacity: 0;
    transform: translateY(-0.3rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
