/* DiwaTop – index.css */
:root {
    --green: #198754;
    --green-dark: #146c43;
    --green-soft: #e8f5ee;
    --accent: #f59e0b;
    --text: #1f2937;
    --muted: #6b7280;
    --bg: #f3f6f4;
    --card: #ffffff;
    --border: #e3e8e5;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(16, 24, 40, .07);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: var(--green); }
ul { padding-left: 1.2rem; }

.skip-link {
    position: absolute; left: -999px; top: 8px; z-index: 200;
    background: var(--green); color: #fff; padding: 8px 14px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { left: 8px; }

a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Navbar ---------- */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .05);
}
.nav-container {
    max-width: 1100px; margin: 0 auto; padding: 10px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.logo-container { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo-icon { width: 40px; height: 40px; border-radius: 10px; overflow: hidden; background: var(--green-soft); flex-shrink: 0; }
.logo-icon img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 800; font-size: 1.3rem; color: var(--green-dark); letter-spacing: .2px; }

.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-links { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.nav-links a {
    display: block; padding: 8px 14px; border-radius: 8px;
    text-decoration: none; color: var(--text); font-weight: 600; font-size: .95rem;
    transition: background .2s, color .2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--green-soft); color: var(--green-dark); }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.telegram-icon { display: inline-flex; line-height: 0; }

.hamburger {
    display: none; width: 40px; height: 40px; padding: 8px;
    background: transparent; border: 0; border-radius: 8px; cursor: pointer;
    flex-direction: column; justify-content: center; gap: 5px;
}
.hamburger .bar { display: block; height: 3px; width: 100%; background: var(--text); border-radius: 3px; transition: transform .25s, opacity .25s; }
.hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active .bar:nth-child(2) { opacity: 0; }
.hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Layout ---------- */
.main-content { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }

.section-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 14px; color: var(--text); }

/* ---------- Intro ---------- */
.app-description {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 22px;
}
.app-description h1 { margin: 0 0 10px; font-size: 1.6rem; line-height: 1.25; color: var(--green-dark); font-weight: 800; }
#app-desc-text { font-size: .95rem; color: #374151; max-height: 6.4em; overflow: hidden; position: relative; }
#app-desc-text p { margin: 0 0 10px; }
#app-desc-text:not(.expanded)::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
}
#app-desc-text.expanded { max-height: none; }
.see-more {
    background: none; border: none; color: var(--green); font: inherit; font-size: .85rem; font-weight: 800;
    cursor: pointer; padding: 0; margin-top: 6px; text-decoration: underline;
}

/* ---------- Most used apps ---------- */
.popular-apps { margin-bottom: 26px; }
.apps-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.app-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 12px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.app-icon { width: 80px; height: 80px; border-radius: 18px; overflow: hidden; background: var(--green-soft); display: block; }
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-name { margin: 6px 0 0; font-size: 1.05rem; font-weight: 800; }
.app-rating { color: var(--accent); font-weight: 800; font-size: .9rem; }
.secure-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--green-dark); }
.secure-badge svg { width: 16px; height: 16px; flex-shrink: 0; }
.download-btn {
    margin-top: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--green); color: #fff; text-decoration: none; font-weight: 800; font-size: .9rem;
    padding: 9px 18px; border-radius: 999px; transition: background .2s, transform .15s;
}
.download-btn svg { width: 18px; height: 18px; }
.download-btn:hover { background: var(--green-dark); }
.download-btn:active { transform: scale(.97); }

/* ---------- Explorer ---------- */
.games-explorer { margin-bottom: 30px; }
.explorer-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }

.tab-switch { display: flex; flex-wrap: wrap; gap: 6px; background: #e6ece8; padding: 5px; border-radius: 12px; }
.tab-btn {
    border: 0; background: transparent; font: inherit; font-weight: 700; font-size: .88rem; color: var(--muted);
    padding: 8px 14px; border-radius: 9px; cursor: pointer; transition: background .2s, color .2s;
}
.tab-btn:hover { color: var(--green-dark); }
.tab-btn.active { background: #fff; color: var(--green-dark); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }

.search-container { position: relative; flex: 1 1 220px; max-width: 320px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
#game-search {
    width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--border); border-radius: 12px;
    font: inherit; font-size: .92rem; background: #fff; color: var(--text);
}
#game-search:focus { border-color: var(--green); }

.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.glass-panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }

