/* =========================================================================
   Loja Tarjada — estilos a partir do Tarja DS (design-system/index.html, v0.2)
   Tokens copiados do DS, incluindo os de contraste AA (--success-text, --exp-*-text,
   --control-edge, --tarja-outline, --on-danger).
   Layout: histórico (esquerda, sempre visível) + página (centro) + ficha técnica (direita) + campo fixo flutuando embaixo.
   ========================================================================= */

/* ---------- tokens: tema claro (padrão) ---------- */
:root {
  --canvas: #F7F8FC; --surface: #FFFFFF; --subtle: #EEF0F8;
  --line: #D9DDEC; --line-strong: #B9BFD6;
  --text: #14172B; --text-2: #474D6B; --text-3: #626887;
  --tarja: #14172B; --on-tarja: #FFFFFF; --tarja-edge: #14172B;
  --primary: #3440E8; --primary-hover: #2631C7; --on-primary: #FFFFFF; --primary-soft: #E6E8FF;
  --marca: #FFE14D; --on-marca: #14172B;
  --hint: #FFB020; --hint-soft: #FFF1D1; --on-hint: #14172B;
  --success: #0B8A6D; --success-soft: #DDF6EF;
  --danger: #D23542; --danger-soft: #FDE4E6;
  --warning: #9A5B00; --warning-soft: #FFF1D1;
  --exp-a: #F28C18; --exp-b: #D63B92; --exp-c: #3E7BFA;
  --focus: #3440E8;
  --sticker: 3px 3px 0 var(--tarja);
  --shadow-1: 0 1px 2px rgba(20, 23, 43, .06), 0 1px 1px rgba(20, 23, 43, .04);
  --shadow-2: 0 8px 24px rgba(20, 23, 43, .12);
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;
  --dur-fast: 120ms; --dur-base: 200ms; --dur-reveal: 320ms;
  --ease-pop: cubic-bezier(.2, .9, .3, 1.25);
  --f-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --f-body: "Atkinson Hyperlegible", "Verdana", "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --pop-pink: #FF6FAE; --pop-mint: #34D6A8; --pop-orange: #FF9448; --pop-sky: #66CCFF; --pop-ink: #14172B;
  --success-text: #07735A; --exp-a-text: #9A5200; --exp-b-text: #B02A76; --exp-c-text: #2A5FD6;
  --control-edge: #858BA8; --tarja-outline: #14172B; --on-danger: #FFFFFF;
  --hdr-h: 64px; --hist-w: 300px;
  --chip-fill: 16%; --chip-edge: 45%;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0D0A1F; --surface: #1C1838; --subtle: #282248;
    --line: #3B3463; --line-strong: #6A5FA0;
    --text: #F2F4FD; --text-2: #C3C8DE; --text-3: #9AA0BC;
    --tarja: #060418; --on-tarja: #F0F2FB; --tarja-edge: #7E73B4;
    --primary: #8B93FF; --primary-hover: #A4AAFF; --on-primary: #0D0A1F; --primary-soft: #332C66;
    --hint: #FFC247; --hint-soft: #3A2E12;
    --success: #3DD6AE; --success-soft: #10362E;
    --danger: #FF6B74; --danger-soft: #3D1A20;
    --warning: #FFC247; --warning-soft: #3A2E12;
    --exp-a: #FFA64D; --exp-b: #FF7DC2; --exp-c: #7FA8FF;
    --focus: #A4AAFF;
  /* no escuro as cores pop sobem um pouco: o preto come saturação */
  --pop-pink: #FF8AC0; --pop-mint: #4BE3B8; --pop-orange: #FFB066; --pop-sky: #7FD8FF;
    --sticker: 3px 3px 0 #FFE14D;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 8px 24px rgba(0, 0, 0, .5);
    --success-text: #3DD6AE; --exp-a-text: #FFA64D; --exp-b-text: #FF7DC2; --exp-c-text: #7FA8FF;
    --control-edge: #7E73B4; --tarja-outline: #7E73B4; --on-danger: #0D0A1F;
    --chip-fill: 11%; --chip-edge: 30%;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0D0A1F; --surface: #1C1838; --subtle: #282248;
  --line: #3B3463; --line-strong: #6A5FA0;
  --text: #F2F4FD; --text-2: #C3C8DE; --text-3: #9AA0BC;
  --tarja: #060418; --on-tarja: #F0F2FB; --tarja-edge: #7E73B4;
  --primary: #8B93FF; --primary-hover: #A4AAFF; --on-primary: #0D0A1F; --primary-soft: #332C66;
  --hint: #FFC247; --hint-soft: #3A2E12;
  --success: #3DD6AE; --success-soft: #10362E;
  --danger: #FF6B74; --danger-soft: #3D1A20;
  --warning: #FFC247; --warning-soft: #3A2E12;
  --exp-a: #FFA64D; --exp-b: #FF7DC2; --exp-c: #7FA8FF;
  --focus: #A4AAFF;
  /* no escuro as cores pop sobem um pouco: o preto come saturação */
  --pop-pink: #FF8AC0; --pop-mint: #4BE3B8; --pop-orange: #FFB066; --pop-sky: #7FD8FF;
  --sticker: 3px 3px 0 #FFE14D;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, .5);
  --success-text: #3DD6AE; --exp-a-text: #FFA64D; --exp-b-text: #FF7DC2; --exp-c-text: #7FA8FF;
  --control-edge: #7E73B4; --tarja-outline: #7E73B4; --on-danger: #0D0A1F;
  color-scheme: dark;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; overflow-x: clip; color: var(--text);
  background-color: var(--canvas); background-image: radial-gradient(color-mix(in srgb, var(--line-strong) 45%, transparent) 1px, transparent 1.3px);
  background-size: 22px 22px; font: 16px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); letter-spacing: -.015em; text-wrap: balance; }
