:root {
  --bg-primary: #0a0e27;
  --bg-secondary: #151932;
  --bg-card: #1a1f3a;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --purple: #a855f7;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  max-width: 100%;
  overflow-wrap: break-word;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
  padding: 24px 32px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.1);
  position: relative;
}

.logo {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05) rotate(5deg);
}

.header-content {
  flex: 1;
}

h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  color: var(--accent-blue);
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.header-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.credits-btn {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.credits-btn:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

#openMiniBtn {
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border: none;
  color: white;
}

#openMiniBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.lang-select {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.lang-select:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr 380px;
  }
}

.card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.offers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .offers-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.offer-panel {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(59, 130, 246, 0.05);
  max-width: 100%;
}

.offer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.offer-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.add-btn {
  background: var(--accent-blue);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 24px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.items-list {
  flex: 1;
  max-height: 360px;
  min-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 8px;
  margin-bottom: 12px;
  scroll-behavior: smooth;
  max-width: 100%;
}

.items-list::-webkit-scrollbar {
  width: 6px;
}

.items-list::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.1);
  border-radius: 3px;
}

.items-list::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 3px;
}

.item-card {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  transition: border-color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  position: relative;
  min-height: 80px;
  max-width: 100%;
}

.item-card.collector {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.item-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.item-card.collector:hover {
  border-color: rgba(168, 85, 247, 0.5);
}

.item-img-container {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.item-img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.item-card:hover .item-img {
  transform: scale(1.1);
}

.collector-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--purple);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.item-price {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--warning);
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 31, 58, 0.95);
  padding: 2.5px 6.5px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  z-index: 2;
  white-space: nowrap;
  min-width: 52px;
  text-align: center;
  line-height: 1.3;
}

.item-card.collector .item-price {
  background: rgba(26, 31, 58, 0.95);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
  transition: color 0.3s ease;
}

.item-card:hover .item-name {
  color: var(--accent-cyan);
}

.item-card.collector:hover .item-name {
  color: var(--purple);
}

.item-demand {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

.item-card.collector .item-demand {
  color: rgba(168, 85, 247, 0.9);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.qty-btn {
  width: 28px;
  height: 28px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.item-card.collector .qty-btn {
  background: rgba(168, 85, 247, 0.2);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: var(--purple);
}

.qty-btn:hover {
  background: rgba(59, 130, 246, 0.4);
  border-color: var(--accent-blue);
  transform: scale(1.1);
}

.item-card.collector .qty-btn:hover {
  background: rgba(168, 85, 247, 0.4);
  border-color: var(--purple);
}

.remove-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.remove-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  border-color: var(--danger);
  transform: scale(1.1);
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 20px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.7;
}

.offer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 13px;
}

.footer-value {
  background: rgba(59, 130, 246, 0.15);
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  color: var(--accent-cyan);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.summary-panel {
  position: sticky;
  top: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.summary-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

.summary-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-cyan);
}

.analysis-boxes {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.analysis-box {
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid transparent;
  position: relative;
  cursor: help;
}

.analysis-box:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 10px;
  border-radius: 8px;
  font-size: 11px;
  white-space: pre-line;
  z-index: 1000;
  min-width: 200px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.analysis-box h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  font-weight: 600;
  opacity: 0.9;
}

.analysis-box .value {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.analysis-box .label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
}

.profit-win {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}

.profit-lose {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.profit-even {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-secondary);
  border-color: rgba(148, 163, 184, 0.3);
}

.action-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 13px;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.btn-secondary {
  background: transparent;
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent-cyan);
  text-align: center;
}

