/*
 * Homepage
 * One component layer for the hero, market discovery controls and cards.
 */

:root {
    --home-card-height: 188px;
    --home-card-radius: 12px;
    --home-card-gap: 12px;
    --home-hero-height: 500px;
    --home-positive-bg: rgba(24, 201, 116, .12);
    --home-positive-bg-hover: rgba(24, 201, 116, .18);
    --home-negative-bg: rgba(228, 79, 85, .11);
    --home-negative-bg-hover: rgba(228, 79, 85, .16);
}

body {
    overflow-x: hidden;
}

.btc-hero,
.amg-section {
    width: min(var(--pm-shell-width), calc(100% - (var(--pm-shell-gutter) * 2)));
    margin-inline: auto;
}

/* Featured market */

.btc-hero {
    margin-top: 16px;
}

.btc-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    height: var(--home-hero-height);
}

.btc-hero__card,
.btc-hero__breaking,
.wc-hero {
    background: var(--pm-surface);
    border: 1px solid var(--pm-line-soft);
    border-radius: var(--pm-radius-lg);
    box-shadow: var(--pm-shadow-card);
}

.btc-hero__card {
    position: relative;
    display: flex;
    min-width: 0;
    height: var(--home-hero-height);
    min-height: 0;
    padding: 20px 22px 16px;
    overflow: hidden;
    flex-direction: column;
}

.btc-hero__card.is-featured > :not(.btc-hero__slide--featured):not(.btc-hero__carousel) {
    display: none;
}

.btc-hero__top {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.btc-hero__asset,
.wc-hero__identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.btc-hero__asset > div {
    min-width: 0;
}

.btc-hero__icon,
.wc-hero__icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 10px;
    object-fit: cover;
}

.btc-hero__title-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.btc-hero__title {
    margin: 0;
    overflow: hidden;
    color: var(--pm-text);
    font-size: 26px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btc-hero__date,
.wc-hero__crumb {
    margin-top: 4px;
    color: var(--pm-text-muted);
    font-size: 13.5px;
    font-weight: var(--pm-weight-medium);
}

.btc-hero__live,
.amg-card__live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--pm-red);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1;
    text-transform: uppercase;
}

.btc-hero__live {
    padding: 4px 7px;
    border: 1px solid var(--pm-red-border);
    border-radius: var(--pm-radius-pill);
    background: var(--pm-red-soft);
}

.btc-hero__live-dot,
.amg-card__live-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: var(--pm-red);
    box-shadow: 0 0 0 3px rgba(228, 79, 85, .10);
}

.btc-hero__meta {
    display: flex;
    align-items: flex-start;
    gap: 22px;
}

.btc-hero__meta-item {
    min-width: 96px;
}

.btc-hero__meta-item > span {
    display: block;
    margin-bottom: 2px;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1.2;
    text-transform: uppercase;
}

.btc-hero__meta-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.btc-hero__meta-row strong {
    color: var(--pm-text);
    font-size: 20px;
    font-weight: var(--pm-weight-medium);
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    transition: color var(--pm-duration-normal) ease;
}

.btc-hero__meta-row strong.is-up,
.btc-hero__meta-row small.is-up {
    color: var(--pm-green);
}

.btc-hero__meta-row strong.is-down,
.btc-hero__meta-row small.is-down {
    color: var(--pm-red);
}

.btc-hero__meta-row small {
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    white-space: nowrap;
}

.btc-hero__share,
.wc-hero__icon-btn,
.amg-icon-btn {
    display: inline-grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--pm-text-secondary);
    cursor: pointer;
    transition: color var(--pm-duration-fast) ease,
                background-color var(--pm-duration-fast) ease,
                transform var(--pm-duration-fast) ease;
}

.btc-hero__share {
    width: 34px;
    height: 34px;
    margin-top: -3px;
    border-radius: var(--pm-radius-sm);
}

.btc-hero__share svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

@media (hover: hover) {
    .btc-hero__share:hover,
    .wc-hero__icon-btn:hover,
    .amg-icon-btn:hover {
        background: var(--pm-surface-hover);
        color: var(--pm-text);
    }
}

.btc-hero__outcomes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: min(356px, 100%);
    margin-top: 14px;
}

.btc-hero__outcome {
    display: flex;
    min-width: 0;
    min-height: 54px;
    padding: 10px 16px;
    border: 0;
    border-radius: var(--pm-radius-sm);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    cursor: pointer;
    text-align: left;
    transition: background-color var(--pm-duration-fast) ease,
                transform var(--pm-duration-fast) ease;
}

.btc-hero__outcome span {
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1;
}

