:root {
    --bg: #f7f7f8;
    --card: #ffffff;
    --text: #1f2328;
    --muted: #6b7280;
    --accent: #0a84ff;
    --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.site-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}
.brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text);
    text-decoration: none;
}
.search {
    margin-left: auto;
    display: flex;
    gap: 8px;
}
.search input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
}
.search button {
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

main {
    max-width: 1100px;
    margin: 24px auto;
    padding: 0 16px;
}

h1 { font-size: 1.5rem; margin-bottom: 16px; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: box-shadow 0.15s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.card .icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
}
.card .icon-link { display: inline-block; line-height: 0; }
.card .icon-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card h3 { margin: 4px 0 0; font-size: 1.05rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card h3 a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card .more {
    margin-top: auto;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.card .more:hover { text-decoration: underline; }

.empty {
    color: var(--muted);
    background: var(--card);
    padding: 24px;
    border-radius: 12px;
    text-align: center;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    padding: 24px;
    margin-top: 32px;
}

.back {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--accent);
    text-decoration: none;
}
.back:hover { text-decoration: underline; }

.hero {
    display: flex;
    gap: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    align-items: flex-start;
}
.hero-icon {
    width: 128px;
    height: 128px;
    border-radius: 24px;
    object-fit: cover;
    flex-shrink: 0;
}
.hero-meta h1 { margin: 0 0 4px; font-size: 1.6rem; }
.hero-meta .developer { color: var(--muted); margin: 0 0 12px; }
.facts { list-style: none; padding: 0; margin: 0 0 16px; color: var(--muted); }
.facts li { margin-bottom: 4px; }
.stars { color: #f59e0b; letter-spacing: 1px; }

.download {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
}
.download:hover { opacity: 0.9; }

.description, .screenshots {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-top: 16px;
}
.description h2, .screenshots h2 { margin-top: 0; font-size: 1.15rem; }
.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.screenshot-grid img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
}

.pagination .disabled {
    color: #999;
    cursor: not-allowed;
}

.pagination a {
    text-decoration: none;
}