p, dl, dd { margin: 0; }
a { color: var(--primary); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.c-primary { color: var(--primary); } .c-warning { color: var(--warning); }
.m-only { display: none !important; }

/* ---------- botões e peças pequenas ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-md);
  font-weight: 700; white-space: nowrap; border: 2px solid transparent;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast), border-color var(--dur-fast); }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--tarja); box-shadow: var(--sticker); }
.btn-primary:hover { background: var(--primary-hover); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--tarja); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tarja); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--control-edge); }
.btn-secondary:hover { border-color: var(--text); }
.btn-danger { background: var(--danger); color: var(--on-danger); border-color: var(--tarja); box-shadow: var(--sticker); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .9rem; border-radius: var(--r-sm); }
.btn .i { width: 16px; height: 16px; }
.x { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm); color: var(--text-2); }
.x:hover { background: var(--subtle); color: var(--text); }
.ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--text-2); background: var(--surface); }
.ico:hover { color: var(--text); border-color: var(--text); }
kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: var(--r-sm); border: 1px solid var(--control-edge);
  border-bottom-width: 3px; background: var(--surface); color: var(--text); font: 700 .78rem var(--f-mono); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--r-pill); font: 700 .75rem/1.6 var(--f-mono);
  letter-spacing: 0; text-transform: none; background: var(--subtle); color: var(--text-2); }
.badge.success { background: var(--success-soft); color: var(--success-text); }
.badge.hint { background: var(--hint-soft); color: var(--warning); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-md); background: var(--subtle); border: 1px solid var(--line); }
.seg button { min-height: 38px; min-width: 44px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 700; font-size: .9rem; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- cabeçalho mínimo ---------- */
.hdr { position: sticky; top: 0; z-index: 30; height: var(--hdr-h); padding: 0 24px; background: color-mix(in srgb, var(--canvas) 90%, transparent); backdrop-filter: blur(10px); }
.hdr-in { max-width: 1440px; height: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.mark { display: grid; gap: 3px; width: 28px; flex-shrink: 0; }
.mark span { height: 5px; border-radius: 2px; background: var(--tarja); outline: 1px solid var(--tarja-outline); }
.mark span:nth-child(2) { width: 70%; background: var(--marca); outline: 0; }
.mark span:nth-child(3) { width: 85%; }
.brand-name { font: 800 1.4rem var(--f-display); letter-spacing: -.02em; white-space: nowrap; }
.hdr-actions { display: flex; gap: 8px; }

/* ---------- estrutura: histórico + página ---------- */
.shell { max-width: 1440px; margin: 0 auto; padding: 12px 24px 150px; display: grid; grid-template-columns: var(--hist-w) minmax(0, 1fr) var(--hist-w); gap: 32px; align-items: start; }
.col-hist, .col-ficha { position: sticky; top: calc(var(--hdr-h) + 12px); align-self: start; min-width: 0; }
.col-ficha.tall { position: static; } /* mais alta que a tela: rola junto com a página, sem scroll interno */
.col-ficha .facts { grid-template-columns: minmax(0, 1fr); }
.page { width: 100%; max-width: 720px; margin: 0 auto; min-width: 0; }
.card { position: relative; padding: 18px; border-radius: var(--r-lg); border: 2px solid var(--tarja-outline); background: var(--surface); box-shadow: var(--sticker); }
/* A fita é da ficha técnica, não de todo cartão. Era o padrão do .card, mas com o logo no
   cabeçalho a fita do histórico virava uma segunda faixa logo abaixo dele, na mesma coluna.
   Uma só, do lado direito. */
.ficha::before { content: ""; position: absolute; z-index: 1; top: -9px; right: 24px; width: 62px; height: 17px; border-radius: 2px;
  background: var(--pop-mint); transform: rotate(3deg); }
.card-h { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font: 700 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.card-h .i { width: 16px; height: 16px; color: var(--primary); }

/* histórico */
.hist { padding: 0; }
.hist .hist-h { border-radius: calc(var(--r-lg) - 2px) calc(var(--r-lg) - 2px) 0 0; }
.hist-body { border-radius: 0 0 calc(var(--r-lg) - 2px) calc(var(--r-lg) - 2px); overflow: hidden; }
.hist-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.hist-t { display: flex; align-items: center; gap: 8px; font: 700 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.hist-t > .i { width: 16px; height: 16px; color: var(--primary); }
.hist-t .badge { background: var(--pop-sky); color: var(--pop-ink); }
.hist-meta { font-size: .72rem; color: var(--text-3); }
.hist-sel { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 14px; background: var(--primary-soft); color: var(--primary); font-size: .85rem; font-weight: 700; }
.hist-sel strong { color: var(--text); }
.hist-sel button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--primary); }
.hist-sel button:hover { background: var(--surface); }
.hist-body { max-height: calc(100vh - var(--hdr-h) - 220px); overflow-y: auto; }
#log { width: 100%; border-collapse: collapse; font-size: .9rem; }
#log th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; text-align: left; background: var(--surface); border-bottom: 2px solid var(--line);
  font: 700 .68rem var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
#log td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
#log .r { text-align: right; font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
#log td.w { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#log tr[data-log] { cursor: pointer; }
#log tr[data-log]:hover { background: var(--subtle); }
#log tr.hit td.w { font-weight: 700; }
#log tr.hit .h { color: var(--success-text); font-weight: 700; }
#log tr.miss td { color: var(--text-3); }
#log tr.sel { background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
#log tr[data-log] .sig { cursor: pointer; } /* dentro de linha clicável, manda a linha */
.sig { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: color-mix(in srgb, var(--exp-c) 16%, var(--surface)); color: var(--exp-c-text); font: 700 1rem/1 var(--f-mono); cursor: help; }
.sig.off { background: none; color: var(--text-3); font-weight: 400; }
.gchip .c.near { background: color-mix(in srgb, var(--exp-c) 14%, var(--surface)); color: var(--exp-c-text); }
.hist-empty { display: grid; justify-items: center; gap: 4px; padding: 28px 18px 24px; text-align: center; font-size: .9rem; color: var(--text-2); }
.hist-empty b { font-family: var(--f-display); font-size: 1.05rem; color: var(--text); }
.hist-empty .tj { margin-bottom: 8px; }

/* página */
.eyebrow { display: inline-block; margin-top: 8px; padding: 3px 11px; border-radius: var(--r-pill); border: 2px solid var(--tarja-outline);
  background: var(--pop-sky); color: var(--pop-ink); box-shadow: 2px 2px 0 var(--tarja-outline); transform: rotate(-1deg);
  font: 700 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .14em; }
#title { margin: 14px 0 24px; text-align: left; font: 800 2.5rem/1.45 var(--f-display); overflow-wrap: anywhere; }
.gallery { margin-bottom: 16px; }
.shot { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-lg); border: 2px solid var(--tarja-outline); background: var(--tarja); }
.shot img { width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; pointer-events: none;
  filter: blur(var(--shot-blur, 28px)); transform: scale(1.08); }
.shot.anim img, .shot.anim ~ .thumbs img { transition: filter .5s, transform .5s; }
.thumbs { display: flex; justify-content: flex-start; gap: 8px; padding-top: 10px; }
.thumbs button { width: 72px; height: 42px; flex-shrink: 0; overflow: hidden; border-radius: var(--r-sm); border: 2px solid var(--control-edge); opacity: .75; }
.thumbs button:hover { opacity: 1; }
.thumbs button[aria-pressed="true"] { opacity: 1; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; filter: blur(calc(var(--shot-blur, 28px) / 2.5)); }
.ficha { margin-bottom: 8px; }
#fichaSlotM .ficha { margin: 0 0 8px; }
.ficha-lbl { display: flex; align-items: center; gap: 6px; margin: 20px 0 10px; font: 700 .72rem var(--f-mono); text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-2); }
.ficha-lbl span { padding: 2px 8px; border-radius: var(--r-sm); background: var(--marca); color: var(--on-marca); }
.ficha-lbl .i { color: var(--primary); }
.ficha-lbl:first-of-type { margin-top: 0; }
.ficha-lbl .i { width: 14px; height: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; max-width: 100%; padding: 3px 10px; border-radius: var(--r-pill);
  background: var(--subtle); border: 1px solid transparent; font-size: .88rem; overflow-wrap: anywhere; }
