/*
 * トレカRWA特集（/tcg）用スタイル
 *
 * public/css/app.css の後に、このページだけで読み込む。色・余白・角丸は
 * resources/assets/sass/renewal/_settings.scss の値に合わせてある。
 * 見出し（.c-top-heading）と記事の行（.c-top-row）は app.css のものを使う。
 * html の font-size が 62.5% なので 1rem = 10px。
 */

:root {
    --tcg-dark: #141C39;
    --tcg-primary: #3EBAFF;
    --tcg-green: #00C09E;
    --tcg-red: #F83A68;
    --tcg-yellow: #F9BC1F;
    --tcg-purple: #8458FF;
    --tcg-text: #fff;
    --tcg-text-medium: rgba(255, 255, 255, 0.6);
    --tcg-bg-05: rgba(255, 255, 255, 0.05);
    --tcg-bg-10: rgba(255, 255, 255, 0.1);
    --tcg-border: rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------------
   共通レイアウト
-------------------------------------------------------- */
.c-tcg-hero__container,
.c-tcg {
    width: 90%;
    max-width: 1300px;
    margin-right: auto;
    margin-left: auto;
}

.c-tcg {
    padding-bottom: 80px;
}

.c-tcg-section {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-top: 48px;
}

/* 見出しの左の線を、ランキングの種類ごとに色分けする */
.c-tcg-section--up .c-top-heading { border-left-color: var(--tcg-red); }
.c-tcg-section--down .c-top-heading { border-left-color: var(--tcg-primary); }
.c-tcg-section--volume .c-top-heading { border-left-color: var(--tcg-green); }
.c-tcg-section--popular .c-top-heading { border-left-color: var(--tcg-yellow); }

.c-tcg-note {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--tcg-text-medium);
    margin: 32px 0 0;
}

.c-tcg-empty {
    padding: 32px 16px;
    border-radius: 10px;
    background-color: var(--tcg-bg-05);
    font-size: 1.4rem;
    line-height: 1.7;
    text-align: center;
    color: var(--tcg-text-medium);
    margin: 0;
}

/* プラットフォーム名のラベル（色は style 属性の --tcg-platform-color で渡す） */
.c-tcg-platform {
    display: inline-block;
    max-width: 100%;
    padding: 2px 8px;
    border: 1px solid var(--tcg-platform-color, var(--tcg-primary));
    border-radius: 100px;
    background-color: color-mix(in srgb, var(--tcg-platform-color, var(--tcg-primary)) 18%, transparent);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--tcg-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* --------------------------------------------------------
   ページタイトル
-------------------------------------------------------- */
.c-tcg-hero {
    padding-top: 28px;
    padding-bottom: 32px;
    background:
        radial-gradient(600px 260px at 12% 0%, rgba(62, 186, 255, 0.16), transparent 70%),
        radial-gradient(520px 240px at 88% 20%, rgba(132, 88, 255, 0.16), transparent 70%);
}

.c-tcg-hero__eyebrow {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--tcg-primary);
    margin: 0 0 12px;
}

.c-tcg-hero__title {
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.4;
    color: var(--tcg-text);
    margin: 0 0 16px;
}

.c-tcg-hero__lead {
    max-width: 800px;
    font-size: 1.5rem;
    line-height: 1.9;
    color: var(--tcg-text);
    margin: 0 0 20px;
}

.c-tcg-hero__platforms {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.c-tcg-hero__platforms-label,
.c-tcg-hero__platforms-note,
.c-tcg-hero__updated {
    font-size: 1.2rem;
    color: var(--tcg-text-medium);
}

.c-tcg-hero__platforms .c-tcg-platform {
    font-size: 1.2rem;
    padding: 3px 10px;
}

.c-tcg-hero__updated {
    margin: 12px 0 0;
}

/* --------------------------------------------------------
   ランキング（横に送って見るカードの列）
-------------------------------------------------------- */
.c-tcg-ranking {
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 4px 0 12px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.c-tcg-card {
    flex: none;
    width: 190px;
    scroll-snap-align: start;
}

.c-tcg-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--tcg-border);
    border-radius: 10px;
    background-color: var(--tcg-bg-05);
    color: var(--tcg-text);
    overflow: hidden;
    transition: background-color 0.2s, border-color 0.2s;
}

