:root {
    --deep-bg: #030304;
    --card-bg-light: rgba(40, 40, 45, 0.7);
    --accent: #00aaff;
    --accent-glow: rgba(0, 170, 255, 0.35);
    --ice-white: #e0f2f1;
    --text-dim: #999999;
    --border-light: rgba(255, 255, 255, 0.08);
    --danger: #ff4d4f;
    --warning: #ffa940;
    --success: #00d26a;
    --yellow-1: #f1c40f;
    --yellow-2: #f39c12;
    --red-1: #e74c3c;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    padding: 15px;
    overflow-x: hidden;
    background-color: var(--deep-bg);
    background-image:
        radial-gradient(at 10% 10%, rgba(0, 170, 255, 0.08) 0px, transparent 40%),
        radial-gradient(at 90% 90%, rgba(0, 170, 255, 0.05) 0px, transparent 40%);
    color: var(--ice-white);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- Welcome ---------- */

#welcome-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--deep-bg);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.welcome-content {
    width: 100%;
    max-width: 400px;
    padding: 30px;
    text-align: center;
}

.main-logo-glow {
    width: 160px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 25px var(--accent));
}

.welcome-content h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(180deg, #ffffff 0%, #aaaaaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-description,
.welcome-content p {
    margin-top: 12px;
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.5;
}

.features {
    display: inline-block;
    margin: 30px 0;
    text-align: left;
}

.f-item {
    margin: 12px 0;
    font-size: 15px;
    color: var(--text-dim);
}

.f-item span {
    margin-right: 12px;
}

.start-btn {
    width: 100%;
    border: none;
    border-radius: 20px;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, #0088cc 100%);
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    box-shadow: 0 4px 20px var(--accent-glow);
    cursor: pointer;
}

.start-btn:active {
    transform: scale(0.98);
}

/* ---------- App visibility ---------- */

.app-hidden {
    display: none;
    opacity: 0;
}

.app-visible {
    display: block;
    opacity: 1;
}

.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ---------- Header ---------- */

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-light);
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-logo {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    border-radius: 10px;
    flex-shrink: 0;
}

.header-text h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.header-text p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-dim);
}

.exit-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.exit-btn:active {
    transform: scale(0.94);
    background: rgba(255, 0, 0, 0.18);
    color: #fff;
}

.back-arrow {
    margin-right: 15px;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ---------- Grid / cards ---------- */

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.card {
    border: 1px solid var(--border-light);
    border-radius: 22px;
    padding: 25px 10px;
    background: var(--card-bg-light);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s ease;
}

button.card {
    color: inherit;
    font: inherit;
}

.card:active {
    transform: scale(0.97);
    border-color: var(--accent);
    background: rgba(60, 60, 65, 0.9);
}

.logo-wrap {
    width: 75px;
    height: 75px;
    margin: 0 auto 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-wrap img {
    max-width: 65%;
    max-height: 65%;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.card h2 {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
}

.card span {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-dim);
}

.icon-wrench {
    font-size: 35px;
    color: var(--text-dim);
}

/* ---------- Search ---------- */

.search-container {
    margin-bottom: 16px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-dim);
}

.search-container input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 1px solid var(--border-light);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 15px;
}

.search-container input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- Engine list ---------- */

.engine-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.category-title {
    margin: 10px 0 0;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #888;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 12px;
}

.engine-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: var(--card-bg-light);
    cursor: pointer;
    transition: 0.2s ease;
}

.engine-card:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.05);
}

.engine-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.engine-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.engine-info p {
    margin: 4px 0;
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

.engine-info span {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-dim);
}

.fuel-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    border: 1px solid transparent;
}

.tag-diesel {
    color: #4facfe;
    border-color: #4facfe;
}

.tag-petrol {
    color: #f093fb;
    border-color: #f093fb;
}

.arrow-right {
    color: rgba(255, 255, 255, 0.25);
    font-size: 20px;
    flex-shrink: 0;
}

/* ---------- Engine detail ---------- */

.info-card-main {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid var(--accent-glow);
    border-radius: 20px;
    background: linear-gradient(
        135deg,
        rgba(0, 170, 255, 0.1) 0%,
        rgba(255, 255, 255, 0.05) 100%
    );
}

.spec-row {
    display: flex;
    justify-content: space-around;
    text-align: center;
    gap: 12px;
}

.spec-item {
    flex: 1;
}

