:root {
    --bg: #f8faf7;
    --surface: #ffffff;
    --text: #172116;
    --muted: #667064;
    --line: #dfe8dc;
    --accent: #19cf55;
    --accent-strong: #10833c;
    --soft: #edf7ee;
    --shadow: 0 18px 60px rgba(22, 48, 28, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 88% 12%, rgba(25, 207, 85, 0.12), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.page-shell {
    width: min(100% - 32px, 1040px);
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

.intro {
    padding: 48px 0 18px;
    max-width: 690px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-strong);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
}

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

.intro-title {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 10px;
}

.title-logo {
    width: clamp(54px, 8vw, 76px);
    height: clamp(54px, 8vw, 76px);
    flex: 0 0 auto;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 8px 22px rgba(25, 207, 85, 0.22);
}

.intro h1 {
    margin-bottom: 0;
    font-size: clamp(2.2rem, 7vw, 4.8rem);
    line-height: 0.98;
    font-weight: 800;
}

.intro-copy {
    margin-bottom: 0;
    max-width: 540px;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.5;
}

.apps-panel {
    margin-bottom: 52px;
}

.apps-table {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
}

.apps-head,
.app-row {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 88px 172px 86px 84px;
    align-items: center;
    gap: 14px;
}

.apps-head {
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.app-row {
    min-height: 86px;
    padding: 12px 16px;
}

.app-row + .app-row {
    border-top: 1px solid var(--line);
}

.app-identity {
    display: grid;
    grid-template-columns: 56px 1fr;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.app-thumb-frame {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(23, 33, 22, 0.08);
    border-radius: 8px;
    background: #f5f8f4;
}

.app-thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-identity h2 {
    margin-bottom: 3px;
    font-size: 1rem;
    line-height: 1.25;
}

.app-identity p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.35;
}

.metric {
    display: grid;
    gap: 2px;
    font-weight: 800;
}

.metric-label {
    display: none;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.vote-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.vote-button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--accent-strong);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.vote-button:hover,
.vote-button:focus-visible {
    border-color: rgba(25, 207, 85, 0.55);
    background: var(--soft);
    outline: none;
}

.vote-button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.vote-button.is-used {
    background: var(--accent);
    border-color: var(--accent);
    color: #05220f;
}

.open-cell {
    text-align: right;
}

.open-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    background: var(--text);
    color: white;
    font-weight: 800;
    text-decoration: none;
}

.open-link:hover,
.open-link:focus-visible {
    background: var(--accent-strong);
    outline: none;
}

.empty-state {
    margin: 56px 0;
    padding: 42px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
    text-align: center;
}

.empty-state p {
    color: var(--muted);
}

.site-footer {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 24px 0 32px;
    color: var(--muted);
}

.site-footer button {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.site-footer button:hover,
.site-footer button:focus-visible {
    color: var(--text);
    outline: none;
}

.modal-layer {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 20, 8, 0.48);
}

.modal {
    position: relative;
    width: min(100%, 520px);
    padding: 28px;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.22);
}

.modal h2 {
    margin-bottom: 12px;
    font-size: 1.45rem;
}

.modal p {
    color: var(--muted);
    line-height: 1.6;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
}

[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 24px, 1040px);
    }

    .intro {
        padding: 34px 0 18px;
    }

    .intro-title {
        gap: 14px;
    }

    .apps-table {
        display: grid;
        gap: 12px;
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .apps-head {
        display: none;
    }

    .app-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: var(--shadow);
    }

    .app-row + .app-row {
        border-top: 1px solid var(--line);
    }

    .app-identity {
        grid-column: 1 / -1;
    }

    .metric-label {
        display: block;
    }

    .vote-controls {
        grid-column: 1 / -1;
        flex-wrap: wrap;
    }

    .open-cell {
        text-align: left;
    }

    .open-link {
        width: 100%;
    }

    .site-footer {
        flex-wrap: wrap;
        gap: 10px 16px;
    }
}

@media (max-width: 430px) {
    .app-row {
        grid-template-columns: 1fr;
    }

    .app-identity {
        grid-template-columns: 52px 1fr;
        gap: 12px;
    }

    .app-thumb-frame {
        width: 52px;
        height: 52px;
    }

    .score {
        margin-top: -8px;
    }
}