.chips .tag:nth-child(4n+1) { background: color-mix(in srgb, var(--pop-pink) var(--chip-fill), var(--surface)); border-color: color-mix(in srgb, var(--pop-pink) var(--chip-edge), transparent); }
.chips .tag:nth-child(4n+2) { background: color-mix(in srgb, var(--pop-mint) var(--chip-fill), var(--surface)); border-color: color-mix(in srgb, var(--pop-mint) var(--chip-edge), transparent); }
.chips .tag:nth-child(4n+3) { background: color-mix(in srgb, var(--pop-sky) var(--chip-fill), var(--surface)); border-color: color-mix(in srgb, var(--pop-sky) var(--chip-edge), transparent); }
.chips .tag:nth-child(4n+4) { background: color-mix(in srgb, var(--marca) var(--chip-fill), var(--surface)); border-color: color-mix(in srgb, var(--marca) var(--chip-edge), transparent); }
.tag .mode-i { display: none; width: 14px; height: 14px; color: var(--text-3); }
.icons-always .tag .mode-i, .tag.rev .mode-i { display: inline-block; }
.chips.small .tag { font-size: .8rem; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 2px; }
.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px dashed var(--line); font-size: .9rem; }
.facts dt { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; color: var(--text-2); }
.facts dt .i { width: 15px; height: 15px; }
.facts dd { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.ficha-more { display: grid; gap: 0; margin-top: 10px; padding-top: 4px; }
/* modos: chip menor e com ícone, para não virar a mesma coisa que marcador */
.chips.small .tag { background: none; border: 1px solid var(--line); }
.langs { display: flex; gap: 6px; font-size: .82rem; color: var(--text-2); overflow-wrap: anywhere; }
.langs .i { width: 15px; height: 15px; margin-top: 3px; }
.sec { margin-top: 26px; }
.sec-h { display: inline-block; margin-bottom: 14px; padding: 3px 11px; border-radius: var(--r-pill); border: 2px solid var(--tarja-outline);
  background: var(--marca); color: var(--on-marca); box-shadow: 2px 2px 0 var(--tarja-outline); transform: rotate(-1deg);
  font: 700 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .12em; }
.sec:nth-of-type(even) .sec-h { background: var(--pop-mint); transform: rotate(1deg); }
.prose { line-height: 1.8; font-size: 1.02rem; overflow-wrap: anywhere; }
.prose.lead { font-size: 1.12rem; }
#about { display: grid; gap: 14px; }
#about h3 { margin-top: 8px; font: 700 1.2rem/1.4 var(--f-display); }

/* ---------- campo: fixo embaixo, flutuando sobre tudo, altura fixa ---------- */
.foot { max-width: 720px; margin: 40px auto 0; padding: 16px 0 8px; border-top: 1px dashed var(--line); color: var(--text-3); font-size: .8rem; text-align: center; }
.bbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 104px; pointer-events: none;
  background: linear-gradient(to top, var(--canvas) 58%, color-mix(in srgb, var(--canvas) 0%, transparent)); }
.bbar-grid { max-width: 1440px; height: 100%; margin: 0 auto; padding: 0 24px calc(env(safe-area-inset-bottom) / 2); display: grid;
  grid-template-columns: var(--hist-w) minmax(0, 1fr) var(--hist-w); gap: 32px; align-items: center; }
.bbar-in { position: relative; width: 100%; max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 10px; pointer-events: auto;
  container-type: inline-size; }
.field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; height: 62px; padding: 0 7px 0 20px; border-radius: 16px;
  background: var(--surface); border: 2px solid var(--tarja-outline); box-shadow: var(--sticker), var(--shadow-2); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.field:focus-within { border-color: var(--primary); box-shadow: var(--sticker), 0 0 0 5px var(--primary-soft); }
.field.warn { border-color: var(--hint); box-shadow: var(--sticker), 0 0 0 5px var(--hint-soft); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; font-size: 1.12rem; }
.field input::placeholder { color: var(--text-3); }
.field input:disabled { color: var(--text-3); }
.field .go { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 11px; background: var(--primary); color: var(--on-primary); }
.field .go:hover { background: var(--primary-hover); }
.field .go:disabled { background: var(--subtle); color: var(--text-3); }
.field .go .i { width: 20px; height: 20px; }
.field .dup { position: absolute; right: 132px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: var(--r-pill); background: var(--hint-soft); color: var(--warning); font-size: .78rem; font-weight: 700; pointer-events: none; }
.field .dup .i { width: 14px; height: 14px; }
/* pronto = botão que leva até a lâmpada; bloqueado/esgotado = só estado, sem clique */
.hintc { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 62px; min-width: 62px; padding: 0 14px; border-radius: 16px;
  border: 2px solid var(--control-edge); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-1); transition: transform var(--dur-fast), box-shadow var(--dur-fast); }
.hintc .mono { font-weight: 700; font-size: .85rem; }
.hintc .i { width: 20px; height: 20px; color: var(--warning); }