.c-tcg-card__link:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background-color: var(--tcg-bg-10);
    color: var(--tcg-text);
}

.c-tcg-card__image {
    position: relative;
    /* 鑑定ケースごと写った縦長の画像を、切らずに収める */
    aspect-ratio: 3 / 4;
    background-color: rgba(0, 0, 0, 0.25);
}

.c-tcg-card__image img {
    /* 画像の縦横比が違っても、枠の高さをそろえる */
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.c-tcg-card__rank {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: rgba(20, 28, 57, 0.85);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1;
    color: var(--tcg-text);
}

.c-tcg-card__rank--1 { background-color: #F9BC1F; color: var(--tcg-dark); }
.c-tcg-card__rank--2 { background-color: #C5CBD6; color: var(--tcg-dark); }
.c-tcg-card__rank--3 { background-color: #D08A55; color: var(--tcg-dark); }

.c-tcg-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    padding: 12px;
}

.c-tcg-card__title {
    display: -webkit-box;
    width: 100%;
    /* 2行ぶんの高さをそろえて、カードの下端を並べる */
    min-height: 3em;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--tcg-text);
    margin: 0;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.c-tcg-card__price {
    width: 100%;
    margin-top: auto;
}

.c-tcg-card__figures {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* --------------------------------------------------------
   広告枠
-------------------------------------------------------- */
.c-tcg-ad {
    padding-top: 32px;
}

.c-tcg-ad .c-top-banner {
    text-align: center;
}

/* 未入稿のときに出す、広告掲載の相談への案内 */
.c-tcg-ad__house {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 90px;
    padding: 16px 20px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background-color: var(--tcg-bg-05);
    color: var(--tcg-text-medium);
    transition: background-color 0.2s;
}

.c-tcg-ad__house:hover {
    background-color: var(--tcg-bg-10);
    color: var(--tcg-text-medium);
}

.c-tcg-ad__label {
    flex: none;
    padding: 2px 8px;
    border: 1px solid var(--tcg-text-medium);
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
}

.c-tcg-ad__text {
    font-size: 1.4rem;
    line-height: 1.7;
}

.c-tcg-ad__text strong {
    margin-left: 8px;
    font-weight: 700;
    color: var(--tcg-primary);
}

/* --------------------------------------------------------
   商品詳細：商品の情報
-------------------------------------------------------- */
.c-tcg--detail {
    display: flex;
    flex-direction: column;
    max-width: 1000px;
    padding-top: 24px;
}

.c-tcg-product {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

.c-tcg-product__image {
    position: relative;
    flex: none;
    width: 300px;
    aspect-ratio: 3 / 4;
    border: 1px solid var(--tcg-border);
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.c-tcg-product__image img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.c-tcg-product__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
}

.c-tcg-product__title {
    font-size: 2.4rem;
    font-weight: 900;
    line-height: 1.5;
    color: var(--tcg-text);
    margin: 0;
    overflow-wrap: anywhere;
}

.c-tcg-product__original {
    margin: -8px 0 0;
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--tcg-text-medium);
    overflow-wrap: anywhere;
}

.c-tcg-product__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.c-tcg-product__tags li {
    padding: 2px 10px;
    border-radius: 4px;
    background-color: var(--tcg-bg-10);
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--tcg-text);
}

.c-tcg-product__figures {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin: 0;
}

.c-tcg-product__figures > div {
    padding: 12px 16px;
    border-radius: 10px;
    background-color: var(--tcg-bg-05);
}

.c-tcg-product__figures dt {
    font-size: 1.2rem;
    line-height: 1.5;
    color: var(--tcg-text-medium);
}

.c-tcg-product__figures dd {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.5;
    color: var(--tcg-text);
    margin: 0;
}

.c-tcg-product__figures dd small {
    margin-left: 4px;
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--tcg-text-medium);
}

.c-tcg-product__figures .c-tcg-card__chip {
    display: inline-block;
    font-size: 1.6rem;
}

.c-tcg-product__btn {
    padding: 13px 32px;
    border-radius: 8px;
    background-color: var(--tcg-primary);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    color: var(--tcg-dark);
    transition: opacity 0.2s;
}

.c-tcg-product__btn:hover {
    opacity: 0.85;
    color: var(--tcg-dark);
}

/* 購入方法の案内（取引所への動線）。商品の情報のすぐ下に、目立つ帯で出す */
.c-tcg-guide {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 18px 24px;
    border-radius: 10px;
    background: linear-gradient(90deg, #F9BC1F 0%, #FFD867 100%);
    color: var(--tcg-dark);
    transition: opacity 0.2s;
}

.c-tcg-guide:hover {
    opacity: 0.88;
    color: var(--tcg-dark);
}

.c-tcg-guide__label {
    flex: none;
    padding: 3px 10px;
    border-radius: 4px;
    background-color: var(--tcg-dark);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.5;
    color: #fff;
}

.c-tcg-guide__text {
    flex: 1;
    min-width: 0;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.c-tcg-guide__arrow {
    flex: none;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.c-tcg--detail > .c-top-more-btn {
    margin-top: 48px;
}

/* --------------------------------------------------------
   商品詳細：価格比較の表
-------------------------------------------------------- */
.c-tcg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.4rem;
    line-height: 1.7;
    color: var(--tcg-text);
}

.c-tcg-table th,
.c-tcg-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--tcg-border);
    text-align: left;
    vertical-align: middle;
}

.c-tcg-table thead th {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--tcg-text-medium);
    white-space: nowrap;
}

.c-tcg-table tr.is-self {
    background-color: var(--tcg-bg-05);
}

.c-tcg-table small {
    margin-left: 6px;
    font-size: 1.2rem;
    color: var(--tcg-text-medium);
}

.c-tcg-table__price {
    font-weight: 800;
    white-space: nowrap;
}

.c-tcg-table__action {
    white-space: nowrap;
    text-align: right;
}

.c-tcg-table a,
.c-tcg-rows a {
    color: var(--tcg-primary);
}

.c-tcg-table a:hover,
.c-tcg-rows a:hover {
    color: #94D9FF;
}

.c-tcg-table__action a {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--tcg-primary);
    border-radius: 6px;
    font-size: 1.3rem;
    font-weight: 700;
}

