/* Pokedex
   Paleta tomada del tema del cliente de PokeMMO (data/themes/default):
   paneles grafito, cabecera pizarra #425a69 y el azul de sus botones #4a79ce. */

:root {
    --bg: #1d2124;
    --panel: #272c30;
    --panel-2: #30363b;
    --field: #202528;
    --line: #363d42;
    --line-2: #465058;
    --head: #425a69;
    --head-line: #58778a;
    --text: #e6ebee;
    --text-2: #a5b1b8;
    --text-3: #77858d;
    --accent: #5db1ff;
    --blue: #4a79ce;
    --good: #5cbf5c;
    --bad: #ee8668;
    --radius: 6px;
    --bar-h: 52px;
    --tabs-h: 60px;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.num { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------
   Estructura: barra superior, contenido y pestañas
   --------------------------------------------------------------- */

.screen { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(var(--tabs-h) + var(--safe-b)); }

.bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 2px;
    height: calc(var(--bar-h) + var(--safe-t));
    padding: var(--safe-t) 6px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.bar-title {
    flex: 1;
    min-width: 0;
    padding: 0 10px;
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bar-logo { width: 28px; height: 28px; margin-left: 10px; }
.bar-logo + .bar-title { padding-left: 8px; }
.bar-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--text);
}
.bar-btn:active { background: var(--panel-2); }
.bar-actions { display: flex; align-items: center; gap: 4px; padding-right: 6px; }

.main { max-width: 760px; margin: 0 auto; padding-bottom: 28px; }
.main-wide { max-width: 1280px; }

.tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    height: calc(var(--tabs-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: var(--panel);
    border-top: 1px solid var(--line);
    -webkit-user-select: none;
    user-select: none;
}
.tabs-brand { display: none; }
.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-3);
    font-size: 11.5px;
    font-weight: 500;
    touch-action: manipulation;
}
.tab-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 30px;
    border-radius: 15px;
    transition: background-color .15s ease;
}
.tab:active .tab-icon { background: var(--panel-2); }
.tab.is-active { color: var(--text); }
.tab.is-active .tab-icon { background: var(--head); color: #fff; }

@media (min-width: 900px) {
    .tabs {
        top: 0;
        right: auto;
        width: 92px;
        height: auto;
        flex-direction: column;
        justify-content: flex-start;
        gap: 4px;
        padding: 14px 0;
        border-top: 0;
        border-right: 1px solid var(--line);
    }
    .tabs-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding-bottom: 18px;
        color: var(--text);
        font-size: 12px;
        font-weight: 600;
    }
    .tab { flex: none; height: 66px; }
    .screen { margin-left: 92px; padding-bottom: 0; }
    .bar-logo { display: none; }
    .bar-logo + .bar-title { padding-left: 10px; }
}

/* ---------------------------------------------------------------
   Bloques
   --------------------------------------------------------------- */

.section { margin-top: 22px; }
.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px 7px;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.section-title a, .section-title span { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }

