/* =====================================================================
   Inkwell — tokens + base + components (tema Noite) · v2 · 2026-10-20
   Arquivo único. Carregue ANTES do <style> de cada página.
   Mudanças em relação à v1: ver CHANGES.md. Nomes de classes e variáveis
   da v1 foram mantidos; aliases legados continuam no fim do bloco :root.
   Breakpoints permitidos: ≤760px (celular), ≤480px (celular compacto).
   ===================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Epilogue:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* ---------- 1. Tokens ---------- */
:root,
html[data-theme="noite"] {
  /* superfícies (escuro → claro = mais à frente) */
  --bg:         #13102a;
  --surface-1:  #1e1a3b;
  --surface-2:  #2a2552;
  --surface-3:  #352f60;
  --field:      #0f0c22;
  --bar:        rgba(19,16,42,.82);
  --scrim:      rgba(8,6,20,.66);

  /* linhas */
  --line:        #352f60;
  --line-soft:   rgba(255,255,255,.06);  /* NOVO: borda-luz de cartões e barras */
  --line-strong: #6a63a3;

  /* texto */
  --text:   #f5f1fb;
  --text-2: #aaa3cc;
  --text-3: #9690c2;

  /* destaque = a ÚNICA cor de ação */
  --accent:       #ecc061;
  --accent-hover: #f3cd78;
  --accent-press: #d9a93f;
  --on-accent:    #241a04;
  --accent-soft:  rgba(236,192,97,.14);
  --accent-ink:   var(--accent);         /* gold used as TEXT (links, labels); dark amber in the light theme */
  --accent-ink-hover: var(--accent-hover);
  --hover-tint:   rgba(255,255,255,.05); /* hover wash on ghost controls */

  /* valor (dinheiro em destaque), nunca ação */
  --money: #f3d27a;

  /* foil: brilho iridescente, decorativo (NOVO; antes usava --accent-soft) */
  --foil: linear-gradient(115deg, #c9a8ff 0%, #9fc3ff 45%, #9fe6c4 100%);
  --foil-soft: rgba(159,195,255,.12);

  /* status */
  --win:  #6fd3a3;  --win-soft:  rgba(111,211,163,.14);
  --loss: #f38b8b;  --loss-soft: rgba(243,139,139,.14);
  --warn: #f0a35e;  --warn-soft: rgba(240,163,94,.14);
  --info: #8fb8ff;  --info-soft: rgba(143,184,255,.12);
  --opp:  #9aaeff;

  /* tintas */
  --ink-amber:    #f2b33d;
  --ink-amethyst: #a77ee0;
  --ink-emerald:  #47b57c;
  --ink-ruby:     #e25866;
  --ink-sapphire: #4a9be0;
  --ink-steel:    #9aa8b5;

  /* tipografia */
  --font:    "Plus Jakarta Sans", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --display: "Epilogue", "Plus Jakarta Sans", system-ui, sans-serif;
  --fs-hero:    2.75rem;   /* 44 · NOVO: o número que importa (placar, valor total) */
  --fs-display: 2rem;      /* 32 */
  --fs-h1:      1.5rem;    /* 24 celular */
  --fs-h1-desk: 1.75rem;   /* 28 · NOVO: H1 no computador */
  --fs-h2:      1.125rem;
  --fs-h3:      1rem;
  --fs-body:    0.9375rem;
  --fs-small:   0.8125rem;
  --fs-micro:   0.75rem;
  --fs-stat:    1.625rem;
  --stretch-num: 88%;      /* NOVO: números grandes levemente condensados (eixo wdth) */

  /* espaço (4-pt) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px; --sp-12: 48px;

  /* raios */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 22px; --r-pill: 999px;

  /* elevação */
  --e1: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 1px var(--line-soft), 0 10px 30px rgba(5,3,20,.32);
  --e2: 0 0 0 1px var(--line-soft), 0 16px 40px rgba(5,3,20,.50);
  --e3: 0 0 0 1px var(--line-soft), 0 24px 64px rgba(5,3,20,.62);
  --glow: 0 6px 20px rgba(236,192,97,.20);   /* NOVO: sombra do botão primário */

  /* movimento */
  --ease: cubic-bezier(.2,.8,.2,1);
  --ease-out: cubic-bezier(.16,1,.3,1);      /* NOVO: entrada de folhas */
  --t-fast: 120ms; --t-med: 180ms; --t-slow: 240ms; --t-sheet: 320ms;

  /* foco */
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  /* layout */
  --page-max: 1040px;
  --form-max: 720px;
  --tap: 44px;
  --bar-h: 60px;      /* NOVO */
  --tabbar-h: 64px;   /* NOVO */

  /* aliases legados — remover após migração */
  --night: var(--bg); --panel: var(--surface-1); --raised: var(--surface-2);
  --muted: var(--text-2); --faint: var(--text-3);
  --gold: var(--accent); --gold-ink: var(--on-accent);
  --amber: var(--ink-amber); --amethyst: var(--ink-amethyst); --emerald: var(--ink-emerald);
  --ruby: var(--ink-ruby); --sapphire: var(--ink-sapphire); --steel: var(--ink-steel);
  --radius: var(--r-lg); --shadow: var(--e1);
  --bg-art: radial-gradient(900px 420px at 88% -12%, rgba(236,192,97,.07), transparent 62%),
            radial-gradient(800px 520px at -8% 4%, rgba(155,106,209,.13), transparent 62%),
            radial-gradient(1200px 600px at 50% 120%, rgba(74,155,224,.05), transparent 60%);
  color-scheme: dark;
}


/* ---------- 1b. Tema Dia — "The Great Illuminary" (padrão desde 26/10/2026) ----------
   Fundo claro, cartões brancos, barra azul-noite e destaques dourados. Noite continua como opção. */
html[data-theme="dia"] {
  --bg:         #f5f7fb;
  --surface-1:  #ffffff;
  --surface-2:  #f0f3fa;
  --surface-3:  #e4eaf5;
  --field:      #ffffff;
  --bar:        rgba(11,25,44,.97);
  --scrim:      rgba(11,25,44,.58);
  --line:        #dfe5ee;
  --line-soft:   rgba(11,25,44,.07);
  --line-strong: #b9c2d0;
  --text:   #111c2c;
  --text-2: #4a5568;
  --text-3: #5f6b7c;
  --accent:       #e8c36a;
  --accent-hover: #f0d28a;
  --accent-press: #cfa847;
  --on-accent:    #1c1404;
  --accent-soft:  rgba(232,195,106,.20);
  --accent-ink:   #7e5700;
  --accent-ink-hover: #5f4100;
  --hover-tint:   rgba(11,25,44,.05);
  --money: #7e5700;
  --foil-soft: rgba(84,120,200,.10);
  --win:  #0f7a4f;  --win-soft:  rgba(15,122,79,.10);
  --loss: #b42335;  --loss-soft: rgba(180,35,53,.09);
  --warn: #9a4d00;  --warn-soft: rgba(217,119,6,.12);
  --info: #1e5aa8;  --info-soft: rgba(30,90,168,.09);
  --opp:  #3b5bcc;
  --ink-amber:    #d48a06;
  --ink-amethyst: #7e3fc8;
  --ink-emerald:  #059669;
  --ink-ruby:     #dc2626;
  --ink-sapphire: #0284c7;
  --ink-steel:    #5b6b80;
  --r-lg: 20px; --r-xl: 28px;
  --e1: 0 0 0 1px rgba(226,232,240,.9), 0 2px 8px -2px rgba(11,25,44,.07), 0 1px 3px rgba(11,25,44,.05);
  --e2: 0 0 0 1px rgba(226,232,240,.9), 0 10px 24px -4px rgba(11,25,44,.10), 0 4px 8px -2px rgba(11,25,44,.05);
  --e3: 0 20px 32px -8px rgba(11,25,44,.24);
  --glow: 0 4px 14px rgba(207,168,71,.30);
  --focus: 0 0 0 2px #fff, 0 0 0 5px #1e3e62;
  --bg-art: radial-gradient(900px 420px at 88% -12%, rgba(232,195,106,.10), transparent 62%),
            radial-gradient(800px 520px at -8% 4%, rgba(30,62,98,.06), transparent 62%);
  color-scheme: light;
}
/* the bar stays midnight navy in the light theme: its own light-on-dark text */
html[data-theme="dia"] .appbar { --surface-1: #13243d; --surface-3: #1b3152; --line-strong: rgba(255,255,255,.28); --text: #ffffff; --text-2: #c9d4e6; --text-3: #aab8cf; --surface-2: #1e3e62; --line-soft: rgba(255,255,255,.08); --hover-tint: rgba(255,255,255,.07);
  --accent-ink: #e8c36a; --accent-ink-hover: #f3d484; --focus: 0 0 0 2px #0b192c, 0 0 0 4px #e8c36a; color-scheme: dark; }
html[data-theme="dia"] .appbar .menu { --text: #111c2c; --text-2: #4a5568; --text-3: #5f6b7c; --surface-1: #ffffff; --surface-2: #ffffff; --surface-3: #e4eaf5; --field: #ffffff; --line: #dfe5ee; --line-strong: rgba(11,25,44,.28); --line-soft: rgba(11,25,44,.07); --hover-tint: rgba(11,25,44,.05);
  --accent-ink: #7e5700; --accent-ink-hover: #5f4100; --focus: 0 0 0 2px #fff, 0 0 0 5px #1e3e62; color-scheme: light; }

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg) var(--bg-art) no-repeat fixed; color: var(--text);
  font: 400 var(--fs-body)/1.45 var(--font); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink-hover); }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-h1); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); font-weight: 700; line-height: 1.3; letter-spacing: -0.005em; }
