/* kingdom-account — Área do Cliente: cantos bem redondos, primary cyan, sem neon excessivo */

.kb-account {
  --kb-acc-radius: 1.5rem;
  --kb-acc-radius-sm: 1.1rem;
  --kb-acc-radius-pill: 9999px;
  --kb-acc-border: hsl(var(--primary) / 0.42);
  --kb-acc-border-soft: hsl(var(--primary) / 0.22);
  --kb-acc-panel: rgb(6 12 22 / 0.92);
  --kb-acc-panel-inner: rgb(8 14 26 / 0.88);
  --kb-acc-ink: #041018;
  box-sizing: border-box;
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding: 1.15rem 0.9rem 2.5rem;
  min-height: 70vh;
  min-width: 0;
  overflow-x: hidden;
}

html.kb-iab .kb-account,
html.kb-coarse .kb-account,
html.kb-iab .kb-order,
html.kb-coarse .kb-order {
  max-width: 100%;
  width: 100%;
  margin-inline: 0;
  padding-inline: max(0.75rem, env(safe-area-inset-left, 0px)) max(0.75rem, env(safe-area-inset-right, 0px));
}

html.kb-iab .kb-account__grid,
html.kb-coarse .kb-account__grid,
html.kb-iab .kb-order__grid,
html.kb-coarse .kb-order__grid,
html.kb-iab .kb-account-order__head,
html.kb-coarse .kb-account-order__head {
  grid-template-columns: minmax(0, 1fr) !important;
}

html.kb-iab .kb-account-order__totals,
html.kb-coarse .kb-account-order__totals {
  text-align: left !important;
  width: 100%;
}

html.kb-iab .kb-account .md\:grid-cols-3,
html.kb-coarse .kb-account .md\:grid-cols-3 {
  grid-template-columns: minmax(0, 1fr) !important;
}

.kb-account__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.kb-account__side-wrap,
.kb-account-main {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
  .kb-account {
    padding: 2rem 1.25rem 3rem;
  }
  .kb-account__grid {
    grid-template-columns: minmax(15.5rem, 17.5rem) minmax(0, 1fr);
    gap: 1.5rem;
  }
}

/* —— Sidebar —— */
.kb-account-side {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.35rem 1.15rem 1.15rem;
  border-radius: var(--kb-acc-radius);
  border: 1px solid var(--kb-acc-border);
  background:
    linear-gradient(165deg, hsl(var(--primary) / 0.06) 0%, transparent 42%),
    var(--kb-acc-panel);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.28);
}

@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
  .kb-account-side {
    position: sticky;
    top: 6.5rem;
  }
}

.kb-account-side__tab {
  position: absolute;
  top: 0;
  left: 1.1rem;
  transform: translateY(-55%);
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  border-radius: 0.55rem 0.55rem 0.35rem 0.35rem;
  border: 1px solid var(--kb-acc-border);
  border-bottom-color: rgb(6 12 22);
  background: rgb(4 10 18);
  color: hsl(var(--primary));
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  z-index: 1;
}

.kb-account-side__profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
  padding-top: 0.35rem;
}

.kb-account-side__avatar {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsl(var(--primary) / 0.55);
  background: rgb(10 18 32);
}

.kb-account-side__avatar--fallback {
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.12);
}

.kb-account-side__name {
  margin: 0;
  max-width: 100%;
  padding-inline: 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kb-account-side__rank {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--kb-acc-radius-pill);
  border: 1px solid rgb(205 127 50 / 0.55);
  background: linear-gradient(145deg, rgb(120 72 28 / 0.55), rgb(60 36 14 / 0.75));
  color: #f0c090;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kb-account-side__rank-icon {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.kb-account-side__nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.kb-account-side__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.85rem;
  padding: 0.65rem 0.95rem;
  border-radius: var(--kb-acc-radius-sm);
  border: 1px solid var(--kb-acc-border);
  background: rgb(4 10 18 / 0.55);
  color: rgb(var(--foreground) / 0.92);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.kb-account-side__link:hover,
.kb-account-side__link:focus-visible {
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary) / 0.65);
  color: #fff;
  outline: none;
}

.kb-account-side__link.is-active {
  background: hsl(var(--primary) / 0.14);
  border-color: hsl(var(--primary) / 0.75);
  color: #fff;
  box-shadow: inset 0 0 0 1px hsl(var(--primary) / 0.12);
}

.kb-account-side__link-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: hsl(var(--primary));
}