.btc-hero__outcome strong {
    margin-top: 3px;
    font-size: 20px;
    font-weight: var(--pm-weight-medium);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.btc-hero__outcome--up {
    background: var(--home-positive-bg);
    color: var(--pm-green);
}

.btc-hero__outcome--down {
    background: var(--home-negative-bg);
    color: var(--pm-red);
}

@media (hover: hover) {
    .btc-hero__outcome--up:hover { background: var(--home-positive-bg-hover); }
    .btc-hero__outcome--down:hover { background: var(--home-negative-bg-hover); }
}

.btc-hero__outcome:active,
.amg-btn:active,
.amg-mini-btn:active {
    transform: scale(.985);
}

.btc-hero__body {
    display: grid;
    grid-template-columns: minmax(290px, 34%) minmax(0, 1fr);
    gap: 24px;
    min-height: 0;
    margin-top: 16px;
    flex: 1;
    overflow: hidden;
}

.btc-hero__comments {
    min-width: 0;
    padding-top: 2px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, #000 0, #000 84%, transparent 100%);
}

.btc-hero__comments-track,
.wc-hero__comments-track {
    display: flex;
    gap: 13px;
    flex-direction: column;
}

.btc-hero__comments-track.is-scrolling,
.wc-hero__comments-track.is-scrolling {
    animation: homeCommentsScroll 20s linear infinite;
    will-change: transform;
}

.btc-hero__comments:hover .btc-hero__comments-track,
.wc-hero__comments:hover .wc-hero__comments-track {
    animation-play-state: paused;
}

.btc-hero__comment,
.wc-hero__comment {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    color: var(--pm-text-secondary);
    font-size: 12.5px;
    line-height: 1.4;
}

.btc-hero__comment-avatar,
.wc-hero__comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(24, 201, 116, .72), rgba(232, 179, 65, .58) 52%, rgba(228, 79, 85, .7));
    object-fit: cover;
}

.btc-hero__comment-name {
    display: block;
    overflow: hidden;
    color: var(--pm-text-secondary);
    font-weight: var(--pm-weight-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btc-hero__comment strong,
.btc-hero__comment-name {
    color: var(--pm-text-secondary);
    font-size: 12.5px;
    font-weight: var(--pm-weight-semibold);
}

.btc-hero__comment p {
    display: -webkit-box;
    margin: 2px 0 0;
    overflow: hidden;
    color: var(--pm-text-muted);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.btc-hero__comment--loading {
    pointer-events: none;
}

.btc-hero__comment--loading .btc-hero__comment-avatar,
.btc-hero__comment-skeleton-line {
    position: relative;
    overflow: hidden;
    background: var(--pm-surface-raised);
}

.btc-hero__comment--loading .btc-hero__comment-avatar::after,
.btc-hero__comment-skeleton-line::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .055), transparent);
    content: "";
    transform: translateX(-100%);
    animation: homeSkeleton 1.4s ease-in-out infinite;
}

.btc-hero__comment-skeleton-line {
    width: 78%;
    height: 8px;
    margin-top: 3px;
    border-radius: var(--pm-radius-pill);
}

.btc-hero__comment-skeleton-line + .btc-hero__comment-skeleton-line {
    width: 58%;
    margin-top: 7px;
}

.btc-hero__comment--empty {
    display: flex;
    min-height: 84px;
    align-items: center;
    color: var(--pm-text-muted);
}

.btc-hero__chart-wrap,
.wc-hero__chart-wrap {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    isolation: isolate;
}

.btc-hero__chart,
.wc-hero__chart {
    display: block;
    width: 100%;
    height: 100%;
}

.btc-hero__target {
    position: absolute;
    z-index: 3;
    left: 0;
    right: 62px;
    display: none;
    border-top: 1px dashed color-mix(in srgb, var(--btc-chart-color, var(--pm-green)) 62%, transparent);
    pointer-events: none;
}

.btc-hero__target span {
    position: absolute;
    right: 6px;
    top: 0;
    padding: 4px 8px;
    border-radius: var(--pm-radius-xs);
    background: color-mix(in srgb, var(--btc-chart-color, var(--pm-green)) 18%, var(--pm-surface));
    color: var(--pm-text-secondary);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1;
    transform: translateY(-50%);
}