h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.35; }
p { margin: 0 0 var(--sp-2); text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
::selection { background: rgba(236,192,97,.28); }
@media (min-width: 761px) { h1 { font-size: var(--fs-h1-desk); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; } }

.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: var(--fs-small); line-height: 1.4; }
.micro { font-size: var(--fs-micro); line-height: 1.3; }
.strong { font-weight: 600; color: var(--text); }
.num, .money, .score { font-variant-numeric: tabular-nums; }
.money { white-space: nowrap; }
.money.value { color: var(--money); font-weight: 700; }
.good, .win { color: var(--win); } .bad, .loss { color: var(--loss); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero-num { font-size: var(--fs-hero); font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-stretch: var(--stretch-num); font-variant-numeric: tabular-nums; }
.display { font-size: var(--fs-display); font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; font-stretch: var(--stretch-num); font-variant-numeric: tabular-nums; }
.dot-sep::before { content: "·"; margin: 0 6px; color: var(--text-3); }

/* ---------- 3. Layout ---------- */
.page { max-width: var(--page-max); margin: 0 auto; padding: var(--sp-4) var(--sp-4) var(--sp-12); }
.page.split { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: var(--sp-6); align-items: start; }
.page.split > .page-head { grid-column: 1 / -1; }
.page.split > aside { position: sticky; top: calc(var(--bar-h) + var(--sp-4)); display: grid; gap: var(--sp-3); }
.page.narrow > * { max-width: var(--form-max); }
/* lista/detalhe (Jogos): duas colunas com rolagem independente */
.page.ld { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: var(--sp-6); align-items: start; }
.page.ld > .pane { position: sticky; top: calc(var(--bar-h) + var(--sp-4)); max-height: calc(100vh - var(--bar-h) - var(--sp-8)); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; padding: 2px 4px var(--sp-4) 2px; margin: -2px -4px 0 -2px; }
.page.ld > .detail { min-width: 0; }
.cols-2-1 { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr); gap: var(--sp-4); align-items: start; }
.stack { display: grid; gap: var(--sp-3); }
.stack.lg { gap: var(--sp-4); }
.row { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
@media (max-width: 760px) {
  .page { padding-bottom: calc(var(--tabbar-h) + var(--sp-8) + env(safe-area-inset-bottom, 0px)); }
  .page.split, .page.ld, .cols-2-1 { grid-template-columns: minmax(0,1fr); }
  .page.split > aside, .page.ld > .pane { position: static; max-height: none; overflow: visible; margin: 0; padding: 0; }
}

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3) var(--sp-4); flex-wrap: wrap; margin: var(--sp-4) 0 var(--sp-5); }
.page-head > div:first-child { min-width: 0; }
.page-head .sub { color: var(--text-2); font-size: var(--fs-small); margin-top: 4px; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
@media (max-width: 760px) { .page-head { margin-top: var(--sp-2); } .page-head .actions { width: 100%; } .page-head .actions .btn { flex: 1 1 auto; } .page-head .actions .btn.icon { flex: none; } }
.back { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; margin-bottom: 2px; color: var(--text-2); text-decoration: none; font-size: var(--fs-small); font-weight: 600; }
.back::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: url(assets/icons/chevron-left.svg) center/contain no-repeat; mask: url(assets/icons/chevron-left.svg) center/contain no-repeat; }
.back:hover { color: var(--text); }
@media (max-width: 760px) { .back { min-height: var(--tap); margin: -6px 0 -4px; } }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); margin: var(--sp-8) 0 var(--sp-3); }
.section-title:first-child { margin-top: 0; }
.section-title .small { color: var(--text-2); }

/* ---------- 4. Shell: barra superior, abas do celular, menu ---------- */
.appbar { position: sticky; top: 0; z-index: 40; height: var(--bar-h); background: var(--bar);
  -webkit-backdrop-filter: saturate(140%) blur(16px); backdrop-filter: saturate(140%) blur(16px); border-bottom: 1px solid var(--line-soft); }
.appbar-in { position: relative; max-width: var(--page-max); height: 100%; margin: 0 auto; padding: 0 var(--sp-4); display: flex; align-items: center; gap: var(--sp-5); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.02em; }
.brand img { width: 26px; height: 26px; }
.brand:hover { color: var(--text); }
/* the coin and the name never shrink under the first section link (they used to overlap "Início" on tablets) */
.appbar .brand { flex: none; }
.sections { display: flex; gap: 2px; }
.sections a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: var(--r-pill); color: var(--text-2); text-decoration: none; font-weight: 600; font-size: var(--fs-body);
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease); }
.sections a .ic { width: 18px; height: 18px; }
.sections a:hover { color: var(--text); background: var(--hover-tint); }
.sections a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }
.appbar .end { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); position: relative; }
.av-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; }
.av-btn .av { width: 32px; height: 32px; font-size: .85rem; box-shadow: 0 0 0 1px var(--line-strong); transition: box-shadow var(--t-med) var(--ease); }
.av-btn:hover .av, .av-btn[aria-expanded="true"] .av { box-shadow: 0 0 0 2px var(--text-2); }
.av-btn:focus-visible { border-radius: 50%; }
.av-btn { position: relative; }
.av-btn .iw-badge { position: absolute; top: -2px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; box-shadow: 0 0 0 2px var(--bar, var(--bg)); }
.av-btn .iw-badge[hidden] { display: none; }
@media (max-width: 360px) { .av-btn .iw-badge { right: -2px; } }   /* the avatar sits at the screen edge: keep the count inside it */

.tabbar { display: none; }
/* between phone and wide desktop the bar's links and buttons need less room, or the page scrolls sideways */
@media (min-width: 761px) and (max-width: 979px) { .appbar-in { gap: var(--sp-3); } .sections a { padding: 0 8px; } .sections a .ic { display: none; } .appbar .counter-btn span { display: none; } }
@media (max-width: 760px) {
  .appbar-in { gap: var(--sp-2); padding-right: var(--sp-2); }
  .sections { display: none; }
  .appbar .counter-btn { width: var(--tap); padding: 0; }
  .appbar .counter-btn span { display: none; }
  .av-btn { width: var(--tap); height: var(--tap); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding: 0 var(--sp-1) env(safe-area-inset-bottom, 0px);
    background: var(--bar); -webkit-backdrop-filter: saturate(140%) blur(16px); backdrop-filter: saturate(140%) blur(16px); border-top: 1px solid var(--line-soft); }
  .tabbar .tab-more { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
  .tabbar a, .tabbar .tab-more { position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: var(--tap);
    color: var(--text-2); text-decoration: none; font-size: 11px; font-weight: 600; letter-spacing: .01em; }
  .tabbar a .ic, .tabbar .tab-more .ic { width: 22px; height: 22px; }
  .tabbar a i.pip, .tabbar .tab-more i.pip { display: grid; place-items: center; width: 52px; height: 28px; border-radius: var(--r-pill); transition: background var(--t-med) var(--ease); }
  .tabbar [aria-current="page"] { color: var(--accent-ink); }
  .tabbar [aria-current="page"] i.pip { background: var(--accent-soft); }
  .tabbar .count { position: absolute; top: 4px; left: calc(50% + 8px); }
}

/* menu suspenso (conta, aparência, ⋯) */
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 300px; padding: var(--sp-2);
  background: var(--surface-2); border-radius: var(--r-lg); box-shadow: var(--e2); animation: iw-pop var(--t-med) var(--ease-out); transform-origin: top right; }
