@font-face { font-family: Silkscreen; src: url(/fonts/silkscreen.woff2) format("woff2"); font-display: swap; }

:root {
  --bg: #0d1619; --panel: #14222a; --panel2: #1a2c35; --line: #244049; --ink: #e6eef0; --mute: #8fa6ac;
  --teal: #5ad3d6; --gold: #f0c46a; --warn: #f08a5d; --good: #5fc46a; --bad: #e0656a; --plate: #0a1114;
  --r0: #9aa3a8; --r1: #5fc46a; --r2: #4f9de0; --r3: #a66be0; --r4: #f0a03c;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3, .brand { font-family: Silkscreen, ui-monospace, monospace; font-weight: 400; letter-spacing: .4px; }
h1 { font-size: 28px; color: var(--gold); margin: 0 0 6px; }
h2 { font-size: 18px; color: var(--gold); margin: 0; }
h3 { font-size: 14px; color: var(--teal); margin: 0 0 8px; }
p { margin: 0 0 10px; }
a { color: var(--teal); }
small, .mute { color: var(--mute); }

/* Cabecera y pie, los mismos en la portada y en la comunidad */
.site-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px 20px; padding: 8px 20px; background: #0b1316f2; border-bottom: 1px solid var(--line); }
.site-brand img { display: block; height: 34px; width: auto; }
#site-nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#site-nav a { padding: 6px 10px; border-radius: 6px; font-size: 16px; color: var(--ink); text-decoration: none; white-space: nowrap; }
#site-nav a:hover { background: var(--panel2); }
#site-nav a[aria-current="page"] { color: var(--teal); }
.site-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.account { flex-wrap: wrap; justify-content: flex-end; }
.lang button { padding: 3px 7px; font-size: 12px; }
.account img { width: 26px; height: 26px; border-radius: 4px; }

/* Secciones de la comunidad */
#tabs { display: flex; gap: 4px; margin: 16px 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
#tabs a { padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--mute); text-decoration: none; white-space: nowrap; }
#tabs a:hover { color: var(--ink); }
#tabs a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--teal); }

main { max-width: 1240px; margin: 0 auto; padding: 0 20px 40px; }
.intro { max-width: 760px; color: var(--mute); margin-bottom: 14px; }
.foot { width: min(1200px, calc(100% - 40px)); margin: 24px auto 0; padding: 16px 0 28px; border-top: 1px solid var(--line); color: var(--mute); font-size: 12px; }

/* Controles */
button, .button { font: inherit; font-size: 13px; color: var(--ink); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .button:hover { border-color: var(--teal); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary, .button.primary { background: var(--teal); color: #06292b; border-color: var(--teal); font-weight: 600; }
button.ghost { background: transparent; }
button.danger:hover { border-color: var(--bad); color: var(--bad); }
input, select, textarea { font: inherit; color: var(--ink); background: #0d1a20; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; min-width: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
input[type=number] { width: 62px; text-align: center; }
input[type=checkbox] { accent-color: var(--teal); }
textarea { width: 100%; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--mute); }
label.field input, label.field select { color: var(--ink); width: 100%; }

/* Barra de filtros y barra de cambios */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { flex: 1; min-width: 180px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; }
.seg button[aria-pressed=true] { background: var(--teal); color: #06292b; font-weight: 600; }
.changes { position: sticky; top: 52px; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin-bottom: 14px; background: #2a2413; border: 1px solid var(--gold); border-radius: 8px; }
.changes b { color: var(--gold); margin-right: auto; }

/* Árbol */
.trees { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 14px; }
.tree, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.tree header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 8px; }
.flow { display: flex; gap: 10px; align-items: stretch; }
/* Cada columna parte del ancho de una cara y reparte el resto según cuántas caras tiene (--n). */
.col { display: flex; flex-direction: column; gap: 6px; flex: var(--n, 1) 1 90px; min-width: 90px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--mute); }
.arrow { font-size: 24px; color: var(--teal); align-self: center; }
.faces { display: flex; flex-wrap: wrap; gap: 6px; min-height: 20px; }
.empty { color: var(--mute); font-size: 12px; font-style: italic; }
.loose { margin-top: 16px; }
.loose .faces { margin-top: 10px; }
.count { font-size: 12px; color: var(--mute); font-family: system-ui, sans-serif; }

.face { position: relative; width: 84px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; background: transparent; border: 1px solid transparent; border-radius: 8px; color: var(--ink); cursor: pointer; }
.face:hover { border-color: var(--teal); background: var(--panel2); }
.face.changed { border-color: var(--gold); }
.face.dim { opacity: .28; }
.face .name { font-size: 12px; line-height: 1.2; }
.plate { width: 54px; height: 54px; border-radius: 8px; background: var(--plate); border: 2px solid var(--rar, #556); display: grid; place-items: center; box-shadow: inset 0 0 0 2px #0006; flex: none; }
.plate img { width: 48px; height: 48px; image-rendering: pixelated; }
.plate.big { width: 84px; height: 84px; }
.plate.big .ico { --s: 4; }
.plate.big img { width: 64px; height: 64px; }
.ico { --s: 3; width: calc(16px * var(--s)); height: calc(16px * var(--s)); background-image: url(/icons.png); background-repeat: no-repeat; background-size: calc(256px * var(--s)) calc(2048px * var(--s)); background-position: calc(var(--x) * var(--s) * -1px) calc(var(--y) * var(--s) * -1px); image-rendering: pixelated; }
.dots { display: flex; gap: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; display: block; background: var(--c); }

/* Diálogo */
dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 16px; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: #000a; }
.dlg-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.dlg-head h2 { flex: 1; }
.tiers { display: grid; gap: 6px; margin-bottom: 14px; }
.tier { display: flex; gap: 8px; font-size: 13px; }
.chip { display: inline-block; flex: none; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; color: #0b1316; background: var(--c, var(--mute)); }
.chip.outline { background: transparent; color: var(--c, var(--mute)); border: 1px solid var(--c, var(--line)); }
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 6px 14px; margin-bottom: 10px; }
.role-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.role-row select { width: 120px; }
.role-row.on span { color: var(--gold); }
.dlg-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.warn { color: var(--warn); font-size: 13px; margin: 6px 0; padding-left: 18px; }
.err { color: var(--bad); font-size: 13px; margin: 6px 0; padding-left: 18px; }

/* Selector de iconos */
.icon-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.icon-tools input[type=search] { flex: 1; min-width: 160px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 4px; height: 56vh; align-content: start; overflow: auto; padding: 2px; }
.icon-btn { padding: 4px; justify-content: center; background: var(--plate); }
.icon-btn[aria-pressed=true] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.icon-btn .ico { --s: 2.5; }

/* Configurador */
.forge { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.steps { display: grid; gap: 12px; min-width: 0; }
.step h3 span { color: var(--gold); margin-right: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.icon-pick { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.rar-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.rar-pick { display: inline-flex; gap: 6px; align-items: center; padding: 4px 9px; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; font-size: 13px; }
.rar-pick:has(input:checked) { border-color: var(--c); color: var(--c); }
.effect { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; }
.effect-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) auto auto; gap: 8px; align-items: end; }
.effect .hint { font-size: 12px; color: var(--mute); margin: 6px 0; }
.table-wrap { overflow-x: auto; }
.values { border-collapse: collapse; font-size: 13px; }
.values th { font-weight: 400; color: var(--mute); text-align: left; padding: 2px 8px 2px 0; white-space: nowrap; }
.values thead th { text-align: center; padding: 2px 2px 4px; font-size: 11px; color: var(--c); }
.values td { padding: 2px; }
.pct { display: inline-flex; align-items: center; gap: 4px; color: var(--mute); font-size: 13px; }
.pct input { width: 58px; }
.tree-pick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.options { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

.preview { position: sticky; top: 64px; display: grid; gap: 10px; }
.card-preview { text-align: center; display: grid; justify-items: center; gap: 6px; }
.card-preview .desc { font-size: 14px; min-height: 60px; }
.card-preview .flavor { font-size: 13px; font-style: italic; color: var(--mute); }
.rar-switch { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.rar-switch button { padding: 2px 7px; font-size: 11px; border-color: var(--c); color: var(--c); background: transparent; }
.rar-switch button[aria-pressed=true] { background: var(--c); color: #0b1316; font-weight: 600; }
.actions { display: grid; gap: 6px; }
.actions button { justify-content: center; }

/* Propuestas */
.proposals { display: grid; gap: 10px; }
.prop { display: grid; grid-template-columns: 52px auto minmax(0, 1fr); gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.vote { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vote button { width: 36px; height: 30px; justify-content: center; padding: 0; }
.vote button[aria-pressed=true].up { background: var(--good); color: #06210a; border-color: var(--good); }
.vote button[aria-pressed=true].down { background: var(--bad); color: #2a0608; border-color: var(--bad); }
.vote b { font-size: 16px; }
.vote b.pos { color: var(--good); }
.vote b.neg { color: var(--bad); }
.prop-body { min-width: 0; }
.prop-title { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-bottom: 2px; }
.prop .meta { font-size: 12px; color: var(--mute); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prop .meta img { width: 16px; height: 16px; border-radius: 3px; }
.prop .note { font-size: 13px; border-left: 2px solid var(--line); padding-left: 8px; margin: 6px 0; color: var(--mute); overflow-wrap: anywhere; }
.prop ul { margin: 4px 0; padding-left: 18px; font-size: 13px; }
.prop .rar-switch { justify-content: flex-start; margin-bottom: 6px; }
.prop-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.status-accepted { --c: var(--good); }
.status-rejected { --c: var(--bad); }
.status-open { --c: var(--mute); }

.loading { color: var(--mute); }
.none { padding: 24px; text-align: center; color: var(--mute); background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--teal); padding: 8px 14px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; }
.toast.bad { border-color: var(--bad); }

/* Wiki */
.soon { display: block; font-family: Silkscreen, ui-monospace, monospace; font-weight: 400; font-size: 18px; color: var(--gold); margin-bottom: 6px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; min-width: 0; }
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card p { font-size: 14px; color: #c9d6da; margin: 0; }
.biome .sub { font-size: 13px; color: var(--mute); margin-bottom: 8px; }
.biome .label { margin-top: 10px; display: block; }
.minis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 8px 3px 4px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel2); }
.mini img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.enemy-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.enemy-tools input[type=search] { flex: 1; min-width: 200px; }
.enemies { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.enemy { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: start; }
.enemy .portrait { width: 72px; height: 72px; display: grid; place-items: center; background: var(--plate); border-radius: 8px; border: 1px solid var(--line); }
.enemy .portrait img { max-width: 64px; max-height: 64px; image-rendering: pixelated; }
.enemy h3 { font-size: 14px; }
.enemy .stats { font-size: 12px; color: var(--mute); margin-bottom: 4px; }
.enemy .stats b { color: var(--ink); font-weight: 600; }
.enemy .style { font-size: 12px; color: var(--gold); }
.enemy .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.enemy .tag { font-size: 11px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); color: var(--mute); }
.enemy .tag.fx { border-color: #4f9de066; color: #9fcbf5; }
.relic-rarities { justify-content: flex-start; margin-bottom: 12px; }
.relic .portrait { border-color: var(--c); }
.relic-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 2px 0 4px; }
.relic .tag { font-size: 11px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); color: var(--mute); white-space: nowrap; }
.relic .tag.elite { border-color: #e0b04f66; color: #f2cf86; }
.relic .desc { font-size: 13px; margin-top: 4px; }
.statuses { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 8px; }
.status-card { display: grid; gap: 2px; }
.status-card b { color: var(--teal); }
.status-card span { font-size: 14px; color: #c9d6da; }

@media (max-width: 900px) {
  .forge { grid-template-columns: minmax(0, 1fr); }
  .preview { position: static; order: -1; }
  .site-top { padding: 8px 16px; flex-wrap: wrap; }
  #site-nav { order: 3; flex-basis: 100%; }
  main { padding: 0 16px 32px; }
  .foot { width: calc(100% - 32px); }
  .changes { top: 96px; }
}
@media (max-width: 600px) {
  h1 { font-size: 22px; }
  .flow { flex-direction: column; }
  .col { flex: none; }
  .arrow { transform: rotate(90deg); align-self: flex-start; line-height: 1; }
  .effect-head { grid-template-columns: minmax(0, 1fr); }
  .prop { grid-template-columns: 44px minmax(0, 1fr); }
  .prop > .plate { display: none; }
  .site-brand img { height: 28px; }
}
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