.btc-hero__watermark {
    position: absolute;
    inset: 50% auto auto 50%;
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: var(--pm-text-disabled);
    font-size: 21px;
    font-weight: var(--pm-weight-semibold);
    letter-spacing: 0;
    opacity: .09;
    pointer-events: none;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.btc-hero__watermark-logo {
    position: relative;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
}

.btc-hero__watermark-logo svg,
.btc-hero__watermark-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.btc-hero__watermark-logo svg {
    color: currentColor;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.btc-hero__watermark-logo svg.is-covered {
    visibility: hidden;
}

.btc-hero__watermark-logo img {
    position: absolute;
    inset: 0;
}

.btc-hero__tooltip {
    position: absolute;
    z-index: 5;
    min-width: 82px;
    padding: 7px 9px;
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius-sm);
    background: var(--pm-popover-bg);
    box-shadow: var(--pm-shadow-popover);
    color: var(--pm-text);
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translate(8px, -50%);
    transition: opacity var(--pm-duration-fast) ease;
}

.btc-hero__tooltip.is-visible {
    opacity: 1;
}

.btc-hero__trades,
.wc-hero__trade-feed {
    position: absolute;
    z-index: 4;
    inset: auto auto 22px 10px;
    max-height: 70%;
    overflow: hidden;
    pointer-events: none;
}

.btc-hero__trades-track,
.wc-hero__trade-feed {
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
}

.btc-hero__trade {
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    font-variant-numeric: tabular-nums;
    opacity: .72;
}

.btc-hero__trade--up { color: var(--pm-green); }
.btc-hero__trade--down { color: var(--pm-red); }

.btc-hero__trade.is-new,
.wc-hero__trade-feed .is-new,
.amg-mobile-btc__ticks .is-new {
    animation: homeTradeIn 420ms var(--pm-ease-emphasized) both;
}

.btc-hero__bottom,
.wc-hero__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
}

.btc-hero__carousel {
    display: none;
}

/* Breaking news */

.btc-hero__breaking {
    min-width: 0;
    height: var(--home-hero-height);
    padding: 20px;
    overflow: hidden;
}

.btc-hero__breaking-title {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--pm-text);
    font-size: 18px;
    font-weight: var(--pm-weight-semibold);
    text-decoration: none;
}

.btc-hero__breaking-title svg {
    width: 15px;
    height: 15px;
    color: var(--pm-green);
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.btc-hero__breaking-list {
    display: flex;
    margin-top: 14px;
    flex-direction: column;
}

.btc-hero__breaking-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 50px;
    padding: 7px 0;
    border-bottom: 1px solid var(--pm-line-soft);
    align-items: start;
    color: var(--pm-text-secondary);
    font-size: 12.5px;
    font-weight: var(--pm-weight-medium);
    line-height: 1.38;
    text-decoration: none;
    transition: color var(--pm-duration-fast) ease, transform var(--pm-duration-fast) ease;
}

@media (hover: hover) {
    .btc-hero__breaking-item:hover {
        color: var(--pm-text);
        transform: translateX(2px);
    }
}

