@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@400;700&family=Fira+Code:wght@400;600&display=swap");

:root {
  --font-sans: "Inter", Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
  --font-mono: "Fira Code", "Courier New", monospace;

  --h-primary-100: #fdfdfd;
  --h-primary-200: #faf9f6;
  --h-primary-300: #e4e6e4;
  --h-primary-500: #a40011;
  --h-primary-600: #8a0714;
  --h-primary-700: #7a1126;
  --h-primary-800: #45080d;
  --h-primary-900: #292005;

  --h-secondary-200: #c3533d;

  --h-neutral-50: #ffffff;
  --h-neutral-500: #a6a6a6;
  --h-neutral-600: #7a7a7a;
  --h-neutral-800: #212121;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--h-primary-200);
  color: var(--h-neutral-800);
  -webkit-font-smoothing: antialiased;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
}

.page {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0.75rem;
  background: var(--h-primary-200);
}

.board {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--h-primary-300);
  border-radius: 1rem;
  background: var(--h-primary-100);
  box-shadow: 0 20px 50px -24px rgba(41, 32, 5, 0.35);
}

.board-header {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  padding: clamp(0.65rem, 1.4vh, 1rem) clamp(0.85rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--h-primary-300);
  background: var(--h-neutral-50);
}

.brand {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: clamp(0.65rem, 1.4vw, 1rem);
  min-width: 0;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

.brand-logo {
  width: clamp(2.35rem, 3.2vw, 3rem);
  height: clamp(2.35rem, 3.2vw, 3rem);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--h-primary-300);
}

.brand-title {
  margin: 0;
  font-weight: 600;
  color: var(--h-primary-900);
  font-size: clamp(calc(0.95rem + 3px), calc(1.35vw + 3px), calc(1.3rem + 3px));
}

.brand-version {
  margin: 0.1rem 0 0;
  font-family: var(--font-mono);
  color: var(--h-neutral-500);
  font-size: clamp(0.55rem, 0.7vw, 0.7rem);
}

.board-title {
  margin: 0;
  min-width: 0;
  max-width: min(100%, 40rem);
  -webkit-box-flex: 1.4;
  -ms-flex: 1.4;
  flex: 1.4;
  text-align: center;
  color: var(--h-neutral-800);
  font-size: clamp(calc(0.95rem + 2px), calc(1.25vw + 2px), calc(1.2rem + 2px));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-update {
  margin: 0;
  min-width: 0;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  text-align: right;
  color: var(--h-neutral-600);
  font-size: clamp(0.7rem, 0.9vw, 0.85rem);
}

.last-update-value {
  color: var(--h-neutral-800);
}

.board-body,
.board-loading {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  min-height: 0;
  gap: clamp(1rem, 2vw, 1.75rem);
  padding: clamp(1rem, 2.5vw, 2rem);
  background: var(--h-primary-100);
}

.board-aside,
.board-table-wrap {
  min-height: 0;
}

.board-aside {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: clamp(0.75rem, 1.5vh, 1.25rem);
  width: 45%;
}

.board-table-wrap {
  width: 55%;
  overflow: hidden;
  border: 1px solid var(--h-primary-300);
  border-radius: 0.75rem;
  background: var(--h-neutral-50);
}

.board-table-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 35vh;
  overflow: hidden;
}

.podium {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  -webkit-box-align: end;
  -ms-flex-align: end;
  align-items: flex-end;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  min-height: 0;
  padding-top: clamp(1.75rem, 3.5vh, 2.75rem);
}

.podium-item {
  position: relative;
  z-index: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: clamp(5.5rem, 10vw, 9.5rem);
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  text-align: center;
}