.modal-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input,
.filter-select,
.sort-select {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  flex: 1;
  min-width: 180px;
  font-weight: 500;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.search-input:focus,
.filter-select:focus,
.sort-select:focus {
  outline: none;
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.close-btn {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.close-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.1);
  border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 4px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

@media (min-width: 768px) {
  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}

@media (max-width: 480px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.catalog-card {
  background: var(--bg-card);
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid rgba(59, 130, 246, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.catalog-card.collector {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.catalog-card.collector:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.2);
}

.catalog-card.value-pending {
  border: 1px solid rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.05);
}

.catalog-magnifier {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.3s ease;
}

.catalog-magnifier:hover {
  transform: scale(1.15);
}

.magnifier-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.catalog-img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  display: block;
  background: rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.catalog-card:hover .catalog-img {
  transform: scale(1.05);
}

.catalog-info {
  padding: 14px;
}

.catalog-category {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-right: 5px;
}

.catalog-category.collector-category {
  background: rgba(168, 85, 247, 0.3);
  color: var(--purple);
}

.catalog-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.catalog-card:hover .catalog-name {
  color: var(--accent-cyan);
}

.catalog-card.collector:hover .catalog-name {
  color: var(--purple);
}

.catalog-details {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(6, 182, 212, 0.05) 100%);
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.catalog-card.collector .catalog-details {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px solid rgba(168, 85, 247, 0.1);
}

.catalog-detail-row {
  display: flex;
  gap: 4px;
  font-size: 10px;
  line-height: 1.3;
}

.catalog-detail-label {
  font-weight: 700;
  color: var(--accent-blue);
  white-space: nowrap;
}

.catalog-card.collector .catalog-detail-label {
  color: var(--purple);
}

.catalog-detail-value {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-details-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.catalog-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 10px;
}

.catalog-price.value-pending-text {
  color: var(--purple);
}

.catalog-card.collector .catalog-price {
  color: var(--purple);
}

.qty-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  background: rgba(59, 130, 246, 0.15);
  padding: 6px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.catalog-card.collector .qty-display {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.qty-value {
  font-weight: 700;
  min-width: 24px;
  text-align: center;
  color: var(--accent-blue);
}

.catalog-card.collector .qty-value {
  color: var(--purple);
}

.detail-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1001;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.detail-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 95%;
  max-width: 400px;
  max-height: 70vh;
  padding: 16px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
}

.detail-img {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 12px;
}

.detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 10px;
  text-align: center;
}

.detail-info-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.detail-info {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.detail-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--warning);
  margin-bottom: 10px;
}

.detail-price.value-pending-text {
  color: var(--purple);
}

.changelog-modal,
.credits-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.changelog-content,
.credits-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 95%;
  max-width: 600px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.changelog-header,
.credits-header {
  padding: 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.changelog-title,
.credits-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent-cyan);
  text-align: center;
}

.changelog-body,
.credits-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.changelog-body::-webkit-scrollbar,
.credits-body::-webkit-scrollbar {
  width: 6px;
}

.changelog-body::-webkit-scrollbar-track,
.credits-body::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.1);
  border-radius: 3px;
}

.changelog-body::-webkit-scrollbar-thumb,
.credits-body::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 3px;
}

.changelog-lang {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.changelog-text {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  margin-bottom: 16px;
}

.changelog-text .emoji {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-left: 8px;
}

.changelog-footer,
.credits-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  text-align: center;
}

.ok-btn {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-right: 10px;
}

.ok-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.hide-changelog-btn {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--text-primary);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.hide-changelog-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.credits-section {
  margin-bottom: 20px;
}

.credits-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.credits-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(59, 130, 246, 0.1);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.credits-user:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.3);
}

.credits-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-blue);
}

.credits-info {
  flex: 1;
}

.credits-username {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.credits-role {
  font-size: 12px;
  color: var(--text-secondary);
}

.confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1002;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.confirm-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 95%;
  max-width: 400px;
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent-cyan);
}

.confirm-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.confirm-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-yes,
.confirm-no {
  padding: 10px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.confirm-yes {
  background: var(--danger);
  color: white;
  border: none;
}

.confirm-yes:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.confirm-no {
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: var(--text-primary);
}

.confirm-no:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.lang-prompt-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1001;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.lang-prompt-content {
  background: var(--bg-secondary);
  border-radius: 16px;
  width: 95%;
  max-width: 400px;
  padding: 24px;
  text-align: center;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.lang-prompt-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent-cyan);
}

.lang-prompt-select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 16px;
}

