/* Store Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#storeApp {
  min-height: 100vh;
  background: linear-gradient(to bottom right, rgb(248, 250, 252), rgb(241, 245, 249));
}

.store-header {
  position: relative;
  height: 16rem;
  overflow: hidden;
  border-bottom: 4px solid rgb(20, 184, 166);
}

.store-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.store-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
}

.store-preview-content {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-avatar {
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1rem;
  border-radius: 9999px;
  border: 4px solid white;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  background: white;
}

.preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-points {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-radius: 9999px;
  padding: 0.5rem 1.5rem;
  display: inline-block;
}

.points-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.star-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: rgb(234, 179, 8);
  fill: rgb(234, 179, 8);
}

.points-text {
  font-size: 1.25rem;
  font-weight: bold;
  color: rgb(30, 41, 59);
}

.store-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.store-title-section {
  text-align: center;
  margin-bottom: 2rem;
}

.store-title {
  font-size: 2.25rem;
  font-weight: bold;
  color: rgb(30, 41, 59);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.cart-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: rgb(20, 184, 166);
}

.store-subtitle {
  color: rgb(100, 116, 139);
}

.store-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tab-button {
  padding: 0.75rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.tab-button.active {
  background: rgb(20, 184, 166);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.tab-button:not(.active) {
  background: white;
  color: rgb(100, 116, 139);
}

.tab-button:not(.active):hover {
  background: rgb(241, 245, 249);
}

.filter-section {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  font-size: 0.875rem;
}

.filter-button.active {
  color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.filter-button:not(.active) {
  background: white;
  color: rgb(100, 116, 139);
}

.filter-button:not(.active):hover {
  background: rgb(241, 245, 249);
}

.filter-button.legendary {
  background: linear-gradient(to right, rgb(168, 85, 247), rgb(236, 72, 153));
}

.filter-button.premium {
  background: linear-gradient(to right, rgb(59, 130, 246), rgb(6, 182, 212));
}

.filter-button.rare {
  background: linear-gradient(to right, rgb(34, 197, 94), rgb(20, 184, 166));
}

.filter-button.common {
  background: linear-gradient(to right, rgb(156, 163, 175), rgb(107, 114, 128));
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.item-card {
  position: relative;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  cursor: pointer;
  border: 2px solid rgb(226, 232, 240);
}

.item-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.item-card.current {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.item-card.owned {
  border-color: rgb(34, 197, 94);
}

.item-card.locked {
  border-color: rgb(226, 232, 240);
  opacity: 0.6;
}

.item-card.locked:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.item-image {
  position: relative;
  height: 12rem;
  overflow: hidden;
  background: rgb(241, 245, 249);
}

.emoji-display {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.color-display {
  width: 100%;
  height: 100%;
}

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

.item-image.blurred img {
  filter: blur(4px);
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
}

.lock-icon {
  width: 3rem;
  height: 3rem;
  color: white;
}

.badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.badge.current {
  background: rgb(20, 184, 166);
}

.badge.owned {
  background: rgb(34, 197, 94);
}

.check-icon {
  width: 1rem;
  height: 1rem;
}

.item-info {
  padding: 1rem;
}

.tier-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: bold;
  color: white;
  margin-bottom: 0.5rem;
}

.tier-badge.legendary {
  background: linear-gradient(to right, rgb(168, 85, 247), rgb(236, 72, 153));
}

.tier-badge.premium {
  background: linear-gradient(to right, rgb(59, 130, 246), rgb(6, 182, 212));
}

.tier-badge.rare {
  background: linear-gradient(to right, rgb(34, 197, 94), rgb(20, 184, 166));
}

.tier-badge.common {
  background: linear-gradient(to right, rgb(156, 163, 175), rgb(107, 114, 128));
}

.item-name {
  font-weight: bold;
  color: rgb(30, 41, 59);
  margin-bottom: 0.5rem;
}

.item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-price {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.price-star {
  width: 1.25rem;
  height: 1.25rem;
  color: rgb(234, 179, 8);
  fill: rgb(234, 179, 8);
}

.price-value {
  font-weight: bold;
  color: rgb(30, 41, 59);
}

.item-status {
  font-size: 0.875rem;
  font-weight: 500;
}

.item-status.current {
  color: rgb(20, 184, 166);
}

.item-status.owned {
  color: rgb(34, 197, 94);
}

.item-status.available {
  color: rgb(20, 184, 166);
}

.item-status.locked {
  color: rgb(220, 38, 38);
}

/* Modal Styles */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.modal.with-bg-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.3;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 28rem;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
  font-size: 1.5rem;
  font-weight: bold;
  color: rgb(30, 41, 59);
  margin-bottom: 1rem;
  text-align: center;
}