.menu.sm { width: 220px; }
.menu-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-3); }
.menu-head .t { min-width: 0; }
.menu-head b { display: block; font-weight: 700; }
.menu-head .small { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--tap); padding: 0 var(--sp-3); border: 0; border-radius: var(--r-md);
  background: none; color: var(--text); text-align: left; text-decoration: none; font-weight: 600; font-size: var(--fs-body); }
.menu-item .ic { color: var(--text-2); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); color: var(--text); box-shadow: none; }
.menu-item .trail { margin-left: auto; padding-left: var(--sp-2); color: var(--text-2); font-weight: 400; font-size: var(--fs-small); white-space: nowrap; }
.menu-item.danger { color: var(--loss); } .menu-item.danger .ic { color: var(--loss); }
.menu-sep { height: 1px; margin: 6px var(--sp-2); background: var(--surface-3); }
.menu-label { padding: var(--sp-2) var(--sp-3) 4px; color: var(--text-2); font-size: var(--fs-micro); font-weight: 600; }
.menu .seg { margin: 0 var(--sp-2) var(--sp-2); }
.menu .seg.block { width: auto; }   /* 100% plus the side margins went past the menu edge */
.menu .seg button[aria-pressed="true"] { background: var(--surface-1); color: var(--text); box-shadow: 0 0 0 1px var(--line-strong), 0 1px 2px rgba(0,0,0,.12); }
@media (max-width: 760px) { .menu { position: fixed; left: var(--sp-2); right: var(--sp-2); top: calc(var(--bar-h) + var(--sp-2)); width: auto; } }
@keyframes iw-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 5. Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 var(--sp-4);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface-1); color: var(--text);
  font-weight: 600; font-size: var(--fs-body); line-height: 1; text-decoration: none; white-space: nowrap;
  transition: background var(--t-med) var(--ease), border-color var(--t-med) var(--ease), color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), transform var(--t-fast) var(--ease); }
.btn .ic { width: 18px; height: 18px; }
.btn.wrap { white-space: normal; line-height: 1.25; text-align: center; max-width: 100%; padding-block: 8px; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary, .btn-primary { background: var(--accent); border-color: var(--accent-ink); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), var(--glow); }
.btn.primary:hover, .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn.primary:active, .btn-primary:active { background: var(--accent-press); border-color: var(--accent-press); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }
.btn.primary:focus-visible { box-shadow: var(--focus); }
.btn.ghost, .btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover, .btn-ghost:hover { background: var(--hover-tint); color: var(--text); }
.btn.danger, .btn-danger { background: transparent; border-color: rgba(243,139,139,.55); color: var(--loss); }
.btn.danger:hover, .btn-danger:hover { background: var(--loss-soft); color: var(--loss); }
.btn.small, .btn-sm { min-height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-small); border-radius: 8px; gap: 6px; }
.btn.small .ic { width: 16px; height: 16px; }
.btn.large, .btn-lg { min-height: 48px; padding: 0 var(--sp-6); font-size: 1rem; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.small { width: 32px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: iw-spin .7s linear infinite; }
/* confirmação em dois toques: 1º toque → data-c="1" + rótulo "Confirmar <verbo>"; volta após 4s ou no blur */
.btn[data-c="1"], .linkbtn[data-c="1"] { background: var(--loss); border-color: var(--loss); color: #2a0b0b; text-decoration: none; animation: iw-arm var(--t-slow) var(--ease); }
.btn[data-c="1"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 4px; height: 2px; border-radius: 2px; background: rgba(42,11,11,.45); transform-origin: left; animation: iw-fuse 4s linear forwards; }
.btn[data-c] { position: relative; overflow: hidden; }
.btn.primary[data-c="1"] { background: var(--accent); border-color: var(--text); color: var(--on-accent); }
.linkbtn[data-c="1"] { padding: 2px 8px; border-radius: var(--r-sm); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; font-weight: 600; }
.linkbtn:hover { color: var(--accent-hover); }
@keyframes iw-arm { 0% { transform: scale(.97); } 60% { transform: scale(1.02); } 100% { transform: none; } }
@keyframes iw-fuse { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes iw-spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .btn { min-height: var(--tap); }
  .btn.small, .btn-sm { min-height: 36px; }
  .btn.icon { width: var(--tap); }
  .btn.icon.small { width: 36px; }
}

/* ---------- 6. Cartões, painéis, linhas de lista ---------- */
.card, .panel { background: var(--surface-1); border-radius: var(--r-lg); box-shadow: var(--e1); padding: var(--sp-4); min-width: 0; }
.card + .card, .panel + .panel { margin-top: var(--sp-3); }
.stack > .card + .card, .stack > .panel + .panel { margin-top: 0; }
.card .hd, .card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.card .hd > :first-child { min-width: 0; }
.card .ft, .card-foot { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); margin-top: var(--sp-4); padding-top: var(--sp-3); }
.card .ft .end { margin-left: auto; display: flex; gap: var(--sp-2); }
.card.inset, .inset { background: var(--field); box-shadow: none; border-radius: var(--r-md); padding: var(--sp-3); }
.card.selected { box-shadow: var(--e1), 0 0 0 1px var(--accent); }
.card.flush { padding: 0; overflow: hidden; }
.card.attention { box-shadow: var(--e1), inset 3px 0 0 var(--accent); }
.list { display: grid; gap: var(--sp-2); }
.list.tight { gap: 0; }
.list-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: var(--sp-3); align-items: center; min-height: 56px;
  padding: var(--sp-2) var(--sp-3); background: var(--surface-1); border-radius: var(--r-md); color: inherit; text-decoration: none; text-align: left; width: 100%; border: 1px solid transparent;
  font: inherit; transition: background var(--t-med) var(--ease); }
a.list-row:hover, button.list-row:hover { background: var(--surface-2); color: inherit; }
.list-row[aria-current="true"] { border-color: var(--accent-ink); background: var(--surface-2); }
.list-row.flat { background: transparent; border-radius: 0; padding-left: 0; padding-right: 0; }
.list-row.on-field { background: var(--field); }
.list-row.two { grid-template-columns: minmax(0,1fr) auto; }
.list-row .t { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list-row .t > span:first-child { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .t small, .list-row .meta { display: block; color: var(--text-2); font-weight: 400; font-size: var(--fs-small); white-space: normal; }
.list-row .trail { display: grid; justify-items: end; gap: 2px; text-align: right; }
.list-row .chev { width: 18px; height: 18px; color: var(--text-3); }
.divided > * + * { border-top: 1px solid var(--line); }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); margin: var(--sp-5) 0 var(--sp-2); padding: 0 2px; }
.group-head:first-child { margin-top: 0; }
.group-head h3 { display: flex; align-items: center; gap: 6px; }

/* ---------- 7. Tags, contadores, chips ---------- */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); color: var(--text-2); font-size: var(--fs-micro); font-weight: 600; line-height: 1; white-space: nowrap; vertical-align: middle; flex: none; }
.tag.match, .tag.win, .tag.ok   { border-color: transparent; background: var(--win-soft);  color: var(--win); }
.tag.late, .tag.loss, .tag.err  { border-color: transparent; background: var(--loss-soft); color: var(--loss); }
.tag.warn                       { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.tag.info                       { border-color: transparent; background: var(--info-soft); color: var(--info); }
.tag.accent                     { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); }
.tag.foil { position: relative; border: 0; background: var(--foil-soft); color: var(--text); }
.tag.foil::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--foil);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.count.quiet { background: var(--surface-3); color: var(--text); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--sp-4)); padding: 0 var(--sp-4); }
.chips.scroll::-webkit-scrollbar { display: none; }
.chipbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); flex: none;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text-2); font-size: var(--fs-small); font-weight: 600; transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease); }
.chipbtn:hover { color: var(--text); background: var(--hover-tint); }
.chipbtn[aria-pressed="true"] { background: var(--surface-3); border-color: var(--surface-3); color: var(--text); }
.chipbtn.x { background: var(--surface-2); border-color: var(--surface-2); color: var(--text); padding-right: 8px; }
.chipbtn.x::after { content: ""; width: 14px; height: 14px; background: currentColor; opacity: .75; -webkit-mask: url(assets/icons/close.svg) center/contain no-repeat; mask: url(assets/icons/close.svg) center/contain no-repeat; }
.chipbtn .inks { margin: 0; }
@media (max-width: 760px) { .chipbtn { min-height: 36px; } }

