@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700&family=Russo+One&display=swap');

html { scrollbar-gutter: stable; }

:root {
    --bg:          #1a1a1a;
    --surface:     #252525;
    --surface-2:   #2d2d2d;
    --border:      rgba(255,255,255,0.07);
    --border-focus: #FF56B4;
    --input-bg:    #2d2d2d;
    --btn:         #2d2d2d;
    --btn-hover:   #383838;
    --text:        #f0f0f0;
    --text-2:      #9a9a9a;
    --accent:      #FF56B4;
    --cyan:        #00CCFF;
    --error:       #f87171;
    --success:     #4ade80;
    --reset:       #3f1111;
    --reset-hover: #5c1f1f;
    --dimmed:      #555;
    --gold:        #fbbf24;
    --male-blue:   #60a5fa;
    --radius:      14px;
    --radius-sm:   8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

body {
    background:
        linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)),
        url('https://mrklypp.com/assets/background.png') repeat center top / auto;
    background-attachment: fixed, fixed;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Syne', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px 48px;
}

/* ── Header ─────────────────────────────────────────────────── */
header { text-align: center; margin-bottom: 24px; animation: fade-up 0.5s ease both; }
h1 { font-family: 'Russo One', sans-serif; font-size: 28px; font-weight: normal; letter-spacing: 0.02em; color: var(--cyan); margin-bottom: 4px; }
.subtitle { color: var(--text-2); font-size: 13px; margin-bottom: 10px; }

h1 .header-brand {
    color: var(--accent);
    text-decoration: none;
    display: inline-block;
    transition: transform 0.18s;
}
h1 .header-brand:hover { transform: scale(1.08); }
.header-error {
    font-size: 12px;
    color: var(--error);
    margin-bottom: 8px;
}
.header-error a { color: var(--cyan); text-decoration: underline; transition: opacity 0.15s; }
.header-error a:hover { opacity: 0.75; }

/* ── Lang toggle ─────────────────────────────────────────────── */
.lang-toggle {
    display: inline-flex;
    gap: 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 3px;
}
.lang-toggle button {
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-2);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    letter-spacing: 0.5px;
    transition: background 0.15s, color 0.15s;
}
.lang-toggle button.active { background: var(--btn-hover); color: var(--text); }

#app { width: 100%; max-width: 1120px; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    animation: fade-up 0.5s ease both;
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }
.card:nth-child(7) { animation-delay: 0.35s; }
.card.card--team    { border-left: 3px solid var(--accent); position: relative; z-index: 1; }
.card.card--actions { border-left: 3px solid var(--cyan); }

/* ── Pokémon rows ─────────────────────────────────────────────── */
.pokemon-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.pokemon-row:last-child { border-bottom: none; }
.pokemon-row.dragging {
    opacity: 0.4;
    box-shadow: 0 6px 20px rgba(0,0,0,0.45);
    transform: scale(1.01);
    z-index: 10;
    border-radius: var(--radius-sm);
}
.pokemon-row.drag-over-top::before,
.pokemon-row.drag-over-bottom::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cyan);
    border-radius: 2px;
    pointer-events: none;
}
.pokemon-row.drag-over-top::before    { top: -2px; }
.pokemon-row.drag-over-bottom::after  { bottom: -2px; }

/* Drag handle */
.drag-handle {
    flex-shrink: 0;
    cursor: grab;
    color: var(--dimmed);
    font-size: 15px;
    line-height: 1;
    padding: 0 2px;
    user-select: none;
    transition: color 0.15s;
}
.drag-handle:hover { color: var(--text-2); }
.drag-handle:active { cursor: grabbing; }

/* Sprite preview */
.sprite-preview {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    opacity: 0;
    transition: opacity 0.2s;
}
.sprite-preview.visible { opacity: 1; }

.row-label { min-width: 76px; font-size: 13px; color: var(--text-2); font-weight: 500; white-space: nowrap; }

