/* Home: titulo, faixa de jogos, o deck, mesas abertas. Molde da home do melee.gg:
   uma coisa grande para fazer no centro e os jogos logo abaixo. */

body {
  background:
    radial-gradient(1200px 500px at 50% -120px, color-mix(in srgb, var(--game, var(--accent)) 28%, transparent), transparent 70%),
    var(--bg);
  transition: background .4s;
}
main { max-width: 1080px; margin: 0 auto; padding: 0 20px 64px; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1080px; margin: 0 auto; padding: 16px 20px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 500 17px var(--display); }
.logo:hover { text-decoration: none; }
.logo b { font-weight: 800; }
.top nav { display: flex; gap: 22px; font-size: 14px; }
.top nav a { color: var(--muted); }
.top nav a:hover { color: var(--ink); text-decoration: none; }

.hero { padding: 48px 0 26px; max-width: 760px; }
.hero h1 {
  margin: 0; font: 800 clamp(38px, 6.4vw, 68px)/.98 var(--display); font-stretch: 78%;
  letter-spacing: -.01em; text-wrap: balance;
}
.lead { margin: 16px 0 0; color: var(--muted); font-size: 17px; max-width: 62ch; text-wrap: pretty; }

.label { margin: 0 0 10px; font: 600 12px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- faixa de jogos ---------- */
.games {
  display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 10px;
  overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x proximity;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.game {
  position: relative; display: grid; align-content: end; height: 84px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer;
  background: var(--surface) center / cover no-repeat; color: #fff; text-align: left;
  font: 700 14px/1.1 var(--display); font-stretch: 90%;
  scroll-snap-align: start; transition: border-color .15s, transform .15s;
}
.game::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(0 0 0 / .05), rgb(0 0 0 / .78));
}
.game span { position: relative; text-shadow: 0 1px 2px rgb(0 0 0 / .6); }
.game:hover { transform: translateY(-2px); }
/* A cor do jogo pode ser escura (o roxo do Magic some no fundo): a borda e a
   cor clareada, e o anel de fora e a cor pura. */
.game[aria-checked="true"] {
  border: 2px solid color-mix(in srgb, var(--game, var(--accent)) 45%, #fff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--game, var(--accent)) 60%, transparent);
}

/* ---------- criar ---------- */
.create {
  display: grid; grid-template-columns: 1fr 300px; gap: 22px; margin-top: 12px;
  padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow);
}
.create-deck { display: grid; gap: 10px; align-content: start; }
.create-deck .textarea { min-height: 236px; }
.create-side { display: grid; gap: 16px; align-content: start; }
.create-side .btn.big { width: 100%; margin-top: 4px; }
.deck-status { min-height: 22px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.deck-status .ok { color: var(--ok); font-weight: 600; }
.deck-status .warn { color: var(--warn); }
.deck-status .bad { color: var(--danger); }
/* Altura fixa desde o comeco: a imagem do deck chegar nao pode empurrar o
   botao de criar para baixo do dedo de quem ia clicar nele. */
.deck-thumb {
  height: 110px; border-radius: 10px; background: var(--bg-2) center 22% / cover no-repeat;
  border: 1px solid var(--line); transition: background-image .2s;
}

.code { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.code .input { width: 130px; min-height: 40px; text-transform: lowercase; letter-spacing: .1em; }

.ad-wrap { margin: 36px 0 0; min-height: 0; }

/* ---------- mesas abertas ---------- */
.open, .how { margin-top: 48px; }
.open h2, .how h2 { margin: 0 0 14px; font: 750 26px/1.1 var(--display); font-stretch: 82%; }
.open-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.open-empty { color: var(--muted); padding: 18px; border: 1px dashed var(--line-2); border-radius: 12px; grid-column: 1 / -1; }
.table-card {
  display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px; align-items: center;
  padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.table-card img { width: 44px; height: 44px; border-radius: 10px; grid-row: span 2; }
.table-card b { font-size: 15px; }
.table-card .muted { font-size: 13px; }
.table-card .actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; }
.table-card .actions .btn { flex: 1; }

/* ---------- como funciona ---------- */
.how ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: passo; }
.how li { padding: 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; counter-increment: passo; }
.how li::before {
  content: counter(passo); display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 10px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 14px var(--display);
}
.how b { font: 700 17px var(--display); font-stretch: 90%; }
.how p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.foot { max-width: 1080px; margin: 0 auto; padding: 24px 20px 90px; color: var(--faint); font-size: 13px; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }
.foot a { color: var(--muted); }

@media (max-width: 820px) {
  .create { grid-template-columns: 1fr; padding: 16px; }
  .create-deck .textarea { min-height: 170px; }
  .how ol { grid-template-columns: 1fr; }
  .top nav a:not(:last-child) { display: none; }
}
@media (max-width: 560px) {
  main { padding: 0 16px 48px; }
  .top { padding: 12px 16px; }
  .hero { padding: 28px 0 18px; }
  .games { grid-auto-columns: 112px; }
  .game { height: 72px; }
}

.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.lang-pick { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.lang-pick .select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 14px; }

/* ---------- conta do site ---------- */
.account { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.account img { border-radius: 50%; object-fit: cover; }
.account .btn { min-height: 32px; }
.my-decks { display: grid; gap: 6px; }
.my-decks .label { margin: 0; }
.my-decks-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.deck-chip {
  display: flex; align-items: center; gap: 8px; flex: none; max-width: 220px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); color: var(--ink);
  cursor: pointer; text-align: left;
}
.deck-chip:hover { border-color: var(--accent); }
.deck-chip img { width: 44px; height: 32px; border-radius: 6px; object-fit: cover; }
.deck-chip span { display: grid; min-width: 0; }
.deck-chip b, .deck-chip small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-chip b { font-size: 13px; }
.deck-chip small { font-size: 11px; color: var(--muted); }
@media (max-width: 820px) { .top nav a:not(:last-of-type) { display: none; } }

/* ---------- FAQ e aviso ---------- */
.faq { margin-top: 48px; }
.faq h2 { margin: 0 0 14px; font: 750 26px/1.1 var(--display); font-stretch: 82%; }
.faq-item { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq-item summary { padding: 12px 4px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; }
.faq-item[open] summary::after { content: "−"; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { margin: 0 4px 14px; color: var(--muted); max-width: 72ch; }
.disclaimer { max-width: 80ch; color: var(--faint); font-size: 12px; line-height: 1.5; }
