/* ============================================
   R SHOP - Gacha Page Styles (List + Detail)
   ============================================ */

/* --- Back Button --- */
.gacha-back-wrap {
  padding: 16px 20px 0;
  max-width: 800px;
  margin: 0 auto;
}

.gacha-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gray);
  transition: color 0.3s ease;
}

.gacha-back-btn:hover {
  color: var(--gold);
}

.gacha-back-btn svg {
  transition: transform 0.3s ease;
}

.gacha-back-btn:hover svg {
  transform: translateX(-3px);
}

/* ================================================
   List Mode
   ================================================ */

/* --- List Header --- */
.gacha-list-header {
  padding: 24px 20px 0;
  max-width: 800px;
  margin: 0 auto;
}

.gacha-list-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--gold);
  margin-bottom: 6px;
}

.gacha-list-title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 2px;
}

/* --- List Grid --- */
.gacha-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 20px 20px 48px;
  max-width: 800px;
  margin: 0 auto;
}

/* --- List Card (same design as home gacha-card) --- */
.gacha-list-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(201, 168, 76, 0.1);
  transition: all 0.4s ease;
  min-height: 160px;
  text-decoration: none;
  display: block;
}

.gacha-list-card:hover {
  border-color: rgba(201, 168, 76, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.gacha-list-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3) 0%, rgba(201, 168, 76, 0.15) 100%);
  transition: opacity 0.4s ease;
}

.gacha-list-card-bg.has-image {
  opacity: 1;
}

.gacha-list-card-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: opacity 0.5s ease, transform 0.7s ease;
}

.gacha-list-card:hover .gacha-list-card-bg-img {
  transform: scale(1.04);
}

.gacha-list-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 20px;
  min-height: inherit;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0.25) 50%,
    transparent 75%
  );
}

.gacha-list-card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.gacha-list-card-badge {
  font-family: var(--font-heading);
  font-size: 7px;
  letter-spacing: 2px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(201, 168, 76, 0.35);
  padding: 2px 10px;
  border-radius: 2px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gacha-list-card-count {
  font-family: var(--font-heading);
  font-size: 8px;
  letter-spacing: 1px;
  color: #A78BFA;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(167, 139, 250, 0.35);
  padding: 2px 10px;
  border-radius: 2px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gacha-list-card-bottom {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.gacha-list-card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gacha-list-card-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 4px 12px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gacha-list-card-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.gacha-list-card-arrow {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.3s ease, transform 0.3s ease;
}

.gacha-list-card:hover .gacha-list-card-arrow {
  color: var(--gold);
  transform: translateX(4px);
}

/* --- List Empty State --- */
.gacha-list-empty {
  text-align: center;
  padding: 80px 20px;
}

.gacha-list-empty p {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 16px;
}

/* ================================================
   Detail Mode
   ================================================ */

/* --- Hero Section --- */
.gacha-hero {
  padding: 20px 20px 0;
}

.gacha-hero-inner {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  min-height: 200px;
  border: 1px solid rgba(201, 168, 76, 0.15);
}

.gacha-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(201, 168, 76, 0.1) 100%);
}

.gacha-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

.gacha-hero-content {
  position: relative;
  z-index: 1;
  padding: 32px 24px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.2) 100%
  );
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.gacha-hero-badge {
  display: inline-block;
  width: fit-content;
  font-family: var(--font-heading);
  font-size: 8px;
  letter-spacing: 3px;
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.4);
  padding: 3px 12px;
  border-radius: 2px;
  margin-bottom: 12px;
}

.gacha-hero-name {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
  line-height: 1.4;
  margin-bottom: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.gacha-hero-desc {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 16px;
}

.gacha-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gacha-hero-price {
  font-family: var(--font-heading);
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--gold);
}

.gacha-hero-price::before {
  content: '\A5';
  font-size: 12px;
  margin-right: 2px;
}

.gacha-hero-count {
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 1px;
  color: #A78BFA;
  border: 1px solid rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.1);
  padding: 4px 14px;
  border-radius: 3px;
}

/* --- Probability Section --- */
.gacha-prob-section {
  padding: 28px 20px 0;
}

.gacha-prob-inner {
  max-width: 800px;
  margin: 0 auto;
}

.gacha-prob-header {
  margin-bottom: 16px;
}

