/* Gluuu — prancha visual v1 (ver DESIGN.md) */
:root {
  --ink: #111111;
  --accent: #4338CA;
  --accent-ink: #4338CA;      /* índigo usado em texto/links */
  --accent-soft: #EEF2FF;
  --accent-soft-ink: #3730A3;
  --bg: #FFFFFF;
  --surface: #F6F6F4;
  --card: #FFFFFF;
  --line: #E7E7E3;
  --muted: #6B6B66;
  --on-ink: #FFFFFF;
  --hit-1: #15803D;
  --hit-2: #EAB308;
  --hit-3: #F97316;
  --miss: #B91C1C;
  --title: "Inter Tight", Inter, system-ui, sans-serif;
  --text: Inter, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #F5F5F4;
    --accent-ink: #A5B4FC;
    --accent-soft: #1A1A1C;
    --accent-soft-ink: #A5B4FC;
    --bg: #0F0F10;
    --surface: #1A1A1C;
    --card: #0F0F10;
    --line: #2A2A2D;
    --muted: #A1A19B;
    --on-ink: #0F0F10;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--text);
  font-size: 17px;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 18px; height: 18px; }

/* Topo */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; max-width: 520px; width: 100%; margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.logo {
  font-family: var(--title); font-weight: 700; font-size: 28px; letter-spacing: -0.05em;
  margin: 0; color: var(--ink); line-height: 1;
}
.logo span { color: var(--accent); }
@media (prefers-color-scheme: dark) { .logo span { color: var(--accent-ink); } }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}

main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 18px 20px 24px; }
.screen { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }

/* Tipografia */
.label {
  margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.big { font-family: var(--title); font-weight: 700; font-size: 44px; letter-spacing: -0.04em; line-height: 1; margin: 0; }
.lead { font-size: 17px; line-height: 1.5; color: var(--muted); margin: 0; }
.lead b { color: var(--ink); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Botões */
.cta, .ghost, .shop-btn {
  width: 100%; min-height: 56px; border-radius: 16px; padding: 0 20px;
  font-family: var(--text); font-size: 17px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.cta { border: 0; background: var(--ink); color: var(--on-ink); }
.cta:disabled { opacity: .5; }
.ghost { border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.shop-btn { border: 0; background: var(--accent); color: #FFFFFF; }
.cta:focus-visible, .ghost:focus-visible, .shop-btn:focus-visible, .icon-btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-ink); outline-offset: 2px;
}

.streak-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-soft-ink); font-size: 14px; font-weight: 600;
}
.streak-pill:empty { display: none; }

/* Carregando */
.loader {
  width: 56px; height: 56px; margin-top: 64px; border-radius: 14px; background: var(--ink); color: var(--on-ink);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--title); font-weight: 700; font-size: 32px; animation: breathe 1.2s infinite ease-in-out;
}
@keyframes breathe { 50% { transform: scale(.9); opacity: .6; } }

/* Rodada */
.progress { display: flex; gap: 6px; width: 100%; }
.progress span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.progress span.done { background: var(--ink); }
.progress span.now { background: var(--accent); }
.card { width: 100%; text-align: left; }
.img-wrap {
  width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
}
.img-wrap img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .img-wrap { background: #FFFFFF; } .img-wrap img { mix-blend-mode: normal; } }
.card h3 { font-size: 17px; font-weight: 500; line-height: 1.35; margin: 14px 0 4px; }
.meta { margin: 0; color: var(--muted); font-size: 14px; }

.tries { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.tries:empty { display: none; }
.try {
  display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 14px;
  border-radius: 12px; background: var(--surface); border: 1.5px solid transparent; font-size: 15px;
  animation: pop .2s ease-out;
}
.try .val { font-family: var(--title); font-weight: 700; }
.try .hint { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.try.ok { background: var(--bg); border-color: var(--hit-1); }
.try.ok .hint { color: var(--hit-1); font-weight: 600; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }

#guess-form { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.money {
  display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 0 18px;
  border-radius: 16px; border: 1.5px solid var(--ink); background: var(--bg);
}
.money span { font-size: 17px; color: var(--muted); }
.money input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink);
  font-family: var(--title); font-weight: 700; font-size: 28px; letter-spacing: -0.02em;
}
.money input::placeholder { font-family: var(--text); font-weight: 400; font-size: 17px; letter-spacing: 0; color: var(--muted); }

.reveal { width: 100%; display: flex; flex-direction: column; gap: 12px; animation: pop .25s ease-out; }
.reveal-label { margin: 0; font-size: 15px; color: var(--muted); }
.reveal-price { margin: 0 0 4px; font-family: var(--title); font-weight: 700; font-size: 64px; letter-spacing: -0.04em; line-height: 1; }

