:root {
  --bg: #080c11;
  --bg-2: #0c1219;
  --panel: #0f161f;
  --panel-2: #131c27;
  --line: #1f2b38;
  --line-2: #2a3a4b;
  --text: #e6edf3;
  --muted: #8a9bb0;
  --faint: #5d6f84;
  --tek: #2dd4bf;
  --tek-2: #14b8a6;
  --amber: #f5b041;
  --violet: #a78bfa;
  --rose: #fb7185;
  --green: #4ade80;
  --sky: #38bdf8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Chakra Petch', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  background-image: radial-gradient(1200px 600px at 80% -10%, rgba(45, 212, 191, .07), transparent 60%),
                    radial-gradient(900px 500px at -10% 10%, rgba(245, 176, 65, .05), transparent 60%);
  background-attachment: fixed; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--tek); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: .01em; margin: 0 0 .4em; line-height: 1.1; }
h1 { font-size: clamp(30px, 5vw, 54px); text-transform: uppercase; }
h2 { font-size: 22px; text-transform: uppercase; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; padding: 22px 0 60px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--display); text-transform: uppercase; letter-spacing: .18em; font-size: 12px; color: var(--amber); margin-bottom: 10px; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.right { margin-left: auto; }
.center { text-align: center; }

/* ---------- topo */
.topbar { position: sticky; top: 0; z-index: 50; padding: 12px 0; background: linear-gradient(var(--bg) 60%, rgba(8, 12, 17, 0)); }
.nav { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: rgba(15, 22, 31, .92); backdrop-filter: blur(10px); border-radius: 18px; padding: 8px 10px 8px 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; letter-spacing: .2em; color: var(--text); text-transform: uppercase; margin-right: 10px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 2px; align-items: center; flex: 1; }
.nav-item { position: relative; }
.nav-link { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav-link.active { box-shadow: inset 0 -2px 0 var(--tek); }
.dropdown { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); display: none; }
.nav-item.open .dropdown { display: block; }
.dropdown a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); font-size: 14px; }
.dropdown a small { display: block; color: var(--muted); font-size: 12px; }
.dropdown a:hover { background: var(--panel-2); text-decoration: none; }
.nav-user { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); object-fit: cover; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--tek); border: 1px solid var(--line-2); }
.nav .menu-btn { display: none; }
@media (max-width: 860px) {
  .nav { flex-wrap: wrap; }
  .nav .menu-btn { display: inline-flex; margin-left: auto; }
  .nav-links { display: none; width: 100%; flex-direction: column; align-items: stretch; padding-top: 6px; }
  .nav.open .nav-links { display: flex; }
  .nav-user { margin-left: 0; }
  .nav.open .nav-user { width: 100%; }
  .dropdown { position: static; box-shadow: none; margin: 4px 0 4px 12px; }
}