.gacha-prob-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--gold);
  margin-bottom: 6px;
}

.gacha-prob-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--gray);
  letter-spacing: 2px;
}

/* Stacked probability bar */
.gacha-prob-bar {
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.gacha-prob-bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: var(--font-heading);
  font-size: 8px;
  letter-spacing: 1px;
  color: rgba(0, 0, 0, 0.85);
  font-weight: 700;
  transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  overflow: hidden;
}

/* Probability detail rows */
.gacha-prob-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gacha-prob-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.gacha-prob-row-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}

.gacha-prob-row-grade--SS { background: #FFD700; color: #1a1a1a; }
.gacha-prob-row-grade--S { background: #FF6B6B; color: #fff; }
.gacha-prob-row-grade--A { background: #A78BFA; color: #fff; }
.gacha-prob-row-grade--B { background: #60A5FA; color: #fff; }
.gacha-prob-row-grade--C { background: #9CA3AF; color: #1a1a1a; }

.gacha-prob-row-bar-wrap {
  flex: 1;
  min-width: 0;
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  overflow: hidden;
}

.gacha-prob-row-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gacha-prob-row-pct {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--white);
  min-width: 52px;
  text-align: right;
  flex-shrink: 0;
}

.gacha-prob-row-pct .pct-unit {
  font-size: 10px;
  color: var(--gray);
  margin-left: 1px;
}

/* Legacy legend (hidden when detail rows are used) */
.gacha-prob-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.gacha-prob-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--gray);
}

.gacha-prob-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.gacha-prob-legend-grade {
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 600;
}

.gacha-prob-legend-pct {
  font-size: 11px;
  color: var(--gray);
}

/* Miss segment in stacked bar */
.gacha-prob-bar-seg--miss {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.35);
  font-size: 9px;
  letter-spacing: 1.5px;
}

/* Summary banner (win rate vs miss rate) */
.gacha-prob-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.gacha-prob-summary-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.gacha-prob-summary-win {
  color: var(--gold);
}
.gacha-prob-summary-win strong {
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 0.5px;
}
.gacha-prob-summary-miss {
  color: rgba(156, 163, 175, 0.7);
}
.gacha-prob-summary-miss strong {
  font-family: var(--font-heading);
  font-size: 15px;
  letter-spacing: 0.5px;
}

/* Miss row styling */
.gacha-prob-row--miss {
  opacity: 0.5;
}
.gacha-prob-row-grade--miss {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
  font-size: 9px;
  letter-spacing: 1px;
}
.gacha-prob-row-bar-fill--miss {
  background: rgba(255, 255, 255, 0.1);
}

/* Probability notice */
.gacha-prob-notice {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  font-size: 10px;
  color: rgba(136, 136, 136, 0.7);
  line-height: 1.6;
  letter-spacing: 0.3px;
}

/* --- Prize List Section --- */
.gacha-prizes-section {
  padding: 32px 20px 48px;
}

.gacha-prizes-inner {
  max-width: 800px;
  margin: 0 auto;
}

.gacha-prizes-header {
  margin-bottom: 20px;
}

.gacha-prizes-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 9px;
  letter-spacing: 4px;
  color: var(--gold);
  margin-bottom: 6px;
}

.gacha-prizes-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--gray);
  letter-spacing: 2px;
}

/* Grade Group */
.gacha-grade-group {
  margin-bottom: 28px;
}

.gacha-grade-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gacha-grade-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 4px;
  line-height: 1.4;
}

