/* ── Base ─────────────────────────────────────────────────────── */
.lp {
    font-family: 'Montserrat', sans-serif;
    min-height: 100vh;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.lp-hero {
    position: relative;
    min-height: 300px;
    background-color: #0d1117;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.lp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(10,12,18,0.55) 0%,
        rgba(10,12,18,0.80) 55%,
        rgba(10,12,18,0.97) 100%
    );
}
.lp-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 28px 36px;
}

.lp-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8b949e;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 28px;
    transition: color 0.15s;
}
.lp-back:hover { color: #c9d1d9; }

.lp-hero-body {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}
.lp-rank-badge {
    font-size: 4rem;
    font-weight: 900;
    color: #4b92ff;
    line-height: 1;
    flex-shrink: 0;
    text-shadow: 0 0 40px rgba(75,146,255,0.4);
    letter-spacing: -0.02em;
}
.lp-hero-text { flex: 1; min-width: 0; }
.lp-hero-name {
    margin: 0 0 6px;
    font-size: 2.4rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    word-break: break-word;
    letter-spacing: -0.01em;
}
.lp-hero-creator {
    font-size: 0.95rem;
    color: #8b949e;
    margin-bottom: 10px;
}
.lp-hero-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.lp-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
    align-items: center;
}
.lp-meta-pill {
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 0.78rem;
    font-weight: 700;
    color: #c9d1d9;
    backdrop-filter: blur(8px);
}
.lp-meta-pill.pts { color: #4bfff5; border-color: rgba(75,255,245,0.3); background: rgba(75,255,245,0.06); }

/* ── Main layout ──────────────────────────────────────────────── */
.lp-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 28px 80px;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 20px;
    align-items: start;
}
@media (max-width: 860px) {
    .lp-main { grid-template-columns: 1fr; }
}

.lp-col { display: flex; flex-direction: column; gap: 16px; }

/* ── Cards ────────────────────────────────────────────────────── */
.lp-card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 12px;
    overflow: hidden;
}
.lp-card-head {
    padding: 14px 18px 12px;
    border-bottom: 1px solid #21262d;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lp-card-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b949e;
}
.lp-card-count {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    color: #4b92ff;
    background: rgba(75,146,255,0.1);
    border: 1px solid rgba(75,146,255,0.2);
    padding: 1px 7px;
    border-radius: 10px;
}
.lp-card-body { padding: 14px 18px; }

/* ── Embed ────────────────────────────────────────────────────── */
.lp-embed iframe {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
    border: none;
}

