* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #ffffff;
    --bg-alt: #f1f3f4;
    --fg: #202124;
    --muted: #5f6368;
    --line: #e8eaed;
    --primary: #01875f;        /* Google Play green */
    --primary-hover: #017048;
    --link: #1a73e8;
    --rating: #5f6368;
    --hero-bg-1: #e3f2fd;
    --hero-bg-2: #fce8e6;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Google Sans', 'Roboto', 'Segoe UI', 'Helvetica Neue', Arial,
        'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* === Top app bar === */
.topbar {
    position: sticky;
    top: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    z-index: 100;
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.brand-name {
    font-size: 20px;
    font-weight: 400;
    color: var(--fg);
}
.brand-name b { font-weight: 500; }

.search {
    flex: 1;
    max-width: 720px;
    display: flex;
    align-items: center;
    background: var(--bg-alt);
    border-radius: 999px;
    padding: 0 18px;
    height: 44px;
}
.search-icon { color: var(--muted); margin-right: 10px; flex-shrink: 0; }
.search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 15px;
    color: var(--fg);
}
.search input::placeholder { color: var(--muted); }

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.icon-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.15s;
}
.icon-btn:hover { background: var(--bg-alt); }
.signin {
    height: 36px;
    padding: 0 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--link);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
}
.signin:hover { background: #f6fafe; border-color: #d2e3fc; }

/* Category tabs */
.cat-tabs, .sub-tabs {
    display: flex;
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar, .sub-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
    padding: 14px 0;
    font-size: 15px;
    color: var(--muted);
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    white-space: nowrap;
    cursor: pointer;
    font-family: inherit;
}
.cat-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.cat-tab:hover { color: var(--fg); }

.sub-tabs {
    border-top: 1px solid var(--line);
    gap: 28px;
    padding-top: 4px;
    padding-bottom: 4px;
}
.sub-tab {
    padding: 12px 0;
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
}
.sub-tab.active { color: var(--fg); font-weight: 500; }
.sub-tab:hover { color: var(--fg); }

/* === Store body === */
.store {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
}

/* Hero feature */
.hero-feature {
    position: relative;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 36px 40px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 32px;
    background: linear-gradient(120deg, var(--hero-bg-1), var(--hero-bg-2));
}
.hero-content { flex: 1; min-width: 0; }
.hero-eyebrow {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}
.hero-title {
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--fg);
}
.hero-tag {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 14px;
}
.hero-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.hero-meta .rating { color: var(--fg); font-weight: 500; }
.hero-meta .dot { color: #bdc1c6; }
.hero-cta { display: flex; gap: 10px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 20px;
    border-radius: 18px;
    border: 0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--line);
}
.btn-ghost:hover { background: #f1f8f5; border-color: #c7e7d8; }

.hero-icon { flex-shrink: 0; }
.icon-tile {
    width: 120px; height: 120px;
    border-radius: 28px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 32px;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Chips */
.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 28px;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex-shrink: 0;
    height: 32px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--fg);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.chip:hover { background: var(--bg-alt); border-color: #dadce0; }

/* Rails */
.rail { margin-bottom: 36px; }
.rail-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}
.rail-head h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--fg);
}
.more {
    font-size: 13px;
    color: var(--link);
    font-weight: 500;
}
.more:hover { text-decoration: underline; }

/* App grid (icon + meta cards) */
.rail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px 16px;
}
.app-card {
    display: block;
    color: var(--fg);
}
.app-card .app-icon {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 120px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 1px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: transform 0.15s;
}
.app-card:hover .app-icon { transform: scale(1.03); }
.app-info h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    color: var(--fg);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-sub {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 2px;
}
.app-rate {
    font-size: 12px;
    color: var(--rating);
    display: flex;
    align-items: center;
    gap: 6px;
}
.app-rate .size { color: #80868b; }

/* Top charts list */
.chart-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 8px 24px;
}
.chart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 0;
}
.chart-rank {
    flex-shrink: 0;
    width: 28px;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: var(--muted);
}
.chart-card {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.15s;
}
.chart-card:hover { background: var(--bg-alt); }
.app-icon.sm {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    font-size: 16px;
    flex-shrink: 0;
    margin-bottom: 0;
    color: #fff;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.chart-card .app-info { flex: 1; min-width: 0; }

/* Categories grid */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.cat-card {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid var(--line);
    color: var(--fg);
    font-size: 14px;
    transition: background 0.15s, border-color 0.15s;
}
.cat-card:hover { background: var(--bg-alt); border-color: #dadce0; }

/* Footer */
.store-footer {
    border-top: 1px solid var(--line);
    background: var(--bg);
    margin-top: 24px;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px;
    text-align: center;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.footer-links a {
    font-size: 13px;
    color: var(--muted);
}
.footer-links a:hover { color: var(--fg); text-decoration: underline; }
.copy { font-size: 12px; color: #80868b; }

/* Badges */
.badge-official, .badge-community {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    vertical-align: middle;
}
.badge-official { background: #e6f4ea; color: #137333; }
.badge-community { background: #e8f0fe; color: #1967d2; }

/* Empty state */
.empty-state {
    padding: 24px 0;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    grid-column: 1 / -1;
}
.empty-state a { color: var(--link); font-weight: 500; }

/* CTA banner */
.cta-banner {
    margin: 48px 0 16px;
    padding: 36px 32px;
    border-radius: 16px;
    background: linear-gradient(120deg, #e6f4ea, #e3f2fd);
}
.cta-banner-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.cta-banner h2 { font-size: 22px; font-weight: 500; margin-bottom: 10px; }
.cta-banner p { color: var(--muted); margin-bottom: 18px; font-size: 14px; line-height: 1.7; }
.cta-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Search bar enabled */
.search input { cursor: text; }
.search input:disabled { cursor: default; opacity: 0.6; }

/* Responsive */
@media (max-width: 720px) {
    .topbar-inner { padding: 8px 12px; }
    .brand-name { display: none; }
    .signin { display: none; }
    .cat-tabs, .sub-tabs { padding: 0 12px; gap: 18px; }
    .store { padding: 16px 12px; }
    .hero-feature { flex-direction: column; align-items: flex-start; padding: 24px; gap: 16px; }
    .icon-tile { width: 88px; height: 88px; border-radius: 22px; font-size: 24px; }
    .rail-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 18px 12px; }
    .app-card .app-icon { border-radius: 20px; font-size: 22px; }
}