.gacha-grade-badge--SS { background: #FFD700; color: #1a1a1a; }
.gacha-grade-badge--S { background: #FF6B6B; color: #fff; }
.gacha-grade-badge--A { background: #A78BFA; color: #fff; }
.gacha-grade-badge--B { background: #60A5FA; color: #fff; }
.gacha-grade-badge--C { background: #9CA3AF; color: #1a1a1a; }

.gacha-grade-group-count {
  font-size: 11px;
  color: var(--gray);
  letter-spacing: 0.3px;
}

.gacha-grade-group-stock {
  margin-left: auto;
  font-family: var(--font-heading);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--gold);
  opacity: 0.7;
}

/* Prize Card Grid */
.gacha-prize-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.gacha-prize-card {
  background: var(--black-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.gacha-prize-card:hover {
  border-color: rgba(201, 168, 76, 0.2);
  transform: translateY(-2px);
}

.gacha-prize-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gacha-prize-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gacha-prize-card:hover .gacha-prize-card-img img {
  transform: scale(1.04);
}

.gacha-prize-card-img svg {
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, 0.15);
}

.gacha-prize-card-body {
  padding: 10px 12px 12px;
}

.gacha-prize-card-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gacha-prize-card-desc {
  font-size: 11px;
  color: var(--gray);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Loading / Error --- */
.gacha-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}

.gacha-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(201, 168, 76, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: gachaSpin 0.7s linear infinite;
}

@keyframes gachaSpin {
  to { transform: rotate(360deg); }
}

.gacha-error {
  text-align: center;
  padding: 80px 20px;
}

.gacha-error p {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 16px;
}

.gacha-error-link {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  border: 1px solid rgba(201, 168, 76, 0.3);
  padding: 10px 24px;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.gacha-error-link:hover {
  background: rgba(201, 168, 76, 0.08);
}

/* ================================================
   Roll Section
   ================================================ */

.gacha-roll-section {
  padding: 24px 20px 0;
}

.gacha-roll-inner {
  max-width: 800px;
  margin: 0 auto;
  background: var(--black-card);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.gacha-roll-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.3), transparent);
}

.gacha-ticket-display {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gacha-ticket-icon {
  color: var(--gold);
  animation: ticketGlow 2s ease-in-out infinite;
}

@keyframes ticketGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.3)); }
  50% { filter: drop-shadow(0 0 12px rgba(201, 168, 76, 0.6)); }
}

.gacha-ticket-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gacha-ticket-label {
  font-family: var(--font-heading);
  font-size: 8px;
  letter-spacing: 3px;
  color: var(--gray);
}

.gacha-ticket-count {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  line-height: 1;
}

/* Roll Buttons */
.gacha-roll-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.gacha-roll-btn {
  position: relative;
  border: none;
  border-radius: 6px;
  padding: 14px 28px;
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 140px;
}

.gacha-roll-btn--single {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a1a1a;
}

.gacha-roll-btn--single:not(:disabled):hover {
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.4);
  transform: translateY(-1px);
}

.gacha-roll-btn--single:not(:disabled) {
  animation: rollBtnPulse 2s ease-in-out infinite;
}

.gacha-roll-btn--ten {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
}

.gacha-roll-btn--ten:not(:disabled):hover {
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
  transform: translateY(-1px);
}

.gacha-roll-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  animation: none;
}

@keyframes rollBtnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.3); }
  50% { box-shadow: 0 0 16px 4px rgba(201, 168, 76, 0.15); }
}

/* No Tickets Message */
.gacha-no-tickets {
  border: 1px solid rgba(136, 136, 136, 0.2);
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 1px;
}

/* Roll Loading Overlay */
.gacha-roll-loading {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  z-index: 5;
}

/* Button loading state */
.gacha-roll-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ================================================
   Roll Result Modal
   ================================================ */

.gacha-result-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gacha-result-overlay.active {
  opacity: 1;
  visibility: visible;
}

.gacha-result-modal {
  background: var(--black-light);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 12px;
  padding: 20px 16px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: scale(0.92) translateY(16px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 76, 0.2) transparent;
}

.gacha-result-modal::-webkit-scrollbar {
  width: 4px;
}

.gacha-result-modal::-webkit-scrollbar-track {
  background: transparent;
}

.gacha-result-modal::-webkit-scrollbar-thumb {
  background: rgba(201, 168, 76, 0.2);
  border-radius: 2px;
}

.gacha-result-overlay.active .gacha-result-modal {
  transform: scale(1) translateY(0);
}

.gacha-result-header {
  text-align: center;
  margin-bottom: 20px;
}

.gacha-result-label {
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--gold);
}

.gacha-result-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.gacha-result-items.multi {
  grid-template-columns: repeat(2, 1fr);
}

.gacha-result-item {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
}

.gacha-result-item-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gacha-result-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gacha-result-item-img svg {
  width: 32px;
  height: 32px;
  color: rgba(255, 255, 255, 0.15);
}

.gacha-result-item-body {
  padding: 8px 10px 10px;
}

.gacha-result-item-grade {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 4px;
}