.lang-prompt-btn {
  background: var(--accent-blue);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lang-prompt-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.discord-section {
  margin-top: 32px;
  padding: 24px;
  background: rgba(88, 101, 242, 0.1);
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(88, 101, 242, 0.2);
}

.discord-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #5865F2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.discord-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.discord-link {
  background: #5865F2;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 13px;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  background-size: 200% 200%;
  animation: gradientFlow 3s ease infinite;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.discord-link:hover {
  transform: scale(1.05);
}

.discord-img {
  width: 1.5em;
  height: 1.5em;
  object-fit: cover;
  border-radius: 4px;
}

.abracadabra-btn {
  background: linear-gradient(45deg, #1e3a8a, #3b82f6, #60a5fa, #3b82f6);
}

.trade-btn {
  background: linear-gradient(45deg, #f97316, #fbbf24, #fcd34d, #fbbf24);
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (max-width: 1200px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .summary-panel {
    position: relative;
    top: 0;
  }
}

@media (max-width: 768px) {
  body {
    padding: 0;
  }
  .container {
    padding: 10px;
    max-width: 100%;
    overflow-x: hidden;
  }
  header {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 12px;
    margin-bottom: 16px;
  }
  .header-buttons {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .credits-btn,
  .lang-select {
    flex: 0 1 auto;
    min-width: 90px;
    padding: 8px 10px;
    font-size: 12px;
  }
  #openMiniBtn {
    min-width: 70px;
  }
  .logo {
    width: 50px;
    height: 50px;
  }
  h1 {
    font-size: 24px;
  }
  .subtitle {
    font-size: 12px;
  }
  .main-layout {
    grid-template-columns: 1fr;
  }
  .summary-panel {
    position: relative;
    top: 0;
  }
  .offers-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .card {
    padding: 12px;
  }
  .offer-panel {
    min-height: 300px;
    padding: 12px;
  }
  .items-list {
    max-height: 300px;
    min-height: 300px;
  }
  .offer-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  .offer-title {
    font-size: 14px;
  }
  .add-btn {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  .item-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    padding: 8px !important;
    gap: 8px;
  }
  .item-card.collector {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
  }
  .item-img-container {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    grid-row: unset;
    grid-column: unset;
    position: relative;
  }
  .item-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
  }
  .collector-badge {
    width: 18px;
    height: 18px;
    font-size: 10px;
    top: -6px;
    right: -6px;
  }
  .item-price {
    font-size: 12px;
    bottom: -10px;
    padding: 3px 6px;
    min-width: 50px;
  }
  .item-info {
    flex: 1;
    min-width: 0;
    grid-column: unset;
    grid-row: unset;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .item-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: normal;
    line-height: 1.3;
  }
  .item-demand {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    word-wrap: normal;
    line-height: 1.3;
    margin-top: 2px;
  }
  .qty-controls {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 6px;
    margin-top: 0 !important;
    width: auto !important;
    justify-content: flex-start;
  }
  .qty-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
    background: rgba(59, 130, 246, 0.3);
  }
  .item-card.collector .qty-btn {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: var(--purple);
  }
  .remove-btn {
    margin-left: 0 !important;
  }
  .offer-footer {
    font-size: 12px;
    padding-top: 12px;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .footer-value {
    padding: 4px 10px;
    font-size: 12px;
  }
  .summary-row {
    padding: 12px;
  }
  .summary-label {
    font-size: 12px;
  }
  .summary-value {
    font-size: 20px;
  }
  .analysis-box {
    padding: 12px;
  }
  .analysis-box h3 {
    font-size: 11px;
  }
  .analysis-box .value {
    font-size: 20px;
  }
  .analysis-box .label {
    font-size: 11px;
  }
  .action-btn {
    padding: 10px;
    font-size: 12px;
  }
  .modal-content {
    width: 90%;
    max-width: 90%;
    max-height: 70vh;
    border-radius: 8px;
    margin: 0 auto;
    overflow-x: hidden;
  }
  .detail-content,
  .lang-prompt-content,
  .confirm-content {
    width: 90%;
    max-width: 90%;
    max-height: 70vh;
    border-radius: 8px;
    margin: 0 auto;
    overflow-x: hidden;
  }
  .changelog-content,
  .credits-content {
    width: 90%;
    max-width: 90%;
    max-height: 70vh;
    border-radius: 8px;
    margin: 0 auto;
  }
  .modal-header,
  .changelog-header,
  .credits-header {
    padding: 16px;
  }
  .modal-title,
  .changelog-title,
  .credits-title,
  .lang-prompt-title,
  .detail-title,
  .confirm-title {
    font-size: 18px;
    margin-bottom: 12px;
  }
  .modal-controls {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 8px;
    max-height: none !important;
  }
  .search-input,
  .filter-select,
  .sort-select,
  .close-btn {
    flex: 1 !important;
    min-width: 120px !important;
    max-width: 48% !important;
  }
  .filter-select,
  .sort-select {
    flex: 1;
    flex-basis: 48%;
    min-width: 120px;
    padding: 6px;
    font-size: 12px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    border-radius: 6px;
  }
  .close-btn {
    flex: 1;
    flex-basis: 48%;
    min-width: 120px;
    height: 32px;
    padding: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
  }
  .ok-btn,
  .hide-changelog-btn,
  .lang-prompt-select,
  .lang-prompt-btn {
    width: 100%;
    flex-basis: 100%;
    min-width: 0;
    padding: 8px;
    font-size: 13px;
    border-radius: 6px;
  }
  .modal-body,
  .changelog-body,
  .credits-body {
    padding: 12px;
    overflow-x: hidden;
  }
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .catalog-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    overflow: hidden;
  }
  .catalog-card.collector {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
  }
  .catalog-img {
    height: 90px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.3);
  }
  .catalog-info {
    padding: 6px;
  }
  .catalog-category {
    font-size: 7px;
    padding: 2px 5px;
    background: rgba(59, 130, 246, 0.3);
  }
  .catalog-card.collector .catalog-category {
    background: rgba(168, 85, 247, 0.3);
  }
  .catalog-name {
    font-size: 10px;
    margin-bottom: 4px;
    line-height: 1.3;
    min-height: 20px;
  }
  .catalog-details {
    font-size: 7px;
    margin-bottom: 6px;
    line-height: 1.3;
  }
  .catalog-details-header {
    font-size: 9px;
  }
  .catalog-price {
    font-size: 11px;
    margin-bottom: 6px;
  }
  .catalog-card.collector .catalog-price {
    color: var(--purple);
  }
  .qty-display {
    padding: 4px;
    gap: 5px;
    margin-top: 6px;
    background: rgba(59, 130, 246, 0.3);
  }
  .catalog-card.collector .qty-display {
    background: rgba(168, 85, 247, 0.15);
  }
  .qty-value {
    min-width: 18px;
    font-size: 11px;
  }
  .changelog-lang {
    font-size: 13px;
  }
  .changelog-text {
    font-size: 12px;
  }
  .changelog-text .emoji {
    width: 14px;
    height: 14px;
  }
  .discord-section {
    margin-top: 16px;
    padding: 16px;
  }
  .discord-title {
    font-size: 14px;
    margin-bottom: 12px;
  }
  .discord-links {
    flex-direction: column;
    gap: 10px;
  }
  .discord-link {
    padding: 10px 20px;
    font-size: 12px;
  }
  .detail-content {
    width: 90%;
    max-width: 90%;
    max-height: 70vh;
    border-radius: 8px;
    padding: 12px;
  }
  .detail-img {
    max-height: 100px;
    background: rgba(0, 0, 0, 0.3);
  }
  .detail-title {
    font-size: 16px;
  }
  .detail-info-header {
    font-size: 12px;
  }
  .detail-info {
    font-size: 11px;
  }
  .detail-price {
    font-size: 14px;
  }
  .credits-user {
    padding: 10px;
  }
  .credits-avatar {
    width: 40px;
    height: 40px;
  }
  .credits-username {
    font-size: 13px;
  }
  .credits-role {
    font-size: 11px;
  }
  .analysis-box:hover::after {
    bottom: auto;
    top: 100%;
    left: 0;
    transform: none;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .catalog-card {
    min-height: 200px;
  }
  .catalog-img {
    height: 100px;
  }
  .item-card {
    flex-wrap: wrap;
  }
  .qty-controls {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
  }
}