/* Autocomplete */
.ac-wrapper { position: relative; flex: 0 0 162px; }
.name-input, .mote-input {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    width: 100%;
    outline: none;
    transition: border-color 0.15s;
}
.name-input:focus, .mote-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(255,86,180,0.12); }
.mote-input { flex: 0 0 120px; }
.suggestions {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    list-style: none;
    z-index: 100;
    display: none;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.suggestions li { padding: 7px 12px; cursor: pointer; font-size: 13px; }
.suggestions li:hover, .suggestions li.active { background: var(--btn-hover); }

/* Property icons */
.icons { display: flex; gap: 6px; }
.icon { font-size: 15px; cursor: default; user-select: none; transition: color 0.15s; }
.icon.dimmed { color: var(--dimmed); }
.gender-icon { color: var(--male-blue); }
.gender-icon.female { color: var(--accent); }
.skin-icon.active { color: var(--accent); }
.shiny-icon.active { color: var(--gold); }

/* Buttons */
button {
    background: var(--btn);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    transition: background 0.15s;
    white-space: nowrap;
}
button:hover { background: var(--btn-hover); }
.props-btn { flex: 0 0 80px; font-size: 12px; }
.clear-btn  { flex: 0 0 30px; background: var(--reset); border-color: transparent; padding: 6px 0; }
.clear-btn:hover { background: var(--reset-hover); }

/* ── Settings ─────────────────────────────────────────────────── */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}
.settings-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text-2);
    font-weight: 500;
}
select {
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    outline: none;
    cursor: pointer;
}
input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }

/* ── Actions ──────────────────────────────────────────────────── */
.actions { display: flex; flex-direction: column; gap: 8px; }

.obs-hint {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.6;
    padding: 10px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent);
}
.obs-hint strong { color: var(--text); font-weight: 600; }
.obs-url-label { display: block; margin-bottom: 2px; font-weight: 600; color: var(--text); }
.obs-url-sub { display: block; margin-bottom: 6px; font-size: 0.72rem; color: var(--muted); }
.obs-url-row { display: flex; align-items: center; gap: 8px; }
.obs-url-display {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    font-size: 11px;
    color: var(--cyan);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

}
.btn-copy-url {
    flex-shrink: 0;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}
.btn-copy-url:hover { background: var(--btn-hover); border-color: var(--cyan); }
.btn-new-channel {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.18s;
}
.btn-new-channel:hover { background: var(--btn-hover); color: var(--text); border-color: rgba(255, 86, 180, 0.35); }
.btn-new-channel svg { width: 14px; height: 14px; }
.obs-channel-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.btn-channel-action {
    flex: 1;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    cursor: pointer;
}
.btn-channel-action:hover { background: var(--btn-hover); color: var(--text); }

.external-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255, 86, 180, 0.10);
    border: 1px solid rgba(255, 86, 180, 0.30);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}