.btc-hero__breaking-item > div:first-child {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.btc-hero__breaking-item:last-child {
    border-bottom: 0;
}

.btc-hero__breaking-num {
    display: inline-block;
    width: 18px;
    color: var(--pm-text-muted);
    font-variant-numeric: tabular-nums;
}

.btc-hero__breaking-pct {
    color: var(--pm-text);
    font-size: 13px;
    font-weight: var(--pm-weight-semibold);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.btc-hero__breaking-sub {
    margin-top: 1px;
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
}

.btc-hero__breaking-loading,
.btc-hero__breaking-empty {
    padding: 22px 0;
    color: var(--pm-text-muted);
    font-size: 13px;
}

.btc-hero__up { color: var(--pm-green); }
.btc-hero__down { color: var(--pm-red); }

/* World Cup slide */

.btc-hero__spotlight {
    margin-top: 16px;
}

.btc-hero__slide--featured {
    position: absolute;
    inset: 0;
    z-index: 8;
    margin: 0;
}

.btc-hero__slide--featured .wc-hero {
    height: 100%;
    border: 0;
    border-radius: inherit;
}

.wc-hero {
    display: flex;
    min-height: var(--home-hero-height);
    padding: 18px 20px 14px;
    flex-direction: column;
}

.wc-hero__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.wc-hero__title {
    display: block;
    overflow: hidden;
    color: var(--pm-text);
    font-size: 22px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1.2;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-hero__actions {
    display: flex;
    gap: 4px;
}

.wc-hero__icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--pm-radius-sm);
}

.wc-hero__icon-btn svg {
    width: 16px;
    height: 16px;
}

.wc-hero__body {
    display: grid;
    grid-template-columns: minmax(185px, .36fr) minmax(0, 1fr);
    gap: 22px;
    min-height: 0;
    margin-top: 14px;
    flex: 1;
}

.wc-hero__left {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
}

.wc-hero__outcomes {
    display: flex;
    flex-direction: column;
}

.wc-hero__outcome {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 38px;
    border-bottom: 1px solid var(--pm-line-soft);
    align-items: center;
    color: var(--pm-text-secondary);
    font-size: 12px;
    text-decoration: none;
}

@media (hover: hover) {
    .wc-hero__outcome:hover {
        color: var(--pm-text);
        background: color-mix(in srgb, var(--wc-color, var(--pm-green)) 7%, transparent);
    }
}

.wc-hero__outcome strong {
    color: var(--pm-text);
    font-size: 15px;
    font-weight: var(--pm-weight-semibold);
    font-variant-numeric: tabular-nums;
}

.wc-hero__flag,
.wc-hero__flag-fallback {
    width: 26px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.wc-hero__flag-fallback {
    width: 9px;
    height: 9px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--wc-color, var(--pm-green));
}

.amg-card--pinned {
    box-shadow: inset 0 2px 0 color-mix(in srgb, var(--pm-green) 58%, transparent);
}

.wc-hero__comments {
    min-height: 0;
    margin-top: 12px;
    overflow: hidden;
    flex: 1;
    mask-image: linear-gradient(to bottom, #000 0, #000 82%, transparent 100%);
}

.wc-hero__chart-side {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
}

.wc-hero__legend {
    display: flex;
    min-height: 24px;
    gap: 12px;
    color: var(--pm-text-secondary);
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
}

.wc-hero__chart-wrap {
    flex: 1;
}

/* Market discovery */

.amg-section {
    position: relative;
    margin-top: 30px;
    margin-bottom: 72px;
}

.amg-head {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.amg-title {
    margin: 0;
    color: var(--pm-text);
    font-size: 24px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1.2;
}

.amg-actions {
    display: flex;
    gap: 6px;
}

.amg-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.amg-icon-btn svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.amg-icon-btn--strong,
.amg-icon-btn.is-active {
    background: var(--pm-control-bg);
    color: var(--pm-text);
}

.amg-search-wrap {
    position: absolute;
    z-index: 12;
    top: 0;
    right: 126px;
    width: min(310px, calc(100% - 150px));
    transform-origin: right center;
}

.amg-search-wrap.is-open {
    animation: homeSearchOpen 220ms var(--pm-ease-emphasized) both;
}

.amg-search-box {
    position: relative;
    display: flex;
    height: 40px;
    border: 1px solid var(--pm-line);
    border-radius: 10px;
    background: var(--pm-control-bg);
    align-items: center;
    transition: border-color var(--pm-duration-fast) ease,
                background-color var(--pm-duration-fast) ease;
}

.amg-search-box:focus-within {
    border-color: var(--pm-green-border);
    background: var(--pm-surface-raised);
}

.amg-search-icon {
    width: 17px;
    height: 17px;
    margin-left: 12px;
    color: var(--pm-text-muted);
    fill: currentColor;
}

.amg-search-input {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0 38px 0 9px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--pm-text);
    font-size: 12px;
}

.amg-search-input::-webkit-search-cancel-button {
    display: none;
}

.amg-search-input::placeholder {
    color: var(--pm-text-muted);
}

.amg-search-clear {
    position: absolute;
    right: 6px;
    display: none;
    width: 28px;
    height: 28px;
    padding: 6px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--pm-text-muted);
    cursor: pointer;
}

.amg-search-wrap.has-value .amg-search-clear {
    display: block;
}

.amg-tabs-row {
    margin-top: 12px;
    overflow: hidden;
}

.amg-tabs {
    display: flex;
    gap: 3px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.amg-tabs::-webkit-scrollbar {
    display: none;
}

.amg-tab {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--pm-text-muted);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--pm-duration-fast) ease,
                background-color var(--pm-duration-fast) ease;
}

.amg-tab.is-active {
    background: var(--pm-green);
    color: var(--pm-text-on-brand);
}

@media (hover: hover) {
    .amg-tab:not(.is-active):hover {
        background: var(--pm-surface-hover);
        color: var(--pm-text-secondary);
    }
}

