/* Cards */
.card {
  background: rgba(13, 18, 32, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(45, 140, 240, 0.12);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.card-body {
  padding: 20px;
}

/* Case card */
.case-card {
  background: rgba(13, 18, 32, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(45, 140, 240, 0.12);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  display: block;
  text-decoration: none;
  color: inherit;
}

.case-card:hover {
  border-color: rgba(45, 140, 240, 0.35);
  transform: translateY(-2px);
}

.case-card-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg-elevated);
}

.case-card-image-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 36px;
}

.case-card-body {
  padding: 16px;
}

.case-card-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.case-card-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--blue-primary);
  margin-bottom: 12px;
}

.case-card-items {
  display: flex;
  gap: 6px;
}

.case-card-item-preview {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
}

/* Item card */
.item-card {
  background: rgba(13, 18, 32, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(45, 140, 240, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s;
  position: relative;
}

.item-card:hover {
  border-color: rgba(45, 140, 240, 0.3);
}

.item-card-rarity-bar {
  height: 3px;
  width: 100%;
}

.item-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg-elevated);
}

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

.item-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-card-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-light);
  margin-bottom: 8px;
}

.item-card-rarity {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Rarity colors */
.rarity-white   { color: var(--rarity-white); }
.rarity-blue    { color: var(--rarity-blue); }
.rarity-purple  { color: var(--rarity-purple); }
.rarity-pink    { color: var(--rarity-pink); }
.rarity-red     { color: var(--rarity-red); }
.rarity-gold, .rarity-ancient { color: var(--rarity-gold); }
.rarity-legendary { color: var(--rarity-pink); }
.rarity-mythical  { color: var(--rarity-purple); }
.rarity-rare      { color: var(--rarity-blue); }
.rarity-uncommon  { color: var(--rarity-white); }

.bar-white   { background: var(--rarity-white); }
.bar-blue    { background: var(--rarity-blue); }
.bar-purple  { background: var(--rarity-purple); }
.bar-pink    { background: var(--rarity-pink); }
.bar-red     { background: var(--rarity-red); }
.bar-gold, .bar-ancient   { background: var(--rarity-gold); }
.bar-legendary { background: var(--rarity-pink); }
.bar-mythical  { background: var(--rarity-purple); }
.bar-rare      { background: var(--rarity-blue); }
.bar-uncommon  { background: var(--rarity-white); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--blue-primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #1A7AE0; transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: rgba(45, 140, 240, 0.1);
  color: var(--blue-light);
  border: 1px solid rgba(45, 140, 240, 0.2);
}
.btn-secondary:hover:not(:disabled) { background: rgba(45, 140, 240, 0.18); transform: translateY(-1px); }
.btn-secondary:active:not(:disabled) { transform: translateY(0); }

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, 0.2); }

.btn-success {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.btn-success:hover:not(:disabled) { background: rgba(34, 197, 94, 0.2); }

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 17px;
  border-radius: 12px;
}

.btn-block { width: 100%; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge-gold     { background: rgba(255, 214, 0, 0.15);  color: var(--rarity-gold); }
.badge-pink     { background: rgba(240, 98, 146, 0.15); color: var(--rarity-pink); }
.badge-purple   { background: rgba(171, 71, 188, 0.15); color: var(--rarity-purple); }
.badge-blue     { background: rgba(79, 195, 247, 0.15); color: var(--rarity-blue); }
.badge-white    { background: rgba(176, 190, 197, 0.15); color: var(--rarity-white); }
.badge-red      { background: rgba(239, 83, 80, 0.15);  color: var(--rarity-red); }
.badge-success  { background: rgba(34, 197, 94, 0.15);  color: var(--success); }
.badge-primary  { background: rgba(45, 140, 240, 0.15); color: var(--blue-primary); }

/* Forms */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid rgba(45, 140, 240, 0.15);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus {
  border-color: rgba(45, 140, 240, 0.5);
}

.form-input::placeholder { color: var(--text-muted); }

/* Amount presets */
.amount-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.amount-preset {
  background: var(--bg-elevated);
  border: 1px solid rgba(45, 140, 240, 0.15);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.amount-preset:hover,
.amount-preset.active {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
  background: rgba(45, 140, 240, 0.08);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid rgba(45, 140, 240, 0.15);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  transform: translateY(16px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
}

.modal-close:hover { color: var(--text-primary); }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid rgba(45, 140, 240, 0.15);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.2s ease;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--blue-primary); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Stat box */
.stat-box {
  background: rgba(13, 18, 32, 0.7);
  border: 1px solid rgba(45, 140, 240, 0.12);
  border-radius: 16px;
  padding: 20px 24px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.stat-value.blue { color: var(--blue-primary); }

/* Item pool table row */
.item-pool-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(45, 140, 240, 0.06);
}

.item-pool-row:last-child { border-bottom: none; }

.item-pool-img {
  width: 52px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.item-pool-info { flex: 1; min-width: 0; }

.item-pool-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-pool-chance {
  font-size: 12px;
  color: var(--text-muted);
}

.item-pool-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-light);
  flex-shrink: 0;
}

/* Hero */
.hero {
  text-align: center;
  padding: 80px 24px 64px;
  max-width: 700px;
  margin: 0 auto;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-title span { color: var(--blue-primary); }

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 48px 0;
}

.step {
  text-align: center;
  padding: 32px 24px;
  background: rgba(13, 18, 32, 0.7);
  border: 1px solid rgba(45, 140, 240, 0.1);
  border-radius: 16px;
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(45, 140, 240, 0.12);
  border: 1px solid rgba(45, 140, 240, 0.2);
  color: var(--blue-primary);
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-desc {
  color: var(--text-secondary);
  font-size: 14px;
}

@media (max-width: 768px) {
  .hero-title { font-size: 32px; }
  .steps { grid-template-columns: 1fr; gap: 12px; }
  .amount-presets { grid-template-columns: repeat(2, 1fr); }
  .modal { padding: 24px; }
}
