:root {
    --bg: #080808;
    --panel: rgba(18, 18, 18, 0.84);
    --panel-strong: rgba(24, 24, 24, 0.92);
    --text: #f5f5f5;
    --muted: rgba(255, 255, 255, 0.64);
    --line: rgba(255, 255, 255, 0.1);
    --accent: #f5f5f5;
    --accent-dark: #d9d9d9;
    --accent-soft: #cfcfcf;
    --teal: #ffffff;
    --ink-light: #ffffff;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 24%),
        radial-gradient(circle at right 20%, rgba(255, 255, 255, 0.05), transparent 20%),
        linear-gradient(160deg, #020202 0%, #0c0c0c 52%, #181818 100%);
}

.page {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 72px;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.hero {
    padding: 32px;
}

.app-brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.app-logo {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #ffffff;
}

.app-handle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.68);
    white-space: nowrap;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1;
}

.intro,
.muted,
.hint {
    color: var(--muted);
}

.search-form {
    margin-top: 28px;
}

.search-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

input,
button {
    border-radius: 16px;
    font: inherit;
}

input {
    width: 100%;
    padding: 16px 18px;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
}

button {
    padding: 16px 22px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #101010;
    background: linear-gradient(135deg, #ffffff 0%, #d7d7d7 100%);
    cursor: pointer;
}

.share-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.download-button {
    white-space: nowrap;
    color: #101010;
    background: #ffffff;
}

.secondary-button {
    white-space: nowrap;
    color: #ffffff;
    background: linear-gradient(135deg, #d62828 0%, #a41212 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.result {
    margin-top: 24px;
}

.hidden {
    display: none;
}

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

.stat-card,
.result-card {
    padding: 24px;
}

.result-card {
    margin-top: 16px;
    background: var(--panel-strong);
}

.share-card-panel {
    margin-top: 16px;
    padding: 24px;
    background: linear-gradient(180deg, rgba(16, 16, 16, 0.94) 0%, rgba(22, 22, 22, 0.94) 100%);
}

.share-heading {
    margin-bottom: 18px;
}

.stat-label {
    margin-bottom: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.58);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: baseline;
}

.format-list {
    display: grid;
    gap: 14px;
}

.format-item {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.format-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.bar-track {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffffff, #cfcfcf);
}

.share-preview-wrap {
    display: flex;
    justify-content: center;
}

.share-card {
    width: min(100%, 440px);
    aspect-ratio: 9 / 16;
    padding: 28px;
    border-radius: 32px;
    color: #ffffff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 26%),
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.08), transparent 20%),
        linear-gradient(180deg, #050505 0%, #111111 52%, #202020 100%);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.22);
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: 22px;
    overflow: hidden;
    position: relative;
}

.share-card::before,
.share-card::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(4px);
}

.share-card::before {
    width: 170px;
    height: 170px;
    background: rgba(255, 255, 255, 0.08);
    top: -40px;
    right: -36px;
}

.share-card::after {
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.05);
    bottom: 110px;
    left: -50px;
}

.share-topline,
.share-brand-row,
.share-main,
.share-list-block,
.share-footer {
    position: relative;
    z-index: 1;
}

.share-brand-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.share-logo {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: #ffffff;
}

.share-handle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.98rem;
    color: rgba(255, 255, 255, 0.62);
    white-space: nowrap;
}

.instagram-icon {
    position: relative;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 6px;
    flex: 0 0 auto;
}

.instagram-icon::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
}

.instagram-icon::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

.share-topline {
    font-size: 0.82rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.share-kicker {
    margin-bottom: 8px;
    font-size: 0.92rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.62);
}

.share-name {
    margin-bottom: 18px;
    font-size: clamp(2rem, 6vw, 2.8rem);
    line-height: 0.95;
    max-width: 8ch;
    text-wrap: balance;
}

.share-total-block {
    display: inline-grid;
    gap: 4px;
    padding: 18px 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
}

.share-total-number {
    font-size: clamp(3.5rem, 10vw, 5.4rem);
    font-weight: 800;
    line-height: 0.9;
}

.share-total-label {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.68);
}

.share-list-block {
    padding: 18px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.share-list-head,
.share-top-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.share-list-head {
    margin-bottom: 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.62);
}

.share-top-list {
    display: grid;
    gap: 12px;
}

.share-top-item {
    align-items: center;
}

.share-top-meta {
    flex: 1;
    min-width: 0;
}

.share-top-activity {
    display: block;
    margin-bottom: 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.share-top-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.share-top-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffffff, #cfcfcf);
}

.share-top-count {
    font-size: 1.2rem;
    font-weight: 800;
    color: #ffffff;
}

.share-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.62);
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .page {
        width: min(100% - 20px, 1080px);
        padding-top: 20px;
    }

    .hero,
    .stat-card,
    .result-card {
        padding: 20px;
    }

    .search-row,
    .stats-grid,
    .section-heading,
    .format-head {
        grid-template-columns: 1fr;
        display: grid;
    }

    .share-card-panel {
        order: -1;
        padding: 20px;
    }

    .result {
        display: flex;
        flex-direction: column;
    }

    .share-footer,
    .share-list-head,
    .share-top-item {
        gap: 10px;
    }

    .share-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .share-brand-row {
        grid-template-columns: 1fr;
        display: grid;
    }

    .app-brand-row {
        grid-template-columns: 1fr;
        display: grid;
    }
}