.amg-filters {
    display: flex;
    min-height: 42px;
    margin-top: 10px;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.amg-filters[hidden] {
    display: none;
}

.amg-filters.is-open {
    animation: homePanelOpen 220ms var(--pm-ease-emphasized) both;
}

.amg-sort-wrap,
.amg-filter-select {
    position: relative;
}

.amg-sort-trigger,
.amg-filter-pill {
    display: inline-flex;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid var(--pm-line);
    border-radius: 10px;
    background: var(--pm-control-bg);
    color: var(--pm-text-secondary);
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    cursor: pointer;
    transition: border-color var(--pm-duration-fast) ease,
                background-color var(--pm-duration-fast) ease,
                color var(--pm-duration-fast) ease;
}

.amg-sort-trigger {
    min-width: 136px;
}

.amg-sort-trigger-icon {
    width: 15px;
    height: 15px;
}

.amg-sort-chevron {
    width: 14px;
    height: 14px;
    margin-left: auto;
    fill: currentColor;
    transition: transform var(--pm-duration-normal) var(--pm-ease-standard);
}

.amg-sort-wrap.is-open .amg-sort-chevron {
    transform: rotate(180deg);
}

.amg-filter-pill--active,
.amg-sort-wrap.is-open .amg-sort-trigger,
.amg-filter-select.is-open .amg-filter-pill {
    border-color: var(--pm-green-border);
    background: var(--pm-green-soft);
    color: var(--pm-green);
}

.amg-sort-menu,
.amg-filter-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    min-width: 190px;
    padding: 6px;
    border: 1px solid var(--pm-line);
    border-radius: var(--pm-radius-md);
    background: var(--pm-popover-bg);
    box-shadow: var(--pm-shadow-popover);
    transform-origin: top left;
    animation: homeMenuOpen 180ms var(--pm-ease-emphasized) both;
}

.amg-filter-menu {
    min-width: 142px;
}

.amg-sort-menu.is-closing,
.amg-filter-menu.is-closing {
    animation: homeMenuClose 120ms ease both;
}

.amg-sort-option,
.amg-filter-option {
    display: flex;
    width: 100%;
    min-height: 36px;
    padding: 0 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--pm-text-secondary);
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
    text-align: left;
    cursor: pointer;
}

.amg-sort-option.is-active,
.amg-filter-option.is-active {
    background: var(--pm-green-soft);
    color: var(--pm-green);
}

@media (hover: hover) {
    .amg-sort-option:not(.is-active):hover,
    .amg-filter-option:not(.is-active):hover {
        background: var(--pm-surface-hover);
        color: var(--pm-text);
    }
}

.amg-sort-option-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: currentColor;
}

.amg-sort-option-icon--live {
    width: 9px;
    height: 9px;
    margin-inline: 3px 4px;
    border-radius: 50%;
    background: var(--pm-red);
    box-shadow: 0 0 0 4px var(--pm-red-soft);
}

.amg-sort-option-dot {
    width: 6px;
    height: 6px;
    margin-left: auto;
    border-radius: 50%;
    background: var(--pm-green);
}

.amg-hide-toggle {
    display: inline-flex;
    min-height: 32px;
    color: var(--pm-text-muted);
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
    cursor: pointer;
}

.amg-hide-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.amg-hide-toggle-track {
    position: relative;
    width: 28px;
    height: 16px;
    border-radius: var(--pm-radius-pill);
    background: var(--pm-control-bg);
    box-shadow: inset 0 0 0 1px var(--pm-line);
    transition: background-color var(--pm-duration-normal) ease;
}

.amg-hide-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--pm-text-muted);
    transition: transform var(--pm-duration-normal) var(--pm-ease-standard),
                background-color var(--pm-duration-normal) ease;
}

.amg-hide-toggle input:checked + .amg-hide-toggle-track {
    background: var(--pm-green-soft-hover);
}

.amg-hide-toggle input:checked + .amg-hide-toggle-track .amg-hide-toggle-thumb {
    background: var(--pm-green);
    transform: translateX(12px);
}

/* Market cards */

.amg-results {
    position: relative;
    min-height: var(--home-card-height);
    margin-top: 12px;
    transition: min-height var(--pm-duration-normal) ease;
}

.amg-grid,
.amg-grid-skeleton {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--home-card-gap);
}

.amg-grid-skeleton[hidden] {
    display: none;
}

.amg-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: var(--home-card-height);
    padding: 13px 14px 11px;
    border: 1px solid var(--pm-line-soft);
    border-radius: var(--home-card-radius);
    background: var(--pm-surface);
    box-shadow: var(--pm-shadow-card);
    color: var(--pm-text);
    flex-direction: column;
    overflow: hidden;
    text-decoration: none;
    transform: translateZ(0);
    transition: transform var(--pm-duration-normal) var(--pm-ease-standard),
                border-color var(--pm-duration-normal) ease,
                background-color var(--pm-duration-normal) ease,
                box-shadow var(--pm-duration-normal) ease;
}

.amg-card--live {
    border-color: rgba(228, 79, 85, .16);
}

@media (hover: hover) {
    .amg-card:hover {
        border-color: var(--pm-line-strong);
        background: var(--pm-surface-raised);
        box-shadow: 0 8px 24px rgba(9, 15, 12, .055);
        transform: translateY(-2px);
    }
}

html.is-dark .amg-card,
body.is-dark .amg-card {
    background: #1a1f23;
}

