/* ガチャ詳細画面専用スタイル */

/* レイアウトリセット */
.main-content .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.main-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* メインラッパー */
.gacha-detail-wrap {
    padding-bottom: 120px;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

/* カウントダウンバナー表示時のコンテンツ余白（争奪戦はヘッダー上にバナーがあるため） */
body.has-battle-countdown .gacha-header {
    margin-top: 130px;
}

body.has-battle-countdown .gacha-detail-wrap {
    margin-top: 140px;
}

/* ガチャページ：クーポンバナーをフッター内に配置 */
.gacha-fixed-footer .battle-countdown-banner {
    position: static !important;
    top: auto !important;
    bottom: auto !important;
    width: 100%;
    box-shadow: none;
}

/* ヘッダー */
.gacha-header {
    text-align: center;
    margin: 80px 8px 8px 8px;
}

.gacha-thumbnail {
    margin-bottom: 8px;
    padding: 8px;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    box-sizing: border-box;
}

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

/* 始まりのガチャ：虹色ボーダーアニメーション */
@property --rainbow-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

.gacha-thumbnail.starter-gacha {
    padding: 6px;
    border: none;
    border-radius: 16px;
    background: conic-gradient(from var(--rainbow-angle), #ffc8c8, #ffe6b0, #fffaaa, #b8f0b8, #b0d8ff, #d4b0ff, #ffb8e0, #ffc8c8);
    animation: rainbow-rotate 3s linear infinite;
}

.gacha-thumbnail.starter-gacha img {
    border-radius: 10px;
}

/* 新規登録ボタン虹色ボーダーアニメーション */
.gummy-btn-rainbow {
    border: 3px solid transparent !important;
    background:
        var(--_, radial-gradient(56.96% 56.96% at 50% 50%, #F2D01F 0%, #FFE973 100%)) padding-box,
        conic-gradient(from var(--rainbow-angle), #ffc8c8, #ffe6b0, #fffaaa, #b8f0b8, #b0d8ff, #d4b0ff, #ffb8e0, #ffc8c8) border-box !important;
    color: #6b5900 !important;
    animation: rainbow-rotate 3s linear infinite;
    width: 100%;
    height: 40px;
    font-size: 1.1rem;
}

@keyframes rainbow-rotate {
    to {
        --rainbow-angle: 360deg;
    }
}

/* バッジ */
.gacha-badges {
    margin: 0;
    padding: 0;
    width: 100%;
}

.gacha-badges .badge {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    box-sizing: border-box;
    border-radius: 8px;
}

.gacha-badges .badge-lottery-limit {
    background: #FFE5E5;
    color: #333333;
}

.gacha-badges .badge-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #D32F2F;
}

.gacha-badges .badge-text {
    flex: 1;
    text-align: left;
}

/* キャッチコピー */
.gacha-catchphrase {
    margin-top: -16px;
    padding: 0 20px;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    color: #000;
    text-align: left;
    line-height: 1.6;
}

.gacha-catchphrase-img {
    margin-top: 32px;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* アイテムコンテナ */
.gacha-items-container {
    margin-bottom: 20px;
    width: 100%;
    max-width: 450px;
}

/* レア度セクション */
.rarity-section {
    margin-bottom: 15px;
    padding: 2px 0;
    background: white;
}

.rarity-header {
    text-align: center;
    margin-bottom: 6px;
}

.rarity-label {
    height: 50px;
    width: auto;
}

.rarity-items {
    display: grid;
    gap: 8px;
    justify-items: center;
}

/* 1等グリッド */
.first-etc-grid {
    display: grid;
    grid-template-columns: 180px 180px;
    gap: 4px;
    width: 100%;
    max-width: 368px;
    margin: 0 auto;
    justify-content: center; /* グリッド全体を中央寄せ */
}

.first-etc-grid:has(.gacha-item:only-child) {
    grid-template-columns: 180px;
    justify-content: center; /* 1枚だけの場合はグリッド全体を中央寄せ */
}

/* 1等で3枚（奇数）の場合、3枚目を中央寄せ */
.first-etc-grid:has(.gacha-item:nth-child(3):last-child) .gacha-item:nth-child(3) {
    grid-column: span 2;
    justify-self: center;
}

/* 2等グリッド */
.second-etc-grid {
    display: grid;
    grid-template-columns: 180px 180px;
    gap: 4px;
    width: 100%;
    max-width: 368px;
    margin: 0 auto;
    justify-content: center; /* グリッド全体を中央寄せ */
}

.second-etc-grid:has(.gacha-item:only-child) {
    grid-template-columns: 180px;
    justify-content: center; /* 1枚だけの場合はグリッド全体を中央寄せ */
}

/* 2等で3枚（奇数）の場合、3枚目を中央寄せ */
.second-etc-grid:has(.gacha-item:nth-child(3):last-child) .gacha-item:nth-child(3) {
    grid-column: span 2;
    justify-self: center;
}

/* 3等グリッド */
.third-etc-grid {
    display: grid;
    grid-template-columns: 95px 95px 95px;
    gap: 4px;
    width: 325px;
    margin: 0 auto;
    justify-content: center; /* グリッド全体を中央寄せ */
}

.third-etc-grid:has(.gacha-item:only-child) {
    grid-template-columns: 95px;
    justify-content: center; /* 1枚だけの場合はグリッド全体を中央寄せ */
}

.third-etc-grid:has(.gacha-item:nth-child(2):last-child) {
    grid-template-columns: 95px 95px;
}

/* 4等グリッド（3等と同じレイアウト） */
.fourth-etc-grid {
    display: grid;
    grid-template-columns: 95px 95px 95px;
    gap: 4px;
    width: 325px;
    margin: 0 auto;
    justify-content: center; /* グリッド全体を中央寄せ */
}

.fourth-etc-grid:has(.gacha-item:only-child) {
    grid-template-columns: 95px;
    justify-content: center; /* 1枚だけの場合はグリッド全体を中央寄せ */
}

.fourth-etc-grid:has(.gacha-item:nth-child(2):last-child) {
    grid-template-columns: 95px 95px;
}

/* その他グリッド */
.n-grid {
    text-align: center;
}

.n-item-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.n-item-text p {
    margin: 10px 0;
}

/* アイテムカード */
.gacha-item {
    background: transparent;
    border-radius: 10px;
    padding: 0;
    box-shadow: none;
    transition: transform 0.3s;
    cursor: pointer;
    overflow: hidden;
}

.gacha-item:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

/* カードサイズ */
.first-etc-section .gacha-item {
    width: 180px;
    height: 237px;
}

.second-etc-section .gacha-item {
    width: 180px;
    height: 237px;
}

.third-etc-section .gacha-item {
    width: 95px;
    height: 125px;
}

.fourth-etc-section .gacha-item {
    width: 95px;
    height: 125px;
}

.item-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: visible;
    border-radius: 10px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* カード系ガチャ: 画像サイズを統一（小さい画像もコンテナいっぱいに拡大） */
.lottery-card-type .item-image {
    display: block;
    overflow: hidden;
}

.lottery-card-type .item-image img {
    object-fit: cover;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* アスペクト比を保ったまま全体を表示（トリミングしない） */
}

/* アイテム個数表示 */
.item-count {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

/* 注意事項 */
.gacha-notes {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-top: 50px;
}

.gacha-notes h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    color: #dc3545;
}

.notes-content h4 {
    font-size: 1.1rem;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

.notes-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 10px;
}

.notes-footer {
    margin-top: 30px;
    font-weight: bold;
    color: #333;
}

/* 固定フッター */
.gacha-fixed-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 4px 0 max(20px, calc(6px + env(safe-area-inset-bottom, 20px)));
    transition: bottom 0.3s ease;
}


.footer-content {
    width: 100%;
    max-width: 345px;
    margin: 0 auto;
}

/* コインと在庫セクション */
.coin-stock-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.gacha-coin-display {
    flex-shrink: 0;
}

.gacha-coin-amount {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
}

.gacha-coin-icon {
    width: 20px;
    height: 20px;
}

.coin-number {
    font-size: 1.2rem;
}

.coin-unit {
    font-size: 0.8rem;
    color: #999;
}

/* 在庫表示 */
.stock-display {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stock-info {
    font-size: 12px;
    color: #666;
    text-align: center;
    white-space: nowrap;
    width: 100%;
    display: block;
    line-height: 1.2;
}

.stock-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.stock-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* ガチャアクション（lottery_pageでのみ適用） */
.gacha-detail-wrap .gacha-actions {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 40px;
}

/* ログイン必要メッセージ */
.login-required {
    text-align: center;
}

.login-required .gummy-btn {
    width: 100%;
    height: 40px;
    font-size: 0.8rem;
}

/* フッター内クーポンバナー表示時の余白調整 */
body.has-coupon-countdown .gacha-detail-wrap {
    padding-bottom: 160px;
}

/* エラーメッセージ */
.error-message {
    background: #dc3545;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 10px;
}

/* 獲得済みバッジ - 基本設定 */
.acquired-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    pointer-events: none;
    object-fit: contain;
    max-height: 80%; /* heightの代わりにmax-heightを使用 */
    max-width: 80%;  /* widthの代わりにmax-widthを使用 */
    width: auto;     /* アスペクト比を保つ */
    height: auto;    /* アスペクト比を保つ */
}

/* 獲得済みアイテムの画像をグレーに */
.acquired-item-gray {
    filter: brightness(0.7) grayscale(30%);
}

/* ゲスト割引価格表示（インライン） */
.guest-discount-row.gacha-coin-amount {
    gap: 0;
}

.coin-stock-section:has(.guest-discount-row) .gacha-coin-display {
    flex: 1;
}

.guest-discount-row .gacha-coin-icon {
    margin-right: 8px;
}

.guest-original-price {
    text-decoration: line-through 3px #E50000;
    color: #333;
    margin-right: 8px;
}

.guest-discount-row .coin-unit {
    margin-right: 8px;
}

.guest-discount-price-value {
    color: #E50000;
    font-weight: bold;
    font-size: 1rem;
}

.guest-coupon-badge {
    position: relative;
    background: #E50000;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    white-space: nowrap;
    margin-left: 4px;
}

.guest-coupon-badge::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-right-color: #E50000;
    border-left: 0;
}

.guest-guarantee-inline {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.65rem;
    color: #666;
    margin-left: auto;
    white-space: nowrap;
}

.guest-guarantee-amount {
    color: #dc3545;
    font-size: calc((0.65rem + 1px) * 1.2);
    font-weight: bold;
}

/* PSAバッジスタイル（デフォルト） */
.psa-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 70px;
    height: auto;
    max-width: 40%;
    z-index: 1;
    pointer-events: none;
}

/* ボーナス賞ラベルスタイル */
.bonus-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 270px;
    height: 50px;
    margin: 0 auto;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bonus-label-lastone {
    background: linear-gradient(135deg,
        #ff6b6b 0%,
        #ff3333 25%,
        #cc0000 50%,
        #ff3333 75%,
        #ff6b6b 100%);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.bonus-label-milestone {
    background: linear-gradient(135deg,
        #4ade80 0%,
        #22c55e 25%,
        #16a34a 50%,
        #22c55e 75%,
        #4ade80 100%);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.bonus-label-nanika-pack {
    background: linear-gradient(135deg,
        #a78bfa 0%,
        #8b5cf6 25%,
        #7c3aed 50%,
        #8b5cf6 75%,
        #a78bfa 100%);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.bonus-label-other {
    background: linear-gradient(135deg,
        #9ca3af 0%,
        #6b7280 25%,
        #4b5563 50%,
        #6b7280 75%,
        #9ca3af 100%);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

/* なにかのパックセクション */
.nanika-pack-section {
    margin-bottom: 30px;
}

.nanika-pack-image-container {
    padding: 0px 20px;
    background: #fff;
    border-radius: 8px;
}

/* キリ番チェックポイントスタイルは stock-gauge.blade.php コンポーネントで定義されています */
.stock-gauge-bar {
    position: relative;
}

/* ウェイトリストボタンラッパー */
.lottery-page-waitlist-button-wrapper {
    width: 100%;
    max-width: 92%;
    margin: 12px auto;
}

.lottery-page-waitlist-button-wrapper .gummy-btn {
    width: 100%;
}

/* カウントダウンタイマー */
.detail-countdown-timer {
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    max-width: 90%;
    margin: 0 auto;
}

.detail-countdown-timer .countdown-text {
    color: #0066CC;
    font-weight: bold;
    font-size: 18px;
}

.detail-countdown-timer.upcoming .countdown-text {
    color: #FF0000;
}

.detail-countdown-timer .countdown-display {
    margin-left: 8px;
    font-size: 20px;
}

/* プレイコード専用ボタンスタイル */
.gummy-btn-playcode {
    background: linear-gradient(90deg, #FFF168 0%, #CBFFFA 50%, #FBD6FF 100%);
    color: #333;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.gummy-btn-playcode:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.gummy-btn-playcode:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* プレイコードボタンのテキストを見やすくする */
.gummy-btn-playcode span {
    position: relative;
    z-index: 1;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* 発送のみバッジスタイル（画像に応じて調整の必要あり） */
.shipping-only-badge {
    position: absolute;
    top: 9px;
    left: 5px;
    width: 120px;
    height: auto;
    max-width: 60%;
    max-height: 20%;
    z-index: 2;
    pointer-events: none;
}

/* クリック可能な景品画像 */
.gacha-item-clickable {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.gacha-item-clickable:hover {
    opacity: 0.8;
}

/* 景品画像拡大モーダル */
.item-image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.item-image-modal-content {
    width: 100%;
    max-width: 375px;
    background: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

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

.item-image-modal-header {
    width: 100%;
    padding: 10px 16px;
    background: var(--グレー_エリア, #F6F4F4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.item-image-modal-title {
    flex: 1;
    color: var(--グミ用ブラック, #6F6969);
    font-size: 12px;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 700;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-image-modal-close {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.item-image-modal-close:hover {
    opacity: 0.7;
}

.item-image-modal-body {
    width: 100%;
    padding: 24px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 画像コンテナのサイズを固定 */
.item-image-modal-body > div {
    width: 343px;
    height: 343px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.item-image-modal-body #itemImageModalImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ウェイトリスト登録ユーザーアイコンセクション */
.waitlist-users-section {
    width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-bottom: 16px;
}

.waitlist-entry-label {
    color: #6F6969;
    text-align: center;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.waitlist-users-icons {
    display: flex;
    align-items: center;
    position: relative;
}

.waitlist-user-icon {
    width: 27px;
    height: 27px;
    flex-shrink: 0;
    border-radius: 27px;
    overflow: hidden;
    border: 2px solid #6F6969;
    background: lightgray;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.waitlist-user-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.waitlist-user-ellipsis {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
}

.waitlist-user-ellipsis span {
    color: #6F6969;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
}