/* ---------- 8. Segmentado (um valor do mesmo objeto) × abas (vistas diferentes) ---------- */
.seg, .vis { display: inline-flex; width: max-content; max-width: 100%; justify-self: start; padding: 3px; gap: 2px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); }
.seg button, .vis button { flex: 1 1 auto; min-height: 34px; padding: 0 var(--sp-3); border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-weight: 600; font-size: var(--fs-small);
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"], .vis button[aria-pressed="true"],
.seg button[aria-checked="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 2px rgba(0,0,0,.3); }
/* a "Foil" choice, when picked: the foil shine (like duels.ink), so it's plain which one is on */
.seg button.is-foil[aria-pressed="true"] { background: linear-gradient(115deg, #ff9ec4 0%, #ffd77a 24%, #9ff0bf 48%, #8fd0ff 72%, #c8a2ff 100%); color: #1b1230; box-shadow: 0 1px 6px rgba(160,140,255,.45); }
.seg button.is-foil[aria-pressed="true"]::before { content: "✦ "; }
/* prices out of date or unavailable (shell.js INKWELL_PRICE_NOTE) */
.price-warn { color: var(--text); background: var(--warn-soft, rgba(236,192,97,.14)); border-radius: var(--r-sm); padding: 6px 10px; }
.price-warn .ic { width: 16px; height: 16px; vertical-align: -3px; }
/* the word "Foil" next to its count (Coleção, Decks): the same shine, as a small tag */
.foil-word { display: inline-block; padding: 1px 8px; border-radius: 999px; background: linear-gradient(115deg, #ff9ec4 0%, #ffd77a 24%, #9ff0bf 48%, #8fd0ff 72%, #c8a2ff 100%); color: #1b1230 !important; font-weight: 700; }
.seg button .ic { width: 18px; height: 18px; }
.seg.icons button { padding: 0 10px; }
.seg.block { display: flex; width: 100%; } .seg.block button { flex: 1; }
@media (max-width: 760px) { .seg button, .vis button { min-height: 40px; } }

.tabs { display: flex; gap: var(--sp-6); border-bottom: 1px solid var(--line); margin: 0 0 var(--sp-5); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 2px;
  border: 0; background: none; color: var(--text-2); font-weight: 600; font-size: var(--fs-body); white-space: nowrap; text-decoration: none; transition: color var(--t-med) var(--ease); }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.tab:focus-visible { border-radius: var(--r-sm); }
.tabs.fill .tab { flex: 1; justify-content: center; }
@media (max-width: 760px) { .tabs { gap: var(--sp-5); margin-left: calc(-1 * var(--sp-4)); margin-right: calc(-1 * var(--sp-4)); padding: 0 var(--sp-4); } }

/* ---------- 9. Formulários ---------- */
.field, label.f { display: grid; gap: 6px; font-size: var(--fs-small); font-weight: 600; color: var(--text-2); min-width: 0; }
.field .hint, label.f .hint { font-weight: 400; color: var(--text-3); }
.field .err { display: flex; gap: 6px; align-items: center; font-weight: 600; color: var(--loss); }
.field .err::before { content: ""; width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: url(assets/icons/alert.svg) center/contain no-repeat; mask: url(assets/icons/alert.svg) center/contain no-repeat; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=datetime-local], input[type=time], input[type=url], input[type=number], input[type=tel], input:not([type]),
select, textarea {
  width: 100%; min-height: 42px; padding: 0 var(--sp-3); background: var(--field); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); font-size: var(--fs-body); font-weight: 400;
  transition: border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); }
textarea { padding: 10px var(--sp-3); min-height: 80px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: #8079b8; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); border-radius: var(--r-md); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--loss); }
input:disabled, select:disabled, textarea:disabled { opacity: .5; }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator { filter: invert(.75) sepia(.2) hue-rotate(210deg); }
/* iPhone draws date and time fields with their own width and centred text: same width and alignment as the other fields */
input[type=date], input[type=datetime-local], input[type=time] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; box-sizing: border-box; text-align: left; line-height: 40px; }
input[type=date]::-webkit-date-and-time-value, input[type=datetime-local]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; margin: 0; }
select { appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23aaa3cc' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select.inline { width: auto; min-height: 34px; background-color: transparent; border-color: var(--line-strong); font-weight: 600; font-size: var(--fs-small); color: var(--text); }
/* the open list of a select: the theme's colours (a transparent select left white text on the system's white list) */
select option, select optgroup { background-color: var(--surface-1); color: var(--text); }
.prefix { position: relative; }
.prefix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); font-weight: 600; pointer-events: none; }
.prefix > input { padding-left: 40px; }
.search { position: relative; flex: 1; min-width: 0; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.search input { padding-left: 40px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-ink); width: 18px; height: 18px; margin: 0; flex: none; }
.check { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 32px; color: var(--text); font-size: var(--fs-small); font-weight: 400; cursor: pointer; }
/* interruptor (NOVO): <label class="switch"><span>Só foil</span><input type="checkbox" role="switch"></label> */
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: var(--tap); color: var(--text); font-size: var(--fs-body); font-weight: 400; cursor: pointer; }
.switch small { display: block; color: var(--text-2); font-size: var(--fs-small); }
.switch input { appearance: none; position: relative; width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--field); border: 1px solid var(--line-strong); flex: none; cursor: pointer; transition: background var(--t-med) var(--ease), border-color var(--t-med) var(--ease); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-2); transition: transform var(--t-med) var(--ease), background var(--t-med) var(--ease); }
.switch input:checked { background: var(--accent); border-color: var(--accent-ink); }
.switch input:checked::after { transform: translateX(18px); background: var(--on-accent); }
.switch input:focus-visible { box-shadow: var(--focus); border-radius: var(--r-pill); }
.form { display: grid; gap: var(--sp-4); }
.form .actions { display: flex; gap: var(--sp-2); justify-content: flex-end; }
.form-block { display: grid; gap: var(--sp-4); padding: var(--sp-5) 0; }
.form-block + .form-block { border-top: 1px solid var(--line); }
.form-block:first-child { padding-top: var(--sp-2); }
.form-block > h3 { display: flex; align-items: center; gap: var(--sp-2); }
.form-block > h3 .step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-3); color: var(--text); font-size: var(--fs-micro); font-weight: 800; }
@media (max-width: 760px) {
  input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=tel], input:not([type]), select, textarea { min-height: var(--tap); font-size: 16px; }
  select.inline { min-height: 36px; font-size: 16px; }
  .form .actions { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); background: var(--surface-1); padding: var(--sp-3) 0; margin-bottom: calc(-1 * var(--sp-4)); }
  .form .actions .btn { flex: 1; }
}
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } .grid2.keep { grid-template-columns: 1fr 1fr; } }

/* código de 6 dígitos (NOVO) */
.otp { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: var(--sp-2); }
.otp input { min-height: 56px; padding: 0; text-align: center; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; caret-color: var(--accent-ink); }
.otp input.filled { border-color: var(--text-2); }
.otp-one { min-height: 56px; font-size: 1.5rem; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; caret-color: var(--accent-ink); }
.otp-one.err { border-color: var(--loss); }

/* busca de carta */
.picker { position: relative; }
.picker input { padding-left: 40px; background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239690c2' stroke-width='1.8'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 13px center; }
.sugg { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; max-height: 300px; overflow: auto;
  background: var(--surface-2); border-radius: var(--r-md); box-shadow: var(--e2); padding: 4px; animation: iw-pop var(--t-fast) var(--ease-out); transform-origin: top; }
.sugg.static { position: static; margin-top: 6px; }
.sugg button { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: var(--sp-3); align-items: center; width: 100%; min-height: 52px;
  padding: 4px var(--sp-2); text-align: left; background: none; border: 0; border-radius: 8px; color: var(--text); }
.sugg button .thumb { width: 32px; }
.sugg button:hover, .sugg button:focus-visible, .sugg button[aria-selected="true"] { background: var(--surface-3); box-shadow: none; }
.sugg button small { display: block; color: var(--text-2); font-size: var(--fs-micro); }
.sugg button:disabled { opacity: .55; cursor: not-allowed; }
.sugg .none { padding: var(--sp-3); color: var(--text-2); font-size: var(--fs-small); }

/* contador de quantidade (− 1 +) */
.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--field); border: 1px solid var(--line); border-radius: var(--r-md); padding: 2px; flex: none; }
.qty button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 1.15rem; font-weight: 700; line-height: 1; }
.qty button:hover { background: var(--surface-3); }
.qty button:disabled { opacity: .3; cursor: not-allowed; background: none; }
.qty output, .qty b { min-width: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.qty.lg { padding: 4px; border-radius: 12px; }
.qty.lg button { width: 44px; height: 44px; border-radius: 9px; font-size: 1.4rem; }
.qty.lg output, .qty.lg b { min-width: 44px; font-size: 1.5rem; font-stretch: var(--stretch-num); }
.qty output.bump { animation: iw-bump var(--t-slow) var(--ease); }
@keyframes iw-bump { 40% { transform: scale(1.18); } }
@media (max-width: 760px) { .qty button { width: 40px; height: 40px; } }

/* ---------- 10. Retorno: avisos, vazio, toast, esqueleto ---------- */
.notice { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3); border-radius: var(--r-md);
  background: var(--surface-2); box-shadow: inset 3px 0 0 var(--info); color: var(--text); font-size: var(--fs-small); margin: var(--sp-2) 0; }
