@charset "UTF-8";

#wrapper {
    background-color: var(--bg-sub1-color);
}

@media (min-width: 1400px) {

    .container-xl,
    .container-lg,
    .container-md,
    .container-sm,
    .container {
        max-width: 1140px;
    }
}

/* 親要素：ゲージの土台 */
.gauge-wrapper {
    position: relative;
    width: 100%;
    height: 15px;
    background-color: #eee;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);

    /* --- 設定エリア --- */
    --percent: 88.4%;
    /* JSやサーバーサイドでここを計算して出力 */
}

/* 動くゲージ部分 */
.gauge-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--percent);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s;

    /* 色の条件分岐ロジック (CSSのみで判定) */
    /* 緑: > 50%, 黄: 21-50%, 赤: <= 20% */
    background-color: #4caf50;
    /* デフォルトは緑 */
}

/* 割合に応じて色を上書きする例（手動またはJSでクラス付与） */
/* ※より高度なCSS関数(color-mix等)を使わない場合、以下のクラスで制御するのが確実です */
.gauge-wrapper.warning .gauge-bar {
    background-color: #ffc107;
}

/* 黄 */
.gauge-wrapper.danger .gauge-bar {
    background-color: #f44336;
}

/* 赤 */

/* テキスト部分 */
.gauge-text {
    position: relative;
    z-index: 2;
    font-size: 0.9rem;
    color: #333;
    font-weight: bold;
    /* ゲージが重なっても見やすくする処理 */
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

#current-val {
    font-size: 1.1rem;
}

/* 抽選一覧スタイル
------------------------------------------*/
.item-card {
    background-color: var(--bg-color);
    border-radius: var(--radius);
}

.item-card:not(.collection) {
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
}

.card-footer .oripa-card-stock,
.card-footer .oripa-card-price {
    display: inline-block;
    font-weight: bold;
    width: 50%;
}

.card-footer .price-value {
    font-size: var(--fs-md);
}

.card-footer .price-value i {
    color: rgb(211, 172, 0);
}

/* 抽選詳細スタイル
------------------------------------------*/
.item-detail-wrap {
    background: white;
    padding: var(--md);
}

.footer-sticky {
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    padding: var(--sm) 0;
}

ul.purchase_lottery_button_wrap {
    display: flex;
    flex-wrap: wrap;
    gap:var(--xs) 0;
}

ul.purchase_lottery_button_wrap li {
    padding: 0 5px;
}

/* 1〜3番目: 33% */
ul.purchase_lottery_button_wrap>li:nth-child(-n+3) {
    width: 33.3333%;
}

/* 4番目以降: 50% */
ul.purchase_lottery_button_wrap>li:nth-child(n+4) {
    width: 50%;
}

@media (max-width: 568px) {
    .item-detail-wrap {
        padding: var(--sm);
    }

    .collection .item-card-img,
    .nft-card-front .item-card-img {
        padding-bottom: 100%;
    }

    .item-card .item-main {
        padding: var(--sm) var(--xs);
    }

    .item-card.collection .item-main {
        padding: var(--sm) 0;
    }

    .item-card .item-title {
        font-size: var(--sm);
    }

    /* 1〜2番目: 50% */
    ul.purchase_lottery_button_wrap>li:nth-child(-n+2) {
        width: 50%;
    }

    /* 3番目以降: 100% */
    ul.purchase_lottery_button_wrap>li:nth-child(n+3),
    ul.purchase_lottery_button_wrap>li:nth-child(n+4) {
        width: 100%;
    }
}