/* ---------- botões e campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 14px var(--font); cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--tek); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--tek), var(--tek-2)); color: #04211d; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.amber { background: var(--amber); color: #2a1a00; border-color: transparent; }
.btn.danger { border-color: rgba(251, 113, 133, .4); color: var(--rose); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn.tab { text-transform: uppercase; font-family: var(--display); letter-spacing: .06em; padding: 12px 18px; border-radius: 13px; }
.btn.tab.active { border-color: var(--amber); color: var(--amber); background: rgba(245, 176, 65, .07); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-family: var(--display); }
input, select, textarea { font: 14px var(--font); color: var(--text); background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; width: 100%; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--tek); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: auto; }
input[type=range] { padding: 0; accent-color: var(--tek); }
.input-group { display: flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: var(--bg-2); }
.input-group input { border: 0; border-radius: 0; }
.input-group span { padding: 10px 14px; font: 600 11px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--tek); background: rgba(45, 212, 191, .07); border-left: 1px solid var(--line-2); display: flex; align-items: center; white-space: nowrap; }
.input-group.amber span { color: var(--amber); background: rgba(245, 176, 65, .07); }
.input-group.violet span { color: var(--violet); background: rgba(167, 139, 250, .08); }
.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .knob { flex: 0 0 auto; width: 42px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .15s; margin-top: 2px; }
.switch .knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #dbe4ee; transition: transform .15s; }
.switch input:checked + .knob { background: var(--tek-2); }
.switch input:checked + .knob::after { transform: translateX(18px); }
.switch b { display: block; font-size: 14px; }
.switch small { color: var(--muted); font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--muted); padding: 8px 12px; font: 600 12px var(--display); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.seg button.active { background: var(--panel-2); color: var(--tek); }

/* ---------- painéis */
.panel { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel.glow { border-color: rgba(245, 176, 65, .35); box-shadow: 0 0 0 1px rgba(245, 176, 65, .05), var(--shadow); }
.panel + .panel, .section + .section { margin-top: 18px; }
.grid > .panel + .panel, .grid > .panel { margin-top: 0; }
.section { margin-top: 30px; }
.section-title { font: 600 12px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px 4px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 980px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; } }
.stat { background: rgba(8, 12, 17, .55); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.stat .k { font: 600 11px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat .v { font: 700 21px var(--mono); margin: 6px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.wrapv .v { white-space: normal; font-size: 17px; line-height: 1.25; }
.stat .d { font-size: 12.5px; color: var(--muted); }
.stat.accent { border-top: 2px solid var(--amber); }
.stat.tek { border-top: 2px solid var(--tek); }
.stat.good { border-top: 2px solid var(--green); }
.stat.bad { border-top: 2px solid var(--rose); }
.badge { display: inline-flex; align-items: center; gap: 6px; font: 600 11px var(--display); letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--muted); }
.badge.tek { color: var(--tek); border-color: rgba(45, 212, 191, .4); }
.badge.amber { color: var(--amber); border-color: rgba(245, 176, 65, .4); }
.badge.rose { color: var(--rose); border-color: rgba(251, 113, 133, .4); }
.badge.green { color: var(--green); border-color: rgba(74, 222, 128, .4); }
.badge.violet { color: var(--violet); border-color: rgba(167, 139, 250, .4); }
.badge.sky { color: var(--sky); border-color: rgba(56, 189, 248, .4); }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 12px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ---------- hero */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; padding: 34px; }
.hero .art { position: absolute; right: -40px; top: 0; bottom: 0; width: 55%; opacity: .35; background-size: contain; background-position: right center; background-repeat: no-repeat; pointer-events: none; mask-image: linear-gradient(90deg, transparent, #000 40%); }
.hero > * { position: relative; }
.hero .lead { color: var(--muted); font-size: 16px; max-width: 560px; }
.hero .controls { display: grid; gap: 14px; align-content: start; border-top: 1px solid var(--line); padding-top: 16px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding: 22px; } .hero .art { width: 100%; opacity: .15; } }

/* ---------- tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 600 11px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(45, 212, 191, .03); }
td.num, th.num { text-align: right; font-family: var(--mono); }
.bar { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--tek-2), var(--tek)); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* ---------- seletor de espécie */
.species-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; margin-bottom: 18px; }
.picker { position: relative; flex: 1 1 340px; max-width: 400px; }
.picker-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; color: var(--text); cursor: pointer; text-align: left; font: inherit; height: 100%; }
.picker-btn:hover { border-color: var(--tek); }
.picker-btn img, .picker-btn .ph { width: 40px; height: 32px; object-fit: contain; }
.picker-btn b { display: block; font-size: 15px; }
.picker-btn small { color: var(--muted); font-size: 12px; }
.picker-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); padding: 10px; display: none; }
.picker.open .picker-pop { display: block; }
.picker-list { max-height: 360px; overflow: auto; margin-top: 8px; }
.picker-list button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 7px 8px; border: 0; background: none; color: var(--text); border-radius: 8px; cursor: pointer; text-align: left; font: 14px var(--font); }
.picker-list button:hover, .picker-list button.sel { background: var(--panel-2); }
.picker-list button small { color: var(--muted); margin-left: auto; font-size: 11px; }
.tabs { display: flex; gap: 10px; flex-wrap: wrap; flex: 2 1 480px; }
.tabs .btn.tab { flex: 1 1 140px; }

/* ---------- workshop: cores */
.dino-stage { position: relative; background: radial-gradient(circle at 50% 60%, rgba(45, 212, 191, .10), transparent 65%), var(--bg-2); border: 1px solid var(--line); border-radius: 14px; min-height: 320px; display: grid; place-items: center; padding: 16px; }
.dino-stage canvas { max-width: 100%; height: auto; }
.region { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8, 12, 17, .45); cursor: pointer; text-align: left; color: var(--text); font: inherit; width: 100%; }
.region:hover, .region.active { border-color: var(--tek); }
.region.disabled { opacity: .45; cursor: default; }
.swatch { width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .15); flex: 0 0 auto; }
.region small { display: block; color: var(--muted); font-size: 12px; }
.region .rn { font: 600 11px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 6px; max-height: 260px; overflow: auto; padding: 4px; }
.palette button { aspect-ratio: 1; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .12); cursor: pointer; padding: 0; position: relative; }
.palette button.sel { outline: 2px solid var(--tek); outline-offset: 1px; }
.palette button.natural::after { content: ''; position: absolute; inset: 0; border-radius: 6px; box-shadow: inset 0 0 0 2px rgba(245, 176, 65, .9); }
.stat-table td input { width: 70px; padding: 6px 8px; text-align: center; font-family: var(--mono); }
.stat-table .val { font: 700 16px var(--mono); }
.stat-table .delta { font-size: 12px; color: var(--muted); }
.solver { background: var(--bg-2); }
.solver td { padding: 10px 14px 14px; }

