:root {
  --paper: #fffdf8;
  --ink: #2b2523;
  --accent: #e8674c;
  --accent-soft: #fbe0d9;
  --accent-line: #f3c6bb;
  --muted: #8b807c;
}

body {
  /* Coluna de altura cheia: o rodape encosta no fim da janela mesmo em paginas curtas. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

.board {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.content {
  flex: 1;
}

/* Rodape: mesma largura e respiro do conteudo */
.footer {
  border-top: 1px solid var(--accent-line);
  background: var(--paper);
}

.footer__note {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Barra do topo: marca de um lado, About e Categorias do outro */
.topbar {
  border-bottom: 1px solid var(--accent-line);
  background: var(--paper);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* Mesma largura do .board: a marca alinha com o conteudo da pagina. */
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 24px;
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.topbar__mark {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  fill: var(--accent);
}

.topbar__name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar__nav {
  display: flex;
  gap: 4px;
}

.topbar__link {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.topbar__link:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.topbar__link--active {
  color: var(--ink);
  font-weight: 600;
}

/* Pagina "Como funciona" */
.about__section {
  margin-top: 40px;
}

.about__heading {
  margin: 0 0 12px;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.about__text {
  margin: 0;
  color: #6b615d;
  font-size: 15px;
  line-height: 1.6;
}

.about__list {
  margin: 0;
  padding-left: 22px;
  color: #6b615d;
  font-size: 15px;
  line-height: 1.6;
}

.about__list li + li {
  margin-top: 10px;
}

.about__list li::marker {
  color: var(--accent);
  font-weight: 700;
}

/* Pagina de categorias */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.category-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  height: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: #fffaf7;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.category-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(232, 103, 76, 0.12);
}

.category-card__name {
  font-weight: 600;
}

.category-card:hover .category-card__name {
  color: var(--accent);
}

.category-card__count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.board__header {
  text-align: center;
}

/* Audiencia: quem esta no site agora e o total de visitantes */
.audience {
  display: flex;
  align-items: center;
  gap: 8px;
  /* width: fit-content + margin auto centraliza a pilula sem esticar a borda. */
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 28px;
  padding: 7px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.audience__online {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 600;
}

.audience__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #2fae6b;
  box-shadow: 0 0 0 3px rgba(47, 174, 107, 0.18);
}

.audience__separator {
  color: var(--accent-line);
}

.board__header h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.02em;
}

.board__hash {
  color: var(--ink);
}

.board__price {
  color: var(--accent);
}

.board__hint {
  max-width: 480px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.board__hint-strong {
  color: var(--accent);
}

.board--narrow {
  max-width: 640px;
}

/* Stepper do lance */
.board__claim {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.02em;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.stepper__button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.stepper__button:hover {
  background: var(--accent);
  color: #fff;
}

.stepper__value {
  display: inline-flex;
  align-items: baseline;
  color: var(--accent);
}

.stepper__input {
  /* A largura acompanha o texto digitado (JS ajusta; field-sizing cobre o resto). */
  width: auto;
  min-width: 1ch;
  field-sizing: content;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  appearance: textfield;
}

.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button {
  appearance: none;
  margin: 0;
}

.stepper__input:focus {
  outline: none;
  border-bottom-color: var(--accent-line);
}

/* Tela pos-pagamento */
.receipt__header {
  margin-bottom: 24px;
  text-align: center;
}

.receipt__header h1 {
  margin: 14px 0 8px;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.receipt__badge {
  display: inline-block;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.receipt__badge--pending {
  background: var(--accent-soft);
  color: var(--accent);
}

.receipt__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.receipt__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 28px;
}

.receipt__actions .bid-form__submit {
  display: inline-block;
  text-decoration: none;
}

.receipt__link {
  color: var(--accent);
  font-size: 14px;
}

.flash {
  margin: 24px 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
  text-align: center;
}

.flash--alert {
  border: 1px solid var(--accent);
  background: #fff;
}

/* Form */
.bid-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 24px;
}

.bid-form__errors {
  flex: 1 0 100%;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: 14px;
}

.bid-form__field {
  flex: 1 1 260px;
}

.bid-form__field--select {
  position: relative;
  flex: 0 1 240px;
  min-width: 0;
}

/* Setinha ancorada no campo (nao no texto): a posicao nao muda com a opcao escolhida */
.bid-form__field--select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23e8674c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat center / 16px 16px;
  pointer-events: none;
  transition: transform 0.15s ease;
}

.bid-form__field--select:has(select:open)::after {
  transform: rotate(180deg);
}

.bid-form input[type="url"],
.bid-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  appearance: none;
}

.bid-form input[type="url"]::placeholder {
  color: var(--muted);
}

.bid-form input[type="url"]:focus,
.bid-form select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

/* Select: campo laranja arredondado, texto sempre em uma linha */
.bid-form select {
  border-radius: 12px;
  border-color: var(--accent);
  padding-right: 42px;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Fallback: navegadores que nao estilizam o popup ao menos mudam as cores */
.bid-form select option {
  background: #fff;
  color: var(--accent);
}

.bid-form select option:checked {
  background: var(--accent-soft);
}

/* Chrome 135+: popup totalmente estilizavel */
@supports (appearance: base-select) {
  .bid-form select,
  .bid-form select::picker(select) {
    appearance: base-select;
  }

  .bid-form select {
    display: flex;
    align-items: center;
  }

  .bid-form select selectedcontent {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* usamos a seta do container, entao a nativa sai de cena */
  .bid-form select::picker-icon {
    display: none;
  }

  .bid-form select::picker(select) {
    margin-top: 6px;
    padding: 6px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(232, 103, 76, 0.18);
  }

  .bid-form select option {
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 500;
    white-space: nowrap;
  }

  .bid-form select option:hover,
  .bid-form select option:focus {
    background: var(--accent-soft);
    color: var(--accent);
    outline: none;
  }

  .bid-form select option:checked {
    background: var(--accent);
    color: #fff;
  }

  .bid-form select option::checkmark {
    display: none;
  }
}

.bid-form__submit {
  padding: 12px 28px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.bid-form__submit:hover {
  background: #d4573d;
}

.bid-form__hint {
  margin: -12px 0 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* Filters */
/* Sao 28 categorias: uma fila unica que rola no lugar de varias linhas de chips. */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-line) transparent;
  -webkit-overflow-scrolling: touch;
}

.filters::-webkit-scrollbar {
  height: 6px;
}

.filters::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--accent-line);
}

.filters__item {
  flex: 0 0 auto;
  white-space: nowrap;
  scroll-snap-align: start;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.filters__item:hover {
  background: var(--accent-soft);
}

.filters__item--active {
  background: var(--accent);
  color: #fff;
}

/* List */
.ranks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rank {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  background: #fffaf7;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rank:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(232, 103, 76, 0.12);
}

.rank--leader {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.rank__position {
  flex: 0 0 auto;
  min-width: 44px;
  padding: 8px 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.rank__icon {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--accent-soft);
}

.rank__icon img {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
  background: #fff;
}

.rank__icon--broken img {
  display: none;
}

.rank__icon-initials {
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

.rank__body {
  flex: 1;
  min-width: 0;
}

.rank__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.rank__url {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.rank:hover .rank__url {
  color: var(--accent);
}

/* Area clicavel esticada: qualquer ponto do item abre o link */
.rank__url::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 16px;
}

.rank__url:focus-visible::after {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rank__amount {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
}

.rank__description {
  margin: 6px 0 0;
  color: #6b615d;
  font-size: 14px;
  line-height: 1.45;
}

.rank__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Paginacao (Kaminari) */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  font-size: 14px;
}

.pagination a,
.pagination .current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}

.pagination a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.pagination .current {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.pagination .first a,
.pagination .prev a,
.pagination .next a,
.pagination .last a {
  color: var(--accent);
  font-weight: 600;
}

.pagination .gap {
  padding: 0 4px;
  color: var(--muted);
}

.ranks__empty {
  padding: 32px;
  border: 1px dashed var(--accent-line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

/* Botões de like / dislike */
.vote {
  display: flex;
  gap: 6px;
  /* z-index garante que os botões ficam acima do ::after do .rank__url
     que estica a área clicável sobre o card inteiro. */
  position: relative;
  z-index: 2;
}

.vote__button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.vote__button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.vote__button--active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.vote__button--dislike.vote__button--active {
  border-color: #8b807c;
  background: #f4f0ef;
  color: #8b807c;
}


.vote__icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
