@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --lm-primary: #1d9bf0;
    --lm-primary-shade: #177cc0;
    --lm-sky: #43a5ff;
    --lm-mod: #ff6900;
    --lm-apk: #43a5ff;
    --lm-radius: 10px;
    --lm-header-h: 64px;
    --lm-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* light theme tokens */
    --lm-bg: #f2f4f7;
    --lm-surface: #ffffff;
    --lm-text: #212121;
    --lm-text-2: #7a7a7a;
    --lm-text-3: #9d9d9d;
    --lm-border: #e6e8ec;
    --lm-input: #f6f8fa;
    --lm-shadow: 0 0 15px 5px rgba(132, 132, 132, .10);
    --lm-shadow-sm: rgba(0, 0, 0, .04) 0 3px 5px;
    --lm-hover: #f5f7fa;
}

html[data-theme="dark"] {
    --lm-bg: #181a1c;
    --lm-surface: #242629;
    --lm-text: #f5f5f5;
    --lm-text-2: #c2c6cc;
    --lm-text-3: #9aa0a6;
    --lm-border: #3a3d42;
    --lm-input: #1d1e20;
    --lm-shadow: 0 0 15px 5px rgba(0, 0, 0, .25);
    --lm-shadow-sm: rgba(0, 0, 0, .35) 0 3px 5px;
    --lm-hover: #2c2f33;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: var(--lm-font);
    color: var(--lm-text);
    background: var(--lm-bg);
    padding-top: var(--lm-header-h);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background .25s ease, color .25s ease;
}

a { color: var(--lm-primary); text-decoration: none; }
a:hover { color: var(--lm-primary-shade); }
img { max-width: 100%; height: auto; }
.lm-clear { clear: both; }

/* ─── Header ─── */
.lm-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--lm-header-h);
    background: var(--lm-surface);
    box-shadow: 0 0 15px 3px rgba(132, 132, 132, .10);
    z-index: 1000;
}
.lm-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.lm-burger {
    display: none;
    width: 40px; height: 40px;
    border: none;
    background: none;
    color: var(--lm-text);
    font-size: 22px;
    cursor: pointer;
}
.lm-logo { display: inline-flex; align-items: center; }
.lm-logo img { max-height: 40px; width: auto; display: block; }
.lm-logo-text { font-size: 20px; font-weight: 700; color: var(--lm-text); }

.lm-nav { display: flex; align-items: center; gap: 6px; margin-left: 10px; }
.lm-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--lm-text);
    font-size: 15px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}
.lm-nav a:hover { border-bottom-color: var(--lm-primary); color: var(--lm-primary); }

.lm-header-search { margin-left: auto; flex: 1; max-width: 380px; }
.lm-header-search form { position: relative; }
.lm-header-search input {
    width: 100%;
    height: 42px;
    padding: 0 44px 0 16px;
    border: 1px solid var(--lm-border);
    border-radius: 24px;
    background: var(--lm-input);
    font-family: inherit;
    font-size: 14px;
    color: var(--lm-text);
    outline: none;
}
.lm-header-search input:focus { border-color: var(--lm-primary); box-shadow: 0 0 0 3px rgba(29, 155, 240, .15); }
.lm-header-search button {
    position: absolute; right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    border: none; border-radius: 50%;
    background: var(--lm-primary); color: #fff;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}

.lm-theme-toggle {
    width: 40px; height: 40px;
    border: 1px solid var(--lm-border);
    border-radius: 50%;
    background: var(--lm-surface);
    color: var(--lm-primary);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.lm-theme-toggle svg { width: 20px; height: 20px; }
.lm-theme-toggle .lm-sun { display: none; }
html[data-theme="dark"] .lm-theme-toggle .lm-sun { display: block; }
html[data-theme="dark"] .lm-theme-toggle .lm-moon { display: none; }

/* ─── Mobile drawer ─── */
.lm-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 0;
    overflow: hidden;
    background: var(--lm-surface);
    z-index: 1100;
    transition: width .3s ease;
    padding-top: 60px;
    box-shadow: 2px 0 12px rgba(0, 0, 0, .15);
}
.lm-drawer a {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 22px;
    color: var(--lm-text);
    font-size: 15px;
    border-bottom: 1px solid var(--lm-border);
}
.lm-drawer a:hover { background: var(--lm-hover); }
.lm-drawer .lm-close {
    position: absolute; top: 12px; right: 18px;
    font-size: 26px; border: none; background: none;
    color: var(--lm-text); cursor: pointer;
}

/* ─── Layout ─── */
.lm-container {
    max-width: 1200px;
    margin: 12px auto 0;
    padding: 0 18px 40px;
}

/* ─── Hero ─── */
.lm-hero {
    background: linear-gradient(135deg, #1d9bf0 0%, #43a5ff 100%);
    color: #fff;
    border-radius: 14px;
    padding: 24px 26px;
    margin-bottom: 22px;
    box-shadow: var(--lm-shadow);
}
.lm-hero h1 { margin: 0 0 6px; font-size: 24px; font-weight: 700; }
.lm-hero h2 { margin: 0 0 10px; font-size: 15px; font-weight: 400; opacity: .95; }
.lm-hero p { margin: 0; font-size: 14px; opacity: .95; line-height: 1.7; }

/* ─── Section heading ─── */
.lm-section { margin-bottom: 28px; }
.lm-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.lm-section-head h1, .lm-section-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--lm-text);
    text-transform: uppercase;
    border-bottom: 3px solid var(--lm-primary);
    padding-bottom: 3px;
}
.lm-section-head a { font-size: 14px; font-weight: 500; color: var(--lm-sky); }

