@charset "UTF-8";

.rg-container {
    max-width: 460px;
    margin: 0 auto 25px;
    background: #fdfaf6;
    border: 3px solid #ffb7c5;
    border-radius: 16px;
    padding: 12px;
    box-sizing: border-box;
    font-family: "M PLUS Rounded 1c", "Hiragino Kaku Gothic ProN", sans-serif;
    color: #4e342e;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* ヘッダー */
.rg-header { text-align: center; margin-bottom: 10px; }
.rg-title-row h2 {
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    font-size: 1.15rem !important;
    color: #d81b60 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}
.rg-global-stats {
    background: #fff5f7;
    border: 1px dashed #ffb7c5;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.72rem;
    color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.rg-global-stats strong { color: #d81b60; font-size: 0.85rem; }
.rg-g-sep { color: #ccc; }

/* ガチャLv設定パネル */
.rg-lv-panel {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.rg-lv-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.rg-lv-badge-wrap { display: flex; align-items: baseline; gap: 6px; }
.rg-lv-label { font-size: 0.85rem; font-weight: bold; color: #795548; }
.rg-lv-val { font-size: 1.35rem; font-weight: 900; color: #ec407a; }
.rg-btn-mini {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 15px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: bold;
    color: #495057;
    cursor: pointer;
    transition: 0.2s;
}
.rg-btn-mini:hover { background: #e9ecef; }

.rg-slider-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.rg-lv-step-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f8bbd0;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: opacity 0.2s;
}
.rg-lv-step-btn:active:not(:disabled) { transform: scale(0.92); }
.rg-lv-step-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.rg-slider-wrap {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding-top: 6px;
}
.rg-lv-slider {
    width: 100%;
    margin: 0;
    accent-color: #ec407a;
    height: 8px;
    cursor: pointer;
}
.rg-lv-slider:disabled { opacity: 0.45; cursor: not-allowed; }

.rg-slider-ticks {
    position: relative;
    height: 20px;
    margin: 4px 8px 0;
}
.rg-slider-ticks.is-locked { opacity: 0.45; pointer-events: none; }
.rg-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 0.68rem;
    font-weight: bold;
    color: #888;
    padding-top: 6px;
    cursor: pointer;
    user-select: none;
    line-height: 1;
    white-space: nowrap; /* ★「20」の縦折り返しを防止 */
}
.rg-tick::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 4px;
    background: #bbb;
}
.rg-tick:hover { color: #ec407a; }

/* ★3列×3行（最大8項目）に綺麗に収めるグリッド設定 */
.rg-lv-prob-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    font-size: 0.64rem;
    background: #f8f9fa;
    padding: 5px;
    border-radius: 8px;
}
.rg-prob-pill {
    padding: 3px 4px;
    border-radius: 12px; /* ★枠の角丸を強調 */
    font-weight: 900;
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
}
.rg-r-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px; /* ★★背景を丸いカプセル型に */
    color: #fff;
    font-weight: 900;
    font-size: 0.72rem;
    line-height: 1.3;
    text-shadow: 0 1px 1px rgba(0,0,0,0.25);
    white-space: nowrap;
}
.rg-prob-pill .rg-r-badge {
    padding: 1px 5px;
    font-size: 0.64rem;
}
.rg-r-1 { background: #a8a8a8; } /* ★1: グレー */
.rg-r-2 { background: #8bc34a; } /* ★2: 黄緑 */
.rg-r-3 { background: #4fc3f7; } /* ★3: 水色 */
.rg-r-4 { background: #ce7be8; } /* ★4: 紫 */
.rg-r-5 { background: #ffa726; } /* ★5: オレンジ */
.rg-r-6 { background: #55d639; } /* ★6: 鮮やかな緑 */
.rg-r-7 { background: #ff5252; } /* ★7: 赤ピンク */
.rg-r-8 { background: #00c8ff; box-shadow: 0 0 6px rgba(0, 200, 255, 0.7); } /* ★8: シアンブルー */
/* オート停止設定バー */
.rg-settings-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 6px 10px;
    margin-bottom: 10px;
    font-size: 0.8rem;
}
.rg-stop-conds { display: flex; align-items: center; gap: 12px; font-weight: bold; }
.rg-set-title { color: #777; font-size: 0.78rem; }
.rg-chk-label { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; user-select: none; }
.rg-c-s8 { color: #00838f; font-weight: 900; }
.rg-c-s7 { color: #d50000; font-weight: 900; }

/* ===================================================
   実機風ガチャビューポート（背景＆35連グリッド）
   =================================================== */
.rg-viewport {
    position: relative;
    width: 100%;
    background: #879c92;
    background-image: radial-gradient(rgba(255,255,255,0.08) 2px, transparent 2px);
    background-size: 24px 24px;
    border-radius: 14px;
    padding: 14px 10px 10px;
    box-sizing: border-box;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2);
    margin-bottom: 12px;
    overflow: hidden;
}

.rg-auto-status {
    height: 26px;
    line-height: 26px;
    padding: 0 12px;
    margin: 0 auto 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.74rem;
    font-weight: bold;
    border-radius: 20px;
    text-align: center;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 20;
    position: relative;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.15s;
}
.rg-auto-status.is-show {
    visibility: visible;
    opacity: 1;
}

.rg-results-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px 8px;
    padding: 4px;
    box-sizing: border-box;
    min-height: 410px;
    position: relative;
}

.rg-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 9px;
    background: #fdfaf2;
    border: 2px solid #fff;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.4);
    user-select: none;
}
.rg-card.is-empty {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    opacity: 1;
    transform: scale(1);
}
.rg-card.is-visible { opacity: 1; transform: scale(1); }
.rg-card.anim-pop { animation: rgCardPop 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

@keyframes rgCardPop {
    0% { opacity: 0; transform: scale(0.3); filter: brightness(3); }
    60% { opacity: 1; transform: scale(1.08); filter: brightness(1.5); }
    100% { opacity: 1; transform: scale(1); filter: brightness(1); }
}

.rg-card img {
    width: 92%;
    height: 92%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
    pointer-events: none;
}

.rg-card-qty {
    position: absolute;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    text-shadow: 1px 1px 0 #5d4037, -1px -1px 0 #5d4037, 1px -1px 0 #5d4037, -1px 1px 0 #5d4037;
    z-index: 4;
    pointer-events: none;
}

/* レア度別の枠発光 */
.rg-card.rarity-1 { background: #f5f0eb; box-shadow: 0 0 4px rgba(255,255,255,0.7); }
.rg-card.rarity-2 { background: #eef7e6; box-shadow: 0 0 5px rgba(255,255,255,0.85); }
.rg-card.rarity-3 { background: #e3f3fc; box-shadow: 0 0 6px #ffffff, 0 0 10px rgba(255,255,255,0.8); }
.rg-card.rarity-4 { background: #f3e5f5; border-color: #fff; box-shadow: 0 0 5px #fff, 0 0 10px #d500f9, 0 0 15px rgba(213, 0, 249, 0.7); }
.rg-card.rarity-5 { background: #fff3e0; border-color: #fff; box-shadow: 0 0 5px #fff, 0 0 11px #ff9100, 0 0 18px rgba(255, 145, 0, 0.85); }
.rg-card.rarity-6 { background: #f1f8e9; border-color: #fff; box-shadow: 0 0 6px #fff, 0 0 13px #76ff03, 0 0 22px #64dd17; z-index: 3; }
.rg-card.rarity-7 { background: #ffebee; border-color: #fff; box-shadow: 0 0 7px #fff, 0 0 15px #ff1744, 0 0 26px #d50000; z-index: 5; }

.rg-card.rarity-8 {
    background: linear-gradient(135deg, #e0f7fa 0%, #80deea 100%);
    border-color: #ffffff;
    box-shadow: 0 0 8px #ffffff, 0 0 16px #00e5ff, 0 0 28px #00b8d4, 0 0 38px rgba(0, 229, 255, 0.95);
    z-index: 10;
}
.rg-card.rarity-8.anim-pop {
    animation: rgCardPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, rgStar8Pulse 1.4s 0.25s infinite alternate;
}
@keyframes rgStar8Pulse {
    0% { box-shadow: 0 0 6px #fff, 0 0 14px #00e5ff, 0 0 24px #00b8d4; }
    100% { box-shadow: 0 0 10px #fff, 0 0 22px #00e5ff, 0 0 36px #00e5ff, 0 0 46px #fff; }
}

.rg-new-badge {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    font-size: 0.65rem; font-weight: 900; color: #ff8a80; letter-spacing: -0.5px; white-space: nowrap;
    text-shadow: 1.5px 1.5px 0 #fff, -1.5px -1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px -1.5px 0 #fff, 0px 2px 4px rgba(0,0,0,0.4);
    z-index: 15; pointer-events: none; animation: rgNewBounce 0.6s infinite alternate;
}
@keyframes rgNewBounce { from { transform: translateX(-50%) translateY(0); } to { transform: translateX(-50%) translateY(-3px); } }

.rg-stage-footer { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 2px 6px; }
.rg-stage-lv-title { color: #fff; font-weight: 900; font-size: 0.82rem; text-shadow: 1px 1px 0 #5d4037, -1px -1px 0 #5d4037, 1px -1px 0 #5d4037, -1px 1px 0 #5d4037; }
.rg-stage-lv-bar {
    flex-grow: 1;
    max-width: 280px;
    background: #b9989e;
    border: 2px solid #fff;
    border-radius: 20px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 0; /* ★左側の余白を0に */
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.rg-stage-lv-num {
    background: #fff;
    color: #5d4037;
    font-weight: 900;
    font-size: 0.74rem;
    height: 100%;
    padding: 0 14px 0 12px;
    border-radius: 0 14px 14px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
.rg-stage-lv-info { color: #fff; font-weight: bold; font-size: 0.72rem; text-shadow: 1px 1px 2px rgba(0,0,0,0.4); }

/* 抽選時の白透過＋モヤ演出 */
.rg-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rg-smoke-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rg-smoke-circle {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(206, 147, 216, 0.85) 0%, rgba(123, 31, 162, 0.45) 50%, transparent 70%);
    border-radius: 50%;
    filter: blur(8px);
    animation: rgSmokePulse 0.4s infinite alternate;
}
@keyframes rgSmokePulse {
    from { transform: scale(0.85) rotate(0deg); opacity: 0.7; }
    to { transform: scale(1.15) rotate(15deg); opacity: 1; }
}

/* ガチャ実行ボタン群 */
.rg-action-area { margin-bottom: 12px; }
.rg-draw-btns { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.rg-btn-draw {
    background: linear-gradient(to bottom, #ff9eb5 0%, #f48fb1 100%);
    border: 3px solid #fff; border-radius: 30px; padding: 8px 10px; cursor: pointer;
    box-shadow: 0 4px 0 #d81b60, 0 5px 10px rgba(0,0,0,0.15);
    transition: transform 0.1s, box-shadow 0.1s, opacity 0.2s;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.rg-btn-draw:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #d81b60; }
.rg-btn-draw:disabled { opacity: 0.5; cursor: not-allowed; }
.rg-btn-draw.rg-btn-single { background: linear-gradient(to bottom, #ff80ab 0%, #ec407a 100%); }
.rg-btn-draw.is-resume {
    background: linear-gradient(to bottom, #66bb6a 0%, #43a047 100%);
    box-shadow: 0 4px 0 #2e7d32, 0 5px 10px rgba(0,0,0,0.15);
}
.rg-btn-main { color: #fff; font-weight: 900; font-size: 0.95rem; text-shadow: 1px 1px 2px rgba(0,0,0,0.25); line-height: 1.2; }
.rg-btn-sub { margin-top: 3px; background: rgba(255,255,255,0.92); color: #5d4037; font-size: 0.7rem; font-weight: 900; padding: 1px 10px; border-radius: 10px; }

/* Xシェアボタンバー（2ボタン） */
.rg-share-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.rg-share-btn { flex: 1; border: none; border-radius: 25px; padding: 10px 6px; font-size: 0.8rem; font-weight: bold; color: #fff; cursor: pointer; box-shadow: 0 3px 6px rgba(0,0,0,0.15); white-space: nowrap; }
.rg-share-btn:active { transform: scale(0.96); }
.rg-btn-pink  { background: #ec407a; }
.rg-btn-x     { background: #0f1419; }

/* 累計データ＆高レア履歴パネル */
.rg-stats-panel { background: #fff; border: 2px solid #ffe0ea; border-radius: 12px; padding: 12px; }
.rg-stats-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; border-bottom: 2px dashed #ffcdd2; padding-bottom: 6px; }
.rg-stats-header h3 { margin: 0 !important; padding: 0 !important; font-size: 0.95rem !important; color: #d81b60 !important; border: none !important; background: none !important; box-shadow: none !important; }
.rg-btn-reset { background: #fff; border: 1px solid #ef9a9a; color: #e53935; border-radius: 15px; padding: 3px 10px; font-size: 0.72rem; font-weight: bold; cursor: pointer; }
.rg-btn-reset:hover { background: #ffebee; }

.rg-stats-overview { display: flex; gap: 8px; margin-bottom: 10px; }
.rg-stat-box { flex: 1; background: #fff9fa; border: 1px solid #f8bbd0; border-radius: 8px; padding: 8px; text-align: center; }
.rg-stat-label { font-size: 0.72rem; color: #888; font-weight: bold; }
.rg-stat-val { font-size: 1.25rem; font-weight: 900; color: #d81b60; line-height: 1.2; }
.rg-stat-sub { font-size: 0.68rem; color: #999; }

.rg-stats-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; margin-bottom: 12px; }
.rg-stats-table th, .rg-stats-table td { border: 1px solid #eee; padding: 5px 6px; text-align: center; }
.rg-stats-table th { background: #f8f9fa; color: #555; font-weight: bold; }

/* ★8・★7 獲得履歴（明確に分離） */
.rg-high-rare-section { display: flex; flex-direction: column; gap: 10px; }
.rg-hr-block { border-radius: 10px; padding: 10px; border: 2px solid #eee; }
.rg-hr-block-s8 {
    background: linear-gradient(135deg, #f0fcff 0%, #e0f7fa 100%);
    border-color: #4dd0e1;
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.15);
}
.rg-hr-block-s7 {
    background: #fff8f8;
    border-color: #ffcdd2;
}
.rg-hr-block-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
}
.rg-hr-head-title { font-size: 0.82rem; font-weight: 900; }
.s8-title { color: #00838f; }
.s7-title { color: #c62828; }

.rg-comp-badge { font-size: 0.68rem; font-weight: bold; padding: 2px 8px; border-radius: 12px; background: #fff; border: 1px solid #ddd; }
.rg-comp-badge.comp-r8 { border-color: #00bcd4; color: #006064; }
.rg-comp-badge.comp-r7 { border-color: #ef9a9a; color: #c62828; }

.rg-hr-grid { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.rg-hr-item { position: relative; width: 48px; height: 48px; border-radius: 8px; background: #fff; border: 2px solid #ddd; display: flex; align-items: center; justify-content: center; }
.rg-hr-item.hr-r8 { border-color: #00e5ff; box-shadow: 0 0 8px rgba(0,229,255,0.65); }
.rg-hr-item.hr-r7 { border-color: #ff5252; box-shadow: 0 0 6px rgba(255,82,82,0.45); }
.rg-hr-item img { width: 88%; height: 88%; object-fit: contain; }
.rg-hr-cnt { position: absolute; bottom: -4px; right: -4px; background: #d81b60; color: #fff; font-size: 0.62rem; font-weight: bold; padding: 1px 5px; border-radius: 10px; border: 1px solid #fff; }

/* 累計レポート画像生成用カード */
.rg-report-card { position: fixed; top: -9999px; left: -9999px; width: 540px; background: #fff5f7; border: 5px solid #ffb7c5; border-radius: 20px; padding: 20px; box-sizing: border-box; font-family: "Hiragino Kaku Gothic ProN", Meiryo, sans-serif; color: #4e342e; }
.rg-rep-header { text-align: center; border-bottom: 3px dashed #ffb7c5; padding-bottom: 10px; margin-bottom: 14px; }
.rg-rep-title { font-size: 22px; font-weight: 900; color: #d81b60; }
.rg-rep-lv { font-size: 13px; font-weight: bold; color: #ec407a; margin-top: 4px; }
.rg-rep-summary { display: flex; gap: 12px; margin-bottom: 14px; }
.rg-rep-box { flex: 1; background: #fff; border: 2px solid #f8bbd0; border-radius: 12px; padding: 10px; text-align: center; }
.rg-rep-lbl { font-size: 13px; color: #777; font-weight: bold; }
.rg-rep-num { font-size: 26px; font-weight: 900; color: #d81b60; }
.rg-rep-rarity-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.rg-rep-r-cell { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 6px 4px; text-align: center; font-size: 12px; font-weight: bold; }
.rg-rep-hr-box { background: #fff; border: 2px solid #f8bbd0; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; min-height: 60px; }
.rg-rep-hr-s8 { background: #f0fcff; border-color: #4dd0e1; }
.rg-rep-hr-s7 { background: #fffafa; border-color: #ffcdd2; }
.rg-rep-hr-head { font-size: 14px; font-weight: 900; margin-bottom: 8px; text-align: center; }
.rg-rep-comp-sub { font-size: 12px; color: #666; font-weight: bold; margin-left: 4px; }
.rg-rep-hr-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rg-rep-footer { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: #999; font-weight: bold; }

/* モーダル */
.rg-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 99999; display: flex; align-items: center; justify-content: center; }
.rg-modal-content { background: #fff; width: 92%; max-width: 440px; max-height: 80vh; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; }
.rg-modal-header { background: #ffebee; padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #ffcdd2; }
.rg-modal-header h3 { margin: 0 !important; font-size: 1rem !important; color: #d81b60 !important; border: none !important; background: none !important; }
.rg-modal-close { background: none; border: none; font-size: 1.5rem; color: #d81b60; cursor: pointer; line-height: 1; }
.rg-modal-body { padding: 12px; overflow-y: auto; font-size: 0.8rem; }

@media screen and (max-width: 400px) {
    .rg-results-grid { gap: 10px 5px; min-height: 360px; }
    .rg-share-btn { font-size: 0.72rem; }
}