.notice > .ic { width: 18px; height: 18px; color: var(--info); }
.notice .t { flex: 1; min-width: 0; }
.notice .t b { display: block; font-size: var(--fs-body); }
.notice.warn { background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--warn); } .notice.warn > .ic { color: var(--warn); }
.notice.err, .notice.error { background: var(--loss-soft); box-shadow: inset 3px 0 0 var(--loss); } .notice.err > .ic { color: var(--loss); }
.notice.ok { background: var(--win-soft); box-shadow: inset 3px 0 0 var(--win); } .notice.ok > .ic { color: var(--win); }
.notice.ask { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--text-2); } .notice.ask > .ic { color: var(--text-2); }
.notice .actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
@media (max-width: 480px) { .notice.wrap { flex-wrap: wrap; } .notice.wrap .actions { width: 100%; margin-left: 30px; } }
.empty { display: grid; justify-items: center; gap: var(--sp-2); text-align: center; padding: var(--sp-10) var(--sp-5);
  color: var(--text-2); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty img { width: 120px; height: 96px; margin-bottom: var(--sp-2); }
.empty b, .empty strong { color: var(--text); font-size: var(--fs-h3); }
.empty p { max-width: 34ch; margin: 0 0 var(--sp-2); }
.empty.inline { display: block; text-align: left; padding: var(--sp-3) 0; border: 0; color: var(--text-2); font-size: var(--fs-small); }
.empty.plain { border: 0; }
.toast-host { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--sp-4) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; width: min(calc(100vw - 24px), 420px); }
.toast { display: flex; align-items: center; gap: var(--sp-3); min-height: 52px; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); border-radius: var(--r-md); background: var(--surface-3);
  color: var(--text); box-shadow: var(--e2); font-size: var(--fs-small); animation: iw-in var(--t-slow) var(--ease-out); }
.toast > .ic { width: 18px; height: 18px; color: var(--win); }
.toast .btn { margin-left: auto; }
.toast.err { box-shadow: var(--e2), inset 3px 0 0 var(--loss); } .toast.err > .ic { color: var(--loss); }
@media (min-width: 761px) { .toast-host { bottom: 24px; } }
@keyframes iw-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.skel { display: block; border-radius: var(--r-md); background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 37%, var(--surface-1) 63%) 0 0/400% 100%; animation: iw-skel 1.4s ease infinite; }
.skel.line { height: 12px; border-radius: 6px; }
.skel.thumb { aspect-ratio: 5/7; border-radius: var(--r-sm); }
@keyframes iw-skel { to { background-position: -100% 0; } }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--text); animation: iw-spin .8s linear infinite; }
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 11. Diálogo / folha ---------- */
dialog.sheet, .sheet { border: 0; padding: 0; color: var(--text); background: var(--surface-1); box-shadow: var(--e3); border-radius: var(--r-xl);
  width: min(560px, calc(100vw - 32px)); max-width: none; max-height: min(88vh, 800px); overflow: auto; overscroll-behavior: contain; }
dialog.sheet.wide, .sheet.wide { width: min(720px, calc(100vw - 32px)); }
dialog.sheet[open] { animation: iw-rise var(--t-sheet) var(--ease-out); }
dialog.sheet::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: iw-fade var(--t-slow) var(--ease); }
.sheet .grab { display: none; }
.sheet .sheet-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-3) var(--sp-3) var(--sp-5); background: var(--surface-1); z-index: 2; }
.sheet .sheet-head .sub { color: var(--text-2); font-size: var(--fs-small); margin-top: 2px; font-weight: 400; }
.sheet .sheet-body { padding: 0 var(--sp-5) var(--sp-5); }
.sheet .sheet-foot { position: sticky; bottom: 0; display: flex; gap: var(--sp-2); justify-content: flex-end; align-items: center; padding: var(--sp-3) var(--sp-5) calc(var(--sp-3) + env(safe-area-inset-bottom, 0px)); background: var(--surface-1); border-top: 1px solid var(--line); z-index: 2; }
.sheet .sheet-foot .note { margin-right: auto; color: var(--text-2); font-size: var(--fs-small); }
@media (max-width: 760px) {
  dialog.sheet, .sheet, dialog.sheet.wide, .sheet.wide { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; }
  dialog.sheet[open] { animation: iw-up var(--t-sheet) var(--ease-out); }
  .sheet .grab { display: block; width: 36px; height: 4px; margin: 8px auto 0; border-radius: var(--r-pill); background: var(--line-strong); }
  .sheet .sheet-head { padding: var(--sp-3) var(--sp-2) var(--sp-3) var(--sp-4); }
  .sheet .sheet-body { padding: 0 var(--sp-4) var(--sp-5); }
  .sheet .sheet-foot { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .sheet .sheet-foot .btn { flex: 1; }
  .sheet .sheet-foot .note { display: none; }
}
@keyframes iw-rise { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes iw-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes iw-fade { from { opacity: 0; } }

/* ---------- 12. Números ---------- */
.stats-row, .tiles, .bal { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-3); }
.stats-row.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stats-row.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat, .tile, .bal > div { background: var(--surface-1); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); min-width: 0; box-shadow: var(--e1); }
.card .stat, .card .tile, .card .bal > div { background: var(--field); box-shadow: none; }
.stat b, .tile b, .bal b { display: block; font-size: var(--fs-stat); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; font-stretch: var(--stretch-num); color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat b small { font-size: .55em; font-weight: 600; color: var(--text-2); letter-spacing: 0; margin-left: 1px; }
.stat b.money small { color: inherit; }
.stat span, .tile span, .bal span { display: block; margin-top: 4px; color: var(--text-2); font-size: var(--fs-small); }
.stat b.money, .tile b.money { color: var(--money); }
.stat b.win { color: var(--win); } .stat b.loss { color: var(--loss); }
.stat.lead b { font-size: var(--fs-hero); }
@media (max-width: 480px) { .stats-row, .tiles, .bal, .stats-row.four { grid-template-columns: 1fr 1fr; } .stats-row.three { grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--sp-2); }
  .stats-row.three .stat { padding: var(--sp-3); } .stat b, .tile b, .bal b { font-size: 1.375rem; } }
/* medidor neutro (progresso, % na coleção) */
.meter { display: block; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; width: var(--v, 0%); border-radius: inherit; background: var(--text-2); }
.meter.full > i { background: var(--win); }
/* saldo da troca: uma linha */
.balance { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--sp-4); padding: var(--sp-3) var(--sp-4); background: var(--field); border-radius: var(--r-md); font-size: var(--fs-small); color: var(--text-2); }
.balance strong { margin-left: auto; font-size: var(--fs-h3); color: var(--text); font-variant-numeric: tabular-nums; }
.balance strong.win { color: var(--win); } .balance strong.loss { color: var(--loss); }
@media (max-width: 480px) { .balance strong { margin-left: 0; width: 100%; } }

