/* Paleta do eeveemoon.pt: creme + dourado (claro) e azul-noite + dourado (escuro).
   Segue o tema do sistema; o botão 🌙/☀️ do cabeçalho força um dos dois (data-theme no <html>). */
:root {
  --bg: #faf6ec; --topbar: #fffcf4; --panel: #ffffff; --panel-2: #f6f0e2; --line: rgba(74, 58, 28, .12);
  --text: #2a2118; --muted: #85765a; --accent: #a16207; --accent-ink: #ffffff; --accent-ghost: rgba(161, 98, 7, .1);
  --good: #15803d; --bad: #c0392b;
  --egg-spot: #d9a05b;
  --r1: #85765a; --r2: #15803d; --r3: #1d4ed8; --r4: #7e22ce; --r5: #a16207;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1322; --topbar: #131829; --panel: #171c30; --panel-2: #1b2138; --line: rgba(242, 237, 225, .1);
    --text: #f2ede1; --muted: rgba(242, 237, 225, .58); --accent: #f2c14e; --accent-ink: #2a2118; --accent-ghost: rgba(242, 193, 78, .12);
    --good: #4ade80; --bad: #f87171;
    --egg-spot: #c98a45;
    --r1: rgba(242, 237, 225, .6); --r2: #4ade80; --r3: #60a5fa; --r4: #c4a1ff; --r5: #f2c14e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1322; --topbar: #131829; --panel: #171c30; --panel-2: #1b2138; --line: rgba(242, 237, 225, .1);
  --text: #f2ede1; --muted: rgba(242, 237, 225, .58); --accent: #f2c14e; --accent-ink: #2a2118; --accent-ghost: rgba(242, 193, 78, .12);
  --good: #4ade80; --bad: #f87171;
  --egg-spot: #c98a45;
  --r1: rgba(242, 237, 225, .6); --r2: #4ade80; --r3: #60a5fa; --r4: #c4a1ff; --r5: #f2c14e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, "Segoe UI", system-ui, sans-serif; }
a { color: inherit; }
h1, h2, .brand, .stat b { font-family: Nunito, Inter, "Segoe UI", sans-serif; }
h1 { font-size: 1.6rem; font-weight: 800; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.top { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .7rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--topbar); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 900; text-decoration: none; font-size: 1.1rem; letter-spacing: .02em; }
.brand-egg { width: 18px; height: 23px; background: radial-gradient(circle at 35% 30%, #fff6d6, #f2c14e 70%); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; display: inline-block; }
#nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
#nav a { text-decoration: none; padding: .35rem .75rem; border-radius: 8px; color: var(--muted); font-weight: 500; }
#nav a:hover { background: var(--accent-ghost); }
#nav a.on { background: var(--accent-ghost); color: var(--accent); font-weight: 600; }
#theme { background: var(--accent-ghost); border: 1px solid var(--line); padding: .3rem .55rem; line-height: 1; }
#session { display: flex; align-items: center; gap: .6rem; }

main { max-width: 1040px; margin: 0 auto; padding: 1.2rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 1.1rem 1.2rem; margin-bottom: 1rem; box-shadow: 0 6px 24px rgba(74, 58, 28, .06); }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }

button, .btn { font: inherit; border: 0; border-radius: 8px; padding: .45rem .9rem; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover:not(:disabled) { filter: brightness(1.08); }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); font-weight: 600; }
button.ghost:hover:not(:disabled) { background: var(--accent-ghost); filter: none; }
button:disabled { opacity: .5; cursor: default; }
input, select { font: inherit; padding: .4rem .6rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
input:focus, select:focus { outline: 2px solid var(--accent-ghost); border-color: var(--accent); }
input[type=number] { width: 6.5rem; }
input[type=checkbox] { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
label { display: inline-flex; align-items: center; gap: .4rem; }

.banner { border-radius: 10px; padding: .55rem .8rem; margin-bottom: 1rem; background: var(--accent-ghost); border: 1px solid var(--line); }
.pill { display: inline-block; padding: .05rem .55rem; border-radius: 999px; font-size: .78rem; border: 1px solid currentColor; }
.r1 { color: var(--r1); } .r2 { color: var(--r2); } .r3 { color: var(--r3); } .r4 { color: var(--r4); } .r5 { color: var(--r5); }

/* ovos */
.eggs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.egg-card { background: var(--panel-2); border-radius: 12px; padding: .9rem; text-align: center; }
.egg { width: 62px; height: 80px; margin: .2rem auto .7rem; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 30%, #fffdf2, #f4e2b0 60%, #d9bd77); position: relative; animation: wobble 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.egg::before, .egg::after { content: ""; position: absolute; border-radius: 50%; background: var(--egg-spot); opacity: .8; }
.egg::before { width: 16px; height: 13px; left: 11px; top: 30px; }
.egg::after { width: 12px; height: 10px; right: 10px; top: 50px; }
.egg.ready { animation: shake .35s linear infinite; }
@keyframes wobble { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes shake { 0%, 100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }
@media (prefers-reduced-motion: reduce) { .egg, .egg.ready, .reveal img { animation: none; } }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0 .3rem; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s; }

/* pokémon */
.mons { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .7rem; }
.mon { background: var(--panel-2); border-radius: 12px; padding: .6rem .4rem; text-align: center; position: relative; border: 1px solid transparent; }
.mon img { width: 84px; height: 84px; object-fit: contain; }
.mon .name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon .num { position: absolute; left: .45rem; top: .3rem; font-size: .7rem; color: var(--muted); }
.mon .count { position: absolute; right: .45rem; top: .3rem; font-size: .75rem; font-weight: 700; }
.mon.shiny { border-color: var(--r5); }
.mon.missing img { filter: brightness(0); opacity: .22; }
.mon.missing .name { color: var(--muted); font-weight: 400; }

/* Cartão com versão normal e shiny: mostra a normal e roda para a shiny */
.mon.dual { cursor: pointer; transition: border-color .35s; }
.mon.dual .art { position: relative; width: 84px; height: 84px; margin: 0 auto; }
.mon.dual .art img { position: absolute; inset: 0; transition: opacity .4s, transform .4s; }
.mon.dual .art img.alt { opacity: 0; transform: scale(.85) rotate(-8deg); }
.mon.dual .name { display: grid; }
.mon.dual .name > span { grid-area: 1 / 1; overflow: hidden; text-overflow: ellipsis; transition: opacity .4s; }
.mon.dual .name .alt { opacity: 0; color: var(--r5); }
.mon.dual .variants { margin-top: .3rem; color: var(--muted); white-space: nowrap; }
.mon.dual .variants span { transition: color .4s, font-weight .4s; }
.mon.dual .variants .base { color: var(--text); font-weight: 600; }
.mon.dual.flip, .mon.dual:focus-visible { border-color: var(--r5); }
.mon.dual.flip .art img.base { opacity: 0; transform: scale(.85) rotate(8deg); }
.mon.dual.flip .art img.alt { opacity: 1; transform: none; }
.mon.dual.flip .name .base { opacity: 0; }
.mon.dual.flip .name .alt { opacity: 1; }
.mon.dual.flip .variants .base { color: var(--muted); font-weight: 400; }
.mon.dual.flip .variants .alt { color: var(--r5); font-weight: 600; }
@media (hover: hover) {
  .mon.dual:hover { border-color: var(--r5); }
  .mon.dual:hover .art img.base { opacity: 0; transform: scale(.85) rotate(8deg); }
  .mon.dual:hover .art img.alt { opacity: 1; transform: none; }
  .mon.dual:hover .name .base { opacity: 0; }
  .mon.dual:hover .name .alt { opacity: 1; }
  .mon.dual:hover .variants .base { color: var(--muted); font-weight: 400; }
  .mon.dual:hover .variants .alt { color: var(--r5); font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) { .mon.dual .art img { transition: none; } }

.stats { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.stat b { display: block; font-size: 1.5rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .82rem; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: .82rem; }
td input[type=text] { width: 11rem; }

.chat div { padding: .2rem 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }

/* revelação do pokémon */
.overlay { position: fixed; inset: 0; background: rgba(15, 19, 34, .72); display: grid; place-items: center; z-index: 20; padding: 1rem; }
.reveal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem 2rem; text-align: center; max-width: 340px; }
.reveal img { width: 200px; height: 200px; object-fit: contain; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }

#toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 30; }
.toast { background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--good); padding: .55rem .8rem; border-radius: 10px; max-width: 340px; }
.toast.err { border-left-color: var(--bad); }

.eggs > p, .mons > p { grid-column: 1 / -1; margin: 0; }