/* ─── App grid (icon-left cards) ─── */
.lm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.lm-app {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--lm-surface);
    border-radius: var(--lm-radius);
    box-shadow: var(--lm-shadow-sm);
    padding: 14px;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}
.lm-app:hover { transform: translateY(-3px); box-shadow: var(--lm-shadow); }
.lm-app-icon {
    width: 72px; height: 72px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--lm-input);
}
.lm-app-body { min-width: 0; flex: 1; }
.lm-app-name {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 600;
    color: var(--lm-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.lm-app-meta {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--lm-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lm-app-meta .lm-ver { color: var(--lm-primary); }
.lm-chips { display: flex; gap: 8px; }
.lm-chip {
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    padding: 3px 10px;
    border-radius: 5px;
    line-height: 18px;
}
.lm-chip-apk { background: var(--lm-apk); }
.lm-chip-mod { background: var(--lm-mod); }

/* ─── Compact blocks (recommended) ─── */
.lm-blocks { display: flex; flex-wrap: wrap; gap: 18px; }
.lm-block { width: 80px; text-align: center; }
.lm-block img {
    width: 70px; height: 70px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--lm-input);
    box-shadow: var(--lm-shadow-sm);
}
.lm-block span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    color: var(--lm-text);
    margin-top: 6px;
    line-height: 1.3;
}

/* ─── Card / panel ─── */
.lm-card {
    background: var(--lm-surface);
    border-radius: 14px;
    box-shadow: var(--lm-shadow);
    padding: 20px;
    margin-bottom: 22px;
}

/* ─── Breadcrumb ─── */
.lm-breadcrumb { font-size: 13px; color: var(--lm-text-2); margin-bottom: 16px; }
.lm-breadcrumb a { color: var(--lm-text-2); }
.lm-breadcrumb span + span::before { content: '›'; margin: 0 8px; color: var(--lm-text-3); }

/* ─── App detail ─── */
.lm-detail-head { display: flex; gap: 18px; align-items: center; }
.lm-detail-head .lm-detail-icon {
    width: 110px; height: 110px;
    border-radius: 16px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--lm-shadow-sm);
}
.lm-detail-head h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--lm-text); }
.lm-detail-head p { margin: 0; color: var(--lm-text-2); font-size: 14px; }
.lm-detail-head .lm-rate { color: var(--lm-primary); font-weight: 600; }

.lm-info-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.lm-info-table th, .lm-info-table td {
    text-align: left;
    padding: 9px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--lm-border);
}
.lm-info-table th { color: var(--lm-text-2); font-weight: 500; width: 40%; }
.lm-info-table td { color: var(--lm-text); font-weight: 500; }