@media (hover: hover) {
    html.is-dark .amg-card:hover,
    body.is-dark .amg-card:hover {
        background: #1d2327;
        box-shadow: 0 10px 26px rgba(0, 0, 0, .14);
    }
}

.amg-card.is-entering {
    animation: homeCardEnter 430ms var(--pm-ease-emphasized) both;
    animation-delay: var(--amg-enter-delay, 0ms);
}

.amg-card__head {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 9px;
    min-height: 36px;
    align-items: start;
}

.amg-card__head--no-icon {
    grid-template-columns: minmax(0, 1fr) auto;
}

.amg-card__icon,
.amg-team-flag {
    display: block;
    object-fit: cover;
    overflow: hidden;
}

.amg-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: contain;
}

.amg-card__icon--btc {
    object-fit: contain;
}

.amg-card__head-text {
    min-width: 0;
}

.amg-card__title {
    display: -webkit-box;
    margin: 1px 0 0;
    overflow: hidden;
    color: var(--pm-text);
    font-size: 13px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.amg-card__title--clamp1 {
    -webkit-line-clamp: 1;
}

.amg-card__live,
.amg-card__game,
.amg-card__recurring {
    margin-top: 4px;
}

.amg-card__game,
.amg-foot-game {
    color: var(--pm-red);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    text-transform: uppercase;
}

.amg-card__recurring {
    display: inline-flex;
    color: var(--pm-text-muted);
}

.amg-card__recurring svg {
    width: 13px;
    height: 13px;
}

.amg-card__body {
    display: flex;
    min-height: 0;
    margin-top: 8px;
    flex: 1;
    flex-direction: column;
    justify-content: center;
}

.amg-team-rows,
.amg-mini-list {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

.amg-team-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 34px;
    align-items: center;
}

.amg-team-row + .amg-team-row,
.amg-mini-row + .amg-mini-row {
    margin-top: 2px;
}

.amg-team-flag {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: contain;
}

.amg-team-name,
.amg-mini-label {
    overflow: hidden;
    color: var(--pm-text-secondary);
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amg-team-pct,
.amg-mini-pct {
    color: var(--pm-text);
    font-size: 14px;
    font-weight: var(--pm-weight-semibold);
    font-variant-numeric: tabular-nums;
}

.amg-mini-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 7px;
    min-height: 34px;
    align-items: center;
}

.amg-mini-main {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

.amg-mini-actions {
    display: flex;
    gap: 5px;
}

.amg-mini-btn {
    display: inline-flex;
    min-width: 38px;
    height: 30px;
    padding: 0 9px;
    border-radius: 7px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--pm-duration-fast) ease,
                transform var(--pm-duration-fast) ease;
}

.amg-mini-btn--yes {
    background: var(--home-positive-bg);
    color: var(--pm-green);
}

.amg-mini-btn--no {
    background: var(--home-negative-bg);
    color: var(--pm-red);
}

@media (hover: hover) {
    .amg-mini-btn--yes:hover { background: var(--home-positive-bg-hover); }
    .amg-mini-btn--no:hover { background: var(--home-negative-bg-hover); }
}

.amg-btns-row {
    display: grid;
    grid-template-columns: repeat(var(--home-action-count, 3), minmax(0, 1fr));
    gap: 7px;
    margin-top: auto;
    padding-top: 9px;
}

.amg-btns-row > :only-child {
    grid-column: 1 / -1;
}

.amg-btns-row--binary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.amg-btn {
    display: flex;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--pm-text-secondary);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: filter var(--pm-duration-fast) ease,
                background-color var(--pm-duration-fast) ease,
                transform var(--pm-duration-fast) ease;
}

.amg-btn--side-a,
.amg-btn--yes {
    background: var(--home-positive-bg);
    color: var(--pm-green);
}

.amg-btn--side-b,
.amg-btn--no {
    background: var(--home-negative-bg);
    color: var(--pm-red);
}

.amg-btn--mid {
    background: var(--pm-control-bg);
    color: var(--pm-text-secondary);
}

@media (hover: hover) {
    .amg-btn:hover {
        filter: saturate(1.08) brightness(1.04);
    }
}

.amg-ring,
.amg-mobile-btc__ring {
    position: relative;
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
}

.amg-ring svg,
.amg-mobile-btc__ring svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.amg-ring circle,
.amg-mobile-btc__ring circle {
    fill: none;
    stroke-width: 3.2;
}

.amg-ring__track,
.amg-mobile-btc__ring-track {
    stroke: var(--pm-control-bg);
}

.amg-ring__fill,
.amg-mobile-btc__ring-fill {
    stroke: var(--pm-green);
    stroke-linecap: round;
    transition: stroke-dasharray 420ms var(--pm-ease-standard);
}