.podium-person {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 100%;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.podium-avatar-wrap {
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.crown {
  position: absolute;
  top: calc(-1 * (clamp(1.75rem, 3.5vh, 2.75rem) + 2px));
  left: 50%;
  width: clamp(1.5rem, 2.5vw, 2rem);
  height: clamp(1.5rem, 2.5vw, 2rem);
  color: var(--h-primary-500);
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
}

.avatar {
  overflow: hidden;
  border-radius: 999px;
  background: var(--h-neutral-50);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.podium-avatar {
  width: clamp(2.75rem, 5vw, 4.5rem);
  height: clamp(2.75rem, 5vw, 4.5rem);
  border: 2px solid var(--h-primary-300);
}

.avatar-first {
  border-color: var(--h-primary-500);
}

.person-name {
  margin: 0;
  width: 100%;
  padding: 0 0.15rem;
  font-weight: 600;
  color: var(--h-neutral-800);
  font-size: clamp(0.85rem, 1.4vw, 1.2rem);
}

.person-cargo {
  margin: 0.15rem 0 0;
  width: 100%;
  padding: 0 0.15rem;
  font-weight: 400;
  color: var(--h-neutral-500);
  font-size: calc(clamp(0.85rem, 1.4vw, 1.2rem) - 2px);
}

.podium-stars,
.rank-row-stars,
.modal-stars {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  gap: 0.125rem;
}

.podium-stars {
  margin-top: 0.25rem;
}

.star {
  width: clamp(calc(0.8rem + 2px), calc(1.15vw + 2px), calc(1rem + 2px));
  height: clamp(calc(0.8rem + 2px), calc(1.15vw + 2px), calc(1rem + 2px));
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.points {
  margin: 0.25rem 0 0;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--h-primary-800);
  font-size: clamp(0.9rem, 1.5vw, 1.35rem);
  font-variant-numeric: tabular-nums;
}

.sales {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--h-neutral-800);
  font-size: clamp(0.7rem, 1vw, 0.85rem);
  font-variant-numeric: tabular-nums;
}

.pts-label,
.vendas-label {
  margin-left: 0.25rem;
  font-family: var(--font-sans);
  font-weight: 500;
}

.pts-label {
  font-size: clamp(0.55rem, 0.75vw, 0.7rem);
  color: var(--h-primary-800);
}

.vendas-label {
  font-size: inherit;
  color: inherit;
}

.podium-bar {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 85%;
  margin-top: 1rem;
  -webkit-box-align: end;
  -ms-flex-align: end;
  align-items: flex-end;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  border-top-left-radius: 0.75rem;
  border-top-right-radius: 0.75rem;
}

.podium-bar span {
  padding-bottom: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--h-primary-100);
  font-size: clamp(1.25rem, 2.2vw, 2.25rem);
  font-variant-numeric: tabular-nums;
}

.podium-bar-1 {
  height: clamp(7rem, 22vh, 14rem);
}

.podium-bar-2 {
  height: clamp(5rem, 16vh, 10rem);
}

.podium-bar-3 {
  height: clamp(3.5rem, 12vh, 7.5rem);
}

.tone-1 {
  background: var(--h-primary-500);
}

.tone-2 {
  background: var(--h-primary-600);
}

.tone-3 {
  background: var(--h-primary-700);
}

.near-podium,
.table-auto-scroll {
  margin: 0;
  padding: 0;
}

.near-podium {
  overflow: hidden;
  border: 1px solid var(--h-primary-300);
  border-radius: 0.75rem;
  background: var(--h-neutral-50);
}

.rank-row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  gap: clamp(0.5rem, 1.2vw, 1rem);
  padding: clamp(0.65rem, 1.5vh, 1.1rem) clamp(0.85rem, 1.8vw, 1.5rem);
  background: var(--h-primary-100);
  border-bottom: 1px dashed var(--h-primary-300);
}

.near-podium .rank-row:last-child,
.table-auto-scroll .rank-row:last-child {
  border-bottom: 0;
}

.rank-row-left {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: clamp(0.5rem, 1vw, 0.85rem);
  min-width: 0;
  -webkit-box-flex: 1.6;
  -ms-flex: 1.6;
  flex: 1.6;
}

.rank-number {
  width: clamp(2rem, 3.5vw, 3rem);
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--h-primary-700);
  font-size: clamp(0.9rem, 1.5vw, 1.35rem);
  font-variant-numeric: tabular-nums;
}

.rank-row-left .avatar {
  width: clamp(2rem, 3.5vw, 3rem);
  height: clamp(2rem, 3.5vw, 3rem);
  -webkit-flex-shrink: 0;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  border: 2px solid var(--h-primary-100);
}

.person-copy {
  min-width: 0;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
}