.kb-account-side__soon {
  margin-left: auto;
  flex-shrink: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--primary) / 0.4);
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.kb-account-side__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.85rem;
  margin-top: 0.15rem;
  padding: 0.7rem 1rem;
  border-radius: var(--kb-acc-radius-pill);
  border: 1px solid hsl(var(--primary) / 0.7);
  background: hsl(var(--primary));
  color: var(--kb-acc-ink);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.12s ease;
}

.kb-account-side__back:hover,
.kb-account-side__back:focus-visible {
  background: hsl(var(--primary) / 0.9);
  transform: translateY(-1px);
  outline: none;
}

.kb-account-side__back-icon {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

/* —— Main panel —— */
.kb-account-main {
  min-width: 0;
  padding: 1.35rem 1.25rem 1.5rem;
  border-radius: var(--kb-acc-radius);
  border: 1px solid var(--kb-acc-border-soft);
  background:
    linear-gradient(180deg, hsl(var(--primary) / 0.04) 0%, transparent 28%),
    var(--kb-acc-panel-inner);
  box-shadow: 0 12px 32px rgb(0 0 0 / 0.22);
}

@media (min-width: 768px) {
  .kb-account-main {
    padding: 1.6rem 1.6rem 1.75rem;
  }
}

.kb-account-main__title {
  margin: 0 0 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.7rem;
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}

.kb-account-main__soon {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--primary) / 0.45);
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.kb-profile-soon {
  margin-left: auto;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.kb-account-main__crumb {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: rgb(var(--muted-foreground));
}

.kb-account-main__crumb a {
  color: rgb(var(--muted-foreground));
  text-decoration: none;
}

.kb-account-main__crumb a:hover {
  color: hsl(var(--primary));
}

/* Empty state */
.kb-account-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 1rem 3.25rem;
  min-height: 22rem;
}

.kb-account-empty__icon-wrap {
  display: grid;
  place-items: center;
  width: 5.25rem;
  height: 5.25rem;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  border: 1px solid hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.08);
  color: hsl(var(--primary));
}

.kb-account-empty__icon {
  width: 2.35rem;
  height: 2.35rem;
}

.kb-account-empty__title {
  margin: 0 0 0.55rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.kb-account-empty__text {
  margin: 0 0 1.35rem;
  max-width: 26rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgb(var(--muted-foreground));
}

.kb-account-empty__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.65rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--kb-acc-radius-sm);
  border: 1px solid hsl(var(--primary) / 0.7);
  background: hsl(var(--primary));
  color: var(--kb-acc-ink);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.12s ease;
}

.kb-account-empty__cta:hover,
.kb-account-empty__cta:focus-visible {
  background: hsl(var(--primary) / 0.9);
  transform: translateY(-1px);
  outline: none;
}

.kb-account-empty__cta-icon {
  width: 1.05rem;
  height: 1.05rem;
}

/* Order cards inside account */
.kb-account-orders {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.kb-account-order {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
  padding: 1rem 1rem 1.05rem;
  border-radius: var(--kb-acc-radius-sm);
  border: 1px solid var(--kb-acc-border-soft);
  background: rgb(4 10 18 / 0.45);
}

.kb-account-order:hover {
  border-color: hsl(var(--primary) / 0.4);
}

.kb-account-order__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.45rem 0.75rem;
  align-items: start;
  min-width: 0;
}

.kb-account-order__status {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  max-width: 100%;
}

.kb-account-order__dot {
  width: 0.7rem;
  height: 0.7rem;
  margin-top: 0.3rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: #fb923c;
}