.hintc.ready { background: var(--marca); color: var(--on-marca); border-color: var(--tarja-outline); font-weight: 700; box-shadow: var(--sticker); cursor: pointer; }
.hintc.ready:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--tarja-outline); }
.hintc.ready:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tarja-outline); }
span.hintc { cursor: default; }
.hintc.ready .i { color: var(--on-marca); animation: wiggle 2.4s ease-in-out infinite; }
.lamp-lit .hintc.ready { background: var(--primary); color: #fff; }
.lamp-lit .hintc.ready .i { color: #fff; animation: none; }
/* caminho inverso: apontar o indicador destaca as lâmpadas onde a dica é aplicada */
.hint-call .lamp { background: var(--primary); color: #fff; }
.hintc.done { opacity: .6; }
/* saída para quem empacou: mesmo tamanho do indicador de dica, para a barra não desalinhar,
   mas em tinta apagada — é escape, não recompensa. Só aparece depois de liberada. */
/* Desistir: bloqueado mostra quanto falta (mesma lógica do indicador de dica, e o mesmo motivo
   para não ser botão enquanto não responde a clique); liberado vira botão. Tinta apagada e
   contorno tracejado nos dois estados, porque é escape e não recompensa. */
.giveupc { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 62px; min-width: 62px;
  padding: 0 12px; border-radius: 16px; border: 2px dashed var(--control-edge); background: var(--surface);
  color: var(--text-3); font-size: .82rem; font-weight: 700; cursor: default;
  transition: color var(--dur-fast), border-color var(--dur-fast); }
.giveupc .i { width: 18px; height: 18px; }
.giveupc .mono { font-size: .72rem; }
.giveupc.on { cursor: pointer; animation: pop-in var(--dur-base) var(--ease-pop); }
.giveupc.on:hover, .giveupc:focus-visible { color: var(--text); border-color: var(--text-3); }
.giveupc.on:hover { border-style: solid; }
.giveupc .rot { display: none; }
/* o rótulo só entra quando a barra tem folga: espremer o campo por causa do escape seria trocar
   o controle principal pelo secundário. A medida é da barra, não da janela. */
@container (min-width: 640px) { .giveupc.on .rot { display: inline; } .giveupc.on { padding: 0 14px; } }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-4deg); } }

/* ---------- balão de contexto (hover e foco) ----------
   Explica o elemento sem nunca guardar o que é essencial para jogar: some no toque e some
   para quem não faz hover (NN/g, Tooltip Guidelines, 2019). Abre também no foco do teclado,
   que é onde o title nativo falha. O número que ele comenta continua visível no próprio chip. */
.tip { position: relative; }
.tip::before, .tip::after { opacity: 0; pointer-events: none; transition: opacity var(--dur-fast); }
.tip::after { content: attr(data-tip); position: absolute; z-index: 30; bottom: calc(100% + 13px); right: 0;
  width: max-content; max-width: min(250px, 72vw); padding: 9px 12px; border-radius: var(--r-md);
  border: 2px solid var(--tarja-outline); background: var(--tarja); color: var(--on-tarja);
  font: 400 .82rem/1.4 var(--f-body); text-align: left; white-space: normal; box-shadow: var(--shadow-2); }
/* seta: quadradinho girado, para o contorno do balão seguir nela (e aparecer no tema escuro) */
.tip::before { content: ""; position: absolute; z-index: 31; bottom: calc(100% + 8px); right: 20px;
  width: 11px; height: 11px; background: var(--tarja); transform: rotate(45deg);
  border-right: 2px solid var(--tarja-outline); border-bottom: 2px solid var(--tarja-outline); }
.tip:hover::before, .tip:hover::after { opacity: 1; transition-delay: .3s; }
.tip:focus-visible::before, .tip:focus-visible::after { opacity: 1; transition-delay: 0s; }
/* No toque não existe hover, e o balão nunca apareceria (NN/g, Tooltip Guidelines, 2019: "they can
   be used only on devices with a mouse or keyboard"). Lá ele vira o que a NN/g chama de popup tip,
   aberto no toque. O :hover é desligado de propósito: no toque ele fica "grudado" depois do tap. */
@media (hover: none) {
  .tip:hover::before, .tip:hover::after { opacity: 0; }
  .tip.tip-open::before, .tip.tip-open::after { opacity: 1; transition-delay: 0s; }
}
/* a mensagem de resultado mora na mesma faixa acima da barra: em vez de ser coberta pelo
   balão, ela sobe enquanto ele está aberto — tooltip não pode esconder o que importa. */
.bbar-in:has(.tip:hover) .toast.float, .bbar-in:has(.tip:focus-visible) .toast.float {
  transform: translate(-50%, -62px); }

/* mensagem de resultado: flutua acima do campo (não muda a altura da barra) */
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); border-left-width: 5px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); }
.toast .i { flex-shrink: 0; }
.toast b { font-weight: 700; }
.toast span { color: var(--text-2); font-size: .92rem; }
.toast.success { border-left-color: var(--success); } .toast.success .i { color: var(--success-text); }
.toast.warn { border-left-color: var(--hint); } .toast.warn .i { color: var(--warning); }
.toast.neutral { border-left-color: var(--control-edge); } .toast.neutral .i { color: var(--text-3); }
.toast.error { border-left-color: var(--danger); } .toast.error .i { color: var(--danger); }
.toast.float { position: absolute; left: 50%; bottom: calc(100% + 12px); z-index: 2; width: max-content; max-width: min(600px, 100%);
  transform: translateX(-50%); animation: rise var(--dur-base) var(--ease-pop);
  transition: transform var(--dur-base) var(--ease-pop); }