.person-copy .person-name,
.person-copy .person-cargo {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delta {
  margin: 0.15rem 0 0;
  font-weight: 600;
  font-size: clamp(0.7rem, 1vw, 0.9rem);
}

.delta-up {
  color: var(--h-primary-500);
}

.delta-down {
  color: var(--h-secondary-200);
}

.rank-row-stars {
  -webkit-box-flex: 0;
  -ms-flex: 0 0 auto;
  flex: 0 0 auto;
}

.rank-row-stats {
  text-align: right;
  -webkit-box-flex: 0.85;
  -ms-flex: 0.85;
  flex: 0.85;
}

.rank-row-stats .points,
.rank-row-stats .sales {
  margin: 0;
}

.table-auto-scroll {
  -webkit-animation-name: table-scroll-down;
  animation-name: table-scroll-down;
  -webkit-animation-timing-function: linear;
  animation-timing-function: linear;
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
  will-change: transform;
}

@-webkit-keyframes table-scroll-down {
  from {
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
  to {
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
  }
}

@keyframes table-scroll-down {
  from {
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
  to {
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
  }
}

.rank-up {
  -webkit-animation: flash-up 1s ease;
  animation: flash-up 1s ease;
}

.rank-down {
  -webkit-animation: fall-down 0.85s ease;
  animation: fall-down 0.85s ease;
}

@-webkit-keyframes flash-up {
  0% {
    background-color: rgba(252, 231, 233, 0.95);
    -webkit-transform: translateY(10px);
    transform: translateY(10px);
  }
  100% {
    background-color: transparent;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

@keyframes flash-up {
  0% {
    background-color: rgba(252, 231, 233, 0.95);
    transform: translateY(10px);
  }
  100% {
    background-color: transparent;
    transform: translateY(0);
  }
}

@-webkit-keyframes fall-down {
  0% {
    background-color: rgba(228, 230, 228, 0.95);
    -webkit-transform: translateY(-8px);
    transform: translateY(-8px);
  }
  55% {
    -webkit-transform: translateY(6px);
    transform: translateY(6px);
  }
  100% {
    background-color: transparent;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

@keyframes fall-down {
  0% {
    background-color: rgba(228, 230, 228, 0.95);
    transform: translateY(-8px);
  }
  55% {
    transform: translateY(6px);
  }
  100% {
    background-color: transparent;
    transform: translateY(0);
  }
}

.skeleton {
  display: block;
  border-radius: 0.35rem;
  background: var(--h-primary-300);
}

.skeleton-title {
  width: min(16rem, 45vw);
  height: 1.1em;
  margin: 0 auto;
}

.skeleton-update {
  width: min(12rem, 35vw);
  height: 1em;
  margin-left: auto;
}

.loading-podium,
.loading-near,
.loading-table {
  background: rgba(228, 230, 228, 0.7);
  border-radius: 0.75rem;
}

.loading-podium {
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  min-height: 12rem;
}

.loading-near {
  height: clamp(5rem, 12vh, 7rem);
}

.loading-table {
  width: 55%;
  min-height: 40vh;
}

.loading-aside {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: 45%;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  gap: 1rem;
}

#modal-root {
  position: relative;
  z-index: 50;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(41, 32, 5, 0.55);
}

.modal-card {
  width: 100%;
  max-width: 28rem;
  padding: 2.5rem 2rem;
  text-align: center;
  border: 1px solid var(--h-primary-300);
  border-radius: 1.5rem;
  background: var(--h-primary-100);
  box-shadow: 0 30px 80px -20px rgba(41, 32, 5, 0.55);
}

.top3-modal {
  max-width: 32rem;
}

.modal-logo {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1.25rem;
  border-radius: 0.75rem;
}

.modal-logo-lg {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 0;
}

.modal-avatar {
  width: 7rem;
  height: 7rem;
  margin: 0 auto;
  border: 4px solid var(--h-primary-500);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.modal-avatar-sm {
  width: 6rem;
  height: 6rem;
  margin-top: 1.25rem;
}

.modal-card h2,
.top3-text {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  color: var(--h-primary-900);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
}

.modal-card h2 .person-cargo,
.top3-text .person-cargo {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--h-neutral-500);
  font-size: calc(1em - 2px);
}

.modal-stars {
  margin-top: 0.75rem;
}

.modal-stars .star {
  width: 1rem;
  height: 1rem;
}

.modal-points {
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  color: var(--h-neutral-800);
  font-size: 1.125rem;
}

.modal-cta {
  margin: 2rem 0 0;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--h-primary-500);
}

.top3-meta {
  margin: 0.75rem 0 0;
  color: var(--h-neutral-600);
  font-size: 1rem;
}

.top3-meta span {
  color: var(--h-neutral-800);
}

.sale-modal {
  -webkit-animation: modal-pop 0.45s ease both;
  animation: modal-pop 0.45s ease both;
}

.top3-modal {
  -webkit-animation: modal-rise 0.5s ease both;
  animation: modal-rise 0.5s ease both;
}

@-webkit-keyframes modal-pop {
  from {
    opacity: 0;
    -webkit-transform: translateY(18px) scale(0.94);
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0) scale(1);
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@-webkit-keyframes modal-rise {
  from {
    opacity: 0;
    -webkit-transform: translateY(28px) scale(0.92);
    transform: translateY(28px) scale(0.92);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0) scale(1);
    transform: translateY(0) scale(1);
  }
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 1024px) {
  .board-body,
  .board-loading {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
  }

  .board-aside,
  .board-table-wrap,
  .loading-aside,
  .loading-table {
    width: 100%;
  }
}