.kb-account-order__dot.is-approved { background: #22c55e; }
.kb-account-order__dot.is-rejected { background: #ef4444; }
.kb-account-order__dot.is-refunded { background: #eab308; }
.kb-account-order__dot.is-chargeback { background: #a855f7; }
.kb-account-order__dot.is-pending { background: #fb923c; }

.kb-account-order__status-copy {
  min-width: 0;
}

.kb-account-order__label {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.kb-account-order__id {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: rgb(var(--muted-foreground));
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: left;
  justify-self: start;
}

.kb-account-order__totals {
  min-width: 0;
  text-align: left;
}

.kb-account-order__price {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.kb-account-order__date {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgb(var(--muted-foreground));
}

.kb-account-order__facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kb-account-order__fact {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.8rem;
}

.kb-account-order__fact-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
  color: rgb(var(--muted-foreground));
}

.kb-account-order__fact-label {
  color: rgb(var(--muted-foreground));
  flex-shrink: 0;
}

.kb-account-order__fact-value,
.kb-account-order__coupon {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.kb-account-order__coupon {
  display: inline-flex;
  max-width: 100%;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-size: 0.72rem;
}

.kb-account-order__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kb-account-order__btn {
  width: 100%;
  min-height: 2.65rem;
  border-radius: 999px;
}

.kb-account-panel {
  padding: 1.15rem 1.2rem;
  border-radius: var(--kb-acc-radius-sm);
  border: 1px solid var(--kb-acc-border-soft);
  background: rgb(4 10 18 / 0.45);
}

.kb-account-panel + .kb-account-panel {
  margin-top: 1rem;
}

.kb-account-stat {
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid hsl(var(--primary) / 0.18);
  background: rgb(6 12 22 / 0.65);
}

/* Pedido (detalhe) */
.kb-order {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.kb-order__crumb {
  margin: 0 0 1.1rem;
  font-size: 0.8rem;
  color: rgb(var(--muted-foreground));
}

.kb-order__crumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kb-order__crumb a {
  color: rgb(var(--muted-foreground));
  text-decoration: none;
}

.kb-order__crumb a:hover {
  color: hsl(var(--primary));
}

.kb-order__crumb-current {
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.kb-order__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  min-width: 0;
}

.kb-order__main,
.kb-order__side {
  min-width: 0;
}

.kb-order-item__head {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
}

.kb-order-item__thumb {
  position: relative;
  width: 3.5rem;
  height: 3.5rem;
}

.kb-order-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--background));
}

.kb-order-item__qty {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  display: grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: #041018;
  font-size: 0.7rem;
  font-weight: 800;
}

.kb-order-item__info {
  min-width: 0;
}

.kb-order-item__name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.3;
  color: #fff;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.kb-order-item__price {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: rgb(var(--muted-foreground));
}

.kb-order-item__aside {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.kb-order-item__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 0.45rem;
  border: 1px solid rgb(16 185 129 / 0.3);
  background: rgb(16 185 129 / 0.1);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
}

.kb-order-item__redeem {
  flex: 1 1 auto;
  min-height: 2.5rem;
  height: auto;
  padding: 0.45rem 0.85rem;
}

.kb-order-keys__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.kb-order-keys__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.kb-order-download {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kb-order-download__btn {
  width: 100%;
}

.kb-order__nav-btns {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1rem;
}

.kb-order__nav-btns > a {
  width: 100%;
  justify-content: center;
}

.kb-order-summary input {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kb-steam-redeem iframe {
  max-width: 100%;
}

@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
  .kb-account-order__facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kb-account-order__actions {
    flex-direction: row;
    justify-content: flex-end;
  }

  .kb-account-order__btn {
    width: auto;
    min-width: 11rem;
  }

  .kb-order-item__head {
    grid-template-columns: 4rem minmax(0, 1fr) auto;
  }

  .kb-order-item__thumb {
    width: 4rem;
    height: 4rem;
  }

  .kb-order-item__aside {
    grid-column: auto;
    flex-direction: column;
    align-items: flex-end;
  }

  .kb-order-item__redeem {
    width: auto;
    flex: 0 0 auto;
  }

  .kb-order-download {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .kb-order-download__btn {
    width: auto;
    flex-shrink: 0;
  }

  .kb-order__nav-btns {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .kb-order__nav-btns > a {
    width: auto;
  }
}

@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
  .kb-account-order__head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .kb-account-order__totals {
    text-align: right;
  }

  .kb-order {
    max-width: 72rem;
    margin-inline: auto;
  }

  .kb-order__grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
  }
}

/* Phone / IAB: sidebar compact, nav quebra linha (não empurra a página) */
@media (max-width: 1279px), (pointer: coarse), (hover: none) {
  .kb-account-main {
    padding: 1.05rem 0.85rem 1.2rem;
  }

  .kb-account-side {
    padding: 1.15rem 0.85rem 0.9rem;
  }

  .kb-account-side__profile {
    flex-direction: row;
    text-align: left;
    align-items: center;
    gap: 0.7rem;
    padding-top: 0.15rem;
  }

  .kb-account-side__avatar {
    width: 2.75rem;
    height: 2.75rem;
  }

  .kb-account-side__rank {
    margin-left: auto;
  }

  .kb-account-side__nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    overflow: visible;
    gap: 0.5rem;
  }

  .kb-account-side__link {
    flex: 1 1 auto;
    white-space: nowrap;
    justify-content: flex-start;
  }

  .kb-account-side__back {
    margin-top: 0.35rem;
  }

  .kb-account-order__totals {
    text-align: left;
    width: 100%;
  }
}