.toast.float > div { display: flex; flex-wrap: wrap; column-gap: 8px; }
@keyframes rise { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- Tari (mascote) ---------- */
/* O desenho vem do Figma (img/tari-base.svg): corpo, olhos, bochechas, pernas e sorriso.
   As outras expressões são camadas extras no mesmo sistema de coordenadas, ligadas por classe. */
.tari-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.tj { position: relative; flex-shrink: 0; }
.tj .mascot { position: relative; width: 132px; height: 114px; animation: bob 3.2s ease-in-out infinite; }
.mascot svg { width: 100%; height: 100%; display: block; overflow: visible; }
/* comemoração: desenho próprio do Figma, trocado inteiro (nada de montar expressão) */
.mascot .tari-happy { display: none; }
.mascot.happy .tari-base, .mascot.party .tari-base { display: none; }
.mascot.happy .tari-happy, .mascot.party .tari-happy { display: block; }
/* o desenho da festa é mais largo que o normal: cresce um pouco para ocupar a mesma caixa */
.tari-happy { transform: scale(1.04); }
.bar-tj .mascot { width: 84px; height: 73px; }
.m-pupil { transition: transform 80ms linear; }
.m-eye-w, .m-pupil { transform-box: fill-box; transform-origin: center; }
.m-eye-w { animation: blink 4.6s infinite; }

/* partes que só aparecem em certos estados */
.m-q, .m-bulb, .m-sparks, .m-hearts, .m-star, .m-arms,
.m-eyes-x, .m-half, .m-open, .m-frown, .m-flat { display: none; }
.mascot.think .m-q, .mascot.wow .m-bulb, .mascot.warn .m-star,
.mascot.party .m-sparks, .mascot.party .m-hearts, .mascot.wow .m-arms { display: block; }
.mascot.warn .m-eye-w, .mascot.warn .m-pupil { display: none; }
.mascot.warn .m-half { display: block; }
.mascot.sad .m-smile, .mascot.warn .m-smile, .mascot.think .m-smile { display: none; }
.mascot.sad .m-frown, .mascot.think .m-frown { display: block; }
.mascot.warn .m-flat { display: block; }
.mascot.sad .m-pupil { transform: translate(-4px, -5px) !important; }
.mascot.think .m-pupil { transform: translate(5px, -5px) !important; }
.mascot.think .m-cheek { opacity: .5; }

.tj .mascot.happy, .tj .mascot.wow { animation: hop 520ms var(--ease-pop); }
.tj .mascot.party { animation: hop 520ms var(--ease-pop) 3; }
.tj .mascot.sad { animation: shake 420ms ease-in-out; }
.tj.still .mascot { animation: none; }
.m-say { position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 3; padding: 5px 12px; border: 2px solid var(--pop-ink); border-radius: 14px 14px 14px 4px;
  background: #fff; color: var(--pop-ink); font: 700 .85rem var(--f-body); white-space: nowrap; box-shadow: 2px 2px 0 var(--pop-ink);
  opacity: 0; transform: translateY(6px) scale(.9); transition: all var(--dur-base) var(--ease-pop); pointer-events: none; }
.tj.talk .m-say { opacity: 1; transform: none; }
.bar-tj .m-say { bottom: calc(100% + 8px); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
@keyframes hop { 0% { transform: translateY(0); } 40% { transform: translateY(-16px) rotate(-6deg); } 100% { transform: translateY(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px) rotate(-3deg); } 75% { transform: translateX(5px) rotate(3deg); } }
.burst { position: absolute; top: 0; width: 8px; height: 14px; border-radius: 2px; pointer-events: none; z-index: 3; animation: burst 950ms cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes burst { from { transform: translate(0, 0) rotate(0); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }

/* ---------- tarjas ---------- */
.w.h { display: inline-block; position: relative; height: 1.25em; vertical-align: -.2em; margin: 0 .08em; border-radius: 4px; cursor: help;
  background: var(--tarja); outline: 1px solid var(--tarja-outline); outline-offset: -1px; transition: transform var(--dur-fast) var(--ease-pop); }
.w.h:hover { transform: translateY(-1px) rotate(-.6deg); }
/* Área de alcance da tarja: um ::before 3px maior que ela, invisível, com o salto do hover
   DESFEITO (a transformação inversa da de cima). Sem isso o salto tira o ponteiro de cima da
   própria tarja na borda e o hover cai e volta em loop — piscando entre o nº de letras e a
   palavra parecida. Como o alcance fica parado na tela nos dois estados, não existe mais borda
   que se mexa debaixo do ponteiro. Também alcança o tracejado do "perto", que é outline e não
   recebe ponteiro. A folga é só vertical (o salto é vertical): nas laterais ela invadiria a tarja
   vizinha, que na ficha técnica fica a poucos pixels, e roubaria o hover dos cantos.
   Se mexer no transform do :hover, mexa no inverso aqui também. */
.w.h::before { content: ""; position: absolute; inset: -3px 0; border-radius: 7px;
  transition: transform var(--dur-fast) var(--ease-pop); }
.w.h:hover::before { transform: rotate(.6deg) translateY(1px); }
.w.h::after { content: attr(data-len); position: absolute; inset: 0; display: grid; place-items: center; font: 700 .68rem var(--f-mono); color: var(--on-tarja);
  opacity: 0; transition: opacity var(--dur-fast); }
.w.h:hover::after, .w.h.peek::after { opacity: 1; }
#title .w.h { border-radius: 6px; }
.w.r { padding: 0 .1em; border-radius: 3px; overflow-wrap: anywhere; }
.w.r:not(.stop) { font-weight: 700; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--success) 55%, transparent); }
.w.r.new { background: var(--marca); color: var(--on-marca); box-shadow: 0 0 0 2px var(--marca); animation: reveal var(--dur-reveal) var(--ease-pop); }
.w.r.stop { color: var(--text-3); }
/* número e data começam à mostra: sem o risco verde (ninguém acertou) e sem o cinza de
   palavrinha de ligação — eles são pista, e pista precisa ser lida. */
.w.r.free { color: var(--text); }
.w.r.hint { text-decoration: underline wavy var(--hint) 2px; text-underline-offset: 4px; }
.w.r.hl { box-shadow: 0 0 0 2px var(--primary); }
.w.r.hl:not(.new) { background: var(--primary-soft); }
.w.r.hl.cur { box-shadow: 0 0 0 3px var(--primary); }
.w.h.exp-a { background: var(--exp-a); outline-color: var(--exp-a); }
.w.h.exp-a::after { opacity: 1; color: var(--on-marca); }
.w.h.hl { box-shadow: 0 0 0 3px var(--primary); }
.w.h.hl.cur { box-shadow: 0 0 0 4px var(--primary); }
.w.h.near { background: color-mix(in srgb, var(--exp-c) 42%, var(--tarja)); outline: 2px dotted var(--exp-c); outline-offset: 1px; }
.w.h.near .ghost { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .14em; overflow: hidden;
  padding: 0 1px; white-space: nowrap; text-overflow: ellipsis; font: italic 500 .68em var(--f-mono); color: rgba(255, 255, 255, .85); }
.w.h.near .ghost::before { content: "≈"; font-style: normal; opacity: .9; }
.w.h.near .ghost.mark-only { font-size: .62em; }
.w.h.near .ghost.mark-only::before { opacity: 1; }
.w.h.near:hover .ghost, .w.h.near.peek .ghost { opacity: 0; }
@keyframes reveal { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.debug .w.h::before { content: attr(data-t); position: absolute; inset: auto auto auto 2px; top: -2px; font-size: .7em; white-space: nowrap; color: rgba(255, 255, 255, .5); }

/* ---------- celular: faixa de chutes e gaveta ---------- */
.recent { position: sticky; top: var(--hdr-h); z-index: 20; align-items: center; gap: 8px; margin: 0 -12px 8px; padding: 6px 12px 8px;
  background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.rc-list { flex: 1; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; min-height: 48px; }
.rc-list::-webkit-scrollbar { display: none; }
.rc-empty { font-size: .85rem; color: var(--text-3); white-space: nowrap; }
.rc-all { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--control-edge); background: var(--surface); }
.rc-all .i { width: 16px; height: 16px; color: var(--primary); }
.gchip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 5px 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--control-edge); background: var(--surface); font-size: .9rem; }
.gchip .n { font: .72rem var(--f-mono); color: var(--text-3); }
.gchip .c { min-width: 26px; padding: 0 6px; border-radius: var(--r-pill); font: 700 .75rem/24px var(--f-mono); text-align: center; background: var(--subtle); color: var(--text-3); }
.gchip.hit .c.h { background: var(--success-soft); color: var(--success-text); }
.gchip .c.b { background: color-mix(in srgb, var(--exp-b) 14%, var(--surface)); color: var(--exp-b-text); }
.gchip .c.sem { background: color-mix(in srgb, var(--exp-c) 14%, var(--surface)); color: var(--exp-c-text); }
.gchip[aria-pressed="true"] { border: 2px solid var(--primary); background: var(--primary-soft); }
.scrim { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; background: rgba(13, 15, 30, .45); animation: fade var(--dur-base); }
.sheet { max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px 20px 0 0; background: var(--surface); border-top: 2px solid var(--tarja-outline);
  box-shadow: var(--shadow-2); transition: transform var(--dur-base); touch-action: none; }
.grab { width: 40px; height: 5px; margin: 10px auto 2px; border-radius: 3px; background: var(--line-strong); cursor: grab; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 8px 16px; }
.sheet-t { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.sheet-t .i { color: var(--primary); }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 12px 16px; touch-action: pan-y; }
.sheet-body .card { box-shadow: none; }
.sheet-body .hist-body { max-height: none; overflow: visible; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- janelas (cobrem a página inteira) ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(13, 15, 30, .5); animation: fade var(--dur-base); overflow-y: auto; }
.modal { width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg);
  border: 2px solid var(--tarja-outline); background: var(--surface); box-shadow: var(--sticker), var(--shadow-2); animation: pop-in var(--dur-base) var(--ease-pop); }
