/* Táticas do Vazio — same visual world as the prototype: the altar over the void.
   Single dark theme by choice. */
:root {
  --void: #0d0a14; --abyss: #16111f; --deep: #1d1729; --line: #2c2540;
  --bone: #e8dfcf; --ash: #a69db6;
  --ember: #ff8a3d; --rift: #9a86ff; --blood: #d4545a; --moss: #8fb06a; --water: #6fb7c9;
  --c1: #a69db6; --c2: #8fb06a; --c3: #6fb7c9; --c4: #c58bff; --c5: #ff8a3d;
  --f-display: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --f-body: "Spectral", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--void); color: var(--bone); }
[hidden] { display: none !important; }
body { font-family: var(--f-body); font-size: 16px; line-height: 1.5; min-height: 100vh; }
button { font: inherit; color: inherit; }
img.px, canvas { image-rendering: pixelated; }

.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--rift); }
h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.6rem, 7vw, 4.4rem); line-height: 1; margin: 0; }
h1 em { color: var(--rift); font-style: italic; }
h2 { font-family: var(--f-display); font-weight: 400; font-size: 1.9rem; line-height: 1.1; margin: 0; }
.lede { margin: 0; color: var(--ash); }
.hint { margin: 0; color: var(--ash); font-family: var(--f-mono); font-size: 12px; }

.btn { font-family: var(--f-mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; background: transparent; color: var(--ember); border: 1px solid var(--ember); padding: 11px 18px; cursor: pointer; }
.btn:hover { background: rgba(255, 138, 61, .12); }
.btn.primary { background: var(--ember); color: var(--void); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { color: var(--ash); border-color: var(--line); }
.btn.small { padding: 6px 10px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .act:focus-visible, .card:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }

/* ---------------------------------------------------------------- menu & lobby */
.screen.menu, .screen.lobby { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.menu-card { width: min(520px, 100%); display: flex; flex-direction: column; gap: 16px; border: 1px solid var(--line); background: var(--abyss); padding: 28px 24px; }
.menu-card.wide { width: min(640px, 100%); }
.field { display: flex; flex-direction: column; gap: 6px; font-family: var(--f-mono); font-size: 12px; color: var(--ash); }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
input, select { font-family: var(--f-mono); font-size: 15px; background: var(--void); color: var(--bone); border: 1px solid var(--line); padding: 10px 12px; }
select { padding: 7px 10px; }
.menu-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.join { display: flex; gap: 6px; }
.join input { width: 110px; text-transform: uppercase; letter-spacing: .2em; text-align: center; }
.code-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.code-row b { font-family: var(--f-mono); color: var(--ember); letter-spacing: .15em; }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.members li { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); background: var(--void); padding: 8px 12px; font-family: var(--f-mono); font-size: 13px; }
.members li .tag { color: var(--ash); font-size: 11px; }
.members li .tag.host { color: var(--ember); }
.members li.off { opacity: .55; }
.settings { display: grid; gap: 10px; }

/* ---------------------------------------------------------------- game layout */
.screen.game { padding: 10px 14px 24px; display: flex; flex-direction: column; gap: 10px; max-width: 1500px; margin: 0 auto; }
.topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; border: 1px solid var(--line); background: var(--abyss); padding: 8px 12px; }
.stage { display: flex; align-items: center; gap: 4px; font-family: var(--f-mono); font-size: 11px; }
.stage .lbl { color: var(--ash); margin-right: 6px; letter-spacing: .08em; }
.rd { position: relative; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); color: var(--ash); background: var(--void); }
.rd svg { width: 16px; height: 16px; }
.rd.done { opacity: .45; }
.rd.now { border-color: var(--ember); color: var(--ember); box-shadow: 0 0 0 1px var(--ember) inset; }
.rd .rd-aug { position: absolute; top: -4px; right: -4px; width: 8px; height: 8px; background: var(--rift); transform: rotate(45deg); }
.phase { min-width: 0; }
.phase-row { display: flex; justify-content: space-between; gap: 10px; font-family: var(--f-mono); font-size: 12px; }
.phase-row b { font-weight: 500; color: var(--bone); letter-spacing: .06em; }
.phase-row span { color: var(--ash); font-variant-numeric: tabular-nums; }
.timer { height: 4px; background: rgba(255, 255, 255, .08); margin-top: 5px; }
.timer-fill { height: 100%; width: 0; background: var(--ember); }
.room { font-family: var(--f-mono); font-size: 12px; color: var(--ash); }
.room b { color: var(--bone); letter-spacing: .12em; }