/* Resultado */
.score { font-family: var(--title); font-weight: 700; font-size: 56px; letter-spacing: -0.04em; line-height: 1; margin: 0; }
.grid { display: flex; gap: 8px; justify-content: center; }
.sq { width: 42px; height: 42px; border-radius: 10px; background: var(--line); }
.sq.h1 { background: var(--hit-1); }
.sq.h2 { background: var(--hit-2); }
.sq.h3 { background: var(--hit-3); }
.sq.miss { background: var(--miss); }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.stat { border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px; }
.stat b { display: block; font-family: var(--title); font-weight: 700; font-size: 23px; letter-spacing: -0.02em; }
.stat small { color: var(--muted); font-size: 12px; }
.section-title { align-self: flex-start; margin-top: 8px; }
.product-list { list-style: none; padding: 0; margin: 0; width: 100%; text-align: left; }
.product-list li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.product-list li:last-child { border-bottom: 1px solid var(--line); }
.product-list img { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--surface); flex: none; }
.product-list .info { flex: 1; min-width: 0; }
.product-list .info p { margin: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-list .info .price { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.product-list .info b { font-family: var(--title); font-weight: 700; }
.product-list .dot { width: 10px; height: 10px; border-radius: 3px; }
.product-list a {
  flex: none; min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent-ink); font-weight: 600; font-size: 15px; text-decoration: none;
}

/* Rodapé, diálogos, avisos */
.foot { max-width: 520px; margin: 0 auto; padding: 16px 20px 24px; font-size: 12px; line-height: 1.5; color: var(--muted); text-align: center; }
dialog {
  border: 1px solid var(--line); border-radius: 16px; padding: 24px 20px 20px; width: min(92vw, 420px);
  background: var(--bg); color: var(--ink);
}
dialog h3 { font-family: var(--title); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; margin: 0 0 12px; }
dialog::backdrop { background: rgba(17, 17, 17, .45); }
dialog ol { padding-left: 20px; line-height: 1.6; margin: 0 0 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(100px);
  background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 12px; font-size: 15px; font-weight: 600;
  transition: transform .25s, opacity .25s; z-index: 10; opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.confetti { position: fixed; top: -16px; width: 10px; height: 10px; border-radius: 3px; pointer-events: none; animation: fall 1.6s linear forwards; z-index: 20; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Páginas de texto (sobre, privacidade) */
.logo-link { text-decoration: none; }
.back { width: auto; min-height: 44px; padding: 0 16px; font-size: 15px; }
.doc { text-align: left; line-height: 1.6; }
.doc .big { margin: 6px 0 16px; }
.doc h2 { font-family: var(--title); font-weight: 700; font-size: 20px; letter-spacing: -0.02em; margin: 28px 0 8px; }
.doc p, .doc ol { margin: 0 0 12px; }
.doc ol { padding-left: 20px; }
.doc a, .foot-links a { color: var(--accent-ink); }
.foot-links { margin-top: 8px; }
.foot-links a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; }

/* Celular: a rodada cabe numa dobra só (produto, chutes, campo e botão sem rolar).
   A foto encolhe quando falta altura; quando sobra, continua quadrada. */
@media (max-width: 560px) {
  .top { padding-top: 8px; padding-bottom: 8px; }
  .icon-btn { width: 44px; height: 44px; }
  main:has(> .screen.fit:not(.hidden)) { padding-top: 10px; padding-bottom: 12px; }
  .screen.fit { height: calc(100dvh - 61px - 22px); gap: 10px; justify-content: flex-start; }
  .screen.fit > * { flex-shrink: 0; }
  /* o cartão some do layout: foto, nome e nota viram itens da tela, e só a foto encolhe */
  .screen.fit .card { display: contents; }
  .screen.fit .card h3, .screen.fit .meta { width: 100%; text-align: left; }
  .screen.fit .img-wrap { flex: 0 1 auto; flex-shrink: 1; aspect-ratio: auto; height: calc(100vw - 40px); min-height: 96px; }
  .screen.fit .card h3 {
    margin: 8px 0 2px; font-size: 16px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .screen.fit .card h3, .screen.fit .meta { flex-shrink: 0; }
  .screen.fit .meta { font-size: 13px; }
  .screen.fit .tries { gap: 6px; }
  .screen.fit .try { min-height: 40px; font-size: 14px; }
  .screen.fit #guess-form { gap: 8px; }
  .screen.fit .money { min-height: 56px; }
  .screen.fit .cta, .screen.fit .ghost, .screen.fit .shop-btn { min-height: 50px; }
  .screen.fit .reveal { gap: 8px; }
  .screen.fit .reveal-price { font-size: 48px; margin: 0; }
  .screen.fit .label { margin: 0; }
}
@media (max-width: 560px) and (max-height: 640px) {
  .screen.fit { gap: 8px; }
  .screen.fit .try { min-height: 36px; }
  .screen.fit .reveal-price { font-size: 40px; }
  .screen.fit .cta, .screen.fit .ghost, .screen.fit .shop-btn { min-height: 46px; }
  .screen.fit .money { min-height: 52px; }
}
