/* touhou-sales-stats: テーマのグローバルCSSに依存しない最小レイアウト */
.tss__lead {
    margin: 0 0 1rem;
    font-size: 0.9375rem;
}

.tss__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tss__row {
    margin-bottom: 1rem;
}

/* 行全体. <a>（代表商品あり）と <div class="tss__link--static">（なし）で同じレイアウト */
.tss__link {
    display: grid;
    grid-template-columns: auto 84px minmax(0, 1fr) auto;
    gap: 0.875rem;
    align-items: center;
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid #e5e5e5;
    border-radius: 0.375rem;
    color: inherit;
    text-decoration: none;
}

a.tss__link:hover,
a.tss__link:focus-visible {
    background: #ffffff; /* 装飾. コントラスト判定の入力にはしない（表示spec §4.6） */
}

a.tss__link:hover .tss__name,
a.tss__link:focus-visible .tss__name {
    text-decoration: underline;
}

a.tss__link:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

.tss__thumb {
    display: block;
    width: 84px;
    height: 112px;
    border-radius: 0.375rem;
    overflow: hidden;
}

.tss__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* .tss__thumb--empty の背景色は style 属性（キャラクター色に白60%）で与える */

.tss__body {
    display: block;
    min-width: 0;
}

.tss__name {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 0.25rem;
}

.tss__share {
    font-size: 1.375rem;
    font-weight: 700;
    text-align: right;
}

.tss__share--muted {
    color: #727272;
}

.tss__bar {
    display: flex;
    min-height: 1.375rem;
    margin-top: 0.5rem;
}

.tss__seg {
    flex: 0 0 auto;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    /* display:flex を付けない — フレックスコンテナでは text-overflow が効かず XXL が X に切り詰められる（spec §7.3） */
    text-align: center;
    line-height: 1.375rem;
    font-size: 0.8125rem;
}

.tss__bar--empty {
    width: 0;
    min-width: 1px;
    border-left: 1px solid #727272;
}

.tss__hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #555555; /* #f9f9f9 上で 7.2:1、#ffffff 上で 7.5:1 */
}

.tss__legend {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0;
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
}

.tss__legend-swatch {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    box-sizing: border-box;
    border: 1px solid #111111;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.tss__note {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.tss .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .tss__link {
        grid-template-columns: auto 64px minmax(0, 1fr) auto;
        gap: 0.5rem;
    }

    .tss__thumb {
        width: 64px;
        height: 85px;
    }

    .tss__share {
        font-size: 1.125rem;
    }

    .tss__rank {
        font-size: 0.75rem;
    }

    .tss__name {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}