.amg-ring__pct {
    position: relative;
    z-index: 1;
    display: flex;
    line-height: 1;
    flex-direction: column;
    align-items: center;
}

.amg-ring__pct strong {
    color: var(--pm-text);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
}

.amg-ring__pct span {
    margin-top: 2px;
    color: var(--pm-text-muted);
    font-size: 10px;
    font-weight: var(--pm-weight-medium);
}

.amg-card__foot,
.amg-mobile-btc__foot {
    display: flex;
    min-height: 20px;
    margin-top: 8px;
    color: var(--pm-text-muted);
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    font-weight: var(--pm-weight-medium);
}

.amg-card__foot-left {
    display: flex;
    min-width: 0;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amg-foot-dot {
    margin-inline: 4px;
    color: var(--pm-text-disabled);
}

.amg-card__foot-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.amg-card__foot-actions svg,
.amg-mobile-btc__foot svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.amg-foot-game {
    margin-right: 1px;
}

/* Mobile BTC card */

.amg-card--mobile-btc {
    display: none;
}

.amg-mobile-btc__top {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 44px;
    gap: 9px;
    align-items: start;
}

.amg-mobile-btc__icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    object-fit: contain;
}

.amg-mobile-btc__top h3 {
    margin: 3px 0 0;
    overflow: hidden;
    color: var(--pm-text);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.amg-mobile-btc__ring {
    width: 44px;
    height: 44px;
}

.amg-mobile-btc__ring strong,
.amg-mobile-btc__ring span {
    position: relative;
    z-index: 1;
    line-height: 1;
}

.amg-mobile-btc__ring strong {
    margin-top: -6px;
    color: var(--pm-text);
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
}

.amg-mobile-btc__ring span {
    position: absolute;
    bottom: 8px;
    color: var(--pm-text-muted);
    font-size: 10px;
}

.amg-mobile-btc__body {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
    margin-top: 7px;
    align-items: center;
}

.amg-mobile-btc__ticks {
    display: flex;
    min-width: 0;
    gap: 1px;
    flex-direction: column;
    font-size: 12px;
    font-weight: var(--pm-weight-semibold);
    line-height: 1.15;
}

.amg-mobile-btc__ticks--up { color: var(--pm-green); }
.amg-mobile-btc__ticks--down { color: var(--pm-red); text-align: right; }
.amg-mobile-btc__ticks.is-loading { opacity: .58; }

.amg-mobile-btc__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.amg-mobile-btc__foot b {
    color: var(--pm-text-disabled);
    font-weight: inherit;
}

/* Loading and empty states */

.amg-grid-skeleton {
    position: absolute;
    z-index: 4;
    inset: 0;
    align-content: start;
    pointer-events: none;
}

.amg-section.has-existing-results .amg-grid-skeleton {
    background: linear-gradient(to bottom, color-mix(in srgb, var(--pm-page-bg) 40%, transparent), transparent 300px);
}

.amg-section.has-existing-results .amg-skeleton-card {
    opacity: .48;
}

.amg-section.is-refreshing .amg-grid {
    opacity: .34;
    transition: opacity var(--pm-duration-normal) ease;
}

.amg-skeleton-card {
    position: relative;
    min-height: var(--home-card-height);
    border-radius: var(--home-card-radius);
    background: var(--pm-surface-subtle);
    overflow: hidden;
}

.amg-skeleton-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 22%, rgba(255, 255, 255, .20) 42%, transparent 62%);
    transform: translateX(-100%);
    animation: homeSkeleton 1.25s ease-in-out infinite;
}

html.is-dark .amg-skeleton-card::after,
body.is-dark .amg-skeleton-card::after {
    background: linear-gradient(105deg, transparent 22%, rgba(255, 255, 255, .035) 42%, transparent 62%);
}

.amg-loader,
.amg-empty,
.amg-error {
    padding: 28px 16px;
    color: var(--pm-text-muted);
    font-size: 12px;
    text-align: center;
}

.amg-loader {
    opacity: 0;
    transition: opacity var(--pm-duration-normal) ease;
}

.amg-loader.is-visible {
    opacity: 1;
}

.amg-error {
    color: var(--pm-red);
}

.amg-sentinel {
    height: 1px;
}

.amg-team-pct.is-live-tick,
.amg-mini-pct.is-live-tick,
.amg-ring.is-live-tick {
    animation: homeLiveTick 520ms var(--pm-ease-emphasized);
}

.is-live-up { color: var(--pm-green); }
.is-live-down { color: var(--pm-red); }

@keyframes homeCardEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes homeLiveTick {
    0%, 100% { transform: scale(1); }
    46% { transform: scale(1.07); }
}