@keyframes pop-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.narrow { max-width: 440px; } .modal.xwide { max-width: 640px; }
/* regras: 560px deixa a linha em torno de 70 caracteres, dentro da faixa confortável de leitura,
   e derruba a altura da coluna, que é o que fazia a janela parecer um paredão */
.modal.rules-w { max-width: 560px; }
.mh { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 10px 12px 18px; border-bottom: 1px solid var(--line); }
.mh h2 { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; }
.mb { padding: 16px 18px; overflow-y: auto; color: var(--text-2); }
.mf { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 18px; background: var(--subtle); }
.msub { margin-bottom: 12px; font-size: .92rem; }
/* ---------- lâmpadas de dica (aparecem só quando há dica pronta) ---------- */
.lamp { display: inline-grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0; margin-left: 6px; border-radius: 50%;
  border: 2px solid #14172B; background: var(--marca); color: var(--on-marca); vertical-align: middle;
  box-shadow: 2px 2px 0 #14172B; animation: pop-in var(--dur-base) var(--ease-pop); }
.lamp .i { width: 15px; height: 15px; }

.lamp:hover, .lamp:focus-visible { background: var(--primary); color: #fff; transform: translate(-1px, -1px); box-shadow: 3px 3px 0 #14172B; }
.lamp:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 #14172B; }
/* resposta ao clique no contador: a lâmpada alvo pisca, mesmo já estando à vista */
.lamp.ping { animation: lampPing 700ms ease-out 2; }
@keyframes lampPing { 0% { box-shadow: 2px 2px 0 #14172B, 0 0 0 0 color-mix(in srgb, var(--primary) 70%, transparent); }
  60% { box-shadow: 2px 2px 0 #14172B, 0 0 0 12px transparent; transform: scale(1.18); }
  100% { box-shadow: 2px 2px 0 #14172B, 0 0 0 0 transparent; } }
.tag .lamp { width: 22px; height: 22px; margin: 0 -4px 0 2px; }
.tag .lamp .i { width: 13px; height: 13px; }
.facts .lamp { margin-left: 8px; }
.sec-h .lamp, .langs .lamp { vertical-align: -6px; }
.lamp-slot { position: absolute; right: 10px; top: 10px; }
.lamp-slot .lamp { width: 36px; height: 36px; margin: 0; box-shadow: 3px 3px 0 #14172B, var(--shadow-2); }
.lamp-slot .lamp .i { width: 20px; height: 20px; }
@media (min-width: 1024px) { .lamp-slot .lamp { width: 44px; height: 44px; } }

/* ---------- onboarding: um destaque por vez, sem travar a página ---------- */
.tour { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(13, 15, 30, .55), 0 0 0 3px var(--primary); }
/* abertura: fala do jogo inteiro, não de um controle. Sem alvo para recortar, a camada toda
   escurece (o mesmo véu do recorte) e o cartão vai para o meio da tela. */
.tour.center { background: rgba(13, 15, 30, .55); }
.tour { animation: fade var(--dur-base); }
.tour-tip { position: fixed; left: 0; top: 0; display: flex; align-items: flex-end; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: auto; }
.tour-tip .tour-b { flex: 1; min-width: 0; padding: 14px 16px; border-radius: var(--r-lg); border: 2px solid var(--tarja-outline); background: var(--surface);
  box-shadow: var(--shadow-2); color: var(--text); font-size: .94rem; }
.tour-tip p { margin-bottom: 12px; }
.tour-a { display: flex; align-items: center; gap: 10px; }
.tour-dots { display: flex; gap: 5px; margin-right: auto; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.tour-dots i.seen { background: var(--text-3); }
.tour-dots i.on { width: 18px; border-radius: var(--r-pill); background: var(--primary); }
.tour-skip { min-height: 44px; padding: 0 6px; white-space: nowrap; color: var(--text-3); font-size: .88rem; text-decoration: underline; }
.tour-skip:hover { color: var(--text); }
.tour-tj { display: none; }
/* com o tour aberto, quem fala é o tour: a Tarjinha da barra fica quieta */
.tour-on .bar-tj .m-say { display: none; }

/* abas da janela de regras: o que está na segunda é suplementar (NN/g, Tabs, Used Right, 2024),
   então quem só quer jogar não precisa tocar nelas */
.tabs { display: flex; gap: 4px; margin-bottom: 18px; padding-bottom: 2px; border-bottom: 2px solid var(--line); }
.tabs button { position: relative; min-height: 40px; padding: 0 14px; color: var(--text-3); font-weight: 700; font-size: .95rem; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--primary); }
/* demonstração jogável da janela de regras: a frase reage à tentativa como a página reage */
.demo { padding: 12px 14px; border-radius: var(--r-md); background: var(--subtle); border: 1px solid var(--line); }
.demo-frase { font-size: .94rem; line-height: 1.9; color: var(--text); }
.demo-form { display: flex; gap: 8px; margin-top: 10px; }
.demo-form input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: var(--r-md);
  border: 2px solid var(--control-edge); background: var(--surface); color: var(--text); font-size: .92rem; }
.demo-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.demo-form input::placeholder { color: var(--text-3); }
.demo-form .btn { flex-shrink: 0; min-height: 40px; }
.demo-form .btn .i { width: 16px; height: 16px; }
.demo-msg { margin-top: 8px; color: var(--text-3); font-size: .84rem; min-height: 1.2em; }
.demo-msg.ok { color: var(--success-text); }
.demo-msg.no { color: var(--text-2); }
#giveUpSlotM:empty { display: none; }
/* no topo o balão abre para baixo: para cima ele sairia da tela */
#giveUpSlotM .tip::after { top: calc(100% + 13px); bottom: auto; }
#giveUpSlotM .tip::before { top: calc(100% + 8px); bottom: auto; border: 0;
  border-left: 2px solid var(--tarja-outline); border-top: 2px solid var(--tarja-outline); }
#giveUpSlotM .giveupc { height: 38px; min-width: 38px; gap: 5px; padding: 0 10px; border-radius: 11px; font-size: .78rem; }
#giveUpSlotM .giveupc .i { width: 15px; height: 15px; }
#giveUpSlotM .giveupc .mono { font-size: .68rem; }
.rule-tip + .rule-tip { margin-top: 16px; }
/* o rótulo em caixa alta serve para etiqueta curta ("COMO LER AS TARJAS"), não para título de
   dica com seis palavras: aqui o texto é frase, e frase se lê em caixa normal */
.rules .rule-tip h3 { margin-bottom: 4px; font: 700 1rem var(--f-body); text-transform: none;
  letter-spacing: 0; color: var(--text); }
.rule-tip p { color: var(--text-2); font-size: .94rem; }
.rules-more p + p { margin-top: 10px; }
.rules-goal { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.rules-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); font-size: .96rem; }
.rules-list li::marker { color: var(--primary); }
.rules-more { padding-top: 14px; border-top: 1px dashed var(--line); color: var(--text-3); font-size: .88rem; line-height: 1.7; }
/* lista de dias anteriores */
/* ---------- estante: um cartão por jogo, tarjado até você vencer ---------- */
.modal.shelf { max-width: 780px; }
.shelf-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.shelf-bar { flex: 1; display: grid; gap: 6px; min-width: 0; }
.shelf-prog { height: 10px; border-radius: var(--r-pill); background: var(--subtle); border: 1px solid var(--line); overflow: hidden; }
.shelf-prog span { display: block; height: 100%; background: var(--success); transition: width var(--dur-base) var(--ease-pop); }
.shelf-count { font-size: .78rem; color: var(--text-2); }
.shelf-rnd { flex-shrink: 0; }

.day-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.gcard { display: grid; align-content: start; gap: 6px; padding: 0 0 10px; overflow: hidden; border-radius: var(--r-md);
  border: 2px solid var(--control-edge); background: var(--surface); color: var(--text); text-align: left;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast), border-color var(--dur-fast); }
.gcard:hover, .gcard:focus-visible { border-color: var(--tarja-outline); transform: translate(-1px, -1px); box-shadow: var(--sticker); }
.gcard.on { border-color: var(--primary); background: var(--primary-soft); }
.gcard-art { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--tarja); overflow: hidden; }
.gcard-img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* cartão ainda escondido: a screenshot desfocada, como a página começa */
.gcard.todo .gcard-img { filter: blur(7px) saturate(.55) brightness(.6); transform: scale(1.2); }
.gcard-veil { position: absolute; inset: 0; background: rgba(20, 23, 43, .35); }
.gcard-n { position: absolute; left: 8px; top: 8px; padding: 2px 7px; border-radius: var(--r-sm);
  background: rgba(20, 23, 43, .72); color: #fff; font-size: .74rem; font-weight: 700; }
.gcard-flag { position: absolute; right: 8px; top: 8px; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--marca); color: var(--on-marca); font: 700 .7rem/1.6 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; }
.gcard-check { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--marca); color: var(--on-marca); border: 2px solid var(--tarja); }
.gcard-check .i { width: 13px; height: 13px; }
.gcard-name { padding: 0 10px; font-weight: 700; font-size: .92rem; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.3em; }
.gcard-bar { display: inline-block; width: 78%; height: 1.05em; border-radius: 3px; background: var(--tarja); vertical-align: -.2em; }
.gcard-meta { padding: 0 10px; font-size: .72rem; color: var(--text-3); }
.gcard.won .gcard-meta { color: var(--success-text); }
/* viu a resposta: revelado, mas não conquistado — fica sem cor, não conta na estante */
.gcard.gaveup .gcard-name { color: var(--text-2); }
.gcard.gaveup .gcard-img { filter: grayscale(.6) brightness(.8); }
.gcard.on .gcard-meta { color: var(--primary); }
.gcard.today .gcard-art { background: linear-gradient(140deg, var(--tarja), #2A2450); }
.win-today { margin-left: 10px; background: var(--marca); color: var(--on-marca); border-color: #14172B; box-shadow: 2px 2px 0 #14172B; }
.set-note { color: var(--text-3); font-size: .82rem; text-align: right; max-width: 55%; }
/* linha de configuração em duas alturas: para quando a explicação não cabe ao lado do rótulo */
.set-row.stack { display: grid; gap: 4px; }
.set-row.stack .set-note { max-width: none; text-align: left; }
.set-list { display: grid; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.set-row:last-child { border-bottom: 0; }
.rules { display: grid; gap: 14px; }
.rules ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text); }
.rules h3 { margin-bottom: 8px; font: 700 .75rem var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }
.legend { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; align-items: center; color: var(--text); font-size: .92rem; }
.keys { display: grid; }
.keys div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.keys div:last-child { border-bottom: 0; }

/* ---------- vitória ---------- */
.win { position: relative; display: grid; gap: 14px; margin: 8px 0 12px; padding: 22px; overflow: hidden;
  border-radius: var(--r-lg); border: 2px solid #14172B; background: var(--marca); color: var(--on-marca); box-shadow: var(--sticker); }
.win > :not(.confetti) { position: relative; z-index: 1; }
.win .trophy { display: grid; place-items: center; flex-shrink: 0; margin-top: 9px; width: 52px; height: 52px; border-radius: var(--r-md); background: #14172B; color: var(--marca); transform: rotate(-6deg); }
.win .trophy .i { width: 30px; height: 30px; }
.win .eyebrow { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; transform: none; color: var(--on-marca); }
.win h2 { font-size: 1.7rem; }
.win h2, .win p, .win .eyebrow { text-shadow: 0 0 2px var(--marca), 0 0 2px var(--marca), 0 0 5px var(--marca), 0 0 8px var(--marca); }
/* topo: troféu + texto + Tarjinha na ponta; ações numa linha própria, alinhadas ao texto */
.win-top { display: flex; align-items: flex-start; gap: 16px; }
.win-txt { flex: 1; min-width: 0; }
.win-tj { flex-shrink: 0; margin: 6px 10px 0 auto; }
.win-tj .mascot { width: 138px; height: 119px; }
/* com quatro ações (incluindo a chamada da estante) a linha quebra em vez de estourar o cartão */
.win-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.win-acts .btn { white-space: nowrap; padding: 0 12px; }
@media (max-width: 639px) {
  /* no celular cada ação ocupa uma linha inteira: lado a lado elas ficam apertadas */
  .win-acts { flex-wrap: wrap; }
  .win-acts .btn { width: 100%; justify-content: center; }
}
/* contador numa linha própria, em tinta sólida: sobre o amarelo precisa de contraste alto */
.win-next { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--r-pill);
  background: #14172B; color: var(--marca); font-size: .88rem; font-weight: 700; }
.win-next .i { width: 16px; height: 16px; }
.win-next .mono { color: #fff; }
/* desistiu: o mesmo banner, sem festa — a resposta em tinta neutra, sem confete nem troféu */
.win.gaveup { background: var(--surface); color: var(--text); border-color: var(--tarja-outline); }
.win.gaveup h2, .win.gaveup p { text-shadow: none; color: var(--text); }
.win.gaveup .eyebrow { text-shadow: none; color: var(--text-3); }
.win.gaveup .trophy { background: var(--subtle); color: var(--text-2); transform: none; }
.win.gaveup .btn-secondary { background: var(--surface); color: var(--text); border-color: var(--control-edge); }

/* depois de "continuar jogando" o banner encolhe, mas a festa continua lá */
.win.slim { padding: 14px 18px; }
.win.slim h2 { font-size: 1.3rem; }
.win.slim .trophy { margin-top: 6px; width: 42px; height: 42px; }
.win.slim .trophy .i { width: 22px; height: 22px; }
.win.slim .win-tj { margin: 2px 6px 0 auto; }
.win.slim .win-tj .mascot { width: 104px; height: 90px; }
.win .btn-secondary { background: #fff; color: #14172B; border-color: #14172B; }
.win .btn-primary { background: #3440E8; color: #fff; border-color: #14172B; box-shadow: 3px 3px 0 #14172B; }
.win .btn-ghost { color: #14172B; text-decoration: underline; text-underline-offset: 3px; }
.win .btn-ghost:hover { background: rgba(20, 23, 43, .08); }
.win .tj .m-say { bottom: auto; top: -2px; left: calc(100% + 10px); }
.win .confetti { position: absolute; z-index: 0; width: 12px; height: 22px; border-radius: 3px; outline: 2px solid #14172B; opacity: .9;
  transform: rotate(var(--r)); animation: sway var(--d) ease-in-out infinite; }
.win .confetti.c { width: 14px; height: 14px; border-radius: 50%; }
/* estrelinha e coração de 4 pontas, o mesmo vocabulário da ilustração */
.win .confetti.st, .win .confetti.ht { width: 20px; height: 20px; border-radius: 0; outline: 0; }
.win .confetti.st { clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%); }
.win .confetti.ht { clip-path: path('M10 18S1.6 12.7 1.6 7.2A4.6 4.6 0 0 1 10 4.6 4.6 4.6 0 0 1 18.4 7.2C18.4 12.7 10 18 10 18z'); }
.burst.st { width: 12px; height: 12px; border-radius: 0; clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%); }
@keyframes sway { 0%, 100% { transform: translateY(0) rotate(var(--r)); } 50% { transform: translateY(-6px) rotate(calc(var(--r) + 25deg)); } }

/* ---------- responsivo ---------- */
@media (max-width: 1279px) {
  :root { --hist-w: 260px; }
  .shell, .bbar-grid { gap: 20px; }
}
@media (max-width: 1023px) {
  :root { --hdr-h: 56px; }
  .m-only { display: flex !important; }
  .hdr { padding: 0 12px; }
  .brand-name { font-size: 1.2rem; }
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 12px 130px; }
  .col-hist, .col-ficha { display: none; }
  .bbar { height: 92px; }
  .bbar-grid { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 10px; }
  .bbar-spacer { display: none; }
  #title { font-size: 2rem; }
  .win .confetti:nth-child(n+7) { display: none; }
  .win .confetti { top: 3% !important; }
  .win-tj { display: none; }
}
@media (max-width: 400px) {
  /* com o Voltar, quatro itens não cabem na linha de ações de um celular estreito: os pontos
     sobem para a própria linha em vez de espremer os botões */
  .tour-a { flex-wrap: wrap; justify-content: flex-end; }
  .tour-dots { flex-basis: 100%; margin: 0 0 10px; }
}
@media (max-width: 639px) {
  .bar-tj { display: none; } /* sem espaço: o campo vem primeiro; a fala da Tarjinha já está na mensagem */
  .field { height: 56px; padding-left: 14px; border-radius: 14px; }
  .field input { font-size: 1rem; }
  .field .go { width: 42px; height: 42px; }
  .field .dup { right: 56px; }
  .hintc { height: 56px; min-width: 56px; padding: 0 8px; border-radius: 14px; }
  .hintc span:not(.mono):not(.sr-only) { display: none; }
  .giveupc { height: 56px; min-width: 56px; border-radius: 14px; }
  .toast.float { max-width: calc(100vw - 20px); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  #title { font-size: 1.7rem; }
  .win h2 { font-size: 1.4rem; }
  .win .tj { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .burst { display: none; }
}
#sheetBody .hist-t { display: none; } /* a gaveta já tem título */