.gacha-result-item-grade--SS { background: #FFD700; color: #1a1a1a; }
.gacha-result-item-grade--S { background: #FF6B6B; color: #fff; }
.gacha-result-item-grade--A { background: #A78BFA; color: #fff; }
.gacha-result-item-grade--B { background: #60A5FA; color: #fff; }
.gacha-result-item-grade--C { background: #9CA3AF; color: #1a1a1a; }

.gacha-result-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--white);
  line-height: 1.4;
}

.gacha-result-ok {
  display: block;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 13px;
  letter-spacing: 3px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 0.3s ease;
}

.gacha-result-ok:hover {
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.3);
}

/* ================================================
   List Card Ticket Badge
   ================================================ */

.gacha-list-card-ticket {
  font-family: var(--font-heading);
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(201, 168, 76, 0.4);
  padding: 2px 10px;
  border-radius: 2px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* --- No prizes state --- */
.gacha-no-prizes {
  text-align: center;
  padding: 32px 0;
  color: var(--gray);
  font-size: 13px;
}

/* ================================================
   Small mobile (max-width: 374px) — SE/mini
   ================================================ */
@media (max-width: 374px) {
  .gacha-hero-name { font-size: 18px; }
  .gacha-hero-content { padding: 24px 16px; }
  .gacha-roll-inner { padding: 16px 14px; }
  .gacha-roll-btn { min-width: 120px; padding: 12px 16px; font-size: 12px; }
  .gacha-ticket-count { font-size: 24px; }
  .gacha-prob-row { padding: 6px 8px; gap: 8px; }
  .gacha-prob-row-grade { font-size: 10px; padding: 2px 8px; min-width: 34px; }
  .gacha-prob-row-pct { font-size: 12px; min-width: 44px; }
  .gacha-result-modal { padding: 16px 12px; }
  .gacha-result-items.multi { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gacha-anim-gekiatsu { font-size: 40px; letter-spacing: 6px; }
}

/* ================================================
   PC Enhancement (min-width: 769px)
   ================================================ */
@media (min-width: 769px) {
  .gacha-back-wrap { padding: 20px 40px 0; }

  /* List mode */
  .gacha-list-header { padding: 28px 40px 0; }
  .gacha-list-label { font-size: 10px; }
  .gacha-list-title { font-size: 18px; }
  .gacha-list-grid { padding: 24px 40px 80px; gap: 16px; }
  .gacha-list-card { min-height: 180px; }
  .gacha-list-card-content { padding: 20px 24px; }
  .gacha-list-card-name { font-size: 18px; letter-spacing: 2px; }
  .gacha-list-card-meta { font-size: 12px; }

  /* Detail mode */
  .gacha-hero { padding: 20px 40px 0; }
  .gacha-hero-inner { min-height: 260px; }
  .gacha-hero-content { padding: 48px 36px; min-height: 260px; }
  .gacha-hero-name { font-size: 28px; }
  .gacha-hero-desc { font-size: 14px; }
  .gacha-hero-price { font-size: 20px; }

  /* Roll section */
  .gacha-roll-section { padding: 28px 40px 0; }
  .gacha-roll-inner { padding: 24px 32px; flex-direction: row; justify-content: space-between; }
  .gacha-ticket-count { font-size: 36px; }
  .gacha-roll-btn { min-width: 160px; padding: 16px 32px; font-size: 14px; }

  /* Probability section */
  .gacha-prob-section { padding: 36px 40px 0; }
  .gacha-prob-label { font-size: 10px; }
  .gacha-prob-title { font-size: 14px; }
  .gacha-prob-bar { height: 36px; }
  .gacha-prob-bar-seg { font-size: 10px; }
  .gacha-prob-row { padding: 10px 16px; }
  .gacha-prob-row-grade { font-size: 12px; min-width: 48px; }
  .gacha-prob-row-pct { font-size: 14px; min-width: 56px; }
  .gacha-prob-row-bar-wrap { height: 10px; }

  /* Prize section */
  .gacha-prizes-section { padding: 40px 40px 80px; }
  .gacha-prizes-label { font-size: 10px; }
  .gacha-prizes-title { font-size: 14px; }
  .gacha-prize-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .gacha-prize-card-name { font-size: 13px; }

  /* Result modal */
  .gacha-result-modal { padding: 28px 24px; }
  .gacha-result-items.multi { grid-template-columns: repeat(5, 1fr); }
}

@media (min-width: 1024px) {
  .gacha-list-grid { grid-template-columns: repeat(2, 1fr); }
  .gacha-prize-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ================================================
   BOX Gacha: Stock Progress
   ================================================ */

.gacha-stock-section {
  padding: 20px 20px 0;
}

.gacha-stock-inner {
  max-width: 800px;
  margin: 0 auto;
  background: var(--black-card);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 10px;
  padding: 16px 20px;
}

.gacha-stock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.gacha-stock-label {
  font-family: var(--font-heading);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gold);
}

.gacha-stock-count {
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--white);
}

.gacha-stock-bar-wrap {
  width: 100%;
}

.gacha-stock-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  overflow: hidden;
}

.gacha-stock-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width 0.5s ease;
}

.gacha-stock-bar-fill.low {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.gacha-stock-bar-fill.critical {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

/* ================================================
   BOX Gacha: Sold Out
   ================================================ */

.gacha-sold-out {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 20px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.06);
  width: 100%;
}

.gacha-sold-out-text {
  font-family: var(--font-heading);
  font-size: 18px;
  letter-spacing: 4px;
  font-weight: 700;
  color: #ef4444;
}

.gacha-sold-out-sub {
  font-size: 12px;
  color: var(--gray);
  letter-spacing: 1px;
}

/* ================================================
   BOX Gacha: Prize Stock Badge
   ================================================ */

.gacha-prize-stock-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--gray);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 3px;
  margin-top: 4px;
}