/* ---------- 13. Tintas, avatares, miniaturas ---------- */
.inks { display: inline-flex; gap: 3px; vertical-align: middle; margin-right: 6px; flex: none; }
.inks i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-steel); box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.inks.lg i { width: 14px; height: 14px; }
.inks.pair { gap: 0; } .inks.pair i + i { margin-left: -4px; box-shadow: 0 0 0 2px var(--surface-1); }
[data-ink="amber"] { --ink: var(--ink-amber); } [data-ink="amethyst"] { --ink: var(--ink-amethyst); } [data-ink="emerald"] { --ink: var(--ink-emerald); }
[data-ink="ruby"] { --ink: var(--ink-ruby); } [data-ink="sapphire"] { --ink: var(--ink-sapphire); } [data-ink="steel"] { --ink: var(--ink-steel); }
.inks i[data-ink] { background: var(--ink); }
.inkbtn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; padding: 0; transition: background var(--t-med) var(--ease); }
.inkbtn::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); opacity: .55; transition: opacity var(--t-med), transform var(--t-med) var(--ease); }
.inkbtn[aria-pressed="true"] { background: var(--surface-3); border-color: var(--ink); }
.inkbtn[aria-pressed="true"]::before { opacity: 1; transform: scale(1.15); }
@media (max-width: 760px) { .inkbtn { width: var(--tap); height: var(--tap); } }
.av { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: var(--surface-3); color: var(--accent-ink); font-weight: 800; font-size: .95rem; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.sm { width: 24px; height: 24px; font-size: .7rem; } .av.lg { width: 48px; height: 48px; font-size: 1.2rem; }
.avs { display: inline-flex; } .avs .av { box-shadow: 0 0 0 2px var(--surface-1); } .avs .av + .av { margin-left: -8px; }
/* miniatura de carta 5:7 — o site real carrega a imagem; aqui é moldura neutra tingida pela tinta */
.thumb { position: relative; aspect-ratio: 5 / 7; border-radius: var(--r-sm); overflow: hidden; flex: none;
  background: radial-gradient(120% 70% at 50% 0%, color-mix(in oklab, var(--ink, var(--ink-steel)) 30%, transparent), transparent 70%), linear-gradient(180deg, var(--surface-2), var(--field));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.thumb::after { content: ""; position: absolute; inset: 7% 8%; border-radius: 3px; border: 1px solid rgba(255,255,255,.07); border-bottom-width: 18%; border-bottom-color: rgba(255,255,255,.035); }
.thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.xs { width: 32px; } .thumb.sm { width: 40px; } .thumb.md { width: 56px; }
.thumb.foil::before { content: ""; position: absolute; inset: 0; z-index: 2; background: var(--foil); opacity: .16; mix-blend-mode: screen; }
.thumbs { display: flex; gap: 6px; }

/* ---------- 14. Tabelas ---------- */
table.tbl, table.cl, table.mt { width: 100%; border-collapse: collapse; font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
table.tbl th, table.cl th, table.mt th { text-align: left; font-weight: 600; font-size: var(--fs-micro); color: var(--text-2); padding: 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
table.tbl td, table.cl td, table.mt td { padding: 8px; height: 52px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table .n, table th.n, table td.n { text-align: right; }
table tr[data-href], table tr[data-opp] { cursor: pointer; }
table tr[data-href]:hover td, table tr[data-opp]:hover td { background: var(--surface-2); }
table .cardcell { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
table .cardcell b { display: block; font-weight: 600; font-size: var(--fs-body); }
table .cardcell small { display: block; color: var(--text-2); }
.tbl-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--sp-4)); padding: 0 var(--sp-4); }

/* ---------- 15. Domínio ---------- */
/* barra de ferramentas fixa (Coleção, Mural) */
.toolbar { position: sticky; top: var(--bar-h); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0 calc(-1 * var(--sp-4)) var(--sp-3); padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(var(--bg) 78%, rgba(19,16,42,0)); }
.toolbar .sep { width: 1px; height: 24px; background: var(--line); margin: 0 var(--sp-1); }
.toolbar .end { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; }
.filter-btn { position: relative; }
.filter-btn .count { position: absolute; top: -6px; right: -6px; }

/* grade de cartas (Coleção) */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-5) var(--sp-4); }
@media (max-width: 760px) { .cgrid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--sp-4) var(--sp-3); } }
.ccard { display: grid; gap: 8px; align-content: start; padding: 0; border: 0; background: none; color: inherit; text-align: left; text-decoration: none; font: inherit; border-radius: var(--r-md); }
.ccard .thumb { width: 100%; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07), 0 8px 20px rgba(5,3,20,.35); transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); }
.ccard:hover .thumb { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 14px 28px rgba(5,3,20,.5); }
.ccard:focus-visible { box-shadow: none; } .ccard:focus-visible .thumb { box-shadow: var(--focus); }
.ccard .pill { position: absolute; z-index: 3; top: 8px; right: 8px; display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 8px; border-radius: var(--r-pill);
  background: rgba(15,12,34,.86); color: #f4f1ff; font-size: var(--fs-small); font-weight: 800; font-variant-numeric: tabular-nums; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.ccard .flags { position: absolute; z-index: 3; left: 8px; bottom: 8px; display: flex; gap: 4px; }
.ccard .flags .tag { background-color: rgba(15,12,34,.86); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); color: #f4f1ff; }
.ccard .flags .tag.info { background: rgba(23,30,60,.9); }
.ccard .nm { font-weight: 600; font-size: var(--fs-small); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.ccard .nm small { display: block; font-weight: 400; color: var(--text-2); }
.ccard .meta { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-micro); color: var(--text-2); font-variant-numeric: tabular-nums; margin-top: -4px; }
.ccard .meta b { color: var(--text); font-weight: 600; }
.ccard.none .thumb { filter: grayscale(.7) brightness(.7); }

/* custo: losango numerado (sem símbolos oficiais) */
.cost { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; position: relative; font-size: var(--fs-micro); font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.cost::before { content: ""; position: absolute; inset: 3px; transform: rotate(45deg); border-radius: 4px; border: 1.5px solid var(--line-strong); background: var(--field); z-index: -1; }
.cost { z-index: 0; }
.cost.ink::before { border-color: var(--text-2); background: var(--surface-3); }  /* inkável */

/* lista de deck */
.dl { display: grid; }
.dl-row { display: grid; grid-template-columns: 28px 24px minmax(0,1fr) auto; gap: var(--sp-3); align-items: center; min-height: 48px; padding: 4px 0; border-top: 1px solid var(--line); }
.dl-row:first-child { border-top: 0; }
.dl-row .q { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-2); }
.dl-row .t { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-row .t small { display: block; font-weight: 400; color: var(--text-2); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; }

/* gráfico de barras (curva de custo, tipos) */
.bars { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0,1fr)); gap: 6px; align-items: end; height: 140px; padding-top: 18px; }
.bars > div { display: grid; grid-template-rows: auto 1fr; justify-items: center; height: 100%; align-items: end; gap: 4px; }
.bars > div > b { font-size: var(--fs-micro); font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bars > div > i { display: block; width: 100%; height: var(--v, 0%); min-height: 2px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--text-2), var(--surface-3)); opacity: .85; }
.bars-x { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0,1fr)); gap: 6px; margin-top: 6px; text-align: center; font-size: var(--fs-micro); color: var(--text-2); font-variant-numeric: tabular-nums; }
.split-bar { display: flex; height: 10px; border-radius: var(--r-pill); overflow: hidden; gap: 2px; }
.split-bar > i { display: block; flex: var(--v) 0 0; background: var(--c, var(--surface-3)); }
.legend { display: grid; gap: 6px; margin-top: var(--sp-3); font-size: var(--fs-small); }
.legend > div { display: flex; align-items: center; gap: var(--sp-2); }
.legend > div > i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.legend > div > b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* gráfico de lore */
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--text-2); font-size: 11px; font-family: var(--font); }
.chart .you { fill: none; stroke: var(--text); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .opp { fill: none; stroke: var(--opp); stroke-width: 2.25; stroke-dasharray: 5 4; stroke-linejoin: round; stroke-linecap: round; }
.chart .goal { stroke: var(--line-strong); stroke-dasharray: 2 4; }
.chart .mark { fill: var(--accent); }
.chart-legend { display: flex; gap: var(--sp-4); font-size: var(--fs-small); color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend span::before { content: ""; width: 16px; height: 0; border-top: 2px solid var(--text); }
.chart-legend span.opp::before { border-top: 2px dashed var(--opp); }

/* linha do tempo: post de jogo (Início) */
.post { display: grid; gap: var(--sp-3); }
.post .who { display: flex; align-items: center; gap: var(--sp-3); }
.post .who b { display: block; }
.post .who .small { color: var(--text-2); }
.post .res { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.post .res .score { font-size: 1.375rem; font-weight: 800; letter-spacing: -0.02em; font-stretch: var(--stretch-num); }
.post .res .word { font-weight: 700; }
.post .match { font-size: var(--fs-body); color: var(--text-2); }
.post .match b { color: var(--text); font-weight: 600; }
.post .acts { display: flex; gap: var(--sp-1); margin: 0 calc(-1 * var(--sp-2)) calc(-1 * var(--sp-2)); padding-top: var(--sp-2); border-top: 1px solid var(--line); }
.post .acts .btn { min-height: var(--tap); }
.post .comment { display: flex; gap: var(--sp-2); font-size: var(--fs-small); }
.post .comment b { color: var(--text); }

/* jogo (Jogos) */
.game-row { position: relative; overflow: hidden; padding-left: var(--sp-4); }
.game-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 3px 3px 0; background: var(--line-strong); }
.game-row.won::before { background: var(--win); } .game-row.lost::before { background: var(--loss); }
.game-row .score { font-weight: 800; font-size: var(--fs-h3); font-variant-numeric: tabular-nums; }
.game-row .trail small { font-size: var(--fs-micro); font-weight: 600; }
.ledger { display: grid; }
.turn { display: grid; grid-template-columns: 44px minmax(0,1fr) minmax(0,1fr) 64px; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--line); align-items: start; font-size: var(--fs-small); }
.turn:first-child { border-top: 0; }
.turn .n { font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; }
.turn .side { display: grid; gap: 2px; min-width: 0; }
.turn .side .who { font-size: var(--fs-micro); font-weight: 600; color: var(--text-2); }
.turn .lore { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.turn .lore small { display: block; font-weight: 400; color: var(--text-2); font-size: var(--fs-micro); }
.turn.key { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); margin: 0 calc(-1 * var(--sp-4)); padding-left: var(--sp-4); padding-right: var(--sp-4); }
.turn > .note, .turn > .notes { grid-column: 2 / -1; }
@media (max-width: 760px) { .turn { grid-template-columns: 32px minmax(0,1fr) 52px; } .turn .side.opp { grid-column: 2; } .turn .lore { grid-row: 1; grid-column: 3; } }
.note { display: grid; grid-template-columns: auto minmax(0,1fr); gap: var(--sp-2) var(--sp-3); padding: var(--sp-3); background: var(--field); border-radius: var(--r-md); box-shadow: inset 3px 0 0 var(--line-strong); font-size: var(--fs-small); }
.note.mine { box-shadow: inset 3px 0 0 var(--accent); }
.note .by { font-weight: 600; color: var(--text); }
.note .by small { font-weight: 400; color: var(--text-2); margin-left: 4px; }
.note p { margin: 2px 0 0; color: var(--text); }

/* etapas de empréstimo / troca (pedido → aceite → entrega → devolução) */
.steps { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0,1fr)); gap: 4px; }
.steps li { display: grid; gap: 6px; font-size: var(--fs-micro); font-weight: 600; color: var(--text-2); min-width: 0; }
.steps li::before { content: ""; height: 4px; border-radius: 2px; background: var(--surface-3); }
.steps li[data-s="done"]::before { background: var(--win); }
.steps li[data-s="now"]::before { background: linear-gradient(90deg, var(--text) 50%, var(--surface-3) 50%); }
.steps li[data-s="now"] { color: var(--text); }
.steps li[data-s="late"]::before { background: var(--loss); } .steps li[data-s="late"] { color: var(--loss); }
.steps li small { font-weight: 400; color: var(--text-2); }

