* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: #262A33;
  color: #FFFFFF;
  min-height: 100vh;
  padding: 80px 20px 40px; 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; 
}

.top-header {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: row; 
  justify-content: space-between; 
  align-items: flex-end; 
  margin-bottom: 24px; 
}

.logo-and-title {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 0; 
  width: auto;
}

.logo {
  max-width: 200px;
  height: auto;
  display: block;
}

.main-title {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

.powered {
  font-size: 14px;
  opacity: 0.7;
  white-space: nowrap;
  margin-bottom: 5px;
  align-self: auto;
}

.card {
  background: #2C313B;
  border-radius: 24px;
  border: 2px dashed #474747;
  padding: 60px 80px;
  width: 100%;
  max-width: 1100px;
  text-align: center;
}

.limit-info {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 40px;
  opacity: 0.9;
}

.limit-info strong {
  font-weight: 600;
}

.compression-mode {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 48px;
  align-items: center;
}

.compression-mode label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 17px;
  cursor: pointer;
  user-select: none;
  text-align: left;
  max-width: 400px;
}

input[type="radio"] {
  accent-color: #6366f1;
  transform: scale(1.5);
}

.drop-zone {
  border: 2px dashed #474747;
  border-radius: 12px;
  padding: 100px 40px;
  margin: 0 auto 40px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255,255,255,0.02);
  max-width: 600px;
  width: 100%;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: #777;
  background: rgba(255,255,255,0.04);
}

.drop-text {
  font-size: 20px;
  opacity: 0.85;
  line-height: 1.5;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
  max-width: 800px;
  width: 100%;
  justify-content: center;
}

.preview-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #1e2228;
}

.preview-item img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.75);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  cursor: pointer;
}

.remove-btn:hover {
  background: #ff4d4d;
}

.btn-primary {
  background: #6366f1;
  color: white;
  border: none;
  padding: 18px 48px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 auto;
  min-width: 280px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.btn-primary:hover:not(:disabled) {
  background: #4f46e5;
  transform: translateY(-2px);
}

.btn-primary:disabled {
  background: #3a3e44;
  cursor: not-allowed;
  opacity: 0.55;
}

.results {
  width: 100%;
  max-width: 1100px;
  margin: 40px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 40px;
}

.result-card {
  background: #2C313B;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.comparison img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 8px;
}

.comparison {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 16px 0;
}

.download-btn {
  display: inline-block;
  margin-top: 16px;
  color: #6366f1;
  text-decoration: none;
  font-weight: 600;
}
.download-btn:hover {
  text-decoration: underline;
}

.footer {
  margin-top: auto;
  padding: 40px 0;
  font-size: 16px;
  opacity: 0.7;
  text-align: center;
  width: 100%;
}

input[type="file"] {
  display: none;
}

.error-card {
  padding: 80px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.error-code {
  font-size: 120px;
  line-height: 1;
  font-weight: 700;
  color: #6366f1;
  margin-bottom: 24px;
  text-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}

.error-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
}

.easter-egg {
  margin-top: 48px;
  font-size: 14px;
  opacity: 0.4;
  max-width: 500px;
}

@media (max-width: 1100px) {
  .top-header {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0;
    margin-bottom: 32px;
  }
  .powered {
    align-self: center;
    margin-top: 16px;
    margin-bottom: 0;
  }
  .logo-and-title {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  .card {
    padding: 50px 30px;
  }
  .main-title {
    white-space: normal;
  }
  
  .error-code {
    font-size: 80px;
  }
  .error-title {
    font-size: 20px;
  }
}