/* --------------------------------------------------------
   商品詳細：出品・成約の一覧
-------------------------------------------------------- */
.c-tcg-rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.c-tcg-rows li {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-bottom: 1px solid var(--tcg-border);
    font-size: 1.4rem;
    line-height: 1.6;
}

.c-tcg-rows__main {
    flex: none;
    min-width: 110px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--tcg-text);
}

.c-tcg-rows__sub {
    flex: 1;
    min-width: 0;
    color: var(--tcg-text-medium);
}

.c-tcg-card__label {
    font-size: 1rem;
    line-height: 1.4;
    color: var(--tcg-text-medium);
    margin: 0;
}

.c-tcg-card__value {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.4;
    color: var(--tcg-text);
    margin: 0;
    white-space: nowrap;
}

.c-tcg-card__chip {
    flex: none;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: var(--tcg-bg-10);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--tcg-text);
    margin: 0;
    white-space: nowrap;
}

.c-tcg-card__chip--up {
    background-color: rgba(248, 58, 104, 0.18);
    color: #FF7A9A;
}

.c-tcg-card__chip--down {
    background-color: rgba(62, 186, 255, 0.18);
    color: var(--tcg-primary);
}

/* --------------------------------------------------------
   スマホ
-------------------------------------------------------- */
@media screen and (max-width: 767px) {
    .c-tcg {
        padding-bottom: 56px;
    }

    .c-tcg-section {
        padding-top: 40px;
    }

    .c-tcg-hero {
        padding-top: 20px;
        padding-bottom: 24px;
    }

    .c-tcg-hero__title {
        font-size: 2.4rem;
    }

    .c-tcg-hero__lead {
        font-size: 1.4rem;
    }

    .c-tcg-ranking {
        gap: 12px;
        /* 画面の右端までカードを流す */
        margin-right: -5.5%;
        padding-right: 5.5%;
    }

    .c-tcg-card {
        width: 156px;
    }

    .c-tcg-ad {
        padding-top: 24px;
    }

    .c-tcg-ad__house {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .c-tcg-ad__text strong {
        display: block;
        margin-left: 0;
    }

    .c-tcg-product {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .c-tcg-product__image {
        width: 70%;
        margin: 0 auto;
    }

    .c-tcg-product__title {
        font-size: 1.8rem;
    }

    .c-tcg-product__figures dd {
        font-size: 1.6rem;
    }

    .c-tcg-product__btn {
        align-self: stretch;
    }

    .c-tcg-guide {
        flex-wrap: wrap;
        gap: 8px 12px;
        padding: 16px;
    }

    .c-tcg-guide__text {
        flex: 1 1 100%;
        order: 3;
        font-size: 1.4rem;
    }

    .c-tcg-guide__arrow {
        margin-left: auto;
    }

    /* 価格比較の表は、1プラットフォームごとのカードに組み替える */
    .c-tcg-table thead {
        display: none;
    }

    .c-tcg-table,
    .c-tcg-table tbody,
    .c-tcg-table tr,
    .c-tcg-table th,
    .c-tcg-table td {
        display: block;
    }

    .c-tcg-table tr {
        margin-bottom: 12px;
        padding: 16px;
        border: 1px solid var(--tcg-border);
        border-radius: 10px;
    }

    .c-tcg-table th,
    .c-tcg-table td {
        padding: 0;
        border-bottom: none;
    }

    .c-tcg-table td {
        margin-top: 10px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .c-tcg-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 1.1rem;
        font-weight: 400;
        color: var(--tcg-text-medium);
    }

    .c-tcg-table__action {
        text-align: left;
    }

    .c-tcg-table__action a {
        display: block;
        text-align: center;
    }

    .c-tcg-rows li {
        flex-wrap: wrap;
        gap: 4px 12px;
        padding: 12px 0;
    }
}

/* --------------------------------------------------------
   鑑定グレードのタグ（プラットフォーム名のタグの横に出す）
-------------------------------------------------------- */
.c-tcg-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.c-tcg-grade {
    flex: none;
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.5;
    color: var(--tcg-text);
    white-space: nowrap;
}

/* PSA は鑑定ケースのラベルに合わせた赤にして目立たせる */
.c-tcg-grade--psa {
    border-color: #E0263C;
    background-color: #E0263C;
    color: #fff;
}

/* --------------------------------------------------------
   「もっと見る」
-------------------------------------------------------- */
/* 見出しの右端に「もっと見る」を置き、補足は見出しの隣に寄せる */
.c-tcg-section .c-top-heading__note {
    margin-right: auto;
}

/* 横に送り切った先に置く、続きへの入口 */
.c-tcg-card--more .c-tcg-card__link {
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border-style: dashed;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.7;
    text-align: center;
    color: var(--tcg-primary);
}

/* 一覧ページ：カードを折り返して並べる */
.c-tcg--list {
    padding-top: 0;
}

.c-tcg-ranking--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    overflow-x: visible;
}

.c-tcg-ranking--grid .c-tcg-card {
    width: auto;
}

.c-tcg-pager {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}

.c-tcg-pager__link {
    padding: 12px 20px;
    border: 1px solid var(--tcg-primary);
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    color: var(--tcg-primary);
    justify-self: start;
}

.c-tcg-pager__link[rel="next"] {
    justify-self: end;
}

.c-tcg-pager__link:hover {
    background-color: var(--tcg-bg-10);
    color: var(--tcg-primary);
}

.c-tcg-pager__page {
    font-size: 1.3rem;
    color: var(--tcg-text-medium);
}

.c-tcg--list > .c-top-more-btn {
    display: block;
    width: fit-content;
    margin: 40px auto 0;
}

@media screen and (max-width: 767px) {
    .c-tcg-ranking--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        /* 一覧ページでは右端へ流さない */
        margin-right: 0;
        padding-right: 0;
    }

    .c-tcg-pager__link {
        padding: 10px 12px;
        font-size: 1.3rem;
    }
}