.external-banner button {
    background: rgba(255, 86, 180, 0.15);
    border: 1px solid rgba(255, 86, 180, 0.35);
    border-radius: 5px;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.external-banner button:hover { background: rgba(255, 86, 180, 0.28); }

.external-mode-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 7px 16px;
    margin: 8px 0;
    border-radius: 8px;
    background: rgba(255, 86, 180, 0.10);
    border: 1px solid rgba(255, 86, 180, 0.30);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.external-mode-bar code {
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.8;
}

.external-mode-bar button {
    background: rgba(255, 86, 180, 0.15);
    border: 1px solid rgba(255, 86, 180, 0.35);
    border-radius: 5px;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.external-mode-bar button:hover {
    background: rgba(255, 86, 180, 0.25);
}

.btn-publish {
    width: 100%;
    padding: 11px;
    font-size: 14px;
    font-weight: 700;
    background: var(--cyan);
    border-color: transparent;
    border-radius: 50px;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: 'Russo One', sans-serif;
}
.btn-publish:hover { background: #00aadd; }


.btn-preview { width: 100%; padding: 9px; }
.btn-import-header {
    margin-top: 12px;
    padding: 7px 18px;
    font-size: 13px;
    background: var(--btn);
    border-color: var(--border);
}

.btn-reset {
    width: 100%;
    padding: 9px;
    background: var(--reset);
    border-color: transparent;
    color: #fca5a5;
}
.btn-reset:hover { background: var(--reset-hover); }

#status { text-align: center; min-height: 20px; font-size: 13px; margin-top: 2px; }


/* ── Modal ────────────────────────────────────────────────────── */
#modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 200;
    justify-content: center;
    align-items: center;
}
#modal-backdrop.open { display: flex; }
#modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    min-width: 300px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
#modal h3 { text-align: center; margin-bottom: 20px; font-size: 15px; font-weight: 600; }
.modal-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-row label { font-size: 13px; color: var(--text-2); font-weight: 500; min-width: 60px; }
.modal-row select { width: 170px; }
.modal-apply {
    display: block;
    margin: 20px auto 0;
    width: 130px;
    padding: 8px;
    font-size: 14px;
    font-weight: 600;
    background: var(--accent);
    border-color: transparent;
    color: #fff;
}
.modal-apply:hover { background: #e04aa0; }

/* ── Presets ─────────────────────────────────────────────────── */
.card--presets { padding: 10px 20px; }
.presets-bar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.preset-label { font-size: 12px; color: var(--text-2); font-weight: 600; margin-right: 2px; white-space: nowrap; }
.preset-slot { display: flex; gap: 2px; flex: 1; min-width: 140px; max-width: 220px; }
.preset-load {
    flex: 1;
    font-size: 12px;
    padding: 5px 8px;
    text-align: left;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.preset-load.empty { color: var(--dimmed); font-style: italic; cursor: default; }
.preset-save {
    flex: 0 0 26px;
    width: 26px;
    padding: 5px 0;
    font-size: 13px;
    text-align: center;
    border-radius: 0;
    border-left: none;
}
.preset-del {
    flex: 0 0 26px;
    width: 26px;
    padding: 5px 0;
    font-size: 11px;
    text-align: center;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: none;
    background: var(--reset);
    border-color: transparent;
    color: #fca5a5;
    display: none;
}
.preset-del.visible { display: block; }


/* ── Tooltip popup ────────────────────────────────────────────── */
.tooltip-popup {
    position: fixed;
    background: var(--surface-2);
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text);
    z-index: 300;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.tooltip-popup.show { opacity: 1; }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
    body { padding: 16px 8px 32px; overflow-x: hidden; }
    .card { padding: 14px; }
    h1 { font-size: 22px; }
    .pokemon-row { gap: 5px; }
    .row-label { display: none; }
    .sprite-preview { flex: 0 0 36px; width: 36px; height: 36px; }
    .ac-wrapper { flex: 1 1 0; min-width: 0; }
    .mote-input { flex: 0 0 72px; }
    .icons { display: none; }
    .props-btn { flex: 0 0 60px; font-size: 11px; padding: 6px 4px; }
    .clear-btn { flex: 0 0 26px; }

}
@media (max-width: 400px) {
    .mote-input { display: none; }
}

/* ── Cookie notice ───────────────────────────────────────────── */
#cookie-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-2);
    z-index: 999;
}
#cookie-bar button {
    flex-shrink: 0;
    padding: 5px 14px;
    font-size: 12px;
    background: var(--btn);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}
#cookie-bar button:hover { background: var(--btn-hover); }

/* ── Live preview ────────────────────────────────────────────── */
.card--preview { padding: 12px 16px; overflow: hidden; }
#preview-msg { text-align: center; color: var(--text-2); font-size: 13px; padding: 16px 0; margin: 0; }
#preview-wrapper { overflow: hidden; position: relative; background: #111; border-radius: 6px; }
#preview-iframe  { border: none; display: block; transform-origin: top left; }
#cemetery-preview-wrapper { overflow: hidden; position: relative; background: #111; border-radius: 6px; }
#cemetery-preview-iframe  { border: none; display: block; transform-origin: top center; position: absolute; left: 50%; }

/* ── Mode toggle ─────────────────────────────────────────────── */
.header-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    margin-bottom: 8px;
}
.mode-toggle {
    display: flex;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 3px;
    gap: 2px;
}
.mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.7rem;
    border-radius: 100px;
    position: relative;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s;
    color: var(--text);
    background: transparent;
    text-decoration: none;
}
.mode-btn-text { display: none; }
.mode-btn-icon { width: 1.05rem; height: 1.05rem; flex-shrink: 0; display: block; }
/* Tooltip */
.mode-btn::after {
    content: attr(aria-label);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-2);
    color: var(--text-em);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.22rem 0.55rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 20;
}
@media (hover: hover) and (pointer: fine) {
    .mode-btn:hover::after { opacity: 1; }
}
@media (max-width: 600px) {
    .mode-toggle { gap: 4px; }
}
.mode-btn.active {
    background: var(--surface);
    color: var(--text-em);
    border-color: rgba(0, 204, 255, 0.3);
    box-shadow: 0 0 12px rgba(0, 204, 255, 0.15);
}