.lm-dl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.lm-dl-row-single { grid-template-columns: 1fr; }
.lm-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    color: #fff;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
    min-height: 54px;
}
.lm-btn-primary { background: var(--lm-primary-shade); }
.lm-btn-primary:hover { background: var(--lm-primary); color: #fff; }
.lm-btn-tg { background: #29a9eb; }
.lm-btn-tg:hover { background: #1e93d0; color: #fff; }

.lm-shots { display: flex; gap: 10px; overflow-x: auto; margin: 18px 0; padding-bottom: 6px; }
.lm-shots img { height: 200px; border-radius: 10px; flex-shrink: 0; box-shadow: var(--lm-shadow-sm); }

.lm-content { font-size: 15px; color: var(--lm-text); line-height: 1.8; }
.lm-content h2, .lm-content h3 { color: var(--lm-text); margin: 22px 0 10px; }
.lm-content p { color: var(--lm-text-2); }
.lm-content img { border-radius: 10px; }
.lm-content ul { padding-left: 20px; color: var(--lm-text-2); }

/* ─── Download page ─── */
.lm-download { text-align: center; padding: 26px 20px; }
.lm-download img.lm-dl-icon { width: 96px; height: 96px; border-radius: 16px; box-shadow: var(--lm-shadow-sm); }
.lm-download h1 { font-size: 22px; color: var(--lm-text); margin: 14px 0 6px; }
.lm-download .lm-meta { color: var(--lm-text-2); margin-bottom: 22px; }

/* ─── Reviews ─── */
.lm-rating-summary {
    display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
    padding-bottom: 18px; border-bottom: 1px solid var(--lm-border); margin-bottom: 8px;
}
.lm-rating-score { text-align: center; min-width: 110px; }
.lm-rating-score .lm-score-num { font-size: 46px; font-weight: 700; color: var(--lm-text); line-height: 1; }
.lm-rating-score .lm-score-count { font-size: 12px; color: var(--lm-text-2); margin-top: 6px; }
.lm-stars { color: #f5a623; letter-spacing: 2px; font-size: 18px; }
.lm-stars .lm-star-off { color: var(--lm-border); }
.lm-bars { flex: 1; min-width: 220px; }
.lm-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--lm-text-2); margin: 4px 0; }
.lm-bar-row .lm-bar-label { width: 12px; text-align: right; }
.lm-bar { flex: 1; height: 8px; background: var(--lm-input); border-radius: 6px; overflow: hidden; }
.lm-bar > span { display: block; height: 100%; background: var(--lm-primary); border-radius: 6px; }

.lm-comment { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--lm-border); }
.lm-comment:last-child { border-bottom: none; }
.lm-comment-avatar img { width: 46px; height: 46px; border-radius: 50%; background: var(--lm-input); }
.lm-comment-body { flex: 1; min-width: 0; }
.lm-comment-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lm-comment-author { font-weight: 600; color: var(--lm-text); font-size: 14px; }
.lm-comment-date { font-size: 12px; color: var(--lm-text-2); }
.lm-comment-text { font-size: 14px; color: var(--lm-text-2); margin-top: 4px; line-height: 1.7; }
.lm-comment-text p { margin: 0 0 6px; }
.lm-no-comments { color: var(--lm-text-2); font-size: 14px; padding: 10px 0; }

/* ─── Review form (cosmetic) ─── */
.lm-review-form { margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--lm-border); }
.lm-review-form h3 { margin: 0 0 14px; font-size: 16px; color: var(--lm-text); font-weight: 600; }
.lm-form-row { margin-bottom: 14px; }
.lm-form-row label { display: block; font-size: 13px; font-weight: 500; color: var(--lm-text); margin-bottom: 6px; }
.lm-form-row select,
.lm-form-row input[type="text"],
.lm-form-row textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--lm-border);
    border-radius: 8px;
    background: var(--lm-input);
    font-family: inherit;
    font-size: 14px;
    color: var(--lm-text);
    outline: none;
}
.lm-form-row select:focus,
.lm-form-row input[type="text"]:focus,
.lm-form-row textarea:focus { border-color: var(--lm-primary); box-shadow: 0 0 0 3px rgba(29, 155, 240, .14); }
.lm-form-row textarea { resize: vertical; min-height: 96px; }
.lm-form-grid { display: grid; grid-template-columns: 200px 1fr; gap: 14px; }
.lm-review-form .lm-btn-primary { width: auto; padding: 12px 26px; }

/* ─── Categories ─── */
.lm-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 18px; }
.lm-cat-grid a {
    display: block;
    padding: 11px 8px;
    color: var(--lm-text);
    font-size: 15px;
    border-bottom: 1px solid var(--lm-border);
}
.lm-cat-grid a:hover { background: var(--lm-hover); color: var(--lm-primary); }

/* ─── Notice / 404 ─── */
.lm-notice { color: var(--lm-text-2); font-size: 14px; padding: 14px 0; }
.lm-404 { text-align: center; padding: 50px 20px; }
.lm-404 .lm-code { font-size: 96px; font-weight: 900; color: var(--lm-primary); line-height: 1; letter-spacing: 4px; }

/* ─── Footer ─── */
.lm-footer { background: var(--lm-surface); box-shadow: var(--lm-shadow); margin-top: 24px; }
.lm-footer-inner { max-width: 1200px; margin: 0 auto; padding: 30px 18px; }
.lm-footer-links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; }
.lm-footer-links a { color: var(--lm-text); font-size: 14px; }
.lm-footer-links a:hover { color: var(--lm-primary); }
.lm-footer-copy { font-size: 13px; color: var(--lm-text-2); border-top: 1px solid var(--lm-border); padding-top: 14px; }
.lm-footer-copy b { color: var(--lm-text); }

/* ─── Back to top ─── */
.lm-top {
    position: fixed; bottom: 28px; right: 28px;
    width: 44px; height: 44px;
    border: none; border-radius: 8px;
    background: var(--lm-primary); color: #fff;
    font-size: 22px; cursor: pointer;
    display: none; align-items: center; justify-content: center;
    z-index: 900;
    box-shadow: var(--lm-shadow);
}
.lm-top.lm-show { display: inline-flex; }

/* ─── Responsive ─── */
@media (max-width: 991px) {
    .lm-grid { grid-template-columns: repeat(2, 1fr); }
    .lm-nav { display: none; }
}
@media (max-width: 768px) {
    .lm-burger { display: inline-flex; }
    .lm-cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .lm-grid { grid-template-columns: 1fr; }
    .lm-cat-grid { grid-template-columns: 1fr; }
    .lm-dl-row { grid-template-columns: 1fr; }
    .lm-form-grid { grid-template-columns: 1fr; }
    .lm-detail-head .lm-detail-icon { width: 84px; height: 84px; }
    .lm-shots img { height: 150px; }
    .lm-header-search { max-width: none; }
}