.gacha-prize-stock-out {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  font-weight: 700;
  letter-spacing: 2px;
}

.gacha-prize-sold-out {
  opacity: 0.4;
  filter: grayscale(0.7);
}

/* ================================================
   BOX Gacha: List Card Sold Out
   ================================================ */

.gacha-list-card-soldout {
  font-family: var(--font-heading);
  font-size: 8px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #ef4444;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 2px 10px;
  border-radius: 2px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gacha-list-card--sold-out {
  opacity: 0.5;
}

.gacha-list-card--sold-out:hover {
  opacity: 0.65;
}

.gacha-list-card-stock {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
}

.gacha-list-card-stock-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  transition: width 0.5s ease;
}

/* ================================================
   BOX Gacha: Partial Roll Notice
   ================================================ */

.gacha-result-partial {
  text-align: center;
  padding: 10px 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.06);
  font-size: 12px;
  color: #f59e0b;
  letter-spacing: 1px;
}

@media (min-width: 769px) {
  .gacha-stock-section { padding: 24px 40px 0; }
  .gacha-stock-inner { padding: 20px 24px; }
  .gacha-stock-label { font-size: 10px; }
  .gacha-stock-count { font-size: 16px; }
  .gacha-stock-bar { height: 12px; }
}

/* ================================================
   Gacha Roll Animation (Enhanced)
   ================================================ */