.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr) 240px; gap: 12px; align-items: start; }
@media (max-width: 1180px) { .layout { grid-template-columns: 210px minmax(0, 1fr); } .side.right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 780px) { .layout { grid-template-columns: minmax(0, 1fr); } .side.left { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } .topbar { grid-template-columns: minmax(0, 1fr); } }
.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel { border: 1px solid var(--line); background: var(--abyss); padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; font-family: var(--f-mono); font-size: 12px; min-width: 0; }
.panel h4 { margin: 0; font-weight: 500; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ash); }
.stat { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ash); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.track { height: 6px; background: rgba(255, 255, 255, .08); }
.fill { height: 100%; transition: width .3s; }
.f-hp { background: var(--blood); } .f-san { background: var(--rift); } .f-xp { background: var(--water); }
.row2 { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.gold { color: var(--ember); font-size: 20px; font-weight: 600; }
.big { font-size: 15px; color: var(--bone); }
.aug-mini { color: var(--rift); font-size: 11px; text-align: right; }
.trait { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid rgba(44, 37, 64, .6); }
.trait:last-child { border-bottom: 0; }
.trait i { width: 10px; height: 10px; transform: rotate(45deg); display: block; opacity: .35; }
.trait.on i { opacity: 1; }
.trait b { font-weight: 500; color: var(--ash); } .trait.on b { color: var(--bone); }
.trait em { font-style: normal; color: var(--ash); font-size: 11px; }
.trait small { grid-column: 2 / 4; color: var(--ash); font-size: 10.5px; line-height: 1.35; }
.empty { color: var(--ash); font-size: 11px; line-height: 1.5; }

.center { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.board { position: relative; border: 1px solid var(--line); background: #07060c; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
#cv { display: block; width: 100%; cursor: grab; }
.opp { position: absolute; left: 10px; top: 8px; font-family: var(--f-mono); font-size: 12px; color: var(--ash); display: flex; align-items: center; gap: 8px; pointer-events: none; }
.opp img { width: 28px; height: 28px; }
.opp b { color: var(--blood); font-weight: 500; }
.scout { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: rgba(13, 10, 20, .85); border: 1px solid var(--rift); padding: 5px 8px 5px 12px; font-family: var(--f-mono); font-size: 12px; white-space: nowrap; }
.banner { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-family: var(--f-display); font-size: clamp(1.6rem, 4.5vw, 2.6rem); text-shadow: 0 3px 12px #000; pointer-events: none; text-align: center; line-height: 1.1; }
.banner small { display: block; font-family: var(--f-mono); font-size: 13px; color: var(--ash); margin-top: 6px; }
.banner.win { color: var(--ember); } .banner.lose { color: var(--blood); } .banner.draw { color: var(--ash); }
.spectate { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: min(92%, 520px); text-align: center; background: rgba(13, 10, 20, .85); border: 1px solid var(--line); padding: 8px 12px; font-family: var(--f-mono); font-size: 12px; color: var(--ash); }

.shopbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
@media (max-width: 640px) { .shopbar { grid-template-columns: 1fr 1fr; } .shop { grid-column: 1 / -1; grid-row: 1; } }
.acts { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 640px) { .acts { flex-direction: row; } }
.act { font-family: var(--f-mono); font-size: 11.5px; background: var(--abyss); border: 1px solid var(--line); color: var(--bone); padding: 8px 10px; cursor: pointer; text-align: left; display: flex; justify-content: space-between; gap: 10px; flex: 1; align-items: center; }
.act b { color: var(--ember); font-weight: 500; }
.act:disabled { opacity: .45; cursor: not-allowed; }
.act[aria-pressed="true"] { border-color: var(--ember); color: var(--ember); }
.act.ready[aria-pressed="true"] { background: var(--ember); color: var(--void); }
.shop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; min-width: 0; position: relative; }
.shop.selling::after { content: "Solte aqui para vender"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(212, 84, 90, .2); border: 1px dashed var(--blood); color: var(--bone); font-family: var(--f-mono); font-size: 12px; pointer-events: none; }
.card { position: relative; background: var(--abyss); border: 1px solid var(--line); border-top: 3px solid var(--cc, var(--c1)); color: var(--bone); padding: 6px 6px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; font-family: var(--f-mono); }
.card:hover:not(:disabled) { background: var(--deep); }
.card:disabled { cursor: not-allowed; opacity: .5; }
.card.gone { visibility: hidden; }
.card.owned { box-shadow: 0 0 0 1px var(--rift) inset; }
.card.upgrade { box-shadow: 0 0 0 2px var(--ember) inset; }
.card img { width: 52px; height: 52px; }
.card .nm { font-family: var(--f-display); font-size: 14px; line-height: 1.1; text-align: center; min-height: 2.2em; display: flex; align-items: center; }
.card .tr { font-size: 9.5px; color: var(--ash); text-align: center; line-height: 1.3; }
.card .ct { font-size: 12px; color: var(--ember); font-weight: 600; }
.detail { border: 1px solid var(--line); background: var(--abyss); padding: 10px 12px; font-family: var(--f-mono); font-size: 12px; color: var(--ash); min-height: 70px; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.detail .dn { font-family: var(--f-display); font-size: 20px; color: var(--bone); }
.detail .chip { display: inline-block; border: 1px solid var(--line); padding: 1px 7px; margin-right: 4px; font-size: 11px; }
.detail .ab { flex-basis: 100%; color: var(--bone); }
.detail .ab b { color: var(--rift); font-weight: 500; }
.detail .its { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.detail .it { display: flex; gap: 6px; align-items: center; color: var(--bone); }
.detail b { color: var(--bone); font-weight: 500; }
.sell { font-family: var(--f-mono); font-size: 11.5px; background: none; border: 1px solid var(--blood); color: var(--blood); padding: 5px 10px; cursor: pointer; margin-left: auto; }
.ico { display: inline-block; width: 24px; height: 24px; background-repeat: no-repeat; image-rendering: pixelated; flex: none; border: 1px solid var(--line); }
.ico.done { border-color: #d9a066; }

.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pl { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 6px; border: 1px solid transparent; cursor: pointer; background: var(--void); }
.pl:hover { border-color: var(--line); }
.pl.me { border-color: rgba(255, 138, 61, .5); }
.pl.viewing { border-color: var(--rift); }
.pl.versus { box-shadow: 0 0 0 1px var(--blood) inset; }
.pl.out { opacity: .45; }
.pl img { width: 30px; height: 30px; }
.pl .nm { display: flex; flex-direction: column; min-width: 0; }
.pl .nm b { font-weight: 500; color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl .nm span { color: var(--ash); font-size: 10.5px; }
.pl .hp { font-size: 15px; font-weight: 600; color: var(--bone); font-variant-numeric: tabular-nums; text-align: right; }
.pl .hp small { display: block; font-size: 10px; font-weight: 400; color: var(--ash); }
.pl .hpbar { grid-column: 2 / 4; height: 3px; background: rgba(255, 255, 255, .08); }
.pl .hpbar i { display: block; height: 100%; background: var(--blood); }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; color: var(--ash); font-size: 11px; }

/* ---------------------------------------------------------------- overlays */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(8, 6, 14, .78); }
.modal { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--line); background: var(--abyss); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.car-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.car { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 4px 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--void); padding: 8px; cursor: pointer; font-family: var(--f-mono); font-size: 11px; color: var(--ash); }
.car img { width: 48px; height: 48px; grid-row: 1 / 3; }
.car b { font-family: var(--f-display); font-size: 15px; font-weight: 400; color: var(--bone); }
.car .ci { display: flex; gap: 6px; align-items: center; }
.car:disabled { cursor: default; }
.car.taken { opacity: .4; }
.car.mine { border-color: var(--ember); opacity: 1; }
.car.can:hover { border-color: var(--ember); background: var(--deep); }
.car .by { grid-column: 1 / -1; color: var(--rift); }
.car-waves { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-family: var(--f-mono); font-size: 11px; color: var(--ash); }
.car-waves li { border: 1px solid var(--line); padding: 3px 8px; }
.car-waves li.now { border-color: var(--ember); color: var(--ember); }
.aug-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .aug-grid, .car-grid { grid-template-columns: minmax(0, 1fr); } }
.aug { text-align: left; border: 1px solid var(--line); border-top: 3px solid var(--rift); background: var(--void); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.aug:hover { border-color: var(--rift); background: var(--deep); }
.aug b { font-family: var(--f-display); font-size: 1.3rem; font-weight: 400; color: var(--bone); }
.aug span { font-size: .95rem; color: var(--ash); }
.standings { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.standings li { display: grid; grid-template-columns: 44px 36px minmax(0, 1fr); gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--void); padding: 6px 10px; font-family: var(--f-mono); }
.standings li.me { border-color: var(--ember); }
.standings .pos { font-family: var(--f-display); font-size: 1.5rem; color: var(--ember); }
.standings img { width: 36px; height: 36px; }
/* ---------------------------------------------------------------- phase 1 additions */
.prefs { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.avatar-pick { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 520px) { .avatar-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.avatar-pick button { background: var(--void); border: 1px solid var(--line); padding: 4px; cursor: pointer; display: grid; place-items: center; aspect-ratio: 1; }
.avatar-pick button img { width: 100%; max-width: 48px; image-rendering: pixelated; }
.avatar-pick button[aria-checked="true"] { border-color: var(--ember); box-shadow: 0 0 0 1px var(--ember) inset; background: var(--deep); }
.avatar-pick button:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }
.members li img { width: 26px; height: 26px; image-rendering: pixelated; vertical-align: middle; margin-right: 8px; }
.fenda-chip { font-family: var(--f-mono); font-size: 11px; color: var(--rift); border: 1px solid var(--rift); padding: 2px 8px; margin-right: 10px; cursor: help; }
.odds { display: flex; gap: 8px; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.odds span { color: var(--ash); }
.interest { color: var(--ember); font-size: 10.5px; opacity: .8; }
.dmg { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.dmg li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: 11px; }
.dmg li img { width: 22px; height: 22px; image-rendering: pixelated; }
.dmg li.dead { opacity: .45; }
.dmg .bar { height: 6px; background: rgba(255, 255, 255, .06); }
.dmg .bar i { display: block; height: 100%; background: var(--ember); }
.dmg b { font-weight: 500; color: var(--bone); font-variant-numeric: tabular-nums; }
.car-hint { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); max-width: 92%; text-align: center; background: rgba(13, 10, 20, .85); border: 1px solid var(--line); padding: 6px 12px; font-family: var(--f-mono); font-size: 12px; color: var(--bone); pointer-events: none; }
.car-hint.mine { border-color: var(--ember); color: var(--ember); }
.emotes { position: absolute; right: 8px; top: 8px; display: flex; gap: 4px; }
.emotes button { font-family: var(--f-mono); font-size: 11px; background: rgba(13, 10, 20, .8); border: 1px solid var(--line); color: var(--ash); padding: 3px 7px; cursor: pointer; }
.emotes button:hover { color: var(--bone); border-color: var(--ash); }
.emotes button:focus-visible { outline: 2px solid var(--bone); }
.aug.t-prata { border-top-color: #c9d4e0; }
.aug.t-ouro { border-top-color: #d9a066; }
.aug.t-prismatico { border-top: 3px solid transparent; border-image: linear-gradient(90deg, #ff7ad9, #9a86ff, #6fb7c9) 1; }
.aug .tier { font-family: var(--f-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ash); }
.aug.voted { border-color: var(--ember); background: var(--deep); }
.aug .voters { display: flex; gap: 4px; flex-wrap: wrap; min-height: 24px; }
.aug .voters img { width: 24px; height: 24px; image-rendering: pixelated; }
#augTitle.t-prata { color: #c9d4e0; } #augTitle.t-ouro { color: #d9a066; } #augTitle.t-prismatico { color: #ff9ae0; }
.recipes { flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 4px 12px; }
.recipes span { display: flex; gap: 6px; align-items: center; color: var(--bone); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30; background: var(--abyss); border: 1px solid var(--blood); padding: 10px 16px; font-family: var(--f-mono); font-size: 13px; max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: reduce) { .fill { transition: none; } }