.game-card { display: flex; align-items: center; gap: 12px; padding: 12px; transition: border-color .2s, box-shadow .2s; }
.game-card:hover { border-color: #b9dbc9; box-shadow: 0 4px 16px rgba(25, 135, 84, .12); }
.game-card-thumbnail { width: 64px; height: 64px; border-radius: 14px; overflow: hidden; flex-shrink: 0; background: var(--green-soft); display: block; }
.game-card-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.game-card-info { flex: 1; min-width: 0; }
.game-title { margin: 0 0 2px; font-size: 1rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-meta, .game-badge-text { margin: 0; font-size: .8rem; color: var(--muted); }
.game-badge-text { color: var(--green-dark); font-weight: 600; }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.game-card-action { flex-shrink: 0; }

.btn {
    display: inline-flex; align-items: center; gap: 6px; border: 0; cursor: pointer; text-decoration: none;
    font: inherit; font-weight: 800; border-radius: 999px; transition: background .2s, transform .15s;
}
.btn-sm { padding: 8px 12px; font-size: .78rem; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:active { transform: scale(.97); }

.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty-state h3 { margin: 0 0 6px; color: var(--text); }
.empty-state[hidden] { display: none; }

/* ---------- SEO articles ---------- */
.seo-article {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.seo-article h2 { margin: 0 0 10px; font-size: 1.25rem; line-height: 1.3; color: var(--green-dark); font-weight: 800; }
.seo-article h3 { margin: 16px 0 4px; font-size: 1.02rem; font-weight: 800; }
.seo-article p { margin: 0 0 10px; font-size: .95rem; color: #374151; }
.seo-article ul li { margin-bottom: 6px; font-size: .95rem; }
.features-article li::marker { color: var(--green); }

.important-notice {
    background: #fff8e6; border: 1px solid #f5d98b; border-left: 5px solid var(--accent);
    border-radius: var(--radius); padding: 18px 20px;
}
.important-notice h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 800; color: #92400e; }
.important-notice p { margin: 0 0 8px; font-size: .88rem; color: #5b4a1a; }
.important-notice p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { background: #0f2a1d; color: #cfe3d8; text-align: center; padding: 22px 16px; font-size: .88rem; }
.site-footer p { margin: 2px 0; }
.site-footer a { color: #9fd8b8; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
    .hamburger { display: flex; }
    .nav-right { gap: 10px; }
    .nav-links {
        display: none; position: absolute; left: 0; right: 0; top: 100%;
        flex-direction: column; gap: 0; background: #fff;
        border-bottom: 1px solid var(--border); box-shadow: 0 8px 16px rgba(0, 0, 0, .08); padding: 8px 12px;
    }
    .nav-links.active { display: flex; }
    .nav-links a { padding: 12px 14px; }
    .apps-container { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .app-card { padding: 12px 6px; }
    .app-icon { width: 60px; height: 60px; border-radius: 14px; }
    .app-name { font-size: .88rem; }
    .secure-badge { font-size: .68rem; text-align: center; }
    .download-btn { padding: 8px 12px; font-size: .8rem; }
}

@media (max-width: 560px) {
    .main-content { padding: 14px 12px 30px; }
    .app-description h1 { font-size: 1.3rem; }
    .games-grid { grid-template-columns: 1fr; gap: 10px; }
    .explorer-header { flex-direction: column; align-items: stretch; }
    .search-container { max-width: none; }
    .tab-switch { justify-content: space-between; }
    .tab-btn { flex: 1 1 auto; padding: 8px 10px; font-size: .8rem; }
    .brand-name { font-size: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}