:root {
    --bg: #f5f1e8;
    --panel: rgba(255, 255, 255, 0.78);
    --panel-strong: #fffdf8;
    --ink: #1f2421;
    --muted: #5f665f;
    --line: rgba(31, 36, 33, 0.08);
    --green: #1f8f5f;
    --amber: #bb7a16;
    --red: #b54848;
    --shadow: 0 18px 40px rgba(49, 42, 24, 0.10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(201, 170, 104, 0.18), transparent 35%),
        radial-gradient(circle at top right, rgba(143, 94, 64, 0.12), transparent 30%),
        linear-gradient(180deg, #f9f6ee 0%, var(--bg) 100%);
}

.page-shell {
    max-width: 1500px;
    margin: 0 auto;
    padding: 28px;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.hero h1 {
    margin: 0;
    font-size: clamp(32px, 5vw, 54px);
    line-height: 0.95;
}

.hero-copy {
    max-width: 760px;
    color: var(--muted);
    margin-top: 12px;
}

.hero-stats {
    display: flex;
    gap: 14px;
}

.stat-card,
.toolbar,
.table-card,
.alternatives-modal {
    background: var(--panel);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: var(--shadow);
}

.stat-card {
    min-width: 140px;
    padding: 18px 20px;
    border-radius: 22px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    font-size: 26px;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 24px;
    margin-bottom: 22px;
}

.toolbar input,
.toolbar select {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
}

.toolbar input {
    flex: 1;
    min-width: 320px;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-group label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-card {
    border-radius: 28px;
    overflow: hidden;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(249, 246, 238, 0.96);
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 12px;
}

.results-table th,
.results-table td {
    padding: 16px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.5);
}

.wine-cell strong {
    display: block;
    font-size: 15px;
}

.platform-card,
.confidence-pill {
    width: 100%;
    border: 0;
    background: var(--panel-strong);
    border-radius: 16px;
    padding: 12px 14px;
    text-align: left;
    min-height: 68px;
}

.vinumplay-card {
    cursor: default;
}

.vinumplay-price-pill {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 68px;
    background: var(--panel-strong);
    color: var(--green);
    text-align: right;
    font-size: 16px;
    font-weight: 800;
}

.platform-card.is-clickable,
.confidence-pill:not(:disabled) {
    cursor: pointer;
}

.platform-card:disabled,
.confidence-pill:disabled {
    opacity: 0.55;
}

.platform-name {
    display: block;
    font-weight: 700;
}

.platform-price {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.confidence-pill {
    text-align: center;
    font-weight: 800;
    font-size: 18px;
    min-height: auto;
}

.confidence-green { background: rgba(31, 143, 95, 0.14); color: var(--green); }
.confidence-amber { background: rgba(187, 122, 22, 0.16); color: var(--amber); }
.confidence-red { background: rgba(181, 72, 72, 0.14); color: var(--red); }
.confidence-empty { background: rgba(255,255,255,0.72); color: #a8ada8; }

.confidence-pill.vinumplay-price-pill {
    min-height: 68px;
}

.tooltip {
    position: fixed;
    z-index: 20;
    width: min(360px, calc(100vw - 24px));
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(24, 24, 24, 0.92);
    color: white;
    font-size: 13px;
    line-height: 1.45;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.28);
    max-height: calc(100vh - 24px);
    overflow: auto;
}

.tooltip-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 10px;
}

.tooltip-title {
    font-weight: 700;
    font-size: 14px;
}

.tooltip-price {
    color: #d6f8e7;
    font-weight: 700;
    white-space: nowrap;
}

.tooltip-meta {
    display: grid;
    gap: 6px;
}

.tooltip-meta div:last-child {
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.alternatives-modal {
    width: min(980px, 92vw);
    border: 0;
    border-radius: 28px;
    padding: 24px;
}

.alternatives-modal::backdrop {
    background: rgba(16, 12, 8, 0.5);
    backdrop-filter: blur(6px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    border: 0;
    background: #1f2421;
    color: white;
    border-radius: 999px;
    width: 38px;
    height: 38px;
    font-size: 24px;
    cursor: pointer;
}

.main-match-card {
    margin-top: 18px;
    margin-bottom: 22px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,0.8);
}

.modal-subtitle {
    margin-bottom: 14px;
}

.alternatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.alternative-card {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.78);
    border: 1px solid var(--line);
}

.card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 10px;
}

.card-head h4 {
    margin: 0;
    font-size: 16px;
}

.card-price {
    font-weight: 800;
    color: var(--green);
    white-space: nowrap;
}

.meta-list {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
}

.meta-list a {
    color: var(--green);
    text-decoration: none;
}

@media (max-width: 980px) {
    .hero,
    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .hero-stats {
        justify-content: flex-start;
    }
    .results-table {
        font-size: 14px;
    }
}