/* ---------- 16. Ícones (24×24, traço 1.8, currentColor via máscara) ---------- */
.ic { display: inline-block; flex: none; width: 20px; height: 20px; background-color: currentColor; -webkit-mask: center / contain no-repeat; mask: center / contain no-repeat; vertical-align: middle; }
.i-home{-webkit-mask-image:url(assets/icons/home.svg);mask-image:url(assets/icons/home.svg)}
.i-cards{-webkit-mask-image:url(assets/icons/cards.svg);mask-image:url(assets/icons/cards.svg)}
.i-decks{-webkit-mask-image:url(assets/icons/decks.svg);mask-image:url(assets/icons/decks.svg)}
.i-camera{-webkit-mask-image:url(assets/icons/camera.svg);mask-image:url(assets/icons/camera.svg)}
.i-games{-webkit-mask-image:url(assets/icons/games.svg);mask-image:url(assets/icons/games.svg)}
.i-trades{-webkit-mask-image:url(assets/icons/trades.svg);mask-image:url(assets/icons/trades.svg)}
.i-counter{-webkit-mask-image:url(assets/icons/counter.svg);mask-image:url(assets/icons/counter.svg)}
.i-search{-webkit-mask-image:url(assets/icons/search.svg);mask-image:url(assets/icons/search.svg)}
.i-filter{-webkit-mask-image:url(assets/icons/filter.svg);mask-image:url(assets/icons/filter.svg)}
.i-sort{-webkit-mask-image:url(assets/icons/sort.svg);mask-image:url(assets/icons/sort.svg)}
.i-grid{-webkit-mask-image:url(assets/icons/grid.svg);mask-image:url(assets/icons/grid.svg)}
.i-list{-webkit-mask-image:url(assets/icons/list.svg);mask-image:url(assets/icons/list.svg)}
.i-plus{-webkit-mask-image:url(assets/icons/plus.svg);mask-image:url(assets/icons/plus.svg)}
.i-close{-webkit-mask-image:url(assets/icons/close.svg);mask-image:url(assets/icons/close.svg)}
.i-chevron-left{-webkit-mask-image:url(assets/icons/chevron-left.svg);mask-image:url(assets/icons/chevron-left.svg)}
.i-chevron-right{-webkit-mask-image:url(assets/icons/chevron-right.svg);mask-image:url(assets/icons/chevron-right.svg)}
.i-chevron-down{-webkit-mask-image:url(assets/icons/chevron-down.svg);mask-image:url(assets/icons/chevron-down.svg)}
.i-more{-webkit-mask-image:url(assets/icons/more.svg);mask-image:url(assets/icons/more.svg)}
.i-comment{-webkit-mask-image:url(assets/icons/comment.svg);mask-image:url(assets/icons/comment.svg)}
.i-eye{-webkit-mask-image:url(assets/icons/eye.svg);mask-image:url(assets/icons/eye.svg)}
.i-users{-webkit-mask-image:url(assets/icons/users.svg);mask-image:url(assets/icons/users.svg)}
.i-user-plus{-webkit-mask-image:url(assets/icons/user-plus.svg);mask-image:url(assets/icons/user-plus.svg)}
.i-shield{-webkit-mask-image:url(assets/icons/shield.svg);mask-image:url(assets/icons/shield.svg)}
.i-globe{-webkit-mask-image:url(assets/icons/globe.svg);mask-image:url(assets/icons/globe.svg)}
.i-sun{-webkit-mask-image:url(assets/icons/sun.svg);mask-image:url(assets/icons/sun.svg)}
.i-moon{-webkit-mask-image:url(assets/icons/moon.svg);mask-image:url(assets/icons/moon.svg)}
.i-bell{-webkit-mask-image:url(assets/icons/bell.svg);mask-image:url(assets/icons/bell.svg)}
.i-coins{-webkit-mask-image:url(assets/icons/coins.svg);mask-image:url(assets/icons/coins.svg)}
.i-logout{-webkit-mask-image:url(assets/icons/logout.svg);mask-image:url(assets/icons/logout.svg)}
.i-check{-webkit-mask-image:url(assets/icons/check.svg);mask-image:url(assets/icons/check.svg)}
.i-mail{-webkit-mask-image:url(assets/icons/mail.svg);mask-image:url(assets/icons/mail.svg)}
.i-trash{-webkit-mask-image:url(assets/icons/trash.svg);mask-image:url(assets/icons/trash.svg)}
.i-calendar{-webkit-mask-image:url(assets/icons/calendar.svg);mask-image:url(assets/icons/calendar.svg)}
.i-alert{-webkit-mask-image:url(assets/icons/alert.svg);mask-image:url(assets/icons/alert.svg)}
.i-info{-webkit-mask-image:url(assets/icons/info.svg);mask-image:url(assets/icons/info.svg)}
.i-undo{-webkit-mask-image:url(assets/icons/undo.svg);mask-image:url(assets/icons/undo.svg)}
.i-external{-webkit-mask-image:url(assets/icons/external.svg);mask-image:url(assets/icons/external.svg)}
.i-import{-webkit-mask-image:url(assets/icons/import.svg);mask-image:url(assets/icons/import.svg)}
.i-export{-webkit-mask-image:url(assets/icons/export.svg);mask-image:url(assets/icons/export.svg)}
.i-sparkle{-webkit-mask-image:url(assets/icons/sparkle.svg);mask-image:url(assets/icons/sparkle.svg)}
.i-clock{-webkit-mask-image:url(assets/icons/clock.svg);mask-image:url(assets/icons/clock.svg)}
.i-edit{-webkit-mask-image:url(assets/icons/edit.svg);mask-image:url(assets/icons/edit.svg)}
.i-send{-webkit-mask-image:url(assets/icons/send.svg);mask-image:url(assets/icons/send.svg)}
.i-board{-webkit-mask-image:url(assets/icons/board.svg);mask-image:url(assets/icons/board.svg)}
.i-loan{-webkit-mask-image:url(assets/icons/loan.svg);mask-image:url(assets/icons/loan.svg)}
.i-chart{-webkit-mask-image:url(assets/icons/chart.svg);mask-image:url(assets/icons/chart.svg)}
.i-refresh{-webkit-mask-image:url(assets/icons/refresh.svg);mask-image:url(assets/icons/refresh.svg)}

