:root {
    --ink: #17201d;
    --muted: #63716b;
    --paper: #f4f1e8;
    --surface: #fffdf8;
    --accent: #ee6b3b;
    --accent-dark: #bd4520;
    --green: #1f6d5a;
    --blue: #2671a8;
    --red: #b63a3a;
    --bgg-orange: #ff5100;
    --bgg-purple: #40395f;
}

body {
    background: var(--paper);
    color: var(--ink);
    min-height: 100vh;
}

.hero {
    background:
        radial-gradient(circle at 88% 15%, rgba(238, 107, 59, .22), transparent 28%),
        linear-gradient(145deg, #fffdf8 0%, #e8eee5 100%);
    border-bottom: 1px solid rgba(23, 32, 29, .09);
}

.brand-mark {
    align-items: center;
    background: var(--ink);
    border-radius: 1rem;
    color: white;
    display: flex;
    font-size: 1.2rem;
    font-weight: 800;
    height: 3.25rem;
    justify-content: center;
    letter-spacing: -.08em;
    transform: rotate(-4deg);
    width: 3.25rem;
}

.eyebrow,
.type-label {
    color: var(--green);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.stat-card {
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: .9rem;
    display: flex;
    flex-direction: column;
    padding: .8rem;
}

.stat-card strong {
    font-size: 1.35rem;
}

.stat-card span {
    color: var(--muted);
    font-size: .75rem;
}

.filter-bar {
    scrollbar-width: none;
}

.view-switch {
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 999px;
    gap: .25rem;
    max-width: 100%;
    overflow-x: auto;
    padding: .3rem;
    scrollbar-width: none;
}

.view-switch::-webkit-scrollbar {
    display: none;
}

.view-switch a {
    align-items: center;
    border-radius: 999px;
    color: var(--muted);
    display: flex;
    font-size: .85rem;
    font-weight: 700;
    gap: .45rem;
    padding: .55rem .8rem;
    text-decoration: none;
    white-space: nowrap;
}

.view-switch a.active {
    background: var(--ink);
    color: white;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.offer-card,
.detail-card {
    background: var(--surface);
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 1.2rem;
    box-shadow: 0 .7rem 2rem rgba(23, 32, 29, .06);
}

.offer-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: transform .2s ease, box-shadow .2s ease;
}

.offer-card:hover {
    box-shadow: 0 1rem 2.5rem rgba(23, 32, 29, .12);
    transform: translateY(-3px);
}

.image-wrap {
    background: #e7e3d8;
    display: block;
    height: 13rem;
    overflow: hidden;
    position: relative;
}

.image-wrap img,
.detail-image img {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.unknowns-logo {
    box-sizing: border-box;
    padding: clamp(1.5rem, 8%, 3rem);
}

.source-badge {
    backdrop-filter: blur(10px);
    background: rgba(23, 32, 29, .84);
    border-radius: 999px;
    bottom: .8rem;
    color: white;
    font-size: .72rem;
    font-weight: 700;
    left: .8rem;
    padding: .4rem .7rem;
    position: absolute;
}

.bgg-rating {
    align-items: center;
    background: var(--bgg-orange);
    clip-path: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0 50%);
    color: white;
    display: flex;
    flex-direction: column;
    height: 4.1rem;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: .65rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
    top: .65rem;
    width: 4.1rem;
}

.bgg-rating::before {
    background: var(--bgg-purple);
    clip-path: inherit;
    content: "";
    inset: .18rem;
    position: absolute;
}

.bgg-rating small {
    color: #ffb08d;
    font-size: .55rem;
    font-weight: 900;
    letter-spacing: .08em;
    margin-bottom: .15rem;
    z-index: 1;
}

.bgg-rating strong {
    font-size: 1.1rem;
    font-weight: 900;
    z-index: 1;
}

.image-placeholder {
    align-items: center;
    display: flex;
    font-size: 4rem;
    height: 100%;
    justify-content: center;
    min-height: 14rem;
}

.price,
.detail-price {
    color: var(--accent-dark);
    white-space: nowrap;
}

.detail-price {
    font-size: 2rem;
    font-weight: 800;
}

.availability,
.comparison,
.timestamps {
    color: var(--muted);
    font-size: .9rem;
}

.empty-state {
    padding: 5rem 1rem;
    text-align: center;
}

.empty-state span {
    font-size: 4rem;
}

.detail-image {
    background: #e7e3d8;
    min-height: 18rem;
}

.bg-accent,
.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-dark);
    color: white;
}

.info-panel {
    background: #f0eee6;
    border-radius: 1rem;
    padding: 1.1rem;
}

.info-panel dl div {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: .5rem;
}

.info-panel dt {
    color: var(--muted);
    font-weight: 500;
}

.info-panel dd {
    font-weight: 700;
    margin: 0;
    text-align: right;
}

