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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  color: #fff;
  line-height: 1.6;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #1da1f2, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.description {
  color: #a0a0a0;
  font-size: 0.95rem;
}

.upload-area {
  border: 3px dashed #1da1f2;
  border-radius: 16px;
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(29, 161, 242, 0.05);
}

.upload-area:hover,
.upload-area.dragover {
  background: rgba(29, 161, 242, 0.15);
  border-color: #00d4ff;
  transform: scale(1.01);
}

.upload-icon {
  width: 64px;
  height: 64px;
  color: #1da1f2;
  margin-bottom: 16px;
}

.upload-content p {
  color: #ccc;
  font-size: 1rem;
}

.preview-section {
  margin-top: 30px;
}

.original-preview {
  text-align: center;
  margin-bottom: 24px;
}

.original-preview h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: #a0a0a0;
}

.original-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.preview-container {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
}

.dual-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.preview-content h3 {
  text-align: center;
  font-size: 1rem;
  color: #a0a0a0;
  margin-bottom: 16px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  max-width: 500px;
  margin: 0 auto;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.tile-item canvas {
  width: 100%;
  height: auto;
  display: block;
}

.vertical-grid {
  display: flex;
  flex-direction: column;
  gap: 90px;
  max-width: 300px;
  margin: 0 auto;
}

.vertical-item {
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.vertical-item canvas {
  width: 100%;
  height: auto;
  display: block;
}

.download-section {
  text-align: center;
  margin-bottom: 20px;
}

.download-btn {
  padding: 16px 32px;
  font-size: 1.1rem;
  background: linear-gradient(90deg, #1da1f2, #00d4ff);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 16px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(29, 161, 242, 0.4);
}

.individual-downloads {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.download-single {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.download-single:hover {
  background: rgba(255, 255, 255, 0.2);
}

.reset-btn {
  display: block;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  padding: 14px;
  background: transparent;
  color: #a0a0a0;
  border: 1px solid #a0a0a0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: #fff;
}

footer {
  text-align: center;
  padding: 30px 20px;
  color: #666;
  font-size: 0.85rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .dual-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 16px;
  }

  header h1 {
    font-size: 1.4rem;
  }

  .description {
    font-size: 0.85rem;
  }

  .upload-area {
    padding: 40px 16px;
  }

  .upload-icon {
    width: 48px;
    height: 48px;
  }

  .upload-content p {
    font-size: 0.9rem;
  }

  .tile-grid {
    max-width: 100%;
  }

  .vertical-grid {
    max-width: 100%;
  }

  .download-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
  }

  .individual-downloads {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .download-single {
    width: 100%;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preview-section {
  animation: fadeIn 0.5s ease;
}