/* rights note at the end of every page (shell.js) */
.iw-legal { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--sp-4) calc(var(--tabbar-h) + var(--sp-6) + env(safe-area-inset-bottom, 0px)); color: var(--text-2); font-size: .75rem; line-height: 1.5; }
.iw-legal a { color: inherit; }
@media (min-width: 761px) { .iw-legal { padding-bottom: var(--sp-6); } }
.iw-legal .iw-social { display: flex; flex-wrap: wrap; gap: 0 var(--sp-4); margin: 0 0 var(--sp-2); font-size: .85rem; }
.iw-legal .iw-social button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: inherit; font: inherit; font-weight: 600; text-decoration: none; }
.iw-legal .iw-social a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; text-decoration: none; font-weight: 600; }
.iw-legal .iw-social a:hover { text-decoration: underline; }
.iw-legal .iw-social .ic { width: 16px; height: 16px; }
.iw-legal .iw-social button:hover { text-decoration: underline; }

/* ---------- Illuminary shell (26/10/2026): wider bar for every module, coin logo, white bottom bar in the light theme ---------- */
.appbar-in { max-width: 1240px; }
.brand img { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(232,195,106,.35); }
.sections a .count { margin-left: 2px; }
.more-list { display: grid; gap: 2px; }
.more-list .menu-item[aria-current="page"] { background: var(--accent-soft); }
@media (min-width: 761px) and (max-width: 1439px) { .appbar-in { gap: var(--sp-3); } .sections a { padding: 0 9px; } .sections a .ic { display: none; } .appbar .counter-btn span { display: none; } }
@media (min-width: 761px) and (max-width: 1099px) { .sections a { padding: 0 7px; font-size: var(--fs-small); } .appbar .end { gap: 0; } }
/* wide screens keep the icons; the counter shows its icon only and links are a little tighter, so "Inkwell" is never cut */
@media (min-width: 1440px) { .appbar .counter-btn span { display: none; } .sections a { padding: 0 10px; } .appbar-in { gap: var(--sp-3); } }
@media (min-width: 761px) and (max-width: 899px) { .sections a { padding: 0 6px; font-size: var(--fs-small); } .brand { font-size: 0; gap: 0; } }
html[data-theme="dia"] .tabbar { background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(11,25,44,.06); }
html[data-theme="dia"] body { background-attachment: scroll; }
html[data-theme="dia"] input[type=date]::-webkit-calendar-picker-indicator { filter: none; }
html[data-theme="dia"] .empty img { opacity: .45; }

/* card zoom (shell.js): the whole card, never cropped */
dialog.iw-zoom-card { padding: 0; border: 0; background: transparent; max-width: min(92vw, 520px); max-height: 92dvh; overflow: visible; }
dialog.iw-zoom-card::backdrop { background: rgba(8,6,20,.82); }
dialog.iw-zoom-card figure { margin: 0; display: grid; gap: var(--sp-2); justify-items: center; }
/* the size is set up front (card proportions), so it no longer depends on the picture having loaded: on iPhone a card
   whose picture was still loading opened small and stayed small */
dialog.iw-zoom-card img { display: block; width: min(92vw, 520px, calc(84dvh * 0.717)); max-width: none; height: auto; aspect-ratio: 1468 / 2048; object-fit: contain; border-radius: 4.5% / 3.2%; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: rgba(255,255,255,.06); }
dialog.iw-zoom-card.has-extra img { width: min(92vw, 520px, calc((92dvh - 190px) * 0.717)); }
dialog.iw-zoom-card .iw-zoom-extra { margin-top: var(--sp-3); width: min(92vw, 520px); box-sizing: border-box; }
dialog.iw-zoom-card .iw-zoom-extra[hidden] { display: none; }
dialog.iw-zoom-card.has-extra { overflow: auto; }
@media (min-width: 760px) {   /* computer: the card on the left, your copies on the right (like Dreamborn) */
  dialog.iw-zoom-card.has-extra[open] { display: flex; align-items: center; gap: var(--sp-5); max-width: min(94vw, 900px); overflow: visible; }
  dialog.iw-zoom-card.has-extra img { width: min(52vw, 480px, calc(88dvh * 0.717)); }
  dialog.iw-zoom-card.has-extra .iw-zoom-extra { margin-top: 0; width: 340px; flex: none; }
}
.iw-zoom-extra .zx { padding: var(--sp-3) var(--sp-4); }
.iw-zoom-extra .zx-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 48px; }
.iw-zoom-extra .zx-step { display: inline-flex; align-items: center; gap: var(--sp-2); }
.iw-zoom-extra .zx-step .btn { font-size: 22px; line-height: 1; }
.iw-zoom-extra .zx-step b { min-width: 2ch; text-align: center; font-size: var(--fs-h3); }
.iw-zoom-extra .zx-foot { display: flex; gap: var(--sp-2); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--sp-2); }
dialog.iw-zoom-card figcaption { color: #fff; font-weight: 600; text-align: center; font-size: var(--fs-small); }
dialog.iw-zoom-card [data-zclose] { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; color: #fff; background: rgba(0,0,0,.4); }
/* notifications (shell.js) */
@media (max-width: 430px) { .appbar .brand { font-size: 0; gap: 0; } }
/* tablets and small laptops: the coin alone, and the section links scroll inside the bar instead of pushing it wider */
@media (min-width: 761px) and (max-width: 1099px) {
  .appbar .brand { font-size: 0; gap: 0; }
  .appbar .sections { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .appbar .sections::-webkit-scrollbar { display: none; }
  .appbar .sections a { flex: none; }
}   /* phones: the coin is the brand, so the language flag fits */
/* the smallest phones (320–374px) signed in: six buttons and the coin fit when each button is 40px and the gaps
   are 2px (44px buttons need ~354px); taps stay at 40px, above the 24px minimum */
@media (max-width: 374px) {
  .appbar-in { padding-left: var(--sp-3); padding-right: var(--sp-1); gap: var(--sp-1); }
  .appbar .end { gap: 2px; }
  .appbar:not(.signed) .end > .btn.icon, .appbar:not(.signed) .counter-btn, .appbar:not(.signed) .av-btn { width: 40px; height: 40px; min-width: 40px; }   /* visitors still have theme, flag and Entrar */
}
.flag-btn svg { display: block; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.bell-btn { position: relative; }
.bell-btn .count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }
.menu.notif { width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow: auto; }
.menu.acct-menu { max-height: calc(100dvh - var(--bar-h) - 96px); overflow: auto; overscroll-behavior: contain; }   /* the account menu scrolls on short phones, above the bottom bar */
.menu.notif .menu-item { align-items: flex-start; white-space: normal; line-height: 1.35; }
.menu.notif .menu-item.unread { background: var(--accent-soft); }
.menu.notif .push-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: var(--sp-2); padding: var(--sp-3) var(--sp-2) var(--sp-1); }
.menu.notif .push-row:empty { display: none; }
.nt-row { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); align-items: center; justify-content: space-between; padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.nt-row > div:first-child { flex: 1 1 260px; min-width: 0; }
.nt-row small { display: block; color: var(--text-2); margin-top: 2px; }
.menu.notif .push-row p { margin: 0; }
.menu.notif .menu-item small { display: block; color: var(--text-2); }
.menu.find-menu { width: min(380px, calc(100vw - 24px)); max-height: min(75vh, 560px); overflow: auto; }
.menu.find-menu .find { display: grid; gap: var(--sp-2); }
.menu.find-menu .find input { width: 100%; }
.menu.find-menu .find p { margin: var(--sp-2); }
.menu.find-menu .menu-item { gap: var(--sp-3); white-space: normal; line-height: 1.3; }
.menu.find-menu .menu-item small { display: block; color: var(--text-2); }
.menu.find-menu .av.sm { width: 32px; height: 32px; flex: 0 0 32px; font-size: .85rem; display: grid; place-items: center; }
/* iPhone zooms the page into any field under 16px when it gets focus; on touch screens fields use 16px */
@media (pointer: coarse) { input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select { font-size: max(16px, 1em); } }
