body {
  padding: 60px 30px 30px;
}

.collection-actions {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 100;
}

.collection-btn {
  padding: 5px 14px;
  background: linear-gradient(180deg, #fff 0%, #e8e8e8 100%);
  border: 1px solid #aaa;
  border-radius: 6px;
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 0 0 1px rgba(255,255,255,0.5) inset;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
  transition: all 0.15s;
}
.collection-btn:hover {
  background: linear-gradient(180deg, #f0f0f0 0%, #ddd 100%);
  border-color: #888;
}
.collection-btn:active {
  background: linear-gradient(180deg, #d0d0d0 0%, #c8c8c8 100%);
}

#content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
}

@media (max-width: 600px) {
  body { padding: 40px 12px 20px; }
  #content { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
  .nav-link { font-size: 12px; top: 10px; }
  .nav-link.right { right: 10px; }
  .nav-link.left { left: 10px; }
  .popup-card { width: 95%; max-width: 340px; }
  .popup-card > img { width: 130px; height: 130px; }
  .popup-info h2 { font-size: 16px; }
  .popup-info { padding: 0 16px 16px; }
}

.toy-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  cursor: pointer;
}

.toy-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.1));
}
.toy-item:hover img { transform: scale(1.15); filter: blur(2px) drop-shadow(0 2px 6px rgba(0,0,0,0.1)); }

.toy-item .tooltip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: none;
  color: black;
  font-size: clamp(14px, 4vw, 22px);
  font-weight: 900;
  padding: 0 4px;
  text-align: center;
  white-space: normal;
  word-wrap: break-word;
  width: 100%;
  overflow: hidden;
  text-transform: uppercase;
  line-height: 1.1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}
.toy-item:hover .tooltip { opacity: 1; }

.count-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #DA291C;
  color: white;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 10px;
  z-index: 5;
}

.empty {
  text-align: center;
  color: #999;
  font-size: 18px;
  margin-top: 120px;
  line-height: 2;
}
.empty a {
  color: #DA291C;
  font-weight: bold;
  text-decoration: none;
}
.empty a:hover { text-decoration: underline; }

/* Popup - Mac OS X Aqua style */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.popup-card {
  background: linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 3%, #f6f6f6 4%, #fafafa 50%, #ececec 100%);
  border-radius: 12px;
  border: 1px solid #999;
  padding: 0;
  max-width: 380px;
  width: 90%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.6) inset,
    0 8px 30px rgba(0,0,0,0.35),
    0 2px 8px rgba(0,0,0,0.2);
  overflow: hidden;
}

@keyframes popIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Aqua title bar */
.popup-card::before {
  content: '';
  display: block;
  width: 100%;
  height: 24px;
  background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 45%, #c8c8c8 55%, #c0c0c0 100%);
  border-bottom: 1px solid #aaa;
  flex-shrink: 0;
}

.popup-close {
  position: absolute;
  top: 5px;
  left: 10px;
  width: 14px;
  height: 14px;
  background: linear-gradient(180deg, #ff6058 0%, #e33e32 100%);
  border: 1px solid #cf3a2f;
  border-radius: 50%;
  font-size: 0;
  cursor: pointer;
  z-index: 5;
  transition: all 0.15s;
}
.popup-close:hover {
  background: linear-gradient(180deg, #ff7b72 0%, #e85046 100%);
}
.popup-close::after {
  content: '\00D7';
  font-size: 11px;
  color: #820b00;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
}

.popup-card > img {
  width: 160px;
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
  margin: 24px 0 16px;
}

.popup-info {
  width: 100%;
  text-align: center;
  padding: 0 28px 24px;
}

.popup-info h2 {
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 18px;
  color: #222;
  margin-bottom: 2px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.popup-set {
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #3366cc;
  font-weight: normal;
  margin-bottom: 14px;
}

.popup-details {
  width: 100%;
  border-top: 1px solid #c8c8c8;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popup-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
}

.detail-label {
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 11px;
  color: #888;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  color: #333;
}

.ebay-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 6px 18px;
  background: linear-gradient(180deg, #fff 0%, #e8e8e8 100%);
  border: 1px solid #aaa;
  border-radius: 6px;
  text-decoration: none;
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #333;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.15s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 0 0 1px rgba(255,255,255,0.5) inset;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}
.ebay-btn:hover {
  background: linear-gradient(180deg, #f0f0f0 0%, #ddd 100%);
  border-color: #888;
}
.ebay-btn:active {
  background: linear-gradient(180deg, #d0d0d0 0%, #c8c8c8 100%);
}
.ebay-btn img {
  height: 16px;
  width: auto;
}