.modal-body {
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-emoji-preview {
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1rem;
  border-radius: 0.75rem;
  border: 4px solid rgb(20, 184, 166);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.modal-bg-preview {
  width: 100%;
  height: 8rem;
  margin: 0 auto 1rem;
  border-radius: 0.75rem;
  border: 4px solid rgb(20, 184, 166);
}

.modal-image {
  width: 8rem;
  height: 8rem;
  margin: 0 auto 1rem;
  border-radius: 0.75rem;
  object-fit: cover;
  border: 4px solid rgb(20, 184, 166);
}

.modal-text {
  font-size: 1.125rem;
  color: rgb(71, 85, 105);
  margin-bottom: 0.5rem;
}

.modal-item-name {
  font-size: 1.5rem;
  font-weight: bold;
  color: rgb(20, 184, 166);
  margin-bottom: 0.5rem;
}

.modal-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.25rem;
}

.modal-remaining {
  font-size: 0.875rem;
  color: rgb(100, 116, 139);
  margin-top: 0.5rem;
}

.error-icon-container {
  width: 5rem;
  height: 5rem;
  background: rgb(254, 226, 226);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.error-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: rgb(239, 68, 68);
}

.error-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: rgb(30, 41, 59);
  margin-bottom: 0.5rem;
}

.error-message {
  color: rgb(100, 116, 139);
  margin-bottom: 1rem;
}

.error-details {
  background: rgb(248, 250, 252);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.error-item-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(30, 41, 59);
  margin-bottom: 0.5rem;
}

.error-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: 1.125rem;
}

.comparison-item {
  text-align: center;
}

.comparison-label {
  font-size: 0.875rem;
  color: rgb(100, 116, 139);
  margin-bottom: 0.25rem;
}

.comparison-value {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: bold;
}

.comparison-value.required {
  color: rgb(220, 38, 38);
}

.comparison-value.available {
  color: rgb(30, 41, 59);
}

.shortage-text {
  font-size: 0.875rem;
  color: rgb(220, 38, 38);
  font-weight: 500;
  margin-top: 0.75rem;
}

.encouragement-text {
  font-size: 0.875rem;
  color: rgb(100, 116, 139);
}

.modal-buttons {
  display: flex;
  gap: 0.75rem;
}

.modal-button {
  flex: 1;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.modal-button.cancel {
  background: rgb(226, 232, 240);
  color: rgb(71, 85, 105);
}

.modal-button.cancel:hover {
  background: rgb(203, 213, 225);
}

.modal-button.confirm {
  background: rgb(20, 184, 166);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.modal-button.confirm:hover {
  background: rgb(17, 160, 145);
}

.modal-button.close {
  background: rgb(226, 232, 240);
  color: rgb(71, 85, 105);
  width: 100%;
}

.modal-button.close:hover {
  background: rgb(203, 213, 225);
}

/* Responsive */
@media (max-width: 640px) {
  .items-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
  
  .item-image {
    height: 10rem;
  }
  
  .store-title {
    font-size: 1.875rem;
  }
}