:root {
  --ink: #eaf2ff; --muted: #9fb3d1; --panel: rgba(10, 18, 38, .82); --line: #4cc9f0;
  --accent: #ffb703; --ok: #5ee08a; --bad: #ff6b6b; --pro: #ff4d8d; --h: 0;
  --sky: linear-gradient(to top, #ff9e5e 0%, #e0698a 12%, #5b4a9e 30%, #1f2f6b 55%, #0b1530 80%, #050914 100%);
  --m1: #161a3a; --m2: #0c0f26;
}
:root[data-theme="aurora"] {
  --sky: linear-gradient(to top, #7ee8c3 0%, #2fb59a 12%, #2a6f8f 30%, #1c3d70 55%, #0a1a3a 80%, #04101f 100%);
  --line: #7ee8c3; --accent: #c9a7ff; --m1: #0f3342; --m2: #08202c;
}
:root[data-theme="neon"] {
  --sky: linear-gradient(to top, #ff2e97 0%, #b3158f 12%, #5a1a8a 30%, #2a1259 55%, #0e0624 80%, #05010f 100%);
  --line: #00f0ff; --accent: #f9f871; --m1: #2a0f4d; --m2: #14072b;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: "Courier New", ui-monospace, Menlo, monospace; color: var(--ink); background: #0b1530; overflow-x: hidden; }
#sky { position: fixed; inset: 0; z-index: -2; background: var(--sky); background-size: 100% 500%;
  background-position: 50% calc(100% - var(--h) * 1%); transition: background-position 1.2s ease; }
#stars { position: fixed; inset: 0; z-index: -1; opacity: calc(var(--h) / 100); transition: opacity 1.2s;
  background-image: radial-gradient(1px 1px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, #fff, transparent), radial-gradient(1px 1px at 85% 60%, #fff, transparent),
    radial-gradient(1px 1px at 10% 80%, #fff, transparent), radial-gradient(1.5px 1.5px at 55% 45%, #fff, transparent); }
#mount { position: fixed; left: 0; bottom: 0; width: 100%; height: 28vh; z-index: -1; pointer-events: none; opacity: calc(1 - var(--h) / 60); }
#mount .m1 { fill: var(--m1); } #mount .m2 { fill: var(--m2); }
main { max-width: 580px; margin: 0 auto; padding: 56px 16px 40px; min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
h1 { font-size: clamp(44px, 12vw, 72px); letter-spacing: .12em; margin: 0; text-align: center; text-shadow: 3px 0 #ff4d8d, -3px 0 #4cc9f0; }
.sub { text-align: center; letter-spacing: .35em; color: var(--line); margin: 6px 0 4px; font-weight: bold; }
.tag { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.panel { background: var(--panel); border: 2px solid var(--line); padding: 18px; box-shadow: 0 0 24px rgba(76, 201, 240, .22); }
button { font: inherit; font-weight: bold; letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  background: #0e1c3d; color: var(--ink); border: 2px solid var(--line); padding: 14px 16px; width: 100%; }
button:hover:not(:disabled) { background: #14295a; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button.ghost { border-color: #3b5278; color: var(--muted); padding: 11px 10px; font-size: 12px; }
button.pro { border-color: var(--pro); color: #fff; background: #3a0f2a; }
button.pro:hover:not(:disabled) { background: #55143c; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.grid.one { grid-template-columns: 1fr; }
.row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.row > * { flex: 1; }
.hud { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.hud b { color: var(--accent); }
.bar { height: 8px; background: #1a2a4f; margin-bottom: 18px; }
.bar i { display: block; height: 100%; width: 100%; background: var(--accent); }
.q { font-size: clamp(20px, 5vw, 26px); line-height: 1.3; margin: 0 0 16px; min-height: 2.6em; }
input[type=text], input[type=email] { width: 100%; font: inherit; font-size: 18px; padding: 12px; background: #060d20; color: var(--ink); border: 2px solid #3b5278; outline: none; }
input[type=text]:focus, input[type=email]:focus { border-color: var(--line); }
.fb { min-height: 58px; margin-top: 14px; font-size: 15px; }
.fb .pts { font-size: 22px; font-weight: bold; }
.good { color: var(--ok); } .meh { color: var(--accent); } .none { color: var(--bad); }
small, .small { color: var(--muted); font-size: 12px; }
.rules { list-style: none; margin: 0 0 4px; padding: 0; font-size: 13px; line-height: 1.7; text-transform: uppercase; color: var(--muted); }
.rules b { color: var(--ink); }
#meter { position: fixed; right: 10px; top: 12vh; bottom: 12vh; width: 6px; background: rgba(255,255,255,.18); z-index: 5; }
#meter i { position: absolute; left: -7px; width: 20px; height: 20px; bottom: 0; transition: bottom 1s ease; font-style: normal; line-height: 20px; text-align: center; font-size: 18px; margin-bottom: -10px; }
#meter span { position: absolute; right: 16px; font-size: 10px; color: var(--muted); white-space: nowrap; }
#alt { position: fixed; left: 12px; top: 10px; font-size: 13px; background: var(--panel); border: 1px solid #3b5278; padding: 6px 10px; z-index: 5; }
#topbar { position: fixed; right: 10px; top: 8px; display: flex; gap: 6px; z-index: 6; }
#topbar button { width: auto; padding: 6px 10px; font-size: 15px; letter-spacing: 0; background: var(--panel); border-color: #3b5278; }
#topbar .badge { color: var(--pro); border-color: var(--pro); font-size: 12px; letter-spacing: .1em; }
.res h2 { margin: 0 0 4px; text-align: center; font-size: 22px; }
.big { text-align: center; font-size: clamp(40px, 11vw, 60px); font-weight: bold; color: var(--accent); margin: 4px 0; }
.verdict { text-align: center; color: var(--muted); margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td { padding: 7px 4px; border-top: 1px solid #243556; vertical-align: top; }
td.n { text-align: right; font-weight: bold; white-space: nowrap; }
td small { display: block; }
button.rep { width: auto; padding: 1px 6px; font-size: 12px; letter-spacing: 0; margin-top: 4px; border-color: transparent; }
.lb { margin-top: 16px; }
.lb h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: .15em; text-transform: uppercase; color: var(--line); }
.lb ol { margin: 0; padding-left: 22px; font-size: 14px; }
.lb li.me { color: var(--accent); font-weight: bold; }
.hidden { display: none !important; }
footer { text-align: center; font-size: 11px; color: var(--muted); margin-top: 18px; }
footer a { color: var(--muted); }
/* modal */
#modal { position: fixed; inset: 0; z-index: 20; background: rgba(2, 6, 18, .75); display: flex; align-items: center; justify-content: center; padding: 14px; }
#modal .box { background: #0a1228; border: 2px solid var(--line); max-width: 520px; width: 100%; max-height: 92vh; overflow: auto; padding: 18px; position: relative; }
#modal h2 { margin: 0 28px 12px 0; font-size: 18px; letter-spacing: .12em; text-transform: uppercase; }
#modal .x { position: absolute; right: 8px; top: 8px; width: auto; padding: 4px 10px; font-size: 16px; border-color: #3b5278; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 6px; border-top: 1px solid #243556; font-size: 14px; }
.item:first-of-type { border-top: 0; }
.item button { width: auto; padding: 8px 12px; font-size: 12px; }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin-bottom: 14px; }
.stats4 b { display: block; font-size: 24px; color: var(--accent); }
.dist div { display: flex; align-items: center; gap: 6px; font-size: 12px; margin: 3px 0; }
.dist i { display: block; height: 14px; background: var(--line); min-width: 2px; }
.pix { text-align: center; }
.pix img { width: 200px; height: 200px; background: #fff; padding: 6px; image-rendering: pixelated; }
.code { word-break: break-all; font-size: 11px; background: #060d20; border: 1px solid #3b5278; padding: 8px; margin: 8px 0; max-height: 84px; overflow: auto; text-align: left; }
.perks { margin: 0 0 12px; padding-left: 20px; font-size: 14px; line-height: 1.7; }
.price { font-size: 30px; font-weight: bold; color: var(--pro); text-align: center; margin: 4px 0; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0a1228; border: 2px solid var(--accent); padding: 10px 16px; z-index: 30; font-size: 14px; max-width: 90vw; }
@media (prefers-reduced-motion: reduce) { #sky, #stars, #meter i { transition: none; } }
@media (max-width: 420px) { .stats4 b { font-size: 18px; } }

/* tema claro "Dia" */
:root[data-theme="dia"] {
  --ink: #10223f; --muted: #4a5d7c; --panel: rgba(255, 255, 255, .92); --line: #1d6fb8; --accent: #b45f00; --ok: #17803d; --bad: #c62828; --pro: #c2185b;
  --sky: linear-gradient(to top, #ffe3b8 0%, #cfe8ff 25%, #8fc1f0 50%, #4a86cf 78%, #2a5596 100%);
  --m1: #7a9bc0; --m2: #5a7ba3;
}
:root[data-theme="dia"] body { background: #cfe8ff; }
:root[data-theme="dia"] h1 { text-shadow: 3px 0 #ffb3d1, -3px 0 #9fd8f5; }
:root[data-theme="dia"] button { background: #fff; color: var(--ink); }
:root[data-theme="dia"] button:hover:not(:disabled) { background: #e6f0fb; }
:root[data-theme="dia"] button.ghost { border-color: #8aa2c4; color: var(--muted); }
:root[data-theme="dia"] button.pro { background: #ffe0ee; color: #8a0f45; }
:root[data-theme="dia"] input[type=text], :root[data-theme="dia"] input[type=email] { background: #fff; border-color: #8aa2c4; color: var(--ink); }
:root[data-theme="dia"] .bar { background: #cfdcf0; }
:root[data-theme="dia"] td { border-top-color: #c5d3ea; }
:root[data-theme="dia"] #alt, :root[data-theme="dia"] #topbar button { border-color: #8aa2c4; }
:root[data-theme="dia"] #modal { background: rgba(20, 40, 80, .5); }
:root[data-theme="dia"] #modal .box { background: #f4f8ff; }
:root[data-theme="dia"] .panel { box-shadow: 0 0 24px rgba(29, 111, 184, .25); }
:root[data-theme="dia"] #meter { background: rgba(0, 0, 0, .2); }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* abertura (splash) enquanto carrega */
#boot { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(to top, #ff9e5e 0%, #5b4a9e 40%, #0b1530 100%); transition: opacity .35s; }
#boot b { font-size: clamp(54px, 16vw, 88px); letter-spacing: .14em; color: #eaf2ff; text-shadow: 3px 0 #ff4d8d, -3px 0 #4cc9f0; animation: bootpulse 1.4s ease-in-out infinite; }
#boot small { letter-spacing: .35em; color: #ffb703; font-weight: bold; }
#boot.hidden { display: block; opacity: 0; pointer-events: none; }
@keyframes bootpulse { 50% { transform: scale(1.04); } }

#upd { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #0a1228; color: var(--ink); border: 2px solid var(--accent); font-size: 13px; max-width: 94vw; }
#upd button { width: auto; padding: 6px 10px; font-size: 12px; }
#btnRepGame { width: auto; margin-top: 8px; font-size: 11px; padding: 4px 8px; letter-spacing: .05em; text-transform: none; }
:root[data-theme="dia"] #upd { background: #fff; }