/* ── User widget ─────────────────────────────────────────────── */
.user-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.user-name {
    color: var(--text);
    font-weight: 600;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 100px;
    border: 1px solid;
    flex-shrink: 0;
}
.user-badge--guest {
    background: rgba(255,255,255,0.05);
    color: var(--text-2);
    border-color: var(--border);
}
.user-badge--vip {
    background: rgba(255,86,180,0.15);
    color: var(--accent);
    border-color: rgba(255,86,180,0.35);
}
.user-logout,
.user-login-link {
    font-size: 12px;
    color: var(--text-2);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    transition: color 0.15s, border-color 0.15s;
    cursor: pointer;
    white-space: nowrap;
}
.user-logout:hover,
.user-login-link:hover {
    color: var(--text);
    border-color: rgba(0, 204, 255, 0.3);
}

/* ── Badge section ───────────────────────────────────────────── */
.hidden { display: none !important; }

.badge-checkboxes {
    display: grid;
    gap: 0.75rem;
    justify-content: center;
}
.badge-check-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.badge-check-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}
.badge-thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
    transition: filter 0.2s;
}

.badge-brightness-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-em);
}
.badge-brightness-row input[type="range"] {
    accent-color: var(--accent);
    flex: 1;
}
#badge-brightness-val {
    color: var(--muted);
    font-size: 0.78rem;
    min-width: 2.5rem;
}

#badge-preview-wrapper {
    position: relative;
    overflow: hidden;
    background: #111;
    border-radius: 6px;
}
#badge-preview-iframe {
    transform-origin: top left;
    display: block;
    border: none;
}

/* ── Types table ─────────────────────────────────────────────── */
.types-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.2rem;
    align-items: start;
}
@media (max-width: 700px) {
    .types-layout { grid-template-columns: 1fr; }
}

.types-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.types-selector-hint {

    font-size: 0.8rem;
    color: var(--text-muted, rgba(255,255,255,0.5));
    margin: 0;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.type-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    transition: border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.type-btn.selected {
    border-color: white;
    box-shadow: 0 0 8px rgba(255,255,255,0.4);
}
.type-btn:hover { opacity: 0.85; }
@media (max-width: 600px) {
    .type-btn { font-size: 0.72rem; padding: 0.4rem 0.45rem; gap: 0.3rem; white-space: normal; }
    .type-grid .type-icon { width: 16px; height: 16px; }
}

.types-table-panel {
    min-height: 120px;
}

.types-placeholder {
    color: var(--dimmed);
    font-size: 0.8rem;
    padding-top: 0.5rem;
}

.mult-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.mult-row:last-child { border-bottom: none; }
.mult-row--neutral { opacity: 0.45; }

.mult-label {

    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    min-width: 3rem;
    padding-top: 0.15rem;
    flex-shrink: 0;
}

.mult-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.type-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 100px;

    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}
.type-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* ── Cemetery ─────────────────────────────────────────────────────── */
.card.card--cemetery-add { z-index: 2; }
.cemetery-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cemetery-add-row .ac-wrapper {
    position: relative;
    flex: 1;
    min-width: 140px;
}
.cemetery-pending-sprite {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}
.cemetery-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}
.cemetery-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}
.cemetery-entry img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}
.cemetery-entry-name {
    font-size: 0.7rem;
    color: var(--muted);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cemetery-remove-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--muted);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.cemetery-remove-btn:hover { color: var(--error, #f44); border-color: var(--error, #f44); }
.cemetery-empty {
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 20px 0;
    display: none;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 0.6rem 1rem 1rem;
    margin-top: 0;
}
.site-footer a {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.12);
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: color 0.2s;
}
.site-footer a:hover { color: rgba(255,255,255,0.35); }

/* ── Desktop layout ──────────────────────────────────────────── */
@media (min-width: 1120px) {
  .desktop-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
  }
  .desktop-col-left {
    min-width: 0;
  }
  .desktop-col-right {
    position: sticky;
    top: 20px;
  }

  /* Pokémon page: preview full-width top, editor + actions below */
  .pokemon-desktop-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .pokemon-desktop-layout > .card--preview {
    max-width: 1040px;
  }
  .pokemon-bottom-cols {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
    max-width: 1040px;
  }
  .pokemon-actions-col {
    position: sticky;
    top: 20px;
    min-width: 0;
  }
}