/* ---------- histórico / feed */
.feed-day { margin: 24px 0 10px; display: flex; gap: 10px; align-items: baseline; }
.feed-day h3 { margin: 0; text-transform: uppercase; font-size: 14px; letter-spacing: .1em; }
.feed-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.feed-item + .feed-item { margin-top: 10px; }
.feed-item .when { color: var(--muted); font-size: 13px; }
.feed-item h4 { margin: 6px 0; font-size: 16px; font-family: var(--font); }
.feed-item img { border-radius: 10px; margin-top: 8px; max-height: 220px; object-fit: cover; }
@media (max-width: 640px) { .feed-item { grid-template-columns: 1fr; gap: 6px; } }
.milestones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- mercado */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lcard { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); color: var(--text); }
.lcard:hover { border-color: var(--tek); text-decoration: none; }
.lcard .top { display: flex; gap: 12px; align-items: center; }
.lcard .thumb { width: 64px; height: 52px; object-fit: contain; flex: 0 0 auto; }
.lcard h3 { margin: 0; text-transform: uppercase; font-size: 15px; }
.lcard .price { font: 700 18px var(--mono); color: var(--amber); }
.statchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.statchips span { font: 600 12px var(--mono); text-align: center; padding: 4px 2px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); }
.statchips span i { display: block; font: 600 9px var(--display); letter-spacing: .08em; color: var(--faint); font-style: normal; text-transform: uppercase; }
.lcard .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.color-dots { display: flex; gap: 4px; }
.color-dots i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .15); }

/* ---------- linha do tempo / agenda */
.timeline { display: grid; gap: 0; }
.timeline .t { padding: 12px 14px; border-left: 2px solid var(--line-2); }
.timeline .t small { color: var(--muted); display: block; }
.timeline .t b { font-size: 15px; }
.timeline .t.done { border-left-color: var(--green); }
.timeline .t.done b { color: var(--green); }
.timeline .t.warn { border-left-color: var(--rose); }
.timeline .t.warn b { color: var(--rose); }
.projection { border: 1px solid rgba(45, 212, 191, .35); border-left: 3px solid var(--tek); border-radius: 12px; padding: 16px 18px; background: rgba(45, 212, 191, .04); }
.projection h3 { color: var(--tek); text-transform: uppercase; letter-spacing: .08em; }
.projection p { margin: 4px 0; font-size: 14px; }
.range-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.range-head b { font-family: var(--mono); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.split > :first-child { border-right: 1px solid var(--line); padding-right: 28px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .split > :first-child { border-right: 0; padding-right: 0; } }

/* ---------- KO */
.ko-row { display: grid; grid-template-columns: minmax(170px, 1.2fr) 110px minmax(0, 3fr); gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.ko-row + .ko-row { margin-top: 8px; }
.ko-row .zones { display: flex; gap: 8px; flex-wrap: wrap; }
.zone { min-width: 110px; padding: 8px 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.zone .zn { font: 600 10px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.zone .zv { font: 700 18px var(--mono); }
.zone .zx { font-size: 11.5px; color: var(--muted); }
.zone.kill { border-color: rgba(251, 113, 133, .45); }
.zone.kill .zv { color: var(--rose); font-size: 14px; }
.zone.low .zv { color: var(--amber); font-size: 14px; }
@media (max-width: 760px) { .ko-row { grid-template-columns: 1fr; } }

/* ---------- toast / modal */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line-2); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 100; max-width: calc(100% - 32px); }
.toast.err { border-color: var(--rose); }
.modal-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; }

/* ---------- rodapé */
footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted); font-size: 13px; }
footer .row { justify-content: space-between; }
footer nav { display: flex; gap: 14px; flex-wrap: wrap; }
footer nav a { color: var(--muted); }

.news-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.news-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); display: flex; flex-direction: column; color: var(--text); }
.news-card img { aspect-ratio: 870/450; object-fit: cover; width: 100%; display: block; }
.news-card div { padding: 10px 12px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.quick a { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); }
.quick a:hover { border-color: var(--tek); text-decoration: none; }
.quick a b { display: block; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; }
.quick a small { color: var(--muted); }
.chart { width: 100%; height: 220px; display: block; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line-2); border-top-color: var(--tek); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(245, 176, 65, .4); background: rgba(245, 176, 65, .06); color: var(--text); }
.notice.tek { border-color: rgba(45, 212, 191, .4); background: rgba(45, 212, 191, .05); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