@keyframes homeTradeIn {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: .82; transform: translateY(0); }
}

@keyframes homeCommentsScroll {
    to { transform: translateY(var(--home-comment-offset, -50%)); }
}

@keyframes homeSkeleton {
    to { transform: translateX(100%); }
}

@keyframes homeSearchOpen {
    from { opacity: 0; transform: scaleX(.84); }
    to { opacity: 1; transform: scaleX(1); }
}

@keyframes homePanelOpen {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes homeMenuOpen {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes homeMenuClose {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-3px) scale(.985); }
}

/* Responsive */

@media (max-width: 1180px) {
    :root {
        --home-hero-height: 470px;
    }

    .btc-hero__grid {
        grid-template-columns: minmax(0, 1fr) 310px;
    }

    .btc-hero__meta {
        gap: 14px;
    }

    .btc-hero__meta-item {
        min-width: 74px;
    }

    .btc-hero__body {
        grid-template-columns: minmax(250px, 32%) minmax(0, 1fr);
        gap: 20px;
    }
}

@media (max-width: 1040px) {
    .btc-hero__grid {
        grid-template-columns: minmax(0, 1fr) 270px;
        gap: 12px;
    }

    .btc-hero__card {
        padding-inline: 16px;
    }

    .btc-hero__meta-item:nth-child(1) {
        display: none;
    }

    .btc-hero__breaking {
        padding: 16px;
    }

    .btc-hero__body {
        grid-template-columns: minmax(230px, 32%) minmax(0, 1fr);
        gap: 18px;
    }

    .btc-hero__breaking-item {
        min-height: 44px;
        font-size: 12px;
    }

    .amg-grid,
    .amg-grid-skeleton {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    :root {
        --pm-shell-gutter: 18px;
    }

    .btc-hero__grid {
        grid-template-columns: 1fr;
    }

    .btc-hero__breaking {
        display: none;
    }

    .btc-hero__meta-item:nth-child(1) {
        display: block;
    }

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

@media (max-width: 720px) {
    :root {
        --pm-shell-gutter: 14px;
        --home-card-height: 176px;
        --home-card-gap: 10px;
    }

    .btc-hero {
        display: none;
    }

    .amg-section {
        margin-top: 14px;
        margin-bottom: 54px;
    }

    .amg-title {
        font-size: 22px;
    }

    .amg-head {
        min-height: 38px;
    }

    .amg-icon-btn {
        width: 36px;
        height: 36px;
    }

    .amg-search-wrap {
        top: 44px;
        right: 0;
        width: 100%;
    }

    .amg-search-wrap.is-open + .amg-tabs-row {
        margin-top: 56px;
    }

    .amg-tabs-row {
        margin-top: 10px;
        margin-inline: calc(var(--pm-shell-gutter) * -1);
        padding-inline: var(--pm-shell-gutter);
        transition: margin-top var(--pm-duration-normal) var(--pm-ease-standard);
    }

    .amg-tab {
        min-height: 34px;
        padding-inline: 13px;
        font-size: 12px;
    }

    .amg-filters {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 10px;
        border-radius: var(--pm-radius-md);
        background: var(--pm-surface-subtle);
    }

    .amg-sort-trigger,
    .amg-filter-pill {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .amg-hide-toggle {
        min-height: 30px;
    }

    .amg-results {
        margin-top: 10px;
    }

    .amg-grid,
    .amg-grid-skeleton {
        grid-template-columns: 1fr;
    }

    .amg-card {
        padding: 13px 14px 11px;
    }

    .amg-card--mobile-btc {
        display: flex;
    }

    .amg-card__title {
        font-size: 13px;
    }

    .amg-team-name,
    .amg-mini-label {
        font-size: 12px;
    }

    .amg-team-pct,
    .amg-mini-pct {
        font-size: 14px;
    }

    .amg-card__foot {
        font-size: 12px;
    }
}

@media (max-width: 460px) {
    .amg-filters {
        grid-template-columns: 1fr 1fr;
    }

    .amg-sort-wrap {
        grid-column: 1 / -1;
    }

    .amg-sort-menu,
    .amg-filter-menu {
        max-width: calc(100vw - (var(--pm-shell-gutter) * 2));
    }

    .amg-mini-row {
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 6px;
    }

    .amg-mini-btn {
        min-width: 36px;
        padding-inline: 8px;
    }

    .amg-mobile-btc__body {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btc-hero__comments-track,
    .wc-hero__comments-track {
        animation: none;
        transform: none;
    }

    .amg-card,
    .amg-card.is-entering,
    .amg-grid-skeleton,
    .btc-hero__trade,
    .amg-mobile-btc__ticks .is-new {
        animation: none;
        transition: none;
    }
}