/* ── Info table ───────────────────────────────────────────────── */
.lp-info-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.83rem;
}
.lp-info-row:last-child { border-bottom: none; }
.lp-info-key {
    color: #5b6877;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
    min-width: 88px;
}
.lp-info-val { color: #c9d1d9; word-break: break-word; }
.lp-info-link { color: #4b92ff; text-decoration: none; font-weight: 600; }
.lp-info-link:hover { text-decoration: underline; }

/* ── Placement history ────────────────────────────────────────── */
.ph-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.82rem;
    color: #8b949e;
}
.ph-entry:last-child { border-bottom: none; }
.ph-entry.ph-current { color: #c9d1d9; }
.ph-rank { font-weight: 800; color: #4b92ff; min-width: 38px; font-size: 0.9rem; }
.ph-entry.ph-current .ph-rank { color: #fff; }
.ph-date { min-width: 96px; font-size: 0.78rem; }
.ph-reason { flex: 1; font-style: italic; font-size: 0.75rem; color: #8b949e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-entry.ph-current .ph-reason { color: #adb5bd; }
.ph-added-tag {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(75,146,255,0.1);
    color: #4b92ff;
    border: 1px solid rgba(75,146,255,0.3);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ── Movement history ─────────────────────────────────────────── */
.mv-empty {
    color: #5b6877;
    font-size: 0.82rem;
    font-style: italic;
    padding: 4px 0 8px;
}
.mv-entry {
    display: grid;
    grid-template-columns: 28px 44px 96px 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.82rem;
}
.mv-entry:last-child { border-bottom: none; }

.mv-dir {
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
}
.mv-dir.up   { background: rgba(75,255,180,0.12); color: #4bffb4; }
.mv-dir.down { background: rgba(255,100,75,0.12);  color: #ff7a4b; }
.mv-dir.same { background: rgba(255,255,255,0.06); color: #8b949e; }

.mv-rank { font-weight: 800; font-size: 0.9rem; color: #c9d1d9; }
.mv-date { font-size: 0.75rem; color: #8b949e; }
.mv-reason { font-size: 0.75rem; color: #8b949e; font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── World records ────────────────────────────────────────────── */
.wr-row {
    display: grid;
    grid-template-columns: 32px 1fr 52px auto;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 0.83rem;
}
.wr-row:last-child { border-bottom: none; }
.wr-pos { font-weight: 800; font-size: 0.85rem; }
.wr-pos.gold   { color: #ffd700; }
.wr-pos.silver { color: #c0c0c0; }
.wr-pos.bronze { color: #cd7f32; }
.wr-pos.other  { color: #8b949e; }
.wr-name  { color: #c9d1d9; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wr-pct   { color: #4bfff5; font-weight: 700; text-align: right; }
.wr-vid   { color: #4b92ff; text-decoration: none; font-size: 0.73rem; font-weight: 700; white-space: nowrap; }
.wr-vid:hover { text-decoration: underline; }

/* ── Edit panel ───────────────────────────────────────────────── */
.ep-card {
    background: #161b22;
    border: 1px solid rgba(255,180,0,0.2);
    border-radius: 12px;
    overflow: hidden;
}
.ep-head {
    padding: 14px 18px 12px;
    border-bottom: 1px solid rgba(255,180,0,0.12);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ep-head-title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffa54b;
}
.ep-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 10px; }

.ep-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5b6877;
    margin-bottom: 3px;
}
.ep-inp {
    width: 100%;
    padding: 7px 10px;
    background: #0d1117;
    border: 1px solid #2a2f38;
    border-radius: 6px;
    color: #c9d1d9;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    outline: none;
    box-sizing: border-box;
    -moz-appearance: textfield;
}
.ep-inp::-webkit-outer-spin-button, .ep-inp::-webkit-inner-spin-button { -webkit-appearance: none; }
.ep-inp:focus { border-color: #ffa54b; }
.ep-inp[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.45); cursor: pointer; }

.ep-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ep-field { display: flex; flex-direction: column; }

.ep-ct-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.ep-ct-tab {
    flex: 1;
    padding: 5px 6px;
    border-radius: 5px;
    background: rgba(255,255,255,0.04);
    border: 1px solid #2a2f38;
    color: #8b949e;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.ep-ct-tab.active { background: rgba(255,165,75,0.12); border-color: rgba(255,165,75,0.4); color: #ffa54b; }

.ep-togs { display: flex; flex-wrap: wrap; gap: 5px; }
.ep-tog {
    padding: 4px 10px;
    border-radius: 5px;
    background: rgba(255,255,255,0.04);
    border: 1px solid #2a2f38;
    color: #8b949e;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.ep-tog.active { background: rgba(75,146,255,0.12); border-color: rgba(75,146,255,0.4); color: #4b92ff; }

.ep-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 2px 0; }

.ep-ph-row {
    display: grid;
    grid-template-columns: 60px 120px 1fr 26px;
    gap: 5px;
    align-items: center;
    margin-bottom: 4px;
}
.ep-ph-del {
    background: none;
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background 0.15s;
}
.ep-ph-del:hover { background: rgba(239,68,68,0.12); }
.ep-ph-add {
    background: none;
    border: 1px solid #2a2f38;
    color: #8b949e;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.15s;
    margin-top: 2px;
}
.ep-ph-add:hover { color: #c9d1d9; border-color: #4b4f58; }

/* Derived (read-only) movement history rows */
.ep-note { font-size: 0.68rem; color: #6e7681; line-height: 1.5; margin-bottom: 6px; }
.ep-mh-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.72rem;
    color: #8b949e;
    padding: 3px 0;
    border-bottom: 1px solid rgba(42,47,56,0.5);
}
.ep-mh-row:last-child { border-bottom: none; }
.ep-mh-row .pos  { color: #c9d1d9; font-weight: 700; flex: 0 0 auto; }
.ep-mh-row .date { flex: 0 0 auto; }
.ep-mh-row .rsn  { flex: 1 1 auto; text-align: right; color: #6e7681; }
.ep-mh-empty { font-size: 0.72rem; color: #6e7681; }

/* Silent-delete opt-out */
.ep-silent {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    color: #8b949e;
    cursor: pointer;
    margin-top: 4px;
}
.ep-silent input { accent-color: #ef4444; cursor: pointer; }

.ep-actions { display: flex; gap: 8px; margin-top: 4px; }
.ep-save {
    flex: 1;
    padding: 9px;
    border-radius: 7px;
    background: rgba(255,165,75,0.12);
    border: 1px solid rgba(255,165,75,0.4);
    color: #ffa54b;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.ep-save:hover { background: rgba(255,165,75,0.22); }
.ep-delete {
    padding: 9px 14px;
    border-radius: 7px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.ep-delete:hover { background: rgba(239,68,68,0.16); }
.ep-msg { font-size: 0.78rem; font-weight: 600; min-height: 1.2em; }
.ep-msg.ok  { color: #4bffb4; }
.ep-msg.err { color: #ef4444; }

/* ── Loading / error ──────────────────────────────────────────── */
#lp-loading:not([hidden]), #lp-error:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    font-size: 0.9rem;
    color: #8b949e;
}
#lp-error:not([hidden]) { color: #ef4444; }
