/* Roulette Reel, Cards, Controls & Winner Modal */

/* Case Panel Box */
.case-panel {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 22, 28, 0.85);
}

.case-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.case-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Horizontal Reel Window */
.reel-window {
  height: 330px;
  position: relative;
  overflow: hidden;
  padding: 20px 0;
  background: repeating-linear-gradient(90deg, transparent 0, transparent 39px, rgba(255, 255, 255, 0.015) 40px);
}

.reel-track {
  position: relative;
  height: 290px;
  will-change: transform;
  transform: translate3d(-400px, 0, 0);
}

/* Center Selector Line / Needle */
.selector-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.8);
}

.selector-line::before,
.selector-line::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
}

.selector-line::before {
  top: 0;
  border-top: 12px solid #ffd700;
}

.selector-line::after {
  bottom: 0;
  border-bottom: 12px solid #ffd700;
}

/* Left & Right Edge Fades */
.reel-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  pointer-events: none;
  z-index: 10;
}

.reel-fade.left {
  left: 0;
  background: linear-gradient(90deg, rgba(14, 17, 21, 0.95), transparent);
}

.reel-fade.right {
  right: 0;
  background: linear-gradient(-90deg, rgba(14, 17, 21, 0.95), transparent);
}

/* Video Card */
.video-card {
  position: absolute;
  top: 0;
  width: 240px;
  height: 290px;
  border-radius: 8px;
  overflow: hidden;
  background: #181d24;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 4px solid var(--card-rarity, var(--rarity-common));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}

.video-card-thumb {
  position: relative;
  width: 100%;
  height: 210px;
  background-color: #12151a;
  overflow: hidden;
}

.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.video-card:hover .video-card-thumb img {
  transform: scale(1.05);
}

.video-quality-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 2;
}

.video-views-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #d1d5db;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

.video-card-info {
  padding: 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, #181d24, #12151b);
}

.video-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.video-card-rarity {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--card-rarity, var(--rarity-common));
  margin-top: 4px;
}

/* Control Bar */
.control-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
}

.select-input {
  height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  background: #171b22;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f3f4f6;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-input:focus {
  border-color: #ffd700;
}

.spin-action-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.spin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 250px;
  height: 56px;
  padding: 0 32px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #0d1117;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.spin-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.spin-btn:disabled {
  filter: grayscale(0.5);
  opacity: 0.7;
  cursor: wait;
}

/* Winner Dialog Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 10, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(520px, 94vw);
  background: #151a22;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--winner-rarity, #ffd700);
  box-shadow: 0 0 50px color-mix(in srgb, var(--winner-rarity, #ffd700) 40%, transparent);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

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

.modal-header {
  padding: 16px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--winner-rarity, #ffd700);
}

.modal-poster {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  background: #0d1015;
}

.modal-body {
  padding: 20px;
  text-align: center;
}

.modal-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.3;
}

.modal-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 24px;
}

.modal-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.watch-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  background: #ffd700;
  color: #0b0e14;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.35);
  transition: transform 0.2s, filter 0.2s;
}

.watch-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.close-btn {
  height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e5e7eb;
  transition: background 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Catalog / Inventory Section */
.catalog-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 36px;
}

.catalog-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.catalog-heading-title {
  font-size: 22px;
  font-weight: 800;
}

.catalog-heading-title span {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #9ca3af;
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
}

.rarity-legend-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.rarity-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: #9ca3af;
}

.rarity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pill-color, #4b69ff);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.catalog-item {
  background: #14181f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 3px solid var(--card-rarity, var(--rarity-common));
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.catalog-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.catalog-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #0d1015;
}

.catalog-info {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.catalog-name {
  font-size: 12px;
  font-weight: 700;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-views {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 640px) {
  .reel-window {
    height: 270px;
    padding: 10px 0;
  }
  .video-card {
    height: 250px;
    width: 210px;
  }
  .video-card-thumb {
    height: 170px;
  }
  .control-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .spin-btn {
    width: 100%;
  }
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