.timestamps {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.back-link,
.info-panel a {
    color: var(--green);
    font-weight: 700;
    text-decoration: none;
}

.activity-hero {
    background:
        radial-gradient(circle at 86% 12%, rgba(38, 113, 168, .2), transparent 30%),
        linear-gradient(145deg, #fffdf8 0%, #e4edea 100%);
}

.activity-timeline {
    margin: 0 auto;
    max-width: 56rem;
    position: relative;
}

.activity-timeline::before {
    background: rgba(23, 32, 29, .12);
    bottom: 1.5rem;
    content: "";
    left: 1.15rem;
    position: absolute;
    top: 1.5rem;
    width: 2px;
}

.activity-entry {
    display: grid;
    gap: .8rem;
    grid-template-columns: 2.3rem minmax(0, 1fr);
    margin-bottom: 1rem;
    position: relative;
}

.activity-marker {
    align-items: center;
    background: var(--green);
    border: .3rem solid var(--paper);
    border-radius: 50%;
    color: white;
    display: flex;
    font-size: .85rem;
    height: 2.3rem;
    justify-content: center;
    width: 2.3rem;
    z-index: 1;
}

.activity-price_changed .activity-marker {
    background: var(--accent-dark);
}

.activity-telegram_sent .activity-marker {
    background: var(--blue);
}

.activity-http_retry .activity-marker,
.activity-lookup_retry .activity-marker {
    background: var(--blue);
}

.activity-telegram_failed .activity-marker {
    background: var(--red);
}

.activity-card {
    background: var(--surface);
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 1rem;
    box-shadow: 0 .6rem 1.8rem rgba(23, 32, 29, .055);
    min-width: 0;
    padding: 1rem;
}

.activity-label {
    color: var(--ink);
    font-size: .82rem;
    font-weight: 800;
}

.source-chip {
    background: #ece9df;
    border-radius: 999px;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 700;
    padding: .25rem .55rem;
}

.activity-time {
    color: var(--muted);
    font-size: .74rem;
    white-space: nowrap;
}

.offer-preview {
    align-items: center;
    display: flex;
    gap: .9rem;
    min-width: 0;
}

.preview-image {
    align-items: center;
    background: #e7e3d8;
    border-radius: .8rem;
    color: var(--green);
    display: flex;
    flex: 0 0 4.5rem;
    font-size: 1.7rem;
    height: 4.5rem;
    justify-content: center;
    overflow: hidden;
}

.preview-image img {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.preview-image .unknowns-logo {
    padding: .65rem;
}

.preview-title {
    color: var(--ink);
    display: block;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: .4rem;
    overflow: hidden;
    text-decoration: none;
    text-overflow: ellipsis;
}

.preview-title:hover {
    color: var(--green);
}

.price-change {
    align-items: center;
    color: var(--accent-dark);
    display: flex;
    font-size: .9rem;
    gap: .45rem;
}

.old-price {
    color: var(--muted);
    text-decoration: line-through;
}

.new-price {
    color: var(--accent-dark);
    font-size: .92rem;
}

.lookup-grid {
    display: grid;
    gap: .55rem;
}

.lookup-result {
    align-items: center;
    background: #f0eee6;
    border-radius: .8rem;
    color: var(--muted);
    display: flex;
    gap: .7rem;
    min-width: 0;
    padding: .7rem .8rem;
}

.lookup-result > i {
    font-size: 1.1rem;
}

.lookup-result > span {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.lookup-result small {
    font-size: .67rem;
    line-height: 1.1;
}

.lookup-result strong {
    color: var(--ink);
    font-size: .8rem;
}

.lookup-result.status-found {
    background: #e0f0e9;
    color: var(--green);
}

.lookup-result.status-not_found,
.lookup-result.status-error {
    background: #f9e6df;
    color: var(--accent-dark);
}

.lookup-result.status-not_configured {
    background: #e8edf1;
    color: #526575;
}

.telegram-note {
    align-items: flex-start;
    background: #e9f1f7;
    border-radius: .8rem;
    color: #31546d;
    display: flex;
    font-size: .85rem;
    gap: .7rem;
    padding: .8rem;
}

.retry-note {
    align-items: flex-start;
    background: #e9f1f7;
    border-radius: .8rem;
    color: #31546d;
    display: flex;
    font-size: .85rem;
    gap: .7rem;
    padding: .8rem;
}

.missing-hero {
    background:
        radial-gradient(circle at 88% 15%, rgba(31, 109, 90, .2), transparent 28%),
        linear-gradient(145deg, #fffdf8 0%, #e5eee9 100%);
}

.missing-panel {
    background: var(--surface);
    border: 1px solid rgba(23, 32, 29, .08);
    border-radius: 1.2rem;
    box-shadow: 0 .7rem 2rem rgba(23, 32, 29, .06);
    padding: 1.25rem;
}

.missing-count {
    align-items: center;
    background: var(--ink);
    border-radius: 999px;
    color: white;
    display: inline-flex;
    font-weight: 800;
    height: 2.5rem;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0 .75rem;
}

.missing-list {
    display: grid;
    gap: .55rem;
}

.missing-list li {
    align-items: center;
    background: #f0eee6;
    border-radius: .8rem;
    display: flex;
    gap: .7rem;
    min-width: 0;
    padding: .75rem .85rem;
}

.missing-list i {
    color: var(--green);
    flex: 0 0 auto;
}

.missing-list span {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.activity-telegram_failed .telegram-note {
    background: #f9e6df;
    color: #89312d;
}

.min-w-0 {
    min-width: 0;
}

@media (min-width: 768px) {
    .stat-card {
        padding: 1rem 1.25rem;
    }

    .stat-card strong {
        font-size: 1.8rem;
    }

    .image-wrap {
        height: 15rem;
    }

    .view-switch a {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .activity-timeline::before {
        left: 1.4rem;
    }

    .activity-entry {
        gap: 1.1rem;
        grid-template-columns: 2.8rem minmax(0, 1fr);
        margin-bottom: 1.25rem;
    }

    .activity-marker {
        font-size: 1rem;
        height: 2.8rem;
        width: 2.8rem;
    }

    .activity-card {
        padding: 1.25rem;
    }

    .missing-panel {
        padding: 1.5rem;
    }

    .lookup-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .detail-image {
        min-height: 42rem;
    }
}