.box { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.box-pad { padding: 14px 16px; }
.box + .box { margin-top: 12px; }
@media (min-width: 600px) {
    .box { margin: 0 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
}

.pad { padding: 0 16px; }
.mt { margin-top: 14px; }
.stack { display: grid; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; }

.flash { margin: 12px 16px 0; padding: 10px 12px; border: 1px solid; border-radius: var(--radius); font-size: 14px; }
.flash-ok { background: #1f3022; border-color: #2f6234; color: #bfe6c1; }
.flash-error { background: #382224; border-color: #7a3c3f; color: #f5b8b6; }
.flash-info { background: #1f2b36; border-color: #375a78; color: #bcd7f0; }

.empty { padding: 44px 24px; text-align: center; color: var(--text-2); }
.empty p + .btn, .empty p + p, .empty .btn + p { margin-top: 14px; }
.empty-code { margin: 0 0 6px; color: var(--line-2); font: 700 44px/1 var(--mono); }

/* ---------------------------------------------------------------
   Listas
   --------------------------------------------------------------- */

.list { margin: 0; padding: 0; list-style: none; }
.row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 6px 16px;
    color: var(--text);
    border-bottom: 1px solid var(--line);
}
.list > li:last-child > .row, .list > .row:last-child { border-bottom: 0; }
a.row:active, button.row:active { background: var(--panel-2); }
.row-img { width: 48px; height: 48px; flex: none; object-fit: contain; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 2px; color: var(--text-2); font-size: 13px; }
.row-end { flex: none; color: var(--text-3); font-size: 13px; text-align: right; }
.row-chev { width: 18px; height: 18px; color: var(--text-3); }
.row-num { width: 38px; flex: none; }

button.row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; }

.count { padding: 10px 16px 0; color: var(--text-3); font-size: 13px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px; }
.pager-info { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; }
.btn.is-disabled { opacity: .35; pointer-events: none; }

/* ---------------------------------------------------------------
   Tipos
   --------------------------------------------------------------- */

.t-normal   { --tc: #9b9b73; }
.t-fire     { --tc: #e2772f; }
.t-water    { --tc: #5f87e6; }
.t-grass    { --tc: #6bb246; }
.t-electric { --tc: #d9b22b; }
.t-ice      { --tc: #6ec2c2; }
.t-fighting { --tc: #b8352b; }
.t-poison   { --tc: #9a449a; }
.t-ground   { --tc: #cba552; }
.t-flying   { --tc: #9584dd; }
.t-psychic  { --tc: #e65a85; }
.t-bug      { --tc: #9aab2a; }
.t-rock     { --tc: #ad993c; }
.t-ghost    { --tc: #6c5894; }
.t-dragon   { --tc: #6c41e6; }
.t-dark     { --tc: #6b5547; }
.t-steel    { --tc: #a3a3bd; }

.type {
    display: inline-block;
    min-width: 66px;
    padding: 2px 6px;
    border-radius: 3px;
    background: var(--tc);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    letter-spacing: .03em;
    text-align: center;
    text-transform: uppercase;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .45);
    white-space: nowrap;
}
.type-sm { min-width: 0; padding: 1px 5px; font-size: 10px; line-height: 14px; }
.types { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--tc); }

/* ---------------------------------------------------------------
   Controles
   --------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 18px;
    border: 1px solid #5d8ad8;
    border-bottom-color: #3a62ab;
    border-radius: var(--radius);
    background: var(--blue);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    touch-action: manipulation;
}
.btn:active { filter: brightness(.9); }
.btn svg { width: 18px; height: 18px; stroke-width: 2; }
.btn-ghost { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.btn-danger { background: transparent; border-color: #74393b; color: #f0928e; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 34px; padding: 0; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font-size: inherit; }

.seg {
    display: flex;
    margin: 12px 16px 0;
    padding: 3px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}
.seg a, .seg button {
    flex: 1;
    padding: 7px 4px;
    border: 0;
    border-radius: 5px;
    background: none;
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}
.seg .is-active { background: var(--head); color: #fff; }
/* Con cuatro o más opciones, cada una ocupa lo que mide su texto */
.seg:has(> :nth-child(4)) a { flex: 1 1 auto; padding-left: 8px; padding-right: 8px; }
@media (max-width: 389px) {
    .seg a, .seg button { font-size: 13.5px; }
}
@media (max-width: 339px) {
    .seg a, .seg button { font-size: 12.5px; }
    .seg:has(> :nth-child(4)) a { padding-left: 6px; padding-right: 6px; }
}

.search {
    position: sticky;
    top: calc(var(--bar-h) + var(--safe-t));
    z-index: 10;
    padding: 10px 16px;
    background: var(--bg);
}
.search-box { position: relative; }
.search-box svg { position: absolute; top: 50%; left: 12px; width: 18px; height: 18px; color: var(--text-3); transform: translateY(-50%); pointer-events: none; }
.search-box .input { padding-left: 38px; }
.search-box .input::-webkit-search-cancel-button { filter: invert(.6); }

/* Las filas de filtros bajan de línea si no caben: nada queda cortado en el borde */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: 16px;
    background: var(--panel);
    color: var(--text-2);
    font-size: 13.5px;
    white-space: nowrap;
}
.chip.is-active { background-color: var(--head); border-color: var(--head-line); color: #fff; }
/* Tipo elegido: el chip toma el color del tipo, como las etiquetas */
.chip-type.is-active { background-color: var(--tc); border-color: var(--tc); text-shadow: 0 1px 1px rgba(0, 0, 0, .45); }
.chip-type option { background: var(--panel); color: var(--text); text-shadow: none; }
.chip-sub { height: 28px; padding: 0 10px; font-size: 13px; }
button.chip { cursor: pointer; }
select.chip {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5b1b8' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 15px;
}

.subtabs {
    position: sticky;
    top: calc(var(--bar-h) + var(--safe-t));
    z-index: 10;
    display: flex;
    padding: 0 6px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.subtabs a {
    flex: 1;
    padding: 12px 4px 10px;
    border-bottom: 2px solid transparent;
    color: var(--text-2);
    font-size: 14.5px;
    font-weight: 500;
    text-align: center;
}
.subtabs a.is-active { color: var(--text); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------
   Formularios
   --------------------------------------------------------------- */

.form { display: grid; gap: 16px; padding: 16px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-row-1 { grid-template-columns: minmax(0, 1fr); }
.field { display: grid; gap: 6px; min-width: 0; }
.label, .field > span { color: var(--text-2); font-size: 13px; font-weight: 500; }
.input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--field);
    color: var(--text);
    font-size: 16px;
    min-width: 0;
}
.input:focus { outline: 2px solid rgba(93, 177, 255, .45); outline-offset: 0; border-color: var(--accent); }
textarea.input { height: auto; min-height: 130px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select.input {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5b1b8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 18px;
}
.hint, .field > .hint { color: var(--text-3); font-size: 12.5px; font-weight: 400; }
.field-error, .field > .field-error { color: #f0928e; font-size: 13px; font-weight: 400; }
.input.is-invalid { border-color: #9a4a4a; }

.check-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; pointer-events: none; }
.check-chip span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--panel-2);
    color: var(--text-2);
    font-size: 14px;
}
.check-chip input:checked + span { background: var(--head); border-color: var(--head-line); color: #fff; }
.check-chip input:focus-visible + span { outline: 2px solid var(--accent); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
    display: block;
    height: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text-3);
    font-size: 13px;
}
.choice b { display: block; color: var(--text-2); font-size: 15px; font-weight: 600; }
.choice input:checked + span { border-color: var(--accent); background: #1f2b36; box-shadow: inset 0 0 0 1px var(--accent); color: var(--text-2); }
.choice input:checked + span b { color: var(--text); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets .chip { height: 30px; padding: 0 10px; font-size: 13px; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch input { width: 22px; height: 22px; accent-color: var(--blue); }

.stat-inputs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.stat-inputs label { display: grid; gap: 4px; text-align: center; }
.stat-inputs span { color: var(--text-3); font-size: 12px; font-weight: 600; }
.stat-inputs .input { padding: 0 2px; text-align: center; font-variant-numeric: tabular-nums; }

/* Pantallas muy estrechas (320 px): una columna en los formularios y los
   stats en dos filas de tres, para que quepa un "252" */
@media (max-width: 359px) {
    .form-row { grid-template-columns: minmax(0, 1fr); }
    .stat-inputs { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 8px; }
}
.ev-total { font-variant-numeric: tabular-nums; }
.ev-total.is-over { color: #f0928e; }

/* ---------------------------------------------------------------
   Pokédex
   --------------------------------------------------------------- */

.hero { display: grid; grid-template-columns: 124px 1fr; gap: 14px; align-items: center; padding: 16px; }
.hero-img { width: 124px; height: 124px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.hero h2 { font-size: 22px; line-height: 1.2; }
.hero .types { margin-top: 8px; }
.genus { color: var(--text-2); font-size: 14px; }
.badge {
    display: inline-block;
    padding: 1px 6px;
    border: 1px solid var(--line-2);
    border-radius: 3px;
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    vertical-align: 1px;
}
.badge-tier { border-color: #5b7a8d; background: #2d3f4a; color: #cfe2ee; }
.badge-warn { border-color: #6d5520; background: #3a3018; color: #e9cf8e; }
.desc { padding: 0 16px; color: var(--text-2); font-size: 14.5px; }

.forms { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 14px; scrollbar-width: none; }
.forms::-webkit-scrollbar { display: none; }

.stats { display: grid; grid-template-columns: 92px 34px 1fr; gap: 8px 10px; align-items: center; padding: 14px 16px; }
.stat-name { color: var(--text-2); font-size: 13.5px; }
.stat-val { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.stat-bar { height: 8px; overflow: hidden; border-radius: 4px; background: var(--panel-2); }
.stat-bar i { display: block; width: var(--w); height: 100%; border-radius: 4px; }
.s1 i { background: #cf5a43; }
.s2 i { background: #d98d33; }
.s3 i { background: #cdb93c; }
.s4 i { background: #7db54a; }
.s5 i { background: #3fa88c; }
.stat-total { color: var(--text-3); font-size: 13px; }

.kv { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.kv > div { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.kv > div:nth-child(odd) { border-right: 1px solid var(--line); }
.kv > div.wide { grid-column: 1 / -1; border-right: 0; }
.kv dt { color: var(--text-3); font-size: 12px; }
.kv dd { margin: 2px 0 0; }

.ability { display: block; padding: 11px 16px; color: var(--text); border-bottom: 1px solid var(--line); }
.ability:last-child { border-bottom: 0; }
.ability:active { background: var(--panel-2); }
.ability b { font-weight: 600; }
.ability p { margin-top: 2px; color: var(--text-2); font-size: 13.5px; }

.matchups { display: grid; gap: 10px; padding: 14px 16px; }
.matchups dt { margin-bottom: 5px; color: var(--text-3); font-size: 12px; }
.matchups dd { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
.mult { display: inline-flex; align-items: center; overflow: hidden; border-radius: 3px; background: var(--panel-2); }
.mult .type { border-radius: 0; }
.mult b { padding: 0 6px; font: 600 12px/18px var(--mono); }
.mult-up b { color: var(--bad); }
.mult-down b { color: var(--good); }
.mult-zero b { color: var(--text-3); }
.note { padding: 0 16px 14px; color: var(--text-3); font-size: 13px; }

.evo { padding: 6px 0; }
.evo-node { display: flex; align-items: center; gap: 10px; padding: 6px 16px; color: var(--text); }
.evo-node img { width: 48px; height: 48px; }
.evo-node.is-current { background: var(--panel-2); }
.evo-how { padding: 0 16px 0 calc(16px + 24px); color: var(--text-3); font-size: 12.5px; }
.evo-how::before { content: "↳ "; }
.evo-children { padding-left: 22px; }

.mv { display: grid; grid-template-columns: 34px 1fr auto; gap: 2px 10px; align-items: center; padding: 9px 16px; color: var(--text); border-bottom: 1px solid var(--line); }
.mv:last-child { border-bottom: 0; }
a.mv:active { background: var(--panel-2); }
.mv-lv { grid-row: span 2; color: var(--text-3); font: 600 12.5px var(--mono); }
.mv-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-meta { grid-column: 2; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mv .type { grid-row: span 2; }
.mv.no-lv { grid-template-columns: 1fr auto; }
.mv.no-lv .mv-meta { grid-column: 1; }

.loc-region { padding: 10px 16px 4px; color: var(--text-2); font-size: 13px; font-weight: 600; }
.loc { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.loc:last-child { border-bottom: 0; }
.loc-place { font-weight: 500; }
.loc-meta { color: var(--text-3); font-size: 12.5px; }
.loc-lv { grid-row: span 2; align-self: center; color: var(--text-2); font: 12.5px var(--mono); }
.when { display: inline-block; padding: 0 5px; border-radius: 3px; background: var(--panel-2); color: var(--text-2); font-size: 11px; font-weight: 600; line-height: 17px; }
.season-primavera { background: #24361f; color: #b7e3a3; }
.season-verano { background: #3a3018; color: #efd58b; }
.season-otono { background: #3d2a1c; color: #f1b37e; }
.season-invierno { background: #22313f; color: #acd5f4; }

.held { display: flex; align-items: center; gap: 8px; padding: 8px 16px; }

.spot { padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.list > .spot:last-child { border-bottom: 0; }
.spot-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 0 16px 4px; }
.spot-place { font-weight: 600; }
.spot-meta { color: var(--text-3); font-size: 13px; }
.spot-mon { display: flex; align-items: center; gap: 10px; padding: 3px 16px; color: var(--text); }
.spot-mon:active { background: var(--panel-2); }
.spot-mon img { width: 40px; height: 40px; flex: none; }
.spot-name { display: block; font-weight: 500; }
.spot-sub { display: block; color: var(--text-3); font-size: 12.5px; }
.ev-gain { flex: none; color: #c9efcc; font: 700 14px/1.3 var(--mono); text-align: right; white-space: nowrap; }
.ev-all { display: block; color: var(--text-3); font: 400 11.5px var(--mono); }
.spot-also { padding: 4px 16px 0; color: var(--text-3); font-size: 12.5px; }
.badge-ok { border-color: #2f6234; background: #1f3022; color: #bfe6c1; }
.held img, .item-icon { width: 24px; height: 24px; image-rendering: pixelated; }

/* ---------------------------------------------------------------
   Equipos
   --------------------------------------------------------------- */

.team-row { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.author { color: var(--text); font-weight: 600; }

/* La estrella de favoritos, en la barra de la guía */
.fav-btn svg { width: 24px; height: 24px; }
.fav-btn.is-on { color: #e9c46a; }
.fav-btn.is-on svg { fill: currentColor; }

/* Votos: buena / mala */
.votes { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.vote-up, .vote-down { display: inline-flex; align-items: center; gap: 3px; }
.vote-up { color: #7fd17f; }
.vote-down { color: #ef8c86; }
.votes svg, .vote-total svg { width: 15px; height: 15px; }
.vote-down svg { transform: rotate(180deg); }
.votes-none { color: var(--text-3); font-size: 13px; }
.votes-link { color: inherit; }

.vote-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius);
    background: var(--panel-2);
    color: var(--text-2);
    font-size: 15px;
    font-weight: 600;
    touch-action: manipulation;
}
.vote-btn svg { width: 20px; height: 20px; }
.vote-btn-down svg { transform: rotate(180deg); }
.vote-btn b { color: var(--text-3); font-variant-numeric: tabular-nums; }
.vote-btn:active { filter: brightness(.92); }
.vote-btn-up.is-on { background: #1f3022; border-color: #2f6234; color: #bfe6c1; }
.vote-btn-down.is-on { background: #382224; border-color: #7a3c3f; color: #f5b8b6; }
.vote-btn.is-on b { color: inherit; }
.vote-total { display: flex; gap: 16px; font-weight: 600; }

.author-card { display: flex; align-items: center; gap: 12px; margin: 12px 16px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); }
.author-card:active { background: var(--panel-2); }
.author-name { display: block; font-weight: 600; }
.avatar-sm { width: 38px; height: 38px; font-size: 16px; }
.team-sprites { display: flex; flex-wrap: wrap; gap: 0; margin-top: 6px; }
.team-sprites img { width: 40px; height: 40px; }

.member { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.member-head { display: flex; align-items: center; gap: 12px; }
.member-head > img { width: 76px; height: 76px; flex: none; }
.member-name { font-size: 17px; font-weight: 600; }
.member-name a { color: inherit; }
.member-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; color: var(--text-2); font-size: 13.5px; }
.member-sub img { width: 24px; height: 24px; margin: -4px 0; image-rendering: pixelated; }
.member-spread { margin-top: 10px; color: var(--text-2); font: 12.5px/1.6 var(--mono); }
.member-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.move-pill {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 34px;
    padding: 0 8px;
    border-left: 3px solid var(--tc, var(--line-2));
    border-radius: 3px;
    background: var(--panel-2);
    color: var(--text);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-notes { margin-top: 12px; color: var(--text); font-size: 14.5px; }
.member-notes p { margin-bottom: 8px; }

.slot { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.slot:last-child { border-bottom: 0; }
.slot > a { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; color: var(--text); }
.slot img { width: 48px; height: 48px; flex: none; }
.slot-tools { display: flex; gap: 2px; }
.slot-tools .bar-btn { width: 38px; height: 38px; color: var(--text-2); }
.slot-tools svg { width: 20px; height: 20px; }

.coverage { width: 100%; border-collapse: collapse; font-size: 13px; }
.coverage th, .coverage td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.coverage th { color: var(--text-3); font-weight: 600; font-size: 12px; }
.coverage td:first-child, .coverage th:first-child { text-align: left; padding-left: 16px; }
.coverage tr:last-child td { border-bottom: 0; }
.coverage .hot { color: var(--bad); font-weight: 700; }
.coverage .zero { color: var(--text-3); }

.prose { padding: 2px 16px; font-size: 15.5px; line-height: 1.6; }
.prose h3 { margin: 18px 0 6px; font-size: 16px; }
.prose p, .prose ul { margin: 0 0 12px; }
.prose ul { padding-left: 20px; }
.byline { padding: 12px 16px 0; color: var(--text-3); font-size: 13px; }
.byline a { color: var(--text-2); }

.export { width: 100%; min-height: 220px; font: 13px/1.5 var(--mono); }

/* ---------------------------------------------------------------
   Crianza
   --------------------------------------------------------------- */

.ivs { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.iv {
    min-width: 23px;
    border-radius: 3px;
    background: var(--panel-2);
    color: var(--text-3);
    font: 600 11.5px/19px var(--mono);
    text-align: center;
}
.iv.max { background: #2c5233; color: #c9efcc; }
.g-m { color: #6fa8ec; }
.g-f { color: #ec7fa0; }

.progress { height: 6px; margin-top: 8px; overflow: hidden; border-radius: 3px; background: var(--panel-2); }
.progress i { display: block; width: var(--w); height: 100%; background: var(--good); }

.calc-result { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.calc-result > div { padding: 14px 6px; border-right: 1px solid var(--line); }
.calc-result > div:last-child { border-right: 0; }
.calc-result b { display: block; font: 700 24px/1.1 var(--mono); }
.calc-result span { color: var(--text-3); font-size: 12px; }
.calc-slots .row { min-height: 48px; }
.calc-count { width: 44px; font: 700 15px var(--mono); color: var(--text); }
.calc-level { display: flex; justify-content: space-between; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.calc-level:last-child { border-bottom: 0; }
.status { font-size: 12px; font-weight: 600; }
.status-planeado { color: var(--text-2); }
.status-en_curso { color: #e9c46a; }
.status-terminado, .status-disponible { color: var(--good); }
.status-usado, .status-vendido { color: var(--text-3); }

/* ---------------------------------------------------------------
   Cuenta
   --------------------------------------------------------------- */

.auth { max-width: 420px; margin: 0 auto; }
.auth-head { padding: 28px 16px 4px; text-align: center; }
.auth-head img { width: 64px; height: 64px; }
.auth-head p { margin-top: 8px; color: var(--text-2); }
.auth-foot { padding: 0 16px; color: var(--text-2); font-size: 14px; text-align: center; }

.profile { display: flex; align-items: center; gap: 14px; padding: 18px 16px 4px; }
.avatar {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    flex: none;
    border: 1px solid var(--head-line);
    border-radius: 50%;
    background: var(--head);
    color: #fff;
    font-size: 22px;
    font-weight: 600;
}
.profile h2 { font-size: 19px; }
.stats-row { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; text-align: center; }
.stats-row a { padding: 12px 4px; color: var(--text); border-right: 1px solid var(--line); }
.stats-row a:last-child { border-right: 0; }
.stats-row b { display: block; font: 700 20px var(--mono); }
.stats-row span { color: var(--text-3); font-size: 12px; }

.form .section { margin-top: 6px; }
.form .section-title { padding-left: 0; padding-right: 0; }
.row-add { color: var(--accent); font-weight: 500; }
.row-add + .row-chev { color: var(--accent); }
.fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

.credits { margin-top: 28px; padding: 14px 16px 0; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12.5px; text-align: center; }
.credits a { color: var(--text-3); }
.credits b { color: var(--text-2); font-weight: 600; }
.prose-sm { color: var(--text-2); font-size: 14.5px; line-height: 1.55; }

.legal { padding: 16px; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.legal h3 { margin: 22px 0 6px; color: var(--text); font-size: 16px; }
.legal p, .legal ul { margin: 0 0 10px; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 6px; }
.legal b { color: var(--text); font-weight: 600; }
.legal-date { color: var(--text-3); font-size: 13px; }
.prose-sm p + p { margin-top: 8px; }
.credit + .credit { border-top: 1px solid var(--line); }
.credit-name { font-size: 17px; font-weight: 600; }
.credit-name + p { margin-top: 4px; font-size: 14px; }

/* ---------------------------------------------------------------
   Mis pokes

   Es una tabla, pero en el celular cada fila se ve como una fila de
   lista: las columnas sueltas se esconden y se usan las etiquetas.
   --------------------------------------------------------------- */

.pokes { width: 100%; border-collapse: collapse; }
.pokes tbody, .pokes td { display: block; }
.pokes thead, .pokes .pk-num, .pokes .pk-col { display: none; }
.pokes tr {
    position: relative;
    display: block;
    padding: 8px 16px 8px 14px;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid var(--tc, transparent);
}
.pokes tbody tr:last-child { border-bottom: 0; }
.pokes tr:active { background: var(--panel-2); }
.pokes .pk-mon { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; }
.pk-link { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); }
a.pk-link::after { content: ""; position: absolute; inset: 0; }
.pk-link img { width: 48px; height: 48px; flex: none; object-fit: contain; }
.pk-names { min-width: 0; }
.pk-name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-sub { display: block; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-sub:empty { display: none; }
.pk-use { grid-column: 2; grid-row: 1; color: var(--text-2); font-size: 12px; font-weight: 600; }
.pk-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; padding-left: 60px; }

.tag {
    display: inline-block;
    max-width: 100%;
    padding: 0 6px;
    border-radius: 3px;
    background: var(--panel-2);
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 19px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tag-iv { background: #2c5233; color: #c9efcc; font-family: var(--mono); font-weight: 600; }
.tag-alpha { background: #24394a; color: #a9d4f5; }
.tag-shiny { background: #3a3018; color: #e9cf8e; }
.tag-particle { background: #2f2a47; color: #cbc1f2; }
.tag-ot { background: #382224; color: #f5b8b6; }

.steps { display: grid; gap: 4px; margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14px; }
.notes-list { display: grid; gap: 4px; margin: 0; padding: 10px 16px 10px 32px; color: var(--text-2); font-size: 13.5px; }

/* En pantallas anchas, la tabla de verdad, como en la hoja de cálculo */
@media (min-width: 1000px) {
    .pokes-box { overflow: clip; }
    .pokes { font-size: 13.5px; }
    .pokes thead { display: table-header-group; }
    .pokes tbody { display: table-row-group; }
    .pokes tr { display: table-row; padding: 0; border: 0; }
    .pokes td, .pokes th, .pokes .pk-num, .pokes .pk-col, .pokes .pk-mon { display: table-cell; padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
    .pokes th {
        position: sticky;
        top: calc(var(--bar-h) + var(--safe-t) + 64px);
        z-index: 1;
        background: var(--panel-2);
        color: var(--text-3);
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
    }
    .pokes tbody tr:last-child td { border-bottom: 0; }
    .pokes tbody tr:hover { background: var(--panel-2); }
    .pokes td.pk-num { box-shadow: inset 3px 0 var(--tc, transparent); }
    .pokes .pk-mon { white-space: nowrap; }
    .pk-link { display: inline-flex; gap: 8px; vertical-align: middle; }
    .pk-link img { width: 34px; height: 34px; margin: -6px 0; }
    .pk-sub, .pk-use { display: none; }
    .pk-tags { display: inline; margin: 0 0 0 6px; padding: 0; }
    .pk-tags .tag:not(.tag-shiny) { display: none; }
    .pk-nick { font-style: italic; }
    .pk-yes svg { width: 18px; height: 18px; color: var(--good); vertical-align: middle; }
    .pk-ot { color: #f0928e; }
}