.spec-item .label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.spec-item .value {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.section-title {
    margin: 0 0 15px;
    padding-left: 5px;
    font-size: 18px;
    font-weight: 800;
}

/* ---------- Accordion ---------- */

.issue-accordion {
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.issue-accordion[open] {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-glow);
}

.issue-accordion summary {
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.issue-accordion summary::-webkit-details-marker {
    display: none;
}

.issue-title {
    padding-right: 10px;
    font-size: 15px;
    font-weight: 700;
    color: #eee;
}

.issue-content {
    padding: 0 18px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.issue-content p {
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-dim);
}

.issue-content b {
    color: var(--ice-white);
}

.risk-tag {
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.high {
    background: rgba(255, 77, 79, 0.18);
    color: var(--danger);
}

.mid {
    background: rgba(255, 169, 64, 0.18);
    color: var(--warning);
}

.low {
    background: rgba(0, 210, 106, 0.18);
    color: var(--success);
}

/* ---------- Footer blocks ---------- */

.action-footer {
    margin-top: 30px;
}

.checklist-btn {
    padding: 15px;
    border: 1px dashed rgba(0, 255, 100, 0.3);
    border-radius: 15px;
    background: rgba(0, 255, 100, 0.05);
    color: var(--success);
}

.checklist-btn span {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 800;
}

.checklist-btn p {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
}

/* ---------- Promo ---------- */

.promo-section {
    padding: 20px 0 0;
    margin-top: 10px;
}

.tg-promo-btn {
    display: flex;
    align-items: center;
    padding: 15px;
    border-radius: 16px;
    background: linear-gradient(135deg, #2481cc 0%, #00a8e8 100%);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 168, 232, 0.3);
}

.tg-promo-btn:active {
    transform: scale(0.98);
}

.tg-icon {
    margin-right: 15px;
    font-size: 24px;
    flex-shrink: 0;
}

.tg-promo-text {
    flex-grow: 1;
}

.tg-promo-title {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.tg-promo-subtitle {
    display: block;
    font-size: 11px;
    opacity: 0.9;
    color: #fff;
}

.tg-arrow {
    font-size: 18px;
    font-weight: bold;
    flex-shrink: 0;
}

.promo-section-mini {
    padding: 20px;
    text-align: center;
}

.tg-channel-link {
    display: inline-block;
    padding-bottom: 2px;
    border-bottom: 1px dashed #00a8e8;
    color: #00a8e8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

/* ---------- Premium upsell ---------- */

.premium-upsell {
    margin-top: 24px;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.12), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.upsell-content h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #fff;
}

.upsell-content p {
    margin: 0 0 14px;
    font-size: 14px;
    color: #bbb;
    line-height: 1.5;
}

.upsell-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.upsell-list li {
    font-size: 14px;
    margin-bottom: 6px;
    color: #ddd;
}

.premium-btn {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--yellow-1), var(--yellow-2));
    color: #000;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.premium-btn:active {
    transform: scale(0.98);
}

/* ---------- Sell page ---------- */

.sell-container {
    padding: 10px 0 20px;
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

.sell-title {
    margin: 0 0 10px;
    font-size: 24px;
}

.sell-sub {
    margin: 10px 0 20px;
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.5;
}

.sell-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 20px;
    text-align: left;
    border: 1px solid var(--border-light);
}

.sell-box h3 {
    margin: 0 0 12px;
    font-size: 16px;
    color: #fff;
}

.sell-box ul {
    margin: 0;
    padding-left: 18px;
}

.sell-box li {
    margin-bottom: 8px;
    font-size: 14px;
    color: #ddd;
    line-height: 1.4;
}

.price-block {
    margin: 20px 0 14px;
    text-align: center;
}

.old-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 4px;
}

.new-price {
    font-size: 34px;
    font-weight: 900;
    color: var(--yellow-1);
    line-height: 1.1;
}

.discount-badge {
    margin-top: 8px;
    display: inline-block;
    background: var(--red-1);
    color: #fff;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.mini-instruction {
    margin: 0 0 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    text-align: left;
}

.mini-step {
    font-size: 14px;
    color: #e0f2f1;
    margin-bottom: 8px;
    line-height: 1.45;
}

.mini-step:last-child {
    margin-bottom: 0;
}

.buy-btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--yellow-1), var(--yellow-2));
    border: none;
    font-size: 16px;
    font-weight: 800;
    color: #000;
    cursor: pointer;
}

.buy-btn:active {
    transform: scale(0.97);
}

.fast-response {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 10px;
    color: var(--text-dim);
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .grid {
        gap: 12px;
    }

    .card {
        padding: 20px 10px;
    }

    .header-text h1 {
        font-size: 19px;
    }

    .engine-info h3 {
        font-size: 16px;
    }

    .spec-row {
        gap: 8px;
    }

    .sell-title {
        font-size: 22px;
    }

    .new-price {
        font-size: 30px;
    }
}


.engine-help {
    margin: 10px 0 15px;
}

.engine-help-btn {
    width: 100%;
    padding: 14px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, #00aaff, #0088cc);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.35);
    transition: 0.2s;
}

.engine-help-btn span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 3px;
}

.engine-help-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 170, 255, 0.4);
}

.request-container {
    padding: 10px 0 20px;
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

.request-sub {
    font-size: 14px;
    color: #aaa;
    margin: 10px 0 20px;
}

.request-box {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 14px;
    margin-bottom: 20px;
    text-align: left;
}

.request-box h3 {
    margin-bottom: 10px;
}

.request-box li {
    font-size: 14px;
    margin-bottom: 6px;
}

.request-steps {
    background: rgba(255,255,255,0.05);
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 20px;
    text-align: left;
}

.step {
    font-size: 14px;
    margin-bottom: 8px;
}

.contact-btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: #000;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.contact-btn:active {
    transform: scale(0.97);
}

.welcome-actions {
    margin-top: 10px;
}