/* --- Overlay --- */
.gacha-anim-overlay {
  position: fixed;
  inset: 0;
  z-index: 25000;
  background: radial-gradient(ellipse at center, rgba(5,5,15,0.94) 0%, rgba(0,0,0,0.99) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow: hidden;
}

.gacha-anim-overlay.active {
  opacity: 1;
  visibility: visible;
}

.gacha-anim-overlay.fading {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Screen shake on final impact */
.gacha-anim-overlay.impact-shake {
  animation: gachaScreenShake 0.35s ease-out;
}

@keyframes gachaScreenShake {
  0% { transform: translate(0, 0); }
  10% { transform: translate(-5px, 4px); }
  20% { transform: translate(4px, -5px); }
  30% { transform: translate(-4px, -3px); }
  40% { transform: translate(5px, 3px); }
  50% { transform: translate(-3px, 4px); }
  60% { transform: translate(3px, -3px); }
  70% { transform: translate(-2px, -2px); }
  80% { transform: translate(2px, 2px); }
  90% { transform: translate(-1px, 1px); }
  100% { transform: translate(0, 0); }
}

/* --- Tap to Start --- */
.gacha-anim-tap {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gacha-anim-tap.visible {
  opacity: 1;
  visibility: visible;
}

.gacha-anim-tap-text {
  font-family: var(--font-heading);
  font-size: 16px;
  letter-spacing: 6px;
  color: rgba(255, 255, 255, 0.6);
  animation: gachaTapPulse 1.8s ease-in-out infinite;
  text-transform: uppercase;
}

@keyframes gachaTapPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

/* --- Video Element --- */
.gacha-anim-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.gacha-anim-video.active {
  opacity: 1;
}

/* --- Blackout (GOD freeze — instant blackout) --- */
.gacha-anim-blackout {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  z-index: 5;
  pointer-events: none;
  transition: none;
}

.gacha-anim-blackout.active {
  opacity: 1;
}

/* --- 激熱 Text (GOD freeze premium) --- */
.gacha-anim-gekiatsu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-family: var(--font-heading);
  font-size: 80px;
  font-weight: 900;
  letter-spacing: 16px;
  color: #ff3333;
  opacity: 0;
  z-index: 6;
  white-space: nowrap;
  text-shadow:
    0 0 20px rgba(255, 51, 51, 0.8),
    0 0 60px rgba(255, 51, 51, 0.6),
    0 0 120px rgba(255, 100, 0, 0.4),
    0 0 200px rgba(255, 50, 0, 0.3);
  filter: brightness(1.2);
}

.gacha-anim-gekiatsu.visible {
  animation: gekiatsuEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             gekiatsuGlow 0.8s ease-in-out 0.5s infinite alternate,
             gekiatsuShake 0.06s linear 0.5s infinite;
}

@keyframes gekiatsuEntrance {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4);
    filter: brightness(3) blur(8px);
  }
  60% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.9);
    filter: brightness(1.5) blur(0);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: brightness(1.2) blur(0);
  }
}

@keyframes gekiatsuGlow {
  0% {
    text-shadow:
      0 0 20px rgba(255, 51, 51, 0.8),
      0 0 60px rgba(255, 51, 51, 0.6),
      0 0 120px rgba(255, 100, 0, 0.4);
    color: #ff3333;
  }
  100% {
    text-shadow:
      0 0 30px rgba(255, 200, 0, 0.9),
      0 0 80px rgba(255, 150, 0, 0.7),
      0 0 160px rgba(255, 80, 0, 0.5);
    color: #ff6600;
  }
}

@keyframes gekiatsuShake {
  0% { margin-left: 0; margin-top: 0; }
  25% { margin-left: -3px; margin-top: 2px; }
  50% { margin-left: 2px; margin-top: -3px; }
  75% { margin-left: -2px; margin-top: -1px; }
  100% { margin-left: 3px; margin-top: 1px; }
}

@media (max-width: 480px) {
  .gacha-anim-gekiatsu { font-size: 48px; letter-spacing: 8px; }
}

/* --- Flash Effect --- */
.gacha-anim-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
  background: rgba(255, 255, 255, 0.7);
}

.gacha-anim-flash.mini {
  animation: gachaFlashMini 0.18s ease-out forwards;
}

.gacha-anim-flash.big {
  animation: gachaFlashBig 0.8s ease-out forwards;
}

@keyframes gachaFlashMini {
  0% { opacity: 0.35; }
  100% { opacity: 0; }
}

@keyframes gachaFlashBig {
  0% { opacity: 0.85; }
  20% { opacity: 0.4; }
  100% { opacity: 0; }
}

/* --- Grade Text --- */
.gacha-anim-grade {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(3);
  font-family: var(--font-heading);
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 12px;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  pointer-events: none;
}

.gacha-anim-grade.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* --- Skip Button --- */
.gacha-anim-skip {
  position: absolute;
  bottom: 32px;
  right: 32px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.35);
  font-family: var(--font-heading);
  font-size: 10px;
  letter-spacing: 3px;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 20;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.gacha-anim-skip:hover {
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}

/* ================================================
   Enhanced Result Modal (Card Reveal)
   ================================================ */

.gacha-result-item.reveal {
  opacity: 0;
  transform: perspective(600px) rotateY(90deg) scale(0.8);
  animation: gachaCardReveal 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: var(--reveal-delay, 0s);
}

@keyframes gachaCardReveal {
  0% {
    opacity: 0;
    transform: perspective(600px) rotateY(90deg) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: perspective(600px) rotateY(-8deg) scale(1.06);
  }
  100% {
    opacity: 1;
    transform: perspective(600px) rotateY(0) scale(1);
  }
}

/* Grade-specific glow on result items */
.gacha-result-item[data-grade="SS"] {
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.2), 0 0 40px rgba(255, 215, 0, 0.1);
}

.gacha-result-item[data-grade="S"] {
  border-color: rgba(255, 107, 107, 0.45);
  box-shadow: 0 0 16px rgba(255, 107, 107, 0.15), 0 0 32px rgba(255, 107, 107, 0.08);
}

.gacha-result-item[data-grade="A"] {
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.12);
}

.gacha-result-item[data-grade="B"] {
  border-color: rgba(96, 165, 250, 0.25);
}

/* SS shimmer effect */
.gacha-result-item[data-grade="SS"]::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    transparent 20%,
    rgba(255, 215, 0, 0.12) 40%,
    rgba(255, 215, 0, 0.35) 50%,
    rgba(255, 215, 0, 0.12) 60%,
    transparent 80%
  );
  background-size: 200% 200%;
  animation: gachaSSShimmer 2s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

/* S subtle shimmer */
.gacha-result-item[data-grade="S"]::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(255, 107, 107, 0.1) 45%,
    rgba(255, 107, 107, 0.2) 50%,
    rgba(255, 107, 107, 0.1) 55%,
    transparent 70%
  );
  background-size: 200% 200%;
  animation: gachaSSShimmer 2.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes gachaSSShimmer {
  0% { background-position: 200% 200%; }
  100% { background-position: -200% -200%; }
}

/* ハズレ (miss) result item */
.gacha-result-item[data-grade="miss"],
.gacha-result-item--miss {
  border-color: rgba(255, 255, 255, 0.04);
  opacity: 0.45;
}
.gacha-result-item--miss .gacha-result-item-img {
  background: rgba(255, 255, 255, 0.01);
}
.gacha-result-item--miss .gacha-result-item-img svg {
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.18);
}

/* Prize reward info on result cards */
.gacha-result-item-reward {
  font-size: 11px;
  color: #6ec6ff;
  background: rgba(110, 198, 255, 0.08);
  border: 1px solid rgba(110, 198, 255, 0.2);
  border-radius: 4px;
  padding: 4px 6px;
  margin: 4px 6px 6px;
  word-break: break-all;
  white-space: pre-wrap;
}

/* --- Inline Claim Review (on result cards) --- */
.gacha-claim-btn {
  display: block;
  width: calc(100% - 12px);
  margin: 4px 6px 6px;
  padding: 6px 0;
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.3);
  border-radius: 4px;
  color: var(--gold, #c9a84c);
  font-size: 10px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gacha-claim-btn:hover {
  background: rgba(201, 168, 76, 0.1);
  border-color: rgba(201, 168, 76, 0.5);
}

.gacha-claim-form {
  padding: 8px 6px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gacha-claim-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 6px;
}

.gacha-claim-star {
  font-size: 18px;
  color: #333;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.gacha-claim-star:hover,
.gacha-claim-star.hovered {
  color: rgba(201, 168, 76, 0.6);
  transform: scale(1.15);
}

.gacha-claim-star.selected {
  color: var(--gold, #c9a84c);
}

.gacha-claim-comment {
  width: 100%;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-family: var(--font-body, sans-serif);
  resize: vertical;
  min-height: 40px;
  box-sizing: border-box;
}

.gacha-claim-comment:focus {
  outline: none;
  border-color: rgba(201, 168, 76, 0.4);
}

.gacha-claim-comment::placeholder {
  color: rgba(136, 136, 136, 0.5);
}

.gacha-claim-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 6px;
}

.gacha-claim-error {
  font-size: 10px;
  color: #dc2626;
  flex: 1;
}

.gacha-claim-submit {
  padding: 5px 14px;
  background: linear-gradient(135deg, #8a6d1f 0%, #c9a84c 100%);
  border: none;
  border-radius: 4px;
  color: #0a0a0a;
  font-weight: 600;
  font-size: 10px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.gacha-claim-submit:hover {
  opacity: 0.85;
}

.gacha-claim-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gacha-claim-done {
  text-align: center;
  font-size: 11px;
  color: var(--gold, #c9a84c);
  padding: 6px 0;
  letter-spacing: 1px;
}

/* ================================================
   Animation Responsive
   ================================================ */
@media (min-width: 769px) {
  .gacha-anim-grade { font-size: 80px; }
}
